From b3050638b290b34e7ef80a7f29c68dd0bd1a5234 Mon Sep 17 00:00:00 2001 From: Prakxo Date: Mon, 13 Mar 2023 11:58:42 +0000 Subject: [PATCH] prepare asset ripping --- .gitignore | 3 ++- config/assets.yml | 7 +++++++ config/rel_slices.yml | 2 ++ configure.py | 16 ++++++++++++++++ rel/sys_stacks.c | 6 +++--- 5 files changed, 30 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 8b4160b6..135090ea 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,5 @@ dump/* *.exe *.dll build.ninja -ac-decomp.code-workspace \ No newline at end of file +ac-decomp.code-workspace +assets/ \ No newline at end of file diff --git a/config/assets.yml b/config/assets.yml index e69de29b..5b7f278e 100644 --- a/config/assets.yml +++ b/config/assets.yml @@ -0,0 +1,7 @@ +config/dol.yml: + nintendo_hi_0.aw: + addrs: [0x800c3140, 0x800cca40] + __Creator__.bin: + addrs: [0x800b05e8, 0x800b05f4] + __DateTime__.bin: + addrs: [0x800b05f4, 0x800b0608] \ No newline at end of file diff --git a/config/rel_slices.yml b/config/rel_slices.yml index 76b0acd4..8c8cf07d 100644 --- a/config/rel_slices.yml +++ b/config/rel_slices.yml @@ -5,6 +5,8 @@ m_room_type/mRmTp_FtrItemNo2FtrIdx.c: #m_skin_matrix.c: # .text: [0x803f1528, 0x803f1bb4] # .rodata: [0x80643310, 0x80643318] +sys_stacks.c: + .bss: [0x812F5670, 0x812F9670] #zurumode/zerucheck_init.c: # .text: [0x8040eb38, 0x8040EB50] #zurumode/zerucheck_key_check.c: diff --git a/configure.py b/configure.py index 84813797..30329a4d 100644 --- a/configure.py +++ b/configure.py @@ -11,6 +11,7 @@ import pickle import re from io import StringIO +from sys import executable as PYTHON, platform from typing import List, Tuple from ninja_syntax import Writer @@ -251,9 +252,24 @@ class Asset: for binary, bdat in c.load_from_yaml(yml_path).items() for asset, adat in bdat.items() } + + def dump(self): + print(f"Ripping {self.path} from main.dol") + os.system( + f"{PYTHON} {c.PPCDIS}/assetrip.py {c.DOL_YML} 0x{self.start:x} {self.end:x} {c.ASSETS}/{self.path}") + assets = Asset.load(c.ASSETS_YML) +############## +# Rip Assets # +############## + +for asset in assets.values(): + Asset.dump(asset) + + + ########### # Sources # ########### diff --git a/rel/sys_stacks.c b/rel/sys_stacks.c index 25851496..c96df3bb 100644 --- a/rel/sys_stacks.c +++ b/rel/sys_stacks.c @@ -4,6 +4,6 @@ #define PADMGR_STACK_SIZE 0x1000 #define GRAPH_STACK_SIZE 0x2000 -extern u8 irqmgrStack [IRQMGR_STACK_SIZE]; -extern u8 padmgrStack [PADMGR_STACK_SIZE]; -extern u8 graphStack[GRAPH_STACK_SIZE]; \ No newline at end of file +u8 graphStack[GRAPH_STACK_SIZE]; +u8 padmgrStack [PADMGR_STACK_SIZE]; +u8 irqmgrStack [IRQMGR_STACK_SIZE];