summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/68AAF0.h2
-rw-r--r--include/m_common_data.h22
-rw-r--r--include/m_field_info.h4
-rw-r--r--src/code/m_common_data.c26
-rw-r--r--yamls/jp/code.yaml4
5 files changed, 52 insertions, 6 deletions
diff --git a/include/68AAF0.h b/include/68AAF0.h
index 34f7311..0c5cb84 100644
--- a/include/68AAF0.h
+++ b/include/68AAF0.h
@@ -3,6 +3,6 @@
#include "ultra64.h"
-// void clip_clear();
+void clip_clear(void);
#endif
diff --git a/include/m_common_data.h b/include/m_common_data.h
index 3da880f..1c74775 100644
--- a/include/m_common_data.h
+++ b/include/m_common_data.h
@@ -3,8 +3,24 @@
#include "ultra64.h"
-// void common_data_reinit();
-// void common_data_init();
-// void common_data_clear();
+typedef struct CommonData {
+ /* 0x00000 */ u8 unk_00000[0x10000];
+ /* 0x10000 */ u8 unk_10000; // named "game_started" in AC GCN decomp
+ /* 0x10001 */ u8 unk_10001[0x3];
+ /* 0x10004 */ s32 unk_10004; // named "last_scene_no" in AC GCN decomp
+ /* 0x10008 */ u8 unk_10008[0x143];
+ /* 0x1014B */ u8 unk_1014B; // named "wipeType" in AC GCN decomp
+ /* 0x1014C */ u8 unk_1014C[0x66A];
+ /* 0x107B6 */ s16 unk_107B6; // named "demo_profile" in AC GCN decomp (though it's an array of two s16s in that game)
+ /* 0x107B8 */ u8 unk_107B8[0x2F8];
+ /* 0x10AB0 */ u8 unk_10AB0; // named "pad_connected" in AC GCN decomp
+ /* 0x10AB1 */ u8 unk_10AB1[0x7];
+} CommonData; // size = 0x10AB8
+
+void common_data_reinit(void);
+void common_data_init(void);
+void common_data_clear(void);
+
+extern CommonData common_data;
#endif
diff --git a/include/m_field_info.h b/include/m_field_info.h
index 7735958..a007926 100644
--- a/include/m_field_info.h
+++ b/include/m_field_info.h
@@ -3,6 +3,8 @@
#include "ultra64.h"
+struct CommonData;
+
// void func_80087C30_jp();
// void func_80087C40_jp();
// void func_80087C64_jp();
@@ -203,7 +205,7 @@
// void func_8008EEE8_jp();
// void func_8008EF0C_jp();
// void mFRm_CheckSaveData();
-// void mFRm_ClearSaveCheckData();
+void mFRm_ClearSaveCheckData(CommonData* common_data);
// void func_8008EFDC_jp();
// void func_8008F020_jp();
// void func_8008F040_jp();
diff --git a/src/code/m_common_data.c b/src/code/m_common_data.c
new file mode 100644
index 0000000..31eea11
--- /dev/null
+++ b/src/code/m_common_data.c
@@ -0,0 +1,26 @@
+#include "global.h"
+#include "m_common_data.h"
+#include "m_field_info.h"
+#include "68AAF0.h"
+
+CommonData common_data;
+
+void common_data_reinit(void) {
+ u8 sp1F = common_data.unk_10AB0;
+
+ bzero(&common_data, sizeof(CommonData));
+ common_data.unk_1014B = -1;
+ common_data.unk_10000 = 1;
+ common_data.unk_10004 = -1;
+ common_data.unk_107B6 = 0xC9;
+ common_data.unk_10AB0 = sp1F;
+ mFRm_ClearSaveCheckData(&common_data);
+}
+
+void common_data_init(void) {
+ common_data_reinit();
+}
+
+void common_data_clear(void) {
+ clip_clear();
+}
diff --git a/yamls/jp/code.yaml b/yamls/jp/code.yaml
index c074a0c..d1e1efd 100644
--- a/yamls/jp/code.yaml
+++ b/yamls/jp/code.yaml
@@ -20,7 +20,7 @@
- [0x68AB30, asm, code/68AB30]
- [0x68B0D0, asm, code/m_collision_bg]
- [0x69A7E0, asm, code/69A7E0]
- - [0x69C6B0, asm, code/m_common_data]
+ - [0x69C6B0, c, code/m_common_data]
- [0x69C770, asm, code/m_controller]
- [0x69CB30, asm, code/69CB30]
- [0x69DDF0, asm, code/m_debug_display]
@@ -223,6 +223,8 @@
- [0x73CEE0, rodata, code/73CEE0]
- { start: 0x73F4D0, type: bss, vram: 0x8011B830, name: code/8011B830 }
+ - { start: 0x74AB40, type: .bss, vram: 0x80126EA0, name: code/m_common_data }
+ - { start: 0x75B600, type: bss, vram: 0x80137960, name: code/80137960 }
- { start: 0x73F4D0, type: bss, vram: 0x80143900, name: code/m_player_call }
- { start: 0x73F4D0, type: bss, vram: 0x80143910, name: code/80143910 }
- { start: 0x73F4D0, type: .bss, vram: 0x801462B0, name: code/sys_matrix }