Multiple features (#12)

This commit is contained in:
NedEX 2023-09-09 03:19:07 +02:00 committed by GitHub
parent e5b4406113
commit d7203e364d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 71 additions and 45 deletions

16
.gitignore vendored
View File

@ -1,12 +1,10 @@
disk/
build/
asm/*/*
asm/*/*/*.s
asm/*/*/*/*.s
asm/*/*/*/*/*.s
asm/*/*/*/*/*/*.s
__pycache__
.vscode
asm
build
disk
generated.symbols*
undefined*
*.ld
.vscode/
__pycache__

6
.gitmodules vendored
View File

@ -1,12 +1,12 @@
[submodule "tools/splat"]
path = tools/splat
url = git@github.com:ethteck/splat.git
url = https://github.com/ethteck/splat.git
[submodule "tools/asm-differ"]
path = tools/asm-differ
url = https://github.com/simonlindholm/asm-differ
url = https://github.com/simonlindholm/asm-differ.git
[submodule "tools/m2c"]
path = tools/m2c
url = https://github.com/matt-kempster/m2c
url = https://github.com/matt-kempster/m2c.git
[submodule "tools/maspsx"]
path = tools/maspsx
url = https://github.com/mkst/maspsx.git

View File

@ -60,7 +60,7 @@ endef
define link
$(LD) $(LD_FLAGS) -o $(2) \
-Map $(BUILD_DIR)/$(1).map \
-T $(1).ld \
-T $(CONFIG_DIR)/ld/$(1).ld \
-T $(CONFIG_DIR)/undefined_syms_auto.$(1).txt \
-T $(CONFIG_DIR)/undefined_funcs_auto.$(1).txt
endef
@ -127,7 +127,7 @@ expected: check
extract: extract_ovlcr extract_game
extract_game:
cat $(CONFIG_DIR)/symbols/symbols.txt $(CONFIG_DIR)/symbols/symbols.game.txt > $(CONFIG_DIR)/symbols/generated.symbols.txt
$(SPLAT) $(CONFIG_DIR)/splat.medievil.exe.yaml
$(SPLAT) $(CONFIG_DIR)/splat.game.yaml
extract_ovl%:
cat $(CONFIG_DIR)/symbols/symbols.txt $(CONFIG_DIR)/symbols/symbols.ovlcr.txt > $(CONFIG_DIR)/symbols/generated.symbols.ovlcr.txt

View File

@ -25,6 +25,7 @@ options:
symbol_addrs_path: config/symbols/symbols.game.txt
undefined_funcs_auto_path: config/undefined_funcs_auto.game.txt
undefined_syms_auto_path: config/undefined_syms_auto.game.txt
ld_script_path: config/ld/game.ld
extensions_path: tools/splat_ext

View File

@ -1,3 +1,5 @@
name: CR.BIN
sha1: b52e73eea027f2a517be47b6f2133e3a6ac73a15
options:
platform: psx
basename: ovlcr
@ -11,6 +13,7 @@ options:
symbol_addrs_path: config/symbols.ovlcr.txt
undefined_funcs_auto_path: config/undefined_funcs_auto.ovlcr.txt
undefined_syms_auto_path: config/undefined_syms_auto.ovlcr.txt
ld_script_path: config/ld/ovlcr.ld
find_file_boundaries: yes
use_legacy_include_asm: no
migrate_rodata_to_functions: yes

View File

@ -1,2 +1,3 @@
#include "include_asm.h"
#include "types.h"
#include "types.h"
#include "unkstruct.h"

27
include/unkstruct.h Normal file
View File

@ -0,0 +1,27 @@
#include "types.h"
typedef struct unkStruct_800A63B0 {
/* 0x00 */ char pad_0[4];
/* 0x04 */ u8 unk4;
/* 0x05 */ s8 unk5;
/* 0x06 */ s8 unk6;
/* 0x07 */ char pad_7[9];
/* 0x10 */ s8 unk10;
/* 0x11 */ s8 unk11;
/* 0x12 */ s8 unk12;
/* 0x16 */ char pad_16[2];
/* 0x18 */ s32 unk18;
/* 0x1C */ s16 unk1C;
} unkStruct_800A63B0;
typedef struct unkStruct_800EDA44_2 {
/* 0x00 */ char pad_0[0xC];
/* 0x0C */ s32 unkC;
} unkStruct_800EDA44_2;
typedef struct unkStruct_800EDA44 {
/* 0x00 */ char pad_0[0xC];
/* 0x0C */ struct unkStruct_800EDA44_2* unkC;
/* 0x10 */ char pad_10[4];
/* 0x14 */ s32 unk14;
} unkStruct_800EDA44;

View File

@ -1,4 +1,4 @@
#include "common.h"
#include "game.h"
INCLUDE_ASM("asm/game/nonmatchings/800", func_80021CA4);
@ -2680,7 +2680,16 @@ INCLUDE_ASM("asm/game/nonmatchings/800", func_800A6358);
INCLUDE_ASM("asm/game/nonmatchings/800", func_800A6384);
INCLUDE_ASM("asm/game/nonmatchings/800", func_800A63B0);
bool func_800A63B0(unkStruct_800A63B0* arg0) {
unkStruct_800A63B0* temp_v1 = arg0->unk18 + (arg0->unk1C * 4);
arg0->unk10 = temp_v1->unk6;
arg0->unk11 = temp_v1->unk5;
arg0->unk12 = temp_v1->unk4;
arg0->unk1C += 2;
return true;
}
INCLUDE_ASM("asm/game/nonmatchings/800", func_800A63F4);

1
src/game/game.h Normal file
View File

@ -0,0 +1 @@
#include "common.h"

View File

@ -1,4 +1,4 @@
#include "include_asm.h"
#include "cr.h"
INCLUDE_ASM("asm/ovl/cr/nonmatchings/18", func_80010018);
@ -10,39 +10,17 @@ INCLUDE_ASM("asm/ovl/cr/nonmatchings/18", func_80010588);
INCLUDE_ASM("asm/ovl/cr/nonmatchings/18", func_80010638);
/*
* First match of the project, keeping it as a reference for now
* TODO: refactor with real structures.
*/
#if 0
INCLUDE_ASM("asm/ovl/cr/nonmatchings/18", func_8001072C);
#else
typedef struct test2 {
char pad_0[0xC];
int unkC;
} test2;
typedef struct test {
char pad_0[0xC];
struct test2* unkC;
int pad_C;
int unk14;
} test;
extern test* D_800EDA44;
extern test* D_800EDA58;
extern int* D_800EE978;
void func_8001072C(void) {
if ((*D_800EE978 != 0) && (D_800EDA58 != 0) && (D_800EDA44->unk14 & 0x01000000)) {
if ((*D_800EE978 != 0) && (D_800EDA58 != NULL) && (D_800EDA44->unk14 & 0x01000000)) {
D_800EDA58->unkC->unkC = 0xC00;
*D_800EE978 = 0;
}
}
#endif
INCLUDE_ASM("asm/ovl/cr/nonmatchings/18", func_8001078C);
void func_8001078C(void) {
D_800EE938 = 0;
D_800EDC10 = 0;
}
INCLUDE_ASM("asm/ovl/cr/nonmatchings/18", func_800107A0);

8
src/ovl/cr/cr.h Normal file
View File

@ -0,0 +1,8 @@
#include "common.h"
extern unkStruct_800EDA44* D_800EDA44;
extern unkStruct_800EDA44* D_800EDA58;
extern s32 D_800EDC10;
extern s8 D_800EE938;
extern s32* D_800EE978;