mirror of
https://github.com/a2-4am/pitch-dark.git
synced 2024-09-29 17:55:56 +00:00
minor refactor
This commit is contained in:
parent
fc73f51afe
commit
2b9c727e54
@ -43,26 +43,22 @@ ClearInterpreterOptions
|
|||||||
bpl -
|
bpl -
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
LaunchInterpreterWithNewGame
|
||||||
|
lda #$FF
|
||||||
|
; execution falls through here
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
; LaunchInterpreterWithNewGame
|
; LaunchInterpreterWithGame
|
||||||
; load interpreter and launch it with a game based on global preferences store
|
; load interpreter and launch it with a game based on global preferences store,
|
||||||
;
|
; and tell it to restore from a specific saved game slot
|
||||||
|
; in: A = saved game slot, or #$FF for none
|
||||||
; in: current ProDOS prefix is the same as the PITCH.DARK file
|
; in: current ProDOS prefix is the same as the PITCH.DARK file
|
||||||
; out: returns with C set if interpreter could not be loaded or game
|
; out: returns with C set if interpreter could not be loaded or game
|
||||||
; directory could not be found
|
; directory could not be found
|
||||||
; otherwise does not return (calls ExitWeeGUI and jumps to interpreter)
|
; otherwise does not return (calls ExitWeeGUI and jumps to interpreter)
|
||||||
; gPathname clobbered
|
; gPathname clobbered
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
LaunchInterpreterWithNewGame
|
LaunchInterpreterWithGame
|
||||||
lda #$FF
|
sta kOnBeyondAutoRestore
|
||||||
; execution falls through here
|
|
||||||
;------------------------------------------------------------------------------
|
|
||||||
; LaunchInterpreterWithSavedGame
|
|
||||||
; load interpreter and launch it with a game based on global preferences store,
|
|
||||||
; and tell it to restore from a specific saved game slot
|
|
||||||
; in: A = saved game slot, or #$FF for none
|
|
||||||
LaunchInterpreterWithSavedGame
|
|
||||||
sta iRestoreSlot
|
|
||||||
jsr SaveGlobalPreferences
|
jsr SaveGlobalPreferences
|
||||||
jsr LoadInterpreter
|
jsr LoadInterpreter
|
||||||
bcs .launchError
|
bcs .launchError
|
||||||
@ -85,7 +81,7 @@ LaunchInterpreterWithSavedGame
|
|||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
LaunchInterpreterWithHints
|
LaunchInterpreterWithHints
|
||||||
lda #$FF
|
lda #$FF
|
||||||
sta iRestoreSlot ; no saved game to restore
|
sta kOnBeyondAutoRestore ; no saved game to restore
|
||||||
jsr SaveGlobalPreferences
|
jsr SaveGlobalPreferences
|
||||||
jsr LoadInterpreter
|
jsr LoadInterpreter
|
||||||
bcs .launchError
|
bcs .launchError
|
||||||
@ -115,7 +111,7 @@ LaunchInterpreterWithHints
|
|||||||
; SetInterpreterOptions
|
; SetInterpreterOptions
|
||||||
; set options struct based on global preferences store
|
; set options struct based on global preferences store
|
||||||
;
|
;
|
||||||
; in: none
|
; in: kOnBeyondAutoRestore already set (save slot 0-7, or #$FF if none)
|
||||||
; out: all registers and flags clobbered
|
; out: all registers and flags clobbered
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
SetInterpreterOptions
|
SetInterpreterOptions
|
||||||
@ -150,10 +146,6 @@ SetInterpreterOptionsExceptForce40
|
|||||||
+ lda #1
|
+ lda #1
|
||||||
sta kOnBeyondCase
|
sta kOnBeyondCase
|
||||||
|
|
||||||
iRestoreSlot=*+1
|
|
||||||
lda #$FD ; SMC
|
|
||||||
sta kOnBeyondAutoRestore
|
|
||||||
|
|
||||||
jsr okvs_get
|
jsr okvs_get
|
||||||
!word gGlobalPrefsStore
|
!word gGlobalPrefsStore
|
||||||
!word kScriptToFile
|
!word kScriptToFile
|
||||||
@ -180,7 +172,7 @@ iRestoreSlot=*+1
|
|||||||
lda #$A5
|
lda #$A5
|
||||||
eor kOnBeyondColumns
|
eor kOnBeyondColumns
|
||||||
eor kOnBeyondCase
|
eor kOnBeyondCase
|
||||||
eor kOnBeyondAutoRestore
|
eor kOnBeyondAutoRestore ; caller must have set this already
|
||||||
eor kOnBeyondScriptToFile
|
eor kOnBeyondScriptToFile
|
||||||
eor kOnBeyondAutoScript
|
eor kOnBeyondAutoScript
|
||||||
eor kOnBeyondWarnMissing
|
eor kOnBeyondWarnMissing
|
||||||
|
@ -227,7 +227,7 @@ callback_resume_ok
|
|||||||
bne +
|
bne +
|
||||||
lda #0
|
lda #0
|
||||||
+ dec ; A = saved game slot (which is WeeGUI view ID - 1) or #$FF
|
+ dec ; A = saved game slot (which is WeeGUI view ID - 1) or #$FF
|
||||||
jmp LaunchInterpreterWithSavedGame
|
jmp LaunchInterpreterWithGame
|
||||||
|
|
||||||
callback_resume_cancel = MainScreen
|
callback_resume_cancel = MainScreen
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user