use kGlobalPrefsBuffer for writing data stored at kGlobalPrefsBuffer, because otherwise things go poorly

This commit is contained in:
4am 2021-11-09 23:21:01 -05:00
parent 7afebf6b04
commit 4f6688cba1
2 changed files with 3 additions and 4 deletions

View File

@ -69,7 +69,7 @@ SaveSmallFileInternal
;jsr hddopendir ; call ProRWTS2 ;jsr hddopendir ; call ProRWTS2
;lda ldrlo2 ;lda ldrlo2
sta ldrlo sta ldrlo
lda #$80 ;lda ldrhi2 lda #>kGlobalPrefsBuffer ;lda ldrhi2
sta ldrhi sta ldrhi
lda #cmdwrite ; write (instead of read) lda #cmdwrite ; write (instead of read)
sta reqcmd sta reqcmd

View File

@ -15,7 +15,7 @@
; - kCheat ; - kCheat
; ;
kGlobalPrefsBuffer = $BD00 kGlobalPrefsBuffer = $BD00 ; [512 bytes] must be page-aligned
; valid pref keys ; valid pref keys
kNextAttract kNextAttract
@ -217,13 +217,13 @@ pref_set
+LDADDR kGlobalPrefsFilename ; write prefs buffer to file on disk +LDADDR kGlobalPrefsFilename ; write prefs buffer to file on disk
jsr SetPath jsr SetPath
;; +LDADDR kGlobalPrefsBuffer
; /!\ execution falls through here to glue.prorwts/SaveSmallFile ; /!\ execution falls through here to glue.prorwts/SaveSmallFile
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; SaveSmallFile ; SaveSmallFile
; Save a file into memory all at once, using ProRWTS2. ; Save a file into memory all at once, using ProRWTS2.
; /!\ Only first block (512 bytes) is written. Keep those files small. /!\ ; /!\ Only first block (512 bytes) is written. Keep those files small. /!\
; /!\ All 512 bytes are written to disk. Clear buffer before calling. /!\ ; /!\ All 512 bytes are written to disk. Clear buffer before calling. /!\
; /!\ Address is hardcoded to kGlobalPrefsBuffer /!\
; ;
; supports paths, see note ; supports paths, see note
; ;
@ -233,7 +233,6 @@ pref_set
; all registers clobbered ; all registers clobbered
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
SaveSmallFile SaveSmallFile
;; +ST16 ldrlo ; set data buffer address for ProRWTS2
jsr SwitchToBank2 jsr SwitchToBank2
jsr SaveSmallFileInternal jsr SaveSmallFileInternal
jmp SwitchToBank1 jmp SwitchToBank1