aboutsummaryrefslogtreecommitdiff
path: root/lib/cpcrslib/cpc_RLI.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_RLI.s
downloadreturn-of-traxtor-cpc-main.tar.gz
return-of-traxtor-cpc-main.zip
Initial import for public releaseHEADmain
Diffstat (limited to 'lib/cpcrslib/cpc_RLI.s')
-rw-r--r--lib/cpcrslib/cpc_RLI.s39
1 files changed, 39 insertions, 0 deletions
diff --git a/lib/cpcrslib/cpc_RLI.s b/lib/cpcrslib/cpc_RLI.s
new file mode 100644
index 0000000..92a9385
--- /dev/null
+++ b/lib/cpcrslib/cpc_RLI.s
@@ -0,0 +1,39 @@
+.globl _cpc_RLI ;rota las líneas que se le digan hacia la izq y mete lo rotado por la derecha.
+
+_cpc_RLI::
+ 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_RLI+1),A
+ LD A,3 (IX) ;ancho
+ LD (ancho_cpc_RLI+1),A
+ DEC HL
+alto_cpc_RLI:
+ LD A,#8 ;; parametro
+ciclo0_cpc_RLI:
+ PUSH AF
+ PUSH HL
+ INC HL
+ LD A,(HL)
+ LD D,H
+ LD E,L
+ DEC HL
+ LD B, #0
+ancho_cpc_RLI:
+ LD C,#50 ; parametro
+ LDDR
+ INC 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_RLI ;sig_linea_2zz ;si no desborda va a la siguiente linea
+ LD BC,#0XC050
+ ADD HL,BC
+ JP ciclo0_cpc_RLI
+