Fix various non matching issues and introduce #ifdef NON_EQUIVALENT instead of #if 0 (#207)

This commit is contained in:
Roman971
2020-06-14 05:29:59 +02:00
committed by GitHub
parent 031d946db7
commit 06fc61c83d
18 changed files with 297 additions and 1307 deletions
+1 -1
View File
@@ -1635,7 +1635,7 @@ void PadMgr_HandlePreNMI(PadMgr* padmgr);
// This function must remain commented out, because it is called incorrectly in
// fault.c (actual bug in game), and the compiler notices and won't compile it
// void PadMgr_RequestPadData(PadMgr* padmgr, Input* inputs, s32 mode);
void PadMgr_Init(PadMgr* padmgr, OSMesgQueue* siIntMsgQ, UNK_TYPE arg2, OSId id, OSPri priority, void* stack);
void PadMgr_Init(PadMgr* padmgr, OSMesgQueue* siIntMsgQ, IrqMgr* irqMgr, OSId id, OSPri priority, void* stack);
void Sched_SwapFrameBuffer(CfbInfo* cfbInfo);
void func_800C84E4(SchedContext* sc, CfbInfo* cfbInfo);
void Sched_HandleReset(SchedContext* sc);
+9 -6
View File
@@ -45,17 +45,20 @@
#define CHECK_QUEST_ITEM(item) (gBitFlags[item] & gSaveContext.questItems)
#define SET_NEXT_GAMESTATE(curState, newInit, newStruct) \
(curState)->init = newInit; \
(curState)->size = sizeof(newStruct);
(curState)->init = newInit; \
(curState)->size = sizeof(newStruct);
#define LOG(exp, value, format, file, line) \
LogUtils_LogThreadId(file, line); \
osSyncPrintf(exp " = " format "\n", value);
#define LOG(exp, value, format, file, line) \
do { \
LogUtils_LogThreadId(file, line); \
osSyncPrintf(exp " = " format "\n", value); \
} while (0)
#define LOG_STRING(string, file, line) LOG(#string, string, "%s", file, line)
#define LOG_ADDRESS(exp, value, file, line) LOG(exp, value, "%08x", file, line)
#define LOG_TIME(exp, value, file, line) LOG(exp, value, "%lld", file, line)
#define LOG_NUM(exp, value, file, line) LOG(exp, value, "%d", file, line)
#define LOG_HEX(exp, value, file, line) LOG(exp, value, "%x", file, line)
/*
* `x` vertex x
@@ -67,7 +70,7 @@
* `cgny` green component of color vertex, or y component of normal vertex
* `cbnz` blue component of color vertex, or z component of normal vertex
* `a` alpha
*/
*/
#define VTX(x,y,z,s,t,crnx,cgny,cbnz,a) { { { x, y, z }, 0, { s, t }, { crnx, cgny, cbnz, a } } }
#define VTX_T(x,y,z,s,t,cr,cg,cb,a) { { x, y, z }, 0, { s, t }, { cr, cg, cb, a } }
+29 -32
View File
@@ -327,35 +327,6 @@ typedef struct
*/
} Input; // size = 0x18
typedef struct {
/* 0x0000 */ OSContStatus pad_status[4];
/* 0x0010 */ OSMesg msgbuf1[1];
/* 0x0014 */ OSMesg msgbuf2[1];
/* 0x0018 */ OSMesg msgbuf3[4];
/* 0x0028 */ OSMesgQueue queue1;
/* 0x0040 */ OSMesgQueue queue2;
/* 0x0058 */ OSMesgQueue queue3;
/* 0x0070 */ UNK_TYPE unk_70;
/* 0x0074 */ UNK_TYPE unk_74;
/* 0x0078 */ UNK_TYPE unk_78;
/* 0x007C */ UNK_TYPE unk_7C;
/* 0x0080 */ OSThread thread;
/* 0x0230 */ Input inputs[4]; // 0x18 each = 0x60 total
/* 0x0290 */ PadState pads[4]; // 0x6 each = 0x18 total
/* 0x02A8 */ volatile u8 validCtrlrsMask;
/* 0x02A9 */ s8 ncontrollers;
/* 0x02AA */ u8 ctrlrIsConnected[4]; // "Key_switch" originally
/* 0x02AE */ u8 pakType[4]; // 1 if rumble pack, 2 if mempak?
/* 0x02B2 */ volatile u8 rumbleEnable[4];
/* 0x02B6 */ u8 rumbleCounter[4]; // not clear exact meaning
/* 0x02BC */ unk_controller_t unk_controller[4];
/* 0x045C */ volatile u8 rumbleOffFrames;
/* 0x045D */ volatile u8 rumbleOnFrames;
/* 0x045E */ u8 preNMIShutdown;
/* 0x0460 */ void (*retraceCallback)(void* padmgr, u32 unk464);
/* 0x0464 */ u32 retraceCallbackValue;
} PadMgr; // size = 0x468
typedef struct {
/* 0x0000 */ s32 topY; // uly (upper left y)
/* 0x0004 */ s32 bottomY; // lry (lower right y)
@@ -363,14 +334,13 @@ typedef struct {
/* 0x000C */ s32 rightX; // lrx (lower right x)
} Viewport; // size = 0x10
typedef struct {
/* 0x0000 */ s32 magic; // string literal "VIEW" / 0x56494557
/* 0x0004 */ GraphicsContext* gfxCtx;
/* 0x0008 */ Viewport viewport;
/* 0x0018 */ f32 fovy; // vertical field of view in degrees
/* 0x001C */ f32 zNear; // distance to near clipping plane
/* 0x0020 */ f32 zFar; // distance to far clipping plane
/* 0x001C */ f32 zNear; // distance to near clipping plane
/* 0x0020 */ f32 zFar; // distance to far clipping plane
/* 0x0024 */ f32 scale; // scale for matrix elements
/* 0x0028 */ Vec3f eye;
/* 0x0034 */ Vec3f unk_34;
@@ -1569,6 +1539,33 @@ typedef struct {
/* 0x278 */ OSTime retraceTime;
} IrqMgr; // size = 0x280
typedef struct {
/* 0x0000 */ OSContStatus padStatus[4];
/* 0x0010 */ OSMesg serialMsgBuf[1];
/* 0x0014 */ OSMesg lockMsgBuf[1];
/* 0x0018 */ OSMesg interruptMsgBuf[4];
/* 0x0028 */ OSMesgQueue serialMsgQ;
/* 0x0040 */ OSMesgQueue lockMsgQ;
/* 0x0058 */ OSMesgQueue interruptMsgQ;
/* 0x0070 */ IrqMgrClient irqClient;
/* 0x0078 */ IrqMgr* irqMgr;
/* 0x0080 */ OSThread thread;
/* 0x0230 */ Input inputs[4];
/* 0x0290 */ PadState pads[4];
/* 0x02A8 */ volatile u8 validCtrlrsMask;
/* 0x02A9 */ u8 ncontrollers;
/* 0x02AA */ u8 ctrlrIsConnected[4]; // "Key_switch" originally
/* 0x02AE */ u8 pakType[4]; // 1 if rumble pack, 2 if mempak?
/* 0x02B2 */ volatile u8 rumbleEnable[4];
/* 0x02B6 */ u8 rumbleCounter[4]; // not clear exact meaning
/* 0x02BC */ unk_controller_t unk_controller[4];
/* 0x045C */ volatile u8 rumbleOffFrames;
/* 0x045D */ volatile u8 rumbleOnFrames;
/* 0x045E */ u8 preNMIShutdown;
/* 0x0460 */ void (*retraceCallback)(void* padmgr, u32 unk464);
/* 0x0464 */ u32 retraceCallbackValue;
} PadMgr; // size = 0x468
// == Previously sched.h
#define OS_SC_NEEDS_RDP 0x0001