From c3b0fa04a663fe233765b83d3be41a42aa08c25d Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Mon, 3 May 2021 08:21:10 +0100 Subject: Initial import for public release --- lib/cpcrslib/cpc_PutSprite.s | 108 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 lib/cpcrslib/cpc_PutSprite.s (limited to 'lib/cpcrslib/cpc_PutSprite.s') diff --git a/lib/cpcrslib/cpc_PutSprite.s b/lib/cpcrslib/cpc_PutSprite.s new file mode 100644 index 0000000..a6d6dec --- /dev/null +++ b/lib/cpcrslib/cpc_PutSprite.s @@ -0,0 +1,108 @@ +.globl _cpc_PutSprite + +_cpc_PutSprite:: +;************************************* +; SPRITE ROUTINE WITHOUT TRANSPARENCY +; Supplied by Tim Riemann +; from a German forum +; DE = source address of the sprite +; (includes header with 1B width [64byte maximum!], 1B height) +; HL = destination address +;************************************* + + POP AF + POP HL ;DESTINATION ADDRESS + POP DE ;SPRITE DATA + PUSH AF + ;EX DE,HL + LD A,#64 + SUB (HL) + ADD A + LD (width1+1),A + XOR A + SUB (HL) + LD (width2+1),A + INC HL + LD A,(HL) + INC HL +width0: + ;ex de,hl +width1: + JR width1 ;cada LDI es un byte + LDI ;se hace el salto al byte correspondiente (64-ancho) + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI + LDI +width2: + LD BC,#0X700 + EX DE,HL + ADD HL,BC + JP NC,width3 + LD BC,#0XC050 + ADD HL,BC +width3: + EX DE,HL + DEC A + JP NZ, width1 + RET + -- cgit v1.2.3