summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo C2019-05-07 12:12:06 +0200
committerLeo C2019-05-07 12:12:06 +0200
commitc1ae5a7d955f1b8d6d80317e2d70d66d7a7f810a (patch)
treefabe7076331274ae5af5e05fa3b62374d72213fa
parent912247b304ad5352c794737272822c5ae484f3c8 (diff)
downloadddt180-c1ae5a7d955f1b8d6d80317e2d70d66d7a7f810a.zip
Refactor to save some bytes
-rw-r--r--ddt180.z80128
1 files changed, 58 insertions, 70 deletions
diff --git a/ddt180.z80 b/ddt180.z80
index 93c2ede..7464549 100644
--- a/ddt180.z80
+++ b/ddt180.z80
@@ -387,29 +387,6 @@ outchar:
pop ix
ret
-pstr_sel:
- inc b
- jr pstr_sel2
-pstr_sel1:
- call sub_0345h
-pstr_sel2:
- djnz pstr_sel1
- ;fall thru
-pstr:
- ld a,(hl)
- inc hl
- and a
- ret z
- call outchar
- ret m
- jr pstr
-
-pstr_inl:
- ex (sp),hl
- call pstr
- ex (sp),hl
- ret
-
p_goto_col:
ld a,(con_col)
cp c
@@ -2958,6 +2935,7 @@ pria_1: ;
inc hl
ld h,(hl)
ld l,a
+ ld a,(iy+000h)
call CALL_HL
pop hl
jr pria_l
@@ -3103,14 +3081,46 @@ do_arg_n:
argpf y
+p_n:
+ ld a,(isprefix_ixiy)
+ and a
+ ld a,(iy+001h)
+ jr z,out_hex_0
+ ld a,(iy+002h)
+ jr out_hex_0
+
+p_rst:
+ and 038h
+out_hex_0:
+ jp out_hex
+
+
+p_j:
+ ld c,(iy+001h)
+ ld a,c
+ rla
+ sbc a,a
+ ld b,a
+ push iy
+ pop hl
+ add hl,bc
+ inc hl
+ inc hl
+ jr out_hl_0
+
+p_nn:
+ ld l,(iy+001h)
+ ld h,(iy+002h)
+out_hl_0:
+ jp out_hl
+
p_ir:
- ld a,(iy+000h)
rra
rra
rra
and 03
ld hl,t_arg_IR
- jp p_arg
+ jr p_arg
get_cb_opc:
@@ -3131,17 +3141,13 @@ p_y:
p_rz_cb:
call get_cb_opc
- jr p_r0
+ jr p_rz
p_ry:
- ld a,(iy+000h)
rra
rra
rra
- jr p_r0
p_rz:
- ld a,(iy+000h)
-p_r0:
and 007h
cp 006h
ld b,a
@@ -3171,11 +3177,9 @@ l1e61h:
p_rp2:
ld hl,t_arg_rp2
- jr l1e8eh
+ db 0ddh ;swallow t_arg_rp in ix
p_rp:
ld hl,t_arg_rp
-l1e8eh:
- ld a,(iy+000h)
rra
rra
rra
@@ -3189,12 +3193,8 @@ p_hlixiy:
jr p_arg
p_ccy2:
- ld a,(iy+000h)
and 018h
- jr p_cc0
p_ccy:
- ld a,(iy+000h)
-p_cc0:
rra
rra
rra
@@ -3203,42 +3203,30 @@ p_cc0:
p_arg:
ld b,a
p_arg0:
- jp pstr_sel
-
-
-p_n:
- ld a,(isprefix_ixiy)
- and a
- ld a,(iy+001h)
- jr z,out_hex_0
- ld a,(iy+002h)
- jr out_hex_0
-
-p_rst:
- ld a,(iy+000h)
- and 038h
-out_hex_0:
- jp out_hex
-
+ ;fall thru
-p_j:
- ld c,(iy+001h)
- ld a,c
- rla
- sbc a,a
- ld b,a
- push iy
- pop hl
- add hl,bc
- inc hl
+pstr_sel:
+ inc b
+ jr pstr_sel2
+pstr_sel1:
+ call sub_0345h
+pstr_sel2:
+ djnz pstr_sel1
+ ;fall thru
+pstr:
+ ld a,(hl)
inc hl
- jr out_hl_0
+ and a
+ ret z
+ call outchar
+ ret m
+ jr pstr
-p_nn:
- ld l,(iy+001h)
- ld h,(iy+002h)
-out_hl_0:
- jp out_hl
+pstr_inl:
+ ex (sp),hl
+ call pstr
+ ex (sp),hl
+ ret
;-------------------------------------------------------------------------------