Skip to content

Commit

Permalink
[BotW] Some additions to the Day Length pack (#599)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispurnell authored Jun 26, 2023
1 parent 7ce34ed commit d3721c9
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 22 deletions.
23 changes: 18 additions & 5 deletions src/BreathOfTheWild/Mods/DayLength/patch_DayTime.asm
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@ const_timeMultiplier:
.float $timeMultiplier

const_cloudMultiplier:
.float $cloudMultiplier
.float $cloudMultiplier + (($cloudMultiplier == 0) * $timeMultiplier)


; Normal Time Mode - Time
multiplyTimeStep:
lfs f7, 0xA4(r30) ; original instruction to load timestep
lis r9, const_timeMultiplier@ha
lfs f8, const_timeMultiplier@l(r9)
lis r4, const_timeMultiplier@ha
lfs f8, const_timeMultiplier@l(r4)
fmuls f7, f7, f8
lwz r9, 0(r6) ; repeat prior instruction for free r9 register
blr

0x0365FF78 = bla multiplyTimeStep
Expand Down Expand Up @@ -73,4 +72,18 @@ lbz r12, 0x129(r30) ; Normal load instruction
cmpwi r0, 0
blr

0x0365FE0C = bla calcForceTime2
0x0365FE0C = bla calcForceTime2


clockUnits:
li r0, $clockAdjust
cmpwi r0, 0
beq clockSkip
subf r0, r12, r3 ; original instruction
clockSkip:
blr

0x307C130 = bla clockUnits


0x10301850 = .float $bloodMoonTime
106 changes: 89 additions & 17 deletions src/BreathOfTheWild/Mods/DayLength/rules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ $timeCycleMode:int = 0
$timeMultiplier = 1.0
$cloudMultiplier = 1.0
$dayTimeEnum:int = 0
$clockAdjust:int = 1
$bloodMoonTime = 2520


[Preset]
Expand All @@ -29,99 +31,169 @@ name = 15 seconds
category = Day Length
condition = ($timeCycleMode == 1)
$timeMultiplier = 96
$cloudMultiplier = 96

[Preset]
name = 30 seconds
category = Day Length
condition = ($timeCycleMode == 1)
$timeMultiplier = 48
$cloudMultiplier = 48

[Preset]
name = 1 minutes
name = 1 minute
category = Day Length
condition = ($timeCycleMode == 1)
$timeMultiplier = 24
$cloudMultiplier = 24

[Preset]
name = 6 minutes
category = Day Length
condition = ($timeCycleMode == 1)
$timeMultiplier = 4
$cloudMultiplier = 4

[Preset]
name = 12 minutes
category = Day Length
condition = ($timeCycleMode == 1)
$timeMultiplier = 2
$cloudMultiplier = 2

[Preset]
name = 24 minutes (Default)
category = Day Length
condition = ($timeCycleMode == 1)
default = 1
$timeMultiplier = 1.0
$cloudMultiplier = 1.0

[Preset]
name = 36 minutes
category = Day Length
condition = ($timeCycleMode == 1)
$timeMultiplier = 0.75
$cloudMultiplier = 0.75

[Preset]
name = 48 minutes
category = Day Length
condition = ($timeCycleMode == 1)
$timeMultiplier = 0.5
$cloudMultiplier = 0.5

[Preset]
name = 72 minutes
category = Day Length
condition = ($timeCycleMode == 1)
$timeMultiplier = (1/3)
$cloudMultiplier = (1/3)

[Preset]
name = 96 minutes
category = Day Length
condition = ($timeCycleMode == 1)
$timeMultiplier = 0.25
$cloudMultiplier = 0.25

[Preset]
name = 2 hours
category = Day Length
condition = ($timeCycleMode == 1)
$timeMultiplier = 0.2
$cloudMultiplier = 0.2

[Preset]
name = 4 hours
category = Day Length
condition = ($timeCycleMode == 1)
$timeMultiplier = 0.1
$cloudMultiplier = 0.1

[Preset]
name = 12 hours
category = Day Length
condition = ($timeCycleMode == 1)
$timeMultiplier = (1/3)/10
$cloudMultiplier = (1/3)/10
$timeMultiplier = (1/30)

[Preset]
name = 24 hours
category = Day Length
condition = ($timeCycleMode == 1)
$timeMultiplier = (1/6)/10
$cloudMultiplier = (1/6)/10
$timeMultiplier = (1/60)


[Preset]
name = Normal (No Speedup/Slowdown)
category = Cloud Speed
condition = ($timeCycleMode == 1)
$cloudMultiplier = 1.0

[Preset]
name = Scaled with day length (Default)
category = Cloud Speed
condition = ($timeCycleMode == 1)
default = 1
$cloudMultiplier = 0


[Preset]
name = Update every 5 minutes (Default)
category = Clock Increment Frequency
condition = ($timeCycleMode == 1)
default = 1
$clockAdjust:int = 1

[Preset]
name = Update every minute
category = Clock Increment Frequency
condition = ($timeCycleMode == 1)
$clockAdjust:int = 0


[Preset]
name = 28 days
category = Time between Blood Moons
condition = ($timeCycleMode == 1)
$bloodMoonTime = (28*360)

[Preset]
name = 14 days
category = Time between Blood Moons
condition = ($timeCycleMode == 1)
$bloodMoonTime = (14*360)

[Preset]
name = 7 days (Default)
category = Time between Blood Moons
condition = ($timeCycleMode == 1)
default = 1
$bloodMoonTime = (7*360)

[Preset]
name = 6 days
category = Time between Blood Moons
condition = ($timeCycleMode == 1)
$bloodMoonTime = (6*360-1)

[Preset]
name = 5 days
category = Time between Blood Moons
condition = ($timeCycleMode == 1)
$bloodMoonTime = (5*360-1)

[Preset]
name = 4 days
category = Time between Blood Moons
condition = ($timeCycleMode == 1)
$bloodMoonTime = (4*360-1)

[Preset]
name = 3 days
category = Time between Blood Moons
condition = ($timeCycleMode == 1)
$bloodMoonTime = (3*360-1)

[Preset]
name = 2 days
category = Time between Blood Moons
condition = ($timeCycleMode == 1)
$bloodMoonTime = (2*360-1)

[Preset]
name = 1 day
category = Time between Blood Moons
condition = ($timeCycleMode == 1)
$bloodMoonTime = (1*360-1)


[Preset]
Expand Down

0 comments on commit d3721c9

Please sign in to comment.