Skip to content

Commit 2043d1d

Browse files
committed
Multiple drives version
1 parent e28e3ce commit 2043d1d

File tree

4 files changed

+24
-20
lines changed

4 files changed

+24
-20
lines changed

bin/cpm.bin

-224 Bytes
Binary file not shown.

bootstrap/crt.inc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111
_start:
1212
push ix
1313
push iy
14+
15+
; ld a, mos_sysvars
16+
; rst.lil $08
17+
18+
; xor a
19+
; ld (ix+$28), a
20+
1421
call _main
1522
pop iy
1623
pop ix

bootstrap/drive_emu.inc

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -85,34 +85,26 @@ f_handle: db 0
8585
_drive_change:
8686
add a, 'a'
8787
ld (drive_letter), a
88+
8889
xor a
8990
ld mb, a
9091

91-
ld a, (f_handle)
92+
ld c, 0
9293
MOSCALL mos_fclose
9394

9495
ld hl, drive
9596
ld c, fa_read+fa_write
9697
MOSCALL mos_fopen
9798

98-
ld (f_handle), a
99-
or a
100-
jr z, _dr_change_err
99+
ld c, a
101100

102-
push af
103101
ld a, CPM_SEG
104102
ld mb, a
105-
pop af
106-
ret.lil
103+
ld a, c
107104

108-
_dr_change_err:
109-
xor a
110-
call.lil _drive_change
111-
112-
ld a, CPM_SEG
113-
ld mb, a
114-
xor a
115-
ret.lil
105+
ld (f_handle), a
106+
or a
107+
ret.lil
116108

117109
fs_init:
118110
ld c, 0
@@ -123,6 +115,12 @@ fs_init:
123115
MOSCALL mos_fopen
124116
ld (f_handle), a
125117
or a
118+
push af
119+
MOSCALL mos_sysvars
120+
xor a
121+
ld (ix+$28), a
122+
ld ix, (sys_ix)
123+
pop af
126124
ret
127125

128126
fs_seek:
@@ -148,6 +146,7 @@ fs_read:
148146
ld hl, (_dma)
149147

150148
MOSCALL mos_fread
149+
151150
ret
152151

153152
fs_write:
@@ -157,3 +156,5 @@ fs_write:
157156
ld hl, (_dma)
158157
MOSCALL mos_fwrite
159158
ret
159+
160+

sources/bios/bios.asm

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,6 @@ seldisk:
175175

176176
sp_save: dw 0
177177

178-
ds $ff
179-
stack = $ - 1
180-
181-
182178

183179
all00: ds 128
184180
all01: ds 128
@@ -196,7 +192,7 @@ all12: ds 128
196192
all13: ds 128
197193
all14: ds 128
198194
all15: ds 128
199-
200195
dirbf: ds 128
201196

197+
stack = $ffff
202198
DISPLAY "BIOS END: ", $

0 commit comments

Comments
 (0)