Compare commits

..

16 Commits

Author SHA1 Message Date
gijs 3898d55536 Decompile `nuContPakFileState` 2023-10-22 12:34:06 +02:00
gijs bfcff8047b Decompile `nuContPakFileDelete` 2023-10-22 12:31:24 +02:00
gijs 361d4d7ffd Decompile `nuContPakFileReadWrite` 2023-10-22 12:25:50 +02:00
gijs 3114542ad4 Decompile `nuContPakGetFree` 2023-10-22 12:15:14 +02:00
gijs bfb4394cee Decompile `nuContPakOpen` 2023-10-22 11:59:06 +02:00
gijs 012990335c Split `nucontpak` files
Add `nucontpakopen.c`
Add `nucontpakgetfree.c`
Add `nucontpakrepairid.c`
Add `nucontpakfileopen.c`
Add `nucontpakfilereadwrite.c`
Add `nucontpakfiledelete.c`
Add `nucontpakfilestate.c`
2023-10-22 11:53:42 +02:00
gijs cce70d0aae Rename `func_8008AC70` to `nuContPakRepairId` 2023-10-22 11:48:16 +02:00
gijs 61cfbc8ecc Rename `func_8008AF20` to `nuContPakFileState` 2023-10-22 11:47:27 +02:00
gijs 829779629c Rename `func_8008AEE0` to `nuContPakFileDelete` 2023-10-22 11:46:42 +02:00
gijs 04531517aa Rename `func_8008AE90` to `nuContPakFileReadWrite` 2023-10-22 11:45:51 +02:00
gijs ad40f4824d Rename `func_8008ACA0` to `nuContPakFileOpen` 2023-10-22 11:45:12 +02:00
gijs d77ebe8dbf Rename `func_8008AC30` to `nuContPakGetFree` 2023-10-22 11:43:47 +02:00
gijs 80749648af Rename `func_8008ABD0` to `nuContPakOpen` 2023-10-22 11:43:05 +02:00
gijs bf2367a63b Rename `nuContPak` functions Impl
These functions are not actually named this, but are called through the message queue
2023-10-22 11:40:45 +02:00
gijs 33e5f17c1c Change type of `handle` in `SomethingMusic` to `musHandle` 2023-10-22 02:05:21 +02:00
gijs c1eebe544b Identify some audio things
Rename `D_800EB2E4` to `__SONG_REVERB`
Rename `field_0x2c` of `SomethingMusic` to `index`
2023-10-22 02:04:23 +02:00
13 changed files with 134 additions and 37 deletions

View File

@ -91,9 +91,9 @@ typedef struct {
/* 0x18 */ s32 field_0x18;
/* 0x1C */ s32 field_0x1c;
/* 0x20 */ s32 field_0x20;
/* 0x24 */ unsigned long handle;
/* 0x24 */ musHandle handle;
/* 0x28 */ s32 field_0x28;
/* 0x2C */ s32 field_0x2c;
/* 0x2C */ s32 index;
/* 0x30 */ s32 field_0x30;
/* 0x34 */ s32 field_0x34;
/* 0x38 */ s32 field_0x38;

View File

@ -48,6 +48,7 @@ nuSiCallBackList = 0x800A9EA0;
nuGfxTaskEndFunc = 0x800A9E88;
nuStackSiMgrThread = 0x800BC030;
nuStackGfxThread = 0x800C0370;
nuContPfs = 0x800E99E8;
nuBoot = 0x8007F880;
nuScCreateScheduler = 0x80088C50; // rom:0x19050
@ -97,16 +98,25 @@ nuContDataOpen = 0x8008A37C;
nuContDataGetAll = 0x8008A600;
nuContRetrace = 0x8008A47C;
nuContReadFuncSet = 0x8008A660;
nuContPakMgrInit = 0x8008A6A0;
nuContPakMgrRemove = 0x8008A6C0;
nuContPakRepairId = 0x8008A8E8;
nuContPakFileState = 0x8008A890;
nuContPakFileNum = 0x8008A8BC;
nuContPakFileDelete = 0x8008A850;
nuContPakFileOpen = 0x8008A798;
nuContPakFileReadWrite = 0x8008A758;
nuContPakGetFree = 0x8008A730;
nuContPakOpen = 0x8008A6E0;
nuContPakOpen = 0x8008ABD0;
nuContPakOpenImpl = 0x8008A6E0;
nuContPakGetFree = 0x8008AC30;
nuContPakGetFreeImpl = 0x8008A730;
nuContPakFileReadWrite = 0x8008AE90;
nuContPakFileReadWriteImpl = 0x8008A758;
nuContPakFileOpen = 0x8008ACA0;
nuContPakFileOpenImpl = 0x8008A798;
nuContPakFileDelete = 0x8008AEE0;
nuContPakFileDeleteImpl = 0x8008A850;
nuContPakFileState = 0x8008AF20;
nuContPakFileStateImpl = 0x8008A890;
nuContPakFileNumImpl = 0x8008A8BC;
nuContPakRepairId = 0x8008AC70;
nuContPakRepairIdImpl = 0x8008A8E8;
obUnpackThreadStart = 0x8007ABAC;
@ -980,6 +990,7 @@ __read_u32_le = 0x8007A7E0;
__load_song = 0x800EA488; // rom:0x3FA18
__SONG_VOLUME = 0x800EB2E0;
__SONG_REVERB = 0x800EB2E4;
__SONG_SOURCE_START = 0x800EB4F0;
__SONG_SOURCE_END = 0x800EB4F4;

View File

@ -133,14 +133,15 @@ segments:
- [0x1AA60, c, "nu/nucontreadfuncset"]
- [0x1AAA0, c, "nu/nucontpakmgr"]
- [0x1AD10, asm]
- [0x1AFD0, asm]
- [0x1B030, asm]
- [0x1B070, asm]
- [0x1AFD0, c, "nu/nucontpakopen"]
- [0x1B030, c, "nu/nucontpakgetfree"]
- [0x1B070, c, "nu/nucontpakrepairid"]
- [0x1B0A0, c, "nu/nucontpakfileopen"]
- [0x1B160, asm]
- [0x1B240, asm]
- [0x1B290, asm]
- [0x1B2E0, asm]
- [0x1B320, asm]
- [0x1B290, c, "nu/nucontpakfilereadwrite"]
- [0x1B2E0, c, "nu/nucontpakfiledelete"]
- [0x1B320, c, "nu/nucontpakfilestate"]
- [0x1B360, asm]
- [0x1B3A0, c, "_ob_electric_zephyr"]
- [0x1B3E0, c, "nu/nugfxthread"]

View File

@ -456,13 +456,13 @@ INCLUDE_ASM(const s32, "main", func_80073CB0);
/* 42D8 80073ED8 */
void func_80073ED8(void) {
if (D_800A81F4 == 0) {
__MAYBE_SONG_800EB0B0.field_0x2c = 0;
__MAYBE_SONG_800EB100.field_0x2c = 0;
__MAYBE_SONG_800EB150.field_0x2c = 0;
__MAYBE_SONG_800EB1A0.field_0x2c = 0;
__MAYBE_SONG_800EB1F0.field_0x2c = 0;
__MAYBE_SONG_800EB240.field_0x2c = 0;
__MAYBE_SONG_800EB290.field_0x2c = 0;
__MAYBE_SONG_800EB0B0.index = 0;
__MAYBE_SONG_800EB100.index = 0;
__MAYBE_SONG_800EB150.index = 0;
__MAYBE_SONG_800EB1A0.index = 0;
__MAYBE_SONG_800EB1F0.index = 0;
__MAYBE_SONG_800EB240.index = 0;
__MAYBE_SONG_800EB290.index = 0;
MusStop(MUSFLAG_SONGS | MUSFLAG_EFFECTS, 12);
D_800A81F4 = 12;
D_800A81F8 = nuScRetraceCounter;
@ -478,7 +478,7 @@ void __initialize_song_mem(void) {
mask = osSetIntMask(OS_IM_NONE);
for(count = 0; count < 7; count++) {
__MAYBE_SONG_ARRAY_800A8218[count]->field_0x2c = 0;
__MAYBE_SONG_ARRAY_800A8218[count]->index = 0;
__MAYBE_SONG_ARRAY_800A8218[count]->field_0x30 = 0;
__MAYBE_SONG_ARRAY_800A8218[count]->field_0x34 = 0;
__MAYBE_SONG_ARRAY_800A8218[count]->field_0x38 = 0;

View File

@ -0,0 +1,16 @@
#include "common.h"
#include "nu/nusys.h"
/* 1B2E0 8008AEE0 */
s32 nuContPakFileDelete(NUContPakFile* file, u8* noteName, u8* extName) {
NUContPakFileOpenMesg mesg;
mesg.file = file;
mesg.noteName = noteName;
mesg.extName = extName;
file->error = nuSiSendMesg(NU_CONT_PAK_FILEDELETE_MSG, &mesg);
return file->error;
}

View File

@ -0,0 +1,3 @@
#include "common.h"
INCLUDE_ASM(const s32, "nu/nucontpakfileopen", nuContPakFileOpen);

View File

@ -0,0 +1,18 @@
#include "common.h"
#include "nu/nusys.h"
/* 1B290 8008AE90 */
s32 nuContPakFileReadWrite(NUContPakFile* file, s32 offset, s32 size, u8* buf, u32 mode) {
NUContPakFileRWMesg mesg;
mesg.file = file;
mesg.offset = offset;
mesg.size = size;
mesg.mode = mode;
mesg.buf = buf;
file->error = nuSiSendMesg(NU_CONT_PAK_READWRITE_MSG, &mesg);
return file->error;
}

View File

@ -0,0 +1,15 @@
#include "common.h"
#include "nu/nusys.h"
/* 1B320 8008AF20 */
s32 nuContPakFileState(NUContPakFile* file, OSPfsState* state) {
NUContPakFileStateMesg sp10;
sp10.file = file;
sp10.state = state;
file->error = nuSiSendMesg(0x206, &sp10);
return file->error;
}

13
src/nu/nucontpakgetfree.c Normal file
View File

@ -0,0 +1,13 @@
#include "common.h"
#include "nu/nusys.h"
/* 1B030 8008AC30 */
s32 nuContPakGetFree(NUContPakFile* file) {
NUContPakFreeMesg mesg;
mesg.file = file;
file->error = nuSiSendMesg(NU_CONT_PAK_FREE_MSG, &mesg);
return mesg.size;
}

View File

@ -11,18 +11,18 @@ void nuContPakMgrRemove(void) {
nuSiCallBackRemove(&nuContPakCallBack);
}
INCLUDE_ASM(const s32, "nu/nucontpakmgr", nuContPakOpen);
INCLUDE_ASM(const s32, "nu/nucontpakmgr", nuContPakOpenImpl);
INCLUDE_ASM(const s32, "nu/nucontpakmgr", nuContPakGetFree);
INCLUDE_ASM(const s32, "nu/nucontpakmgr", nuContPakGetFreeImpl);
INCLUDE_ASM(const s32, "nu/nucontpakmgr", nuContPakFileReadWrite);
INCLUDE_ASM(const s32, "nu/nucontpakmgr", nuContPakFileReadWriteImpl);
INCLUDE_ASM(const s32, "nu/nucontpakmgr", nuContPakFileOpen);
INCLUDE_ASM(const s32, "nu/nucontpakmgr", nuContPakFileOpenImpl);
INCLUDE_ASM(const s32, "nu/nucontpakmgr", nuContPakFileDelete);
INCLUDE_ASM(const s32, "nu/nucontpakmgr", nuContPakFileDeleteImpl);
INCLUDE_ASM(const s32, "nu/nucontpakmgr", nuContPakFileState);
INCLUDE_ASM(const s32, "nu/nucontpakmgr", nuContPakFileStateImpl);
INCLUDE_ASM(const s32, "nu/nucontpakmgr", nuContPakFileNum);
INCLUDE_ASM(const s32, "nu/nucontpakmgr", nuContPakFileNumImpl);
INCLUDE_ASM(const s32, "nu/nucontpakmgr", nuContPakRepairId);
INCLUDE_ASM(const s32, "nu/nucontpakmgr", nuContPakRepairIdImpl);

17
src/nu/nucontpakopen.c Normal file
View File

@ -0,0 +1,17 @@
#include "common.h"
#include "nu/nusys.h"
/* 1AFD0 8008ABD0 */
s32 nuContPakOpen(NUContPakFile* file, u32 contNo) {
OSPfs* pfs;
pfs = &nuContPfs[contNo];
file->pfs = pfs;
pfs->channel = contNo;
file->error = nuSiSendMesg(NU_CONT_PAK_OPEN_MSG, file);
return file->error;
}

View File

@ -0,0 +1,3 @@
#include "common.h"
INCLUDE_ASM(const s32, "nu/nucontpakrepairid", nuContPakRepairId);

View File

@ -47,7 +47,7 @@ void func_800EA3BC(SomethingMusic* arg0) {
arg0->field_0x8 = 0;
arg0->field_0xc = 0;
arg0->field_0x2c = temp_v0;
arg0->index = temp_v0;
arg0->field_0x30 = temp_v1;
arg0->field_0x34 = temp_a1;
}
@ -71,10 +71,10 @@ void func_800EA3E4(SomethingMusic* arg0) {
arg0->field_0x3c = 3;
}
arg0->field_0x38 = 2;
arg0->field_0x40 = arg0->field_0x2c;
arg0->field_0x40 = arg0->index;
return;
}
arg0->field_0x40 = arg0->field_0x2c;
arg0->field_0x40 = arg0->index;
}
INCLUDE_ASM(const s32, "segment_song/_ob_knotty_chess", __load_song);
@ -94,8 +94,8 @@ void func_800EA568(SomethingMusic* arg0) {
arg0->field_0x28 = arg0->handle;
MusPtrBankSetSingle(&D_80104710);
arg0->handle = MusStartEffect(arg0->field_0x2c - 1);
arg0->field_0x20 = arg0->field_0x2c;
arg0->handle = MusStartEffect(arg0->index - 1);
arg0->field_0x20 = arg0->index;
}
INCLUDE_ASM(const s32, "segment_song/_ob_knotty_chess", func_800EA604);