diff --git a/src/constants.a b/src/constants.a index 44976be..639334f 100644 --- a/src/constants.a +++ b/src/constants.a @@ -4,6 +4,17 @@ ; Memory addresses and constants ; -kProDOSFileBuffer = $1C00 -kSystemAddress = $2000 -WGInit = $4000 +kInfoPaintWidth = 65 ; used by paintInfoView +kDescriptionPaintWidth = 78 ; used by paintDescriptionView + +kGameInfoBuffer = $0800 ; used by LoadGameInfo +kProDOSFileBuffer = $1C00 ; 1K buffer for ProDOS MLI calls +kSystemAddress = $2000 ; used by LaunchInterpreter +kGlobalPrefsBuffer = $2000 ; used by LoadGlobalPreferences/SaveGlobalPreferences +gPathname = $3F00 ; used by ResetPath/AddToPath +kNullTerminatedBuffer = $3F00 ; used by paintInfoView +gKeyLen = $3F00 ; used by ParseKeyValueText +gKey = $3F01 +gValLen = $3F80 +gVal = $3F81 +WGInit = $4000 ; WeeGUI file load address and initialization function diff --git a/src/parse.common.a b/src/parse.common.a index de7495f..c1e65d8 100644 --- a/src/parse.common.a +++ b/src/parse.common.a @@ -1,8 +1,3 @@ -gKeyLen = $3F00 -gKey = $3F01 -gValLen = $3F80 -gVal = $3F81 - ;------------------------------------------------------------------------------ ; ParseKeyValueText ; parse buffer with KEY=VALUE lines of text into an okvs diff --git a/src/parse.gameinfo.a b/src/parse.gameinfo.a index 3c2eee9..79c199e 100644 --- a/src/parse.gameinfo.a +++ b/src/parse.gameinfo.a @@ -52,14 +52,12 @@ LoadGameInfo jsr LoadFile !word gPathname - !word $0800 + !word kGameInfoBuffer !word kProDOSFileBuffer - lda #$FF - sta $FE - lda #$07 - sta $FF ; ($FE) points to start of data buffer - ldy #$00 ; index into ($FF) pointing to current character + +LDADDR (kGameInfoBuffer-1) + +STAY $FE ; ($FE) points to start of data buffer + ldy #$00 ; index into ($FE) pointing to current character ldx #$08 ; index into sectionPointers array, stores pointer to start of each section .convertSectionLoop diff --git a/src/parse.prefs.a b/src/parse.prefs.a index c8ac39e..14f985c 100644 --- a/src/parse.prefs.a +++ b/src/parse.prefs.a @@ -53,7 +53,7 @@ LoadGlobalPreferences jsr LoadFile ; load prefs file at $2000 !word .globalPrefsFilename -.handle !word $2000 +.handle !word kGlobalPrefsBuffer !word kProDOSFileBuffer jsr ParseKeyValueText ; parse contents into global prefs store @@ -74,9 +74,8 @@ LoadGlobalPreferences SaveGlobalPreferences lda gNeedToSavePrefs beq .exit - stz $FE - lda #$20 - sta $FF + +LDADDR kGlobalPrefsBuffer + +STAY $FE +LDADDR .fluff1 jsr addString @@ -128,14 +127,14 @@ SaveGlobalPreferences sta .filelen lda $FF sec - sbc #$20 + sbc #>kGlobalPrefsBuffer sta .filelen+1 jsr SaveFile !word .globalPrefsFilename !byte 4 ; filetype=TXT !word 0 ; auxtype=0000 - !word $2000 + !word kGlobalPrefsBuffer .filelen !word $FDFD ; SMC !word kProDOSFileBuffer diff --git a/src/path.a b/src/path.a index 02537e4..c2d04a8 100644 --- a/src/path.a +++ b/src/path.a @@ -8,11 +8,6 @@ ; - AddToPath ; - SetStartupPath ; -; Public variables -; - gPathname -; - -gPathname = $3F00 ;------------------------------------------------------------------------------ ; ResetPath diff --git a/src/ui.main.a b/src/ui.main.a index 8176981..e87ce96 100644 --- a/src/ui.main.a +++ b/src/ui.main.a @@ -129,7 +129,7 @@ paintDescriptionView lda #ID_DESCRIPTION jsr WeeGUI +LDAY addrDescription - ldx #78 + ldx #kDescriptionPaintWidth jsr multiPrint lda .vtab+1 cmp #10 @@ -143,16 +143,16 @@ paintInfoView lda #ID_INFO jsr WeeGUI +LDAY addrInfo - ldx #65 + ldx #kInfoPaintWidth phx jsr multiPrint plx lda #$A0 -- sta $3F00,x +- sta kNullTerminatedBuffer,x dex bpl - lda #$00 - sta $3F65 + sta kNullTerminatedBuffer+kInfoPaintWidth jsr okvs_get ; get shortname of current game !word gGlobalPrefsStore