summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJulgodis <>2021-09-24 17:51:55 +0200
committerJulgodis <>2021-09-26 03:38:03 +0200
commitbb8d99313bb8b2ed0458ac421d19ad5dfe7167de (patch)
tree69eebed33fa4c53057871d13c40b77a1cbdbf9e1 /include
parentb3b3215f322193ad5741a9f451391b3c9ff00278 (diff)
Added TColor.h
Diffstat (limited to 'include')
-rw-r--r--include/JSystem/JUtility/JUTDirectPrint.h44
-rw-r--r--include/JSystem/JUtility/TColor.h39
-rw-r--r--include/dolphin/types.h2
3 files changed, 85 insertions, 0 deletions
diff --git a/include/JSystem/JUtility/JUTDirectPrint.h b/include/JSystem/JUtility/JUTDirectPrint.h
index d805d9cb82..b9b1fbef21 100644
--- a/include/JSystem/JUtility/JUTDirectPrint.h
+++ b/include/JSystem/JUtility/JUTDirectPrint.h
@@ -2,5 +2,49 @@
#define JUTDIRECTPRINT_H
#include "dolphin/types.h"
+#include "JSystem/JUtility/TColor.h"
+
+struct base_process_class {};
+
+struct __va_list_struct {};
+
+class JUTDirectPrint {
+public:
+ /* 802E41E8 */ JUTDirectPrint();
+ /* 802E4240 */ void start();
+ /* 802E4288 */ void erase(int, int, int, int);
+ /* 802E431C */ void drawChar(int, int, int);
+ /* 802E456C */ void changeFrameBuffer(void*, u16, u16);
+ /* 802E45A4 */ void printSub(u16, u16, char const*, __va_list_struct*, bool);
+ /* 802E46D8 */ void drawString(u16, u16, char*);
+ /* 802E4708 */ void drawString_f(u16, u16, char const*, ...);
+ /* 802E47C8 */ void setCharColor(u8, u8, u8);
+ /* 802E4798 */ void setCharColor(JUtility::TColor);
+
+ static u8 sAsciiTable[128];
+ static void* sFontData[64];
+ static void* sFontData2[77];
+ static u8 sDirectPrint[4 + 4 /* padding */];
+
+private:
+ /* 0x00 */ void* field_0x00;
+ /* 0x04 */ u16 mFrameBufferWidth;
+ /* 0x06 */ u16 mFrameBufferHeight;
+ /* 0x08 */ u16 field_0x08;
+ /* 0x0A */ u16 field_0x0A;
+ /* 0x0C */ size_t field_0x0C;
+ /* 0x10 */ u8 field_0x10[4];
+ /* 0x14 */ void* mFrameBuffer;
+ /* 0x18 */ JUtility::TColor mCharColor;
+ /* 0x1C */ u16 field_0x1C;
+ /* 0x1E */ u16 field_0x1E;
+ /* 0x20 */ u16 field_0x20;
+ /* 0x22 */ u16 field_0x22;
+ /* 0x24 */ u16 field_0x24;
+ /* 0x26 */ u16 field_0x26;
+ /* 0x28 */ u16 field_0x28;
+ /* 0x2A */ u16 field_0x2A;
+ /* 0x2C */
+};
#endif /* JUTDIRECTPRINT_H */
diff --git a/include/JSystem/JUtility/TColor.h b/include/JSystem/JUtility/TColor.h
new file mode 100644
index 0000000000..19719d2fd8
--- /dev/null
+++ b/include/JSystem/JUtility/TColor.h
@@ -0,0 +1,39 @@
+#ifndef TCOLOR_H
+#define TCOLOR_H
+
+#include "dolphin/gx/GXTexture.h"
+#include "dolphin/types.h"
+
+namespace JUtility {
+class TColor {
+public:
+ TColor(u8 r, u8 g, u8 b, u8 a) { set(r, g, b, a); }
+ TColor() { set(0xffffffff); }
+ TColor(u32 u32Color) { set(u32Color); }
+ TColor(_GXColor gxColor) { set(gxColor); }
+
+ TColor(const TColor& other) { *this = other; }
+ TColor& operator=(const TColor& other) {
+ mColor = other.mColor;
+ return *this;
+ }
+
+ operator u32() { return toUInt32(); }
+ u32 toUInt32() { return *(u32*)&mColor; }
+
+ void set(u8 cR, u8 cG, u8 cB, u8 cA) {
+ mColor.r = cR;
+ mColor.g = cG;
+ mColor.b = cB;
+ mColor.a = cA;
+ }
+
+ void set(u32 u32Color) { *(u32*)&mColor = u32Color; }
+ void set(_GXColor gxColor) { mColor = gxColor; }
+
+private:
+ _GXColor mColor;
+};
+} // namespace JUtility
+
+#endif \ No newline at end of file
diff --git a/include/dolphin/types.h b/include/dolphin/types.h
index 87de0f1133..0144f699a6 100644
--- a/include/dolphin/types.h
+++ b/include/dolphin/types.h
@@ -26,6 +26,8 @@ typedef volatile f64 vf64;
typedef int BOOL;
+typedef unsigned long size_t;
+
#define TRUE 1
#define FALSE 0