aboutsummaryrefslogtreecommitdiff
path: root/lib/cpcrslib/cpc_PutSprite.s
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2021-05-03 08:21:10 +0100
committerJuan J. Martinez <jjm@usebox.net>2021-05-03 10:00:00 +0100
commitc3b0fa04a663fe233765b83d3be41a42aa08c25d (patch)
tree0befda349001ef6ce306b39378f9c70ad917363e /lib/cpcrslib/cpc_PutSprite.s
downloadreturn-of-traxtor-cpc-c3b0fa04a663fe233765b83d3be41a42aa08c25d.tar.gz
return-of-traxtor-cpc-c3b0fa04a663fe233765b83d3be41a42aa08c25d.zip
Initial import for public releaseHEADmain
Diffstat (limited to 'lib/cpcrslib/cpc_PutSprite.s')
-rw-r--r--lib/cpcrslib/cpc_PutSprite.s108
1 files changed, 108 insertions, 0 deletions
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
+