mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-06-23 23:35:17 -04:00
Link m_debug_hayakawa.c
This commit is contained in:
@@ -40,6 +40,29 @@ extern void __OSCacheInit();
|
||||
void OSResetSystem(u32, u32, u32); // goes in reset, but eh
|
||||
void OSInit(void);
|
||||
|
||||
#define OS_CONSOLE_RETAIL4 0x00000004
|
||||
#define OS_CONSOLE_RETAIL3 0x00000003
|
||||
#define OS_CONSOLE_RETAIL2 0x00000002
|
||||
#define OS_CONSOLE_RETAIL1 0x00000001
|
||||
#define OS_CONSOLE_RETAIL 0x00000000
|
||||
#define OS_CONSOLE_DEVHW4 0x10000007
|
||||
#define OS_CONSOLE_DEVHW3 0x10000006
|
||||
#define OS_CONSOLE_DEVHW2 0x10000005
|
||||
#define OS_CONSOLE_DEVHW1 0x10000004
|
||||
#define OS_CONSOLE_MINNOW 0x10000003
|
||||
#define OS_CONSOLE_ARTHUR 0x10000002
|
||||
#define OS_CONSOLE_PC_EMULATOR 0x10000001
|
||||
#define OS_CONSOLE_EMULATOR 0x10000000
|
||||
#define OS_CONSOLE_DEVELOPMENT 0x10000000
|
||||
#define OS_CONSOLE_DEVKIT 0x10000000
|
||||
#define OS_CONSOLE_TDEVKIT 0x20000000
|
||||
|
||||
#define OS_CONSOLE_DEV_MASK 0x10000000
|
||||
|
||||
u32 OSGetConsoleType();
|
||||
#define OS_CONSOLE_IS_DEV() ((OSGetConsoleType() & OS_CONSOLE_DEV_MASK) != 0)
|
||||
|
||||
|
||||
|
||||
typedef void (*OSExceptionHandler)(u8, OSContext*);
|
||||
OSExceptionHandler __OSSetExceptionHandler(u8, OSExceptionHandler);
|
||||
|
||||
@@ -8,7 +8,8 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
void VISetBlack(BOOL);
|
||||
extern void VIWaitForRetrace();
|
||||
void VIWaitForRetrace();
|
||||
void VIConfigurePan(u16 x_origin, u16 y_origin, u16 width, u16 height);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
|
||||
+8
-8
@@ -68,8 +68,8 @@ typedef struct graph_s {
|
||||
/* 0x02E8 */ THA_GA font_thaga;
|
||||
/* 0x02F8 */ THA_GA shadow_thaga;
|
||||
/* 0x0308 */ THA_GA light_thaga;
|
||||
/* 0x0318 */ THA_GA new0_thaga;
|
||||
/* 0x0328 */ THA_GA new1_thaga;
|
||||
/* 0x0318 */ THA_GA bg_opaque_thaga;
|
||||
/* 0x0328 */ THA_GA bg_translucent_thaga;
|
||||
/* 0x0338 */ int frame_counter;
|
||||
/* 0x033C */ u16* frameBuffer;
|
||||
/* 0x0340 */ u16* renderBuffer;
|
||||
@@ -117,8 +117,8 @@ extern void graph_dt(GRAPH* this);
|
||||
#define NEXT_FONT_DISP NEXT_DISP(&__graph->font_thaga)
|
||||
#define NEXT_SHADOW_DISP NEXT_DISP(&__graph->shadow_thaga)
|
||||
#define NEXT_LIGHT_DISP NEXT_DISP(&__graph->light_thaga)
|
||||
#define NEXT_NEW0_DISP NEXT_DISP(&__graph->new0_thaga)
|
||||
#define NEXT_NEW1_DISP NEXT_DISP(&__graph->new1_thaga)
|
||||
#define NEXT_BG_OPA_DISP NEXT_DISP(&__graph->bg_opaque_thaga)
|
||||
#define NEXT_BG_XLU_DISP NEXT_DISP(&__graph->bg_translucent_thaga)
|
||||
|
||||
#define NOW_POLY_OPA_DISP (Gfx*)NOW_DISP(&__graph->polygon_opaque_thaga)
|
||||
#define NOW_POLY_XLU_DISP (Gfx*)NOW_DISP(&__graph->polygon_translucent_thaga)
|
||||
@@ -127,8 +127,8 @@ extern void graph_dt(GRAPH* this);
|
||||
#define NOW_FONT_DISP (Gfx*)NOW_DISP(&__graph->font_thaga)
|
||||
#define NOW_SHADOW_DISP (Gfx*)NOW_DISP(&__graph->shadow_thaga)
|
||||
#define NOW_LIGHT_DISP (Gfx*)NOW_DISP(&__graph->light_thaga)
|
||||
#define NOW_NEW0_DISP (Gfx*)NOW_DISP(&__graph->new0_thaga)
|
||||
#define NOW_NEW1_DISP (Gfx*)NOW_DISP(&__graph->new1_thaga)
|
||||
#define NOW_BG_OPA_DISP (Gfx*)NOW_DISP(&__graph->bg_opaque_thaga)
|
||||
#define NOW_BG_XLU_DISP (Gfx*)NOW_DISP(&__graph->bg_translucent_thaga)
|
||||
|
||||
#define SET_POLY_OPA_DISP(p) SET_DISP(&__graph->polygon_opaque_thaga, p)
|
||||
#define SET_POLY_XLU_DISP(p) SET_DISP(&__graph->polygon_translucent_thaga, p)
|
||||
@@ -137,8 +137,8 @@ extern void graph_dt(GRAPH* this);
|
||||
#define SET_FONT_DISP(p) SET_DISP(&__graph->font_thaga, p)
|
||||
#define SET_SHADOW_DISP(p) SET_DISP(&__graph->shadow_thaga, p)
|
||||
#define SET_LIGHT_DISP(p) SET_DISP(&__graph->light_thaga, p)
|
||||
#define SET_NEW0_DISP(p) SET_DISP(&__graph->new0_thaga, p)
|
||||
#define SET_NEW1_DISP(p) SET_DISP(&__graph->new1_thaga, p)
|
||||
#define SET_BG_OPA_DISP(p) SET_DISP(&__graph->bg_opaque_thaga, p)
|
||||
#define SET_BG_XLU_DISP(p) SET_DISP(&__graph->bg_translucent_thaga, p)
|
||||
|
||||
#define GRAPH_ALLOC(graph, size) ((void*)((graph)->polygon_opaque_thaga.tha.tail_p = (char*)((int)(graph)->polygon_opaque_thaga.tha.tail_p - (int)(size))))
|
||||
#define GRAPH_ALLOC_TYPE(graph, type, num) (GRAPH_ALLOC(graph, sizeof(type) * (num)))
|
||||
|
||||
@@ -61,7 +61,7 @@ u32 __osGetMemBlockSize(Arena*, void*);
|
||||
void __osDisplayArena(Arena*);
|
||||
int __osCheckArena(Arena*);
|
||||
|
||||
|
||||
extern int __osMalloc_FreeBlockTest_Enable;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
#ifndef EMU64_H
|
||||
#define EMU64_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* These might be signed */
|
||||
extern void emu64_set_aflags(u32 idx, u32 value);
|
||||
extern int emu64_get_aflags(u32 idx);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -9,6 +9,33 @@ extern "C" {
|
||||
|
||||
extern void JW_BeginFrame();
|
||||
extern void JW_EndFrame();
|
||||
extern void JW_JUTReport(int x, int y, int show_count, const char* fmt, ...);
|
||||
extern void JW_SetLowResoMode(BOOL enable);
|
||||
extern void JW_SetProgressiveMode(BOOL enable);
|
||||
|
||||
extern void* JC_JFWSystem_getSystemConsole();
|
||||
extern void* JC_JFWSystem_getRootHeap();
|
||||
|
||||
extern int JC_JKRHeap_dump(void* heap);
|
||||
extern s32 JC_JKRHeap_getTotalFreeSize(void* heap);
|
||||
|
||||
extern int JC_JUTConsole_isVisible(void* console);
|
||||
extern void JC_JUTConsole_setVisible(void* console, BOOL visible);
|
||||
extern void JC_JUTConsole_clear(void* console);
|
||||
extern void JC_JUTConsole_scroll(void* console, int scroll);
|
||||
extern int JC_JUTConsole_getPositionX(void* console);
|
||||
extern void JC_JUTConsole_setPosition(void* console, int x, int y);
|
||||
extern int JC_JUTConsole_getOutput(void* console);
|
||||
extern int JC_JUTConsole_getLineOffset(void* console);
|
||||
extern void JC_JUTConsole_dumpToTerminal(void* console, int lines);
|
||||
extern void JC_JUTConsole_setOutput(void* console, int output);
|
||||
|
||||
extern void* JC_JUTDbPrint_getManager();
|
||||
extern void JC_JUTDbPrint_setVisible(void* dbprint, BOOL visible);
|
||||
|
||||
extern void* JC_JUTProcBar_getManager();
|
||||
extern void JC_JUTProcBar_setVisible(void* procbar, BOOL visible);
|
||||
extern void JC_JUTProcBar_setVisibleHeapBar(void* procbar, BOOL visible);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -8,11 +8,12 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* sizeof(pad_t) == 0x18 */
|
||||
typedef struct {
|
||||
OSContPad now;
|
||||
OSContPad last;
|
||||
OSContPad on;
|
||||
OSContPad off;
|
||||
/* 0x00 */ OSContPad now;
|
||||
/* 0x06 */ OSContPad last;
|
||||
/* 0x0C */ OSContPad on;
|
||||
/* 0x12 */ OSContPad off;
|
||||
} pad_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
u32 r:8;
|
||||
u32 g:8;
|
||||
@@ -15,4 +19,8 @@ typedef union {
|
||||
rgba8888_t c;
|
||||
} rgba8888;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -17,11 +17,12 @@ typedef struct {
|
||||
u8 errno;
|
||||
} OSContStatus;
|
||||
|
||||
/* sizeof(OSContPad) == 6 */
|
||||
typedef struct {
|
||||
u16 button;
|
||||
s8 stick_x;
|
||||
s8 stick_y;
|
||||
u8 errno;
|
||||
/* 0x00 */ u16 button;
|
||||
/* 0x02 */ s8 stick_x;
|
||||
/* 0x03 */ s8 stick_y;
|
||||
/* 0x04 */ u8 errno;
|
||||
} OSContPad;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -55,6 +55,8 @@ typedef enum {
|
||||
#define DEBUG_REG_SIZE 16
|
||||
#define DEBUG_REG_GROUP 6
|
||||
|
||||
#define DEBUG_REG_COUNT (DEBUG_REG_SIZE * DEBUG_REG_GROUP * DEBUG_REG_MAX)
|
||||
|
||||
typedef struct debug_mode_s {
|
||||
u8 mode;
|
||||
u8 type;
|
||||
|
||||
@@ -11,6 +11,11 @@ extern "C" {
|
||||
|
||||
extern void debug_hayakawa_draw(GRAPH* graph);
|
||||
extern void debug_hayakawa_move(pad_t* pad);
|
||||
extern int hreg_init_check(const int n);
|
||||
|
||||
#define HREG_STATE_IDX 80
|
||||
#define HREG_STATE_ARGS_START 81
|
||||
#define HREG_STATE_ARGS_COUNT 14
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define M_FIELD_INFO_H
|
||||
|
||||
#include "types.h"
|
||||
#include "libu64/gfxprint.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -21,6 +22,9 @@ enum {
|
||||
|
||||
extern int mFI_GetClimate();
|
||||
|
||||
extern void mFI_PrintNowBGNum(gfxprint_t* gfxprint);
|
||||
extern void mFI_PrintFgAttr(gfxprint_t* gfxprint);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define M_MSG_H
|
||||
|
||||
#include "types.h"
|
||||
#include "libu64/gfxprint.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -16,6 +17,8 @@ extern M_MSG_WINDOW* mMsg_Get_base_window_p();
|
||||
|
||||
extern void mMsg_Set_free_str(M_MSG_WINDOW* msg, int free_str_no, u8* str, size_t str_size);
|
||||
|
||||
extern void mMsg_debug_draw(gfxprint_t* gfxprint);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
+2
-2
@@ -10,6 +10,8 @@ extern "C" {
|
||||
|
||||
#define APPNMI_FLAGS_IDX 15
|
||||
|
||||
#define APPNMI_GETVAL() (osAppNMIBuffer[APPNMI_FLAGS_IDX])
|
||||
|
||||
#define APPNMI_SET(v) (osAppNMIBuffer[APPNMI_FLAGS_IDX] |= v)
|
||||
#define APPNMI_CLR(v) (osAppNMIBuffer[APPNMI_FLAGS_IDX] &= ~v)
|
||||
#define APPNMI_GET(v) (osAppNMIBuffer[APPNMI_FLAGS_IDX] & v)
|
||||
@@ -54,8 +56,6 @@ extern "C" {
|
||||
#define APPNMI_HOTRESET_GET() (osAppNMIBuffer[APPNMI_FLAGS_IDX] & 0x200)
|
||||
#define APPNMI_HOTRESET_FLP() (osAppNMIBuffer[APPNMI_FLAGS_IDX] ^= 0x200)
|
||||
|
||||
#define APPNMI_
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define M_PRIVATE_H
|
||||
|
||||
#include "types.h"
|
||||
#include "libu64/gfxprint.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -9,6 +10,11 @@ extern "C" {
|
||||
|
||||
#define PLAYER_NUM 4
|
||||
|
||||
extern s16 mPr_GetGoodsPower();
|
||||
extern s16 mPr_GetMoneyPower();
|
||||
|
||||
extern void mPr_PrintMapInfo_debug(gfxprint_t* gfxprint);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -9,6 +9,8 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
extern Gfx* gfx_gSPTextureRectangle1(Gfx* gfx, u32 ulx, u32 uly, u32 lrx, u32 lry, int tile, int s, int t, int dsdx, int dtdy);
|
||||
extern Gfx* gfx_gDPFillRectangle1(Gfx* gfx, u32 ulx, u32 uly, u32 lrx, u32 lry);
|
||||
extern Gfx* gfx_gDPFillRectangleF(Gfx* gfx, u32 ulx, u32 uly, u32 lrx, u32 lry);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef MAIN_H
|
||||
#define MAIN_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define SCREEN_WIDTH 320
|
||||
#define SCREEN_HEIGHT 240
|
||||
|
||||
extern int ScreenWidth;
|
||||
extern int ScreenHeight;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,58 +0,0 @@
|
||||
#ifndef ROOM_TYPE_H
|
||||
#define ROOM_TYPE_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
enum {
|
||||
FG_ITEM0_TYPE,
|
||||
FG_FTR0_TYPE,
|
||||
FG_ITEM1_TYPE,
|
||||
FG_FTR1_TYPE,
|
||||
FG_NXGT0_TYPE,
|
||||
FG_STRUCTURE_TYPE,
|
||||
FG_PAD6_TYPE,
|
||||
FG_PAD7_TYPE,
|
||||
FG_ITEM2_TYPE,
|
||||
FG_ACTOR_TYPE,
|
||||
FG_PROPS_TYPE,
|
||||
FG_PAD11_TYPE,
|
||||
FG_PAD12_TYPE,
|
||||
FG_SP_NPC_TYPE,
|
||||
FG_NPC_TYPE,
|
||||
FG_DONT_TYPE,
|
||||
FG_TYPE_NUM
|
||||
};
|
||||
|
||||
// TEMPORARY. Should be generated with .decl files
|
||||
#define ITEM0_NO_START 0x0000
|
||||
#define NULL_NO ITEM0_NO_START
|
||||
#define ITEM0_1_NO_START ITEM0_NO_START + 0x800
|
||||
|
||||
#define FTR0_NO_START 0x1000
|
||||
|
||||
#define ITEM1_NO_START 0x2000
|
||||
#define ITEM1_0_NO_START ITEM0_1_NO_START // paper
|
||||
#define ITEM1_1_NO_START ITEM1_NO_START + 0x100 // money
|
||||
#define ITEM1_2_NO_START ITEM1_NO_START + 0x200 // tools
|
||||
#define ITEM1_3_NO_START ITEM1_NO_START + 0x300 // fish
|
||||
#define ITEM1_4_NO_START ITEM1_NO_START + 0x400 // clothing
|
||||
#define ITEM1_5_NO_START ITEM1_NO_START + 0x500 // etc
|
||||
#define ITEM1_6_NO_START ITEM1_NO_START + 0x600 // carpets
|
||||
#define ITEM1_7_NO_START ITEM1_NO_START + 0x700 // wallpaper
|
||||
#define ITEM1_8_NO_START ITEM1_NO_START + 0x800 // food
|
||||
#define ITEM1_9_NO_START ITEM1_NO_START + 0x900 // seeds
|
||||
#define ITEM1_A_NO_START ITEM1_NO_START + 0xA00 // mini disks
|
||||
#define ITEM1_B_NO_START ITEM1_NO_START + 0xB00 // diaries
|
||||
#define ITEM1_C_NO_START ITEM1_NO_START + 0xC00 // tickets
|
||||
#define ITEM1_D_NO_START ITEM1_NO_START + 0xD00 // insects
|
||||
#define ITEM1_E_NO_START ITEM1_NO_START + 0xE00 // hukubukuro
|
||||
#define ITEM1_F_NO_START ITEM1_NO_START + 0xF00 // kabu
|
||||
|
||||
#define FTR1_NO_START 0x3000
|
||||
|
||||
#define GET_FG_ITEM0_CATEGORY(f) (((f)&0x800) >> 11)
|
||||
#define GET_FG_ITEM1_CATEGORY(f) (((f)&0xF00) >> 8)
|
||||
#define GET_FG_TYPE(f) (((f)&0xF000) >> 12)
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user