diff --git a/src/4cade.a b/src/4cade.a index 9cc62a58d..8c180ea1e 100644 --- a/src/4cade.a +++ b/src/4cade.a @@ -78,15 +78,15 @@ RestoreStackNextTime ; reset to branch so we don't try to sta RestoreStackNextTime + 1 ; restore the same stack twice - ldx #-gStackSize -- lda STACKBASE - $FE + gStackSize,x +STACKPTR + ldx #$D1 ; SMC, restore stack pointer + txs + inx +- lda STACKBASE - $100 + gStackSize,x ; restore stack sta $100,x inx bne - -STACKPTR - ldx #$D1 ; SMC, restore stack pointer - txs SwitchToBank1 +READ_RAM1_WRITE_RAM1 rts @@ -177,7 +177,7 @@ COPYSRC = * !source "src/glue.launch.lc2.a" !source "src/hw.accel.lc2.a" STACKBASE = * - LCRAM2_END = STACKBASE + gStackSize + LCRAM2_END = STACKBASE + gStackSize - 1 !if LCRAM2_END >= DisableAccelerator { !error "code is too large: ends at ", LCRAM2_END } diff --git a/src/glue.launch.lc2.a b/src/glue.launch.lc2.a index dd59629d2..700ff735c 100644 --- a/src/glue.launch.lc2.a +++ b/src/glue.launch.lc2.a @@ -1,5 +1,5 @@ ;license:MIT -;(c) 2018-9 by 4am & qkumba +;(c) 2018-2021 by 4am & qkumba ; ; Functions to launch games and self-running demos ; @@ -8,18 +8,18 @@ ; which handle bank switching for you. LaunchInternal - ldy #-gStackSize -- lda $100,y - sta STACKBASE - $FE + gStackSize,y - ; back up stack - iny - bne - tsx ; back up stack pointer stx STACKPTR + 1 - sty RestoreStackNextTime + 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 - tya + txa ldy #$18 - sta $bf57,y dey diff --git a/src/ui.attract.mode.a b/src/ui.attract.mode.a index 3ccc4e11b..e67063d32 100644 --- a/src/ui.attract.mode.a +++ b/src/ui.attract.mode.a @@ -78,10 +78,10 @@ MiniAttractMode !word - + !word $FDFD ; SMC jsr okvs_get_current - sty $1FFB + sty $1FFA ldy #4 - lda (PTR), y - sta $1FFC, y + sta $1FFB, y dey bpl - @@ -93,7 +93,7 @@ MiniAttractMode jsr LoadIndexedFile !word kAttractModeFulFile - !word $6000 - !word $1FFB + !word $1FFA +LDADDR - jsr okvs_len