mirror of
https://github.com/a2-4am/pitch-dark.git
synced 2025-03-20 02:29:46 +00:00
bugfix in painting long version string, other minor improvements and named constants
This commit is contained in:
parent
979cfc8635
commit
5fc1c1c76d
@ -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
|
||||
|
@ -1,8 +1,3 @@
|
||||
gKeyLen = $3F00
|
||||
gKey = $3F01
|
||||
gValLen = $3F80
|
||||
gVal = $3F81
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; ParseKeyValueText
|
||||
; parse buffer with KEY=VALUE lines of text into an okvs
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -8,11 +8,6 @@
|
||||
; - AddToPath
|
||||
; - SetStartupPath
|
||||
;
|
||||
; Public variables
|
||||
; - gPathname
|
||||
;
|
||||
|
||||
gPathname = $3F00
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; ResetPath
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user