mirror of
https://github.com/a2-4am/4cade.git
synced 2024-09-13 14:56:27 +00:00
28 lines
860 B
Plaintext
28 lines
860 B
Plaintext
;license:MIT
|
|
;(c) 2018-2021 by 4am & qkumba
|
|
;
|
|
; Functions to launch games and self-running demos
|
|
;
|
|
; /!\ These live in LC RAM 2 and rely on the ProRWTS code which is also in LC RAM 2. /!\
|
|
; Code in LC RAM 1 (which is most program code) should call the functions in glue.launch
|
|
; which handle bank switching for you.
|
|
|
|
LaunchInternal
|
|
tsx ; back up stack pointer
|
|
stx STACKPTR + 1
|
|
inx
|
|
- pla
|
|
sta STACKBASE - $100 + gStackSize,x
|
|
; back up stack
|
|
inx
|
|
bne -
|
|
stx RestoreStackNextTime + 1
|
|
; tell |Reenter| to restore the stack and stack pointer
|
|
|
|
txa
|
|
ldy #$18
|
|
- sta $bf57,y
|
|
dey
|
|
bne -
|
|
jmp $106 ; jump to pre-launch code
|