diff options
author | Juan J. Martinez <jjm@usebox.net> | 2021-05-03 08:21:10 +0100 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2021-05-03 10:00:00 +0100 |
commit | c3b0fa04a663fe233765b83d3be41a42aa08c25d (patch) | |
tree | 0befda349001ef6ce306b39378f9c70ad917363e /lib/cpcrslib/cpc_GetSp.s | |
download | return-of-traxtor-cpc-c3b0fa04a663fe233765b83d3be41a42aa08c25d.tar.gz return-of-traxtor-cpc-c3b0fa04a663fe233765b83d3be41a42aa08c25d.zip |
Diffstat (limited to 'lib/cpcrslib/cpc_GetSp.s')
-rw-r--r-- | lib/cpcrslib/cpc_GetSp.s | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/lib/cpcrslib/cpc_GetSp.s b/lib/cpcrslib/cpc_GetSp.s new file mode 100644 index 0000000..cb19efc --- /dev/null +++ b/lib/cpcrslib/cpc_GetSp.s @@ -0,0 +1,49 @@ +.globl _cpc_GetSp + +_cpc_GetSp:: + + LD IX,#2 + ADD IX,SP + LD E,0 (IX) + LD D,1 (IX) + LD A,3 (IX) + LD L,4 (IX) + LD H,5 (IX) + + + + LD (#loop_alto_2x_GetSp0+1),A + + + SUB #1 + CPL + LD (#salto_lineax_GetSp0+1),A ;comparten los 2 los mismos valores. + + LD A,2 (IX) + ;JP cpc_GetSp0 + +cpc_GetSp0:: + .DB #0XFD + LD H,A ;ALTO, SE PUEDE TRABAJAR CON HX DIRECTAMENTE + LD B,#7 +loop_alto_2x_GetSp0: + LD C,#0 +loop_ancho_2x_GetSp0: + LD A,(HL) + LD (DE),A + INC DE + INC HL + DEC C + JP NZ,loop_ancho_2x_GetSp0 + .DB #0XFD + DEC H + RET Z +salto_lineax_GetSp0: + LD C,#0XFF ;salto linea menos ancho + ADD HL,BC + JP NC,loop_alto_2x_GetSp0 ;sig_linea_2zz ;si no desborda va a la siguiente linea + LD BC,#0XC050 + ADD HL,BC + LD B,#7 ;sólo se daría una de cada 8 veces en un sprite + JP loop_alto_2x_GetSp0 + |