Skip to content

Commit 12985df

Browse files
authored
Merge pull request #11 from Konamiman/fix-path-lost-on-filenamme-save
2 parents 6d943a9 + 1d7cdf5 commit 12985df

File tree

2 files changed

+99
-98
lines changed

2 files changed

+99
-98
lines changed

src/DEBUGGER.ASM

Lines changed: 42 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,10 @@ WISBREAK jp wisbreak
6262
INSERTBREAK jp insertbreak
6363
MAININSTPROG jp mainconfig
6464
SETDEBPARS jp loadconfig
65-
;was SETGETPATH: jp filenames
66-
ret
67-
ret
68-
ret
65+
SETGETPATH: jp filenames
6966
SETGETADRES jp setgetadres
7067
ABOUTPROG jp doabout
7168
REDEFCHARS jp doredefchars
72-
SETNAMEBUFFERS jp change_current_source_buffer
7369
PRINTDISKLINES jp print_disk_lines
7470

7571
wisbreak ld hl,breakbuf
@@ -101,6 +97,47 @@ loadconfig:
10197
ldir
10298
ret
10399

100+
101+
;Get or seet path and file name for a given source buffer
102+
;
103+
;Input:
104+
;A = 0 to update buffer data
105+
; <>0 to retrieve buffer data
106+
;B = buffer number
107+
;C:0 = 0 for Ascii, 1 for Asm
108+
;HL = address of path name
109+
;DE = address of file name
110+
111+
filenames:
112+
push de
113+
push hl
114+
ld de,64+11
115+
bit 0,c
116+
ld hl,filbuf_asm-(64+11)
117+
jr nz,_filenames1
118+
ld hl,filbuf_asc-(64+11)
119+
_filenames1:
120+
add hl,de
121+
djnz _filenames1
122+
ld bc,64
123+
or a
124+
jr z,_filenames2
125+
pop de
126+
ldir
127+
pop de
128+
_filenames3:
129+
ld bc,11
130+
ldir
131+
ret
132+
_filenames2:
133+
ex de,hl
134+
pop hl
135+
ldir
136+
pop hl
137+
jr _filenames3
138+
filbuf_asm: ds 4*(64+11),0
139+
filbuf_asc: ds 4*(64+11),0
140+
104141
realfkeys ds 10
105142

106143
setgetadres add a,a
@@ -5963,85 +6000,6 @@ vormen_sq db #10,#10,#10,#ff,#00,#00,#00,#00 ;17
59636000
db #00,#c0,#e0,#e0,#e0,#e0,#c0,#00 ;29
59646001

59656002

5966-
; Adjust ASM and ASCII file names in the disk menu
5967-
; when changing the current source buffer
5968-
; (moved here due to exhaustion of space in main segment)
5969-
;
5970-
; Input: E = Old source buffer number
5971-
; D = New source buffer number
5972-
; IX = Address of name_asm
5973-
5974-
change_current_source_buffer:
5975-
ld a,e
5976-
or a
5977-
ret z ;Nothing to do if no old buffer number
5978-
cp d
5979-
ret z ;Nothing to do if not actually changing the buffer number
5980-
5981-
push de
5982-
5983-
;First backup the current name_asm and name_asc
5984-
;into the appropriate entries in names_asm_for_buffers
5985-
;and names_asc_for_buffers for the old buffer.
5986-
5987-
call get_buffer_name_asm_address
5988-
push hl
5989-
ex de,hl
5990-
push ix
5991-
pop hl
5992-
ld bc,11
5993-
ldir ;HL points now to name_asc
5994-
ex de,hl
5995-
pop hl
5996-
ld bc,4*11
5997-
add hl,bc ;Entry in asc buffer = entry in asm buffer + 11*4
5998-
ex de,hl
5999-
ld bc,11
6000-
ldir
6001-
6002-
;Now set the name from the asm and asc buffers into
6003-
;the appropriate entries in names_asm_for_buffers
6004-
;and names_asc_for_buffers for the new buffer.
6005-
6006-
pop af
6007-
6008-
call get_buffer_name_asm_address
6009-
push hl
6010-
push ix
6011-
pop de
6012-
ld bc,11
6013-
ldir ;DE points now to name_asc
6014-
pop hl
6015-
ld bc,4*11
6016-
add hl,bc ;Entry in asc buffer = entry in asm buffer + 11*4
6017-
ld bc,11
6018-
ldir
6019-
ret
6020-
6021-
;Input: A = Buffer num, 1-4
6022-
;Output: HL = Address in names_asm_for_buffers
6023-
get_buffer_name_asm_address:
6024-
ld hl,names_asm_for_buffers-11
6025-
ld b,a
6026-
ld de,11
6027-
_get_buf_name_asm_address_loop:
6028-
add hl,de
6029-
djnz _get_buf_name_asm_address_loop
6030-
ret
6031-
6032-
;ASM and ASCII file names for each source buffer
6033-
names_asm_for_buffers:
6034-
db "NAME ASM"
6035-
db "NAME ASM"
6036-
db "NAME ASM"
6037-
db "NAME ASM"
6038-
names_asc_for_buffers:
6039-
db "NAME ASC"
6040-
db "NAME ASC"
6041-
db "NAME ASC"
6042-
db "NAME ASC"
6043-
6044-
60456003
;Print the disk menu frame and fixed texts
60466004
; (moved here due to exhaustion of space in main segment)
60476005

src/MAIN.ASM

Lines changed: 57 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ MAININSTPROG equ #4009 ;in debugger segment
6060
SETDEBPARS equ #400c ;in debugger segment
6161
ABOUTPROG equ #4015 ;in debugger segment
6262
REDEFCHARS equ #4018 ;in debugger segment
63-
SETNAMEBUFFERS equ #401B ;in debugger segment
64-
PRINTDISKLINES equ #401E ;in debugger segment
63+
PRINTDISKLINES equ #401B ;in debugger segment
6564

6665
;--------------------------------------------
6766
ORG #0140
@@ -287,6 +286,27 @@ fill_NAMEASM:
287286
LD DE,pathname ;pathnamebuffer
288287
LD BC,64
289288
LDIR
289+
290+
ld a,(Soort)
291+
push af
292+
ld a,1
293+
ld (Soort),a
294+
call init_asm_asc_filename_buffers
295+
ld a,2
296+
ld (Soort),a
297+
call init_asm_asc_filename_buffers
298+
pop af
299+
ld (Soort),a
300+
ret
301+
302+
init_asm_asc_filename_buffers:
303+
LD B,4
304+
nxt_name_deb:
305+
PUSH BC
306+
XOR A ;load 4 filenames+path in debugger for ASM
307+
CALL parse_nam_deb
308+
POP BC
309+
DJNZ nxt_name_deb
290310
ret
291311

292312
chk_comline LD A,(#0080) ;is there anything else on the command line?
@@ -555,14 +575,6 @@ slotmonitor equ tab_compass+4 ;ok
555575
slotdebugger equ tab_compass+6 ;ok
556576
slotsubroutin db 0,2
557577

558-
change_current_buffer:
559-
ld de,(Buffer)
560-
ld d,a
561-
ld (Buffer),a
562-
ld ix,name_asm
563-
ld bc,SETNAMEBUFFERS
564-
jp call_in_debugger
565-
566578
slotregister PUSH BC
567579
PUSH DE
568580
PUSH HL
@@ -1174,6 +1186,8 @@ set_file_type_no_sector:
11741186
ld (Soort),a
11751187
call printtype
11761188
call prtfilenaam
1189+
call jon1
1190+
call printpath
11771191
scf
11781192
ret
11791193

@@ -1231,7 +1245,7 @@ GODISKDRIVE:
12311245
ld a,b
12321246
ld (Diskasm),a
12331247
ld a,c
1234-
call change_current_buffer
1248+
ld (Buffer),a
12351249
xor a
12361250
ld (Formatdone),a
12371251
ld (doinclude),a
@@ -1434,7 +1448,7 @@ _ctrl1234 call WISKEYBUFFER
14341448
pop bc
14351449
jp c,diskhoofd
14361450
ld a,b
1437-
call change_current_buffer
1451+
ld (Buffer),a
14381452
call jon1
14391453
jp diskhoofdprt
14401454
_ctrl1234_1 push hl
@@ -2529,14 +2543,35 @@ jon1:
25292543
LD A,(Diskasm)
25302544
OR A
25312545
JR NZ,_jon12
2546+
LD A,(Soort)
2547+
CP 3
2548+
JR C,_jon11
25322549
LD HL,pathname
25332550
LD DE,pathnamebuf
25342551
LD BC,64
25352552
LDIR
25362553
RET
2537-
2554+
_jon11:
2555+
LD A,(Buffer)
2556+
LD B,A
2557+
parse_nam_deb:
2558+
ld h,a
2559+
ld a,(Soort)
2560+
ld c,a
2561+
dec a
2562+
LD DE,name_asm
2563+
jr z,parse_nam_deb_2
2564+
LD DE,name_asc
2565+
parse_nam_deb_2:
2566+
ld a,h
2567+
LD HL,pathnamebuf
2568+
PUSH HL
2569+
LD HL,#400F
2570+
JP GOTODEBUGGER
25382571
_jon12:
2539-
ld b,a
2572+
PUSH AF
2573+
CALL _jon11
2574+
POP BC
25402575
LD HL,name_com1
25412576
LD DE,11
25422577
_jon13:
@@ -2548,11 +2583,19 @@ _jon13:
25482583
LDIR
25492584
RET
25502585
jon2:
2586+
LD A,(Soort)
2587+
CP 3
2588+
JR C,_jon21
25512589
LD HL,pathnamebuf
25522590
LD DE,pathname
25532591
LD BC,64
25542592
LDIR
25552593
RET
2594+
_jon21:
2595+
LD A,(Buffer)
2596+
LD B,A
2597+
XOR A
2598+
JR parse_nam_deb
25562599

25572600
;--input pathname
25582601
inputpath:

0 commit comments

Comments
 (0)