mirror of
https://github.com/HarbourMasters/2ship2harkinian.git
synced 2024-11-27 16:20:34 +00:00
Decompile graph.c (#274)
* Decompiled, 1 non-matching, add some bss reordering helpers * Document stuff * Review suggestions * graphutil.c -> graphalloc.c * Try to fix fault callback warnings * Remove extra comments in GfxMasterList * char pad -> u32 pad Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * Fix gameState Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Other suggestions Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
This commit is contained in:
parent
38fc110f99
commit
b1b114e142
@ -53,9 +53,9 @@ void __osSyncVPrintf(const char* fmt, ...);
|
||||
void osSyncPrintf(const char* fmt, ...);
|
||||
void rmonPrintf(const char* fmt, ...);
|
||||
void Fault_SleepImpl(u32 duration);
|
||||
void Fault_AddClient(FaultClient* client, fault_client_func callback, void* param0, void* param1);
|
||||
void Fault_AddClient(FaultClient* client, void* callback, void* param0, void* param1);
|
||||
void Fault_RemoveClient(FaultClient* client);
|
||||
void Fault_AddAddrConvClient(FaultAddrConvClient* client, FaultAddrConvFunc callback, void* param);
|
||||
void Fault_AddAddrConvClient(FaultAddrConvClient* client, void* callback, void* param);
|
||||
void Fault_RemoveAddrConvClient(FaultAddrConvClient* client);
|
||||
void* Fault_ConvertAddress(void* addr);
|
||||
void Fault_Sleep(u32 duration);
|
||||
@ -2412,7 +2412,7 @@ Gfx* Gfx_TwoTexScroll(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 wi
|
||||
Gfx* Gfx_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, u32 x2, u32 y2, s32 width2, s32 height2, s32 r, s32 g, s32 b, s32 a);
|
||||
Gfx* Gfx_EnvColor(GraphicsContext* gfxCtx, s32 r, s32 g, s32 b, s32 a);
|
||||
Gfx* Gfx_PrimColor(GraphicsContext* gfxCtx, s32 lodfrac, s32 r, s32 g, s32 b, s32 a);
|
||||
void func_8012CF0C(GraphicsContext* gfxCtx, s32 iParm2, s32 iParm3, u8 r, u8 g, u8 b);
|
||||
void func_8012CF0C(GraphicsContext* gfxCtx, s32 clearFb, s32 clearZb, u8 r, u8 g, u8 b);
|
||||
void func_8012D374(GraphicsContext* gfxCtx, u8 r, u8 g, u8 b);
|
||||
void func_8012D40C(f32* param_1, f32* param_2, s16* param_3);
|
||||
void Room_nop8012D510(GlobalContext* globalCtx, Room* room, UNK_PTR param_3, UNK_TYPE1 param_4);
|
||||
@ -3176,26 +3176,26 @@ void GameState_Realloc(GameState* gameState, size_t size);
|
||||
void GameState_Init(GameState* gameState, GameStateFunc gameStateInit, GraphicsContext* gfxCtx);
|
||||
void GameState_Destroy(GameState* gameState);
|
||||
GameStateFunc GameState_GetNextStateInit(GameState* gameState);
|
||||
size_t Game_GetNextStateSize(GameState* gameState);
|
||||
size_t GameState_GetNextStateSize(GameState* gameState);
|
||||
u32 GameState_IsRunning(GameState* gameState);
|
||||
s32 GameState_GetArenaSize(GameState* gameState);
|
||||
s32 func_80173B48(GameState* gameState);
|
||||
void GameAlloc_Log(GameAlloc* heap);
|
||||
void* GameAlloc_Malloc(GameAlloc* heap, size_t size);
|
||||
void GameAlloc_Free(GameAlloc* heap, void* ptr);
|
||||
void GameAlloc_Cleanup(GameAlloc* heap);
|
||||
void GameAlloc_Init(GameAlloc* iParm1);
|
||||
// void Graph_FaultClient(void);
|
||||
void Graph_DlAlloc(TwoHeadGfxArena* dl, void* memoryBlock, size_t size);
|
||||
void Graph_InitTHGA(GraphicsContext* gfxCtx);
|
||||
void GameAlloc_Log(GameAlloc* this);
|
||||
void* GameAlloc_Malloc(GameAlloc* this, size_t size);
|
||||
void GameAlloc_Free(GameAlloc* this, void* data);
|
||||
void GameAlloc_Cleanup(GameAlloc* this);
|
||||
void GameAlloc_Init(GameAlloc* this);
|
||||
void* Graph_FaultClient(void);
|
||||
void Graph_InitTHGA(TwoHeadGfxArena* arena, Gfx* buffer, s32 size);
|
||||
void Graph_SetNextGfxPool(GraphicsContext* gfxCtx);
|
||||
GameStateOverlay* Graph_GetNextGameState(GameState* gameState);
|
||||
void* Graph_FaultAddrConvFunc(void* addr);
|
||||
void* Graph_FaultAddrConvFunc(void* address, void* param);
|
||||
void Graph_Init(GraphicsContext* gfxCtx);
|
||||
// void Graph_Destroy(void);
|
||||
void Graph_Render(GraphicsContext* gfxCtx, GameState* gameState);
|
||||
void Graph_FrameSetup(GameState* gameState);
|
||||
void Graph_RenderFrame(GraphicsContext* gfxCtx, GameState* gameState);
|
||||
void Graph_DoFrame(GraphicsContext* gfxCtx, GameState* gameState);
|
||||
void Graph_Destroy(GraphicsContext* gfxCtx);
|
||||
void Graph_TaskSet00(GraphicsContext* gfxCtx, GameState* gameState);
|
||||
void Graph_UpdateGame(GameState* gameState);
|
||||
void Graph_ExecuteAndDraw(GraphicsContext* gfxCtx, GameState* gameState);
|
||||
void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState);
|
||||
void Graph_ThreadEntry(void* arg);
|
||||
Gfx* Graph_GfxPlusOne(Gfx* gfx);
|
||||
Gfx* Graph_BranchDlist(Gfx* gfx, Gfx* dst);
|
||||
@ -3267,10 +3267,10 @@ void func_801780F0(Mtx* param_1, f32 param_2, f32 param_3, f32 param_4, f32 para
|
||||
// void func_8017842C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8, UNK_TYPE4 param_9, UNK_TYPE4 param_10, UNK_TYPE4 param_11);
|
||||
// void func_80178750(void);
|
||||
// void func_80178818(void);
|
||||
// void func_80178978(void);
|
||||
void func_80178978(void);
|
||||
// void func_801789D4(void);
|
||||
u32* get_framebuffer(s32 index);
|
||||
// u16* get_zbuffer(void);
|
||||
u32 SysCfb_GetFbPtr(s32 index);
|
||||
u32 SysCfb_GetZBuffer(void);
|
||||
// UNK_TYPE4 func_80178A24(void);
|
||||
// void func_80178A34(void);
|
||||
s32 func_80178A94(s32 param_1, s32 param_2);
|
||||
@ -3436,10 +3436,10 @@ void func_8018219C(MtxF* pfParm1, Vec3s* psParm2, s32 iParm3);
|
||||
// void func_801822C4(void);
|
||||
void Matrix_InsertRotationAroundUnitVector_f(f32 rotation, Vec3f* vector, s32 appendToState);
|
||||
void Matrix_InsertRotationAroundUnitVector_s(s16 rotation, Vec3f* vector, s32 appendToState);
|
||||
// void func_80182C90(void);
|
||||
// void func_80182CA0(void);
|
||||
// void func_80182CBC(void);
|
||||
// void func_80182CCC(void);
|
||||
u64* SysUcode_GetUCodeBoot(void);
|
||||
u32 SysUcode_GetUCodeBootSize(void);
|
||||
u64* SysUcode_GetUCode(void);
|
||||
u64* SysUcode_GetUCodeData(void);
|
||||
// void func_80182CE0(void);
|
||||
// void func_80183020(void);
|
||||
// void func_80183058(void);
|
||||
|
@ -88,6 +88,7 @@ extern GraphicsContext* __gfxCtx;
|
||||
#define POLY_OPA_DISP __gfxCtx->polyOpa.p
|
||||
#define POLY_XLU_DISP __gfxCtx->polyXlu.p
|
||||
#define OVERLAY_DISP __gfxCtx->overlay.p
|
||||
#define DEBUG_DISP __gfxCtx->debug.p
|
||||
|
||||
// __gfxCtx shouldn't be used directly.
|
||||
// Use the DISP macros defined above when writing to display buffers.
|
||||
@ -121,6 +122,7 @@ extern GraphicsContext* __gfxCtx;
|
||||
|
||||
#define ALIGN8(val) (((val) + 7) & ~7)
|
||||
#define ALIGN16(val) (((val) + 0xF) & ~0xF)
|
||||
#define ALIGN64(val) (((val) + 0x3F) & ~0x3F)
|
||||
|
||||
#define SQ(x) ((x) * (x))
|
||||
#define ABS(x) ((x) >= 0 ? (x) : -(x))
|
||||
|
@ -81,10 +81,8 @@ typedef struct {
|
||||
/* 0x18 */ s32 (*epiDmaCallback)(OSPiHandle*, s32, u32, void*, size_t);
|
||||
} OSDevMgr; // size = 0x1C
|
||||
|
||||
|
||||
typedef u64 OSTime;
|
||||
|
||||
|
||||
typedef struct OSTimer_s {
|
||||
/* 0x00 */ struct OSTimer_s* next;
|
||||
/* 0x04 */ struct OSTimer_s* prev;
|
||||
@ -94,7 +92,6 @@ typedef struct OSTimer_s {
|
||||
/* 0x1C */ OSMesg msg;
|
||||
} OSTimer; // size = 0x20
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u16 type;
|
||||
/* 0x2 */ u8 status;
|
||||
|
@ -79,26 +79,26 @@ typedef struct {
|
||||
/* 0x00 */ u32 type;
|
||||
/* 0x04 */ u32 flags;
|
||||
|
||||
/* 0x08 */ u64* ucode_boot;
|
||||
/* 0x0C */ u32 ucode_boot_size;
|
||||
/* 0x08 */ u64* ucodeBoot;
|
||||
/* 0x0C */ u32 ucodeBootSize;
|
||||
|
||||
/* 0x10 */ u64* ucode;
|
||||
/* 0x14 */ u32 ucode_size;
|
||||
/* 0x14 */ u32 ucodeSize;
|
||||
|
||||
/* 0x18 */ u64* ucode_data;
|
||||
/* 0x1C */ u32 ucode_data_size;
|
||||
/* 0x18 */ u64* ucodeData;
|
||||
/* 0x1C */ u32 ucodeDataSize;
|
||||
|
||||
/* 0x20 */ u64* dram_stack;
|
||||
/* 0x24 */ u32 dram_stack_size;
|
||||
/* 0x20 */ u64* dramStack;
|
||||
/* 0x24 */ u32 dramStackSize;
|
||||
|
||||
/* 0x28 */ u64* output_buff;
|
||||
/* 0x2C */ u64* output_buff_size;
|
||||
/* 0x28 */ u64* outputBuff;
|
||||
/* 0x2C */ u64* outputBuffSize;
|
||||
|
||||
/* 0x30 */ u64* data_ptr;
|
||||
/* 0x34 */ u32 data_size;
|
||||
/* 0x30 */ u64* dataPtr;
|
||||
/* 0x34 */ u32 dataSize;
|
||||
|
||||
/* 0x38 */ u64* yield_data_ptr;
|
||||
/* 0x3C */ u32 yield_data_size;
|
||||
/* 0x38 */ u64* yieldDataPtr;
|
||||
/* 0x3C */ u32 yieldDataSize;
|
||||
} OSTask_t; // size = 0x40
|
||||
|
||||
typedef union
|
||||
|
@ -1,6 +1,8 @@
|
||||
#ifndef _ULTRA64_VI_H_
|
||||
#define _ULTRA64_VI_H_
|
||||
|
||||
#include "ultra64/message.h"
|
||||
|
||||
/* Special Features */
|
||||
#define OS_VI_GAMMA_ON 0x0001
|
||||
#define OS_VI_GAMMA_OFF 0x0002
|
||||
@ -65,7 +67,7 @@ typedef struct {
|
||||
/* 0x14 */ OSMesg* msg;
|
||||
/* 0x18 */ __OSViScale x;
|
||||
/* 0x24 */ __OSViScale y;
|
||||
} OSViContext; // size = 0x30
|
||||
} __OSViContext; // size = 0x30
|
||||
|
||||
#define OS_VI_NTSC_LPN1 0 /* NTSC */
|
||||
#define OS_VI_NTSC_LPF1 1
|
||||
@ -97,6 +99,36 @@ typedef struct {
|
||||
#define OS_VI_PAL_HPN2 26
|
||||
#define OS_VI_PAL_HPF2 27
|
||||
|
||||
#define OS_VI_MPAL_LPN1 28 /* MPAL */
|
||||
#define OS_VI_MPAL_LPF1 29
|
||||
#define OS_VI_MPAL_LAN1 30
|
||||
#define OS_VI_MPAL_LAF1 31
|
||||
#define OS_VI_MPAL_LPN2 32
|
||||
#define OS_VI_MPAL_LPF2 33
|
||||
#define OS_VI_MPAL_LAN2 34
|
||||
#define OS_VI_MPAL_LAF2 35
|
||||
#define OS_VI_MPAL_HPN1 36
|
||||
#define OS_VI_MPAL_HPF1 37
|
||||
#define OS_VI_MPAL_HAN1 38
|
||||
#define OS_VI_MPAL_HAF1 39
|
||||
#define OS_VI_MPAL_HPN2 40
|
||||
#define OS_VI_MPAL_HPF2 41
|
||||
|
||||
#define OS_VI_FPAL_LPN1 42 /* FPAL */
|
||||
#define OS_VI_FPAL_LPF1 43
|
||||
#define OS_VI_FPAL_LAN1 44
|
||||
#define OS_VI_FPAL_LAF1 45
|
||||
#define OS_VI_FPAL_LPN2 46
|
||||
#define OS_VI_FPAL_LPF2 47
|
||||
#define OS_VI_FPAL_LAN2 48
|
||||
#define OS_VI_FPAL_LAF2 49
|
||||
#define OS_VI_FPAL_HPN1 50
|
||||
#define OS_VI_FPAL_HPF1 51
|
||||
#define OS_VI_FPAL_HAN1 52
|
||||
#define OS_VI_FPAL_HAF1 53
|
||||
#define OS_VI_FPAL_HPN2 54
|
||||
#define OS_VI_FPAL_HPF2 55
|
||||
|
||||
#define OS_TV_PAL 0
|
||||
#define OS_TV_NTSC 1
|
||||
#define OS_TV_MPAL 2
|
||||
|
@ -937,13 +937,7 @@ extern s16 D_801BD8C6;
|
||||
extern ColliderCylinderInit fireObjCollisionInit;
|
||||
extern FireObjLightParams D_801BD8FC[2];
|
||||
extern GameStateOverlay gGameStateOverlayTable[];
|
||||
// extern GameStateOverlay D_801BD940;
|
||||
// extern GameStateOverlay titleGameStateInfo;
|
||||
// extern GameStateOverlay mainGameStateInfo;
|
||||
// extern GameStateOverlay openingGameStateInfo;
|
||||
// extern GameStateOverlay fileChooseGameStateInfo;
|
||||
// extern GameStateOverlay daytelopGameStateInfo;
|
||||
// extern UNK_TYPE4 graphNumGameStates;
|
||||
extern s32 graphNumGameStates;
|
||||
// extern UNK_TYPE2 D_801BDA70;
|
||||
// extern UNK_TYPE2 D_801BDA74;
|
||||
// extern UNK_TYPE2 D_801BDA78;
|
||||
@ -1660,8 +1654,8 @@ extern s32 gFramerateDivisor;
|
||||
extern f32 gFramerateDivisorF;
|
||||
extern f32 gFramerateDivisorHalf;
|
||||
extern f32 gFramerateDivisorThird;
|
||||
extern u32 D_801D1510;
|
||||
extern u32 D_801D1514[3];
|
||||
extern u32 retryCount;
|
||||
extern u32 cfbIdx[3];
|
||||
extern s32 gScreenWidth;
|
||||
extern s32 gScreenHeight;
|
||||
extern u32 startHeapSize;
|
||||
@ -3422,11 +3416,10 @@ extern struct_801F8010 D_801F8010;
|
||||
extern struct_801F8020 D_801F8020;
|
||||
extern VisMono sMonoColors;
|
||||
extern UNK_TYPE1 D_801F8048;
|
||||
extern FaultAddrConvClient grapgFaultAddrConvClient;
|
||||
extern FaultClient graphFaultClient;
|
||||
extern Gfx* graphDlEntry;
|
||||
// extern UNK_TYPE1 D_801F80F8;
|
||||
extern u64 lastRenderFrameTimestamp;
|
||||
extern FaultAddrConvClient sGraphFaultAddrConvClient;
|
||||
extern FaultClient sGraphFaultClient;
|
||||
extern GfxMasterList* gGfxMasterDL;
|
||||
extern CfbInfo sGraphCfbInfos[3];
|
||||
extern OSMesgQueue sSiIntMsgQ;
|
||||
extern OSMesg sSiIntMsgBuf[1];
|
||||
extern u32 gSegments[NUM_SEGMENTS];
|
||||
@ -3452,8 +3445,8 @@ extern OSTime sRSPOtherStartTime;
|
||||
extern OSTime sRDPStartTime;
|
||||
extern u64* gAudioSPDataPtr;
|
||||
extern u32 gAudioSPDataSize;
|
||||
// extern UNK_TYPE1 D_801FBAE0;
|
||||
// extern UNK_TYPE1 D_801FBAE8;
|
||||
extern volatile OSTime D_801FBAE0;
|
||||
extern volatile OSTime D_801FBAE8;
|
||||
extern volatile OSTime D_801FBAF0;
|
||||
extern volatile OSTime lastRenderFrameDuration;
|
||||
extern volatile OSTime gRSPAudioTotalTime;
|
||||
@ -3466,21 +3459,21 @@ extern OSViMode D_801FBB30;
|
||||
extern u32* gFramebuffers[2];
|
||||
extern OSViMode* D_801FBB88;
|
||||
extern u16* gZBufferPtr;
|
||||
// extern UNK_TYPE4 D_801FBB90;
|
||||
// extern UNK_TYPE1 D_801FBB94;
|
||||
// extern UNK_TYPE1 D_801FBB98;
|
||||
extern void* D_801FBB90;
|
||||
extern u64* gGfxSPTaskOutputBufferPtr;
|
||||
extern u32 gGfxSPTaskOutputBufferSize;
|
||||
// extern UNK_TYPE1 D_801FBB9C;
|
||||
// extern UNK_TYPE1 D_801FBBA0;
|
||||
extern u16* sys_cfb_zbufl;
|
||||
extern u16** sys_cfb_wbufl;
|
||||
extern u16** sys_cfb_fifol;
|
||||
// extern UNK_TYPE1 D_801FBBB0;
|
||||
extern u16 (*gZBuffer)[SCREEN_WIDTH * SCREEN_HEIGHT];
|
||||
extern u16 (*gWorkBuffer)[SCREEN_WIDTH * SCREEN_HEIGHT];
|
||||
extern u64 (*gGfxSPTaskOutputBuffer)[0x3000];
|
||||
extern void* gGfxSPTaskOutputBufferEnd;
|
||||
// extern UNK_TYPE1 D_801FBBB4;
|
||||
// extern UNK_TYPE1 D_801FBBB8;
|
||||
// extern UNK_TYPE1 D_801FBBBC;
|
||||
// extern UNK_TYPE1 D_801FBBC0;
|
||||
// extern UNK_TYPE1 D_801FBBC4;
|
||||
// extern UNK_TYPE1 D_801FBBC8;
|
||||
extern u64 (*gGfxSPTaskOutputBuffer2)[0x3000];
|
||||
extern void* gGfxSPTaskOutputBufferEnd2;
|
||||
extern UNK_TYPE2 D_801FBBCC;
|
||||
extern UNK_TYPE2 D_801FBBCE;
|
||||
// extern UNK_TYPE1 D_801FBBD0;
|
||||
@ -4093,10 +4086,8 @@ extern UNK_TYPE D_05023008;
|
||||
extern UNK_TYPE D_0502324C;
|
||||
|
||||
// other segments
|
||||
extern UNK_TYPE D_0E000048;
|
||||
extern UNK_TYPE D_0E000088;
|
||||
extern UNK_TYPE D_0E000140;
|
||||
extern UNK_TYPE D_0E0001C8;
|
||||
extern UNK_TYPE D_0E0002C8;
|
||||
extern GfxMasterList D_0E000000;
|
||||
|
||||
extern UNK_TYPE D_0F000000;
|
||||
|
||||
#endif
|
||||
|
324
include/z64.h
324
include/z64.h
@ -5,16 +5,13 @@
|
||||
#include "stdbool.h"
|
||||
#include "stdint.h"
|
||||
|
||||
#include "PR/ultratypes.h"
|
||||
#include "PR/gbi.h"
|
||||
#include "ultra64.h"
|
||||
#include "io/controller.h"
|
||||
#include "osint.h"
|
||||
#include "viint.h"
|
||||
#include "math.h"
|
||||
#include "os.h"
|
||||
#include "stdlib.h"
|
||||
#include "xstdio.h"
|
||||
#include "unk.h"
|
||||
|
||||
#include "bgm.h"
|
||||
#include "sfx.h"
|
||||
@ -255,6 +252,30 @@ typedef struct {
|
||||
/* 0x14 */ s16 data[REG_GROUPS * REG_PER_GROUP]; // 0xAE0 entries
|
||||
} GameInfo; // size = 0x15D4
|
||||
|
||||
typedef struct IrqMgrClient {
|
||||
/* 0x0 */ struct IrqMgrClient* next;
|
||||
/* 0x4 */ OSMesgQueue* queue;
|
||||
} IrqMgrClient; // size = 0x8
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ s16 type;
|
||||
/* 0x2 */ u8 misc[30];
|
||||
} OSScMsg;
|
||||
|
||||
typedef struct {
|
||||
/* 0x000 */ OSScMsg verticalRetraceMesg;
|
||||
/* 0x020 */ OSScMsg prenmiMsg;
|
||||
/* 0x040 */ OSScMsg nmiMsg;
|
||||
/* 0x060 */ OSMesgQueue irqQueue;
|
||||
/* 0x078 */ OSMesg irqBuffer[8];
|
||||
/* 0x098 */ OSThread thread;
|
||||
/* 0x248 */ IrqMgrClient* callbacks;
|
||||
/* 0x24C */ u8 prenmiStage;
|
||||
/* 0x250 */ OSTime lastPrenmiTime;
|
||||
/* 0x258 */ OSTimer prenmiTimer;
|
||||
/* 0x278 */ OSTime lastFrameTime;
|
||||
} IrqMgr; // size = 0x280
|
||||
|
||||
typedef struct {
|
||||
/* 0x0000 */ u32 size;
|
||||
/* 0x0004 */ void* bufp;
|
||||
@ -269,13 +290,31 @@ typedef struct {
|
||||
/* 0x000C */ Gfx* d;
|
||||
} TwoHeadGfxArena; // size = 0x10
|
||||
|
||||
typedef struct {
|
||||
/* 0x000 */ Gfx taskStart[9];
|
||||
/* 0x048 */ Gfx clearZBuffer[8]; // original name: clear_zb_dl
|
||||
/* 0x088 */ Gfx clearFrameBuffer[5]; // original name: clear_fb_dl
|
||||
/* 0x0B0 */ Gfx setupBuffers[6]; // setup framebuffer and zbuffer
|
||||
/* 0x0E0 */ Gfx unk_E0[12]; // unused
|
||||
/* 0x140 */ Gfx syncSegments[17];
|
||||
/* 0x1C8 */ Gfx setScissor[2];
|
||||
/* 0x1D8 */ Gfx unk_1D8[25]; // unused
|
||||
/* 0x2A0 */ Gfx disps[5];
|
||||
/* 0x2C8 */ Gfx clearFillRect[3]; // fillrect for clearing buffers
|
||||
/* 0x2E0 */ Gfx fillRect[3]; // fillrect for general purpose
|
||||
/* 0x2F8 */ Gfx debugDisp[1];
|
||||
} GfxMasterList; // size = 0x300
|
||||
|
||||
#define GFXPOOL_HEAD_MAGIC 0x1234
|
||||
#define GFXPOOL_TAIL_MAGIC 0x5678
|
||||
|
||||
typedef struct {
|
||||
/* 0x00000 */ u16 headMagic; // 1234
|
||||
/* 0x00008 */ Gfx unk8[96];
|
||||
/* 0x00008 */ GfxMasterList master;
|
||||
/* 0x00308 */ Gfx polyXluBuffer[2048];
|
||||
/* 0x04308 */ Gfx overlayBuffer[1024];
|
||||
/* 0x06308 */ Gfx unk6308[64];
|
||||
/* 0x06508 */ Gfx unk6508[64];
|
||||
/* 0x06308 */ Gfx workBuffer[64];
|
||||
/* 0x06508 */ Gfx debugBuffer[64];
|
||||
/* 0x06708 */ Gfx polyOpaBuffer[13184];
|
||||
/* 0x20308 */ u16 tailMagic; // 5678
|
||||
} GfxPool; // size = 0x20310
|
||||
@ -293,38 +332,90 @@ typedef struct {
|
||||
/* 0x18 */ f32 yScale;
|
||||
} CfbInfo; // size = 0x1C
|
||||
|
||||
#define OS_SC_NEEDS_RDP 0x0001
|
||||
#define OS_SC_NEEDS_RSP 0x0002
|
||||
#define OS_SC_DRAM_DLIST 0x0004
|
||||
#define OS_SC_PARALLEL_TASK 0x0010
|
||||
#define OS_SC_LAST_TASK 0x0020
|
||||
#define OS_SC_SWAPBUFFER 0x0040
|
||||
|
||||
#define OS_SC_RCP_MASK 0x0003
|
||||
#define OS_SC_TYPE_MASK 0x0007
|
||||
|
||||
#define OS_SC_DP 0x0001
|
||||
#define OS_SC_SP 0x0002
|
||||
#define OS_SC_YIELD 0x0010
|
||||
#define OS_SC_YIELDED 0x0020
|
||||
|
||||
typedef struct OSScTask {
|
||||
/* 0x00 */ struct OSScTask* next;
|
||||
/* 0x04 */ u32 state;
|
||||
/* 0x08 */ u32 flags;
|
||||
/* 0x0C */ CfbInfo* framebuffer;
|
||||
/* 0x10 */ OSTask list;
|
||||
/* 0x50 */ OSMesgQueue* msgQ;
|
||||
/* 0x54 */ OSMesg msg;
|
||||
} OSScTask; // size = 0x58
|
||||
|
||||
typedef struct GraphicsContext {
|
||||
/* 0x000 */ Gfx* polyOpaBuffer;
|
||||
/* 0x004 */ Gfx* polyXluBuffer;
|
||||
/* 0x008 */ UNK_TYPE1 pad8[0x8];
|
||||
/* 0x010 */ Gfx* overlayBuffer;
|
||||
/* 0x014 */ UNK_TYPE1 pad14[0x24];
|
||||
/* 0x038 */ UNK_TYPE4 unk38[8];
|
||||
/* 0x058 */ OSMesgQueue* unk58;
|
||||
/* 0x05C */ OSMesgQueue unk5C;
|
||||
/* 0x074 */ UNK_TYPE1 pad74[0x12C];
|
||||
/* 0x1A0 */ Gfx* unk1A0;
|
||||
/* 0x1A4 */ TwoHeadGfxArena unk1A4;
|
||||
/* 0x1B4 */ Gfx* unk1B4;
|
||||
/* 0x1B8 */ TwoHeadGfxArena unk1B8;
|
||||
/* 0x1C8 */ UNK_TYPE1 pad1C8[0xAC];
|
||||
/* 0x274 */ OSViMode* viMode;
|
||||
/* 0x278 */ void* zbuffer;
|
||||
/* 0x27C */ UNK_TYPE1 pad27C[0x1C];
|
||||
/* 0x298 */ TwoHeadGfxArena overlay;
|
||||
/* 0x2A8 */ TwoHeadGfxArena polyOpa;
|
||||
/* 0x2B8 */ TwoHeadGfxArena polyXlu;
|
||||
/* 0x2C8 */ s32 displaylistCounter;
|
||||
/* 0x2CC */ void* framebuffer;
|
||||
/* 0x2D0 */ int pad2D0;
|
||||
/* 0x2D4 */ u32 viConfigFeatures;
|
||||
/* 0x2D8 */ UNK_TYPE1 gap2D8[0x3];
|
||||
/* 0x2DB */ u8 framebufferCounter;
|
||||
/* 0x2DC */ UNK_TYPE1 pad2DC[0x8];
|
||||
/* 0x2E4 */ f32 viConfigXScale;
|
||||
/* 0x2E8 */ f32 viConfigYScale;
|
||||
/* 0x2EC */ UNK_TYPE1 pad2EC[0x4];
|
||||
} GraphicsContext; // size = 0x2F0
|
||||
/* 0x000 */ Gfx* polyOpaBuffer; // Pointer to "Zelda 0"
|
||||
/* 0x004 */ Gfx* polyXluBuffer; // Pointer to "Zelda 1"
|
||||
/* 0x008 */ char unk_8[0x8]; // Unused, could this be pointers to "Zelda 2" / "Zelda 3"
|
||||
/* 0x010 */ Gfx* overlayBuffer; // Pointer to "Zelda 4"
|
||||
/* 0x014 */ u32 unk_14;
|
||||
/* 0x018 */ char unk_18[0x20];
|
||||
/* 0x038 */ OSMesg msgBuff[8];
|
||||
/* 0x058 */ OSMesgQueue* schedMsgQ;
|
||||
/* 0x05C */ OSMesgQueue queue;
|
||||
/* 0x074 */ char unk_74[0x04];
|
||||
/* 0x078 */ OSScTask task;
|
||||
/* 0x0E0 */ char unk_E0[0xD0];
|
||||
/* 0x1B0 */ Gfx* workBuffer;
|
||||
/* 0x1B4 */ TwoHeadGfxArena work;
|
||||
/* 0x1C4 */ Gfx* debugBuffer;
|
||||
/* 0x1C8 */ TwoHeadGfxArena debug;
|
||||
/* 0x1D8 */ char unk_1D8[0xAC];
|
||||
/* 0x284 */ OSViMode* viMode;
|
||||
/* 0x288 */ void* zbuffer;
|
||||
/* 0x28C */ char unk_28C[0x1C];
|
||||
/* 0x2A8 */ TwoHeadGfxArena overlay; // "Zelda 4"
|
||||
/* 0x2B8 */ TwoHeadGfxArena polyOpa; // "Zelda 0"
|
||||
/* 0x2C8 */ TwoHeadGfxArena polyXlu; // "Zelda 1"
|
||||
/* 0x2D8 */ u32 gfxPoolIdx;
|
||||
/* 0x2DC */ u16* curFrameBuffer;
|
||||
/* 0x2E0 */ char unk_2E0[0x4];
|
||||
/* 0x2E4 */ u32 viConfigFeatures;
|
||||
/* 0x2E8 */ char unk_2E8[0x2];
|
||||
/* 0x2EA */ u8 updateViMode;
|
||||
/* 0x2EB */ u8 framebufferIdx;
|
||||
/* 0x2EC */ void (*callback)(struct GraphicsContext*, u32);
|
||||
/* 0x2F0 */ u32 callbackParam;
|
||||
/* 0x2F4 */ f32 xScale;
|
||||
/* 0x2F8 */ f32 yScale;
|
||||
/* 0x2FC */ GfxMasterList* masterList;
|
||||
} GraphicsContext; // size = 0x300
|
||||
|
||||
typedef struct {
|
||||
/* 0x000 */ OSMesgQueue interruptQ;
|
||||
/* 0x018 */ OSMesg intBuf[64];
|
||||
/* 0x118 */ OSMesgQueue cmdQ;
|
||||
/* 0x130 */ OSMesg cmdMsgBuf[8];
|
||||
/* 0x150 */ OSThread thread;
|
||||
/* 0x300 */ OSScTask* audioListHead;
|
||||
/* 0x304 */ OSScTask* gfxListHead;
|
||||
/* 0x308 */ OSScTask* audioListTail;
|
||||
/* 0x30C */ OSScTask* gfxListTail;
|
||||
/* 0x310 */ OSScTask* curRSPTask;
|
||||
/* 0x314 */ OSScTask* curRDPTask;
|
||||
/* 0x318 */ s32 retraceCount;
|
||||
/* 0x318 */ s32 doAudio;
|
||||
/* 0x320 */ CfbInfo* curBuf;
|
||||
/* 0x324 */ CfbInfo* pendingSwapBuf1;
|
||||
/* 0x328 */ CfbInfo* pendingSwapBuf2;
|
||||
/* 0x32C */ char unk_32C[0x3];
|
||||
/* 0x32F */ u8 shouldUpdateVi;
|
||||
/* 0x330 */ IrqMgrClient irqClient;
|
||||
} SchedContext; // size = 0x338
|
||||
|
||||
typedef enum IRQ_MSG_TYPE {
|
||||
IRQ_VERTICAL_RETRACE_MSG = 0x1,
|
||||
@ -410,10 +501,6 @@ typedef struct {
|
||||
/* 0xC */ s32 rightX;
|
||||
} Viewport; // size = 0x10
|
||||
|
||||
typedef void*(*FaultAddrConvFunc)(void* addr, void* arg);
|
||||
|
||||
typedef void(*fault_client_func)(void* arg1, void* arg2);
|
||||
|
||||
typedef void(*osCreateThread_func)(void*);
|
||||
|
||||
typedef void* (*PrintCallback)(void*, const char*, size_t);
|
||||
@ -563,25 +650,6 @@ typedef enum {
|
||||
GFXPRINT_OPEN = 0x80
|
||||
} GfxPrintFlag;
|
||||
|
||||
typedef struct GameState GameState;
|
||||
|
||||
typedef void (*GameStateFunc)(GameState* gameState);
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ void* loadedRamAddr;
|
||||
/* 0x04 */ uintptr_t vromStart; // if applicable
|
||||
/* 0x08 */ uintptr_t vromEnd; // if applicable
|
||||
/* 0x0C */ void* vramStart; // if applicable
|
||||
/* 0x10 */ void* vramEnd; // if applicable
|
||||
/* 0x14 */ UNK_PTR unk_14;
|
||||
/* 0x18 */ GameStateFunc init; // initializes and executes the given context
|
||||
/* 0x1C */ GameStateFunc destroy; // deconstructs the context, and sets the next context to load
|
||||
/* 0x20 */ UNK_PTR unk_20;
|
||||
/* 0x24 */ UNK_PTR unk_24;
|
||||
/* 0x28 */ UNK_TYPE unk_28;
|
||||
/* 0x2C */ size_t instanceSize;
|
||||
} GameStateOverlay; // size = 0x30
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u16 countdown;
|
||||
/* 0x04 */ Vec3f originPos;
|
||||
@ -988,12 +1056,12 @@ typedef struct {
|
||||
/* 0x120D8 */ UNK_TYPE1 pad120D8[0x8];
|
||||
} MessageContext; // size = 0x120E0
|
||||
|
||||
typedef struct ArenaNode_t {
|
||||
typedef struct ArenaNode {
|
||||
/* 0x0 */ s16 magic; // Should always be 0x7373
|
||||
/* 0x2 */ s16 isFree;
|
||||
/* 0x4 */ size_t size;
|
||||
/* 0x8 */ struct ArenaNode_t* next;
|
||||
/* 0xC */ struct ArenaNode_t* prev;
|
||||
/* 0x8 */ struct ArenaNode* next;
|
||||
/* 0xC */ struct ArenaNode* prev;
|
||||
} ArenaNode; // size = 0x10
|
||||
|
||||
typedef struct {
|
||||
@ -1005,22 +1073,18 @@ typedef struct {
|
||||
/* 0x22 */ u8 flag;
|
||||
} Arena; // size = 0x24
|
||||
|
||||
typedef struct FaultAddrConvClient FaultAddrConvClient;
|
||||
|
||||
struct FaultAddrConvClient {
|
||||
/* 0x0 */ FaultAddrConvClient* next;
|
||||
/* 0x4 */ FaultAddrConvFunc callback;
|
||||
typedef struct FaultAddrConvClient {
|
||||
/* 0x0 */ struct FaultAddrConvClient* next;
|
||||
/* 0x4 */ void* (*callback)(void*, void*);
|
||||
/* 0x8 */ void* param;
|
||||
}; // size = 0xC
|
||||
} FaultAddrConvClient; // size = 0xC
|
||||
|
||||
typedef struct FaultClient FaultClient;
|
||||
|
||||
struct FaultClient {
|
||||
/* 0x0 */ FaultClient* next;
|
||||
/* 0x4 */ fault_client_func callback;
|
||||
typedef struct FaultClient {
|
||||
/* 0x0 */ struct FaultClient* next;
|
||||
/* 0x4 */ void (*callback)(void*, void*);
|
||||
/* 0x8 */ void* param0;
|
||||
/* 0xC */ void* param1;
|
||||
}; // size = 0x10
|
||||
} FaultClient; // size = 0x10
|
||||
|
||||
typedef struct {
|
||||
/* 0x000 */ OSThread thread;
|
||||
@ -1044,9 +1108,28 @@ typedef struct FireObj FireObj;
|
||||
|
||||
typedef struct FireObjLight FireObjLight;
|
||||
|
||||
typedef struct GameAllocNode {
|
||||
/* 0x0 */ struct GameAllocNode* next;
|
||||
/* 0x4 */ struct GameAllocNode* prev;
|
||||
struct GameState;
|
||||
|
||||
typedef void (*GameStateFunc)(struct GameState* gameState);
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ void* loadedRamAddr;
|
||||
/* 0x04 */ uintptr_t vromStart; // if applicable
|
||||
/* 0x08 */ uintptr_t vromEnd; // if applicable
|
||||
/* 0x0C */ void* vramStart; // if applicable
|
||||
/* 0x10 */ void* vramEnd; // if applicable
|
||||
/* 0x14 */ UNK_PTR unk_14;
|
||||
/* 0x18 */ GameStateFunc init; // initializes and executes the given context
|
||||
/* 0x1C */ GameStateFunc destroy; // deconstructs the context, and sets the next context to load
|
||||
/* 0x20 */ UNK_PTR unk_20;
|
||||
/* 0x24 */ UNK_PTR unk_24;
|
||||
/* 0x28 */ UNK_TYPE unk_28;
|
||||
/* 0x2C */ size_t instanceSize;
|
||||
} GameStateOverlay; // size = 0x30
|
||||
|
||||
typedef struct GameAllocEntry {
|
||||
/* 0x0 */ struct GameAllocEntry* next;
|
||||
/* 0x4 */ struct GameAllocEntry* prev;
|
||||
/* 0x8 */ size_t size;
|
||||
/* 0xC */ u32 unk_0C;
|
||||
} GameAllocEntry; // size = 0x10
|
||||
@ -1056,7 +1139,7 @@ typedef struct GameAlloc {
|
||||
/* 0x10 */ GameAllocEntry* head;
|
||||
} GameAlloc; // size = 0x14
|
||||
|
||||
struct GameState {
|
||||
typedef struct GameState {
|
||||
/* 0x00 */ GraphicsContext* gfxCtx;
|
||||
/* 0x04 */ GameStateFunc main;
|
||||
/* 0x08 */ GameStateFunc destroy;
|
||||
@ -1070,8 +1153,8 @@ struct GameState {
|
||||
/* 0x9C */ u32 frames;
|
||||
/* 0xA0 */ u8 padA0[0x2];
|
||||
/* 0xA2 */ u8 framerateDivisor; // game speed?
|
||||
/* 0xA3 */ UNK_TYPE1 unkA3;
|
||||
}; // size = 0xA4
|
||||
/* 0xA3 */ u8 unk_A3;
|
||||
} GameState; // size = 0xA4
|
||||
|
||||
typedef struct PreNMIContext {
|
||||
/* 0x00 */ GameState state;
|
||||
@ -1236,30 +1319,6 @@ typedef enum {
|
||||
QUAKE2_SETUP,
|
||||
} Quake2State;
|
||||
|
||||
typedef struct IrqMgrClient_t {
|
||||
/* 0x0 */ struct IrqMgrClient_t* next;
|
||||
/* 0x4 */ OSMesgQueue* queue;
|
||||
} IrqMgrClient; // size = 0x8
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ s16 type;
|
||||
/* 0x2 */ u8 misc[30];
|
||||
} OSScMsg;
|
||||
|
||||
typedef struct {
|
||||
/* 0x000 */ OSScMsg verticalRetraceMesg;
|
||||
/* 0x020 */ OSScMsg prenmiMsg;
|
||||
/* 0x040 */ OSScMsg nmiMsg;
|
||||
/* 0x060 */ OSMesgQueue irqQueue;
|
||||
/* 0x078 */ OSMesg irqBuffer[8];
|
||||
/* 0x098 */ OSThread thread;
|
||||
/* 0x248 */ IrqMgrClient* callbacks;
|
||||
/* 0x24C */ u8 prenmiStage;
|
||||
/* 0x250 */ OSTime lastPrenmiTime;
|
||||
/* 0x258 */ OSTimer prenmiTimer;
|
||||
/* 0x278 */ OSTime lastFrameTime;
|
||||
} IrqMgr; // size = 0x280
|
||||
|
||||
typedef struct {
|
||||
/* 0x000 */ u8 controllers; // bit 0 is set if controller 1 is plugged in, etc.
|
||||
/* 0x001 */ UNK_TYPE1 pad1[0x13];
|
||||
@ -1283,56 +1342,9 @@ typedef struct {
|
||||
/* 0x47F */ UNK_TYPE1 pad47F[0x1];
|
||||
} PadMgr; // size = 0x480
|
||||
|
||||
#define OS_SC_NEEDS_RDP 0x0001
|
||||
#define OS_SC_NEEDS_RSP 0x0002
|
||||
#define OS_SC_DRAM_DLIST 0x0004
|
||||
#define OS_SC_PARALLEL_TASK 0x0010
|
||||
#define OS_SC_LAST_TASK 0x0020
|
||||
#define OS_SC_SWAPBUFFER 0x0040
|
||||
|
||||
#define OS_SC_RCP_MASK 0x0003
|
||||
#define OS_SC_TYPE_MASK 0x0007
|
||||
|
||||
#define OS_SC_DP 0x0001
|
||||
#define OS_SC_SP 0x0002
|
||||
#define OS_SC_YIELD 0x0010
|
||||
#define OS_SC_YIELDED 0x0020
|
||||
|
||||
typedef struct OSScTask {
|
||||
/* 0x00 */ struct OSScTask* next;
|
||||
/* 0x04 */ u32 state;
|
||||
/* 0x08 */ u32 flags;
|
||||
/* 0x0C */ CfbInfo* framebuffer;
|
||||
/* 0x10 */ OSTask list;
|
||||
/* 0x50 */ OSMesgQueue* msgQ;
|
||||
/* 0x54 */ OSMesg msg;
|
||||
} OSScTask; // size = 0x58
|
||||
|
||||
typedef struct {
|
||||
/* 0x0000 */ OSMesgQueue interruptQ;
|
||||
/* 0x0018 */ OSMesg intBuf[64];
|
||||
/* 0x0118 */ OSMesgQueue cmdQ;
|
||||
/* 0x0130 */ OSMesg cmdMsgBuf[8];
|
||||
/* 0x0150 */ OSThread thread;
|
||||
/* 0x0300 */ OSScTask* audioListHead;
|
||||
/* 0x0304 */ OSScTask* gfxListHead;
|
||||
/* 0x0308 */ OSScTask* audioListTail;
|
||||
/* 0x030C */ OSScTask* gfxListTail;
|
||||
/* 0x0310 */ OSScTask* curRSPTask;
|
||||
/* 0x0314 */ OSScTask* curRDPTask;
|
||||
/* 0x0318 */ s32 retraceCount;
|
||||
/* 0x0318 */ s32 doAudio;
|
||||
/* 0x0320 */ CfbInfo* curBuf;
|
||||
/* 0x0324 */ CfbInfo* pendingSwapBuf1;
|
||||
/* 0x0328 */ CfbInfo* pendingSwapBuf2;
|
||||
/* 0x032C */ char unk_32C[0x3];
|
||||
/* 0x032F */ u8 shouldUpdateVi;
|
||||
/* 0x0330 */ IrqMgrClient irqClient;
|
||||
} SchedContext; // size = 0x338
|
||||
|
||||
typedef struct StackEntry_t {
|
||||
/* 0x00 */ struct StackEntry_t* next;
|
||||
/* 0x04 */ struct StackEntry_t* prev;
|
||||
typedef struct StackEntry {
|
||||
/* 0x00 */ struct StackEntry* next;
|
||||
/* 0x04 */ struct StackEntry* prev;
|
||||
/* 0x08 */ u32 head;
|
||||
/* 0x0C */ u32 tail;
|
||||
/* 0x10 */ u32 initValue;
|
||||
|
6
spec
6
spec
@ -610,11 +610,10 @@ beginseg
|
||||
include "build/data/code/game.bss.o"
|
||||
include "build/src/code/gamealloc.o"
|
||||
include "build/src/code/graph.o"
|
||||
include "build/data/code/graph.data.o"
|
||||
include "build/data/code/graph.bss.o"
|
||||
include "build/src/code/code_80174A40.o"
|
||||
include "build/src/code/graphalloc.o"
|
||||
include "build/src/code/listalloc.o"
|
||||
include "build/src/code/main.o"
|
||||
include "build/data/code/main.data.o"
|
||||
include "build/data/code/main.bss.o"
|
||||
include "build/src/code/padmgr.o"
|
||||
include "build/data/code/padmgr.data.o"
|
||||
@ -635,6 +634,7 @@ beginseg
|
||||
include "build/data/code/sys_matrix.data.o"
|
||||
include "build/data/code/sys_matrix.bss.o"
|
||||
include "build/src/code/sys_ucode.o"
|
||||
include "build/src/code/code_80182CE0.o"
|
||||
include "build/data/code/code_801D1E70.data.o"
|
||||
include "build/src/code/code_80183070.o"
|
||||
include "build/src/code/c_keyframe.o"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "prevent_bss_reordering.h"
|
||||
|
||||
UNK_TYPE4 D_8009BE30;
|
||||
UNK_TYPE4 D_8009BE34;
|
||||
@ -17,7 +18,7 @@ void CIC6105_PrintRomInfo(void) {
|
||||
}
|
||||
|
||||
void CIC6105_AddRomInfoFaultPage(void) {
|
||||
Fault_AddClient(&romInfoFaultClient, (fault_client_func)CIC6105_PrintRomInfo, 0, 0);
|
||||
Fault_AddClient(&romInfoFaultClient, CIC6105_PrintRomInfo, 0, 0);
|
||||
}
|
||||
|
||||
void CIC6105_RemoveRomInfoFaultPage(void) {
|
||||
|
@ -33,7 +33,7 @@ void Fault_SleepImpl(u32 duration) {
|
||||
Sleep_Cycles(value);
|
||||
}
|
||||
|
||||
void Fault_AddClient(FaultClient* client, fault_client_func callback, void* param0, void* param1) {
|
||||
void Fault_AddClient(FaultClient* client, void* callback, void* param0, void* param1) {
|
||||
OSIntMask mask;
|
||||
u32 alreadyExists = 0;
|
||||
|
||||
@ -104,7 +104,7 @@ void Fault_RemoveClient(FaultClient* client) {
|
||||
}
|
||||
}
|
||||
|
||||
void Fault_AddAddrConvClient(FaultAddrConvClient* client, FaultAddrConvFunc callback, void* param) {
|
||||
void Fault_AddAddrConvClient(FaultAddrConvClient* client, void* callback, void* param) {
|
||||
OSIntMask mask;
|
||||
u32 alreadyExists = 0;
|
||||
|
||||
@ -910,8 +910,8 @@ void Fault_HangupFaultClient(const char* arg0, char* arg1) {
|
||||
|
||||
void Fault_AddHungupAndCrashImpl(const char* arg0, char* arg1) {
|
||||
FaultClient client;
|
||||
char padd[4];
|
||||
Fault_AddClient(&client, (fault_client_func)Fault_HangupFaultClient, (void*)arg0, arg1);
|
||||
u32 pad;
|
||||
Fault_AddClient(&client, Fault_HangupFaultClient, (void*)arg0, arg1);
|
||||
*(u32*)0x11111111 = 0; // trigger an exception
|
||||
}
|
||||
|
||||
|
@ -1,7 +0,0 @@
|
||||
#include "global.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_80174A40/Graph_GfxPlusOne.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_80174A40/Graph_BranchDlist.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_80174A40/Graph_DlistAlloc.s")
|
7
src/code/code_80182CE0.c
Normal file
7
src/code/code_80182CE0.c
Normal file
@ -0,0 +1,7 @@
|
||||
#include "global.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_80182CE0/func_80182CE0.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_80182CE0/func_80183020.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_80182CE0/func_80183058.s")
|
@ -5,9 +5,6 @@ f32 gFramerateDivisorF = 1.0f;
|
||||
f32 gFramerateDivisorHalf = 1.0f / 2.0f;
|
||||
f32 gFramerateDivisorThird = 1.0f / 3.0f;
|
||||
|
||||
u32 D_801D1510 = 0x0000000A;
|
||||
u32 D_801D1514[3] = { 0 };
|
||||
|
||||
void Game_UpdateFramerateVariables(s32 divisor) {
|
||||
gFramerateDivisor = divisor;
|
||||
gFramerateDivisorF = (f32)divisor;
|
||||
@ -104,12 +101,12 @@ void GameState_Draw(GameState* gameState, GraphicsContext* gfxCtx) {
|
||||
void GameState_SetFrameBuffer(GraphicsContext* gfxCtx) {
|
||||
OPEN_DISPS(gfxCtx);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0, NULL);
|
||||
gSPSegment(POLY_OPA_DISP++, 0xF, gfxCtx->framebuffer);
|
||||
gSPSegment(POLY_XLU_DISP++, 0, NULL);
|
||||
gSPSegment(POLY_XLU_DISP++, 0xF, gfxCtx->framebuffer);
|
||||
gSPSegment(OVERLAY_DISP++, 0, NULL);
|
||||
gSPSegment(OVERLAY_DISP++, 0xF, gfxCtx->framebuffer);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x00, NULL);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x0F, gfxCtx->curFrameBuffer);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x00, NULL);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x0F, gfxCtx->curFrameBuffer);
|
||||
gSPSegment(OVERLAY_DISP++, 0x00, NULL);
|
||||
gSPSegment(OVERLAY_DISP++, 0x0F, gfxCtx->curFrameBuffer);
|
||||
|
||||
CLOSE_DISPS(gfxCtx);
|
||||
}
|
||||
@ -199,8 +196,8 @@ void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* g
|
||||
gameState->running = 1;
|
||||
gfxCtx->viMode = D_801FBB88;
|
||||
gfxCtx->viConfigFeatures = gViConfigFeatures;
|
||||
gfxCtx->viConfigXScale = gViConfigXScale;
|
||||
gfxCtx->viConfigYScale = gViConfigYScale;
|
||||
gfxCtx->xScale = gViConfigXScale;
|
||||
gfxCtx->yScale = gViConfigYScale;
|
||||
gameState->nextGameStateInit = NULL;
|
||||
gameState->nextGameStateSize = 0U;
|
||||
|
||||
@ -220,14 +217,14 @@ void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* g
|
||||
func_801773A0(&D_801F7FF0);
|
||||
func_8013ED9C();
|
||||
|
||||
osSendMesg(&gameState->gfxCtx->unk5C, NULL, 1);
|
||||
osSendMesg(&gameState->gfxCtx->queue, NULL, OS_MESG_BLOCK);
|
||||
}
|
||||
}
|
||||
|
||||
void GameState_Destroy(GameState* gameState) {
|
||||
func_80172BC0();
|
||||
func_8019E014();
|
||||
osRecvMesg(&gameState->gfxCtx->unk5C, NULL, OS_MESG_BLOCK);
|
||||
osRecvMesg(&gameState->gfxCtx->queue, NULL, OS_MESG_BLOCK);
|
||||
|
||||
if (gameState->destroy != NULL) {
|
||||
gameState->destroy(gameState);
|
||||
@ -247,7 +244,7 @@ GameStateFunc GameState_GetNextStateInit(GameState* gameState) {
|
||||
return gameState->nextGameStateInit;
|
||||
}
|
||||
|
||||
size_t Game_GetNextStateSize(GameState* gameState) {
|
||||
size_t GameState_GetNextStateSize(GameState* gameState) {
|
||||
return gameState->nextGameStateSize;
|
||||
}
|
||||
|
||||
|
385
src/code/graph.c
385
src/code/graph.c
@ -1,25 +1,388 @@
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
#include "overlays/gamestates/ovl_daytelop/z_daytelop.h"
|
||||
#include "overlays/gamestates/ovl_file_choose/z_file_choose.h"
|
||||
#include "overlays/gamestates/ovl_opening/z_opening.h"
|
||||
#include "overlays/gamestates/ovl_select/z_select.h"
|
||||
#include "overlays/gamestates/ovl_title/z_title.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/graph/Graph_FaultClient.s")
|
||||
FaultAddrConvClient sGraphFaultAddrConvClient;
|
||||
FaultClient sGraphFaultClient;
|
||||
GfxMasterList* gGfxMasterDL;
|
||||
CfbInfo sGraphCfbInfos[3];
|
||||
OSTime sGraphTaskStartTime;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/graph/Graph_DlAlloc.s")
|
||||
void* Graph_FaultClient(void) {
|
||||
FaultDrawer_DrawText(30, 100, "ShowFrameBuffer PAGE 0/1");
|
||||
osViSwapBuffer(SysCfb_GetFbPtr(0));
|
||||
osViSetMode(D_801FBB88);
|
||||
osViSetSpecialFeatures(OS_VI_DITHER_FILTER_ON | OS_VI_GAMMA_OFF);
|
||||
Fault_WaitForInput();
|
||||
osViSwapBuffer(SysCfb_GetFbPtr(1));
|
||||
osViSetMode(D_801FBB88);
|
||||
osViSetSpecialFeatures(OS_VI_DITHER_FILTER_ON | OS_VI_GAMMA_OFF);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/graph/Graph_InitTHGA.s")
|
||||
void Graph_InitTHGA(TwoHeadGfxArena* arena, Gfx* buffer, s32 size) {
|
||||
THGA_Ct(arena, buffer, size);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/graph/Graph_GetNextGameState.s")
|
||||
void Graph_SetNextGfxPool(GraphicsContext* gfxCtx) {
|
||||
GfxPool* pool = &gGfxPools[gfxCtx->gfxPoolIdx % 2];
|
||||
|
||||
gGfxMasterDL = &pool->master;
|
||||
gSegments[0x0E] = gGfxMasterDL;
|
||||
|
||||
pool->headMagic = GFXPOOL_HEAD_MAGIC;
|
||||
pool->tailMagic = GFXPOOL_TAIL_MAGIC;
|
||||
|
||||
Graph_InitTHGA(&gfxCtx->polyOpa, pool->polyOpaBuffer, sizeof(pool->polyOpaBuffer));
|
||||
Graph_InitTHGA(&gfxCtx->polyXlu, pool->polyXluBuffer, sizeof(pool->polyXluBuffer));
|
||||
Graph_InitTHGA(&gfxCtx->overlay, pool->overlayBuffer, sizeof(pool->overlayBuffer));
|
||||
Graph_InitTHGA(&gfxCtx->work, pool->workBuffer, sizeof(pool->workBuffer));
|
||||
Graph_InitTHGA(&gfxCtx->debug, pool->debugBuffer, sizeof(pool->debugBuffer));
|
||||
|
||||
gfxCtx->polyOpaBuffer = pool->polyOpaBuffer;
|
||||
gfxCtx->polyXluBuffer = pool->polyXluBuffer;
|
||||
gfxCtx->overlayBuffer = pool->overlayBuffer;
|
||||
gfxCtx->workBuffer = pool->workBuffer;
|
||||
gfxCtx->debugBuffer = pool->debugBuffer;
|
||||
|
||||
gfxCtx->curFrameBuffer = (u16*)SysCfb_GetFbPtr(gfxCtx->framebufferIdx % 2);
|
||||
gSegments[0x0F] = gfxCtx->curFrameBuffer;
|
||||
|
||||
gfxCtx->zbuffer = SysCfb_GetZBuffer();
|
||||
|
||||
gSPBranchList(&gGfxMasterDL->disps[0], pool->polyOpaBuffer);
|
||||
gSPBranchList(&gGfxMasterDL->disps[1], pool->polyXluBuffer);
|
||||
gSPBranchList(&gGfxMasterDL->disps[2], pool->overlayBuffer);
|
||||
gSPBranchList(&gGfxMasterDL->disps[3], pool->workBuffer);
|
||||
gSPEndDisplayList(&gGfxMasterDL->disps[4]);
|
||||
gSPBranchList(&gGfxMasterDL->debugDisp[0], pool->debugBuffer);
|
||||
}
|
||||
|
||||
GameStateOverlay* Graph_GetNextGameState(GameState* gameState) {
|
||||
GameStateFunc gameStateInit = GameState_GetNextStateInit(gameState);
|
||||
|
||||
if (gameStateInit == (GameStateFunc)TitleSetup_Init) {
|
||||
return &gGameStateOverlayTable[0];
|
||||
}
|
||||
if (gameStateInit == (GameStateFunc)Select_Init) {
|
||||
return &gGameStateOverlayTable[1];
|
||||
}
|
||||
if (gameStateInit == (GameStateFunc)Title_Init) {
|
||||
return &gGameStateOverlayTable[2];
|
||||
}
|
||||
if (gameStateInit == (GameStateFunc)Play_Init) {
|
||||
return &gGameStateOverlayTable[3];
|
||||
}
|
||||
if (gameStateInit == (GameStateFunc)Opening_Init) {
|
||||
return &gGameStateOverlayTable[4];
|
||||
}
|
||||
if (gameStateInit == (GameStateFunc)FileChoose_Init) {
|
||||
return &gGameStateOverlayTable[5];
|
||||
}
|
||||
if (gameStateInit == (GameStateFunc)Daytelop_Init) {
|
||||
return &gGameStateOverlayTable[6];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// Regalloc differences
|
||||
void* Graph_FaultAddrConvFunc(void* address, void* param) {
|
||||
u32 addr = address;
|
||||
GameStateOverlay* gamestateOvl;
|
||||
u32 ramConv;
|
||||
u32 ramStart;
|
||||
u32 diff;
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < graphNumGameStates; i++) {
|
||||
gamestateOvl = &gGameStateOverlayTable[i];
|
||||
ramStart = gamestateOvl->loadedRamAddr;
|
||||
diff = (u32)gamestateOvl->vramEnd - (u32)gamestateOvl->vramStart;
|
||||
ramConv = (u32)gamestateOvl->vramStart - ramStart;
|
||||
|
||||
if (gamestateOvl->loadedRamAddr != NULL) {
|
||||
if (addr >= ramStart && addr < ramStart + diff) {
|
||||
return addr + ramConv;
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/graph/Graph_FaultAddrConvFunc.s")
|
||||
#endif
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/graph/Graph_Init.s")
|
||||
void Graph_Init(GraphicsContext* gfxCtx) {
|
||||
bzero(gfxCtx, sizeof(GraphicsContext));
|
||||
gfxCtx->gfxPoolIdx = 0;
|
||||
gfxCtx->framebufferIdx = 0;
|
||||
gfxCtx->viMode = NULL;
|
||||
gfxCtx->viConfigFeatures = gViConfigFeatures;
|
||||
gfxCtx->xScale = gViConfigXScale;
|
||||
gfxCtx->yScale = gViConfigYScale;
|
||||
osCreateMesgQueue(&gfxCtx->queue, gfxCtx->msgBuff, ARRAY_COUNT(gfxCtx->msgBuff));
|
||||
Fault_AddClient(&sGraphFaultClient, Graph_FaultClient, NULL, NULL);
|
||||
Fault_AddAddrConvClient(&sGraphFaultAddrConvClient, Graph_FaultAddrConvFunc, NULL);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/graph/Graph_Destroy.s")
|
||||
void Graph_Destroy(GraphicsContext* gfxCtx) {
|
||||
Fault_RemoveClient(&sGraphFaultClient);
|
||||
Fault_RemoveAddrConvClient(&sGraphFaultAddrConvClient);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/graph/Graph_Render.s")
|
||||
/**
|
||||
* Constructs the graphics OSTask and forwards it to the scheduler.
|
||||
* Waits for up to 3 additional seconds for any current graphics task to complete.
|
||||
* If it does not signal completion in that time, retry or trigger a crash.
|
||||
*/
|
||||
void Graph_TaskSet00(GraphicsContext* gfxCtx, GameState* gameState) {
|
||||
static s32 retryCount = 10;
|
||||
static s32 cfbIdx = 0;
|
||||
OSTask_t* task = &gfxCtx->task.list.t;
|
||||
OSScTask* scTask = &gfxCtx->task;
|
||||
OSTimer timer;
|
||||
OSMesg msg;
|
||||
CfbInfo* cfb;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/graph/Graph_FrameSetup.s")
|
||||
retry:
|
||||
osSetTimer(&timer, OS_USEC_TO_CYCLES(3 * 1000 * 1000), 0, &gfxCtx->queue, (OSMesg)666);
|
||||
osRecvMesg(&gfxCtx->queue, &msg, OS_MESG_BLOCK);
|
||||
osStopTimer(&timer);
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/graph/Graph_RenderFrame.s")
|
||||
if (msg == (OSMesg)666) {
|
||||
osSyncPrintf("GRAPH SP TIMEOUT\n");
|
||||
if (retryCount >= 0) {
|
||||
retryCount--;
|
||||
Sched_SendGfxCancelMsg(&gSchedContext);
|
||||
goto retry;
|
||||
} else {
|
||||
// graph.c: No more! die!
|
||||
osSyncPrintf("graph.c:もうダメ!死ぬ!\n");
|
||||
Fault_AddHungupAndCrashImpl("RCP is HUNG UP!!", "Oh! MY GOD!!");
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/graph/Graph_DoFrame.s")
|
||||
gfxCtx->masterList = gGfxMasterDL;
|
||||
if (gfxCtx->callback != NULL) {
|
||||
gfxCtx->callback(gfxCtx, gfxCtx->callbackParam);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/graph/Graph_ThreadEntry.s")
|
||||
task->type = M_GFXTASK;
|
||||
task->flags = OS_SC_DRAM_DLIST;
|
||||
task->ucodeBoot = SysUcode_GetUCodeBoot();
|
||||
task->ucodeBootSize = SysUcode_GetUCodeBootSize();
|
||||
task->ucode = SysUcode_GetUCode();
|
||||
task->ucodeData = SysUcode_GetUCodeData();
|
||||
task->ucodeSize = 0x1000;
|
||||
task->ucodeDataSize = 0x800;
|
||||
task->dramStack = (u64*)gGfxSPTaskStack;
|
||||
task->dramStackSize = sizeof(gGfxSPTaskStack);
|
||||
task->outputBuff = gGfxSPTaskOutputBufferPtr;
|
||||
task->outputBuffSize = gGfxSPTaskOutputBufferSize;
|
||||
task->dataPtr = (u64*)gGfxMasterDL;
|
||||
task->dataSize = 0;
|
||||
task->yieldDataPtr = (u64*)gGfxSPTaskYieldBuffer;
|
||||
task->yieldDataSize = sizeof(gGfxSPTaskYieldBuffer);
|
||||
|
||||
scTask->next = NULL;
|
||||
scTask->flags = OS_SC_RCP_MASK | OS_SC_SWAPBUFFER | OS_SC_LAST_TASK;
|
||||
|
||||
if (SREG(33) & 1) {
|
||||
SREG(33) &= ~1;
|
||||
scTask->flags &= ~OS_SC_SWAPBUFFER;
|
||||
gfxCtx->framebufferIdx--;
|
||||
}
|
||||
|
||||
scTask->msgQ = &gfxCtx->queue;
|
||||
scTask->msg = NULL;
|
||||
|
||||
{ s32 pad; }
|
||||
|
||||
cfb = &sGraphCfbInfos[cfbIdx];
|
||||
cfbIdx = (cfbIdx + 1) % ARRAY_COUNT(sGraphCfbInfos);
|
||||
|
||||
cfb->fb1 = gfxCtx->curFrameBuffer;
|
||||
cfb->swapBuffer = gfxCtx->curFrameBuffer;
|
||||
|
||||
if (gfxCtx->updateViMode) {
|
||||
gfxCtx->updateViMode = false;
|
||||
cfb->viMode = gfxCtx->viMode;
|
||||
cfb->features = gfxCtx->viConfigFeatures;
|
||||
cfb->xScale = gfxCtx->xScale;
|
||||
cfb->yScale = gfxCtx->yScale;
|
||||
} else {
|
||||
cfb->viMode = NULL;
|
||||
}
|
||||
cfb->unk_10 = 0;
|
||||
cfb->updateRate = gameState->framerateDivisor;
|
||||
|
||||
scTask->framebuffer = cfb;
|
||||
|
||||
while (gfxCtx->queue.validCount != 0) {
|
||||
osRecvMesg(&gfxCtx->queue, NULL, OS_MESG_NOBLOCK);
|
||||
}
|
||||
|
||||
gfxCtx->schedMsgQ = &gSchedContext.cmdQ;
|
||||
osSendMesg(&gSchedContext.cmdQ, scTask, OS_MESG_BLOCK);
|
||||
Sched_SendEntryMsg(&gSchedContext);
|
||||
}
|
||||
|
||||
void Graph_UpdateGame(GameState* gameState) {
|
||||
Game_UpdateInput(gameState);
|
||||
Game_IncrementFrameCount(gameState);
|
||||
if (SREG(20) < 3) {
|
||||
func_8019E014();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the gamestate logic, then finalize the gfx buffer
|
||||
* and run the graphics task for this frame.
|
||||
*/
|
||||
void Graph_ExecuteAndDraw(GraphicsContext* gfxCtx, GameState* gameState) {
|
||||
u32 problem;
|
||||
|
||||
gameState->unk_A3 = 0;
|
||||
Graph_SetNextGfxPool(gfxCtx);
|
||||
|
||||
Game_Update(gameState);
|
||||
|
||||
OPEN_DISPS(gfxCtx);
|
||||
|
||||
gSPEndDisplayList(WORK_DISP++);
|
||||
gSPEndDisplayList(POLY_OPA_DISP++);
|
||||
gSPEndDisplayList(POLY_XLU_DISP++);
|
||||
gSPEndDisplayList(OVERLAY_DISP++);
|
||||
gSPEndDisplayList(DEBUG_DISP++);
|
||||
|
||||
CLOSE_DISPS(gfxCtx);
|
||||
|
||||
{
|
||||
Gfx* gfx = gGfxMasterDL->taskStart;
|
||||
|
||||
gSPSegment(gfx++, 0x0E, gGfxMasterDL);
|
||||
gSPDisplayList(gfx++, &D_0E000000.disps[3]);
|
||||
gSPDisplayList(gfx++, &D_0E000000.disps[0]);
|
||||
gSPDisplayList(gfx++, &D_0E000000.disps[1]);
|
||||
gSPDisplayList(gfx++, &D_0E000000.disps[2]);
|
||||
gSPDisplayList(gfx++, &D_0E000000.debugDisp[0]);
|
||||
|
||||
gDPPipeSync(gfx++);
|
||||
gDPFullSync(gfx++);
|
||||
gSPEndDisplayList(gfx++);
|
||||
}
|
||||
|
||||
problem = false;
|
||||
|
||||
{
|
||||
GfxPool* pool = &gGfxPools[gfxCtx->gfxPoolIdx % 2];
|
||||
|
||||
if (pool->headMagic != GFXPOOL_HEAD_MAGIC) {
|
||||
Fault_AddHungupAndCrash("../graph.c", 1054);
|
||||
}
|
||||
if (pool->tailMagic != GFXPOOL_TAIL_MAGIC) {
|
||||
Fault_AddHungupAndCrash("../graph.c", 1066);
|
||||
}
|
||||
}
|
||||
|
||||
if (THGA_IsCrash(&gfxCtx->polyOpa)) {
|
||||
problem = true;
|
||||
}
|
||||
if (THGA_IsCrash(&gfxCtx->polyXlu)) {
|
||||
problem = true;
|
||||
}
|
||||
if (THGA_IsCrash(&gfxCtx->overlay)) {
|
||||
problem = true;
|
||||
}
|
||||
if (THGA_IsCrash(&gfxCtx->work)) {
|
||||
problem = true;
|
||||
}
|
||||
if (THGA_IsCrash(&gfxCtx->debug)) {
|
||||
problem = true;
|
||||
}
|
||||
|
||||
if (!problem) {
|
||||
Graph_TaskSet00(gfxCtx, gameState);
|
||||
gfxCtx->gfxPoolIdx++;
|
||||
gfxCtx->framebufferIdx++;
|
||||
}
|
||||
|
||||
{
|
||||
OSTime time = osGetTime();
|
||||
|
||||
D_801FBAE8 = sRSPGFXTotalTime;
|
||||
D_801FBAE0 = gRSPAudioTotalTime;
|
||||
D_801FBAF0 = gRDPTotalTime;
|
||||
sRSPGFXTotalTime = 0;
|
||||
gRSPAudioTotalTime = 0;
|
||||
gRDPTotalTime = 0;
|
||||
|
||||
if (sGraphTaskStartTime != 0) {
|
||||
lastRenderFrameDuration = time - sGraphTaskStartTime;
|
||||
}
|
||||
sGraphTaskStartTime = time;
|
||||
}
|
||||
}
|
||||
|
||||
void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
|
||||
gameState->unk_A3 = 0;
|
||||
|
||||
Graph_UpdateGame(gameState);
|
||||
Graph_ExecuteAndDraw(gfxCtx, gameState);
|
||||
}
|
||||
|
||||
void Graph_ThreadEntry(void* arg) {
|
||||
GraphicsContext gfxCtx;
|
||||
GameStateOverlay* nextOvl = &gGameStateOverlayTable[0];
|
||||
GameStateOverlay* ovl;
|
||||
GameState* gameState;
|
||||
u32 size;
|
||||
s32 pad[2];
|
||||
|
||||
gZBuffer = SystemArena_Malloc(sizeof(*gZBuffer) + sizeof(*gWorkBuffer) + 64 - 1);
|
||||
gZBuffer = (void*)ALIGN64((u32)gZBuffer);
|
||||
|
||||
gWorkBuffer = (void*)((u8*)gZBuffer + sizeof(*gZBuffer));
|
||||
|
||||
gGfxSPTaskOutputBuffer2 = gGfxSPTaskOutputBuffer = SystemArena_Malloc(sizeof(*gGfxSPTaskOutputBuffer));
|
||||
|
||||
gGfxSPTaskOutputBufferEnd = (u8*)gGfxSPTaskOutputBuffer + sizeof(*gGfxSPTaskOutputBuffer);
|
||||
gGfxSPTaskOutputBufferEnd2 = (u8*)gGfxSPTaskOutputBuffer2 + sizeof(*gGfxSPTaskOutputBuffer2);
|
||||
|
||||
func_80178978();
|
||||
Fault_SetFB(D_801FBB90, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
Graph_Init(&gfxCtx);
|
||||
|
||||
while (nextOvl) {
|
||||
ovl = nextOvl;
|
||||
|
||||
Overlay_LoadGameState(ovl);
|
||||
|
||||
size = ovl->instanceSize;
|
||||
|
||||
func_800809F4(ovl->vromStart);
|
||||
|
||||
gameState = SystemArena_Malloc(size);
|
||||
|
||||
bzero(gameState, size);
|
||||
GameState_Init(gameState, ovl->init, &gfxCtx);
|
||||
|
||||
while (GameState_IsRunning(gameState)) {
|
||||
Graph_Update(&gfxCtx, gameState);
|
||||
}
|
||||
|
||||
nextOvl = Graph_GetNextGameState(gameState);
|
||||
|
||||
if (size) {}
|
||||
|
||||
GameState_Destroy(gameState);
|
||||
SystemArena_Free(gameState);
|
||||
|
||||
Overlay_FreeGameState(ovl);
|
||||
}
|
||||
Graph_Destroy(&gfxCtx);
|
||||
}
|
||||
|
29
src/code/graphalloc.c
Normal file
29
src/code/graphalloc.c
Normal file
@ -0,0 +1,29 @@
|
||||
#include "global.h"
|
||||
|
||||
Gfx* Graph_GfxPlusOne(Gfx* gfx) {
|
||||
return &gfx[1];
|
||||
}
|
||||
|
||||
Gfx* Graph_BranchDlist(Gfx* gfx, Gfx* dst) {
|
||||
gSPBranchList(gfx, dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allocates a structure of `size` into the display list buffer`gfx`,
|
||||
* returning a pointer to the start of the buffer.
|
||||
* Since the alloc may not itself be display list commands, a BranchList
|
||||
* command is used to step over this region.
|
||||
*/
|
||||
void* Graph_DlistAlloc(Gfx** gfx, size_t size) {
|
||||
u8* start;
|
||||
Gfx* end;
|
||||
|
||||
size = ALIGN8(size);
|
||||
start = (u8*)&(*gfx)[1];
|
||||
end = (Gfx*)(start + size);
|
||||
gSPBranchList(*gfx, end);
|
||||
|
||||
*gfx = end;
|
||||
return start;
|
||||
}
|
@ -179,7 +179,7 @@ halt_rdp:
|
||||
if (dpTask->type == M_GFXTASK) {
|
||||
// Try to stop DP
|
||||
osSyncPrintf("DP止めようとします\n");
|
||||
bzero(dpTask->output_buff, (u32)dpTask->output_buff_size - (u32)dpTask->output_buff);
|
||||
bzero(dpTask->outputBuff, (u32)dpTask->outputBuffSize - (u32)dpTask->outputBuff);
|
||||
osSendMesg(&sched->interruptQ, RDP_DONE_MSG, OS_MESG_NOBLOCK);
|
||||
}
|
||||
}
|
||||
@ -336,8 +336,8 @@ void Sched_RunTask(SchedContext* sched, OSScTask* spTask, OSScTask* dpTask) {
|
||||
|
||||
if (spTask->list.t.type == M_AUDTASK) {
|
||||
// Set global pointers to audio task data for use in audio processing
|
||||
gAudioSPDataPtr = spTask->list.t.data_ptr;
|
||||
gAudioSPDataSize = spTask->list.t.data_size;
|
||||
gAudioSPDataPtr = spTask->list.t.dataPtr;
|
||||
gAudioSPDataSize = spTask->list.t.dataSize;
|
||||
}
|
||||
|
||||
// Begin task execution
|
||||
@ -527,7 +527,7 @@ void Sched_FaultClient(void* param1, void* param2) {
|
||||
spTask = sched->curRSPTask;
|
||||
if (spTask != NULL) {
|
||||
FaultDrawer_Printf("RSPTask %08x %08x %02x %02x\n%01x %08x %08x\n", spTask, spTask->next, spTask->state,
|
||||
spTask->flags, spTask->list.t.type, spTask->list.t.data_ptr, spTask->list.t.data_size);
|
||||
spTask->flags, spTask->list.t.type, spTask->list.t.dataPtr, spTask->list.t.dataSize);
|
||||
}
|
||||
|
||||
dpTask = sched->curRDPTask;
|
||||
|
@ -8,9 +8,9 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_cmpdma/func_801789D4.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_cmpdma/get_framebuffer.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_cmpdma/SysCfb_GetFbPtr.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_cmpdma/get_zbuffer.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_cmpdma/SysCfb_GetZBuffer.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_cmpdma/func_80178A24.s")
|
||||
|
||||
|
@ -87,11 +87,3 @@ void Matrix_StatePop(void) {
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_InsertRotationAroundUnitVector_f.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_InsertRotationAroundUnitVector_s.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/func_80182C90.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/func_80182CA0.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/func_80182CBC.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/func_80182CCC.s")
|
||||
|
@ -1,7 +1,9 @@
|
||||
#include "global.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_ucode/func_80182CE0.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_ucode/SysUcode_GetUCodeBoot.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_ucode/func_80183020.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_ucode/SysUcode_GetUCodeBootSize.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_ucode/func_80183058.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_ucode/SysUcode_GetUCode.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_ucode/SysUcode_GetUCodeData.s")
|
||||
|
@ -62,6 +62,6 @@ void TitleSetup_Destroy(GameState* gameState) {
|
||||
}
|
||||
|
||||
void TitleSetup_Init(GameState* gameState) {
|
||||
gameState->destroy = &TitleSetup_Destroy;
|
||||
gameState->destroy = TitleSetup_Destroy;
|
||||
TitleSetup_InitImpl(gameState);
|
||||
}
|
||||
|
@ -319,7 +319,7 @@ void Actor_SetScale(Actor* actor, f32 scale) {
|
||||
|
||||
void Actor_SetObjectSegment(GlobalContext* globalCtx, Actor* actor) {
|
||||
// TODO: Segment number enum
|
||||
gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[actor->objBankIndex].segment);
|
||||
gSegments[0x06] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[actor->objBankIndex].segment);
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
@ -50,7 +50,7 @@ void EffectSs_DrawGEffect(GlobalContext* globalCtx, EffectSs* this, void* textur
|
||||
SkinMatrix_SetScale(&mfScale, scale, scale, scale);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans, &globalCtx->mf_187FC, &mfTrans11DA0);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans11DA0, &mfScale, &mfResult);
|
||||
gSegments[6] = PHYSICAL_TO_VIRTUAL(object);
|
||||
gSegments[0x06] = PHYSICAL_TO_VIRTUAL(object);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x06, object);
|
||||
|
||||
mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &mfResult);
|
||||
|
@ -19,7 +19,7 @@ void PreNMI_Update(PreNMIContext* prenmiCtx) {
|
||||
void PreNMI_Draw(PreNMIContext* prenmiCtx) {
|
||||
GraphicsContext* gfxCtx = prenmiCtx->state.gfxCtx;
|
||||
|
||||
func_8012CF0C(gfxCtx, 1, 1, 0, 0, 0);
|
||||
func_8012CF0C(gfxCtx, true, true, 0, 0, 0);
|
||||
|
||||
OPEN_DISPS(gfxCtx);
|
||||
|
||||
@ -35,7 +35,7 @@ void PreNMI_Main(PreNMIContext* prenmiCtx) {
|
||||
PreNMI_Update(prenmiCtx);
|
||||
PreNMI_Draw(prenmiCtx);
|
||||
|
||||
prenmiCtx->state.unkA3 = 1;
|
||||
prenmiCtx->state.unk_A3 = 1;
|
||||
}
|
||||
|
||||
void PreNMI_Destroy(PreNMIContext* prenmiCtx) {
|
||||
|
146
src/code/z_rcp.c
146
src/code/z_rcp.c
@ -762,7 +762,7 @@ Gfx sFillSetupDL[] = {
|
||||
G_TD_CLAMP | G_TP_PERSP | G_CYC_FILL | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PIXEL | G_RM_NOOP | G_RM_NOOP2),
|
||||
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
|
||||
gsSPDisplayList(&D_0E0001C8),
|
||||
gsSPDisplayList(D_0E000000.setScissor),
|
||||
gsDPSetBlendColor(0x00, 0x00, 0x00, 0x08),
|
||||
gsSPClipRatio(FRUSTRATIO_2),
|
||||
gsSPEndDisplayList(),
|
||||
@ -1223,82 +1223,110 @@ Gfx* Gfx_PrimColor(GraphicsContext* gfxCtx, s32 lodfrac, s32 r, s32 g, s32 b, s3
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc, some reorderings
|
||||
void func_8012CF0C(GraphicsContext* gfxCtx, s32 iParm2, s32 iParm3, u8 r, u8 g, u8 b) {
|
||||
// Regalloc differences, minor reorderings
|
||||
void func_8012CF0C(GraphicsContext* gfxCtx, s32 clearFb, s32 clearZb, u8 r, u8 g, u8 b) {
|
||||
Gfx* masterGfx;
|
||||
void* zbuffer;
|
||||
s32 i;
|
||||
Gfx* gfx;
|
||||
|
||||
gSegments[0] = 0;
|
||||
gSegments[14] = (u32)graphDlEntry;
|
||||
gSegments[15] = (u32)gfxCtx->framebuffer;
|
||||
gSegments[0x00] = 0;
|
||||
gSegments[0x0F] = gfxCtx->curFrameBuffer;
|
||||
gSegments[0x0E] = gGfxMasterDL;
|
||||
|
||||
gfx = graphDlEntry + 0x16;
|
||||
gSPDisplayList(gfx + 0, &D_0E000140);
|
||||
gSPDisplayList(gfx + 1, &sFillSetupDL);
|
||||
gDPSetColorImage(gfx + 2, G_IM_FMT_RGBA, G_IM_SIZ_16b, D_801FBBCC, 0x0F000000);
|
||||
if (gfxCtx->zbuffer != NULL) {
|
||||
gDPSetDepthImage(gfx + 3, gfxCtx->zbuffer);
|
||||
zbuffer = gfxCtx->zbuffer;
|
||||
|
||||
// Set up Framebuffer and Z-Buffer
|
||||
|
||||
masterGfx = gGfxMasterDL->setupBuffers;
|
||||
|
||||
gSPDisplayList(&masterGfx[0], D_0E000000.syncSegments);
|
||||
gSPDisplayList(&masterGfx[1], sFillSetupDL);
|
||||
gDPSetColorImage(&masterGfx[2], G_IM_FMT_RGBA, G_IM_SIZ_16b, D_801FBBCC, &D_0F000000);
|
||||
if (zbuffer != NULL) {
|
||||
gDPSetDepthImage(&masterGfx[3], zbuffer);
|
||||
} else {
|
||||
gDPSetDepthImage(gfx + 3, 0x0F000000);
|
||||
gDPSetDepthImage(&masterGfx[3], &D_0F000000);
|
||||
}
|
||||
gSPEndDisplayList(gfx + 4);
|
||||
gSPEndDisplayList(&masterGfx[4]);
|
||||
|
||||
gfx = graphDlEntry + 0x39;
|
||||
gDPSetScissor(gfx + 0, G_SC_NON_INTERLACE, 0, 0, D_801FBBCC, D_801FBBCE);
|
||||
gSPEndDisplayList(gfx + 1);
|
||||
// Set Scissor
|
||||
|
||||
gfx = graphDlEntry + 0x9;
|
||||
if (gfxCtx->zbuffer == NULL) {
|
||||
gSPEndDisplayList(gfx + 0);
|
||||
masterGfx = gGfxMasterDL->setScissor;
|
||||
|
||||
gDPSetScissor(&masterGfx[0], G_SC_NON_INTERLACE, 0, 0, D_801FBBCC, D_801FBBCE);
|
||||
gSPEndDisplayList(&masterGfx[1]);
|
||||
|
||||
// Clear Z-Buffer
|
||||
|
||||
masterGfx = gGfxMasterDL->clearZBuffer;
|
||||
|
||||
if (zbuffer == NULL) {
|
||||
gSPEndDisplayList(&masterGfx[0]);
|
||||
} else {
|
||||
gDPSetColorImage(gfx + 0, G_IM_FMT_RGBA, G_IM_SIZ_16b, D_801FBBCC, gfxCtx->zbuffer);
|
||||
gDPPipeSync(gfx + 1);
|
||||
gDPSetCycleType(gfx + 2, G_CYC_FILL);
|
||||
gDPSetRenderMode(gfx + 3, G_RM_NOOP, G_RM_NOOP2);
|
||||
gDPSetFillColor(gfx + 4, (GPACK_RGBA5551(0xFF, 0xFF, 0xF0, 0) << 16) | GPACK_RGBA5551(0xFF, 0xFF, 0xF0, 0));
|
||||
gSPDisplayList(gfx + 5, &D_0E0002C8);
|
||||
gDPSetColorImage(gfx + 6, G_IM_FMT_RGBA, G_IM_SIZ_16b, D_801FBBCC, gfxCtx->zbuffer);
|
||||
gSPEndDisplayList(gfx + 7);
|
||||
gDPSetColorImage(&masterGfx[0], G_IM_FMT_RGBA, G_IM_SIZ_16b, D_801FBBCC, zbuffer);
|
||||
gDPPipeSync(&masterGfx[1]);
|
||||
gDPSetCycleType(&masterGfx[2], G_CYC_FILL);
|
||||
gDPSetRenderMode(&masterGfx[3], G_RM_NOOP, G_RM_NOOP2);
|
||||
gDPSetFillColor(&masterGfx[4], (GPACK_RGBA5551(255, 255, 240, 0) << 16) | GPACK_RGBA5551(255, 255, 240, 0));
|
||||
gSPDisplayList(&masterGfx[5], D_0E000000.clearFillRect);
|
||||
gDPSetColorImage(&masterGfx[6], G_IM_FMT_RGBA, G_IM_SIZ_16b, D_801FBBCC, zbuffer);
|
||||
gSPEndDisplayList(&masterGfx[7]);
|
||||
}
|
||||
|
||||
gfx = graphDlEntry + 0x11;
|
||||
gDPSetColorImage(gfx + 0, G_IM_FMT_RGBA, G_IM_SIZ_16b, D_801FBBCC, 0x0F000000);
|
||||
gDPSetCycleType(gfx + 1, G_CYC_FILL);
|
||||
gDPSetRenderMode(gfx + 2, G_RM_NOOP, G_RM_NOOP2);
|
||||
gDPSetFillColor(gfx + 3, GPACK_RGBA5551(r, g, b, 0));
|
||||
gSPBranchList(gfx + 4, &D_0E0002C8);
|
||||
// Clear Framebuffer
|
||||
|
||||
gfx = graphDlEntry + 0x59;
|
||||
gDPFillRectangle(gfx + 0, 0, 0, D_801FBBCC - 1, D_801FBBCE - 1);
|
||||
gDPPipeSync(gfx + 1);
|
||||
gSPEndDisplayList(gfx + 2);
|
||||
masterGfx = gGfxMasterDL->clearFrameBuffer;
|
||||
|
||||
gfx = graphDlEntry + 0x5C;
|
||||
gDPFillRectangle(gfx + 0, 0, 0, D_801FBBCC, D_801FBBCE);
|
||||
gDPPipeSync(gfx + 1);
|
||||
gSPEndDisplayList(gfx + 2);
|
||||
gDPSetColorImage(&masterGfx[0], G_IM_FMT_RGBA, G_IM_SIZ_16b, D_801FBBCC, &D_0F000000);
|
||||
gDPSetCycleType(&masterGfx[1], G_CYC_FILL);
|
||||
gDPSetRenderMode(&masterGfx[2], G_RM_NOOP, G_RM_NOOP2);
|
||||
gDPSetFillColor(&masterGfx[3], (GPACK_RGBA5551(r, g, b, 1) << 16) | GPACK_RGBA5551(r, g, b, 1));
|
||||
gSPBranchList(&masterGfx[4], D_0E000000.clearFillRect);
|
||||
|
||||
gfx = graphDlEntry + 0x28;
|
||||
for (i = 0; i < 0x10; i++) {
|
||||
if (i == 0xE) {
|
||||
gSPNoOp(gfx + i);
|
||||
// Fillrect used by the above buffer clearing routines
|
||||
|
||||
masterGfx = gGfxMasterDL->clearFillRect;
|
||||
|
||||
gDPFillRectangle(&masterGfx[0], 0, 0, D_801FBBCC - 1, D_801FBBCE - 1);
|
||||
gDPPipeSync(&masterGfx[1]);
|
||||
gSPEndDisplayList(&masterGfx[2]);
|
||||
|
||||
// General Fillrect?
|
||||
|
||||
masterGfx = gGfxMasterDL->fillRect;
|
||||
|
||||
gDPFillRectangle(&masterGfx[0], 0, 0, D_801FBBCC, D_801FBBCE);
|
||||
gDPPipeSync(&masterGfx[1]);
|
||||
gSPEndDisplayList(&masterGfx[2]);
|
||||
|
||||
// Sync SP Segments with current CPU Segments
|
||||
|
||||
masterGfx = gGfxMasterDL->syncSegments;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(gSegments); i++) {
|
||||
if (i == 0x0E) {
|
||||
gSPNoOp(&masterGfx[i]);
|
||||
} else {
|
||||
gSPSegment(gfx + i, i, gSegments[i]);
|
||||
gSPSegment(&masterGfx[i], i, gSegments[i]);
|
||||
}
|
||||
}
|
||||
gSPEndDisplayList(gfx + i);
|
||||
gSPEndDisplayList(&masterGfx[i]);
|
||||
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, graphDlEntry + 0x16);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, graphDlEntry + 0x16);
|
||||
gSPDisplayList(gfxCtx->overlay.p++, graphDlEntry + 0x16);
|
||||
gSPDisplayList(gfxCtx->unk1B8.p++, graphDlEntry + 0x16);
|
||||
OPEN_DISPS(gfxCtx);
|
||||
|
||||
if (iParm3) {
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, &D_0E000048);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gGfxMasterDL->setupBuffers);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGfxMasterDL->setupBuffers);
|
||||
gSPDisplayList(OVERLAY_DISP++, gGfxMasterDL->setupBuffers);
|
||||
gSPDisplayList(DEBUG_DISP++, gGfxMasterDL->setupBuffers);
|
||||
|
||||
if (clearZb) {
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, D_0E000000.clearZBuffer);
|
||||
}
|
||||
if (iParm2) {
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, &D_0E000088);
|
||||
if (clearFb) {
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, D_0E000000.clearFrameBuffer);
|
||||
}
|
||||
|
||||
CLOSE_DISPS(gfxCtx);
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_8012CF0C.s")
|
||||
@ -1306,9 +1334,9 @@ void func_8012CF0C(GraphicsContext* gfxCtx, s32 iParm2, s32 iParm3, u8 r, u8 g,
|
||||
|
||||
void func_8012D374(GraphicsContext* gfxCtx, u8 r, u8 g, u8 b) {
|
||||
if ((R_PAUSE_MENU_MODE < 2) && (D_801F6D10 < 2)) {
|
||||
func_8012CF0C(gfxCtx, 1, 1, r, g, b);
|
||||
func_8012CF0C(gfxCtx, true, true, r, g, b);
|
||||
} else {
|
||||
func_8012CF0C(gfxCtx, 0, 0, r, g, b);
|
||||
func_8012CF0C(gfxCtx, false, false, r, g, b);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,7 @@ s32 Room_HandleLoadCallbacks(GlobalContext* globalCtx, RoomContext* roomCtx) {
|
||||
roomCtx->unk31 = 0;
|
||||
roomCtx->currRoom.segment = roomCtx->activeRoomVram;
|
||||
// TODO: Segment number enum
|
||||
gSegments[3] = PHYSICAL_TO_VIRTUAL(roomCtx->activeRoomVram);
|
||||
gSegments[0x03] = PHYSICAL_TO_VIRTUAL(roomCtx->activeRoomVram);
|
||||
|
||||
Scene_ProcessHeader(globalCtx, (SceneCmd*)roomCtx->currRoom.segment);
|
||||
func_80123140(globalCtx, GET_PLAYER(globalCtx));
|
||||
@ -137,7 +137,7 @@ s32 Room_HandleLoadCallbacks(GlobalContext* globalCtx, RoomContext* roomCtx) {
|
||||
void Room_Draw(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
if (room->segment != NULL) {
|
||||
// TODO: Segment number enum
|
||||
gSegments[3] = PHYSICAL_TO_VIRTUAL(room->segment);
|
||||
gSegments[0x03] = PHYSICAL_TO_VIRTUAL(room->segment);
|
||||
roomDrawFuncs[room->mesh->type0.type](globalCtx, room, flags);
|
||||
}
|
||||
return;
|
||||
|
@ -53,7 +53,7 @@ void Object_InitBank(GameState* gameState, ObjectContext* objectCtx) {
|
||||
objectCtx->spaceEnd = (void*)((u32)objectCtx->spaceStart + spaceSize);
|
||||
objectCtx->mainKeepIndex = Object_Spawn(objectCtx, GAMEPLAY_KEEP);
|
||||
|
||||
gSegments[4] = PHYSICAL_TO_VIRTUAL(objectCtx->status[objectCtx->mainKeepIndex].segment);
|
||||
gSegments[0x04] = PHYSICAL_TO_VIRTUAL(objectCtx->status[objectCtx->mainKeepIndex].segment);
|
||||
}
|
||||
|
||||
void Object_UpdateBank(ObjectContext* objectCtx) {
|
||||
@ -228,7 +228,7 @@ void Scene_HeaderCmdSpecialFiles(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
if (cmd->specialFiles.subKeepIndex != 0) {
|
||||
globalCtx->objectCtx.subKeepIndex = Object_Spawn(&globalCtx->objectCtx, cmd->specialFiles.subKeepIndex);
|
||||
// TODO: Segment number enum?
|
||||
gSegments[5] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[globalCtx->objectCtx.subKeepIndex].segment);
|
||||
gSegments[0x05] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[globalCtx->objectCtx.subKeepIndex].segment);
|
||||
}
|
||||
|
||||
if (cmd->specialFiles.cUpElfMsgNum != 0) {
|
||||
|
@ -210,7 +210,7 @@ void SkelAnime_DrawFlexLod(GlobalContext* globalCtx, void** skeleton, Vec3s* joi
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0xD, mtx);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x0D, mtx);
|
||||
Matrix_StatePush();
|
||||
|
||||
rootLimb = (LodLimb*)Lib_SegmentedToVirtual(skeleton[0]);
|
||||
@ -428,7 +428,7 @@ void SkelAnime_DrawFlexOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* joi
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0xD, mtx);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x0D, mtx);
|
||||
|
||||
Matrix_StatePush();
|
||||
|
||||
@ -555,7 +555,7 @@ void func_801343C0(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable,
|
||||
|
||||
mtx = (Mtx*)GRAPH_ALLOC(globalCtx->state.gfxCtx, ALIGN16(sizeof(Mtx) * dListCount));
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0xD, mtx);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x0D, mtx);
|
||||
|
||||
Matrix_StatePush();
|
||||
|
||||
@ -822,7 +822,7 @@ Gfx* SkelAnime_DrawFlex(GlobalContext* globalCtx, void** skeleton, Vec3s* jointT
|
||||
|
||||
mtx = (Mtx*)GRAPH_ALLOC(globalCtx->state.gfxCtx, ALIGN16(sizeof(Mtx) * dListCount));
|
||||
|
||||
gSPSegment(gfx++, 0xD, mtx);
|
||||
gSPSegment(gfx++, 0x0D, mtx);
|
||||
|
||||
Matrix_StatePush();
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
void osViSetEvent(OSMesgQueue* mq, OSMesg m, u32 retraceCount) {
|
||||
register u32 saveMask = __osDisableInt();
|
||||
|
||||
__osViNext->msgq = mq;
|
||||
__osViNext->mq = mq;
|
||||
__osViNext->msg = m;
|
||||
__osViNext->retraceCount = retraceCount;
|
||||
|
||||
|
@ -13,12 +13,12 @@ OSTask* _VirtualToPhysicalTask(OSTask* intp) {
|
||||
bcopy(intp, tp, sizeof(OSTask));
|
||||
|
||||
_osVirtualToPhysical(tp->t.ucode);
|
||||
_osVirtualToPhysical(tp->t.ucode_data);
|
||||
_osVirtualToPhysical(tp->t.dram_stack);
|
||||
_osVirtualToPhysical(tp->t.output_buff);
|
||||
_osVirtualToPhysical(tp->t.output_buff_size);
|
||||
_osVirtualToPhysical(tp->t.data_ptr);
|
||||
_osVirtualToPhysical(tp->t.yield_data_ptr);
|
||||
_osVirtualToPhysical(tp->t.ucodeData);
|
||||
_osVirtualToPhysical(tp->t.dramStack);
|
||||
_osVirtualToPhysical(tp->t.outputBuff);
|
||||
_osVirtualToPhysical(tp->t.outputBuffSize);
|
||||
_osVirtualToPhysical(tp->t.dataPtr);
|
||||
_osVirtualToPhysical(tp->t.yieldDataPtr);
|
||||
|
||||
return tp;
|
||||
}
|
||||
@ -27,12 +27,12 @@ void osSpTaskLoad(OSTask* intp) {
|
||||
OSTask* tp = _VirtualToPhysicalTask(intp);
|
||||
|
||||
if (tp->t.flags & OS_TASK_YIELDED) {
|
||||
tp->t.ucode_data = tp->t.yield_data_ptr;
|
||||
tp->t.ucode_data_size = tp->t.yield_data_size;
|
||||
tp->t.ucodeData = tp->t.yieldDataPtr;
|
||||
tp->t.ucodeDataSize = tp->t.yieldDataSize;
|
||||
intp->t.flags &= ~OS_TASK_YIELDED;
|
||||
|
||||
if (tp->t.flags & OS_TASK_LOADABLE) {
|
||||
tp->t.ucode = HW_REG((u32)intp->t.yield_data_ptr + OS_YIELD_DATA_SIZE - 4, u32);
|
||||
tp->t.ucode = HW_REG((u32)intp->t.yieldDataPtr + OS_YIELD_DATA_SIZE - 4, u32);
|
||||
}
|
||||
}
|
||||
osWritebackDCache(tp, sizeof(OSTask));
|
||||
@ -47,7 +47,7 @@ void osSpTaskLoad(OSTask* intp) {
|
||||
while (__osSpDeviceBusy()) {
|
||||
;
|
||||
}
|
||||
while (__osSpRawStartDma(1, (void*)SP_IMEM_START, tp->t.ucode_boot, tp->t.ucode_boot_size) == -1) {
|
||||
while (__osSpRawStartDma(1, (void*)SP_IMEM_START, tp->t.ucodeBoot, tp->t.ucodeBootSize) == -1) {
|
||||
;
|
||||
}
|
||||
}
|
||||
|
@ -6,8 +6,8 @@ void __osViInit(void) {
|
||||
__osViNext = &D_80098060[1];
|
||||
__osViNext->retraceCount = 1;
|
||||
__osViCurr->retraceCount = 1;
|
||||
__osViNext->framep = (void*)0x80000000;
|
||||
__osViCurr->framep = (void*)0x80000000;
|
||||
__osViNext->buffer = (void*)0x80000000;
|
||||
__osViCurr->buffer = (void*)0x80000000;
|
||||
|
||||
if (osTvType == 0) {
|
||||
__osViNext->modep = &osViModePalLan1;
|
||||
@ -18,7 +18,7 @@ void __osViInit(void) {
|
||||
}
|
||||
|
||||
__osViNext->state = 0x20;
|
||||
__osViNext->control = __osViNext->modep->comRegs.ctrl;
|
||||
__osViNext->features = __osViNext->modep->comRegs.ctrl;
|
||||
|
||||
while (*(vu32*)0xA4400010 > 10) {
|
||||
;
|
||||
|
@ -2,13 +2,13 @@
|
||||
|
||||
void* osViGetNextFramebuffer(void) {
|
||||
register u32 saveMask;
|
||||
void* framep;
|
||||
void* buffer;
|
||||
|
||||
saveMask = __osDisableInt();
|
||||
|
||||
framep = __osViNext->framep;
|
||||
buffer = __osViNext->buffer;
|
||||
|
||||
__osRestoreInt(saveMask);
|
||||
|
||||
return framep;
|
||||
return buffer;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ void osViSetMode(OSViMode* modep) {
|
||||
|
||||
__osViNext->modep = modep;
|
||||
__osViNext->state = 1;
|
||||
__osViNext->control = __osViNext->modep->comRegs.ctrl;
|
||||
__osViNext->features = __osViNext->modep->comRegs.ctrl;
|
||||
|
||||
__osRestoreInt(saveMask);
|
||||
}
|
||||
|
@ -4,33 +4,33 @@ void osViSetSpecialFeatures(u32 func) {
|
||||
register u32 saveMask = __osDisableInt();
|
||||
|
||||
if (func & 1) {
|
||||
__osViNext->control |= 8;
|
||||
__osViNext->features |= 8;
|
||||
}
|
||||
if (func & 2) {
|
||||
__osViNext->control &= ~8;
|
||||
__osViNext->features &= ~8;
|
||||
}
|
||||
if (func & 4) {
|
||||
__osViNext->control |= 4;
|
||||
__osViNext->features |= 4;
|
||||
}
|
||||
if (func & 8) {
|
||||
|
||||
__osViNext->control &= ~4;
|
||||
__osViNext->features &= ~4;
|
||||
}
|
||||
if (func & 0x10) {
|
||||
|
||||
__osViNext->control |= 0x10;
|
||||
__osViNext->features |= 0x10;
|
||||
}
|
||||
if (func & 0x20) {
|
||||
|
||||
__osViNext->control &= ~0x10;
|
||||
__osViNext->features &= ~0x10;
|
||||
}
|
||||
if (func & 0x40) {
|
||||
__osViNext->control |= 0x10000;
|
||||
__osViNext->control &= ~0x300;
|
||||
__osViNext->features |= 0x10000;
|
||||
__osViNext->features &= ~0x300;
|
||||
}
|
||||
if (func & 0x80) {
|
||||
__osViNext->control &= ~0x10000;
|
||||
__osViNext->control |= __osViNext->modep->comRegs.ctrl & 0x300;
|
||||
__osViNext->features &= ~0x10000;
|
||||
__osViNext->features |= __osViNext->modep->comRegs.ctrl & 0x300;
|
||||
}
|
||||
__osViNext->state |= 8;
|
||||
|
||||
|
@ -4,7 +4,7 @@ void osViSwapBuffer(void* frameBufPtr) {
|
||||
|
||||
u32 saveMask = __osDisableInt();
|
||||
|
||||
__osViNext->framep = frameBufPtr;
|
||||
__osViNext->buffer = frameBufPtr;
|
||||
__osViNext->state |= 0x10;
|
||||
|
||||
__osRestoreInt(saveMask);
|
||||
|
@ -39,7 +39,8 @@ const ActorInit Arrow_Fire_InitVars = {
|
||||
|
||||
extern ColliderQuadInit D_80922230;
|
||||
|
||||
extern UNK_TYPE D_0E0002E0;
|
||||
// there are uses of D_0E000000.fillRect (appearing as D_0E0002E0) in this file
|
||||
extern GfxMasterList D_0E000000;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Arrow_Fire/ArrowFire_SetupAction.s")
|
||||
|
||||
|
@ -40,8 +40,6 @@ static InitChainEntry sInitChain[] = {
|
||||
ICHAIN_F32(uncullZoneForward, 2000, ICHAIN_STOP),
|
||||
};
|
||||
|
||||
extern Gfx D_0E0002E0[];
|
||||
|
||||
void ArrowIce_SetupAction(ArrowIce* this, ArrowIceActionFunc actionFunc) {
|
||||
this->actionFunc = actionFunc;
|
||||
}
|
||||
@ -214,7 +212,7 @@ void ArrowIce_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
(s32)(150.0f * this->blueingEffectMagnitude) & 0xFF);
|
||||
gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_DISABLE);
|
||||
gDPSetColorDither(POLY_XLU_DISP++, G_CD_DISABLE);
|
||||
gSPDisplayList(POLY_XLU_DISP++, D_0E0002E0);
|
||||
gSPDisplayList(POLY_XLU_DISP++, D_0E000000.fillRect);
|
||||
}
|
||||
|
||||
// Draw ice on the arrow
|
||||
|
@ -37,7 +37,8 @@ static InitChainEntry D_809260A0[] = {
|
||||
|
||||
extern InitChainEntry D_809260A0[];
|
||||
|
||||
extern UNK_TYPE D_0E0002E0;
|
||||
// there are uses of D_0E000000.fillRect (appearing as D_0E0002E0) in this file
|
||||
extern GfxMasterList D_0E000000;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Arrow_Light/D_809260B0.s")
|
||||
|
||||
|
@ -177,7 +177,7 @@ s32 func_80A515C4(EnDnk* this) {
|
||||
|
||||
void func_80A51648(EnDnk* this, GlobalContext* globalCtx) {
|
||||
if (func_8013D8DC(this->unk_28E, globalCtx) == 1) {
|
||||
gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->unk_28E].segment);
|
||||
gSegments[0x06] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->unk_28E].segment);
|
||||
this->actor.draw = func_80A52018;
|
||||
this->actor.objBankIndex = this->unk_28E;
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, NULL, 18.0f);
|
||||
|
@ -1102,7 +1102,7 @@ void func_80B2ADB0(EnFish2* this, Vec3f* vec, s16 arg2) {
|
||||
phi_v0 = &D_04091BE0;
|
||||
}
|
||||
|
||||
ptr->unk_20 = gSegments[(phi_v0 * 0x10) >> 0x1C] + (phi_v0 & 0xFFFFFF);
|
||||
ptr->unk_20 = VIRTUAL_TO_PHYSICAL(SEGMENTED_TO_VIRTUAL(phi_v0));
|
||||
ptr->unk_00 = true;
|
||||
ptr->unk_04 = *vec;
|
||||
ptr->unk_04.x += randPlusMinusPoint5Scaled(ptr->unk_00 + (this->unk_330 * 4000.0f));
|
||||
|
@ -14,7 +14,7 @@ typedef struct {
|
||||
/* 0x14 */ f32 unk_14;
|
||||
/* 0x18 */ f32 unk_18;
|
||||
/* 0x1C */ s16 unk_1C;
|
||||
/* 0x20 */ s32 unk_20;
|
||||
/* 0x20 */ void* unk_20;
|
||||
} EnFish2UnkStruct; // size = 0x24
|
||||
|
||||
typedef struct EnFish2 {
|
||||
|
@ -1317,7 +1317,7 @@ void EnSob1_Blink(EnSob1* this) {
|
||||
}
|
||||
|
||||
void EnSob1_ChangeObject(EnSob1* this, GlobalContext* globalCtx) {
|
||||
gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->objIndices[2]].segment);
|
||||
gSegments[0x06] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->objIndices[2]].segment);
|
||||
}
|
||||
|
||||
s32 EnSob1_AreObjectsLoaded(EnSob1* this, GlobalContext* globalCtx) {
|
||||
@ -1335,7 +1335,7 @@ s32 EnSob1_AreObjectsLoaded(EnSob1* this, GlobalContext* globalCtx) {
|
||||
|
||||
void EnSob1_InitZoraShopkeeper(EnSob1* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600D208, NULL, this->jointTable, this->morphTable, 20);
|
||||
gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->objIndices[2]].segment);
|
||||
gSegments[0x06] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->objIndices[2]].segment);
|
||||
Animation_Change(&this->skelAnime, &D_0600078C, 1.0f, 0.0f, Animation_GetLastFrame(&D_0600078C), 0, 0.0f);
|
||||
this->actor.draw = EnSob1_DrawZoraShopkeeper;
|
||||
this->changeObjectFunc = EnSob1_ChangeObject;
|
||||
@ -1343,7 +1343,7 @@ void EnSob1_InitZoraShopkeeper(EnSob1* this, GlobalContext* globalCtx) {
|
||||
|
||||
void EnSob1_InitGoronShopkeeper(EnSob1* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06011AC8, NULL, this->jointTable, this->morphTable, 18);
|
||||
gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->objIndices[2]].segment);
|
||||
gSegments[0x06] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->objIndices[2]].segment);
|
||||
Animation_Change(&this->skelAnime, &D_060000FC, 1.0f, 0.0f, Animation_GetLastFrame(&D_060000FC), 0, 0.0f);
|
||||
this->actor.draw = EnSob1_DrawGoronShopkeeper;
|
||||
this->changeObjectFunc = EnSob1_ChangeObject;
|
||||
|
@ -12,7 +12,9 @@ extern UNK_TYPE D_0102A6B0;
|
||||
extern UNK_TYPE D_0102B170;
|
||||
extern UNK_TYPE D_010310F0;
|
||||
extern UNK_TYPE D_010311F0;
|
||||
extern UNK_TYPE D_0E0002E0;
|
||||
|
||||
// there are uses of D_0E000000.fillRect (appearing as D_0E0002E0) in this file
|
||||
extern GfxMasterList D_0E000000;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_file_choose/func_80807940.s")
|
||||
|
||||
|
@ -12,7 +12,9 @@ extern UNK_TYPE D_0102A6B0;
|
||||
extern UNK_TYPE D_0102B170;
|
||||
extern UNK_TYPE D_010310F0;
|
||||
extern UNK_TYPE D_010311F0;
|
||||
extern UNK_TYPE D_0E0002E0;
|
||||
|
||||
// there are uses of D_0E000000.fillRect (appearing as D_0E0002E0) in this file
|
||||
extern GfxMasterList D_0E000000;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_file_choose/func_8080BC20.s")
|
||||
|
||||
|
@ -12,7 +12,9 @@ extern UNK_TYPE D_0102A6B0;
|
||||
extern UNK_TYPE D_0102B170;
|
||||
extern UNK_TYPE D_010310F0;
|
||||
extern UNK_TYPE D_010311F0;
|
||||
extern UNK_TYPE D_0E0002E0;
|
||||
|
||||
// there are uses of D_0E000000.fillRect (appearing as D_0E0002E0) in this file
|
||||
extern GfxMasterList D_0E000000;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_file_choose/func_80804010.s")
|
||||
|
||||
|
@ -455,7 +455,7 @@
|
||||
0x80173360 : "game",
|
||||
0x80173BF0 : "gamealloc",
|
||||
0x80173D30 : "graph",
|
||||
0x80174A40 : "code_80174A40",
|
||||
0x80174A40 : "graphalloc",
|
||||
0x80174AA0 : "listalloc",
|
||||
0x80174BF0 : "main",
|
||||
0x80174F10 : "padmgr",
|
||||
@ -467,7 +467,8 @@
|
||||
0x801795F0 : "sys_math3d",
|
||||
0x8017FEB0 : "sys_math_atan",
|
||||
0x80180160 : "sys_matrix",
|
||||
0x80182CE0 : "sys_ucode",
|
||||
0x80182C90 : "sys_ucode",
|
||||
0x80182CE0 : "",
|
||||
0x80183070 : "code_80183070",
|
||||
0x801830A0 : "c_keyframe",
|
||||
0x80185660 : "sys_slowly",
|
||||
@ -560,7 +561,8 @@
|
||||
0x801D0D80 : "z_play_hireso",
|
||||
0x801D14F0 : "audioMgr",
|
||||
0x801D1500 : "game",
|
||||
0x801D1520 : "graph",
|
||||
0x801D1510 : "graph",
|
||||
0x801D1520 : "main",
|
||||
0x801D1530 : "padmgr",
|
||||
0x801D1540 : "speed_meter",
|
||||
0x801D1570 : "sys_math",
|
||||
|
@ -3135,7 +3135,7 @@
|
||||
0x80173950:("GameState_Init",),
|
||||
0x80173A50:("GameState_Destroy",),
|
||||
0x80173B00:("GameState_GetNextStateInit",),
|
||||
0x80173B0C:("Game_GetNextStateSize",),
|
||||
0x80173B0C:("GameState_GetNextStateSize",),
|
||||
0x80173B18:("GameState_IsRunning",),
|
||||
0x80173B24:("GameState_GetArenaSize",),
|
||||
0x80173B48:("func_80173B48",),
|
||||
@ -3145,16 +3145,16 @@
|
||||
0x80173CC8:("GameAlloc_Cleanup",),
|
||||
0x80173D18:("GameAlloc_Init",),
|
||||
0x80173D30:("Graph_FaultClient",),
|
||||
0x80173DAC:("Graph_DlAlloc",),
|
||||
0x80173DCC:("Graph_InitTHGA",),
|
||||
0x80173DAC:("Graph_InitTHGA",),
|
||||
0x80173DCC:("Graph_SetNextGfxPool",),
|
||||
0x80173F98:("Graph_GetNextGameState",),
|
||||
0x80174060:("Graph_FaultAddrConvFunc",),
|
||||
0x801740D0:("Graph_Init",),
|
||||
0x80174174:("Graph_Destroy",),
|
||||
0x801741A8:("Graph_Render",),
|
||||
0x801744AC:("Graph_FrameSetup",),
|
||||
0x801744F8:("Graph_RenderFrame",),
|
||||
0x80174868:("Graph_DoFrame",),
|
||||
0x801741A8:("Graph_TaskSet00",),
|
||||
0x801744AC:("Graph_UpdateGame",),
|
||||
0x801744F8:("Graph_ExecuteAndDraw",),
|
||||
0x80174868:("Graph_Update",),
|
||||
0x801748A0:("Graph_ThreadEntry",),
|
||||
0x80174A40:("Graph_GfxPlusOne",),
|
||||
0x80174A4C:("Graph_BranchDlist",),
|
||||
@ -3229,8 +3229,8 @@
|
||||
0x80178818:("func_80178818",),
|
||||
0x80178978:("func_80178978",),
|
||||
0x801789D4:("func_801789D4",),
|
||||
0x801789EC:("get_framebuffer",),
|
||||
0x80178A14:("get_zbuffer",),
|
||||
0x801789EC:("SysCfb_GetFbPtr",),
|
||||
0x80178A14:("SysCfb_GetZBuffer",),
|
||||
0x80178A24:("func_80178A24",),
|
||||
0x80178A34:("func_80178A34",),
|
||||
0x80178A94:("func_80178A94",),
|
||||
@ -3393,10 +3393,10 @@
|
||||
0x801822C4:("func_801822C4",),
|
||||
0x801823EC:("Matrix_InsertRotationAroundUnitVector_f",),
|
||||
0x8018284C:("Matrix_InsertRotationAroundUnitVector_s",),
|
||||
0x80182C90:("func_80182C90",),
|
||||
0x80182CA0:("func_80182CA0",),
|
||||
0x80182CBC:("func_80182CBC",),
|
||||
0x80182CCC:("func_80182CCC",),
|
||||
0x80182C90:("SysUcode_GetUCodeBoot",),
|
||||
0x80182CA0:("SysUcode_GetUCodeBootSize",),
|
||||
0x80182CBC:("SysUcode_GetUCode",),
|
||||
0x80182CCC:("SysUcode_GetUCodeData",),
|
||||
0x80182CE0:("func_80182CE0",),
|
||||
0x80183020:("func_80183020",),
|
||||
0x80183058:("func_80183058",),
|
||||
|
@ -2244,8 +2244,6 @@
|
||||
0x801D1504:("gFramerateDivisorF","f32","",0x4),
|
||||
0x801D1508:("gFramerateDivisorHalf","f32","",0x4),
|
||||
0x801D150C:("gFramerateDivisorThird","f32","",0x4),
|
||||
0x801D1510:("D_801D1510","UNK_TYPE4","",0x4),
|
||||
0x801D1514:("D_801D1514","UNK_TYPE4","",0x4),
|
||||
0x801D1520:("gScreenWidth","s32","",0x4),
|
||||
0x801D1524:("gScreenHeight","s32","",0x4),
|
||||
0x801D1528:("startHeapSize","UNK_TYPE4","",0x4),
|
||||
@ -4180,11 +4178,11 @@
|
||||
0x801F8020:("D_801F8020","struct_801F8020","",0x10),
|
||||
0x801F8030:("sMonoColors","VisMono","",0x18),
|
||||
0x801F8048:("D_801F8048","UNK_TYPE1","",0x1),
|
||||
0x801F80D0:("grapgFaultAddrConvClient","FaultAddrConvClient","",0xc),
|
||||
0x801F80E0:("graphFaultClient","FaultClient","",0x10),
|
||||
0x801F80F0:("graphDlEntry","Gfx*","",0x4),
|
||||
0x801F80F8:("D_801F80F8","UNK_TYPE1","",0x1),
|
||||
0x801F8150:("lastRenderFrameTimestamp","u64","",0x8),
|
||||
0x801F80D0:("sGraphFaultAddrConvClient","FaultAddrConvClient","",0xc),
|
||||
0x801F80E0:("sGraphFaultClient","FaultClient","",0x10),
|
||||
0x801F80F0:("gGfxMasterDL","Gfx*","",0x4),
|
||||
0x801F80F8:("sGraphCfbInfos","UNK_TYPE1","",0x1),
|
||||
0x801F8150:("sGraphTaskStartTime","u64","",0x8),
|
||||
0x801F8160:("sSiIntMsgQ","OSMesgQueue","",0x18),
|
||||
0x801F8178:("sSiIntMsgBuf","OSMesg","[1]",0x4),
|
||||
0x801F8180:("gSegments","u32","[16]",0x40),
|
||||
@ -4227,20 +4225,20 @@
|
||||
0x801FBB88:("D_801FBB88","OSViMode*","",0x4),
|
||||
0x801FBB8C:("gZBufferPtr","u16*","",0x4),
|
||||
0x801FBB90:("D_801FBB90","UNK_TYPE4","",0x4),
|
||||
0x801FBB94:("D_801FBB94","UNK_TYPE1","",0x1),
|
||||
0x801FBB98:("D_801FBB98","UNK_TYPE1","",0x1),
|
||||
0x801FBB94:("gGfxSPTaskOutputBufferPtr","UNK_TYPE1","",0x1),
|
||||
0x801FBB98:("gGfxSPTaskOutputBufferSize","UNK_TYPE1","",0x1),
|
||||
0x801FBB9C:("D_801FBB9C","UNK_TYPE1","",0x1),
|
||||
0x801FBBA0:("D_801FBBA0","UNK_TYPE1","",0x1),
|
||||
0x801FBBA4:("sys_cfb_zbufl","u16*","",0x4),
|
||||
0x801FBBA8:("sys_cfb_wbufl","u16**","",0x4),
|
||||
0x801FBBAC:("sys_cfb_fifol","u16**","",0x4),
|
||||
0x801FBBB0:("D_801FBBB0","UNK_TYPE1","",0x1),
|
||||
0x801FBBA4:("gZBuffer","u16*","",0x4),
|
||||
0x801FBBA8:("gWorkBuffer","u16**","",0x4),
|
||||
0x801FBBAC:("gGfxSPTaskOutputBuffer","u16**","",0x4),
|
||||
0x801FBBB0:("gGfxSPTaskOutputBufferEnd","UNK_TYPE1","",0x1),
|
||||
0x801FBBB4:("D_801FBBB4","UNK_TYPE1","",0x1),
|
||||
0x801FBBB8:("D_801FBBB8","UNK_TYPE1","",0x1),
|
||||
0x801FBBBC:("D_801FBBBC","UNK_TYPE1","",0x1),
|
||||
0x801FBBC0:("D_801FBBC0","UNK_TYPE1","",0x1),
|
||||
0x801FBBC4:("D_801FBBC4","UNK_TYPE1","",0x1),
|
||||
0x801FBBC8:("D_801FBBC8","UNK_TYPE1","",0x1),
|
||||
0x801FBBC4:("gGfxSPTaskOutputBuffer2","UNK_TYPE1","",0x1),
|
||||
0x801FBBC8:("gGfxSPTaskOutputBufferEnd2","UNK_TYPE1","",0x1),
|
||||
0x801FBBCC:("D_801FBBCC","UNK_TYPE2","",0x2),
|
||||
0x801FBBCE:("D_801FBBCE","UNK_TYPE2","",0x2),
|
||||
0x801FBBD0:("D_801FBBD0","UNK_TYPE1","",0x1),
|
||||
|
@ -168,8 +168,8 @@ asm/non_matchings/code/z_effect_soft_sprite_old_init/EffectSsIceSmoke_Spawn.s,Ef
|
||||
asm/non_matchings/code/z_effect_soft_sprite_old_init/EffectSsIceBlock_Spawn.s,EffectSsIceBlock_Spawn,0x800B326C,0x19
|
||||
asm/non_matchings/code/flg_set/FlagSet_Update.s,FlagSet_Update,0x800B32D0,0xDD
|
||||
asm/non_matchings/code/flg_set/FlagSet_Draw.s,FlagSet_Draw,0x800B3644,0x8F
|
||||
asm/non_matchings/code/z_DLF/DLF_LoadGameState.s,DLF_LoadGameState,0x800B3880,0x49
|
||||
asm/non_matchings/code/z_DLF/DLF_FreeGameState.s,DLF_FreeGameState,0x800B39A4,0x4B
|
||||
asm/non_matchings/code/z_DLF/Overlay_LoadGameState.s,Overlay_LoadGameState,0x800B3880,0x49
|
||||
asm/non_matchings/code/z_DLF/Overlay_FreeGameState.s,Overlay_FreeGameState,0x800B39A4,0x4B
|
||||
asm/non_matchings/code/z_actor/Actor_PrintLists.s,Actor_PrintLists,0x800B3AD0,0x35
|
||||
asm/non_matchings/code/z_actor/ActorShape_Init.s,ActorShape_Init,0x800B3BA4,0x9
|
||||
asm/non_matchings/code/z_actor/ActorShadow_Draw.s,ActorShadow_Draw,0x800B3BC8,0xFE
|
||||
@ -2646,11 +2646,11 @@ asm/non_matchings/code/game/Game_Update.s,Game_Update,0x8017377C,0x1A
|
||||
asm/non_matchings/code/game/Game_IncrementFrameCount.s,Game_IncrementFrameCount,0x801737E4,0xB
|
||||
asm/non_matchings/code/game/Game_InitHeap.s,Game_InitHeap,0x80173810,0x1C
|
||||
asm/non_matchings/code/game/Game_ResizeHeap.s,Game_ResizeHeap,0x80173880,0x34
|
||||
asm/non_matchings/code/game/Game_StateInit.s,Game_StateInit,0x80173950,0x40
|
||||
asm/non_matchings/code/game/Game_StateFini.s,Game_StateFini,0x80173A50,0x2C
|
||||
asm/non_matchings/code/game/Game_GetNextStateInit.s,Game_GetNextStateInit,0x80173B00,0x3
|
||||
asm/non_matchings/code/game/Game_GetNextStateSize.s,Game_GetNextStateSize,0x80173B0C,0x3
|
||||
asm/non_matchings/code/game/Game_GetShouldContinue.s,Game_GetShouldContinue,0x80173B18,0x3
|
||||
asm/non_matchings/code/game/GameState_Init.s,GameState_Init,0x80173950,0x40
|
||||
asm/non_matchings/code/game/GameState_Destroy.s,GameState_Destroy,0x80173A50,0x2C
|
||||
asm/non_matchings/code/game/GameState_GetNextStateInit.s,GameState_GetNextStateInit,0x80173B00,0x3
|
||||
asm/non_matchings/code/game/GameState_GetNextStateSize.s,GameState_GetNextStateSize,0x80173B0C,0x3
|
||||
asm/non_matchings/code/game/GameState_IsRunning.s,GameState_IsRunning,0x80173B18,0x3
|
||||
asm/non_matchings/code/game/Game_GetHeapFreeSize.s,Game_GetHeapFreeSize,0x80173B24,0x9
|
||||
asm/non_matchings/code/game/func_80173B48.s,func_80173B48,0x80173B48,0x2A
|
||||
asm/non_matchings/code/gamealloc/func_80173BF0.s,func_80173BF0,0x80173BF0,0x8
|
||||
@ -2659,20 +2659,20 @@ asm/non_matchings/code/gamealloc/Gamealloc_Free.s,Gamealloc_Free,0x80173C7C,0x13
|
||||
asm/non_matchings/code/gamealloc/Gamealloc_FreeAll.s,Gamealloc_FreeAll,0x80173CC8,0x14
|
||||
asm/non_matchings/code/gamealloc/Gamealloc_Init.s,Gamealloc_Init,0x80173D18,0x6
|
||||
asm/non_matchings/code/graph/Graph_FaultClient.s,Graph_FaultClient,0x80173D30,0x1F
|
||||
asm/non_matchings/code/graph/Graph_DlAlloc.s,Graph_DlAlloc,0x80173DAC,0x8
|
||||
asm/non_matchings/code/graph/Graph_InitTHGA.s,Graph_InitTHGA,0x80173DCC,0x73
|
||||
asm/non_matchings/code/graph/Graph_InitTHGA.s,Graph_InitTHGA,0x80173DAC,0x8
|
||||
asm/non_matchings/code/graph/Graph_SetNextGfxPool.s,Graph_SetNextGfxPool,0x80173DCC,0x73
|
||||
asm/non_matchings/code/graph/Graph_GetNextGameState.s,Graph_GetNextGameState,0x80173F98,0x32
|
||||
asm/non_matchings/code/graph/Graph_FaultAddrConvFunc.s,Graph_FaultAddrConvFunc,0x80174060,0x1C
|
||||
asm/non_matchings/code/graph/Graph_Init.s,Graph_Init,0x801740D0,0x29
|
||||
asm/non_matchings/code/graph/Graph_Destroy.s,Graph_Destroy,0x80174174,0xD
|
||||
asm/non_matchings/code/graph/Graph_Render.s,Graph_Render,0x801741A8,0xC1
|
||||
asm/non_matchings/code/graph/Graph_FrameSetup.s,Graph_FrameSetup,0x801744AC,0x13
|
||||
asm/non_matchings/code/graph/Graph_RenderFrame.s,Graph_RenderFrame,0x801744F8,0xDC
|
||||
asm/non_matchings/code/graph/Graph_DoFrame.s,Graph_DoFrame,0x80174868,0xE
|
||||
asm/non_matchings/code/graph/Graph_TaskSet00.s,Graph_TaskSet00,0x801741A8,0xC1
|
||||
asm/non_matchings/code/graph/Graph_UpdateGame.s,Graph_UpdateGame,0x801744AC,0x13
|
||||
asm/non_matchings/code/graph/Graph_ExecuteAndDraw.s,Graph_ExecuteAndDraw,0x801744F8,0xDC
|
||||
asm/non_matchings/code/graph/Graph_Update.s,Graph_Update,0x80174868,0xE
|
||||
asm/non_matchings/code/graph/Graph_ThreadEntry.s,Graph_ThreadEntry,0x801748A0,0x68
|
||||
asm/non_matchings/code/code_80174A40/Graph_GfxPlusOne.s,Graph_GfxPlusOne,0x80174A40,0x3
|
||||
asm/non_matchings/code/code_80174A40/Graph_BranchDlist.s,Graph_BranchDlist,0x80174A4C,0x6
|
||||
asm/non_matchings/code/code_80174A40/Graph_DlistAlloc.s,Graph_DlistAlloc,0x80174A64,0xF
|
||||
asm/non_matchings/code/graphalloc/Graph_GfxPlusOne.s,Graph_GfxPlusOne,0x80174A40,0x3
|
||||
asm/non_matchings/code/graphalloc/Graph_BranchDlist.s,Graph_BranchDlist,0x80174A4C,0x6
|
||||
asm/non_matchings/code/graphalloc/Graph_DlistAlloc.s,Graph_DlistAlloc,0x80174A64,0xF
|
||||
asm/non_matchings/code/listalloc/func_80174AA0.s,func_80174AA0,0x80174AA0,0x5
|
||||
asm/non_matchings/code/listalloc/func_80174AB4.s,func_80174AB4,0x80174AB4,0x1B
|
||||
asm/non_matchings/code/listalloc/func_80174B20.s,func_80174B20,0x80174B20,0x20
|
||||
@ -2743,8 +2743,8 @@ asm/non_matchings/code/sys_cmpdma/func_80178750.s,func_80178750,0x80178750,0x32
|
||||
asm/non_matchings/code/sys_cmpdma/func_80178818.s,func_80178818,0x80178818,0x58
|
||||
asm/non_matchings/code/sys_cmpdma/func_80178978.s,func_80178978,0x80178978,0x17
|
||||
asm/non_matchings/code/sys_cmpdma/func_801789D4.s,func_801789D4,0x801789D4,0x6
|
||||
asm/non_matchings/code/sys_cmpdma/get_framebuffer.s,get_framebuffer,0x801789EC,0xA
|
||||
asm/non_matchings/code/sys_cmpdma/get_zbuffer.s,get_zbuffer,0x80178A14,0x4
|
||||
asm/non_matchings/code/sys_cmpdma/SysCfb_GetFbPtr.s,SysCfb_GetFbPtr,0x801789EC,0xA
|
||||
asm/non_matchings/code/sys_cmpdma/SysCfb_GetZBuffer.s,SysCfb_GetZBuffer,0x80178A14,0x4
|
||||
asm/non_matchings/code/sys_cmpdma/func_80178A24.s,func_80178A24,0x80178A24,0x4
|
||||
asm/non_matchings/code/sys_cmpdma/func_80178A34.s,func_80178A34,0x80178A34,0x18
|
||||
asm/non_matchings/code/sys_cmpdma/func_80178A94.s,func_80178A94,0x80178A94,0xB
|
||||
@ -2907,10 +2907,10 @@ asm/non_matchings/code/sys_matrix/func_8018219C.s,func_8018219C,0x8018219C,0x4A
|
||||
asm/non_matchings/code/sys_matrix/func_801822C4.s,func_801822C4,0x801822C4,0x4A
|
||||
asm/non_matchings/code/sys_matrix/Matrix_InsertRotationAroundUnitVector_f.s,Matrix_InsertRotationAroundUnitVector_f,0x801823EC,0x118
|
||||
asm/non_matchings/code/sys_matrix/Matrix_InsertRotationAroundUnitVector_s.s,Matrix_InsertRotationAroundUnitVector_s,0x8018284C,0x111
|
||||
asm/non_matchings/code/sys_matrix/func_80182C90.s,func_80182C90,0x80182C90,0x4
|
||||
asm/non_matchings/code/sys_matrix/func_80182CA0.s,func_80182CA0,0x80182CA0,0x7
|
||||
asm/non_matchings/code/sys_matrix/func_80182CBC.s,func_80182CBC,0x80182CBC,0x4
|
||||
asm/non_matchings/code/sys_matrix/func_80182CCC.s,func_80182CCC,0x80182CCC,0x5
|
||||
asm/non_matchings/code/sys_matrix/SysUcode_GetUCodeBoot.s,SysUcode_GetUCodeBoot,0x80182C90,0x4
|
||||
asm/non_matchings/code/sys_matrix/SysUcode_GetUCodeBootSize.s,SysUcode_GetUCodeBootSize,0x80182CA0,0x7
|
||||
asm/non_matchings/code/sys_matrix/SysUcode_GetUCode.s,SysUcode_GetUCode,0x80182CBC,0x4
|
||||
asm/non_matchings/code/sys_matrix/SysUcode_GetUCodeData.s,SysUcode_GetUCodeData,0x80182CCC,0x5
|
||||
asm/non_matchings/code/sys_ucode/func_80182CE0.s,func_80182CE0,0x80182CE0,0xD0
|
||||
asm/non_matchings/code/sys_ucode/func_80183020.s,func_80183020,0x80183020,0xE
|
||||
asm/non_matchings/code/sys_ucode/func_80183058.s,func_80183058,0x80183058,0x6
|
||||
|
|
@ -4375,6 +4375,9 @@ D_0D003700 = 0x0D003700;
|
||||
|
||||
// segment 0x0E
|
||||
|
||||
D_0E000000 = 0x0E000000;
|
||||
|
||||
// TODO the following are fake and are offsets into the structure at D_0E000000
|
||||
D_0E000048 = 0x0E000048;
|
||||
D_0E000088 = 0x0E000088;
|
||||
D_0E000140 = 0x0E000140;
|
||||
@ -4385,7 +4388,6 @@ D_0E0002B0 = 0x0E0002B0;
|
||||
D_0E0002B8 = 0x0E0002B8;
|
||||
D_0E0002C8 = 0x0E0002C8;
|
||||
D_0E0002E0 = 0x0E0002E0;
|
||||
D_0E0002F8 = 0x0E0002F8;
|
||||
|
||||
// segment 0x0F
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user