cleanup new sprite table

This commit is contained in:
scawful
2024-07-01 23:14:54 -04:00
parent 55c23e6844
commit 3919a0dc7b

View File

@@ -11,69 +11,76 @@ RTS
pullpc pullpc
SpriteActiveExp_MainLong: SpriteActiveExp_MainLong:
{ {
PHB : PHK : PLB PHB : PHK : PLB
JSL NewSprTable JSL NewSprTable
PLB PLB
RTL RTL
} }
NewSprTable: NewSprTable:
LDA $0E20, X ; Load Sprite ID {
REP #$30 LDA $0E20, X ; Load Sprite ID
AND.w #$00FF REP #$30
STA $06 AND.w #$00FF
ASL A ; *2 STA $06
CLC : ADC $06 ; *3 ASL A ; *2
TAY CLC : ADC $06 ; *3
TAY
LDA NewSprRoutinesLong, Y ; Load sprite Address LDA NewSprRoutinesLong, Y ; Load sprite Address
STA $06 STA $06
SEP #$20 ; Previously SEP #$30 -_- (that's fine for sprites below ~0x40 over that it will crash) SEP #$20 ; Previously SEP #$30 -_- (that's fine for sprites below ~0x40 over that it will crash)
LDA NewSprRoutinesLong+2, Y LDA NewSprRoutinesLong+2, Y
STA $08 STA $08
SEP #$30 SEP #$30
JMP [$0006] JMP [$0006]
;do a JML and sprite will RTL back to previous code ;do a JML and sprite will RTL back to previous code
}
Sprite_PrepExp_Long: Sprite_PrepExp_Long:
{ {
PHB : PHK : PLB PHB : PHK : PLB
JSL NewSprPrepTable JSL NewSprPrepTable
PLB PLB
RTL RTL
} }
NewSprPrepTable: NewSprPrepTable:
LDA $0E20, X ; Load Sprite ID {
REP #$30 LDA $0E20, X ; Load Sprite ID
AND.w #$00FF REP #$30
STA $06 AND.w #$00FF
ASL A ; *2 STA $06
CLC : ADC $06 ; *3 ASL A ; *2
TAY CLC : ADC $06 ; *3
TAY
LDA NewSprPrepRoutinesLong, Y ; Load sprite Address LDA NewSprPrepRoutinesLong, Y ; Load sprite Address
STA $06 STA $06
SEP #$20 ; Previously SEP #$30 -_- (that's fine for sprites below ~0x40 over that it will crash) 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 STA $08
SEP #$30 SEP #$30
JMP [$0006] JMP [$0006]
}
NewSprRoutinesLong: NewSprRoutinesLong:
fillbyte $00 {
fill $2FD fillbyte $00
fill $2FD
}
NewSprPrepRoutinesLong: NewSprPrepRoutinesLong:
fillbyte $00 {
fill $2FD fillbyte $00
fill $2FD
}