mirror of
https://github.com/a2-4am/4cade.git
synced 2024-12-24 22:31:40 +00:00
move most of Launch code to LC RAM bank 2
This commit is contained in:
parent
01f1885ea4
commit
a50b4d8a04
@ -9,7 +9,7 @@
|
||||
; D000..E5F4 - persistent data structures (per-game cheat categories,
|
||||
; gGlobalPrefsStore, gGamesListStore)
|
||||
; ...unused...
|
||||
; EC89..FFF9 - main program code
|
||||
; ECBA..FFF9 - main program code
|
||||
; FFFA..FFFF - NMI, reset, IRQ vectors
|
||||
;
|
||||
; LC RAM BANK 2
|
||||
|
@ -9,6 +9,9 @@
|
||||
; - PlayGame
|
||||
; - Launch
|
||||
;
|
||||
; Public variables:
|
||||
; - gGameToLaunch - 0-based index into gGamesListStore
|
||||
;
|
||||
|
||||
GetGameDisplayName
|
||||
; in: A/Y points to game filename
|
||||
@ -146,25 +149,4 @@ gGameToLaunch=*+1
|
||||
; execution falls through here
|
||||
Launch
|
||||
jsr SwitchToBank2
|
||||
jsr SaveOrRestoreScreenHoles ; save screen hole contents
|
||||
ldy #$F1
|
||||
- lda $100,y
|
||||
sta $DF00,y ; back up stack
|
||||
iny
|
||||
bne -
|
||||
tsx ; back up stack pointer
|
||||
stx $DFF0
|
||||
lda #$38 ; 'sec' opcode to tell |Reenter| to
|
||||
sta RestoreStackNextTime ; restore the stack and stack pointer
|
||||
|
||||
ldx #(end_promote-promote-1)
|
||||
- lda promote,x ; copy ProDOS shim to main memory
|
||||
sta $bf00,x
|
||||
dex
|
||||
bpl -
|
||||
tya
|
||||
ldy #$18
|
||||
- sta $bf57,y
|
||||
dey
|
||||
bne -
|
||||
jmp $106 ; jump to pre-launch code
|
||||
jmp LaunchInternal
|
||||
|
@ -630,3 +630,27 @@ SaveSmallFileInternal
|
||||
sta reqcmd
|
||||
sta sizelo ; non-zero
|
||||
jmp hddopendir ; exit via ProRWTS2 (must re-open the file after query)
|
||||
|
||||
LaunchInternal
|
||||
jsr SaveOrRestoreScreenHoles ; save screen hole contents
|
||||
ldy #$F1
|
||||
- lda $100,y
|
||||
sta $DF00,y ; back up stack
|
||||
iny
|
||||
bne -
|
||||
tsx ; back up stack pointer
|
||||
stx $DFF0
|
||||
lda #$38 ; 'sec' opcode to tell |Reenter| to
|
||||
sta RestoreStackNextTime ; restore the stack and stack pointer
|
||||
|
||||
ldx #(end_promote-promote-1)
|
||||
- lda promote,x ; copy ProDOS shim to main memory
|
||||
sta $bf00,x
|
||||
dex
|
||||
bpl -
|
||||
tya
|
||||
ldy #$18
|
||||
- sta $bf57,y
|
||||
dey
|
||||
bne -
|
||||
jmp $106 ; jump to pre-launch code
|
||||
|
Loading…
Reference in New Issue
Block a user