summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTakaRikka <38417346+TakaRikka@users.noreply.github.com>2022-01-09 17:33:14 -0800
committerTakaRikka <38417346+TakaRikka@users.noreply.github.com>2022-01-09 17:33:14 -0800
commit37146dfed130ad271f552fc1bbfff4dde7958d53 (patch)
tree26a14703979221daf1a642c9f3726cf7a93dd992 /include
parent035a24092ee91139ab60d41fb5f8b4fb35053281 (diff)
JFramework mostly ok
Diffstat (limited to 'include')
-rw-r--r--include/JSystem/JFramework/JFWDisplay.h53
-rw-r--r--include/JSystem/JFramework/JFWSystem.h28
-rw-r--r--include/JSystem/JUtility/JUTConsole.h18
-rw-r--r--include/JSystem/JUtility/JUTProcBar.h85
-rw-r--r--include/JSystem/JUtility/JUTVideo.h22
-rw-r--r--include/JSystem/JUtility/JUTXfb.h6
-rw-r--r--include/dolphin/gx/GX.h88
-rw-r--r--include/dolphin/os/OS.h21
8 files changed, 278 insertions, 43 deletions
diff --git a/include/JSystem/JFramework/JFWDisplay.h b/include/JSystem/JFramework/JFWDisplay.h
index b7fd742e16..ec61c69e86 100644
--- a/include/JSystem/JFramework/JFWDisplay.h
+++ b/include/JSystem/JFramework/JFWDisplay.h
@@ -2,21 +2,45 @@
#define JFWDISPLAY_H
#include "JSystem/JKernel/JKRHeap.h"
+#include "JSystem/JUtility/JUTDirectPrint.h"
#include "JSystem/JUtility/JUTFader.h"
+#include "JSystem/JUtility/JUTProcBar.h"
#include "JSystem/JUtility/JUTXfb.h"
#include "JSystem/JUtility/TColor.h"
#include "dolphin/gx/GX.h"
#include "dolphin/types.h"
+typedef void (*UnkFunc)(void);
+
+class JFWAlarm : public OSAlarm {
+public:
+ JFWAlarm() : mLink(this) {}
+ ~JFWAlarm() {}
+ void createAlarm() { OSCreateAlarm(this); }
+ void cancelAlarm() { OSCancelAlarm(this); }
+ void removeLink() { sList.remove(&mLink); }
+ void appendLink() { sList.append(&mLink); }
+ OSThread* getThread() const { return mThread; }
+ void setThread(OSThread* thread) { mThread = thread; }
+
+ static JSUList<JFWAlarm> sList;
+
+public:
+ /* 0x28 */ OSThread* mThread;
+ /* 0x2C */ JSULink<JFWAlarm> mLink;
+};
+
class JFWDisplay {
public:
enum EDrawDone {
+ /* 0x0 */ UNK_METHOD_0 = 0,
/* 0x1 */ UNK_METHOD_1 = 1
};
/* 80272040 */ void ctor_subroutine(bool);
/* 802720F8 */ JFWDisplay(JKRHeap*, JUTXfb::EXfbNumber, bool);
- /* 802721DC */ void createManager(_GXRenderModeObj const*, JKRHeap*, JUTXfb::EXfbNumber, bool);
+ /* 802721DC */ static JFWDisplay* createManager(_GXRenderModeObj const*, JKRHeap*,
+ JUTXfb::EXfbNumber, bool);
/* 802722B8 */ void prepareCopyDisp();
/* 802723AC */ void drawendXfb_single();
/* 802723F4 */ void exchangeXfb_double();
@@ -58,23 +82,34 @@ public:
private:
/* 0x04 */ JUTFader* mFader;
/* 0x08 */ JUtility::TColor mClearColor;
- /* 0x0C */ u32 field_0xc;
+ /* 0x0C */ u32 mZClear;
/* 0x10 */ JUTXfb* mXfbManager;
- /* 0x14 */ u16 field_0x14;
+ /* 0x14 */ u16 mGamma;
/* 0x18 */ EDrawDone mDrawDoneMethod;
/* 0x1C */ u16 mFrameRate;
/* 0x20 */ u32 mTickRate;
- /* 0x24 */ bool field_0x24;
+ /* 0x24 */ bool mEnableAlpha;
+ /* 0x26 */ u16 mClamp;
/* 0x28 */ f32 mCombinationRatio;
/* 0x2C */ u32 field_0x2c;
- /* 0x30 */ int field_0x30;
- /* 0x34 */ int field_0x34;
+ /* 0x30 */ u32 field_0x30;
+ /* 0x34 */ u32 field_0x34;
/* 0x38 */ int field_0x38;
/* 0x3C */ int field_0x3c;
- /* 0x40 */ u8 field_0x40;
- /* 0x44 */ int field_0x44;
- /* 0x48 */ u16 field_0x48;
+ /* 0x40 */ bool field_0x40;
+ /* 0x44 */ UnkFunc field_0x44;
+ /* 0x48 */ s16 field_0x48;
/* 0x4A */ u8 field_0x4a;
};
+inline void JUTChangeFrameBuffer(void* buffer, u16 height, u16 width) {
+ JUTDirectPrint::getManager()->changeFrameBuffer(buffer, width, height);
+}
+
+static void JFWDrawDoneAlarm();
+static void JFWThreadAlarmHandler(OSAlarm*, OSContext*);
+static void JFWGXAbortAlarmHandler(OSAlarm*, OSContext*);
+static void waitForTick(u32, u16);
+static void diagnoseGpHang();
+
#endif /* JFWDISPLAY_H */
diff --git a/include/JSystem/JFramework/JFWSystem.h b/include/JSystem/JFramework/JFWSystem.h
index a618ea68f6..b8af555edf 100644
--- a/include/JSystem/JFramework/JFWSystem.h
+++ b/include/JSystem/JFramework/JFWSystem.h
@@ -1,12 +1,16 @@
#ifndef JFWSYSTEM_H
#define JFWSYSTEM_H
+#include "JSystem/JKernel/JKRExpHeap.h"
+#include "JSystem/JKernel/JKRThread.h"
#include "JSystem/JUtility/JUTConsole.h"
+#include "JSystem/JUtility/JUTDbPrint.h"
+#include "JSystem/JUtility/JUTResFont.h"
#include "dolphin/types.h"
struct JFWSystem {
struct CSetUpParam {
- static u32 maxStdHeaps;
+ static s32 maxStdHeaps;
static u32 sysHeapSize;
static u32 fifoBufSize;
static u32 aramAudioBufSize;
@@ -14,22 +18,22 @@ struct JFWSystem {
static u32 streamPriority;
static u32 decompPriority;
static u32 aPiecePriority;
- static void* systemFontRes;
- static void* renderMode;
- static u32 exConsoleBufferSize[1 + 1 /* padding */];
+ static ResFONT* systemFontRes;
+ static GXRenderModeObj* renderMode;
+ static u32 exConsoleBufferSize;
};
- /* 80271CD0 */ void firstInit();
- /* 80271D18 */ void init();
+ /* 80271CD0 */ static void firstInit();
+ /* 80271D18 */ static void init();
static JUTConsole* getSystemConsole() { return systemConsole; }
- static u8 rootHeap[4];
- static u8 systemHeap[4];
- static u8 mainThread[4];
- static u8 debugPrint[4];
- static u8 systemFont[4];
- static u8 systemConsoleManager[4];
+ static JKRExpHeap* rootHeap;
+ static JKRExpHeap* systemHeap;
+ static JKRThread* mainThread;
+ static JUTDbPrint* debugPrint;
+ static JUTResFont* systemFont;
+ static JUTConsoleManager* systemConsoleManager;
static JUTConsole* systemConsole;
};
diff --git a/include/JSystem/JUtility/JUTConsole.h b/include/JSystem/JUtility/JUTConsole.h
index 274e8de7e7..9377bf25fe 100644
--- a/include/JSystem/JUtility/JUTConsole.h
+++ b/include/JSystem/JUtility/JUTConsole.h
@@ -14,6 +14,12 @@ public:
UNK_TYPE2 = 2,
};
+ enum OutputFlag {
+ /* 0x0 */ OUTPUT_NONE,
+ /* 0x1 */ OUTPUT_OSREPORT,
+ /* 0x2 */ OUTPUT_CONSOLE
+ };
+
/* 802E73E4 */ static JUTConsole* create(unsigned int, void*, u32);
/* 802E7354 */ static JUTConsole* create(unsigned int, unsigned int, JKRHeap*);
/* 802E746C */ JUTConsole(unsigned int, unsigned int, bool);
@@ -46,6 +52,11 @@ public:
}
}
+ void setFont(JUTFont* p_font) {
+ mFont = p_font;
+ setFontSize(p_font->getWidth(), p_font->getHeight());
+ }
+
u32 getOutput() const { return mOutput; }
int getPositionY() const { return mPositionY; }
int getPositionX() const { return mPositionX; }
@@ -115,10 +126,13 @@ private:
/* 0x10 */ JUTConsole* mDirectConsole;
}; // Size: 0x14
-void JUTConsole_print_f_va_(JUTConsole*, const char*, va_list);
+extern "C" {
void JUTSetReportConsole(JUTConsole*);
-JUTConsole* JUTGetReportConsole();
void JUTSetWarningConsole(JUTConsole*);
+};
+
+void JUTConsole_print_f_va_(JUTConsole*, const char*, va_list);
+JUTConsole* JUTGetReportConsole();
JUTConsole* JUTGetWarningConsole();
void JUTReportConsole_f_va(const char*, va_list);
void JUTReportConsole_f(const char*, ...);
diff --git a/include/JSystem/JUtility/JUTProcBar.h b/include/JSystem/JUtility/JUTProcBar.h
index 1243be8ee6..79e3b3538d 100644
--- a/include/JSystem/JUtility/JUTProcBar.h
+++ b/include/JSystem/JUtility/JUTProcBar.h
@@ -1,6 +1,91 @@
#ifndef JUTPROCBAR_H
#define JUTPROCBAR_H
+#include "JSystem/JKernel/JKRHeap.h"
+#include "JSystem/JUtility/TColor.h"
#include "dolphin/types.h"
+class JUTProcBar {
+public:
+ class CTime {
+ public:
+ /* 802E7340 */ CTime();
+
+ void start(u8 param_0, u8 param_1, u8 param_2) {
+ field_0x10 = param_0;
+ field_0x11 = param_1;
+ field_0x12 = param_2;
+ mTick = OSGetTick();
+ }
+
+ void end() {
+ field_0x4 = ((OSGetTick() - mTick) * 8) / ((*(u32*)0x800000F8 >> 2) / 125000);
+ if (field_0x4 == 0) {
+ field_0x4 = 1;
+ }
+ }
+
+ /* 0x00 */ u32 mTick;
+ /* 0x04 */ u32 field_0x4;
+ /* 0x08 */ u32 field_0x8;
+ /* 0x0C */ u32 field_0xc;
+ /* 0x10 */ u8 field_0x10;
+ /* 0x11 */ u8 field_0x11;
+ /* 0x12 */ u8 field_0x12;
+ };
+
+ class CParamSet {
+ public:
+ /* 0x00 */ int mBarWidth;
+ /* 0x04 */ int mPosX;
+ /* 0x08 */ int mPosY;
+ /* 0x0C */ int mWidth;
+ /* 0x10 */ int mUserPosition;
+ };
+
+ /* 802E5888 */ JUTProcBar();
+ /* 802E599C */ ~JUTProcBar();
+ /* 802E59E0 */ static void create();
+ /* 802E5A28 */ static void destroy();
+ /* 802E5A60 */ static void clear();
+ /* 802E5B30 */ void bar_subroutine(int, int, int, int, int, int, int, JUtility::TColor,
+ JUtility::TColor);
+ /* 802E5CC4 */ void adjustMeterLength(u32, f32*, f32, f32, int*);
+ /* 802E5E08 */ void draw();
+ /* 802E5E3C */ void drawProcessBar();
+ /* 802E6FA0 */ void drawHeapBar();
+
+ void cpuStart() { mCpu.start(255, 129, 30); }
+ void cpuEnd() { mCpu.end(); }
+ void gpWaitStart() { mGpWait.start(255, 129, 30); }
+ void gpWaitEnd() { mGpWait.end(); }
+ void gpStart() { mGp.start(255, 129, 30); }
+ void gpEnd() { mGp.end(); }
+ void wholeLoopStart() { mWholeLoop.start(255, 129, 30); }
+ void wholeLoopEnd() { mWholeLoop.end(); }
+ void idleStart() { mIdle.start(255, 129, 30); }
+ void idleEnd() { mIdle.end(); }
+ void setCostFrame(int frame) { mCostFrame = frame; }
+
+ static JUTProcBar* getManager() { return sManager; }
+
+ static JUTProcBar* sManager;
+
+private:
+ /* 0x000 */ CTime mIdle;
+ /* 0x014 */ CTime mGp;
+ /* 0x028 */ CTime mCpu;
+ /* 0x03C */ CTime mGpWait;
+ /* 0x050 */ CTime mWholeLoop;
+ /* 0x064 */ CTime field_0x64[8];
+ /* 0x104 */ int mCostFrame;
+ /* 0x108 */ int field_0x108;
+ /* 0x10C */ bool mVisible;
+ /* 0x110 */ int field_0x110;
+ /* 0x114 */ CParamSet field_0x114;
+ /* 0x128 */ int field_0x128;
+ /* 0x12C */ JKRHeap* mWatchHeap;
+ /* 0x130 */ bool mHeapBarVisible;
+};
+
#endif /* JUTPROCBAR_H */
diff --git a/include/JSystem/JUtility/JUTVideo.h b/include/JSystem/JUtility/JUTVideo.h
index 537ee1dcf6..319a8f2c7c 100644
--- a/include/JSystem/JUtility/JUTVideo.h
+++ b/include/JSystem/JUtility/JUTVideo.h
@@ -6,6 +6,8 @@
#include "dolphin/types.h"
#include "dolphin/vi/vi.h"
+typedef u8 (*Pattern)[2];
+
class JUTVideo {
public:
typedef void (*Callback)(u32);
@@ -16,8 +18,8 @@ public:
// TODO: return types not confirmed
/* 802E4C54 */ static JUTVideo* createManager(GXRenderModeObj const*);
/* 802E4CAC */ static void destroyManager();
- /* 802E5088 */ void drawDoneStart();
- /* 802E50B0 */ void dummyNoDrawWait();
+ /* 802E5088 */ static void drawDoneStart();
+ /* 802E50B0 */ static void dummyNoDrawWait();
/* 802E5198 */ void setRenderMode(GXRenderModeObj const*);
/* 802E5210 */ void waitRetraceIfNeed();
@@ -25,10 +27,22 @@ public:
/* 802E5144 */ static void postRetraceProc(u32);
/* 802E50BC */ static void drawDoneCallback();
- u32 getFbWidth() const { return mRenderObj->fb_width; }
- u32 getEfbHeight() const { return mRenderObj->efb_height; }
+ u16 getFbWidth() const { return mRenderObj->fb_width; }
+ u16 getEfbHeight() const { return mRenderObj->efb_height; }
+ void getBounds(u16& width, u16& height) const {
+ width = (u16)getFbWidth();
+ height = (u16)getEfbHeight();
+ }
+ u16 getXfbHeight() const { return mRenderObj->xfb_height; }
+ u32 isAntiAliasing() const { return mRenderObj->antialiasing; }
+ Pattern getSamplePattern() const { return mRenderObj->sample_pattern; }
+ u8* getVFilter() const { return mRenderObj->vfilter; }
+ OSMessageQueue* getMessageQueue() { return &mMessageQueue; }
static JUTVideo* getManager() { return sManager; }
+ static OSTick getVideoInterval() { return sVideoInterval; }
+ static OSTick getVideoLastTick() { return sVideoLastTick; }
+
GXRenderModeObj* getRenderMode() const { return mRenderObj; }
private:
diff --git a/include/JSystem/JUtility/JUTXfb.h b/include/JSystem/JUtility/JUTXfb.h
index 240fb27a08..5d3933cc71 100644
--- a/include/JSystem/JUtility/JUTXfb.h
+++ b/include/JSystem/JUtility/JUTXfb.h
@@ -25,7 +25,7 @@ public:
s32 getBufferNum() const { return mBufferNum; }
s16 getDrawnXfbIndex() const { return mDrawnXfbIndex; }
- s16 getDrawningXfbIndex() const { return mDrawingXfbIndex; }
+ s16 getDrawingXfbIndex() const { return mDrawingXfbIndex; }
s16 getDisplayingXfbIndex() const { return mDisplayingXfbIndex; }
s32 getSDrawingFlag() const { return mSDrawingFlag; }
@@ -35,7 +35,7 @@ public:
return NULL;
}
- void* getDrawningXfb() const {
+ void* getDrawingXfb() const {
if (mDrawingXfbIndex >= 0)
return mBuffer[mDrawingXfbIndex];
return NULL;
@@ -49,6 +49,8 @@ public:
void setDisplayingXfbIndex(s16 index) { mDisplayingXfbIndex = index; }
void setSDrawingFlag(s32 flag) { mSDrawingFlag = flag; }
+ void setDrawnXfbIndex(s16 index) { mDrawnXfbIndex = index; }
+ void setDrawingXfbIndex(s16 index) { mDrawingXfbIndex = index; }
static JUTXfb* getManager() { return sManager; }
diff --git a/include/dolphin/gx/GX.h b/include/dolphin/gx/GX.h
index 157ddaaebb..f1eca18856 100644
--- a/include/dolphin/gx/GX.h
+++ b/include/dolphin/gx/GX.h
@@ -40,7 +40,7 @@ typedef struct _GXRenderModeObj {
u16 vi_height;
s32 xfb_mode;
u8 field_rendering;
- u8 antialiasing;
+ bool antialiasing;
u8 sample_pattern[12][2];
u8 vfilter[7];
} GXRenderModeObj;
@@ -74,6 +74,21 @@ typedef struct _GXFogAdjTable {
/* 0x0 */ u16 r[10];
} GXFogAdjTable;
+typedef struct _GXFifoObj {
+ /* 0x00 */ void* base;
+ /* 0x04 */ u32 end;
+ /* 0x08 */ u32 size;
+ /* 0x0C */ u32 high_wtrmark;
+ /* 0x10 */ u32 low_wtrmark;
+ /* 0x14 */ void* read_ptr;
+ /* 0x18 */ void* write_ptr;
+ /* 0x1C */ void* rw_dst;
+ /* 0x20 */ u8 fifo_wrap;
+ /* 0x21 */ bool cpu_fifo_ready;
+ /* 0x22 */ bool gp_fifo_ready;
+ /* 0x23 */ u8 field_0x23[93];
+} GXFifoObj; // Size: 0x80
+
typedef enum _GXPrimitive {
/* 0x80 */ GX_QUADS = 0x80,
/* 0x90 */ GX_TRIANGLES = 0x90,
@@ -416,9 +431,15 @@ typedef enum _GXTexFmt {
/* 0x8 */ GX_TF_CI8,
/* 0x9 */ GX_TF_CI14,
/* 0xE */ GX_TF_CMPR = 14,
-
/* 0x10 */ _GX_TF_ZTF = 0x10,
- /* 0x20 */ _GX_TF_CTF = 0x20
+ /* 0x11 */ GX_TF_Z8 = (0x1 | _GX_TF_ZTF),
+ /* 0x13 */ GX_TF_Z16 = (0x3 | _GX_TF_ZTF),
+ /* 0x16 */ GX_TF_Z24X8 = (0x6 | _GX_TF_ZTF),
+ /* 0x20 */ _GX_TF_CTF = 0x20,
+ /* 0x30 */ GX_CTF_Z4 = (0x0 | _GX_TF_ZTF | _GX_TF_CTF),
+ /* 0x39 */ GX_CTF_Z8M = (0x9 | _GX_TF_ZTF | _GX_TF_CTF),
+ /* 0x3A */ GX_CTF_Z8L = (0xA | _GX_TF_ZTF | _GX_TF_CTF),
+ /* 0x3C */ GX_CTF_Z16L = (0xC | _GX_TF_ZTF | _GX_TF_CTF),
} GXTexFmt;
typedef enum _GXGamma {
@@ -470,16 +491,6 @@ typedef enum _GXTexFmt8 {
/* 0x2C */ GX_CTF_GB8 = (0xC | _GX_TF_CTF),
} GXTexFmt8;
-typedef enum _GXZTexFmt {
- /* 0x11 */ GX_TF_Z8 = (0x1 | _GX_TF_ZTF),
- /* 0x13 */ GX_TF_Z16 = (0x3 | _GX_TF_ZTF),
- /* 0x16 */ GX_TF_Z24X8 = (0x6 | _GX_TF_ZTF),
- /* 0x30 */ GX_CTF_Z4 = (0x0 | _GX_TF_ZTF | _GX_TF_CTF),
- /* 0x39 */ GX_CTF_Z8M = (0x9 | _GX_TF_ZTF | _GX_TF_CTF),
- /* 0x3A */ GX_CTF_Z8L = (0xA | _GX_TF_ZTF | _GX_TF_CTF),
- /* 0x3C */ GX_CTF_Z16L = (0xC | _GX_TF_ZTF | _GX_TF_CTF),
-} GXZTexFmt;
-
typedef enum _GXTexWrapMode {
/* 0x0 */ GX_CLAMP,
/* 0x1 */ GX_REPEAT,
@@ -816,6 +827,30 @@ typedef struct _GXVtxDescList {
GXAttrType type;
} GXVtxDescList;
+typedef enum _GXFBClamp {
+ /* 0x0 */ GX_CLAMP_NONE,
+ /* 0x1 */ GX_CLAMP_TOP,
+ /* 0x2 */ GX_CLAMP_BOTTOM,
+} GXFBClamp;
+
+typedef enum _GXPixelFmt {
+ /* 0x0 */ GX_PF_RGB8_Z24,
+ /* 0x1 */ GX_PF_RGBA6_Z24,
+ /* 0x2 */ GX_PF_RGB565_Z16,
+ /* 0x3 */ GX_PF_Z24,
+ /* 0x4 */ GX_PF_Y8,
+ /* 0x5 */ GX_PF_U8,
+ /* 0x6 */ GX_PF_V8,
+ /* 0x7 */ GX_PF_YUV420,
+} GXPixelFmt;
+
+typedef enum _GXZFmt16 {
+ /* 0x0 */ GX_ZC_LINEAR,
+ /* 0x1 */ GX_ZC_NEAR,
+ /* 0x2 */ GX_ZC_MID,
+ /* 0x3 */ GX_ZC_FAR,
+} GXZFmt16;
+
extern "C" {
f32 GXGetYScaleFactor(u16 efb_height, u16 xfb_height);
u16 GXGetNumXfbLines(u32 efb_height, f32 y_scale);
@@ -852,6 +887,14 @@ void GXSetDrawDoneCallback(GXDrawDoneCallback);
void GXDrawDone(void);
void GXAbortFrame(void);
void GXFlush(void);
+void GXSetCopyClear(GXColor, u32);
+void GXSetDispCopySrc(u16, u16, u16, u16);
+void GXSetDispCopyDst(u16, u16);
+u32 GXSetDispCopyYScale(f32);
+void GXSetCopyClamp(GXFBClamp);
+void GXSetDispCopyGamma(GXGamma);
+void GXCopyDisp(void*, GXBool);
+void GXSetPixelFmt(GXPixelFmt, GXZFmt16);
struct OSThread;
OSThread* GXSetCurrentGXThread(void);
@@ -898,7 +941,7 @@ void GXSetTexCopySrc(u16, u16, u16, u16);
void GXSetViewport(f32, f32, f32, f32, f32, f32);
void GXSetZCompLoc(GXBool);
void GXSetZMode(GXBool, GXCompare, GXBool);
-void GXSetZTexture(GXZTexOp, GXZTexFmt, u32);
+void GXSetZTexture(GXZTexOp, GXTexFmt, u32);
void GXSetPointSize(u8, GXTexOffset);
void GXSetLineWidth(u8, GXTexOffset);
void GXSetTevDirect(GXTevStageID);
@@ -909,6 +952,13 @@ void GXSetIndTexMtx(GXIndTexMtxID, Mtx23, s8);
void GXSetIndTexCoordScale(GXIndTexStageID, GXIndTexScale, GXIndTexScale);
void GXSetIndTexOrder(GXIndTexStageID, GXTexCoordID, GXTexMapID);
void GXEnableTexOffsets(GXTexCoordID, GXBool, GXBool);
+void GXSetDstAlpha(GXBool, u8);
+u32 GXGetFifoSize(GXFifoObj*);
+void* GXGetFifoBase(GXFifoObj*);
+GXFifoObj* GXInit(void*, u32);
+GXFifoObj* GXGetCPUFifo(void);
+void GXGetGPStatus(GXBool*, GXBool*, GXBool*, GXBool*, GXBool*);
+void GXReadXfRasMetric(u32*, u32*, u32*, u32*);
#define GFX_FIFO(T) (*(volatile T*)0xCC008000)
@@ -927,6 +977,16 @@ inline void GXTexCoord2f32(f32 s, f32 t) {
GFX_FIFO(f32) = t;
}
+inline void GXTexCoord2u8(u8 s, u8 t) {
+ GFX_FIFO(u8) = s;
+ GFX_FIFO(u8) = t;
+}
+
+inline void GXPosition2u16(u16 x, u16 y) {
+ GFX_FIFO(u16) = x;
+ GFX_FIFO(u16) = y;
+}
+
inline void GXEnd() {}
};
diff --git a/include/dolphin/os/OS.h b/include/dolphin/os/OS.h
index 7c94ec7bf0..b30dbbdf3a 100644
--- a/include/dolphin/os/OS.h
+++ b/include/dolphin/os/OS.h
@@ -131,6 +131,23 @@ struct OSThread {
void* data[2];
};
+struct OSAlarm;
+struct OSAlarmLink {
+ /* 0x0 */ OSAlarm* prev;
+ /* 0x4 */ OSAlarm* next;
+};
+
+typedef void (*OSAlarmHandler)(OSAlarm*, OSContext*);
+
+struct OSAlarm {
+ /* 0x00 */ OSAlarmHandler handler;
+ /* 0x04 */ u32 tag;
+ /* 0x08 */ OSTime fire_time;
+ /* 0x10 */ OSAlarmLink link;
+ /* 0x18 */ OSTime period_time;
+ /* 0x20 */ OSTime start_time;
+}; // Size: 0x28
+
extern "C" {
s32 OSEnableScheduler(void);
s32 OSDisableScheduler(void);
@@ -205,6 +222,10 @@ void LCDisable(void);
void OSReportInit__Fv(void); // needed for inline asm
u8* OSGetStackPointer(void);
+
+void OSCreateAlarm(OSAlarm*);
+void OSCancelAlarm(OSAlarm*);
+void OSSetAlarm(OSAlarm*, OSTime, OSAlarmHandler);
}; // extern "C"
void OSSwitchFiberEx(u32, u32, u32, u32, u32, u32);