Skip to content

Commit fe82cd0

Browse files
committed
[BotW] Fix draw distance crashes
Fixes at least the crash when you go to Vah Ruta, but likely the other crashes too. Fix was made by Exzap, I'm just uploading it.
1 parent aa31584 commit fe82cd0

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

src/BreathOfTheWild/Mods/ExtendedMemory/patch_extendedHeaps.asm

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ moduleMatches = 0x6267BFD0
55

66
0x02C5E660 = lis r9, 0x8B60 ; add 0x50000000 to main gameheap which by default has a fixed size of 0x3B600000. Can't make it larger due to overlay arena being in the way
77

8-
SaveAreaHeapSize = 8 * 1024 * 1024 ; 8MiB (default is 2312KiB)
9-
TriggerParamHeapSize = 8 * 1024 * 1024 ; 8MiB (default is around 2616KiB)
10-
HavokMainHeapSize = 80 * 1024 * 1024 ; 80MiB (default is 30MiB)
11-
PhysicsTempLowHeapSize = 512 * 1024; 512KiB (default is 128KiB)
12-
PhysicsSystemHeapSize = 512 * 1024; 512KiB (default is 128KiB)
8+
SaveAreaHeapSize = 8 * 1024 * 1024 ; 8MiB (default is 2312KiB)
9+
TriggerParamHeapSize = 8 * 1024 * 1024 ; 8MiB (default is around 2616KiB)
10+
HavokMainHeapSize = 80 * 1024 * 1024 ; 80MiB (default is 30MiB)
11+
PhysicsTempLowHeapSize = 512 * 1024 ; 512KiB (default is 128KiB)
12+
PhysicsSystemHeapSize = 512 * 1024 ; 512KiB (default is 128KiB)
1313

1414
; GameDataHeap
1515
0x032015E0 = lis r3, (SaveAreaHeapSize@ha + TriggerParamHeapSize@ha)
@@ -33,19 +33,18 @@ PhysicsSystemHeapSize = 512 * 1024; 512KiB (default is 128KiB)
3333
0x037fd6d4 = lis r3, PhysicsSystemHeapSize@ha
3434

3535
; Terrain Scene
36-
0x02C5A208 = lis r3, 0x400 #lis r3, 0x140
36+
0x02C5A208 = lis r3, 0x400 ; lis r3, 0x140
3737

3838
; KingSystem -> ForestRenderer
39-
0x0338cdbc = lis r3,0x80 # lis r3,0x30
39+
0x0338cdbc = lis r3, 0x80 ; lis r3,0x30
4040

4141
; KingSystem -> ForestRenderer -> ForestRenderer - WorkHeap
42-
0x033C9D80 = lis r3, 0x20 # lis r3, 0xC
43-
44-
42+
0x033C9D80 = lis r3, 0x20 ; lis r3, 0xC
4543

4644
; Overlay arena
4745
0x030AA5F4 = lis r7, 0x4000 ; expand overlay arena root heap size to 0x40000000 (1GiB) from default 0x1C000000 (448MiB). Can't make it larger due to forground bucket memory being in the way (starts at 0xE0000000)
48-
; Extra size for overlay arena from rules.txt is 0x24000000 (576MiB)
46+
; Extra size for overlay arena from rules.txt is 0x24000000 (576MiB)
47+
4948
; Overlay arena -> FixedHeap
5049
; FixedHeap seems to store terrain renderer among other things
5150
0x034ED614 = lis r3, 0x0C20 + 0x1000 ; add 256MiB
@@ -80,7 +79,7 @@ PhysicsSystemHeapSize = 512 * 1024; 512KiB (default is 128KiB)
8079
0x0340f33C = nop
8180

8281
; ForResourceS
83-
0x0340f3f4 = lis r0,0x940 + 0x1000 ; add 256MiB
82+
0x0340f3f4 = lis r0, 0x940 + 0x1000 ; add 256MiB
8483

8584
; ForResourceL
8685
; 0340F370 addis r26, r26, 0x20
@@ -89,7 +88,13 @@ PhysicsSystemHeapSize = 512 * 1024; 512KiB (default is 128KiB)
8988
0x340F370 = lis r26, 0x2200 ; add around 288MiB
9089

9190
; PlacementMgr heap
92-
0x037c0f30 = li r28,0x5a + 0x40 ; in MiB
91+
0x037c0f30 = li r28, 0x5a + 0x40 ; in MiB
92+
93+
; Some pool size related to PlacementMgr ?
94+
0x02c4136c = li r10, 0x1000 + 0x400
95+
0x02c413f0 = li r10, 0x1000 + 0x400
96+
0x02c43e64 = li r10, 0x1000 + 0x400
97+
0x02c46340 = li r10, 0x1000 + 0x400
9398

9499

95100
; Increase the size of the resource heap for small resources. When using mods like e.g. draw distance this would likely be the reason why it would spawn panic moons.

0 commit comments

Comments
 (0)