Match gamework.c
Also tried to split up and name gamework struct bitfields.
This commit is contained in:
parent
0137cf8783
commit
fd44616c86
11 changed files with 551 additions and 70 deletions
|
|
@ -5,6 +5,13 @@
|
|||
|
||||
#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0]))
|
||||
|
||||
typedef struct w10_state {
|
||||
/* 0x00 */ s32 unk0;
|
||||
/* 0x04 */ u16 unk4;
|
||||
/* 0x06 */ u16 unk6;
|
||||
/* 0x08 */ s16 unk8;
|
||||
} W10State;
|
||||
|
||||
typedef struct unkw10Dll {
|
||||
Vec unk0;
|
||||
Vec unk0C;
|
||||
|
|
@ -107,7 +114,7 @@ extern Process* lbl_1_bss_18;
|
|||
extern s16 lbl_1_bss_1C;
|
||||
extern s16 lbl_1_bss_1E;
|
||||
extern s32 lbl_1_data_78[2];
|
||||
extern BoardStateSubStruct* lbl_1_bss_0;
|
||||
extern W10State* lbl_1_bss_0;
|
||||
extern s16 lbl_1_bss_10[4]; //could be incorrect size
|
||||
extern void* lbl_1_bss_8; //unknown type
|
||||
extern s16 lbl_1_bss_C;
|
||||
|
|
|
|||
|
|
@ -18,58 +18,132 @@ typedef struct wipe_state {
|
|||
u8 unk2[20];
|
||||
} WipeState;
|
||||
|
||||
typedef struct BoardStateSubStruct {
|
||||
/* 0x00 */ s32 unk0;
|
||||
/* 0x04 */ u16 unk4;
|
||||
/* 0x06 */ u16 unk6;
|
||||
/* 0x08 */ s16 unk8;
|
||||
} BoardStateSubStruct;
|
||||
|
||||
typedef struct system_work {
|
||||
/* 0x00 */ char unk00[0x04];
|
||||
/* 0x04 */ s8 curTurnCount;
|
||||
/* 0x05 */ s8 maxTurnCount;
|
||||
/* 0x06 */ char unk06[0x02];
|
||||
/* 0x08 */ u8 unk08;
|
||||
/* 0x09 */ s8 doubleCoinsOnSpaceBool;
|
||||
/* 0x0A */ s8 curPlayerIndex;
|
||||
/* 0x0C */ char unk0C[4];
|
||||
/* 0x10 */ BoardStateSubStruct unk10;
|
||||
/* 0x1A */ char unk1A[0xC6];
|
||||
} SystemState; //8018fcf8, sizeof 0xE0
|
||||
|
||||
typedef struct {
|
||||
u8 unk0 : 2;
|
||||
} PlayerFlags;
|
||||
typedef struct system_state {
|
||||
/* 0x00 */ struct {
|
||||
u16 story : 1;
|
||||
u16 team : 1;
|
||||
u8 : 7;
|
||||
};
|
||||
/* 0x02 */ struct {
|
||||
u16 bonus_star : 1;
|
||||
u16 explain_mg : 1;
|
||||
u16 show_com_mg : 1;
|
||||
u16 mg_type : 2;
|
||||
u16 mess_speed : 2;
|
||||
u16 save_mode : 2;
|
||||
};
|
||||
/* 0x04 */ s8 turn;
|
||||
/* 0x05 */ s8 max_turn;
|
||||
/* 0x06 */ u8 star_flag;
|
||||
/* 0x07 */ u8 star_total;
|
||||
/* 0x08 */ struct {
|
||||
u8 star_pos : 3;
|
||||
u8 board : 5;
|
||||
};
|
||||
/* 0x09 */ s8 last5_effect;
|
||||
/* 0x0A */ s8 player_curr;
|
||||
/* 0x0B */ char unk0B[3];
|
||||
/* 0x0E */ s16 hidden_block_pos;
|
||||
/* 0x10 */ u8 ATTRIBUTE_ALIGN(4) board_data[32];
|
||||
/* 0x30 */ u8 mess_delay;
|
||||
/* 0x31 */ struct {
|
||||
u8 field31_bit0 : 4;
|
||||
};
|
||||
/* 0x32 */ char unk_32[0x2];
|
||||
/* 0x34 */ u16 mg_next;
|
||||
/* 0x36 */ s16 mg_next_extra;
|
||||
/* 0x38 */ u8 flag[3][16];
|
||||
/* 0x68 */ u8 unk_68[0x74];
|
||||
} SystemState; //8018fcf8, sizeof 0xDC
|
||||
|
||||
typedef struct player_state {
|
||||
/* 0x00 */ u8 characterID;
|
||||
/* 0x01 */ s8 unk01;
|
||||
/* 0x02 */ s8 unk02;
|
||||
/* 0x03 */ s8 unk03;
|
||||
/* 0x04 */ s8 controllerPort;
|
||||
/* 0x05 */ s8 items[3];
|
||||
/* 0x08 */ PlayerFlags flags; //0x02 mini mushroom, 0x04 mega mushroom
|
||||
/* 0x09 */ s8 placement; //0x80 1st, 0x20 2nd, 0x40 3rd, 0x60 4th
|
||||
/* 0x0A */ u8 spacesLeftToMove;
|
||||
/* 0x0B */ char unk_0B[5];
|
||||
/* 0x10 */ s16 nextABSSpaceIndex;
|
||||
/* 0x12 */ char unk_12[2];
|
||||
/* 0x14 */ s8 blueSpacesLanded;
|
||||
/* 0x15 */ s8 redSpacesLanded;
|
||||
/* 0x16 */ s8 happeningSpacesLanded;
|
||||
/* 0x17 */ s8 chanceSpacesLanded;
|
||||
/* 0x18 */ char unk_18;
|
||||
/* 0x19 */ s8 battleSpacesLanded;
|
||||
/* 0x1A */ s8 itemSpacesLanded;
|
||||
/* 0x1B */ s8 springSpacesLanded;
|
||||
/* 0x1C */ s16 coins;
|
||||
/* 0x1E */ char unk_1E[2];
|
||||
/* 0x20 */ s16 totalCoinsCollected;
|
||||
/* 0x22 */ s16 coinPeak;
|
||||
/* 0x24 */ char unk_24[6];
|
||||
/* 0x2A */ s16 stars;
|
||||
/* 0x2C */ char unk_2C[4];
|
||||
/* 0x00 */ struct {
|
||||
u8 diff : 2;
|
||||
u8 com : 1;
|
||||
u8 character : 4;
|
||||
u8 auto_size : 2;
|
||||
};
|
||||
/* 0x02 */ struct {
|
||||
u8 team : 1;
|
||||
u8 field02_bit1 : 1;
|
||||
u8 player_idx : 2;
|
||||
u8 field02_bit4 : 5;
|
||||
};
|
||||
/* 0x04 */ s8 port;
|
||||
/* 0x05 */ s8 items[3];
|
||||
/* 0x08 */ struct {
|
||||
u8 color : 2;
|
||||
u8 moving : 1;
|
||||
u8 field08_bit3 : 1;
|
||||
u8 show_next : 1;
|
||||
u8 size : 2;
|
||||
u8 field08_bit7 : 2;
|
||||
u8 rank : 2;
|
||||
u8 bowser_suit : 1;
|
||||
};
|
||||
/* 0x0A */ s8 roll;
|
||||
/* 0x0C */ s16 space_curr;
|
||||
/* 0x0E */ s16 space_prev;
|
||||
/* 0x10 */ s16 space_next;
|
||||
/* 0x12 */ s16 unk_12;
|
||||
/* 0x14 */ u8 blue_count;
|
||||
/* 0x15 */ u8 red_count;
|
||||
/* 0x16 */ u8 question_count;
|
||||
/* 0x17 */ u8 fortune_count;
|
||||
/* 0x18 */ u8 bowser_count;
|
||||
/* 0x19 */ u8 battle_count;
|
||||
/* 0x1A */ u8 mushroom_count;
|
||||
/* 0x1B */ u8 warp_count;
|
||||
/* 0x1C */ s16 coins;
|
||||
/* 0x1E */ s16 coins_mg;
|
||||
/* 0x20 */ s16 coins_total;
|
||||
/* 0x22 */ s16 coins_max;
|
||||
/* 0x24 */ s16 coins_battle;
|
||||
/* 0x26 */ s16 unk_26;
|
||||
/* 0x28 */ s16 coins_mg_gain;
|
||||
/* 0x2A */ s16 stars;
|
||||
/* 0x2C */ s16 stars_max;
|
||||
/* 0x2E */ char unk_2E[2];
|
||||
} PlayerState; //size of 0x30
|
||||
|
||||
typedef struct game_stat {
|
||||
/* 0x0 */ s16 unk_00;
|
||||
/* 0x2 */ u8 language;
|
||||
/* 0x3 */ u8 sound_mode;
|
||||
/* 0x4 */ s8 rumble;
|
||||
/* 0x6 */ u16 total_stars;
|
||||
/* 0x8 */ OSTime create_time;
|
||||
/* 0x10 */ u32 mg_custom[2];
|
||||
/* 0x18 */ u32 mg_avail[2];
|
||||
/* 0x20 */ u32 mg_record[15];
|
||||
/* 0x5C */ u8 board_win_count[9][8];
|
||||
/* 0xA4 */ u8 board_play_count[9];
|
||||
/* 0xAE */ u16 board_max_stars[9];
|
||||
/* 0xC0 */ u16 board_max_coins[9];
|
||||
/* 0xD2 */ u8 present[60];
|
||||
/* 0x10E */ struct {
|
||||
u8 story_continue : 1;
|
||||
u8 party_continue : 1;
|
||||
u8 open_w06 : 1;
|
||||
u8 field10E_bit4 : 1;
|
||||
u8 field10E_bit5 : 1;
|
||||
u8 field10E_bit6 : 1;
|
||||
};
|
||||
/* 0x10F */ struct {
|
||||
u8 field10F_bit0 : 1;
|
||||
u8 field10F_bit1 : 1;
|
||||
u8 field10F_bit2 : 2;
|
||||
u8 field10F_bit4 : 2;
|
||||
u8 field10F_bit6 : 2;
|
||||
};
|
||||
/* 0x110 */ struct {
|
||||
u8 field110_bit0 : 1;
|
||||
u8 field110_bit1 : 1;
|
||||
u8 field110_bit2 : 2;
|
||||
u8 field110_bit4 : 2;
|
||||
u8 field110_bit6 : 2;
|
||||
};
|
||||
} GameStat;
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@ void HuWinMesMaxSizeGet(s32, f32*, ...);
|
|||
s16 HuWinCreate(float x, float y, s16 w, s16 h, s16 frame);
|
||||
|
||||
void HuPadRumbleAllStop(void);
|
||||
s16 HuPadStatGet(s16);
|
||||
|
||||
void HuAudFXListnerKill(void);
|
||||
void HuAudDllSndGrpSet(u16 ovl);
|
||||
|
|
|
|||
37
include/game/gamework.h
Normal file
37
include/game/gamework.h
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#ifndef _GAME_GAMEWORK_H
|
||||
#define _GAME_GAMEWORK_H
|
||||
|
||||
#include "dolphin.h"
|
||||
|
||||
void GWInit(void);
|
||||
void GWResetGameStat(void);
|
||||
s16 GWGetMessSpeed(void);
|
||||
void GWSetMGRecord(int index, s32 value);
|
||||
s32 GWGetMGRecord(int index);
|
||||
void GWGetCharColor(int character, GXColor *color);
|
||||
void GWSetBoardPlayCount(int board, u8 value);
|
||||
void GWAddBoardPlayCount(int board, u8 value);
|
||||
u8 GWGetBoardPlayCount(int board);
|
||||
void GWSetBoardMaxStars(int board, int value);
|
||||
u16 GWGetBoardMaxStars(int board);
|
||||
void GWSetBoardMaxCoins(int board, int value);
|
||||
u16 GWGetBoardMaxCoins(int board);
|
||||
int GWIncBoardWinCount(int character, int board);
|
||||
int GWGetBoardWinCount(int character, int board);
|
||||
void GWSetBoardWinCount(int character, int board, int value);
|
||||
int GWGetMGAvail(int id);
|
||||
int GWSetMGAvail(int id);
|
||||
int GWGetMGCustom(int id);
|
||||
int GWSetMGCustom(int id);
|
||||
int GWResetMGCustom(int id);
|
||||
s16 GWGetCoins(int player);
|
||||
void GWSetCoins(int player, s16 value);
|
||||
void GWAddCoins(int player, s16 amount);
|
||||
void GWSetStars(int player, s16 value);
|
||||
void GWAddStars(int player, s16 amount);
|
||||
s16 GWGetStars(int player);
|
||||
void GWSetTotalStars(s16 value);
|
||||
void GWAddTotalStars(s16 amount);
|
||||
u16 GWGetTotalStars(void);
|
||||
|
||||
#endif
|
||||
|
|
@ -21,6 +21,6 @@ extern char fadeStat;
|
|||
|
||||
extern PlayerState GWPlayer[4];
|
||||
extern SystemState GWSystem;
|
||||
|
||||
extern GameStat GWGameStat;
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue