diff --git a/Core/symbols.asm b/Core/symbols.asm index b1698ea..120bd2a 100644 --- a/Core/symbols.asm +++ b/Core/symbols.asm @@ -39,6 +39,10 @@ CurrentDream = $0426 ; Current Song CurrentSong = $030F +; 01 - Song of Healing +; 02 - Song of Time +SongFlag = $FE + ; ========================================================= ; The record format for the low table is 4 bytes: ; byte OBJ*4+0: xxxxxxxx diff --git a/Items/ocarina.asm b/Items/ocarina.asm index 420c260..8e59b13 100644 --- a/Items/ocarina.asm +++ b/Items/ocarina.asm @@ -148,12 +148,12 @@ LinkItem_NewFlute: JMP .song_of_storms .song_of_time LDA.b #$27 : JSR $802F ; Player_DoSfx3 - LDA.b #$02 : STA $FE + LDA.b #$02 : STA SongFlag RTS .song_of_healing LDA.b #$13 : JSR Player_DoSfx2 - LDA.b #$01 : STA $FE + LDA.b #$01 : STA SongFlag RTS .song_of_storms diff --git a/Overworld/time_system.asm b/Overworld/time_system.asm index 83a63f1..bd929ec 100644 --- a/Overworld/time_system.asm +++ b/Overworld/time_system.asm @@ -193,7 +193,7 @@ RunClock: CheckForSongOfTime: { ; Check if Song of Time was activated - LDA $FE : CMP.b #$02 : BNE + + LDA SongFlag : CMP.b #$02 : BNE + ; Speed up the time LDA.b #$00 : STA.l TimeSpeed @@ -201,14 +201,14 @@ CheckForSongOfTime: LDA.l Hours : CMP.b #$06 : BNE ++ LDA.l Minutes : BNE ++ LDA.b #$3F : STA.l TimeSpeed - STZ $FE + STZ SongFlag ++ ; If we reached 6pm LDA.l Hours : CMP.b #$12 : BNE ++ LDA.l Minutes : BNE ++ LDA.b #$3F : STA.l TimeSpeed - STZ $FE + STZ SongFlag ++ + RTS diff --git a/Sprites/Enemies/pols_voice.asm b/Sprites/Enemies/pols_voice.asm index a7ccffa..52f6e1a 100644 --- a/Sprites/Enemies/pols_voice.asm +++ b/Sprites/Enemies/pols_voice.asm @@ -32,8 +32,6 @@ %Set_Sprite_Properties(Sprite_PolsVoice_Prep, Sprite_PolsVoice_Long) -; ========================================================= - Sprite_PolsVoice_Long: { PHB : PHK : PLB @@ -46,8 +44,6 @@ Sprite_PolsVoice_Long: RTL } -; ========================================================= - Sprite_PolsVoice_Prep: { PHB : PHK : PLB @@ -58,8 +54,6 @@ Sprite_PolsVoice_Prep: RTL } -; ========================================================= - Sprite_PolsVoice_Main: { JSR PolsVoice_CheckForFluteSong @@ -132,7 +126,7 @@ Sprite_PolsVoice_Main: PolsVoice_CheckForFluteSong: { ; If the player plays the flute - LDA $FE : BEQ + + LDA SongFlag : BEQ + LDA.b #$03 : STA.w SprState, X + RTS diff --git a/Sprites/NPCs/bug_net_kid.asm b/Sprites/NPCs/bug_net_kid.asm index a515258..20635f0 100644 --- a/Sprites/NPCs/bug_net_kid.asm +++ b/Sprites/NPCs/bug_net_kid.asm @@ -3,10 +3,10 @@ SickKid_CheckForSongOfHealing: { - LDA $FE : CMP.b #$01 : BNE .no_song + LDA SongFlag : CMP.b #$01 : BNE .no_song INC $0D80, X INC $02E4 - STZ $FE + STZ.w SongFlag .no_song RTL } diff --git a/Sprites/NPCs/deku_scrub.asm b/Sprites/NPCs/deku_scrub.asm index 002ec22..05888e4 100644 --- a/Sprites/NPCs/deku_scrub.asm +++ b/Sprites/NPCs/deku_scrub.asm @@ -81,7 +81,7 @@ Sprite_DekuScrub_Prep: Sprite_DekuScrub_Main: { LDA.w SprAction, X - JSL UseImplicitRegIndexedLocalJumpTable + JSL JumpTableLocal dw EstadoInactivo dw QuiereCuracion @@ -107,8 +107,8 @@ Sprite_DekuScrub_Main: QuiereCuracion: { %PlayAnimation(0, 1, 16) - LDA $FE : BEQ .ninguna_cancion - STZ $FE + LDA SongFlag : CMP.b #$01 : BNE .ninguna_cancion + STZ.w SongFlag LDA.b #$C0 : STA.w SprTimerD, X %GotoAction(2) .ninguna_cancion diff --git a/Sprites/NPCs/zora.asm b/Sprites/NPCs/zora.asm index de5fe51..6f3306c 100644 --- a/Sprites/NPCs/zora.asm +++ b/Sprites/NPCs/zora.asm @@ -52,7 +52,7 @@ Sprite_Zora_Handler: RTS .not_princess - JSL UseImplicitRegIndexedLocalJumpTable + JSL JumpTableLocal dw Sprite_Zora_Main dw Sprite_ZoraPrincess_Main @@ -68,7 +68,7 @@ Sprite_Zora_Main: JSR Zora_HandleDialogue LDA.w SprAction, X - JSL UseImplicitRegIndexedLocalJumpTable + JSL JumpTableLocal dw Zora_Forward dw Zora_Right diff --git a/Sprites/NPCs/zora_princess.asm b/Sprites/NPCs/zora_princess.asm index e13648c..ec936bb 100644 --- a/Sprites/NPCs/zora_princess.asm +++ b/Sprites/NPCs/zora_princess.asm @@ -35,7 +35,7 @@ Sprite_ZoraPrincess_Long: PHB : PHK : PLB JSR Sprite_ZoraPrincess_Draw JSL Sprite_CheckActive : BCC .SpriteIsNotActive - JSR Sprite_ZoraPrincess_Main + JSR Sprite_ZoraPrincess_Main .SpriteIsNotActive PLB RTL @@ -44,7 +44,7 @@ Sprite_ZoraPrincess_Long: Sprite_ZoraPrincess_Prep: { PHB : PHK : PLB - LDA.l $7EF302 : BEQ .doesnt_have_mask + LDA.l $7EF302 : BEQ .doesnt_have_mask STZ.w SprState, X ; Kill the sprite .doesnt_have_mask @@ -60,7 +60,7 @@ Sprite_ZoraPrincess_Main: JSL Sprite_PlayerCantPassThrough LDA.w SprAction, X - JSL UseImplicitRegIndexedLocalJumpTable + JSL JumpTableLocal dw WaitForLink dw CheckForSongOfHealing @@ -79,8 +79,8 @@ Sprite_ZoraPrincess_Main: CheckForSongOfHealing: { %PlayAnimation(0, 1, 10) - LDA $FE : BEQ .ninguna_cancion - STZ $FE + LDA.b SongFlag : BEQ .ninguna_cancion + STZ.b SongFlag LDA.b #$C0 : STA.w SprTimerD, X %GotoAction(2) .ninguna_cancion