Fix compile errors.

This commit is contained in:
James Benton 2016-01-08 08:52:12 -08:00
parent 05149e41ad
commit f9123fa460
16 changed files with 86 additions and 25 deletions

View File

@ -111,7 +111,7 @@ CHECK_OFFSET(OSAlarm, 0x10, group);
CHECK_OFFSET(OSAlarm, 0x18, nextFire);
CHECK_OFFSET(OSAlarm, 0x20, link);
CHECK_OFFSET(OSAlarm, 0x28, period);
CHECK_OFFSET(OSAlarm, 0x30, tbrStart);
CHECK_OFFSET(OSAlarm, 0x30, start);
CHECK_OFFSET(OSAlarm, 0x38, userData);
CHECK_OFFSET(OSAlarm, 0x3c, state);
CHECK_OFFSET(OSAlarm, 0x40, threadQueue);

View File

@ -56,8 +56,6 @@ CHECK_OFFSET(OSEvent, 0x10, queue);
CHECK_OFFSET(OSEvent, 0x20, mode);
CHECK_SIZE(OSEvent, 0x24);
#pragma pack(pop)
/**
* Initialise an event object with value and mode.

View File

@ -11,7 +11,6 @@
extern "C" {
#endif
typedef uint32_t OSExceptionType;
typedef BOOL (*OSExceptionCallbackFn)(OSContext *context);
typedef enum OSExceptionType

View File

@ -17,6 +17,13 @@ typedef enum MEMFrameHeapFreeMode
MEM_FRAME_HEAP_FREE_FROM_TOP = 1 << 1,
} MEMFrameHeapFreeMode;
typedef struct MEMFrameHeap MEMFrameHeap;
struct MEMFrameHeap
{
};
UNKNOWN_SIZE(MEMFrameHeap);
MEMFrameHeap *
MEMCreateFrmHeap(MEMFrameHeap *heap,
uint32_t size);

View File

@ -11,15 +11,18 @@
extern "C" {
#endif
typedef struct MEMMemoryLink MEMMemoryLink;
typedef struct MEMMemoryList MEMMemoryList;
struct MEMMemoryLink
{
void *prev;
void *next;
};
CHECK_OFFSET(MemoryLink, 0x0, prev);
CHECK_OFFSET(MemoryLink, 0x4, next);
CHECK_SIZE(MemoryLink, 0x8);
CHECK_OFFSET(MEMMemoryLink, 0x0, prev);
CHECK_OFFSET(MEMMemoryLink, 0x4, next);
CHECK_SIZE(MEMMemoryLink, 0x8);
struct MEMMemoryList
{
@ -64,7 +67,7 @@ MEMGetPrevListObject(MEMMemoryList *list,
void *object);
void *
MEMGetNthListObject(MEMMEMMemoryList *list,
MEMGetNthListObject(MEMMemoryList *list,
uint16_t n);
#ifdef __cplusplus

View File

@ -11,6 +11,9 @@
extern "C" {
#endif
typedef struct OSMessage OSMessage;
typedef struct OSMessageQueue OSMessageQueue;
typedef enum OSMessageFlags
{
OS_MESSAGE_QUEUE_BLOCKING = 1 << 0,
@ -50,8 +53,6 @@ CHECK_OFFSET(OSMessageQueue, 0x34, first);
CHECK_OFFSET(OSMessageQueue, 0x38, used);
CHECK_SIZE(OSMessageQueue, 0x3c);
#pragma pack(pop)
void
OSInitMessageQueue(OSMessageQueue *queue,
OSMessage *messages,

View File

@ -16,9 +16,8 @@
extern "C" {
#endif
typedef struct OSThread;
typedef struct OSThread OSThread;
typedef struct OSCondition OSCondition;
typedef struct OSMutex OSMutex;
typedef struct OSMutexLink OSMutexLink;

View File

@ -21,8 +21,6 @@ struct OSRendezvous
CHECK_OFFSET(OSRendezvous, 0x00, core);
CHECK_SIZE(OSRendezvous, 0x10);
#pragma pack(pop)
void
OSInitRendezvous(OSRendezvous *rendezvous);

View File

@ -25,8 +25,6 @@ CHECK_OFFSET(OSSpinLock, 0x0, owner);
CHECK_OFFSET(OSSpinLock, 0x8, recursion);
CHECK_SIZE(OSSpinLock, 0x10);
#pragma pack(pop)
void
OSInitSpinLock(OSSpinLock *spinlock);

View File

@ -21,12 +21,22 @@ typedef uint32_t (*MPTaskFunc)(uint32_t, uint32_t);
typedef enum MPTaskState
{
MP_TASK_STATE_INITIALISED = 1 << 0,
MP_TASK_STATE_READY = 1 << 1,
MP_TASK_STATE_RUNNING = 1 << 2,
MP_TASK_STATE_FINISHED = 1 << 3,
MP_TASK_STATE_INITIALISED = 1 << 0,
MP_TASK_STATE_READY = 1 << 1,
MP_TASK_STATE_RUNNING = 1 << 2,
MP_TASK_STATE_FINISHED = 1 << 3,
} MPTaskState;
typedef enum MPTaskQueueState
{
MP_TASK_QUEUE_STATE_INITIALISED = 1 << 0,
MP_TASK_QUEUE_STATE_READY = 1 << 1,
MP_TASK_QUEUE_STATE_STOPPING = 1 << 2,
MP_TASK_QUEUE_STATE_STOPPED = 1 << 3,
MP_TASK_QUEUE_STATE_FINISHED = 1 << 4,
} MPTaskQueueState;
#pragma pack(push, 1)
struct MPTaskInfo
{
MPTaskState state;
@ -34,12 +44,14 @@ struct MPTaskInfo
uint32_t coreID;
OSTime duration;
};
#pragma pack(pop)
CHECK_OFFSET(MPTaskInfo, 0x00, state);
CHECK_OFFSET(MPTaskInfo, 0x04, result);
CHECK_OFFSET(MPTaskInfo, 0x08, coreID);
CHECK_OFFSET(MPTaskInfo, 0x0C, duration);
CHECK_SIZE(MPTaskInfo, 0x14);
#pragma pack(push, 1)
struct MPTask
{
MPTask *self;
@ -53,6 +65,7 @@ struct MPTask
OSTime duration;
void *userData;
};
#pragma pack(pop)
CHECK_OFFSET(MPTask, 0x00, self);
CHECK_OFFSET(MPTask, 0x04, queue);
CHECK_OFFSET(MPTask, 0x08, state);

View File

@ -11,6 +11,9 @@
extern "C" {
#endif
typedef struct GX2ShadowState GX2ShadowState;
typedef struct GX2ContextState GX2ContextState;
struct GX2ShadowState
{
uint32_t config[0xB00];

View File

@ -12,6 +12,8 @@
extern "C" {
#endif
typedef struct GX2DisplayListOverrunData GX2DisplayListOverrunData;
typedef enum GX2EventType
{
GX2_EVENT_TYPE_VSYNC = 2,

View File

@ -1,8 +1,9 @@
#pragma once
#include <wut.h>
#include "surface.h"
/**
* \defgroup gx2_displaylist Display List
* \defgroup gx2_registers Registers
* \ingroup gx2
* @{
*/
@ -11,6 +12,23 @@
extern "C" {
#endif
typedef struct GX2AAMaskReg GX2AAMaskReg;
typedef struct GX2AlphaTestReg GX2AlphaTestReg;
typedef struct GX2AlphaToMaskReg GX2AlphaToMaskReg;
typedef struct GX2BlendControlReg GX2BlendControlReg;
typedef struct GX2BlendConstantColorReg GX2BlendConstantColorReg;
typedef struct GX2ColorControlReg GX2ColorControlReg;
typedef struct GX2DepthStencilControlReg GX2DepthStencilControlReg;
typedef struct GX2StencilMaskReg GX2StencilMaskReg;
typedef struct GX2LineWidthReg GX2LineWidthReg;
typedef struct GX2PointSizeReg GX2PointSizeReg;
typedef struct GX2PointLimitsReg GX2PointLimitsReg;
typedef struct GX2PolygonControlReg GX2PolygonControlReg;
typedef struct GX2PolygonOffsetReg GX2PolygonOffsetReg;
typedef struct GX2ScissorReg GX2ScissorReg;
typedef struct GX2TargetChannelMaskReg GX2TargetChannelMaskReg;
typedef struct GX2ViewportReg GX2ViewportReg;
typedef enum GX2CompareFunction
{
GX2_COMPARE_FUNC_NEVER = 0,
@ -64,6 +82,12 @@ typedef enum GX2BlendCombineMode
GX2_BLEND_COMBINE_MODE_REV_SUB = 4,
} GX2BlendCombineMode;
typedef enum GX2FrontFace
{
GX2_FRONT_FACE_CCW = 0,
GX2_FRONT_FACE_CW = 1,
} GX2FrontFace;
typedef enum GX2LogicOp
{
GX2_LOGIC_OP_CLEAR = 0x00,
@ -219,8 +243,6 @@ struct GX2ViewportReg
};
CHECK_SIZE(GX2ViewportReg, 48);
#pragma pack(pop)
void
GX2SetAAMask(uint8_t upperLeft,
uint8_t upperRight,

View File

@ -11,6 +11,8 @@
extern "C" {
#endif
typedef struct GX2Sampler GX2Sampler;
struct GX2Sampler
{
uint32_t regs[3];
@ -66,6 +68,7 @@ typedef enum GX2TexZFilterMode
typedef enum GX2TexZPerfMode
{
GX2_TEX_Z_PERF_MODE_DISABLED = 0,
} GX2TexZPerfMode;
typedef enum GX2RoundingMode

View File

@ -11,6 +11,10 @@
extern "C" {
#endif
typedef struct GX2Surface GX2Surface;
typedef struct GX2DepthBuffer GX2DepthBuffer;
typedef struct GX2ColorBuffer GX2ColorBuffer;
typedef enum
{
GX2_SURFACE_DIM_TEXTURE_1D = 0,
@ -157,6 +161,17 @@ typedef enum GX2TileMode
GX2_TILE_MODE_LINEAR_SPECIAL = 16,
} GX2TileMode;
typedef enum GX2RenderTarget
{
GX2_RENDER_TARGET_0 = 0,
GX2_RENDER_TARGET_1 = 1,
GX2_RENDER_TARGET_2 = 2,
GX2_RENDER_TARGET_3 = 3,
GX2_RENDER_TARGET_4 = 4,
GX2_RENDER_TARGET_5 = 5,
GX2_RENDER_TARGET_6 = 6,
} GX2RenderTarget;
struct GX2Surface
{
GX2SurfaceDim dim;

View File

@ -12,6 +12,8 @@
extern "C" {
#endif
typedef struct GX2Texture GX2Texture;
struct GX2Texture
{
GX2Surface surface;
@ -32,8 +34,6 @@ CHECK_OFFSET(GX2Texture, 0x84, compMap);
CHECK_OFFSET(GX2Texture, 0x88, regs);
CHECK_SIZE(GX2Texture, 0x9c);
#pragma pack(pop)
void
GX2InitTextureRegs(GX2Texture *texture);