Get graph.c linked

This commit is contained in:
Cuyler36
2023-03-25 00:24:06 -04:00
parent 342725c2be
commit 6e38066c45
15 changed files with 223 additions and 137 deletions
+17
View File
@@ -0,0 +1,17 @@
#ifndef AUDIO_H
#define AUDIO_H
#include "types.h"
#ifdef __cplusplus
extern "C" {
#endif
extern void sAdo_GameFrame();
extern void sAdo_SoftReset();
#ifdef __cplusplus
}
#endif
#endif
+5 -5
View File
@@ -5,7 +5,7 @@
#include "TwoHeadArena.h"
#include "graph.h"
#include "gamealloc.h"
#include "pad.h"
#include "libu64/pad.h"
#include "m_controller.h"
#ifdef __cplusplus
@@ -28,20 +28,20 @@ typedef struct game_s {
/* 0x009E */ u8 disable_display;
/* 0x009F */ u8 doing;
/* 0x00A0 */ u32 frame_counter;
/* 0x00A4 */ u8 disable_prenmi;
/* 0x00A4 */ int disable_prenmi;
/* 0x00A8 */ MCON mcon;
} GAME;
extern void game_ct(GAME* game);
extern void game_ct(GAME*, void (*)(GAME*), GRAPH*);
extern void game_dt(GAME* game);
extern void game_main(GAME* game);
extern u8 game_is_doing(GAME* game);
extern int 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_init = (void (*)(struct game_s*))init_name##_init; \
g->next_game_class_size = sizeof(GAME_##class_name); \
} while (0)
+5 -4
View File
@@ -2,7 +2,7 @@
#define GRAPH_H
#include "types.h"
#include "mbi.h"
#include "PR/mbi.h"
#include "THA_GA.h"
#include "dolphin/os/OSMessage.h"
@@ -29,7 +29,7 @@ typedef enum {
GRAPH_DOING_TASK_SET_FINISHED,
GRAPH_DOING_AUDIO,
GRAPH_DOING_AUDIO_FINISHED,
GRAPH_DOING_18, /* This is unused? Can't find it anywhere. Perhaps only used in DnM. */
GRAPH_DOING_GAME_18, /* Not sure what this is, relevant code removed */
GRAPH_DOING_GAME_DT,
GRAPH_DOING_GAME_DT_FINISHED,
GRAPH_DOING_DT,
@@ -77,14 +77,14 @@ typedef struct graph_s {
/* 0x0349 */ u8 _unk349;
/* 0x034A */ u8 need_viupdate;
/* 0x034B */ u8 cfb_bank;
/* 0x034C */ void (*taskEndCallback)(GRAPH*, void*);
/* 0x034C */ void (*taskEndCallback)(struct graph_s*, void*);
/* 0x0350 */ void* taskEndData;
/* 0x0354 */ f32 vixscale;
/* 0x0358 */ f32 viyscale;
/* 0x035C */ Gfx* last_dl;
/* 0x0360 */ Gfx* Gfx_list10; /* shadow */
/* 0x0364 */ Gfx* Gfx_list11; /* light */
} GRAPH;
} GRAPH ATTRIBUTE_ALIGN(8); // one of the missing structs is likely aligned to 8 bytes.
extern void graph_proc(void* arg);
extern void graph_ct(GRAPH* this);
@@ -128,6 +128,7 @@ extern void graph_dt(GRAPH* this);
#define NOW_SHADOW_DISP (Gfx*)NOW_DISP(&__graph->shadow_thaga)
#define NOW_LIGHT_DISP (Gfx*)NOW_DISP(&__graph->light_thaga)
extern u8 SoftResetEnable;
extern GRAPH graph_class;
#ifdef __cplusplus
+17
View File
@@ -0,0 +1,17 @@
#ifndef JSYSWRAPPER_H
#define JSYSWRAPPER_H
#include "types.h"
#ifdef __cplusplus
extern "C" {
#endif
extern void JW_BeginFrame();
extern void JW_EndFrame();
#ifdef __cplusplus
}
#endif
#endif
+16
View File
@@ -0,0 +1,16 @@
#ifndef M_BGM_H
#define M_BGM_H
#include "types.h"
#ifdef __cplusplus
extern "C" {
#endif
extern void mBGM_reset();
#ifdef __cplusplus
}
#endif
#endif
+16
View File
@@ -0,0 +1,16 @@
#ifndef M_VIBCTL_H
#define M_VIBCTL_H
#include "types.h"
#ifdef __cplusplus
extern "C" {
#endif
extern void mVibctl_reset();
#ifdef __cplusplus
}
#endif
#endif
+1
View File
@@ -4,6 +4,7 @@
#include "types.h"
#include "irqmgr.h"
#include "libu64/pad.h"
#include "dolphin/os/OSMessage.h"
#ifdef __cplusplus
extern "C" {
+37 -32
View File
@@ -2,6 +2,7 @@
#define SYS_DYNAMIC_H
#include "types.h"
#include "PR/mbi.h"
#ifdef __cplusplus
extern "C" {
@@ -10,43 +11,47 @@ extern "C" {
#define SYSDYNAMIC_START_MAGIC 0x1234
#define SYSDYNAMIC_END_MAGIC 0x5678
#define DYNAMIC_HEADER_SIZE 8
#define DYNAMIC_EPILOG_SIZE 8
#define SHADOW_SIZE 512
#define LIGHT_SIZE 256
#define LINE_XLU_SIZE 9952
#define OVERLAY_SIZE 2048
#define LINE_OPA_SIZE 1024
#define WORK_SIZE 128
#define UNK_BUF0_SIZE 32
#define POLY_OPA_SIZE 1792
#define POLY_XLU_SIZE 512
#define FONT_SIZE 256
#define SHADOW_SIZE 0x1000
#define LIGHT_SIZE 0x800
#define LINE_XLU_SIZE 0x13700
#define OVERLAY_SIZE 0x4000
#define LINE_OPA_SIZE 0x2000
#define WORK_SIZE 0x400
#define UNK_BUF0_SIZE 0x100
#define POLY_OPA_SIZE 0x3800
#define POLY_XLU_SIZE 0x1000
#define FONT_SIZE 0x800
typedef struct dynamic_s {
u16 start_magic;
Gfx line_xlu[LINE_XLU_SIZE];
Gfx overlay[OVERLAY_SIZE];
Gfx line_opa[LINE_OPA_SIZE];
Gfx work[WORK_SIZE];
Gfx unused[UNK_BUF0_SIZE];
Gfx poly_opa[POLY_OPA_SIZE];
Gfx poly_xlu[POLY_XLU_SIZE];
Gfx font[FONT_SIZE];
Gfx shadow[SHADOW_SIZE];
Gfx light[LIGHT_SIZE];
u16 end_magic;
} dynamic_t;
#define SYSDYNAMIC_START (0)
#define SYSDYNAMIC_HEADER_OFS (SYSDYNAMIC_START)
#define LINE_XLU_OFS (SYSDYNAMIC_HEADER_OFS + DYNAMIC_HEADER_SIZE)
#define OVERLAY_OFS (LINE_XLU_OFS + LINE_XLU_SIZE)
#define LINE_OPA_OFS (OVERLAY_OFS + OVERLAY_SIZE)
#define WORK_OFS (LINE_OPA_OFS + LINE_OPA_SIZE)
#define UNUSED_OFS (WORK_OFS + WORK_SIZE)
#define POLY_OPA_OFS (UNUSED_OFS + UNK_BUF0_SIZE)
#define POLY_XLU_OFS (POLY_OPA_OFS + POLY_OPA_SIZE)
#define FONT_OFS (POLY_XLU_OFS + POLY_XLU_SIZE)
#define SHADOW_OFS (FONT_OFS + FONT_SIZE)
#define LIGHT_OFS (SHADOW_OFS + SHADOW_SIZE)
#define SYSDYNAMIC_EPILOG_OFS (LIGHT_OFS + LIGHT_SIZE)
#define SYSDYNAMIC_END (SYSDYNAMIC_EPILOG_OFS + DYNAMIC_EPILOG_SIZE)
extern dynamic_t sys_dynamic;
/* 0x20410 bytes */
#define DYNAMIC_SIZE \
(DYNAMIC_HEADER_SIZE + SHADOW_SIZE + LIGHT_SIZE + LINE_XLU_SIZE + OVERLAY_SIZE + LINE_OPA_SIZE + \
WORK_SIZE + UNK_BUF0_SIZE + POLY_OPA_SIZE + POLY_XLU_SIZE + FONT_SIZE + DYNAMIC_EPILOG_SIZE)
#define SYSDYNAMIC_OPEN() \
do { \
dynamic_t* __dyn = &sys_dynamic;\
while (0)
static u8 sys_dynamic[DYNAMIC_SIZE];
#define SYSDYNAMIC_CLOSE() \
(void)__dyn; \
} while (0)
#define GET_DYNAMIC_OFS(ofs) (&sys_dynamic[(ofs)])
#define SYSDYNAMIC_CHECK_START() (__dyn->start_magic == SYSDYNAMIC_START_MAGIC)
#define SYSDYNAMIC_CHECK_END() (__dyn->end_magic == SYSDYNAMIC_END_MAGIC)
#ifdef __cplusplus
};
+1 -1
View File
@@ -2,7 +2,7 @@
#define SYS_UCODE_H
#include "types.h"
#include "mbi.h"
#include "PR/mbi.h"
#ifdef __cplusplus
extern "C" {
+1 -1
View File
@@ -67,4 +67,4 @@ enum zurumode_stage {
}
#endif
#endif
#endif