From 5a19ee8d89493e08360454694aba79496eaef23d Mon Sep 17 00:00:00 2001 From: z64a Date: Sun, 29 Sep 2024 23:43:27 -0400 Subject: [PATCH] some effect symbols --- src/{325AD0.c => effect_utils.c} | 0 src/effects.c | 12 +++++++----- src/heaps.c | 4 ++-- ver/ique/splat.yaml | 4 ++-- ver/jp/splat.yaml | 4 ++-- ver/jp/undefined_syms.txt | 4 ++-- ver/pal/splat.yaml | 4 ++-- ver/us/splat.yaml | 5 +++-- 8 files changed, 20 insertions(+), 17 deletions(-) rename src/{325AD0.c => effect_utils.c} (100%) diff --git a/src/325AD0.c b/src/effect_utils.c similarity index 100% rename from src/325AD0.c rename to src/effect_utils.c diff --git a/src/effects.c b/src/effects.c index 78b6d729e7f..aba4f268549 100644 --- a/src/effects.c +++ b/src/effects.c @@ -5,11 +5,13 @@ typedef s32 TlbEntry[0x1000 / 4]; typedef TlbEntry TlbMappablePage[15]; +#define EFFECT_GLOBALS_TLB_IDX 0x10 + BSS EffectGraphics gEffectGraphicsData[15]; EffectInstance* gEffectInstances[96]; -extern TlbMappablePage D_80197000; -extern Addr D_801A6000; +extern TlbMappablePage gEffectDataBuffer; +extern Addr gEffectGlobals; #define FX_ENTRY(name, gfx_name) { \ name##_main, effect_##name##_ROM_START, effect_##name##_ROM_END, effect_##name##_VRAM, gfx_name##_ROM_START, \ @@ -44,8 +46,8 @@ void clear_effect_data(void) { } osUnmapTLBAll(); - osMapTLB(0x10, NULL, _325AD0_VRAM, (s32)&D_801A6000 & 0xFFFFFF, -1, -1); - DMA_COPY_SEGMENT(_325AD0); + osMapTLB(EFFECT_GLOBALS_TLB_IDX, OS_PM_4K, effect_globals_VRAM, (s32)&gEffectGlobals & 0xFFFFFF, -1, -1); + DMA_COPY_SEGMENT(effect_globals); } void func_80059D48(void) { @@ -320,7 +322,7 @@ s32 load_effect(s32 effectIndex) { ASSERT(i < ARRAY_COUNT(gEffectGraphicsData)); // Map space for the effect - tlbMappablePages = &D_80197000; + tlbMappablePages = &gEffectDataBuffer; osMapTLB(i, OS_PM_4K, effectEntry->dmaDest, (s32)((*tlbMappablePages)[i]) & 0xFFFFFF, -1, -1); // Copy the effect into the newly mapped space diff --git a/src/heaps.c b/src/heaps.c index b7b60e90d8e..76bad8a06a7 100644 --- a/src/heaps.c +++ b/src/heaps.c @@ -5,8 +5,8 @@ typedef s32 TlbEntry[0x1000 / 4]; typedef TlbEntry TlbMappablePage[15]; -BSS TlbMappablePage D_80197000 ALIGNED(0x1000); -BSS u8 D_801A6000[0x1000] ALIGNED(0x1000); +BSS TlbMappablePage gEffectDataBuffer ALIGNED(0x1000); +BSS u8 gEffectGlobals[0x1000] ALIGNED(0x1000); BSS u8 BattleEntityHeapBottom[0x3000] ALIGNED(0x1000); BSS u8 AuHeapBase[AUDIO_HEAP_SIZE] ALIGNED(0x1000); BSS u8 D_80200000[0x4000] ALIGNED(0x1000); diff --git a/ver/ique/splat.yaml b/ver/ique/splat.yaml index fd56752881f..a4b00f92a57 100644 --- a/ver/ique/splat.yaml +++ b/ver/ique/splat.yaml @@ -1562,12 +1562,12 @@ segments: ############### ### Effects ### ############### - - name: 325AD0 + - name: effect_globals type: code start: 0x36E520 vram: 0xE0200000 subsegments: - - [auto, c, 325AD0] + - [auto, c, effect_utils] - [0x36E930, pm_effect_shims, effect_shims] - [0x36EBB0] - name: effect_gfx_big_smoke_puff diff --git a/ver/jp/splat.yaml b/ver/jp/splat.yaml index 43b454f6e45..e85508283fa 100644 --- a/ver/jp/splat.yaml +++ b/ver/jp/splat.yaml @@ -1490,12 +1490,12 @@ segments: ############### ### Effects ### ############### - - name: 325AD0 + - name: effect_globals type: code start: 0x32DDD0 vram: 0xE0200000 subsegments: - - [0x32DDD0, c, 325AD0] + - [0x32DDD0, c, effect_utils] - [0x32E1E0, pm_effect_shims, effect_shims] - [0x32E460] - name: effect_gfx_big_smoke_puff diff --git a/ver/jp/undefined_syms.txt b/ver/jp/undefined_syms.txt index 85a3aee40f8..b8662dd93f1 100644 --- a/ver/jp/undefined_syms.txt +++ b/ver/jp/undefined_syms.txt @@ -52,8 +52,8 @@ obfuscated_obfuscation_shims_VRAM = 0x7599F6D8; obfuscated_obfuscation_shims_ROM_START = 0xF79E611F; // subsequent segments -D_80197000 = 0x80197000; -D_801A6000 = 0x801A6000; +gEffectDataBuffer = 0x80197000; +gEffectGlobals = 0x801A6000; AuHeapBase = 0x801AA000; D_80200000 = 0x80200000; gBackgroundImage = 0x80200000; diff --git a/ver/pal/splat.yaml b/ver/pal/splat.yaml index 8ef41915ed9..370c577a3ce 100644 --- a/ver/pal/splat.yaml +++ b/ver/pal/splat.yaml @@ -1177,12 +1177,12 @@ segments: ############### ### Effects ### ############### - - name: 325AD0 + - name: effect_globals type: code start: 0x34E890 vram: 0xE0200000 subsegments: - - [0x34E890, c, 325AD0] + - [0x34E890, c, effect_utils] - [0x34ECA0, pm_effect_shims, effect_shims] - [0x34EF20] - name: effect_gfx_big_smoke_puff diff --git a/ver/us/splat.yaml b/ver/us/splat.yaml index a3c99bb084e..99a02320091 100644 --- a/ver/us/splat.yaml +++ b/ver/us/splat.yaml @@ -1643,11 +1643,12 @@ segments: ############### ### Effects ### ############### - - type: code + - name: effect_globals + type: code start: 0x325AD0 vram: 0xE0200000 subsegments: - - [auto, c, 325AD0] + - [auto, c, effect_utils] - [0x325EE0, pm_effect_shims, effect_shims] - [0x326160] - name: effect_gfx_big_smoke_puff