summaryrefslogtreecommitdiff
path: root/include/JSystem/JFramework
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/JSystem/JFramework
parent035a24092ee91139ab60d41fb5f8b4fb35053281 (diff)
JFramework mostly ok
Diffstat (limited to 'include/JSystem/JFramework')
-rw-r--r--include/JSystem/JFramework/JFWDisplay.h53
-rw-r--r--include/JSystem/JFramework/JFWSystem.h28
2 files changed, 60 insertions, 21 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;
};