Compare commits

..

7 Commits

Author SHA1 Message Date
gijs 9669273d02 Fixed `m2ctx` 2023-10-10 13:23:49 +02:00
gijs 8aca547092 Tried decompiling func_8007896C but it didn't match.. 2023-10-10 13:06:42 +02:00
gijs c30c278972 Before I do something stupid... 2023-09-30 09:58:59 +02:00
gijs d1f07791c9 Cleaned up `splat.yaml` 2023-09-30 01:09:12 +02:00
gijs 2efd0cbbe9 Merged `__read_u32_le` and `UnpackProc` from `lha.c` to `_ob_rabid_jar` 2023-09-30 00:58:19 +02:00
gijs 9e1dd54094 Merged old `_ob_overconfident_mother` with `_ob_rabid_jar` 2023-09-29 18:54:56 +02:00
gijs dccd234f4a Decompiled `UnusedMallocNo` 2023-09-29 18:53:09 +02:00
8 changed files with 450 additions and 56 deletions

View File

@ -253,7 +253,7 @@ typedef struct {
ASSERT_SIZE(OverlaySomething, 0x14);
extern OverlaySomething* (*D_800AF028[24])(void);
extern OverlaySomething* (*D_800AF028[])(void);
extern OverlaySomething* D_800E8294;
@ -270,7 +270,7 @@ extern void __setup_overlay_87200(void);
extern void __setup_overlay_71280_51674(void);
extern void __setup_overlay_71280_51940(void);
extern u32* func_80076188(void);
extern OverlaySomething* func_80076188(void);
extern void func_80076194(void);
extern void func_800761A4(void);
extern void __loads_overlay_array(s32 arg0);
@ -333,7 +333,6 @@ extern const char STR_CREATING_NEW_DATA[];
extern const char STR_CREATING_A_NEW_FILE[];
extern const char STR_ADDING_NEW_DATA[];
extern const char STR_buSave_SAVING[];
extern const char STR_UNUSEDMALLOCNO_INSUFFICIENT_MEMORY[];
// extern const char STR_LHa___s_s__s[];
extern const char STR_Error[];
@ -388,7 +387,7 @@ extern void func_801C889C(s32 arg0);
extern void func_8007337C(void);
extern void func_801C8864(void);
extern u32 D_800A872C[];
extern OverlaySomething D_800A872C;
extern CharacterSlot CHARACTER_SLOT[0x64];

View File

@ -575,7 +575,7 @@ STR_CREATING_A_NEW_FILE = 0x800ADEC8;
STR_ADDING_NEW_DATA = 0x800ADEA4; // type:asciz
STR_buSave_SAVING = 0x800ADF08; // type:asciz
STR_UNUSEDMALLOCNO_INSUFFICIENT_MEMORY = 0x800ADF88; // type:asciz force_migration:True
STR_UNUSEDMALLOCNO_INSUFFICIENT_MEMORY = 0x800ADF88; // type:asciz
STR_FILE_NOT_FOUND = 0x800AE2AC; // type:asciz force_migration:True
D_overlay_286BD0_8023E378_29A2B8 = 0x8023E378; // type:asciz rom:0x29A2B8
@ -622,7 +622,7 @@ D_800E7D90 = 0x800E7D90; // size:0x58
D_800E7DE8 = 0x800E7DE8; // size:0x58
D_800AEFE0 = 0x800AEFE0; // size:0x8
VALID_LHA_MAGIC = 0x800A8750;
VALID_LHA_MAGIC = 0x800A8750; // type:u32 size:0x24
STR_LHa___s_s__s = 0x800AE30C; // type:asciz
STR_Error = 0x800AE31C; // type:asciz

View File

@ -54,13 +54,11 @@ segments:
find_file_boundaries: True
subsegments:
- [0x1060, c, "main"]
# Unsure about these
- [0x4AC0, asm, "_ob_overconfident_mother"]
- [0x5FC0, asm, "_ob_rabid_jar"]
- [0x68E0, asm]
- [0x8700, asm]
- [0xA370, asm, "lha"]
- [0x4AC0, c, "_ob_overconfident_mother"]
- [0x5FC0, c, "_ob_rabid_jar"]
# Needs string fixing
- [0xB0B0, asm, "_ob_creepy_middle"]
- [0xFC80, c, "boot"]
- [0xFDC0, c, "_ob_spooky_degree"]
@ -328,9 +326,9 @@ segments:
- [0x3E100, data]
- [0x3E330, rodata]
- [0x3E330, .rodata, "_ob_rabid_jar"]
- [0x3E460, rodata]
- [0x3E4A0, rodata, "_ob_creepy_middle"]
- [0x3E7A0, .rodata, "_ob_spooky_degree"]
- [0x3E7C0, .rodata, "_ob_ambitious_fold"]
- [0x3E7D0, .rodata, "_ob_rebel_pull"]
@ -1360,7 +1358,7 @@ segments:
# - { start: 0x281860, type: bss, vram: 0x8022D0D0 }
# # __SOME_OVERLAY_TABLE[14]
# __SOME_OVERLAY_TABLE[14]
# - type: code
# dir: overlay_281860
# start: 0x281860
@ -1373,11 +1371,9 @@ segments:
# - [0x282FE0, asm]
# - [0x283DF0, asm]
# - [0x2866F0, rodata, 282FE0]
# - [0x286940, rodata]
# - [0x286960, rodata]
# - [0x286B50, rodata, 281860]
# - [0x286B90, rodata, 283DF0]
# - [0x2866F0, data]
# - [0x286B50, rodata]
# - { start: 0x286BD0, type: bss, vram: 0x8022AC00 }

View File

@ -0,0 +1,52 @@
#include "common.h"
void func_800746C0(void) {
}
INCLUDE_ASM(const s32, "_ob_overconfident_mother", func_800746C8);
INCLUDE_ASM(const s32, "_ob_overconfident_mother", func_80074834);
INCLUDE_ASM(const s32, "_ob_overconfident_mother", buSave);
INCLUDE_ASM(const s32, "_ob_overconfident_mother", func_800749C0);
INCLUDE_ASM(const s32, "_ob_overconfident_mother", func_80074AD4);
INCLUDE_ASM(const s32, "_ob_overconfident_mother", func_80074BF0);
INCLUDE_ASM(const s32, "_ob_overconfident_mother", func_80074C58);
INCLUDE_ASM(const s32, "_ob_overconfident_mother", romCopy_256);
INCLUDE_ASM(const s32, "_ob_overconfident_mother", func_80074DA0);
INCLUDE_ASM(const s32, "_ob_overconfident_mother", func_80074F9C);
INCLUDE_ASM(const s32, "_ob_overconfident_mother", func_8007513C);
INCLUDE_ASM(const s32, "_ob_overconfident_mother", func_80075224);
INCLUDE_ASM(const s32, "_ob_overconfident_mother", func_80075360);
INCLUDE_ASM(const s32, "_ob_overconfident_mother", func_8007541C);
INCLUDE_ASM(const s32, "_ob_overconfident_mother", func_80075578);
INCLUDE_ASM(const s32, "_ob_overconfident_mother", func_80075688);
INCLUDE_ASM(const s32, "_ob_overconfident_mother", func_8007578C);
INCLUDE_ASM(const s32, "_ob_overconfident_mother", func_80075858);
INCLUDE_ASM(const s32, "_ob_overconfident_mother", func_800758FC);
INCLUDE_ASM(const s32, "_ob_overconfident_mother", func_8007599C);
INCLUDE_ASM(const s32, "_ob_overconfident_mother", func_80075A84);
INCLUDE_ASM(const s32, "_ob_overconfident_mother", func_80075AC4);
INCLUDE_ASM(const s32, "_ob_overconfident_mother", func_80075B00);
INCLUDE_ASM(const s32, "_ob_overconfident_mother", func_80075B60);

371
src/_ob_rabid_jar.c Normal file
View File

@ -0,0 +1,371 @@
#include "common.h"
typedef struct {
s32 field_0x0;
u8 field_0x4[0xA0];
s32 field_0x8;
} SomethingMalloc;
extern SomethingMalloc D_800E8300[];
INCLUDE_ASM(const s32, "_ob_rabid_jar", __calls_loads_overlay_array);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80076150);
/* 6550 80076150 */
// s8 func_80076150(u16 arg0) {
// switch (arg0) {
// case 3:
// case 4:
// case 5:
// case 6:
// case 7:
// case 10:
// case 11:
// case 15:
// case 18:
// case 23:
// return 0;
// default:
// return 1;
// }
// }
/* 6588 80076188 */
OverlaySomething* func_80076188(void) {
return &D_800A872C;
}
/* 6594 80076194 */
void func_80076194(void) {
D_800C4C26 = 0xFFFE;
}
/* 65A4 800761A4 */
void func_800761A4(void) {
func_80073164(0, 1, 1, 0x80, 1, 0x100, 0x2000);
}
INCLUDE_ASM(const s32, "_ob_rabid_jar", __loads_overlay_array);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80076324);
INCLUDE_ASM(const s32, "_ob_rabid_jar", __get_overlay_index);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_800764E0);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_800765D8);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80076AE8);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80076DC8);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80076E00);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80076E2C);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80076E58);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80076EAC);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80076F00);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80076F5C);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_8007705C);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80077160);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80077200);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80077288);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80077314);
/* 7768 80077368 */
s32 UnusedMallocNo(s32 arg0) {
s32 var_a1;
SomethingMalloc** var_v1;
var_a1 = 0;
var_v1 = &D_800E8300[arg0];
loop_1:
if (*var_v1 != 0) {
var_a1 += 1;
var_v1 += 1;
if (var_a1 >= 10) {
osSyncPrintf("UnusedMallocNo(): 空きがない!\n");
while(1);
}
goto loop_1;
}
return var_a1;
}
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_800773D4);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_8007740C);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_8007745C);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80077494);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_800775EC);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80077BF8);
void func_80077F80(void) { }
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80077F88);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_800780D4);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80078164);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_8007819C);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_800782EC);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80078300);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_8007834C);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80078658);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80078674);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_8007896C);
// s32 func_8007338C(); /* extern */
// extern s32 D_800E8210;
// /* 8D6C 8007896C */
// void func_8007896C(s16 arg0, s16 arg1, s16 arg2, s16 arg3) {
// s16 ulx;
// s16 uly;
// s16 lrx;
// s16 lry;
// // s32 temp_a0;
//
// lry = arg0;
// lrx = arg1;
// ulx = arg2;
// uly = arg3;
// if (func_8007338C() != 0) {
// if (arg0 < 0) {
// lry = 0;
// } else if (arg0 >= 320) {
// lry = 319;
// }
// if (lrx < 0) {
// lrx = 0;
// } else if (lrx >= 320) {
// lrx = 319;
// }
// if (ulx < 0) {
// ulx = 0;
// } else if (ulx >= 320) {
// ulx = 319;
// }
// if (uly < 0) {
// uly = 0;
// } else if (uly >= 240) {
// uly = 239;
// }
//
// gDPPipeSync(obPtrDisplayList++);
//
// // obPtrDisplayList = temp_v0 + 8;
// // temp_v0->unk8 = 0xE200001C;
// // temp_v0->unkC = 0;
// gDPSetRenderMode(obPtrDisplayList++, G_RM_NOOP, G_RM_NOOP2);
//
// gDPPipeSync(obPtrDisplayList++);
// gDPPipeSync(obPtrDisplayList++);
// gDPPipeSync(obPtrDisplayList++);
//
// // obPtrDisplayList = temp_v0 + 0x28;
// // temp_v0->unk28 = 0xE3000A01;
// // temp_v0->unk2C = 0x00300000;
// gDPSetCycleType(obPtrDisplayList++, G_CYC_FILL);
//
// // obPtrDisplayList = temp_v0 + 0x30;
// // temp_v0->unk30 = 0xE7000000U;
// // temp_v0->unk34 = 0;
// gDPPipeSync(obPtrDisplayList++);
//
// // obPtrDisplayList = temp_v0 + 0x38;
// // temp_v0->unk38 = 0xFE000000;
// // temp_v0->unk3C = temp_a0;
// gDPSetDepthImage(obPtrDisplayList++, D_800C4B20 - 0x80000000);
//
// // obPtrDisplayList = temp_v0 + 0x40;
// // temp_v0->unk40 = 0xFF10013F;
// // temp_v0->unk44 = temp_a0;
// gDPSetColorImage(obPtrDisplayList++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 320, D_800C4B20 - 0x80000000);
//
// // obPtrDisplayList = temp_v0 + 0x48;
// // temp_v0->unk48 = 0xF7000000;
// // temp_v0->unk4C = 0xFFFCFFFC;
// gDPSetFillColor(obPtrDisplayList++, 0xFFFCFFFC);
//
// // obPtrDisplayList = temp_v0 + 0x50;
// // temp_v0->unk50 = 0xE7000000U;
// // temp_v0->unk54 = 0;
// gDPPipeSync(obPtrDisplayList++);
//
// // obPtrDisplayList = temp_v0 + 0x58;
// // temp_v0->unk58 = (s32) (((ulx & 0x3FF) << 0xE) | (((uly & 0x3FF) * 4) | 0xF6000000));
// // temp_v0->unk5C = (s32) (((lry & 0x3FF) << 0xE) | ((lrx & 0x3FF) * 4));
// gDPFillRectangle(obPtrDisplayList++, ulx, uly, lrx, lry);
//
// // obPtrDisplayList = temp_v0 + 0x60;
// // temp_v0->unk60 = 0xE7000000U;
// // temp_v0->unk64 = 0;
// gDPPipeSync(obPtrDisplayList++);
//
// // obPtrDisplayList = temp_v0 + 0x68;
// // temp_v0->unk68 = 0xE7000000U;
// // temp_v0->unk6C = 0;
// gDPPipeSync(obPtrDisplayList++);
//
// // obPtrDisplayList = temp_v0 + 0x70;
// // temp_v0->unk70 = 0xE7000000U;
// // temp_v0->unk74 = 0;
// gDPPipeSync(obPtrDisplayList++);
//
// // obPtrDisplayList = temp_v0 + 0x78;
// // temp_v0->unk78 = 0xE7000000U;
// // temp_v0->unk7C = 0;
// gDPPipeSync(obPtrDisplayList++);
//
// // obPtrDisplayList = temp_v0 + 0x80;
// // temp_v0->unk80 = 0xFF10013F;
// // temp_v0->unk84 = (s32) (D_800E8210 - 0x80000000);
// gDPSetColorImage(obPtrDisplayList++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 320, D_800E8210 - 0x80000000);
//
// // obPtrDisplayList = temp_v0 + 0x88;
// // temp_v0->unk88 = 0xE7000000U;
// // temp_v0->unk8C = 0;
// gDPPipeSync(obPtrDisplayList++);
//
// // obPtrDisplayList = temp_v0 + 0x90;
// // temp_v0->unk90 = 0xE7000000U;
// // temp_v0->unk94 = 0;
// gDPPipeSync(obPtrDisplayList++);
//
// // obPtrDisplayList = temp_v0 + 0x98;
// // temp_v0->unk98 = 0xE3000A01;
// // temp_v0->unk9C = 0;
// gDPSetCycleType(obPtrDisplayList++, G_CYC_1CYCLE);
//
// // obPtrDisplayList = temp_v0 + 0xA0;
// // temp_v0->unkA0 = 0xE7000000U;
// // temp_v0->unkA4 = 0;
// gDPPipeSync(obPtrDisplayList++);
//
// // obPtrDisplayList = temp_v0 + 0xA8;
// }
// }
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80078C6C);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80079028);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_8007913C);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80079358);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80079380);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_8007938C);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80079618);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80079850);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_800798AC);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80079950);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80079AFC);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80079BD8);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80079CB4);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80079D60);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80079D98);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80079DF8);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80079E50);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80079E9C);
/* A29C 80079E9C */
// Arg_800712C4* func_80079E9C(Arg_800712C4* arg0) {
// Arg_800712C4* var_s0;
// var_s0 = arg0;
// if (var_s0 != NULL) {
// var_s0->field_0x10 = func_80079E9C(var_s0->field_0x10);
// var_s0->field_0x14 = func_80079E9C(var_s0->field_0x14);
// func_800712C4(var_s0->field_0x4);
// func_800712C4(var_s0);
// var_s0 = NULL;
// }
// return var_s0;
// }
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80079EF4);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_80079F70);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_8007A070);
INCLUDE_ASM(const s32, "_ob_rabid_jar", Unpack);
/* ABE0 8007A7E0 */
u32 __read_u32_le(u8* arg0) {
return (arg0[0] << 24) | (arg0[1] << 16) | (arg0[2] << 8) | arg0[3];
}
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_8007A80C);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_8007AB30);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_8007AB7C);
INCLUDE_ASM(const s32, "_ob_rabid_jar", func_8007ABAC);
void Unpack(s32, s32);
extern OSMesgQueue MQ_800AF320;
/* B030 8007AC30 */
void UnpackProc(void) {
struct {
/* 0x00 */ s32 field_0x0;
/* 0x04 */ OSMesgQueue* field_0x4;
/* 0x08 */ u8 field_0x8;
/* 0x09 */ u8 field_0x9[3];
/* 0x0C */ s32 field_0xc;
/* 0x10 */ s32 field_0x10;
} *sp10;
sp10 = NULL;
while(1) {
osRecvMesg(&MQ_800AF320, &sp10, 1);
if (sp10->field_0x8 == 1) {
Unpack(sp10->field_0x10, sp10->field_0xc);
osSendMesg(sp10->field_0x4, sp10, 1);
} else {
osSyncPrintf("UnpackProc: no supported format %d\n", sp10->field_0x8);
}
}
}

View File

@ -1,26 +0,0 @@
#include "common.h"
INCLUDE_ASM(const s32, "_ob_overconfident_mother", __calls_loads_overlay_array);
INCLUDE_ASM(const s32, "_ob_overconfident_mother", func_80076150);
/* 6588 80076188 */
u32* func_80076188(void) {
return &D_800A872C;
}
/* 6594 80076194 */
void func_80076194(void) {
D_800C4C26 = 0xFFFE;
}
/* 65A4 800761A4 */
void func_800761A4(void) {
func_80073164(0, 1, 1, 0x80, 1, 0x100, 0x2000);
}
INCLUDE_ASM(const s32, "_ob_overconfident_mother", __loads_overlay_array);
INCLUDE_ASM(const s32, "_ob_overconfident_mother", func_80076324);
INCLUDE_ASM(const s32, "_ob_overconfident_mother", __get_overlay_index);

View File

@ -222,12 +222,12 @@ u8* __SOME_OVERLAY_ID_ARRAY[] = {
u32 D_800A8728 = NULL;
/* 38B2C 800A872C */
u32 D_800A872C[] = {
0x800761A4,
0x00000000,
0x00000000,
0x00000000,
0x0000000C
OverlaySomething D_800A872C = {
.setup = func_800761A4,
.field_0x4 = 0x00000000,
.field_0x8 = 0x00000000,
.field_0xc = 0x00000000,
.field_0x10 = 0x0000000C
};
/* 38B40 800A8740 */

View File

@ -14,12 +14,14 @@ src_dir = root_dir + "src/"
CPP_FLAGS = [
"-Iinclude",
"-Isrc",
"-Ilib/libreultra/include/2.0I/",
"-Iinclude",
"-Iinclude/ultra",
"-Iinclude/ultra/PR",
"-D_LANGUAGE_C",
"-DF3DEX_GBI_2",
"-D_MIPS_SZLONG=32",
"-DSCRIPT(...)={}",
"-D__attribute__(...)=",
# "-DSCRIPT(...)={}",
# "-D__attribute__(...)=",
"-D__asm__(...)=",
"-ffreestanding",
"-DM2CTX",