mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-08-11 02:53:19 -04:00
Implement skeletons for all GAME "classes"
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#ifndef FAMICOM_EMU_H
|
||||
#define FAMICOM_EMU_H
|
||||
|
||||
#include "types.h"
|
||||
#include "game.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* sizeof(struct game_famicom_emu_s) == 0xE0 */
|
||||
typedef struct game_famicom_emu_s {
|
||||
/* 0x00 */ GAME game;
|
||||
} GAME_FAMICOM_EMU;
|
||||
|
||||
extern void famicom_emu_init(GAME_FAMICOM_EMU* famicom_emu);
|
||||
extern void famicom_emu_cleanup(GAME_FAMICOM_EMU* famicom_emu);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,23 @@
|
||||
#ifndef FIRST_GAME_H
|
||||
#define FIRST_GAME_H
|
||||
|
||||
#include "types.h"
|
||||
#include "game.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* sizeof(struct game_first_s) == 0xE0 */
|
||||
typedef struct game_first_s {
|
||||
/* 0x00 */ GAME game;
|
||||
} GAME_FIRST;
|
||||
|
||||
extern void first_game_cleanup(GAME_FIRST* first_game);
|
||||
extern void first_game_init(GAME_FIRST* first_game);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+38
-1
@@ -2,20 +2,57 @@
|
||||
#define GAME_H
|
||||
|
||||
#include "types.h"
|
||||
#include "TwoHeadArena.h"
|
||||
#include "graph.h"
|
||||
#include "gamealloc.h"
|
||||
#include "pad.h"
|
||||
#include "m_controller.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* sizeof(struct game_s) == 0xE0 */
|
||||
typedef struct game_s {
|
||||
/* 0x0000 */ GRAPH* graph;
|
||||
/* 0x0004 */ void (*exec)(struct game_s* );
|
||||
/* 0x0008 */ void (*cleanup)(struct game_s*);
|
||||
/* 0x000C */ void (*next_game_init)(struct game_s*);
|
||||
/* 0x0010 */ size_t next_game_class_size;
|
||||
/* 0x0014 */ pad_t pads[MAXCONTROLLERS];
|
||||
/* 0x0074 */ int pad_initialized;
|
||||
/* 0x0078 */ THA tha;
|
||||
/* 0x0088 */ GameAlloc gamealloc;
|
||||
/* 0x009C */ u8 doing_point;
|
||||
/* 0x009D */ u8 doing_point_specific; /* game class specific? */
|
||||
/* 0x009E */ u8 disable_display;
|
||||
/* 0x009F */ u8 doing;
|
||||
/* 0x00A0 */ u32 frame_counter;
|
||||
/* 0x00A4 */ u8 disable_prenmi;
|
||||
/* 0x00A8 */ MCON mcon;
|
||||
} GAME;
|
||||
|
||||
extern void game_ct(GAME* game);
|
||||
extern void game_dt(GAME* game);
|
||||
extern void game_main(GAME* game);
|
||||
extern u8 game_is_doing(GAME*);
|
||||
extern u8 game_is_doing(GAME* game);
|
||||
extern void (*game_get_next_game_init(GAME* game))(GAME*);
|
||||
|
||||
#define GAME_NEXT_GAME(game, init_name, class_name) \
|
||||
do { \
|
||||
GAME* g = (game); \
|
||||
g->next_game_init = init_name##_init; \
|
||||
g->next_game_class_size = sizeof(GAME_##class_name); \
|
||||
} while (0)
|
||||
|
||||
#define GAME_GOTO_NEXT(game, init_name, class_name) \
|
||||
do { \
|
||||
GAME* t_game = (game); \
|
||||
t_game->doing = FALSE; \
|
||||
GAME_NEXT_GAME(t_game, init_name, class_name); \
|
||||
} while (0)
|
||||
|
||||
extern void game_get_controller(GAME* game);
|
||||
|
||||
extern GAME* game_class_p;
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
#ifndef GAMEALLOC_H
|
||||
#define GAMEALLOC_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* sizeof(struct gameAllocList_s) == 0x10 */
|
||||
typedef struct gameAllocList_s {
|
||||
/* 0x00 */ struct gameAllocList_s* next;
|
||||
/* 0x04 */ struct gameAllocList_s* prev;
|
||||
/* 0x08 */ size_t alloc_size;
|
||||
/* 0x0C */ u32 pad;
|
||||
} GameAllocList;
|
||||
|
||||
/* sizeof(struct gameAlloc_s) == 0x14 */
|
||||
typedef struct gameAlloc_s {
|
||||
/* 0x00 */ GameAllocList head;
|
||||
/* 0x10 */ GameAllocList* tail;
|
||||
} GameAlloc;
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,22 @@
|
||||
#ifndef EMU64_WRAPPER_H
|
||||
#define EMU64_WRAPPER_H
|
||||
|
||||
#include "types.h"
|
||||
#include "sys_ucode.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern void emu64_set_ucode_info(int count, ucode_info* ucode_info);
|
||||
extern void emu64_set_first_ucode(void* ucode);
|
||||
extern void emu64_taskstart(Gfx* gfx);
|
||||
extern void emu64_init();
|
||||
extern void emu64_refresh();
|
||||
extern void emu64_cleanup();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,10 @@
|
||||
#ifndef U64TYPES_H
|
||||
#define U64TYPES_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
typedef struct xyz_s {
|
||||
f32 x, y, z;
|
||||
} xyz_t;
|
||||
|
||||
#endif
|
||||
@@ -9,17 +9,19 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define MAXCONTROLLERS 4
|
||||
|
||||
typedef struct {
|
||||
u16 type;
|
||||
u8 status;
|
||||
u8 errno;
|
||||
u16 type;
|
||||
u8 status;
|
||||
u8 errno;
|
||||
} OSContStatus;
|
||||
|
||||
typedef struct {
|
||||
u16 button;
|
||||
s8 stick_x;
|
||||
s8 stick_y;
|
||||
u8 errno;
|
||||
u16 button;
|
||||
s8 stick_x;
|
||||
s8 stick_y;
|
||||
u8 errno;
|
||||
} OSContPad;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
#ifndef M_CONTROLLER_H
|
||||
#define M_CONTROLLER_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* sizeof(struct controller_s) == 0x38 */
|
||||
typedef struct controller_s {
|
||||
/* 0x00 */ f32 move_pX;
|
||||
/* 0x04 */ f32 move_pY;
|
||||
/* 0x08 */ f32 move_pR;
|
||||
/* 0x0C */ s16 move_angle;
|
||||
|
||||
/* 0x10 */ f32 last_move_pX;
|
||||
/* 0x14 */ f32 last_move_pY;
|
||||
/* 0x18 */ f32 last_move_pR;
|
||||
/* 0x1C */ s16 last_move_angle;
|
||||
|
||||
/* 0x20 */ f32 adjusted_pX;
|
||||
/* 0x24 */ f32 adjusted_pY;
|
||||
/* 0x28 */ f32 adjusted_pR;
|
||||
|
||||
/* 0x2C */ f32 last_adjusted_pX;
|
||||
/* 0x30 */ f32 last_adjusted_pY;
|
||||
/* 0x34 */ f32 last_adjusted_pR;
|
||||
} MCON;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
#ifndef M_OLIB_H
|
||||
#define M_OLIB_H
|
||||
|
||||
#include "types.h"
|
||||
#include "libu64/u64types.h"
|
||||
|
||||
typedef struct rect_s {
|
||||
int top, bottom;
|
||||
int l, r;
|
||||
} rect;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,25 @@
|
||||
#ifndef M_PLAY_H
|
||||
#define M_PLAY_H
|
||||
|
||||
#include "types.h"
|
||||
#include "game.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* sizeof(struct game_play_s) == 0x2600 */
|
||||
typedef struct game_play_s {
|
||||
/* 0x0000 */ GAME game;
|
||||
// TODO: finish
|
||||
/* 0x00E0 */ u8 _temp[0x2520];
|
||||
} GAME_PLAY;
|
||||
|
||||
extern void play_init(GAME_PLAY* play);
|
||||
extern void play_cleanup(GAME_PLAY* play);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,25 @@
|
||||
#ifndef M_PRENMI_H
|
||||
#define M_PRENMI_H
|
||||
|
||||
#include "types.h"
|
||||
#include "game.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* sizeof(struct game_prenmi_s) == 0xE8 */
|
||||
typedef struct game_prenmi_s {
|
||||
GAME game;
|
||||
u32 timer;
|
||||
u32 pad;
|
||||
} GAME_PRENMI;
|
||||
|
||||
extern void prenmi_init(GAME_PRENMI* prenmi);
|
||||
extern void prenmi_cleanup(GAME_PRENMI* prenmi);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,36 @@
|
||||
#ifndef M_SELECT_H
|
||||
#define M_SELECT_H
|
||||
|
||||
#include "types.h"
|
||||
#include "game.h"
|
||||
#include "m_view.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* sizeof(struct game_select_s) == 0x0238 */
|
||||
typedef struct game_select_s {
|
||||
/* 0x0000 */ GAME game;
|
||||
/* 0x00E0 */ View view;
|
||||
/* 0x0200 */ int status;
|
||||
/* 0x0204 */ int cursor_x;
|
||||
/* 0x0208 */ int cursor_y;
|
||||
/* 0x020C */ int step;
|
||||
/* 0x0210 */ int step_add;
|
||||
/* 0x0214 */ int selected_course;
|
||||
/* 0x0218 */ int top_course; /* course at top of screen it seems */
|
||||
/* 0x021C */ u32 unk_21C;
|
||||
/* 0x0220 */ int button_step;
|
||||
/* 0x0224 */ u8 name[8];
|
||||
/* 0x0228 */ int unk_228[3];
|
||||
} GAME_SELECT;
|
||||
|
||||
extern void select_init(GAME_SELECT* select);
|
||||
extern void select_cleanup(GAME_SELECT* select);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,25 @@
|
||||
#ifndef M_TRADEMARK_H
|
||||
#define M_TRADEMARK_H
|
||||
|
||||
#include "types.h"
|
||||
#include "game.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* sizeof(struct game_trademark_s) == 0x25A70 */
|
||||
typedef struct game_trademark_s {
|
||||
/* 0x000000 */ GAME game;
|
||||
// TODO: finish
|
||||
/* 0x0000E0 */ u8 _temp[0x25990];
|
||||
} GAME_TRADEMARK;
|
||||
|
||||
extern void trademark_init(GAME_TRADEMARK* trademark);
|
||||
extern void trademark_cleanup(GAME_TRADEMARK* trademark);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,50 @@
|
||||
#ifndef M_VIEW_H
|
||||
#define M_VIEW_H
|
||||
|
||||
#include "types.h"
|
||||
#include "libu64/u64types.h"
|
||||
#include "m_olib.h"
|
||||
#include "graph.h"
|
||||
#include "PR/mbi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* sizeof(struct view_s) == 0x120 */
|
||||
typedef struct view_s {
|
||||
GRAPH* graph;
|
||||
|
||||
rect screen;
|
||||
f32 fovY;
|
||||
f32 near, far;
|
||||
f32 scale;
|
||||
xyz_t eye;
|
||||
xyz_t center;
|
||||
xyz_t up;
|
||||
|
||||
Vp viewport;
|
||||
|
||||
Mtx mtx_projection;
|
||||
Mtx mtx_viewing;
|
||||
Mtx* p_projection;
|
||||
Mtx* p_viewing;
|
||||
|
||||
struct stretch_s {
|
||||
xyz_t target_rotate;
|
||||
xyz_t target_scale;
|
||||
f32 step; /* step speed between rotate/scale -> target_rotation/target_scale */
|
||||
xyz_t rotate;
|
||||
xyz_t scale;
|
||||
} stretch;
|
||||
|
||||
u16 normal;
|
||||
int flag;
|
||||
int _unused_pad0;
|
||||
} View;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -9,7 +9,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define MAXCONTROLLERS 4
|
||||
#define PADMSGBUFCNT 8
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
#ifndef PLAYER_SELECT_H
|
||||
#define PLAYER_SELECT_H
|
||||
|
||||
#include "types.h"
|
||||
#include "game.h"
|
||||
#include "m_view.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* sizeof(struct game_player_select_s) == 0x0288 */
|
||||
typedef struct game_player_select_s {
|
||||
/* 0x0000 */ GAME game;
|
||||
/* 0x00E0 */ View view;
|
||||
// TODO: finish this
|
||||
/* 0x0200 */ u8 _temp[0x88];
|
||||
} GAME_PLAYER_SELECT;
|
||||
|
||||
extern void player_select_init(GAME_PLAYER_SELECT* player_select);
|
||||
extern void player_select_cleanup(GAME_PLAYER_SELECT* player_select);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,27 @@
|
||||
#ifndef SAVE_MENU_H
|
||||
#define SAVE_MENU_H
|
||||
|
||||
#include "types.h"
|
||||
#include "game.h"
|
||||
#include "m_view.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* sizeof(struct game_save_menu_s) == 0x0228 */
|
||||
typedef struct game_save_menu_s {
|
||||
/* 0x0000 */ GAME game;
|
||||
/* 0x00E0 */ View view;
|
||||
// TODO: finish this
|
||||
/* 0x0200 */ u8 _temp[0x28];
|
||||
} GAME_SAVE_MENU;
|
||||
|
||||
extern void save_menu_init(GAME_SAVE_MENU* save_menu);
|
||||
extern void save_menu_cleanup(GAME_SAVE_MENU* save_menu);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,23 @@
|
||||
#ifndef SECOND_GAME_H
|
||||
#define SECOND_GAME_H
|
||||
|
||||
#include "types.h"
|
||||
#include "game.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* sizeof(struct second_game_s) == 0xE0 */
|
||||
typedef struct second_game_s {
|
||||
/* 0x00 */ GAME game;
|
||||
} GAME_SECOND;
|
||||
|
||||
extern void second_game_init(GAME_SECOND second);
|
||||
extern void second_game_cleanup(GAME_SECOND* second);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user