mirror of
https://github.com/a2-4am/4cade.git
synced 2024-09-27 12:57:21 +00:00
fix Reenter race-condition and mini-attract off-by-one
This commit is contained in:
parent
92aefda47f
commit
f287cc4d98
12
src/4cade.a
12
src/4cade.a
@ -78,15 +78,15 @@ RestoreStackNextTime
|
|||||||
; reset to branch so we don't try to
|
; reset to branch so we don't try to
|
||||||
sta RestoreStackNextTime + 1
|
sta RestoreStackNextTime + 1
|
||||||
; restore the same stack twice
|
; restore the same stack twice
|
||||||
ldx #-gStackSize
|
STACKPTR
|
||||||
- lda STACKBASE - $FE + gStackSize,x
|
ldx #$D1 ; SMC, restore stack pointer
|
||||||
|
txs
|
||||||
|
inx
|
||||||
|
- lda STACKBASE - $100 + gStackSize,x
|
||||||
; restore stack
|
; restore stack
|
||||||
sta $100,x
|
sta $100,x
|
||||||
inx
|
inx
|
||||||
bne -
|
bne -
|
||||||
STACKPTR
|
|
||||||
ldx #$D1 ; SMC, restore stack pointer
|
|
||||||
txs
|
|
||||||
SwitchToBank1
|
SwitchToBank1
|
||||||
+READ_RAM1_WRITE_RAM1
|
+READ_RAM1_WRITE_RAM1
|
||||||
rts
|
rts
|
||||||
@ -177,7 +177,7 @@ COPYSRC = *
|
|||||||
!source "src/glue.launch.lc2.a"
|
!source "src/glue.launch.lc2.a"
|
||||||
!source "src/hw.accel.lc2.a"
|
!source "src/hw.accel.lc2.a"
|
||||||
STACKBASE = *
|
STACKBASE = *
|
||||||
LCRAM2_END = STACKBASE + gStackSize
|
LCRAM2_END = STACKBASE + gStackSize - 1
|
||||||
!if LCRAM2_END >= DisableAccelerator {
|
!if LCRAM2_END >= DisableAccelerator {
|
||||||
!error "code is too large: ends at ", LCRAM2_END
|
!error "code is too large: ends at ", LCRAM2_END
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
;license:MIT
|
;license:MIT
|
||||||
;(c) 2018-9 by 4am & qkumba
|
;(c) 2018-2021 by 4am & qkumba
|
||||||
;
|
;
|
||||||
; Functions to launch games and self-running demos
|
; Functions to launch games and self-running demos
|
||||||
;
|
;
|
||||||
@ -8,18 +8,18 @@
|
|||||||
; which handle bank switching for you.
|
; which handle bank switching for you.
|
||||||
|
|
||||||
LaunchInternal
|
LaunchInternal
|
||||||
ldy #-gStackSize
|
|
||||||
- lda $100,y
|
|
||||||
sta STACKBASE - $FE + gStackSize,y
|
|
||||||
; back up stack
|
|
||||||
iny
|
|
||||||
bne -
|
|
||||||
tsx ; back up stack pointer
|
tsx ; back up stack pointer
|
||||||
stx STACKPTR + 1
|
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
|
; tell |Reenter| to restore the stack and stack pointer
|
||||||
|
|
||||||
tya
|
txa
|
||||||
ldy #$18
|
ldy #$18
|
||||||
- sta $bf57,y
|
- sta $bf57,y
|
||||||
dey
|
dey
|
||||||
|
@ -78,10 +78,10 @@ MiniAttractMode
|
|||||||
!word -
|
!word -
|
||||||
+ !word $FDFD ; SMC
|
+ !word $FDFD ; SMC
|
||||||
jsr okvs_get_current
|
jsr okvs_get_current
|
||||||
sty $1FFB
|
sty $1FFA
|
||||||
ldy #4
|
ldy #4
|
||||||
- lda (PTR), y
|
- lda (PTR), y
|
||||||
sta $1FFC, y
|
sta $1FFB, y
|
||||||
dey
|
dey
|
||||||
bpl -
|
bpl -
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ MiniAttractMode
|
|||||||
jsr LoadIndexedFile
|
jsr LoadIndexedFile
|
||||||
!word kAttractModeFulFile
|
!word kAttractModeFulFile
|
||||||
- !word $6000
|
- !word $6000
|
||||||
!word $1FFB
|
!word $1FFA
|
||||||
|
|
||||||
+LDADDR -
|
+LDADDR -
|
||||||
jsr okvs_len
|
jsr okvs_len
|
||||||
|
Loading…
Reference in New Issue
Block a user