Fix bug with Sprite_SelectNewDirection data bank long jump

This commit is contained in:
scawful
2024-11-27 13:41:02 -05:00
parent 834da79237
commit c11e112a40
3 changed files with 23 additions and 41 deletions

View File

@@ -1,24 +1,21 @@
pushpc
org $06FFF8 ; New Jumptable for sprites
NewMainSprFunction:
JSL SpriteActiveExp_MainLong
RTS
JSL SpriteActiveExp_MainLong
RTS
org $068EB9
NewSprPrepFunction:
JSL Sprite_PrepExp_Long
RTS
JSL Sprite_PrepExp_Long
RTS
pullpc
SpriteActiveExp_MainLong:
{
PHB : PHK : PLB
JSL NewSprTable
PLB
RTL
}
@@ -34,8 +31,8 @@ NewSprTable:
LDA NewSprRoutinesLong, Y ; Load sprite Address
STA $06
SEP #$20 ; Previously SEP #$30 -_- (that's fine for sprites below ~0x40 over that it will crash)
LDA NewSprRoutinesLong+2, Y
SEP #$20
LDA NewSprRoutinesLong+2, Y
STA $08
SEP #$30
JMP [$0006]
@@ -46,18 +43,15 @@ NewSprTable:
Sprite_PrepExp_Long:
{
PHB : PHK : PLB
JSL NewSprPrepTable
PLB
RTL
}
NewSprPrepTable:
{
LDA $0E20, X ; Load Sprite ID
REP #$30
REP #$30
AND.w #$00FF
STA $06
ASL A ; *2
@@ -67,7 +61,7 @@ NewSprPrepTable:
LDA NewSprPrepRoutinesLong, Y ; Load sprite Address
STA $06
SEP #$20 ; Previously SEP #$30 -_- (that's fine for sprites below ~0x40 over that it will crash)
LDA NewSprPrepRoutinesLong+2, Y
LDA NewSprPrepRoutinesLong+2, Y
STA $08
SEP #$30
JMP [$0006]