Cleanup Mermaid subsprites jump table

This commit is contained in:
scawful
2024-09-22 16:27:48 -04:00
parent ee9b89129c
commit 874c4af85c

View File

@@ -37,7 +37,7 @@ Sprite_Mermaid_Long:
PHB : PHK : PLB PHB : PHK : PLB
LDA.w SprMiscE, X : BEQ .MermaidDraw LDA.w SprMiscE, X : BEQ .MermaidDraw
CMP.b #$02 : BEQ .LibrarianDraw CMP.b #$02 : BEQ .LibrarianDraw
JSR Sprite_Maple_Draw JSR Sprite_Maple_Draw
JMP .Continue JMP .Continue
.LibrarianDraw .LibrarianDraw
@@ -63,24 +63,24 @@ Sprite_Mermaid_Prep:
PHB : PHK : PLB PHB : PHK : PLB
LDA.b #$80 : STA.w SprDefl, X LDA.b #$80 : STA.w SprDefl, X
LDA.b #$40 : STA.w SprTimerA, X LDA.b #$40 : STA.w SprTimerA, X
STZ.w SprMiscE, X
LDA.b #$07 : STA.w SprHitbox, X LDA.b #$07 : STA.w SprHitbox, X
LDA.w SprSubtype, X : CMP.b #$01 : BNE + ; Mermaid Sprite
; Maple Sprite STZ.w SprMiscE, X
; Maple Sprite
LDA.w SprSubtype, X : CMP.b #$01 : BNE +
LDA.b #$01 : STA.w SprMiscE, X LDA.b #$01 : STA.w SprMiscE, X
+ +
; Librarian Sprite
CMP.b #$02 : BNE ++ CMP.b #$02 : BNE ++
; Librarian Sprite
LDA.b #$02 : STA.w SprMiscE, X LDA.b #$02 : STA.w SprMiscE, X
LDA.b #$06 : STA.w SprAction, X
++ ++
PLB PLB
RTL RTL
} }
Sprite_Mermaid_Main: Sprite_Mermaid_Main:
{ {
LDA.w SprMiscE, X LDA.w SprMiscE, X
@@ -99,38 +99,37 @@ Sprite_Mermaid_Main:
dw MermaidDive dw MermaidDive
dw MermaidSwim dw MermaidSwim
MermaidWait: MermaidWait:
{ {
%PlayAnimation(0,0, 20) %PlayAnimation(0,0, 20)
JSL Sprite_PlayerCantPassThrough JSL Sprite_PlayerCantPassThrough
%ShowMessageOnContact($047) : BCC .didnt_talk %ShowMessageOnContact($047) : BCC .didnt_talk
LDA.w SprTimerA, X : BNE +
LDA.b #$20 : STA.w SprTimerA, X
INC.w SprAction, X
+
.didnt_talk
RTS
}
MermaidDive:
{
%PlayAnimation(1,2, 14)
LDA.w SprX, X : INC : STA.w SprX, X
LDA.w SprTimerA, X : BNE + LDA.w SprTimerA, X : BNE +
LDA.b #$20 : STA.w SprTimerA, X INC.w SprAction, X
INC.w SprAction, X LDA.b #$04 : STA.w SprTimerA, X
+ +
.didnt_talk RTS
RTS }
}
MermaidDive: MermaidSwim:
{ {
%PlayAnimation(1,2, 14) %PlayAnimation(3,3,20)
JSL Sprite_Move
LDA.w SprX, X : INC : STA.w SprX, X LDA.b #10 : STA.w SprXSpeed, X
LDA.w SprTimerA, X : BNE + JSR SpawnSplash
INC.w SprAction, X
LDA.b #$04 : STA.w SprTimerA, X
+
RTS
}
MermaidSwim:
{
%PlayAnimation(3,3,20)
JSL Sprite_Move
LDA.b #10 : STA.w SprXSpeed, X
JSR SpawnSplash
LDA.w SprMiscD,X : BNE ++ LDA.w SprMiscD,X : BNE ++
STZ.w SprState, X STZ.w SprState, X
++ ++
@@ -141,8 +140,8 @@ Sprite_Mermaid_Main:
LDA.b #$01 : STA.w SprMiscD, X LDA.b #$01 : STA.w SprMiscD, X
LDA.b #$04 : STA.w SprTimerA, X LDA.b #$04 : STA.w SprTimerA, X
+ +
RTS RTS
} }
} }
MapleHandler: MapleHandler:
@@ -169,68 +168,67 @@ Sprite_Mermaid_Main:
Maple_BoughtMilkBottle: Maple_BoughtMilkBottle:
{ {
REP #$20
LDA.l $7EF360
CMP.w #$1E ; 30 rupees
SEP #$30
BCC .not_enough_rupees
LDA.l $7EF35C : CMP.b #$02 : BEQ .bottle1_available
LDA.l $7EF35D : CMP.b #$02 : BEQ .bottle2_available
LDA.l $7EF35E : CMP.b #$02 : BEQ .bottle3_available
LDA.l $7EF35F : CMP.b #$02 : BEQ .bottle4_available
%ShowUnconditionalMessage($033)
%GotoAction(0)
RTS
.bottle1_available
LDA.b #$0A : STA.l $7EF35C : JMP .finish_storage
.bottle2_available
LDA.b #$0A : STA.l $7EF35D : JMP .finish_storage
.bottle3_available
LDA.b #$0A : STA.l $7EF35E : JMP .finish_storage
.bottle4_available
LDA.b #$0A : STA.l $7EF35F
.finish_storage
REP #$20 REP #$20
LDA.l $7EF360 LDA.l $7EF360
SEC CMP.w #$1E ; 30 rupees
SBC.w #$1E ; Subtract 30 rupees
STA.l $7EF360
SEP #$30 SEP #$30
BCC .not_enough_rupees
%ShowUnconditionalMessage($0188) ; Thank you! LDA.l $7EF35C : CMP.b #$02 : BEQ .bottle1_available
%GotoAction(0) LDA.l $7EF35D : CMP.b #$02 : BEQ .bottle2_available
LDA.l $7EF35E : CMP.b #$02 : BEQ .bottle3_available
LDA.l $7EF35F : CMP.b #$02 : BEQ .bottle4_available
%ShowUnconditionalMessage($033)
%GotoAction(0)
RTS
.bottle1_available
LDA.b #$0A : STA.l $7EF35C : JMP .finish_storage
.bottle2_available
LDA.b #$0A : STA.l $7EF35D : JMP .finish_storage
.bottle3_available
LDA.b #$0A : STA.l $7EF35E : JMP .finish_storage
.bottle4_available
LDA.b #$0A : STA.l $7EF35F
.finish_storage
REP #$20
LDA.l $7EF360
SEC
SBC.w #$1E ; Subtract 30 rupees
STA.l $7EF360
SEP #$30
%ShowUnconditionalMessage($0188) ; Thank you!
%GotoAction(0)
RTS
.not_enough_rupees
%GotoAction(2)
RTS RTS
.not_enough_rupees
%GotoAction(2)
RTS
} }
Maple_NotEnoughRupees: Maple_NotEnoughRupees:
{ {
%ShowUnconditionalMessage($0189) ; You don't have enough rupees! %ShowUnconditionalMessage($0189) ; You don't have enough rupees!
%GotoAction(0) %GotoAction(0)
RTS RTS
} }
Maple_HandlePlayerResponse: Maple_HandlePlayerResponse:
{ {
LDA $1CE8 : BEQ .player_said_yes LDA $1CE8 : BEQ .player_said_yes
%GotoAction(4) %GotoAction(4)
RTS
.player_said_yes
%GotoAction(1)
RTS RTS
.player_said_yes
%GotoAction(1)
RTS
} }
Maple_ComeBackAgain: Maple_ComeBackAgain:
{ {
%ShowUnconditionalMessage($018B) ; Come back again! %ShowUnconditionalMessage($018B) ; Come back again!
%GotoAction(0) %GotoAction(0)
RTS RTS
} }
} }
LibrarianHandler: LibrarianHandler:
@@ -241,36 +239,31 @@ Sprite_Mermaid_Main:
dw LibrarianIdle dw LibrarianIdle
dw Librarian_OfferTranslation dw Librarian_OfferTranslation
LibrarianIdle: LibrarianIdle:
{ {
%PlayAnimation(0,1,16) %PlayAnimation(0,1,16)
JSL Sprite_PlayerCantPassThrough JSL Sprite_PlayerCantPassThrough
%ShowSolicitedMessage($012E) %ShowSolicitedMessage($012E)
JSR Librarian_CheckForAllMaps : BCC + JSR Librarian_CheckForAllMaps : BCC +
INC.w SprAction, X INC.w SprAction, X
+ +
RTS RTS
} }
Librarian_OfferTranslation: Librarian_OfferTranslation:
{ {
%PlayAnimation(0,1,16) %PlayAnimation(0,1,16)
JSL Sprite_PlayerCantPassThrough JSL Sprite_PlayerCantPassThrough
%ShowSolicitedMessage($012C) %ShowSolicitedMessage($012C)
RTS RTS
}
} }
}
} }
Librarian_CheckForAllMaps: Librarian_CheckForAllMaps:
{ {
LDA.l DNGMAP1 LDA.l DNGMAP1 : CMP.b #$FC : BNE .not_all_maps
CMP.b #$FC LDA.l DNGMAP2 : CMP.b #$FF : BEQ .all_maps
BNE .not_all_maps
LDA.l DNGMAP2
CMP.b #$FF
BEQ .all_maps
.not_all_maps .not_all_maps
CLC CLC
RTS RTS