aboutsummaryrefslogtreecommitdiff
path: root/lib/cpcrslib/cpc_RRI.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_RRI.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_RRI.s')
-rw-r--r--lib/cpcrslib/cpc_RRI.s39
1 files changed, 39 insertions, 0 deletions
diff --git a/lib/cpcrslib/cpc_RRI.s b/lib/cpcrslib/cpc_RRI.s
new file mode 100644
index 0000000..d2f5b5d
--- /dev/null
+++ b/lib/cpcrslib/cpc_RRI.s
@@ -0,0 +1,39 @@
+.globl _cpc_RRI
+;cpc_RRI(unsigned int pos, unsigned char w, unsigned char h);
+_cpc_RRI::
+ LD IX,#2
+ ADD IX,SP
+ LD L,0 (IX)
+ LD H,1 (IX) ;posición inicial
+ LD A,2 (IX) ;lineas
+ LD (alto_cpc_RRI+1),A
+ LD A,3 (IX) ;ancho
+ LD (ancho_cpc_RRI+1),A
+ INC HL
+alto_cpc_RRI:
+ LD A,#8 ;; parametro
+ciclo0_cpc_RRI:
+ PUSH AF
+ PUSH HL
+ DEC HL
+ LD A,(HL)
+ LD D,H
+ LD E,L
+ INC HL ; SOLO MUEVE 1 BYTE
+ LD B, #0
+ancho_cpc_RRI:
+ LD C,#50 ; PARAMETRO
+ LDIR
+ DEC HL
+ LD (HL),A
+ POP HL
+ POP AF
+ DEC A
+ RET Z
+ LD BC,#0X800 ;salto de línea, ojo salto caracter
+ ADD HL,BC
+ JP NC,ciclo0_cpc_RRI ;sig_linea_2zz ;si no desborda va a la siguiente linea
+ LD BC,#0XC050
+ ADD HL,BC
+ JP ciclo0_cpc_RRI
+