diff --git a/find_splits.py b/find_splits.py new file mode 100644 index 0000000..1b31cbc --- /dev/null +++ b/find_splits.py @@ -0,0 +1,24 @@ +import os +import re + +rodata_syms = set() + +for root, dirs, files in os.walk("asm/data"): + for file in files: + if file.endswith(".rodata.s"): + with open(os.path.join(root, file)) as f: + data = f.read() + for match in re.finditer("(glabel )(D_([0-9A-F]+))", data): + rodata_syms.add(match.group(2)) + +for root, dirs, files in os.walk("asm"): + for file in files: + if "blob" in file: + print("Scanning " + file) + with open(os.path.join(root, file)) as f: + data = f.read() + + for sym in rodata_syms: + num = data.count(sym) + if num > 2: + pass diff --git a/kh.jp.yaml b/kh.jp.yaml index dce2123..ba26767 100644 --- a/kh.jp.yaml +++ b/kh.jp.yaml @@ -29,11 +29,33 @@ segments: vram: 0x100000 bss_size: 0x1E1500 subsegments: - - [0x80, asm, blob1] - - [0x1FCD8, c, kingdom] - - [0x207F8, asm, blob2] - - [0x3ABE8, c, unnamed_apple] - - [0x3BD28, asm, blob3] + - [0x80, asm] + - [0x1260, c, xporcupine] + - [0x15A8, asm] + - [0x11FE8, c, xspinach] + - [0x121E8, asm] + - [0x1FCD8, c, xkingdom] + - [0x207F8, asm] + - [0x3ABE8, c, xapple] + - [0x3BD28, asm] + - [0x49D68, c, xsquash] + - [0x4A098, asm] + - [0xA8828, c, xpear] + - [0xA9300, asm] + - [0xDEEF8, c, xstuck] + - [0xDF218, asm] + - [0xF3AA0, c, xmeowp] + - [0xF4910, asm] + - [0x119868, c, xrodent] + - [0x11A450, asm] + - [0x144510, c, xcapy] + - [0x144BF0, asm] + - [0x146BD0, c, xmonitor] + - [0x1477F8, asm] + - [0x14A438, c, xgoober] + - [0x14A4D8, asm] + - [0x14A5D8, c, xsomething] + - [0x14AB08, asm] ########### # Library # ########### @@ -98,11 +120,28 @@ segments: - [0x16F360, data] - - [0x3869D0, rodata, blob1] - - [0x386FF0, .rodata, kingdom] - - [0x387048, rodata, blob2] - - [0x387A50, rodata, unnamed_apple] + - [0x3869D0, rodata, "80"] + - [0x3869F8, rodata, 15A8] + - [0x386DB0, .rodata, xspinach] + - [0x386DB8, rodata, 121E8] + - [0x386FF0, .rodata, xkingdom] + - [0x387048, rodata, 207F8] + - [0x387A50, rodata, xapple] - [0x387A58, rodata, blob3] + - [0x387A60, rodata, 3BD28] + - [0x3881C0, rodata, 4A098] + - [0x389BC0, rodata, DF218] + - [0x38A700, .rodata, xmeowp] + - [0x38A720, rodata, F4910] + - [0x38AB30, .rodata, xrodent] + - [0x38AB50, rodata, 11A450] + # - [0x38B3D0, .rodata, xcapy] + - [0x38B400, rodata, 144BF0] + - [0x38B450, .rodata, xmonitor] + - [0x38B468, rodata, 1477F8] + # - [0x38B558, .rodata, xgoober] + - [0x38B560, rodata, 14A4D8] + - [0x38B578, .rodata, xsomething] - [0x38B598, rodata, libc] - [0x38BCA8, rodata, libkernl/tty] - [0x38BD20, rodata, libkernl/kprintf] diff --git a/src/unnamed_apple.c b/src/xapple.c similarity index 97% rename from src/unnamed_apple.c rename to src/xapple.c index fe40d02..c5cece2 100644 --- a/src/unnamed_apple.c +++ b/src/xapple.c @@ -194,7 +194,7 @@ s32 func_0013AB68(u16* arg0) { return 0; } -INCLUDE_ASM(const s32, "unnamed_apple", func_0013AFE8); +INCLUDE_ASM(const s32, "xapple", func_0013AFE8); void func_0013B138(void) { if (D_0053260C[2] - D_0053260C[1] > 0) { @@ -210,7 +210,7 @@ void func_0013B138(void) { D_00532604 = 4; } -INCLUDE_ASM(const s32, "unnamed_apple", func_0013B1D0); +INCLUDE_ASM(const s32, "xapple", func_0013B1D0); // s32 func_0013B1D0(void) { // XAppleBlemish* var_17; @@ -268,7 +268,7 @@ s32 func_0013B368(void) { return 1; } -INCLUDE_ASM(const s32, "unnamed_apple", func_0013B480); +INCLUDE_ASM(const s32, "xapple", func_0013B480); // typedef struct LargeApple { // /* 0x00 */ char unk_00[0x30]; @@ -311,7 +311,7 @@ INCLUDE_ASM(const s32, "unnamed_apple", func_0013B480); // return 0; // } -INCLUDE_ASM(const s32, "unnamed_apple", func_0013B578); +INCLUDE_ASM(const s32, "xapple", func_0013B578); // int func_0011EEB8(int*, int, int*); // int func_00123858(void*); // void func_001250B0(void); @@ -350,7 +350,7 @@ INCLUDE_ASM(const s32, "unnamed_apple", func_0013B578); // func_0011EEB8(&D_00532518, 0, &func_0013B480); // } -INCLUDE_ASM(const s32, "unnamed_apple", func_0013B6E0); +INCLUDE_ASM(const s32, "xapple", func_0013B6E0); // s32 func_0013B6E0(void) { // XAppleBlemish* var_4; @@ -425,7 +425,7 @@ void func_0013B9A8(void) { D_00532604 = 2; } -INCLUDE_ASM(const s32, "unnamed_apple", func_0013B9B8); +INCLUDE_ASM(const s32, "xapple", func_0013B9B8); f32 func_0013BAC0(void) { return (D_002DEC00->unk_6C->unk_48 + ((s32)(D_002DED20 >> 0xA) & 7)) * 3000; @@ -480,4 +480,4 @@ f32 func_0013BAC0(void) { // func_0011ED30(52000, &func_0013B8F8); // } -INCLUDE_ASM(const s32, "unnamed_apple", func_0013BB00); +INCLUDE_ASM(const s32, "xapple", func_0013BB00); diff --git a/src/xcapy.c b/src/xcapy.c new file mode 100644 index 0000000..2eec1d3 --- /dev/null +++ b/src/xcapy.c @@ -0,0 +1,13 @@ +#include "common.h" + +INCLUDE_ASM(const s32, "xcapy", func_00244490); + +INCLUDE_ASM(const s32, "xcapy", func_002446B0); + +INCLUDE_ASM(const s32, "xcapy", func_00244730); + +INCLUDE_ASM(const s32, "xcapy", func_002447B0); + +INCLUDE_ASM(const s32, "xcapy", func_00244828); + +INCLUDE_ASM(const s32, "xcapy", func_00244858); diff --git a/src/xgoober.c b/src/xgoober.c new file mode 100644 index 0000000..1dfd5f6 --- /dev/null +++ b/src/xgoober.c @@ -0,0 +1,3 @@ +#include "common.h" + +INCLUDE_ASM(const s32, "xgoober", func_0024A3B8); diff --git a/src/kingdom.c b/src/xkingdom.c similarity index 93% rename from src/kingdom.c rename to src/xkingdom.c index 7e45d63..ea289f9 100644 --- a/src/kingdom.c +++ b/src/xkingdom.c @@ -46,7 +46,7 @@ extern s32 D_004EC940; extern s32 D_004EC948; extern XCrown D_004EC970[16]; -INCLUDE_ASM(const s32, "kingdom", func_0011FC58); +INCLUDE_ASM(const s32, "xkingdom", func_0011FC58); void func_0011FD08(void) { if (func_001EE068() == 1) { @@ -92,7 +92,7 @@ void func_0011FE80(XCrown* arg0) { arg0->unk_00 = 0; } -INCLUDE_ASM(const s32, "kingdom", func_0011FE88); +INCLUDE_ASM(const s32, "xkingdom", func_0011FE88); // hash s32 func_0011FF40(char* str) { @@ -106,7 +106,7 @@ s32 func_0011FF40(char* str) { return hash; } -INCLUDE_ASM(const s32, "kingdom", func_0011FFB8); +INCLUDE_ASM(const s32, "xkingdom", func_0011FFB8); UNK_RET func_0011FFB8(UNK_ARGS); void* func_0011FFD8(char* arg0) { @@ -229,7 +229,7 @@ s32 func_001203C8(char* arg0, char* arg1) { return D_002C2198; } -INCLUDE_ASM(const s32, "kingdom", func_00120438); +INCLUDE_ASM(const s32, "xkingdom", func_00120438); // s32 func_00120438(char* arg0, void* arg1) { // XCrown* temp_2 = func_001202E8(arg0, arg1); @@ -244,11 +244,11 @@ INCLUDE_ASM(const s32, "kingdom", func_00120438); // return D_002C2198; // } -INCLUDE_ASM(const s32, "kingdom", func_001204C0); +INCLUDE_ASM(const s32, "xkingdom", func_001204C0); -INCLUDE_ASM(const s32, "kingdom", func_00120590); +INCLUDE_ASM(const s32, "xkingdom", func_00120590); -INCLUDE_ASM(const s32, "kingdom", func_00120640); +INCLUDE_ASM(const s32, "xkingdom", func_00120640); void func_001206D0(char* arg0) { if (sceCdDiskReady(1) == SCECdComplete) { @@ -260,6 +260,6 @@ void func_001206D0(char* arg0) { } } -INCLUDE_ASM(const s32, "kingdom", func_00120728); +INCLUDE_ASM(const s32, "xkingdom", func_00120728); -INCLUDE_ASM(const s32, "kingdom", func_00120750); +INCLUDE_ASM(const s32, "xkingdom", func_00120750); diff --git a/src/xmeowp.c b/src/xmeowp.c new file mode 100644 index 0000000..9d4d2d6 --- /dev/null +++ b/src/xmeowp.c @@ -0,0 +1,85 @@ +#include "common.h" + +INCLUDE_ASM(const s32, "xmeowp", func_001F3A20); + +INCLUDE_ASM(const s32, "xmeowp", func_001F3D50); + +INCLUDE_ASM(const s32, "xmeowp", func_001F3D88); + +INCLUDE_ASM(const s32, "xmeowp", func_001F3DA0); + +INCLUDE_ASM(const s32, "xmeowp", func_001F3DF0); + +INCLUDE_ASM(const s32, "xmeowp", func_001F3E28); + +INCLUDE_ASM(const s32, "xmeowp", func_001F3E58); + +INCLUDE_ASM(const s32, "xmeowp", func_001F3E88); + +INCLUDE_ASM(const s32, "xmeowp", func_001F3EC8); + +INCLUDE_ASM(const s32, "xmeowp", func_001F3F00); + +INCLUDE_ASM(const s32, "xmeowp", func_001F3F18); + +INCLUDE_ASM(const s32, "xmeowp", func_001F3F38); + +INCLUDE_ASM(const s32, "xmeowp", func_001F3F88); + +INCLUDE_ASM(const s32, "xmeowp", func_001F3FD8); + +INCLUDE_ASM(const s32, "xmeowp", func_001F4040); + +INCLUDE_ASM(const s32, "xmeowp", func_001F40C0); + +INCLUDE_ASM(const s32, "xmeowp", func_001F4150); + +INCLUDE_ASM(const s32, "xmeowp", func_001F41F8); + +INCLUDE_ASM(const s32, "xmeowp", func_001F42B0); + +INCLUDE_ASM(const s32, "xmeowp", func_001F4380); + +INCLUDE_ASM(const s32, "xmeowp", func_001F4408); + +INCLUDE_ASM(const s32, "xmeowp", func_001F44A0); + +INCLUDE_ASM(const s32, "xmeowp", func_001F4510); + +INCLUDE_ASM(const s32, "xmeowp", func_001F4590); + +INCLUDE_ASM(const s32, "xmeowp", func_001F45D8); + +INCLUDE_ASM(const s32, "xmeowp", func_001F45E0); + +INCLUDE_ASM(const s32, "xmeowp", func_001F45F0); + +INCLUDE_ASM(const s32, "xmeowp", func_001F4640); + +INCLUDE_ASM(const s32, "xmeowp", func_001F4668); + +INCLUDE_ASM(const s32, "xmeowp", func_001F4670); + +INCLUDE_ASM(const s32, "xmeowp", func_001F4690); + +INCLUDE_ASM(const s32, "xmeowp", func_001F46D8); + +INCLUDE_ASM(const s32, "xmeowp", func_001F46E0); + +INCLUDE_ASM(const s32, "xmeowp", func_001F4700); + +INCLUDE_ASM(const s32, "xmeowp", func_001F4748); + +INCLUDE_ASM(const s32, "xmeowp", func_001F4790); + +INCLUDE_ASM(const s32, "xmeowp", func_001F47F0); + +INCLUDE_ASM(const s32, "xmeowp", func_001F4810); + +INCLUDE_ASM(const s32, "xmeowp", func_001F4858); + +INCLUDE_ASM(const s32, "xmeowp", func_001F4878); + +INCLUDE_ASM(const s32, "xmeowp", func_001F4880); + +INCLUDE_ASM(const s32, "xmeowp", func_001F4888); diff --git a/src/xmonitor.c b/src/xmonitor.c new file mode 100644 index 0000000..ab2103a --- /dev/null +++ b/src/xmonitor.c @@ -0,0 +1,43 @@ +#include "common.h" + +INCLUDE_ASM(const s32, "xmonitor", func_00246B50); + +INCLUDE_ASM(const s32, "xmonitor", func_00246C28); + +INCLUDE_ASM(const s32, "xmonitor", func_00246C48); + +INCLUDE_ASM(const s32, "xmonitor", func_00246C60); + +INCLUDE_ASM(const s32, "xmonitor", func_00246C80); + +INCLUDE_ASM(const s32, "xmonitor", func_00246D60); + +INCLUDE_ASM(const s32, "xmonitor", func_00246D68); + +INCLUDE_ASM(const s32, "xmonitor", func_00246E80); + +INCLUDE_ASM(const s32, "xmonitor", func_00246EA0); + +INCLUDE_ASM(const s32, "xmonitor", func_00246FF0); + +INCLUDE_ASM(const s32, "xmonitor", func_00247010); + +INCLUDE_ASM(const s32, "xmonitor", func_00247028); + +INCLUDE_ASM(const s32, "xmonitor", func_00247030); + +INCLUDE_ASM(const s32, "xmonitor", func_00247108); + +INCLUDE_ASM(const s32, "xmonitor", func_00247128); + +INCLUDE_ASM(const s32, "xmonitor", func_00247218); + +INCLUDE_ASM(const s32, "xmonitor", func_00247238); + +INCLUDE_ASM(const s32, "xmonitor", func_00247250); + +INCLUDE_ASM(const s32, "xmonitor", func_00247258); + +INCLUDE_ASM(const s32, "xmonitor", func_002475E8); + +INCLUDE_ASM(const s32, "xmonitor", func_00247668); diff --git a/src/xpear.c b/src/xpear.c new file mode 100644 index 0000000..6019ec3 --- /dev/null +++ b/src/xpear.c @@ -0,0 +1,5 @@ +#include "common.h" + +INCLUDE_ASM(const s32, "xpear", func_001A87A8); + +INCLUDE_ASM(const s32, "xpear", func_001A8C48); diff --git a/src/xporcupine.c b/src/xporcupine.c new file mode 100644 index 0000000..0b3b510 --- /dev/null +++ b/src/xporcupine.c @@ -0,0 +1,5 @@ +#include "common.h" + +INCLUDE_ASM(const s32, "xporcupine", func_001011E0); + +INCLUDE_ASM(const s32, "xporcupine", func_001014A8); diff --git a/src/xrodent.c b/src/xrodent.c new file mode 100644 index 0000000..06ec4fa --- /dev/null +++ b/src/xrodent.c @@ -0,0 +1,3 @@ +#include "common.h" + +INCLUDE_ASM(const s32, "xrodent", func_002197E8); diff --git a/src/xsomething.c b/src/xsomething.c new file mode 100644 index 0000000..b919ac8 --- /dev/null +++ b/src/xsomething.c @@ -0,0 +1,15 @@ +#include "common.h" + +INCLUDE_ASM(const s32, "xsomething", func_0024A558); + +INCLUDE_ASM(const s32, "xsomething", func_0024A588); + +INCLUDE_ASM(const s32, "xsomething", func_0024A620); + +INCLUDE_ASM(const s32, "xsomething", func_0024A630); + +INCLUDE_ASM(const s32, "xsomething", func_0024A780); + +INCLUDE_ASM(const s32, "xsomething", func_0024A850); + +INCLUDE_ASM(const s32, "xsomething", func_0024A8B0); diff --git a/src/xspinach.c b/src/xspinach.c new file mode 100644 index 0000000..8a4d830 --- /dev/null +++ b/src/xspinach.c @@ -0,0 +1,7 @@ +#include "common.h" + +INCLUDE_ASM(const s32, "xspinach", func_00111F68); + +INCLUDE_ASM(const s32, "xspinach", func_00111FF0); + +INCLUDE_ASM(const s32, "xspinach", func_001120D0); diff --git a/src/xsquash.c b/src/xsquash.c new file mode 100644 index 0000000..9595adc --- /dev/null +++ b/src/xsquash.c @@ -0,0 +1,7 @@ +#include "common.h" + +INCLUDE_ASM(const s32, "xsquash", func_00149CE8); + +INCLUDE_ASM(const s32, "xsquash", func_00149D78); + +INCLUDE_ASM(const s32, "xsquash", func_00149E38); diff --git a/src/xstuck.c b/src/xstuck.c new file mode 100644 index 0000000..63dc6db --- /dev/null +++ b/src/xstuck.c @@ -0,0 +1,5 @@ +#include "common.h" + +INCLUDE_ASM(const s32, "xstuck", func_001DEE78); + +INCLUDE_ASM(const s32, "xstuck", func_001DF008);