From 342725c2befff6a28bceb17703375bb26c3ec09c Mon Sep 17 00:00:00 2001 From: Cuyler36 Date: Fri, 24 Mar 2023 16:04:45 -0400 Subject: [PATCH] Implement skeletons for all GAME "classes" --- include/famicom_emu.h | 23 +++++ include/first_game.h | 23 +++++ include/game.h | 39 +++++++- include/gamealloc.h | 28 ++++++ include/libforest/emu64/emu64_wrapper.h | 22 +++++ include/libu64/u64types.h | 10 ++ include/libultra/osContPad.h | 16 ++-- include/m_controller.h | 35 +++++++ include/m_olib.h | 12 +++ include/m_play.h | 25 +++++ include/m_prenmi.h | 25 +++++ include/m_select.h | 36 +++++++ include/m_trademark.h | 25 +++++ include/m_view.h | 50 ++++++++++ include/padmgr.h | 1 - include/player_select.h | 27 ++++++ include/save_menu.h | 27 ++++++ include/second_game.h | 23 +++++ rel/graph.c | 121 ++++++++++++++++-------- rel/m_game_dlftbls.c | 30 ++++++ 20 files changed, 548 insertions(+), 50 deletions(-) create mode 100644 include/famicom_emu.h create mode 100644 include/first_game.h create mode 100644 include/gamealloc.h create mode 100644 include/libforest/emu64/emu64_wrapper.h create mode 100644 include/libu64/u64types.h create mode 100644 include/m_controller.h create mode 100644 include/m_olib.h create mode 100644 include/m_play.h create mode 100644 include/m_prenmi.h create mode 100644 include/m_select.h create mode 100644 include/m_trademark.h create mode 100644 include/m_view.h create mode 100644 include/player_select.h create mode 100644 include/save_menu.h create mode 100644 include/second_game.h create mode 100644 rel/m_game_dlftbls.c diff --git a/include/famicom_emu.h b/include/famicom_emu.h new file mode 100644 index 00000000..86c9a3b6 --- /dev/null +++ b/include/famicom_emu.h @@ -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 diff --git a/include/first_game.h b/include/first_game.h new file mode 100644 index 00000000..014968a1 --- /dev/null +++ b/include/first_game.h @@ -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 diff --git a/include/game.h b/include/game.h index 1ae2cb62..9c90090d 100644 --- a/include/game.h +++ b/include/game.h @@ -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; diff --git a/include/gamealloc.h b/include/gamealloc.h new file mode 100644 index 00000000..1d503728 --- /dev/null +++ b/include/gamealloc.h @@ -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 diff --git a/include/libforest/emu64/emu64_wrapper.h b/include/libforest/emu64/emu64_wrapper.h new file mode 100644 index 00000000..3e239bdc --- /dev/null +++ b/include/libforest/emu64/emu64_wrapper.h @@ -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 diff --git a/include/libu64/u64types.h b/include/libu64/u64types.h new file mode 100644 index 00000000..089ac015 --- /dev/null +++ b/include/libu64/u64types.h @@ -0,0 +1,10 @@ +#ifndef U64TYPES_H +#define U64TYPES_H + +#include "types.h" + +typedef struct xyz_s { + f32 x, y, z; +} xyz_t; + +#endif diff --git a/include/libultra/osContPad.h b/include/libultra/osContPad.h index 600c4acd..367e5fa5 100644 --- a/include/libultra/osContPad.h +++ b/include/libultra/osContPad.h @@ -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 diff --git a/include/m_controller.h b/include/m_controller.h new file mode 100644 index 00000000..236fee31 --- /dev/null +++ b/include/m_controller.h @@ -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 diff --git a/include/m_olib.h b/include/m_olib.h new file mode 100644 index 00000000..58492c3f --- /dev/null +++ b/include/m_olib.h @@ -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 diff --git a/include/m_play.h b/include/m_play.h new file mode 100644 index 00000000..4d446105 --- /dev/null +++ b/include/m_play.h @@ -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 diff --git a/include/m_prenmi.h b/include/m_prenmi.h new file mode 100644 index 00000000..6678e8da --- /dev/null +++ b/include/m_prenmi.h @@ -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 diff --git a/include/m_select.h b/include/m_select.h new file mode 100644 index 00000000..e9d9d3e2 --- /dev/null +++ b/include/m_select.h @@ -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 diff --git a/include/m_trademark.h b/include/m_trademark.h new file mode 100644 index 00000000..5bb03beb --- /dev/null +++ b/include/m_trademark.h @@ -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 diff --git a/include/m_view.h b/include/m_view.h new file mode 100644 index 00000000..03472ad0 --- /dev/null +++ b/include/m_view.h @@ -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 diff --git a/include/padmgr.h b/include/padmgr.h index bf267c7a..0c2e786a 100644 --- a/include/padmgr.h +++ b/include/padmgr.h @@ -9,7 +9,6 @@ extern "C" { #endif -#define MAXCONTROLLERS 4 #define PADMSGBUFCNT 8 typedef struct { diff --git a/include/player_select.h b/include/player_select.h new file mode 100644 index 00000000..992387d4 --- /dev/null +++ b/include/player_select.h @@ -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 diff --git a/include/save_menu.h b/include/save_menu.h new file mode 100644 index 00000000..b6b0dfcc --- /dev/null +++ b/include/save_menu.h @@ -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 diff --git a/include/second_game.h b/include/second_game.h new file mode 100644 index 00000000..cb3f1ccb --- /dev/null +++ b/include/second_game.h @@ -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 diff --git a/rel/graph.c b/rel/graph.c index 6f781df3..6e17e424 100644 --- a/rel/graph.c +++ b/rel/graph.c @@ -1,21 +1,34 @@ #include "graph.h" -#include "libc64/malloc.h" -#include "libultra/libultra.h" -#include "libu64/debug.h" -#include "irqmgr.h" + +#include "dvderr.h" #include "game.h" +#include "irqmgr.h" +#include "libc64/malloc.h" +#include "libu64/debug.h" +#include "libultra/libultra.h" +#include "libforest/emu64/emu64_wrapper.h" +#include "m_debug.h" #include "m_game_dlftbls.h" #include "sys_dynamic.h" #include "sys_ucode.h" -#include "m_debug.h" -#include "dvderr.h" #include "zurumode.h" +#include "first_game.h" +#include "m_select.h" +#include "m_play.h" +#include "second_game.h" +#include "m_trademark.h" +#include "player_select.h" +#include "save_menu.h" +#include "famicom_emu.h" +#include "m_prenmi.h" + static int frame; static BOOL SoftResetEnable; static int skip_frame; -#define CONSTRUCT_THA_GA(tha_ga, name) (THA_GA_ct((tha_ga), (Gfx*)GET_DYNAMIC_OFS(##name##_OFS), ##name##_SIZE)) +#define CONSTRUCT_THA_GA(tha_ga, name) \ + (THA_GA_ct((tha_ga), (Gfx*)GET_DYNAMIC_OFS(##name##_OFS), ##name##_SIZE)) static void graph_setup_double_buffer(GRAPH* this) { bzero(sys_dynamic, DYNAMIC_SIZE); @@ -45,8 +58,37 @@ static void graph_setup_double_buffer(GRAPH* this) { this->gfxsave = NULL; } -/* TODO: This requires multiple GAME classes to be implemented before it will be matching */ static DLFTBL_GAME* game_get_next_game_dlftbl(GAME* game) { + void (*next_game_init_proc)(GAME*) = game_get_next_game_init(game); + + if (next_game_init_proc == first_game_init) { + return &game_dlftbls[0]; + } + else if (next_game_init_proc == select_init) { + return &game_dlftbls[1]; + } + else if (next_game_init_proc == play_init) { + return &game_dlftbls[2]; + } + else if (next_game_init_proc == second_game_init) { + return &game_dlftbls[3]; + } + else if (next_game_init_proc == trademark_init) { + return &game_dlftbls[5]; + } + else if (next_game_init_proc == player_select_init) { + return &game_dlftbls[6]; + } + else if (next_game_init_proc == save_menu_init) { + return &game_dlftbls[7]; + } + else if (next_game_init_proc == famicom_emu_init) { + return &game_dlftbls[8]; + } + else if (next_game_init_proc == prenmi_init) { + return &game_dlftbls[9]; + } + return NULL; } @@ -75,13 +117,13 @@ static void graph_task_set00(GRAPH* this) { ucode[1].type = UCODE_TYPE_SPRITE_TEXT; ucode[0].ucode_p = ucode_GetPolyTextStart(); ucode[1].ucode_p = ucode_GetSpriteTextStart(); - //JW_BeginFrame(); - //emu64_init(); - //emu64_set_ucode_info(2, ucode); - //emu64_set_first_ucode(ucode[0].ucode_p); - // emu64_taskstart(this->Gfx_list05); /* work data */ - // emu64_cleanup(); - // JW_EndFrame(); + // JW_BeginFrame(); + emu64_init(); + emu64_set_ucode_info(2, ucode); + emu64_set_first_ucode(ucode[0].ucode_p); + emu64_taskstart(this->Gfx_list05); /* work data */ + emu64_cleanup(); + // JW_EndFrame(); frame++; } } @@ -118,41 +160,41 @@ static int graph_draw_finish(GRAPH* this) { } if (THA_GA_isCrash(&this->overlay_thaga)) { - err = TRUE; - } + err = TRUE; + } if (THA_GA_isCrash(&this->line_opaque_thaga)) { - err = TRUE; - } + err = TRUE; + } if (THA_GA_isCrash(&this->polygon_opaque_thaga)) { - err = TRUE; - } + err = TRUE; + } if (THA_GA_isCrash(&this->polygon_translucent_thaga)) { - err = TRUE; - } + err = TRUE; + } if (THA_GA_isCrash(&this->font_thaga)) { - err = TRUE; - } + err = TRUE; + } if (THA_GA_isCrash(&this->shadow_thaga)) { - err = TRUE; - } + err = TRUE; + } if (THA_GA_isCrash(&this->light_thaga)) { - err = TRUE; - } + err = TRUE; + } return err; } static void do_soft_reset(GAME* game) { SoftResetEnable = FALSE; - //mBGM_reset(); - //mVibctl_reset(); - //sAdo_SoftReset(); + // mBGM_reset(); + // mVibctl_reset(); + // sAdo_SoftReset(); ResetTime = osGetTime(); ResetStatus = IRQ_RESET_PRENMI; } @@ -166,7 +208,7 @@ static void reset_check(GRAPH* this, GAME* game) { static void graph_main(GRAPH* this, GAME* game) { game->disable_prenmi = FALSE; graph_setup_double_buffer(this); - //game_get_controller(game); + game_get_controller(game); game->disable_display = FALSE; GRAPH_SET_DOING_POINT(this, GAME_MAIN); game_main(game); @@ -175,8 +217,7 @@ static void graph_main(GRAPH* this, GAME* game) { if (skip_frame < GETREG(SREG, 3)) { skip_frame++; this->frame_counter++; - } - else if (game->disable_display == FALSE) { + } else if (game->disable_display == FALSE) { skip_frame = 0; if (graph_draw_finish(this) == FALSE) { GRAPH_SET_DOING_POINT(this, TASK_SET); @@ -193,23 +234,21 @@ static void graph_main(GRAPH* this, GAME* game) { if (GETREG(SREG, 20) < 2) { GRAPH_SET_DOING_POINT(this, AUDIO); - //sAdo_GameFrame(); + // sAdo_GameFrame(); GRAPH_SET_DOING_POINT(this, AUDIO_FINISHED); } reset_check(this, game); if (ResetStatus == IRQ_RESET_PRENMI && game->disable_prenmi == FALSE) { - //game->running = FALSE; - //game->next_game_init = prenmi_init; - //game->next_game_size = sizeof(PRENMI_GAME); /* sizeof(PRENIM_GAME) == 0xE8 */ + GAME_GOTO_NEXT(game, prenmi, PRENMI); } } extern void graph_proc(void* arg) { DLFTBL_GAME* dlftbl = &game_dlftbls[0]; graph_ct(&graph_class); - + while (dlftbl != NULL) { size_t size = dlftbl->alloc_size; GAME* game = (GAME*)malloc(size); @@ -217,7 +256,7 @@ extern void graph_proc(void* arg) { bzero(game, size); GRAPH_SET_DOING_POINT(&graph_class, GAME_CT); game_ct(game); - //emu64_refresh(); + emu64_refresh(); GRAPH_SET_DOING_POINT(&graph_class, GAME_CT_FINISHED); while (game_is_doing(game)) { diff --git a/rel/m_game_dlftbls.c b/rel/m_game_dlftbls.c new file mode 100644 index 00000000..2d006a3c --- /dev/null +++ b/rel/m_game_dlftbls.c @@ -0,0 +1,30 @@ +#include "m_game_dlftbls.h" +#include "types.h" + +#include "first_game.h" +#include "m_select.h" +#include "m_play.h" +#include "second_game.h" +#include "m_trademark.h" +#include "player_select.h" +#include "save_menu.h" +#include "famicom_emu.h" +#include "m_prenmi.h" + +#define DLFTBL_MAKE(name, class) \ + { NULL, 0, 0, NULL, NULL, NULL, name##_init, name##_cleanup, NULL, NULL, NULL, sizeof(GAME_##class) } +#define DLFTBL_NULL() \ + { NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0 } + +DLFTBL_GAME game_dlftbls[] = { + DLFTBL_MAKE(first_game, FIRST), + DLFTBL_MAKE(select, SELECT), + DLFTBL_MAKE(play, PLAY), + DLFTBL_MAKE(second_game, SECOND), + DLFTBL_NULL(), /* removed & unused _GAME entry */ + DLFTBL_MAKE(trademark, TRADEMARK), + DLFTBL_MAKE(player_select, PLAYER_SELECT), + DLFTBL_MAKE(save_menu, SAVE_MENU), + DLFTBL_MAKE(famicom_emu, FAMICOM_EMU), + DLFTBL_MAKE(prenmi, PRENMI) +};