more c files

This commit is contained in:
Ethan Roseman 2023-09-23 17:57:43 +09:00
parent 95467d13e6
commit eddd007178
No known key found for this signature in database
GPG Key ID: 27F9FCEB8E4969BD
15 changed files with 279 additions and 25 deletions

24
find_splits.py Normal file
View File

@ -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

View File

@ -29,11 +29,33 @@ segments:
vram: 0x100000 vram: 0x100000
bss_size: 0x1E1500 bss_size: 0x1E1500
subsegments: subsegments:
- [0x80, asm, blob1] - [0x80, asm]
- [0x1FCD8, c, kingdom] - [0x1260, c, xporcupine]
- [0x207F8, asm, blob2] - [0x15A8, asm]
- [0x3ABE8, c, unnamed_apple] - [0x11FE8, c, xspinach]
- [0x3BD28, asm, blob3] - [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 # # Library #
########### ###########
@ -98,11 +120,28 @@ segments:
- [0x16F360, data] - [0x16F360, data]
- [0x3869D0, rodata, blob1] - [0x3869D0, rodata, "80"]
- [0x386FF0, .rodata, kingdom] - [0x3869F8, rodata, 15A8]
- [0x387048, rodata, blob2] - [0x386DB0, .rodata, xspinach]
- [0x387A50, rodata, unnamed_apple] - [0x386DB8, rodata, 121E8]
- [0x386FF0, .rodata, xkingdom]
- [0x387048, rodata, 207F8]
- [0x387A50, rodata, xapple]
- [0x387A58, rodata, blob3] - [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] - [0x38B598, rodata, libc]
- [0x38BCA8, rodata, libkernl/tty] - [0x38BCA8, rodata, libkernl/tty]
- [0x38BD20, rodata, libkernl/kprintf] - [0x38BD20, rodata, libkernl/kprintf]

View File

@ -194,7 +194,7 @@ s32 func_0013AB68(u16* arg0) {
return 0; return 0;
} }
INCLUDE_ASM(const s32, "unnamed_apple", func_0013AFE8); INCLUDE_ASM(const s32, "xapple", func_0013AFE8);
void func_0013B138(void) { void func_0013B138(void) {
if (D_0053260C[2] - D_0053260C[1] > 0) { if (D_0053260C[2] - D_0053260C[1] > 0) {
@ -210,7 +210,7 @@ void func_0013B138(void) {
D_00532604 = 4; D_00532604 = 4;
} }
INCLUDE_ASM(const s32, "unnamed_apple", func_0013B1D0); INCLUDE_ASM(const s32, "xapple", func_0013B1D0);
// s32 func_0013B1D0(void) { // s32 func_0013B1D0(void) {
// XAppleBlemish* var_17; // XAppleBlemish* var_17;
@ -268,7 +268,7 @@ s32 func_0013B368(void) {
return 1; return 1;
} }
INCLUDE_ASM(const s32, "unnamed_apple", func_0013B480); INCLUDE_ASM(const s32, "xapple", func_0013B480);
// typedef struct LargeApple { // typedef struct LargeApple {
// /* 0x00 */ char unk_00[0x30]; // /* 0x00 */ char unk_00[0x30];
@ -311,7 +311,7 @@ INCLUDE_ASM(const s32, "unnamed_apple", func_0013B480);
// return 0; // 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_0011EEB8(int*, int, int*);
// int func_00123858(void*); // int func_00123858(void*);
// void func_001250B0(void); // void func_001250B0(void);
@ -350,7 +350,7 @@ INCLUDE_ASM(const s32, "unnamed_apple", func_0013B578);
// func_0011EEB8(&D_00532518, 0, &func_0013B480); // 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) { // s32 func_0013B6E0(void) {
// XAppleBlemish* var_4; // XAppleBlemish* var_4;
@ -425,7 +425,7 @@ void func_0013B9A8(void) {
D_00532604 = 2; D_00532604 = 2;
} }
INCLUDE_ASM(const s32, "unnamed_apple", func_0013B9B8); INCLUDE_ASM(const s32, "xapple", func_0013B9B8);
f32 func_0013BAC0(void) { f32 func_0013BAC0(void) {
return (D_002DEC00->unk_6C->unk_48 + ((s32)(D_002DED20 >> 0xA) & 7)) * 3000; 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); // func_0011ED30(52000, &func_0013B8F8);
// } // }
INCLUDE_ASM(const s32, "unnamed_apple", func_0013BB00); INCLUDE_ASM(const s32, "xapple", func_0013BB00);

13
src/xcapy.c Normal file
View File

@ -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);

3
src/xgoober.c Normal file
View File

@ -0,0 +1,3 @@
#include "common.h"
INCLUDE_ASM(const s32, "xgoober", func_0024A3B8);

View File

@ -46,7 +46,7 @@ extern s32 D_004EC940;
extern s32 D_004EC948; extern s32 D_004EC948;
extern XCrown D_004EC970[16]; extern XCrown D_004EC970[16];
INCLUDE_ASM(const s32, "kingdom", func_0011FC58); INCLUDE_ASM(const s32, "xkingdom", func_0011FC58);
void func_0011FD08(void) { void func_0011FD08(void) {
if (func_001EE068() == 1) { if (func_001EE068() == 1) {
@ -92,7 +92,7 @@ void func_0011FE80(XCrown* arg0) {
arg0->unk_00 = 0; arg0->unk_00 = 0;
} }
INCLUDE_ASM(const s32, "kingdom", func_0011FE88); INCLUDE_ASM(const s32, "xkingdom", func_0011FE88);
// hash // hash
s32 func_0011FF40(char* str) { s32 func_0011FF40(char* str) {
@ -106,7 +106,7 @@ s32 func_0011FF40(char* str) {
return hash; return hash;
} }
INCLUDE_ASM(const s32, "kingdom", func_0011FFB8); INCLUDE_ASM(const s32, "xkingdom", func_0011FFB8);
UNK_RET func_0011FFB8(UNK_ARGS); UNK_RET func_0011FFB8(UNK_ARGS);
void* func_0011FFD8(char* arg0) { void* func_0011FFD8(char* arg0) {
@ -229,7 +229,7 @@ s32 func_001203C8(char* arg0, char* arg1) {
return D_002C2198; return D_002C2198;
} }
INCLUDE_ASM(const s32, "kingdom", func_00120438); INCLUDE_ASM(const s32, "xkingdom", func_00120438);
// s32 func_00120438(char* arg0, void* arg1) { // s32 func_00120438(char* arg0, void* arg1) {
// XCrown* temp_2 = func_001202E8(arg0, arg1); // XCrown* temp_2 = func_001202E8(arg0, arg1);
@ -244,11 +244,11 @@ INCLUDE_ASM(const s32, "kingdom", func_00120438);
// return D_002C2198; // 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) { void func_001206D0(char* arg0) {
if (sceCdDiskReady(1) == SCECdComplete) { 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);

85
src/xmeowp.c Normal file
View File

@ -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);

43
src/xmonitor.c Normal file
View File

@ -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);

5
src/xpear.c Normal file
View File

@ -0,0 +1,5 @@
#include "common.h"
INCLUDE_ASM(const s32, "xpear", func_001A87A8);
INCLUDE_ASM(const s32, "xpear", func_001A8C48);

5
src/xporcupine.c Normal file
View File

@ -0,0 +1,5 @@
#include "common.h"
INCLUDE_ASM(const s32, "xporcupine", func_001011E0);
INCLUDE_ASM(const s32, "xporcupine", func_001014A8);

3
src/xrodent.c Normal file
View File

@ -0,0 +1,3 @@
#include "common.h"
INCLUDE_ASM(const s32, "xrodent", func_002197E8);

15
src/xsomething.c Normal file
View File

@ -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);

7
src/xspinach.c Normal file
View File

@ -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);

7
src/xsquash.c Normal file
View File

@ -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);

5
src/xstuck.c Normal file
View File

@ -0,0 +1,5 @@
#include "common.h"
INCLUDE_ASM(const s32, "xstuck", func_001DEE78);
INCLUDE_ASM(const s32, "xstuck", func_001DF008);