Moved symbol_addrs to its own folder

Identified a ton of libmus functions
This commit is contained in:
gijs 2023-09-25 16:34:55 +02:00
parent fdc88c6c5f
commit 8457613831
6 changed files with 133 additions and 58 deletions

View File

@ -333,12 +333,13 @@ extern void __idle_start_4_threads(s32, s32);
extern void (*D_800E7A18)();
extern void boot(void);
extern void idle(void* arg);
extern void obIdle(void* arg);
extern OSThread THREAD_FIRST_DMA_LOAD;
extern u8 SP_THREAD_FIRST_DMA_LOAD[];
extern OSThread THREAD_IDLE;
extern u8 SP_THREAD_IDLE[];
extern OSThread obThreadIdle;
extern u8 obStackIdle[];
extern OverlaySomething __OVERLAY_INFO_resets_menu_timer;
extern void* D_8018FB0C[];
@ -522,7 +523,7 @@ extern OSIoMesg __MUS_MEM_800B186C[];
extern void *__virtual_mem_alloc(u32);
extern void *__MusIntMemMalloc(s32 size);
extern ALHeap D_800B1A70;
extern ALHeap audio_heap;
extern void __character_initialise(CharacterSlot *arg0, u8 level);
extern u16 character_get_item(CharacterSlot* character, u8 slot);

View File

@ -565,7 +565,6 @@ __calls_loads_overlay_array = 0x80075BC0;
D_800A81C0 = 0x800A81C0; // size:0x30
maybe_boot_01 = 0x800851C0;
__add_0x594284 = 0x8009DD28;
@ -654,8 +653,6 @@ __GLOBAL_CONT_STATUS = 0x800C4B38;
__set_fp_8008A660 = 0x8008A660;
musCurrentPtrBank = 0x800B182C;
__osSetTimerIntr = 0x80094F70;
__osInsertTimer = 0x80094FD0;
osSetTime = 0x80094D20;
@ -799,7 +796,6 @@ magnitude = 0x8009C780;
main_ = 0x80071EB0;
__dma_load_loop = 0x80089A30;
__dma_load_loop_check = 0x800819D4;
__MUS_MEM_800B18A4 = 0x800B18A4; // size:0x58
__MUS_MEM_800B186C = 0x800B186C;
@ -832,7 +828,6 @@ OSMESG_800BE048 = 0x800BE048;
OSMESG_800B9C58 = 0x800B9C58;
OSMESG_800B9C80 = 0x800B9C80;
SP_THREAD_IDLE = 0x800B17A0;
SP_THREAD_FIRST_DMA_LOAD = 0x800C6D60;
SP_THREAD_800BE1C0 = 0x800C2370;
SP_THREAD_800B9C88 = 0x800BBE40;
@ -924,12 +919,12 @@ __VIRTUAL_MEMORY_EXHAUSTED = 0x800AE35C;
__virtual_mem_alloc = 0x80070F30;
__controller_thread_80089D9C = 0x80089D9C;
__Mus_thread_80085908 = 0x80085908;
THREAD_IDLE = 0x800AF440;
idle = 0x8007F8E4;
obThreadIdle = 0x800AF440;
obStackIdle = 0x800B17A0;
obIdle = 0x8007F8E4;
obInitializePi = 0x80089F40;
@ -962,36 +957,19 @@ bcopy = 0x80093060;
bcmp = 0x80092F50;
bzero = 0x80093380;
MusHandlePause = 0x80081EA4;
MusHandleUnpause = 0x80081EC8;
MusSetFxType = 0x80081EF0;
MusFxBankNumberOfEffects = 0x80082000;
MusFxBankSetPtrBank = 0x8008202C;
MusFxBankGetPtrBank = 0x80082034;
MusSetMasterVolume = 0x800814C4;
MusStartSong = 0x800814F0;
MusPtrBankSetCurrent = 0x80081E18;
__MusIntInitSweep = 0x80083010;
__MusIntMemMalloc = 0x80085ADC;
// Maybe incorrect, found them myself.
MusInitialize = 0x8008123C; // rom:0x1163C
MusFxBankInitialize = 0x80081F7C; // rom:0x1237C
MusPtrBankInitialize = 0x80081DB4;
n64_ptr_tables_v2_00_VRAM = 0x80164770; // rom:0xB9D00
n64_ptr_tables_v2_01_VRAM = 0x80104710; // rom:0x59CA0
n64_wave_data_VRAM = 0xD_8010A760; // rom:0x5FCF0
__MUS_CONFIG_8010A710 = 0x8010A710; // size:0x44
alSynAddPlayer = 0x80088000; // rom:0x18400
alSynAllocVoice = 0x80088050; // rom:0x18450
alSynStopVoice = 0x80088550; // rom:0x18950
alSynAllocFX = 0x8008FF70;
alFxNew = 0x8008C694;
alFxParam = 0x8008EEA4;
alMainBusParam = 0x8008E850;
alInit = 0x8008F7A0;
alInit = 0x80084970; // rom:0x14D70
alUnlink = 0x8008F81C;
alClose = 0x8008F7CC;
alLink = 0x8008F7FC;

View File

@ -0,0 +1,98 @@
__libmus_alglobals = 0x800E7D18;
__libmus_current_sched = 0x800A9B8C;
audio_heap = 0x800B1A70;
mus_master_volume_effects = 0x800B181C;
mus_master_volume_songs = 0x800B181E;
mus_init_bank = 0x800B1828;
libmus_fxheader_single = 0x800B183C;
libmus_fxheader_current = 0x800B1838;
mus_channels = 0x800B180C;
max_channels = 0x800B1804;
musCurrentPtrBank = 0x800B182C;
__MusIntThreadProcess = 0x80085908;
__MusIntAudManInit = 0x800857D0; // rom:0x15BD0
__MusIntSamplesInit = 0x80085BD0; // rom:0x15FD0
__MusIntDmaInit = 0x800851C0; // rom:0x155C0
__MusIntSchedInit = 0x80085620; // rom:0x15A20
__MusIntMemInit = 0x80085A90; // rom:0x15E90
__MusIntInitialiseChannel = 0x80083738; // rom:0x13B38
__MusIntStartSong = 0x80083CCC; // rom:0x140CC
__MusIntFindChannelAndStart = 0x80083B24; // rom:0x13F24
__MusIntStartEffect = 0x80083A74; // rom:0x13E74
__MusIntMemMalloc = 0x80085ADC;
__MusIntMemRemaining = 0x80085B0C; // rom:0x15F0C
__MusIntMemGetHeapAddr = 0x80085B24; // rom:0x15F24
__MusIntMemSet = 0x80085B30; // rom:0x15F30
__MusIntMemMove = 0x80085B5C; // rom:0x15F5C
__MusIntRemapPtrs = 0x80083A3C; // rom:0x13E3C
// player_fifo.c
__MusIntFifoOpen = 0x80082130; // rom:0x12530
__MusIntFifoProcessCommand = 0x80082194; // rom:0x12594
__MusIntFifoAddCommand = 0x80082214; // rom:0x12614
// player.c
__MusIntMain = 0x800822AC; // rom:0x126AC
__MusIntProcessContinuousVolume = 0x800831A0; // rom:0x135A0
__MusIntProcessContinuousPitchBend = 0x80083264; // rom:0x13664
__MusIntGetNewNote = 0x8008259C; // rom:0x1299C
__MusIntFlushPending = 0x80082AE8; // rom:0x12EE8
__MusIntSetVolumeAndPan = 0x80082B64; // rom:0x12F64
__MusIntSetPitch = 0x80082CB8; // rom:0x130B8
__MusIntInitEnvelope = 0x80082DC4; // rom:0x131C4
__MusIntProcessEnvelope = 0x80082E34; // rom:0x13234
__MusIntInitSweep = 0x80083010; // rom:0x13410
__MusIntProcessSweep = 0x8008302C; // rom:0x1342C
__MusIntProcessVibrato = 0x8008313C; // rom:0x1353C
__MusIntProcessWobble = 0x800830E4; // rom:0x134E4
__MusIntPowerOf2 = 0x80083378; // rom:0x13778
__MusIntRemapPtrBank = 0x8008350C; // rom:0x1390C
__MusIntRandom = 0x800836A4; // rom:0x13AA4
__MusIntFindChannel = 0x80083874; // rom:0x13C74
__MusIntHandleSetFlag = 0x80083F38; // rom:0x14338
// player_api.c
MusInitialize = 0x8008123C; // rom:0x1163C
MusSetMasterVolume = 0x800814C4; // rom:0x118C4
MusStartSong = 0x800814F0; // rom:0x118F0
MusStartSongFromMarker = 0x80081520; // rom:0x11920
MusStartEffect = 0x80081770; // rom:0x11B70
MusStartEffect2 = 0x800817F0; // rom:0x11BF0
MusStop = 0x80081908; // rom:0x11D08
MusAsk = 0x800819D4; // rom:0x11DD4
MusHandleStop = 0x80081A54; // rom:0x11E54
MusHandleAsk = 0x80081B08; // rom:0x11F08
MusHandleSetVolume = 0x80081B60; // rom:0x11F60
MusHandleSetPan = 0x80081BC0; // rom:0x11FC0
MusHandleSetFreqOffset = 0x80081C30; // rom:0x12030
MusHandleSetTempo = 0x80081CA0; // rom:0x120A0
MusHandleSetReverb = 0x80081D2C; // rom:0x1212C
MusPtrBankSetSingle = 0x80081DF0; // rom:0x121F0
MusPtrBankSetCurrent = 0x80081E18; // rom:0x12218
MusPtrBankGetCurrent = 0x80081E3C; // rom:0x1223C
MusHandleGetPtrBank = 0x80081E48; // rom:0x12248
MusHandlePause = 0x80081EA4; // rom:0x122A4
MusHandleUnpause = 0x80081EC8; // rom:0x122C8
MusSetFxType = 0x80081EF0; // rom:0x122F0
MusSetSongFxChange = 0x80081F20; // rom:0x12320
MusFxBankInitialize = 0x80081F7C; // rom:0x1237C
MusFxBankNumberOfEffects = 0x80082000; // rom:0x12400
MusFxBankSetCurrent = 0x80082008; // rom:0x12408
MusFxBankSetSingle = 0x80082014; // rom:0x12414
MusFxBankGetCurrent = 0x80082020; // rom:0x12420
MusFxBankSetPtrBank = 0x8008202C; // rom:0x1242C
MusFxBankGetPtrBank = 0x80082034; // rom:0x12434
MusSetScheduler = 0x8008203C; // rom:0x1243C
MusHandleWaveCount = 0x80082048; // rom:0x12448
MusHandleWaveAddress = 0x800820AC; // rom:0x124AC
MusSetMarkerCallback = 0x80082124; // rom:0x12524
MusPtrBankInitialize = 0x80081DB4; // rom:0x121B4
__MUS_CONFIG_8010A710 = 0x8010A710; // size:0x44

View File

@ -14,7 +14,9 @@ options:
# undefined_funcs_auto_path: undefined_funcs_auto.txt
# undefined_syms_auto: True
# undefined_syms_auto_path: undefined_syms_auto.txt
# symbol_addrs_path: symbol_addrs.txt
symbol_addrs_path:
- linker_scripts/symbols/addr.txt
- linker_scripts/symbols/libmus_addr.txt
# asm_path: asm
# src_path: src
# build_path: build
@ -38,7 +40,7 @@ segments:
start: 0x1000
vram: 0x80070C00
subsegments:
- [0x1000, asm, "entry_code"]
- [0x1000, asm, "entry"]
- name: main
type: code
@ -81,12 +83,15 @@ segments:
- [0x11440, asm]
- [0x11480, asm]
- [0x114F0, asm, "libmus"]
- [0x114F0, asm, "libmus/player_api"]
- [0x12530, asm]
- [0x155C0, asm]
- [0x15A20, asm]
- [0x15BD0, asm]
- [0x15E90, asm]
- [0x15BD0, asm, "libmus/aud_thread"]
- [0x15E90, asm, "libmus/memory"]
- [0x15FD0, asm]
- [0x16100, asm]
- [0x17090, asm]
- [0x177B0, asm]

View File

@ -2,11 +2,11 @@
void boot(void) {
osInitialize();
osCreateThread(&THREAD_IDLE, 1, idle, NULL, SP_THREAD_IDLE, 0xA);
osStartThread(&THREAD_IDLE);
osCreateThread(&obThreadIdle, 1, obIdle, NULL, obStackIdle, 0xA);
osStartThread(&obThreadIdle);
}
void idle(void* arg) {
void obIdle(void* arg) {
D_800E7A18 = NULL;
obInitializePi();
@ -17,7 +17,7 @@ void idle(void* arg) {
osCreateThread(&THREAD_FIRST_DMA_LOAD, 3, main_, NULL, SP_THREAD_FIRST_DMA_LOAD, 0xA);
osStartThread(&THREAD_FIRST_DMA_LOAD);
osSetThreadPri(&THREAD_IDLE, OS_PRIORITY_IDLE);
osSetThreadPri(&obThreadIdle, OS_PRIORITY_IDLE);
while(1) {
if (D_800E7A18 != NULL) {

View File

@ -2,17 +2,10 @@
void __load_song(void*);
extern void Mus__unknown_80081DB4(const void* arg0, const void* arg1);
extern u8 D_8010A760[];
extern u8 D_80164770[];
extern u8 D_80104710[];
extern void func_80081A54(s32, s32);
extern s32 func_80081B08(s32);
extern s32 func_80081770(s32);
extern void func_80081DF0(const void*);
extern s32 D_800EB0E8;
/* 3F1B0 800E9C20 */
@ -62,17 +55,17 @@ void func_800EA3BC(SomethingMusic* arg0) {
void func_800EA3E4(SomethingMusic* arg0) {
s32 var_v0;
if (func_80081B08(arg0->handle) == 0) {
if (MusHandleAsk(arg0->handle) == 0) {
D_800EB0E8 = 0;
__load_song(arg0);
return;
}
if (arg0->field_0x38 == 0) {
if (arg0->field_0x34 != 0) {
func_80081A54(arg0->handle, arg0->field_0x34);
MusHandleStop(arg0->handle, arg0->field_0x34);
arg0->field_0x3c = arg0->field_0x34 + 3;
} else {
func_80081A54(arg0->handle, 1);
MusHandleStop(arg0->handle, 1);
arg0->field_0x3c = 3;
}
arg0->field_0x38 = 2;
@ -88,18 +81,18 @@ INCLUDE_ASM(const s32, "segment_song/ob_knotty_chess", __load_song);
void func_800EA568(SomethingMusic* arg0) {
if (arg0->field_0x18 != 0) {
if (func_80081B08(arg0->handle) != 0) {
func_80081A54(arg0->handle, 0);
if (MusHandleAsk(arg0->handle) != 0) {
MusHandleStop(arg0->handle, 0);
}
} else {
if ((arg0->field_0x28 != -1) && (func_80081B08(arg0->field_0x28) != 0)) {
func_80081A54(arg0->field_0x28, 0);
if ((arg0->field_0x28 != -1) && (MusHandleAsk(arg0->field_0x28) != 0)) {
MusHandleStop(arg0->field_0x28, 0);
}
}
arg0->field_0x28 = arg0->handle;
func_80081DF0(&D_80104710);
arg0->handle = func_80081770(arg0->field_0x2c - 1);
MusPtrBankSetSingle(&D_80104710);
arg0->handle = MusStartEffect(arg0->field_0x2c - 1);
arg0->field_0x20 = arg0->field_0x2c;
}