From 2402f9cff5579116ccf2539ec6deb7ca1c800b82 Mon Sep 17 00:00:00 2001 From: scawful Date: Fri, 5 Jul 2024 12:15:57 -0400 Subject: [PATCH] add TimeSpeed ram for controlling day/night --- Overworld/time_system.asm | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/Overworld/time_system.asm b/Overworld/time_system.asm index 9054ba9..c51002d 100644 --- a/Overworld/time_system.asm +++ b/Overworld/time_system.asm @@ -7,6 +7,10 @@ !hud_hours_high = $7EC7C4 !hud_template = $0DFF07 +Hours = $7EE000 +Minutes = $7EE001 +TimeSpeed = $7EE002 + org !hud_template db $10,$24,$11,$24 db $6C,$25 @@ -36,23 +40,27 @@ JSL LogoFadeInSetClock pullpc LogoFadeInSetClock: -JSL $00ED7C ; restore code -LDA.b #$08 : STA.l $7EE000 ; Set the time to 6:00am -RTL +{ + JSL $00ED7C ; restore code + LDA.b #$08 : STA.l $7EE000 ; Set the time to 6:00am + LDA.b #$3F : STA.l $7EE002 ; Set the time speed + RTL +} pushpc org $0CCA59 JSL ResetClockTriforceRoom - pullpc ResetClockTriforceRoom: -JSL $00E384 ;Restored code +{ + JSL $00E384 ;Restored code -LDA.b #$00 : STA.l $7EE000 ; low hours for palette? -LDA.b #$00 : STA.l $7EE001 ; high hours for palette? + LDA.b #$00 : STA.l $7EE000 ; low hours for palette? + LDA.b #$00 : STA.l $7EE001 ; high hours for palette? -RTL + RTL +} DrawClockToHudLong: { @@ -142,7 +150,7 @@ RunClock: ; time speed (1,3,5,7,F,1F,3F,7F,FF) ; #$3F is almost 1 sec = 1 game minute - LDA $1A : AND #$3F : BEQ .increase_minutes ; 05 + LDA $1A : AND TimeSpeed : BEQ .increase_minutes ; 05 .end RTS