update minecart direction values in movement tile section

This commit is contained in:
scawful
2024-05-22 20:18:17 -04:00
parent f92f2d2b2e
commit 45ac08bd3c

View File

@@ -540,7 +540,6 @@ HandleTileDirections:
TAY ; Transfer to Y to use as an offset for the rows TAY ; Transfer to Y to use as an offset for the rows
LDA.w .DirectionTileLookup, Y : TAY LDA.w .DirectionTileLookup, Y : TAY
JSR ClampSpritePositionToGrid
CPY #$01 : BEQ .move_north CPY #$01 : BEQ .move_north
CPY #$02 : BEQ .move_east CPY #$02 : BEQ .move_east
CPY #$03 : BEQ .move_south CPY #$03 : BEQ .move_south
@@ -548,23 +547,24 @@ HandleTileDirections:
JMP .done JMP .done
.move_north .move_north
LDA #$00 : STA SprSubtype, X LDA #$00 : STA SprSubtype, X : STA !MinecartDirection
STA !SpriteDirection, X STA !SpriteDirection, X
%GotoAction(2) ; Minecart_MoveNorth %GotoAction(2) ; Minecart_MoveNorth
RTS RTS
.move_east .move_east
LDA #$01 : STA SprSubtype, X LDA #$01 : STA SprSubtype, X : STA !MinecartDirection
STA !MinecartDirection
LDA #$03 : STA !SpriteDirection, X LDA #$03 : STA !SpriteDirection, X
LDA SprY, X : SEC : SBC.b #$04 : STA SprY, X LDA SprY, X : SEC : SBC.b #$04 : STA SprY, X
%GotoAction(3) ; Minecart_MoveEast %GotoAction(3) ; Minecart_MoveEast
RTS RTS
.move_south .move_south
LDA #$02 : STA SprSubtype, X LDA #$02 : STA SprSubtype, X : STA !MinecartDirection
LDA #$01 : STA !SpriteDirection, X LDA #$01 : STA !SpriteDirection, X
%GotoAction(4) ; Minecart_MoveSouth %GotoAction(4) ; Minecart_MoveSouth
RTS RTS
.move_west .move_west
LDA #$03 : STA SprSubtype, X LDA #$03 : STA SprSubtype, X : STA !MinecartDirection
LDA #$02 : STA !SpriteDirection, X LDA #$02 : STA !SpriteDirection, X
LDA SprY, X : SEC : SBC.b #$04 : STA SprY, X LDA SprY, X : SEC : SBC.b #$04 : STA SprY, X
%GotoAction(5) ; Minecart_MoveWest %GotoAction(5) ; Minecart_MoveWest