Skip to content

Commit

Permalink
[DOS] init code missed these variables after they had moved (X16Commu…
Browse files Browse the repository at this point in the history
  • Loading branch information
mooinglemur authored Oct 6, 2023
1 parent 128f2cd commit 6f9fb36
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
7 changes: 7 additions & 0 deletions dos/declare.s
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
.export fat32_dirent
.export fat32_readonly
.export skip_mask
.export shared_vars
.export shared_vars_len


.include "../fat32/lib.inc"

.segment "BSS"


shared_vars:

; API arguments and return data, shared from DOS into FAT32
; but used primarily by FAT32
fat32_dirent: .tag dirent ; Buffer containing decoded directory entry
Expand All @@ -18,3 +23,5 @@ fat32_readonly: .byte 0 ; User-accessible read-only flag

skip_mask:
.byte 0

shared_vars_len = * - shared_vars
17 changes: 16 additions & 1 deletion dos/main.s
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
.export dos_secnd, dos_tksa, dos_acptr, dos_ciout, dos_untlk, dos_unlsn, dos_listn, dos_talk, dos_macptr
.export dos_set_time

; from declare.s, so that state can be cleared
.import shared_vars, shared_vars_len

.include "file.inc"

Expand Down Expand Up @@ -163,7 +165,20 @@ reset_dos:
stz buffer_overflow
stz buffer_len
stz disk_changed
stz skip_mask

.assert >shared_vars_len = 1, error, "dos/fat32 shared var size doesn't match assumed size (two total pages)"
.assert <shared_vars_len > 0, error, "dos/fat32 shared var size doesn't match assumed size (not a page boundary)"


ldx #<shared_vars_len
: stz shared_vars+$ff,x
dex
bne :-

ldx #0
: stz shared_vars,x
inx
bne :-

fat32_call fat32_init

Expand Down

0 comments on commit 6f9fb36

Please sign in to comment.