Add B button check to start riding, allows for easier lifting with A button

This commit is contained in:
scawful
2024-03-30 09:53:19 -04:00
parent 58dd5aab1f
commit b0b3ca242b

View File

@@ -212,27 +212,26 @@ Sprite_Minecart_Main:
LDA !LinkCarryOrToss : AND #$03 : BNE .lifting LDA !LinkCarryOrToss : AND #$03 : BNE .lifting
JSR CheckIfPlayerIsOn : BCC .not_ready JSR CheckIfPlayerIsOn : BCC .not_ready
LDA $F4 : AND.b #$80 : BEQ .not_ready ; Check for B button
JSL Player_HaltDashAttack ; Stop the player from dashing JSL Player_HaltDashAttack ; Stop the player from dashing
LDA #$02 : STA $02F5 ; Somaria platform and moving LDA #$02 : STA $02F5 ; Somaria platform and moving
LDA $0FDA : SEC : SBC #$0B : STA $20 ; Adjust player pos LDA $0FDA : SEC : SBC #$0B : STA $20 ; Adjust player pos
LDA #$01 : STA !LinkInCart ; Set Link in cart flag LDA #$01 : STA !LinkInCart ; Set Link in cart flag
; Check if the cart is facing east or west ; Check if the cart is facing east or west
LDA SprSubtype, X : CMP.b #$03 : BNE .opposite_direction LDA SprSubtype, X : CMP.b #$03 : BNE .opposite_direction
STA.w !MinecartDirection STA.w !MinecartDirection
LDA #$02 : STA !SpriteDirection, X LDA #$02 : STA !SpriteDirection, X
%GotoAction(5) ; Minecart_MoveWest %GotoAction(5) ; Minecart_MoveWest
RTS RTS
.opposite_direction .opposite_direction
STA.w !MinecartDirection STA.w !MinecartDirection
LDA #$03 : STA !SpriteDirection, X LDA #$03 : STA !SpriteDirection, X
%GotoAction(3) ; Minecart_MoveEast %GotoAction(3) ; Minecart_MoveEast
.not_ready .not_ready
RTS
.lifting .lifting
%HandleLiftAndToss() %HandleLiftAndToss()
RTS RTS
@@ -247,23 +246,24 @@ Sprite_Minecart_Main:
LDA !LinkCarryOrToss : AND #$03 : BNE .lifting LDA !LinkCarryOrToss : AND #$03 : BNE .lifting
JSR CheckIfPlayerIsOn : BCC .not_ready JSR CheckIfPlayerIsOn : BCC .not_ready
LDA $F4 : AND.b #$80 : BEQ .not_ready ; Check for B button
JSL Player_HaltDashAttack ; Stop the player from dashing JSL Player_HaltDashAttack ; Stop the player from dashing
LDA #$02 : STA $02F5 ; Somaria platform and moving LDA #$02 : STA $02F5 ; Somaria platform and moving
LDA $0FDA : SEC : SBC #$0B : STA $20 ; Adjust player pos LDA $0FDA : SEC : SBC #$0B : STA $20 ; Adjust player pos
LDA #$01 : STA !LinkInCart ; Set Link in cart flag LDA #$01 : STA !LinkInCart ; Set Link in cart flag
; Check if the cart is facing north or south
LDA SprSubtype, X : BEQ .opposite_direction
STA.w !MinecartDirection
LDA #$01 : STA !SpriteDirection, X
%GotoAction(4) ; Minecart_MoveSouth
RTS
.opposite_direction ; Check if the cart is facing north or south
STA.w !MinecartDirection LDA SprSubtype, X : BEQ .opposite_direction
LDA #$00 : STA !SpriteDirection, X STA.w !MinecartDirection
%GotoAction(2) ; Minecart_MoveNorth LDA #$01 : STA !SpriteDirection, X
%GotoAction(4) ; Minecart_MoveSouth
RTS
.opposite_direction
STA.w !MinecartDirection
LDA #$00 : STA !SpriteDirection, X
%GotoAction(2) ; Minecart_MoveNorth
.not_ready .not_ready
.lifting .lifting
@@ -626,7 +626,7 @@ HandleDynamicSwitchTileDirections:
JSL CheckIfHitBoxesOverlap : BCC .no_b0 JSL CheckIfHitBoxesOverlap : BCC .no_b0
LDA !MinecartDirection : CMP.b #$00 : BEQ .east_or_west LDA !MinecartDirection : CMP.b #$00 : BEQ .east_or_west
CMP.b #$02 : BEQ .north_or_south CMP.b #$02 : BEQ .north_or_south
.east_or_west .east_or_west
@@ -786,29 +786,29 @@ CheckForPlayerInput:
LDA $0FA5 : CLC : CMP.b #$B6 : BNE .cant_input LDA $0FA5 : CLC : CMP.b #$B6 : BNE .cant_input
; Check for input from the user (u,d,l,r) ; Check for input from the user (u,d,l,r)
LDY !SpriteDirection, X LDY !SpriteDirection, X
LDA $F0 : AND .d_pad_press, Y : STA $00 : AND.b #$08 : BEQ .not_pressing_up LDA $F0 : AND .d_pad_press, Y : STA $00 : AND.b #$08 : BEQ .not_pressing_up
LDA.b #$00 : STA !SpriteDirection, X ; Moving Up LDA.b #$00 : STA !SpriteDirection, X ; Moving Up
STA SprSubtype, X STA SprSubtype, X
%GotoAction(2) ; Minecart_MoveNorth %GotoAction(2) ; Minecart_MoveNorth
BRA .return BRA .return
.not_pressing_up: .not_pressing_up:
LDA $00 : AND.b #$04 : BEQ .not_pressing_down LDA $00 : AND.b #$04 : BEQ .not_pressing_down
LDA.b #$01 : STA !SpriteDirection, X LDA.b #$01 : STA !SpriteDirection, X
LDA #$02 : STA SprSubtype, X LDA #$02 : STA SprSubtype, X
%GotoAction(4) ; Minecart_MoveSouth %GotoAction(4) ; Minecart_MoveSouth
BRA .return BRA .return
.not_pressing_down .not_pressing_down
LDA $00 : AND.b #$02 : BEQ .not_pressing_left LDA $00 : AND.b #$02 : BEQ .not_pressing_left
LDA.b #$02 : STA !SpriteDirection, X LDA.b #$02 : STA !SpriteDirection, X
LDA #$03 : STA SprSubtype, X LDA #$03 : STA SprSubtype, X
%GotoAction(5) ; Minecart_MoveWest %GotoAction(5) ; Minecart_MoveWest
BRA .return BRA .return
.not_pressing_left .not_pressing_left
LDA $00 : AND.b #$01 : BEQ .always LDA $00 : AND.b #$01 : BEQ .always
LDA.b #$03 : STA !SpriteDirection, X LDA.b #$03 : STA !SpriteDirection, X
STA SprSubtype, X STA SprSubtype, X
%GotoAction(3) ; Minecart_MoveEast %GotoAction(3) ; Minecart_MoveEast