Minecart and follower stuff

This commit is contained in:
scawful
2024-11-28 11:29:00 -05:00
parent 07451bc0ca
commit 130df6b653
3 changed files with 20 additions and 26 deletions

View File

@@ -811,14 +811,14 @@ DrawMinecartFollower:
{ {
JSL $099EFC ; Follower_Initialize JSL $099EFC ; Follower_Initialize
LDX $012B LDX !MinecartDirection
LDA .direction_to_anim, X LDA .direction_to_anim, X : STA $02CF
STA $02CF
JSR FollowerDraw_CachePosition JSR FollowerDraw_CachePosition
JSR MinecartFollower_Top JSR MinecartFollower_Top
JSR MinecartFollower_Bottom JSR MinecartFollower_Bottom
; Check the current submodule in the underworld
LDA.b $11 : BNE .dont_spawn LDA.b $11 : BNE .dont_spawn
LDA !LinkInCart : BEQ .dont_spawn LDA !LinkInCart : BEQ .dont_spawn
LDA.b #$A3 LDA.b #$A3
@@ -844,7 +844,7 @@ DrawMinecartFollower:
.dont_spawn .dont_spawn
RTS RTS
.direction_to_anim .direction_to_anim
db $02, $00, $02, $00 db $02, $00, $02, $00
} }

View File

@@ -188,6 +188,7 @@ endmacro
Minecart_HandleToss: Minecart_HandleToss:
{ {
LDA.b #$30 : STA.w SprTimerA, X
; Check links facing direction $2F and apply velocity ; Check links facing direction $2F and apply velocity
LDA $2F : CMP.b #$00 : BEQ .toss_north LDA $2F : CMP.b #$00 : BEQ .toss_north
CMP.b #$02 : BEQ .toss_south CMP.b #$02 : BEQ .toss_south
@@ -470,7 +471,6 @@ HandleTileDirections:
; Fetch tile attributes based on current coordinates ; Fetch tile attributes based on current coordinates
LDA.b #$00 : JSL Sprite_GetTileAttr : LDA $0FA5 LDA.b #$00 : JSL Sprite_GetTileAttr : LDA $0FA5
CMP.b #$02 : BNE .not_out_of_bounds CMP.b #$02 : BNE .not_out_of_bounds
; If the tile is out of bounds, release the cart ; If the tile is out of bounds, release the cart
LDA #$40 : STA.w SprTimerD, X LDA #$40 : STA.w SprTimerD, X
@@ -626,38 +626,32 @@ HandleDynamicSwitchTileDirections:
CMP.b #$01 : BEQ .north_or_south CMP.b #$01 : BEQ .north_or_south
CMP.b #$02 : BEQ .east_or_west CMP.b #$02 : BEQ .east_or_west
CMP.b #$03 : BEQ .north_or_south CMP.b #$03 : BEQ .north_or_south
.no_b0 .no_b0
RTS RTS
.east_or_west .east_or_west
LDA.w SwitchRam : BNE .go_west LDA.w SwitchRam : BNE .go_west
LDA #$01 : STA.w SprSubtype, X LDA #$01 : STA.w SprSubtype, X : STA.w !MinecartDirection
STA.w !MinecartDirection LDA #$03 : STA !SpriteDirection, X
LDA #$03 : STA !SpriteDirection, X %GotoAction(3) ; Minecart_MoveEast
%GotoAction(3) ; Minecart_MoveEast RTS
RTS .go_west
LDA #$03 : STA.w SprSubtype, X : STA.w !MinecartDirection
.go_west
LDA #$03 : STA.w SprSubtype, X
STA.w !MinecartDirection
LDA #$02 : STA !SpriteDirection, X LDA #$02 : STA !SpriteDirection, X
%GotoAction(5) ; Minecart_MoveWest %GotoAction(5) ; Minecart_MoveWest
RTS RTS
.north_or_south .north_or_south
LDA.w SwitchRam : BNE .go_south LDA.w SwitchRam : BNE .go_south
LDA #$00 : STA.w SprSubtype, X LDA #$00 : STA.w SprSubtype, X : STA.w !MinecartDirection
STA.w !MinecartDirection STA !SpriteDirection, X
STA !SpriteDirection, X
%GotoAction(2) ; Minecart_MoveNorth %GotoAction(2) ; Minecart_MoveNorth
RTS RTS
.go_south .go_south
LDA #$02 : STA.w SprSubtype, X LDA #$02 : STA.w SprSubtype, X : STA.w !MinecartDirection
STA.w !MinecartDirection LDA #$01 : STA !SpriteDirection, X
LDA #$01 : STA !SpriteDirection, X %GotoAction(4) ; Minecart_MoveSouth
%GotoAction(4) ; Minecart_MoveSouth RTS
RTS
} }
; ========================================================= ; =========================================================

View File

@@ -102,7 +102,7 @@ Sprite_RotatingTrack_Main:
; 02 = BottomRight -> BottomLeft ; 02 = BottomRight -> BottomLeft
BottomRightToBottomLeft: BottomRightToBottomLeft:
{ {
LDA.w SwitchRam : BNE part2_b LDA.w SwitchRam : BEQ part2_b
%PlayAnimation(2,2,4) %PlayAnimation(2,2,4)
part2_b: part2_b:
%PlayAnimation(3,3,4) %PlayAnimation(3,3,4)