summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo C2016-08-03 23:19:28 +0200
committerLeo C2016-08-03 23:19:28 +0200
commit990f66ca70c01178f95bac31a2c039c4082b1fb6 (patch)
treea28c9aff7aea7a50e6aee577a6338e592f8bf477
parent15f6bf953151a63b21a16c6037a3633fb3235587 (diff)
downloadddt180-990f66ca70c01178f95bac31a2c039c4082b1fb6.zip
Sync with master
-rw-r--r--ddtz.z80122
1 files changed, 65 insertions, 57 deletions
diff --git a/ddtz.z80 b/ddtz.z80
index 3604007..706a973 100644
--- a/ddtz.z80
+++ b/ddtz.z80
@@ -282,7 +282,7 @@ get_line:
ld de,conbuf+1 ;015a 11 6b 00 . k .
ld a,(de) ;015d 1a .
ld b,a ;015e 47 G
- ld c,000h ;015f 0e 00 . .
+ ld c,0 ;015f 0e 00 . .
inc b ;0161 04 .
l0162h:
inc de ;0162 13 .
@@ -461,6 +461,7 @@ l0242h:
ex af,af' ;0257 08 .
jr c,l022dh ;0258 38 d3 8 .
ret ;025a c9 .
+
outquote:
ld a,'''' ;025b 3e 27 > '
outchar:
@@ -498,7 +499,7 @@ l0284h:
pop hl ;0286 e1 .
ret ;0287 c9 .
pstr:
- ld c,000h ;0288 0e 00 . .
+ ld c,0 ;0288 0e 00 . .
l028ah:
ld a,(hl) ;028a 7e ~
and a ;028b a7 .
@@ -645,13 +646,15 @@ l0339h:
and a ;033a a7 .
pop bc ;033b c1 .
ret ;033c c9 .
-sub_033dh:
+
+sel_dc_string:
inc b ;033d 04 .
l033eh:
dec b ;033e 05 .
ret z ;033f c8 .
call sub_0345h ;0340 cd 45 03 . E .
jr l033eh ;0343 18 f9 . .
+
sub_0345h:
ld a,(hl) ;0345 7e ~
and a ;0346 a7 .
@@ -662,6 +665,7 @@ l0348h:
and a ;034a a7 .
ret m ;034b f8 .
jr l0348h ;034c 18 fa . .
+
sub_034eh:
call get_arg_range ;034e cd 7d 03 . } .
push hl ;0351 e5 .
@@ -853,8 +857,8 @@ l0433h:
push bc ;0437 c5 .
call do_factor ;0438 cd e4 04 . . .
pop bc ;043b c1 .
- ex de,hl ;043c eb .
- ex (sp),hl ;043d e3 .
+ ex de,hl ;043c eb .
+ ex (sp),hl ;043d e3 .
jr nc,l0447h ;043e 30 07 0 .
pop de ;0440 d1 .
ld a,b ;0441 78 x
@@ -1989,7 +1993,7 @@ cmd_X:
jp z,ERROR ;0c08 ca 07 01 . . .
ex de,hl ;0c0b eb .
ld hl,b_0cc3_start ;0c0c 21 c3 0c ! . .
- call sub_033dh ;0c0f cd 3d 03 . = .
+ call sel_dc_string ;0c0f cd 3d 03 . = .
l0c12h:
call l0c33h ;0c12 cd 33 0c . 3 .
l0c15h:
@@ -4429,15 +4433,15 @@ b_1ad1_start:
db 0f8h,0b8h,013h ;
dw l1e30h
db 0c7h,0c0h,08bh ;ret cc
- dw l1e9dh
+ dw prnt_arg_cc
db 0c7h,0c7h,0b4h ;rst
dw l1c98h
db 0ffh,0c9h,08bh ;ret
dw l1c97h
db 0cfh,0c1h,081h ;pop rr
- dw l1e86h
+ dw prnt_arg_zz
db 0cfh,0c5h,084h ;push rr
- dw l1e86h
+ dw prnt_arg_zz
db 0ffh,0e3h,034h ;ex (sp),hl
dw l1ca0h
db 0ffh,0e9h,052h ;jp (hl)
@@ -4447,9 +4451,9 @@ b_1ad1_start:
db 0ffh,0f9h,056h ;ld sp,hl
dw l1cc1h
db 0cfh,003h,041h ;inc rr
- dw l1e8bh
+ dw prnt_arg_ww
db 0cfh,00bh,029h ;dec rr
- dw l1e8bh
+ dw prnt_arg_ww
db 0c7h,004h,041h ;inc r
dw l1e28h
db 0c7h,005h,029h ;dec r
@@ -4545,15 +4549,15 @@ b_1bc9_start:
db 0ffh ;<end mark>
b_1bf4_start:
- db 0e7h,040h,03fh ;in r,(c) ;r=bcde
+ db 0e7h,040h,03fh ;in r,(c) ;r=b,c,d,e
dw l1db3h ;
- db 0f7h,060h,03fh ;in r,(c) ;r=hl
+ db 0f7h,060h,03fh ;in r,(c) ;r=h,l
dw l1db3h ;
db 0ffh,078h,03fh ;in r,(c) ;r=a
dw l1db3h ;
- db 0e7h,041h,076h ;out (c),r ;r=bcde
+ db 0e7h,041h,076h ;out (c),r ;r=b,c,d,e
dw l1dbfh ;
- db 0f7h,061h,076h ;out (c),r ;r=hl
+ db 0f7h,061h,076h ;out (c),r ;r=h,l
dw l1dbfh ;
db 0ffh,079h,076h ;out (c),r ;r=a
dw l1dbfh ;
@@ -4628,14 +4632,14 @@ l1c98h:
l1ca0h:
ld hl,b_1ca9_start ;1ca0 21 a9 1c ! . .
call pstr ;1ca3 cd 88 02 . . .
- jp l1e7eh ;1ca6 c3 7e 1e . ~ .
+ jp prnt_arg_hlixiy ;1ca6 c3 7e 1e . ~ .
b_1ca9_start:
DC '(SP),'
l1caeh:
ld a,'(' ;1cae 3e 28 > (
call outchar ;1cb0 cd 5d 02 . ] .
- call l1e7eh ;1cb3 cd 7e 1e . ~ .
+ call prnt_arg_hlixiy ;1cb3 cd 7e 1e . ~ .
ld a,')' ;1cb6 3e 29 > )
jp outchar ;1cb8 c3 5d 02 . ] .
l1cbbh:
@@ -4644,7 +4648,7 @@ l1cbbh:
l1cc1h:
ld hl,b_1cca_start ;1cc1 21 ca 1c ! . .
call pstr ;1cc4 cd 88 02 . . .
- jp l1e7eh ;1cc7 c3 7e 1e . ~ .
+ jp prnt_arg_hlixiy ;1cc7 c3 7e 1e . ~ .
b_1cca_start:
DC 'SP,'
@@ -4652,9 +4656,9 @@ l1ccdh:
ld hl,b_176d_start ;1ccd 21 6d 17 ! m .
jp pstr ;1cd0 c3 88 02 . . .
l1cd3h:
- call l1e7eh ;1cd3 cd 7e 1e . ~ .
+ call prnt_arg_hlixiy ;1cd3 cd 7e 1e . ~ .
call prnt_char_comma ;1cd6 cd b4 1e . . .
- jp l1e8bh ;1cd9 c3 8b 1e . . .
+ jp prnt_arg_ww ;1cd9 c3 8b 1e . . .
l1cdch:
call sub_1ce8h ;1cdc cd e8 1c . . .
call prnt_char_comma ;1cdf cd b4 1e . . .
@@ -4665,7 +4669,7 @@ l1ce5h:
sub_1ce8h:
ld a,'(' ;1ce8 3e 28 > (
call outchar ;1cea cd 5d 02 . ] .
- call l1e8bh ;1ced cd 8b 1e . . .
+ call prnt_arg_ww ;1ced cd 8b 1e . . .
ld a,')' ;1cf0 3e 29 > )
jp outchar ;1cf2 c3 5d 02 . ] .
l1cf5h:
@@ -4686,7 +4690,7 @@ l1d0ch:
l1d0fh:
ld a,(iy+000h) ;1d0f fd 7e 00 . ~ .
and 018h ;1d12 e6 18 . .
- call sub_1ea0h ;1d14 cd a0 1e . . .
+ call prnt_arg_cc0 ;1d14 cd a0 1e . . .
call prnt_char_comma ;1d17 cd b4 1e . . .
l1d1ah:
ld c,(iy+001h) ;1d1a fd 4e 01 . N .
@@ -4715,7 +4719,7 @@ prnt_char_A:
jp outchar ;1d3f c3 5d 02 . ] .
l1d42h:
- call l1e9dh ;1d42 cd 9d 1e . . .
+ call prnt_arg_cc ;1d42 cd 9d 1e . . .
call prnt_char_comma ;1d45 cd b4 1e . . .
l1d48h:
ld l,(iy+001h) ;1d48 fd 6e 01 . n .
@@ -4728,15 +4732,15 @@ sub_1d50h:
call out_hl ;1d56 cd 13 02 . . .
ret ;1d59 c9 .
l1d5ah:
- call l1e8bh ;1d5a cd 8b 1e . . .
+ call prnt_arg_ww ;1d5a cd 8b 1e . . .
call prnt_char_comma ;1d5d cd b4 1e . . .
jr l1d48h ;1d60 18 e6 . .
l1d62h:
call sub_1e13h ;1d62 cd 13 1e . . .
call prnt_char_comma ;1d65 cd b4 1e . . .
- jp l1e7eh ;1d68 c3 7e 1e . ~ .
+ jp prnt_arg_hlixiy ;1d68 c3 7e 1e . ~ .
l1d6bh:
- call l1e7eh ;1d6b cd 7e 1e . ~ .
+ call prnt_arg_hlixiy ;1d6b cd 7e 1e . ~ .
call prnt_char_comma ;1d6e cd b4 1e . . .
jp sub_1e13h ;1d71 c3 13 1e . . .
l1d74h:
@@ -4791,15 +4795,15 @@ l1dbfh:
call prnt_char_comma ;1dc5 cd b4 1e . . .
jr l1e28h ;1dc8 18 5e . ^
l1dcah:
- call l1e7eh ;1dca cd 7e 1e . ~ .
+ call prnt_arg_hlixiy ;1dca cd 7e 1e . ~ .
call prnt_char_comma ;1dcd cd b4 1e . . .
- jp l1e8bh ;1dd0 c3 8b 1e . . .
+ jp prnt_arg_ww ;1dd0 c3 8b 1e . . .
l1dd3h:
call sub_1e13h ;1dd3 cd 13 1e . . .
call prnt_char_comma ;1dd6 cd b4 1e . . .
- jp l1e8bh ;1dd9 c3 8b 1e . . .
+ jp prnt_arg_ww ;1dd9 c3 8b 1e . . .
l1ddch:
- call l1e8bh ;1ddc cd 8b 1e . . .
+ call prnt_arg_ww ;1ddc cd 8b 1e . . .
call prnt_char_comma ;1ddf cd b4 1e . . .
jr sub_1e13h ;1de2 18 2f . /
l1de4h:
@@ -4851,11 +4855,11 @@ l1e30h:
l1e33h:
and 007h ;1e33 e6 07 . .
cp 006h ;1e35 fe 06 . .
- jr nz,l1e73h ;1e37 20 3a :
+ jr nz,prnt_arg_r ;1e37 20 3a :
ld a,(isprefix_ixiy) ;1e39 3a f8 1f : . .
and a ;1e3c a7 .
ld a,006h ;1e3d 3e 06 > .
- jr z,l1e73h ;1e3f 28 32 ( 2
+ jr z,prnt_arg_r ;1e3f 28 32 ( 2
ld hl,b_1e78_start ;1e41 21 78 1e ! x .
ld a,(isprefix_ixiy) ;1e44 3a f8 1f : . .
dec a ;1e47 3d =
@@ -4879,22 +4883,24 @@ l1e6bh:
call out_hex ;1e6b cd 18 02 . . .
ld a,')' ;1e6e 3e 29 > )
jp outchar ;1e70 c3 5d 02 . ] .
-l1e73h:
+
+prnt_arg_r:
ld hl,t_BCDEHL_HL_A ;1e73 21 96 1f ! . .
- jr l1eaah ;1e76 18 32 . 2
+ jr prnt_arg ;1e76 18 32 . 2
b_1e78_start:
DC '(IX'
l1e7bh:
DC '(IY'
-l1e7eh:
+
+prnt_arg_hlixiy:
ld a,(isprefix_ixiy) ;1e7e 3a f8 1f : . .
ld hl,t_HL.IX.IY ;1e81 21 c6 1f ! . .
- jr l1eaah ;1e84 18 24 . $
-l1e86h:
+ jr prnt_arg ;1e84 18 24 . $
+prnt_arg_zz:
ld hl,t_BC.DE.HL.AF ;1e86 21 ab 1f ! . .
jr l1e8eh ;1e89 18 03 . .
-l1e8bh:
+prnt_arg_ww:
ld hl,t_BC.DE.HL.SP ;1e8b 21 a2 1f ! . .
l1e8eh:
ld a,(iy+000h) ;1e8e fd 7e 00 . ~ .
@@ -4904,11 +4910,12 @@ l1e8eh:
rra ;1e94 1f .
and 003h ;1e95 e6 03 . .
cp 002h ;1e97 fe 02 . .
- jr z,l1e7eh ;1e99 28 e3 ( .
- jr l1eaah ;1e9b 18 0d . .
-l1e9dh:
+ jr z,prnt_arg_hlixiy ;1e99 28 e3 ( .
+ jr prnt_arg ;1e9b 18 0d . .
+
+prnt_arg_cc:
ld a,(iy+000h) ;1e9d fd 7e 00 . ~ .
-sub_1ea0h:
+prnt_arg_cc0:
rra ;1ea0 1f .
rra ;1ea1 1f .
rra ;1ea2 1f .
@@ -4916,8 +4923,9 @@ sub_1ea0h:
ld hl,t_tstfl_ZCPS ;1ea5 21 dc 1f ! . .
jr l1eaah ;1ea8 18 00 . .
l1eaah:
+prnt_arg:
ld b,a ;1eaa 47 G
- call sub_033dh ;1eab cd 3d 03 . = .
+ call sel_dc_string ;1eab cd 3d 03 . = .
jp pstr ;1eae c3 88 02 . . .
prnt_A_comma:
@@ -5130,35 +5138,35 @@ l2037h:
ret ;2038 c9 .
b_2039_start:
- db 0ffh,0ddh,000h
+ db 0ffh,0ddh,000h ;Prefix DD
dw l20a7h
- db 0ffh,0fdh,000h
+ db 0ffh,0fdh,000h ;Prefix FD
dw l20ach
- db 0ffh,0edh,000h
+ db 0ffh,0edh,000h ;Prefix ED
dw l20b8h
b_2048_start:
- db 0ffh,0cdh,000h
+ db 0ffh,0cdh,000h ;call mn
dw l2080h
- db 0ffh,0c3h,000h
+ db 0ffh,0c3h,000h ;jp mn
dw l208bh
- db 0ffh,0e9h,000h
+ db 0ffh,0e9h,000h ;jp ()
dw l20a2h
- db 0ffh,0c9h,000h
+ db 0ffh,0c9h,000h ;ret
dw l20dch
- db 0ffh,0cfh,000h
+ db 0ffh,0cfh,000h ;rst 8
dw l2115h
- db 0c7h,0c7h,000h
+ db 0c7h,0c7h,000h ;
dw l20f9h
- db 0c7h,0c4h,000h
+ db 0c7h,0c4h,000h ;
dw l2080h
- db 0f7h,010h,000h
+ db 0f7h,010h,000h ;
dw l2093h
- db 0e7h,020h,000h
+ db 0e7h,020h,000h ;
dw l2093h
- db 0c7h,0c2h,000h
+ db 0c7h,0c2h,000h ;
dw l208bh
- db 0c7h,0c0h,000h
+ db 0c7h,0c0h,000h ;
dw l20c5h
db 0