Skip to content

Commit

Permalink
some effect symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
z64a committed Sep 30, 2024
1 parent ba9d821 commit 5a19ee8
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 17 deletions.
File renamed without changes.
12 changes: 7 additions & 5 deletions src/effects.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/heaps.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions ver/ique/splat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ver/jp/splat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ver/jp/undefined_syms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions ver/pal/splat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions ver/us/splat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5a19ee8

Please sign in to comment.