mirror of
https://github.com/a2-4am/4cade.git
synced 2024-06-01 23:41:39 +00:00
recopy reset vector code to during Reenter, because some games and demos clobber it
This commit is contained in:
parent
1abaf7c5ad
commit
986244b88b
14
src/4cade.a
14
src/4cade.a
|
@ -44,6 +44,17 @@ Reenter
|
|||
+READ_RAM2_WRITE_RAM2
|
||||
jsr CloseHandles ; close any open handles to restore ProRWTS
|
||||
jsr SaveOrRestoreScreenHoles ; restore original screen hole contents
|
||||
ldx #5
|
||||
- lda ResetVector,x ; copy reentry wrapper to bottom of stack
|
||||
sta $100,x ; (used as reset vector because ][+ always
|
||||
dex ; switches to ROM on Ctrl-Reset)
|
||||
bpl -
|
||||
inx
|
||||
stx $3F2 ; page 3 reset vector to ($100)
|
||||
inx
|
||||
stx $3F3
|
||||
ldx #$A4
|
||||
stx $3F4
|
||||
RestoreStackNextTime
|
||||
clc ; SMC
|
||||
bcc SearchMode ; not an unconditional branch because code
|
||||
|
@ -62,6 +73,9 @@ RestoreStackNextTime
|
|||
txs
|
||||
+READ_RAM1_WRITE_RAM1
|
||||
rts ; and return to caller
|
||||
ResetVector ; 6 bytes, copied to $100
|
||||
+READ_RAM1_NO_WRITE
|
||||
jmp Reenter
|
||||
|
||||
; these routines will only be called after relocating to language card
|
||||
!source "src/ui.search.mode.a"
|
||||
|
|
|
@ -245,23 +245,7 @@ OneTimeSetup
|
|||
cpy #$03
|
||||
bcc @outer
|
||||
|
||||
ldx #5
|
||||
- lda @ResetVector,x ; copy reentry wrapper to bottom of stack
|
||||
sta $100,x ; (used as reset vector because ][+ always
|
||||
dex ; switches to ROM on Ctrl-Reset)
|
||||
bpl -
|
||||
inx
|
||||
stx $3F2 ; page 3 reset vector to ($100)
|
||||
inx
|
||||
stx $3F3
|
||||
ldx #$A4
|
||||
stx $3F4
|
||||
|
||||
bit CLEARKBD
|
||||
; execution falls through here
|
||||
@ResetVector
|
||||
; main entry point into launcher (also used by self-running demos, vectors)
|
||||
+READ_RAM1_NO_WRITE
|
||||
jmp Reenter
|
||||
|
||||
@kGameListConfFile
|
||||
|
|
Loading…
Reference in New Issue
Block a user