Match gamework.c

Also tried to split up and name gamework struct bitfields.
This commit is contained in:
gamemasterplc 2023-12-09 23:29:26 -06:00
parent 0137cf8783
commit fd44616c86
11 changed files with 551 additions and 70 deletions

View file

@ -14,7 +14,7 @@ s16 lbl_1_bss_E;
s16 lbl_1_bss_C;
void* lbl_1_bss_8;
s32 lbl_1_bss_4_pad;
BoardStateSubStruct* lbl_1_bss_0;
W10State* lbl_1_bss_0;
//DATA
unkw10Dll lbl_1_data_0[1] = {
@ -62,7 +62,7 @@ s32 lbl_1_data_6C[2] = {
// function is probably global. only inlined in rels?
inline s32 get_current_board(void) {
return GWSystem.unk08 & 0x1F;
return GWSystem.board;
}
void fn_1_E0(void) {
@ -76,7 +76,7 @@ void fn_1_E0(void) {
s32 temp2;
temp2 = get_current_board();
lbl_1_bss_0 = &GWSystem.unk10;
lbl_1_bss_0 = (W10State *)&GWSystem.board_data;
lbl_1_bss_0->unk0 = 0;
lbl_1_bss_0->unk4 = 0;
lbl_1_bss_0->unk6 = 0;

View file

@ -174,7 +174,7 @@ void fn_1_13A4(void) {
fn_1_BA0(0x2E0023);
for (i = 0; i < 4; i++) {
GWPlayer[i].flags.unk0 = 1;
GWPlayer[i].color = 1;
}
fn_800A4C88();
fn_800884F4(0);

View file

@ -1,6 +1,8 @@
#include "REL/w10Dll.h"
#include "game/data.h"
s16 HuPadStatGet(s16 i); //TODO: Move to some other header file since gamework.c relies on an implicit declaration of it
char lbl_1_data_98[] = "@@@@@@@@@@@@@@ Tutorial Exit @@@@@@@@@@@@@@\n\000";
w10DllUnk03 lbl_1_data_C6[11] = {
@ -85,21 +87,21 @@ void fn_1_176C(void) {
void fn_1_179C(void) {
fn_1_BA0(0x2E0025);
GWPlayer[1].flags.unk0 = 2;
GWPlayer[3].flags.unk0 = 2;
GWPlayer[1].color = 2;
GWPlayer[3].color = 2;
}
void fn_1_17F4(void) {
fn_1_BA0(0x2E0026);
GWPlayer[0].flags.unk0 = 2;
GWPlayer[0].color = 2;
}
void fn_1_1834(void) {
fn_1_BA0(0x2E0027);
GWPlayer[0].flags.unk0 = 1;
GWPlayer[1].flags.unk0 = 1;
GWPlayer[2].flags.unk0 = 1;
GWPlayer[3].flags.unk0 = 2;
GWPlayer[0].color = 1;
GWPlayer[1].color = 1;
GWPlayer[2].color = 1;
GWPlayer[3].color = 2;
}
void fn_1_18BC(void) {
@ -139,7 +141,7 @@ void fn_1_1984(void) {
return;
}
for (i = 0; i < ARRAY_COUNT(GWPlayer); i++) {
contPortIndex = GWPlayer[i].controllerPort;
contPortIndex = GWPlayer[i].port;
if (contPortIndex == -1) {
continue;
}
@ -168,7 +170,7 @@ int fn_1_1AAC(s16 arg0, s32 arg1) {
if (fn_8005B6A8() == 0) {
s32 contPortIndex;
for (i = 0; i < ARRAY_COUNT(GWPlayer); i++) {
contPortIndex = GWPlayer[i].controllerPort;
contPortIndex = GWPlayer[i].port;
if (contPortIndex == -1) {
continue;
}
@ -190,8 +192,8 @@ int fn_1_1AAC(s16 arg0, s32 arg1) {
}
if (arg0 != 0x1D) {
OSReport(lbl_1_data_258,
(GWPlayer[0].characterID >> 5) & 1, (GWPlayer[1].characterID >> 5) & 1,
(GWPlayer[2].characterID >> 5) & 1, (GWPlayer[3].characterID >> 5) & 1,
GWPlayer[0].com, GWPlayer[1].com,
GWPlayer[2].com, GWPlayer[3].com,
lbl_1_bss_0->unk0, arg0, arg1, lbl_1_bss_0->unk4, lbl_1_bss_0->unk6);
if (lbl_1_data_108[lbl_1_bss_0->unk0].unk0 != -1) {
if (arg0 == 5) {