mirror of
https://github.com/zeldaret/tww.git
synced 2026-09-07 02:59:59 -04:00
@@ -0,0 +1,30 @@
|
||||
#ifndef JUTASSERT_H
|
||||
#define JUTASSERT_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/os/OS.h"
|
||||
|
||||
#define JUT_ASSERT(FILE, LINE, COND) \
|
||||
if (!(COND)) { \
|
||||
JUTAssertion::showAssert(JUTAssertion::getSDevice(), FILE, LINE, #COND); \
|
||||
OSPanic(FILE, LINE, "Halt"); \
|
||||
}
|
||||
|
||||
#define JUT_PANIC(FILE, LINE, TEXT) \
|
||||
JUTAssertion::showAssert(JUTAssertion::getSDevice(), FILE, LINE, TEXT); \
|
||||
OSPanic(FILE, LINE, "Halt");
|
||||
|
||||
namespace JUTAssertion {
|
||||
u32 getSDevice();
|
||||
void showAssert(u32 device, const char * file, int line, const char * assertion);
|
||||
void create();
|
||||
u32 flush_subroutine();
|
||||
void flushMessage();
|
||||
void flushMessage_dbPrint();
|
||||
void setVisible(bool);
|
||||
void setMessageCount(int);
|
||||
};
|
||||
|
||||
extern bool sAssertVisible;
|
||||
|
||||
#endif /* JUTASSERT_H */
|
||||
@@ -0,0 +1,80 @@
|
||||
#ifndef JUTCACHEFONT_H
|
||||
#define JUTCACHEFONT_H
|
||||
|
||||
#include "JSystem/JUtility/JUTResFont.h"
|
||||
#include "global.h"
|
||||
|
||||
class JKRAramBlock;
|
||||
|
||||
class JUTCacheFont : public JUTResFont {
|
||||
public:
|
||||
struct TGlyphCacheInfo {
|
||||
/* 0x0 */ TGlyphCacheInfo* mPrev;
|
||||
/* 0x4 */ TGlyphCacheInfo* mNext;
|
||||
};
|
||||
|
||||
struct TCachePage {
|
||||
/* 0x00 */ u8 field_0x0[8];
|
||||
/* 0x08 */ s16 field_0x8;
|
||||
/* 0x0A */ u16 field_0xa;
|
||||
/* 0x0C */ u8 field_0xc[4];
|
||||
/* 0x10 */ u8* field_0x10;
|
||||
/* 0x14 */ u16 field_0x14;
|
||||
/* 0x16 */ u16 field_0x16;
|
||||
/* 0x18 */ u16 field_0x18;
|
||||
/* 0x1A */ u16 field_0x1a;
|
||||
/* 0x1C */ u16 field_0x1c;
|
||||
/* 0x1E */ u16 field_0x1e;
|
||||
}; // Size: 0x20
|
||||
|
||||
enum EPagingType {
|
||||
PAGE_TYPE_0,
|
||||
PAGE_TYPE_1,
|
||||
};
|
||||
|
||||
/* 802DD188 */ JUTCacheFont(ResFONT const*, u32, JKRHeap*);
|
||||
/* 802DD29C */ void deleteMemBlocks_CacheFont();
|
||||
/* 802DD320 */ void initialize_state();
|
||||
/* 802DD35C */ int getMemorySize(ResFONT const*, u16*, u32*, u16*, u32*, u16*, u32*, u32*);
|
||||
/* 802DD4EC */ int initiate(ResFONT const*, void*, u32, JKRHeap*);
|
||||
/* 802DD54C */ bool internal_initiate(ResFONT const*, void*, u32, JKRHeap*);
|
||||
/* 802DD650 */ bool allocArea(void*, u32, JKRHeap*);
|
||||
/* 802DD804 */ bool allocArray(JKRHeap*);
|
||||
/* 802DDB0C */ void determineBlankPage();
|
||||
/* 802DDBBC */ void getGlyphFromAram(JUTCacheFont::TGlyphCacheInfo*, JUTCacheFont::TCachePage*,
|
||||
int*, int*);
|
||||
/* 802DDD98 */ void loadCache_char_subroutine(int*, bool);
|
||||
/* 802DDEE0 */ void invalidiateAllCache();
|
||||
/* 802DDF68 */ void unlink(JUTCacheFont::TGlyphCacheInfo*);
|
||||
/* 802DDFAC */ void prepend(JUTCacheFont::TGlyphCacheInfo*);
|
||||
|
||||
/* 802DD208 */ virtual ~JUTCacheFont();
|
||||
/* 802DDCE4 */ virtual void loadImage(int, _GXTexMapID);
|
||||
/* 802DD8EC */ virtual void setBlock();
|
||||
|
||||
void setPagingType(EPagingType type) { mPagingType = type; }
|
||||
|
||||
static u32 calcCacheSize(u32 param_0, int param_1) { return (ALIGN_NEXT(param_0, 0x20) + 0x40) * param_1; }
|
||||
|
||||
private:
|
||||
/* 0x70 */ u32 mTotalWidSize;
|
||||
/* 0x74 */ u32 mTotalGlySize;
|
||||
/* 0x78 */ u32 mTotalMapSize;
|
||||
/* 0x7C */ void* field_0x7c;
|
||||
/* 0x80 */ void* field_0x80;
|
||||
/* 0x84 */ void* field_0x84;
|
||||
/* 0x88 */ u32 mMaxSheetSize;
|
||||
/* 0x8C */ EPagingType mPagingType;
|
||||
/* 0x90 */ void* mCacheBuffer;
|
||||
/* 0x94 */ int field_0x94;
|
||||
/* 0x98 */ u32 mCachePage;
|
||||
/* 0x9C */ TGlyphCacheInfo* field_0x9c;
|
||||
/* 0xA0 */ TGlyphCacheInfo* field_0xa0;
|
||||
/* 0xA4 */ void* field_0xa4;
|
||||
/* 0xA8 */ u32 field_0xa8;
|
||||
/* 0xAC */ JKRAramBlock* field_0xac;
|
||||
/* 0xB0 */ u8 field_0xb0;
|
||||
/* 0xB4 */ int field_0xb4;
|
||||
}; // Size: 0xB8
|
||||
|
||||
#endif /* JUTCACHEFONT_H */
|
||||
@@ -0,0 +1,153 @@
|
||||
#ifndef JUTCONSOLE_H
|
||||
#define JUTCONSOLE_H
|
||||
|
||||
#include "JSystem/JGadget/linklist.h"
|
||||
#include "JSystem/JKernel/JKRDisposer.h"
|
||||
#include "JSystem/JUtility/JUTFont.h"
|
||||
#include "Runtime.PPCEABI.H/__va_arg.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
class JUTConsole : public JKRDisposer {
|
||||
public:
|
||||
enum EConsoleType {
|
||||
CONSOLE_TYPE_0 = 0,
|
||||
CONSOLE_TYPE_1 = 1,
|
||||
CONSOLE_TYPE_2 = 2,
|
||||
};
|
||||
|
||||
enum OutputFlag {
|
||||
/* 0x0 */ OUTPUT_NONE,
|
||||
/* 0x1 */ OUTPUT_OSREPORT,
|
||||
/* 0x2 */ OUTPUT_CONSOLE,
|
||||
/* 0x3 */ OUTPUT_OSR_AND_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);
|
||||
/* 802E75CC */ static size_t getObjectSizeFromBufferSize(unsigned int, unsigned int);
|
||||
/* 802E75DC */ static size_t getLineFromObjectSize(u32, unsigned int);
|
||||
/* 802E75EC */ void clear();
|
||||
/* 802E7648 */ void doDraw(JUTConsole::EConsoleType) const;
|
||||
/* 802E7BB8 */ void print_f(char const*, ...);
|
||||
/* 802E7C38 */ void print(char const*);
|
||||
/* 802E7F7C */ void dumpToTerminal(unsigned int);
|
||||
/* 802E80A8 */ void scroll(int);
|
||||
/* 802E8184 */ int getUsedLine() const;
|
||||
/* 802E81A8 */ int getLineOffset() const;
|
||||
|
||||
/* 802E755C */ virtual ~JUTConsole();
|
||||
|
||||
void setOutput(unsigned int output) { mOutput = output; }
|
||||
void setPosition(int x, int y) {
|
||||
mPositionX = x;
|
||||
mPositionY = y;
|
||||
}
|
||||
void setFontSize(f32 x, f32 y) {
|
||||
mFontSizeX = x;
|
||||
mFontSizeY = y;
|
||||
}
|
||||
void setHeight(u32 height) {
|
||||
mHeight = height;
|
||||
if (mHeight > mMaxLines) {
|
||||
mHeight = mMaxLines;
|
||||
}
|
||||
}
|
||||
|
||||
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; }
|
||||
u32 getHeight() const { return mHeight; }
|
||||
|
||||
bool isVisible() const { return mVisible; }
|
||||
void setVisible(bool visible) { mVisible = visible; }
|
||||
|
||||
void setLineAttr(int param_0, u8 param_1) { mBuf[(field_0x20 + 2) * param_0] = param_1; }
|
||||
u8* getLinePtr(int param_0) const { return &mBuf[(field_0x20 + 2) * param_0] + 1; }
|
||||
int diffIndex(int param_0, int param_1) const {
|
||||
int diff = param_1 - param_0;
|
||||
if (diff >= 0) {
|
||||
return diff;
|
||||
}
|
||||
return diff += mMaxLines;
|
||||
}
|
||||
|
||||
int nextIndex(int param_0) const {
|
||||
int index = param_0 + 1;
|
||||
if (mMaxLines <= index) {
|
||||
index = 0;
|
||||
}
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
void scrollToLastLine() { scroll(mMaxLines); }
|
||||
void scrollToFirstLine() { scroll(-mMaxLines); }
|
||||
|
||||
private:
|
||||
/* 0x18 */ JGadget::TLinkListNode mListNode;
|
||||
|
||||
private:
|
||||
/* 0x20 */ u32 field_0x20;
|
||||
/* 0x24 */ u32 mMaxLines;
|
||||
/* 0x28 */ u8* mBuf;
|
||||
/* 0x2C */ bool field_0x2c;
|
||||
/* 0x30 */ int field_0x30;
|
||||
/* 0x34 */ int field_0x34;
|
||||
/* 0x38 */ int field_0x38;
|
||||
/* 0x3C */ int field_0x3c;
|
||||
/* 0x40 */ int mPositionX;
|
||||
/* 0x44 */ int mPositionY;
|
||||
/* 0x48 */ u32 mHeight;
|
||||
/* 0x4C */ JUTFont* mFont;
|
||||
/* 0x50 */ f32 mFontSizeX;
|
||||
/* 0x54 */ f32 mFontSizeY;
|
||||
/* 0x58 */ int mOutput;
|
||||
/* 0x5C */ JUtility::TColor field_0x5c;
|
||||
/* 0x60 */ JUtility::TColor field_0x60;
|
||||
/* 0x64 */ int field_0x64;
|
||||
/* 0x68 */ bool mVisible;
|
||||
/* 0x69 */ bool field_0x69;
|
||||
/* 0x6A */ bool field_0x6a;
|
||||
/* 0x6B */ bool field_0x6b;
|
||||
}; // Size: 0x6C
|
||||
|
||||
class JUTConsoleManager {
|
||||
public:
|
||||
/* 802E81CC */ JUTConsoleManager();
|
||||
/* 802E81F4 */ static JUTConsoleManager* createManager(JKRHeap*);
|
||||
/* 802E8240 */ void appendConsole(JUTConsole*);
|
||||
/* 802E82B0 */ void removeConsole(JUTConsole*);
|
||||
/* 802E8384 */ void draw() const;
|
||||
/* 802E8450 */ void drawDirect(bool) const;
|
||||
/* 802E84C4 */ void setDirectConsole(JUTConsole*);
|
||||
|
||||
JUTConsole* getDirectConsole() const { return mDirectConsole; }
|
||||
|
||||
static JUTConsoleManager* getManager() { return sManager; }
|
||||
|
||||
static JUTConsoleManager* sManager;
|
||||
|
||||
private:
|
||||
/* 0x00 */ JGadget::TLinkList<JUTConsole, 4> mLinkList;
|
||||
/* 0x0C */ JUTConsole* mActiveConsole;
|
||||
/* 0x10 */ JUTConsole* mDirectConsole;
|
||||
}; // Size: 0x14
|
||||
|
||||
extern "C" void JUTConsole_print_f_va_(JUTConsole*, const char*, va_list);
|
||||
extern "C" void JUTSetReportConsole(JUTConsole*);
|
||||
extern "C" JUTConsole* JUTGetReportConsole();
|
||||
extern "C" void JUTSetWarningConsole(JUTConsole*);
|
||||
extern "C" JUTConsole* JUTGetWarningConsole();
|
||||
extern "C" void JUTReportConsole_f_va(const char*, va_list);
|
||||
extern "C" void JUTReportConsole_f(const char*, ...);
|
||||
extern "C" void JUTWarningConsole(const char* message);
|
||||
extern "C" void JUTWarningConsole_f(const char* message, ...);
|
||||
extern "C" void JUTReportConsole(const char* message);
|
||||
|
||||
#endif /* JUTCONSOLE_H */
|
||||
@@ -0,0 +1,43 @@
|
||||
#ifndef JUTDBPRINT_H
|
||||
#define JUTDBPRINT_H
|
||||
|
||||
#include "JSystem/JUtility/JUTFont.h"
|
||||
|
||||
class JKRHeap;
|
||||
|
||||
// TODO: fix struct
|
||||
struct unk_print {
|
||||
/* 0x00 */ unk_print* mNext;
|
||||
/* 0x04 */ s16 unk_0x04;
|
||||
/* 0x06 */ s16 unk_0x06;
|
||||
/* 0x08 */ s16 unk_0x08;
|
||||
/* 0x0A */ s16 unk_0x0A;
|
||||
/* 0x0C */ char unk_0x0C[0];
|
||||
};
|
||||
|
||||
class JUTDbPrint {
|
||||
public:
|
||||
/* 802E0148 */ JUTDbPrint(JUTFont*, JKRHeap*);
|
||||
/* 802E0190 */ static JUTDbPrint* start(JUTFont*, JKRHeap*);
|
||||
/* 802E0204 */ JUTFont* changeFont(JUTFont*);
|
||||
/* 802E021C */ void enter(int, int, int, char const*, int);
|
||||
/* 802E02DC */ void flush(int, int, int, int);
|
||||
/* 802E02A4 */ void flush();
|
||||
/* 802E0440 */ void drawString(int, int, int, u8 const*);
|
||||
|
||||
static JUTDbPrint* getManager() { return sDebugPrint; }
|
||||
|
||||
void setVisible(bool visible) { mVisible = visible; }
|
||||
JUTFont* getFont() const { return mFont; }
|
||||
|
||||
static JUTDbPrint* sDebugPrint;
|
||||
|
||||
private:
|
||||
/* 0x00 */ unk_print* mFirst;
|
||||
/* 0x04 */ JUTFont* mFont;
|
||||
/* 0x08 */ JUtility::TColor mColor;
|
||||
/* 0x0C */ bool mVisible;
|
||||
/* 0x10 */ JKRHeap* mHeap;
|
||||
};
|
||||
|
||||
#endif /* JUTDBPRINT_H */
|
||||
@@ -0,0 +1,25 @@
|
||||
#ifndef JUTDIRECTFILE_H
|
||||
#define JUTDIRECTFILE_H
|
||||
|
||||
#include "dolphin/dvd/dvd.h"
|
||||
|
||||
#define JUTDF_BUFSIZE (0x800)
|
||||
|
||||
struct JUTDirectFile {
|
||||
/* 802E8730 */ int fetch32byte();
|
||||
/* 802E87F8 */ JUTDirectFile();
|
||||
/* 802E881C */ ~JUTDirectFile();
|
||||
/* 802E8860 */ bool fopen(char const*);
|
||||
/* 802E88FC */ void fclose();
|
||||
/* 802E8958 */ int fgets(void*, int);
|
||||
|
||||
/* 0x000 */ u8 mBuffer[0x820];
|
||||
/* 0x820 */ u8* mSectorStart;
|
||||
/* 0x824 */ u32 mToRead;
|
||||
/* 0x828 */ u32 mLength;
|
||||
/* 0x82C */ u32 mPos;
|
||||
/* 0x830 */ bool mIsOpen;
|
||||
/* 0x834 */ DVDFileInfo mFileInfo;
|
||||
};
|
||||
|
||||
#endif /* JUTDIRECTFILE_H */
|
||||
@@ -0,0 +1,57 @@
|
||||
#ifndef JUTDIRECTPRINT_H
|
||||
#define JUTDIRECTPRINT_H
|
||||
|
||||
#include "JSystem/JUtility/TColor.h"
|
||||
#include "Runtime.PPCEABI.H/__va_arg.h"
|
||||
|
||||
class JUTDirectPrint {
|
||||
private:
|
||||
/* 802E41E8 */ JUTDirectPrint();
|
||||
|
||||
public:
|
||||
/* 802E4288 */ void erase(int, int, int, int);
|
||||
/* 802E431C */ void drawChar(int, int, int);
|
||||
/* 802E456C */ void changeFrameBuffer(void*, u16, u16);
|
||||
/* -------- */ void print(u16, u16, char const*, ...);
|
||||
/* 802E45A4 */ void printSub(u16, u16, char const*, va_list, 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);
|
||||
|
||||
/* 802E4240 */ static JUTDirectPrint* start();
|
||||
|
||||
bool isActive() const { return field_0x00 != 0; }
|
||||
JUtility::TColor getCharColor() const { return mCharColor; }
|
||||
|
||||
static JUTDirectPrint* getManager() { return sDirectPrint; }
|
||||
|
||||
private:
|
||||
static u8 sAsciiTable[128];
|
||||
static u32 sFontData[64];
|
||||
static u32 sFontData2[77];
|
||||
static JUTDirectPrint* sDirectPrint;
|
||||
static u8 sDirectPrint_padding[4 /* padding */];
|
||||
|
||||
private:
|
||||
/* 0x00 */ void* field_0x00;
|
||||
/* 0x04 */ u16 mFrameBufferWidth;
|
||||
/* 0x06 */ u16 mFrameBufferHeight;
|
||||
/* 0x08 */ u16 mStride;
|
||||
/* 0x0A */ u16 field_0x0A;
|
||||
/* 0x0C */ size_t mFrameBufferSize;
|
||||
/* 0x10 */ u8 field_0x10[4];
|
||||
/* 0x14 */ u16* mFrameBuffer;
|
||||
/* 0x18 */ JUtility::TColor mCharColor;
|
||||
/* 0x1C */ u16 mCharColor_Y;
|
||||
/* 0x1E */ u16 mCharColor_Cb;
|
||||
/* 0x20 */ u16 mCharColor_Cb2;
|
||||
/* 0x22 */ u16 mCharColor_Cb4;
|
||||
/* 0x24 */ u16 mCharColor_Cr;
|
||||
/* 0x26 */ u16 mCharColor_Cr2;
|
||||
/* 0x28 */ u16 mCharColor_Cr4;
|
||||
/* 0x2A */ u16 field_0x2A;
|
||||
/* 0x2C */
|
||||
};
|
||||
|
||||
#endif /* JUTDIRECTPRINT_H */
|
||||
@@ -0,0 +1,141 @@
|
||||
#ifndef JUTEXCEPTION_H
|
||||
#define JUTEXCEPTION_H
|
||||
|
||||
#include "JSystem/JKernel/JKRThread.h"
|
||||
#include "JSystem/JUtility/JUTGamePad.h"
|
||||
#include "Runtime.PPCEABI.H/__va_arg.h"
|
||||
#include "dolphin/gx/GXEnum.h"
|
||||
#include "dolphin/os/OSError.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "global.h"
|
||||
|
||||
typedef struct _GXRenderModeObj GXRenderModeObj;
|
||||
typedef struct OSContext OSContext;
|
||||
class JUTDirectPrint;
|
||||
|
||||
class JUTExternalFB {
|
||||
public:
|
||||
/* 802E40CC */ JUTExternalFB(_GXRenderModeObj*, GXGamma, void*, u32);
|
||||
|
||||
private:
|
||||
/* 0x00 */ _GXRenderModeObj* mRenderMode;
|
||||
/* 0x04 */ u32 mSize;
|
||||
/* 0x08 */ u32 field_0x08;
|
||||
/* 0x0C */ u16 field_0x0C;
|
||||
/* 0x0E */ u16 mGamma;
|
||||
/* 0x10 */ bool field_0x10;
|
||||
/* 0x11 */ u8 field_[3];
|
||||
};
|
||||
|
||||
STATIC_ASSERT(sizeof(JUTExternalFB) == 0x14);
|
||||
|
||||
#define JUT_PRINT_GPR 1
|
||||
#define JUT_PRINT_GPR_MAP 2
|
||||
#define JUT_PRINT_SRR0_MAP 4
|
||||
#define JUT_PRINT_FLOAT 8
|
||||
#define JUT_PRINT_STACK 16
|
||||
|
||||
class JUTException : public JKRThread {
|
||||
public:
|
||||
enum EInfoPage {
|
||||
EINFO_PAGE_GPR = 1,
|
||||
EINFO_PAGE_FLOAT = 2,
|
||||
EINFO_PAGE_STACK = 3,
|
||||
EINFO_PAGE_GPR_MAP = 4,
|
||||
EINFO_PAGE_SSR0_MAP = 5,
|
||||
};
|
||||
|
||||
class JUTExMapFile {
|
||||
public:
|
||||
JUTExMapFile(char* path) : mLink(this) { mPath = path; }
|
||||
|
||||
public:
|
||||
/* 0x00 */ char* mPath;
|
||||
/* 0x04 */ JSULink<JUTExMapFile> mLink;
|
||||
/* 0x14 */
|
||||
};
|
||||
|
||||
/* 802E1D5C */ JUTException(JUTDirectPrint*);
|
||||
/* 802E40EC */ virtual ~JUTException();
|
||||
|
||||
/* 802E22C4 */ void showFloatSub(int, f32);
|
||||
/* 802E2454 */ void showFloat(OSContext*);
|
||||
/* 802E26B0 */ void showStack(OSContext*);
|
||||
/* 802E27B0 */ void showMainInfo(u16, OSContext*, u32, u32);
|
||||
/* 802E2A84 */ void showGPR(OSContext*);
|
||||
/* 802E2B44 */ bool showMapInfo_subroutine(u32, bool);
|
||||
/* 802E2CA0 */ void showGPRMap(OSContext*);
|
||||
/* 802E2DAC */ void showSRR0Map(OSContext*);
|
||||
/* 802E2E70 */ void printDebugInfo(JUTException::EInfoPage, OSError, OSContext*, u32, u32);
|
||||
/* 802E2F18 */ bool isEnablePad() const;
|
||||
/* 802E2F54 */ bool readPad(u32*, u32*);
|
||||
/* 802E34C0 */ void printContext(u16, OSContext*, u32, u32);
|
||||
/* 802E3A08 */ void createFB();
|
||||
|
||||
/* 802E1EA8 */ /* vt[03] */ virtual void* run();
|
||||
|
||||
/* 802E1E40 */ static JUTException* create(JUTDirectPrint*);
|
||||
/* 802E1FCC */ static void errorHandler(OSError, OSContext*, u32, u32);
|
||||
/* 802E20C0 */ static void panic_f_va(char const*, int, char const*, va_list);
|
||||
/* 802E21FC */ static void panic_f(char const*, int, char const*, ...);
|
||||
/* 802E227C */ static void setFPException(u32);
|
||||
/* 802E2578 */ static bool searchPartialModule(u32, u32*, u32*, u32*, u32*);
|
||||
/* 802E3AEC */ static OSErrorHandler setPreUserCallback(OSErrorHandler);
|
||||
/* 802E3AFC */ static OSErrorHandler setPostUserCallback(OSErrorHandler);
|
||||
/* 802E3B0C */ static void appendMapFile(char const*);
|
||||
/* 802E3BA0 */ static bool queryMapAddress(char*, u32, s32, u32*, u32*, char*, u32, bool, bool);
|
||||
/* 802E3C90 */ static bool queryMapAddress_single(char*, u32, s32, u32*, u32*, char*, u32, bool,
|
||||
bool);
|
||||
/* 802E3FEC */ static void createConsole(void*, u32);
|
||||
/* 802E3980 */ static void waitTime(s32);
|
||||
|
||||
static JUTException* getManager() { return sErrorManager; }
|
||||
static JUTConsole* getConsole() { return sConsole; }
|
||||
|
||||
JUTExternalFB* getFrameMemory() const { return mFrameMemory; }
|
||||
|
||||
void setTraceSuppress(u32 param_0) { mTraceSuppress = param_0; }
|
||||
void setGamePad(JUTGamePad* gamePad) {
|
||||
mGamePad = gamePad;
|
||||
mGamePadPort = JUTGamePad::Port_Unknown;
|
||||
}
|
||||
|
||||
static void setMapFile(const char* map) {
|
||||
appendMapFile(map);
|
||||
}
|
||||
|
||||
private:
|
||||
static OSMessageQueue sMessageQueue;
|
||||
static const char* sCpuExpName[17];
|
||||
static JSUList<JUTException::JUTExMapFile> sMapFileList;
|
||||
static u8 sMessageBuffer[4 + 4 /* padding */];
|
||||
static JUTException* sErrorManager;
|
||||
static OSErrorHandler sPreUserCallback;
|
||||
static OSErrorHandler sPostUserCallback;
|
||||
static void* sConsoleBuffer;
|
||||
static u32 sConsoleBufferSize;
|
||||
static JUTConsole* sConsole;
|
||||
static u32 msr;
|
||||
static u32 fpscr;
|
||||
|
||||
private:
|
||||
/* 0x7C */ JUTExternalFB* mFrameMemory;
|
||||
/* 0x80 */ JUTDirectPrint* mDirectPrint;
|
||||
/* 0x84 */ JUTGamePad* mGamePad;
|
||||
/* 0x88 */ JUTGamePad::EPadPort mGamePadPort;
|
||||
/* 0x8C */ s32 mPrintWaitTime0;
|
||||
/* 0x90 */ s32 mPrintWaitTime1;
|
||||
/* 0x94 */ u32 mTraceSuppress;
|
||||
/* 0x98 */ u32 field_0x98;
|
||||
/* 0x9C */ u32 mPrintFlags;
|
||||
/* 0xA0 */ u32 mStackPointer;
|
||||
};
|
||||
|
||||
STATIC_ASSERT(sizeof(JUTException) == 0xA4);
|
||||
|
||||
struct JUTWarn {
|
||||
JUTWarn& operator<<(const char*) { return *this; }
|
||||
JUTWarn& operator<<(long) { return *this; }
|
||||
};
|
||||
|
||||
#endif /* JUTEXCEPTION_H */
|
||||
@@ -0,0 +1,35 @@
|
||||
#ifndef JUTFADER_H
|
||||
#define JUTFADER_H
|
||||
|
||||
#include "JSystem/JGeometry.h"
|
||||
#include "JSystem/JUtility/TColor.h"
|
||||
|
||||
class JUTFader {
|
||||
public:
|
||||
enum EStatus {
|
||||
UNKSTATUS_M1 = -1,
|
||||
UNKSTATUS_0 = 0,
|
||||
};
|
||||
|
||||
/* 802E5530 */ JUTFader(int, int, int, int, JUtility::TColor);
|
||||
/* 802E55DC */ void control();
|
||||
/* 802E57D0 */ void setStatus(JUTFader::EStatus, int);
|
||||
|
||||
/* 802E5840 */ virtual ~JUTFader();
|
||||
/* 802E576C */ virtual bool startFadeIn(int);
|
||||
/* 802E579C */ virtual bool startFadeOut(int);
|
||||
/* 802E56DC */ virtual void draw();
|
||||
|
||||
s32 getStatus() const { return mStatus; }
|
||||
void setColor(JUtility::TColor& color) { mColor.set(color); }
|
||||
|
||||
/* 0x04 */ s32 mStatus;
|
||||
/* 0x08 */ u16 field_0x8;
|
||||
/* 0x0A */ u16 field_0xa;
|
||||
/* 0x0C */ JUtility::TColor mColor;
|
||||
/* 0x10 */ JGeometry::TBox2<f32> mBox;
|
||||
/* 0x20 */ int mEStatus;
|
||||
/* 0x24 */ u32 field_0x24;
|
||||
};
|
||||
|
||||
#endif /* JUTFADER_H */
|
||||
@@ -0,0 +1,128 @@
|
||||
#ifndef JUTFONT_H
|
||||
#define JUTFONT_H
|
||||
|
||||
#include "JSystem/JUtility/TColor.h"
|
||||
#include "MSL_C/string.h"
|
||||
|
||||
struct ResFONT {
|
||||
struct INF1 {
|
||||
/* 0x00 */ u32 magic;
|
||||
/* 0x04 */ u32 size;
|
||||
/* 0x08 */ u16 fontType;
|
||||
/* 0x0A */ u16 ascent;
|
||||
/* 0x0C */ u16 descent;
|
||||
/* 0x0E */ u16 width;
|
||||
/* 0x10 */ u16 leading;
|
||||
/* 0x12 */ u16 defaultCode;
|
||||
};
|
||||
|
||||
struct WID1 {
|
||||
/* 0x00 */ u32 magic;
|
||||
/* 0x04 */ u32 size;
|
||||
/* 0x08 */ u16 startCode;
|
||||
/* 0x0A */ u16 endCode;
|
||||
/* 0x0C */ u8 mChunkNum[4];
|
||||
};
|
||||
|
||||
struct MAP1 {
|
||||
/* 0x00 */ u32 magic;
|
||||
/* 0x04 */ u32 size;
|
||||
/* 0x08 */ u16 mappingMethod;
|
||||
/* 0x0A */ u16 startCode;
|
||||
/* 0x0C */ u16 endCode;
|
||||
/* 0x0E */ u16 numEntries;
|
||||
/* 0x10 */ u16 mLeading;
|
||||
};
|
||||
|
||||
struct GLY1 {
|
||||
/* 0x00 */ u32 magic;
|
||||
/* 0x04 */ u32 size;
|
||||
/* 0x08 */ u16 startCode;
|
||||
/* 0x0A */ u16 endCode;
|
||||
/* 0x0C */ u16 cellWidth;
|
||||
/* 0x0E */ u16 cellHeight;
|
||||
/* 0x10 */ u32 textureSize;
|
||||
/* 0x14 */ u16 textureFormat;
|
||||
/* 0x16 */ u16 numRows;
|
||||
/* 0x18 */ u16 numColumns;
|
||||
/* 0x1A */ u16 textureWidth;
|
||||
/* 0x1C */ u16 textureHeight;
|
||||
/* 0x1E */ u16 padding;
|
||||
/* 0x20 */ u8 data[];
|
||||
};
|
||||
|
||||
/* 0x00 */ u64 magic;
|
||||
/* 0x08 */ u32 filesize;
|
||||
/* 0x0C */ u32 numBlocks;
|
||||
/* 0x10 */ u8 padding[0x10];
|
||||
/* 0x20 */ u8 data[];
|
||||
};
|
||||
|
||||
class JUTFont {
|
||||
public:
|
||||
JUTFont();
|
||||
virtual ~JUTFont() {}
|
||||
|
||||
struct TWidth {
|
||||
u8 field_0x0;
|
||||
u8 field_0x1;
|
||||
};
|
||||
|
||||
/* 0x0C */ virtual void setGX() = 0;
|
||||
/* 0x10 */ virtual void setGX(JUtility::TColor col1, JUtility::TColor col2);
|
||||
/* 0x14 */ virtual f32 drawChar_scale(f32 a1, f32 a2, f32 a3, f32 a4, int a5, bool a6) = 0;
|
||||
/* 0x18 */ virtual int getLeading() const = 0;
|
||||
/* 0x1C */ virtual s32 getAscent() const = 0;
|
||||
/* 0x20 */ virtual s32 getDescent() const = 0;
|
||||
/* 0x24 */ virtual s32 getHeight() const = 0;
|
||||
/* 0x28 */ virtual s32 getWidth() const = 0;
|
||||
/* 0x2C */ virtual void getWidthEntry(int i_no, TWidth* width) const = 0;
|
||||
/* 0x30 */ virtual int getCellWidth() const;
|
||||
/* 0x34 */ virtual s32 getCellHeight() const;
|
||||
/* 0x38 */ virtual int getFontType() const = 0;
|
||||
/* 0x3C */ virtual ResFONT* getResFont() const = 0;
|
||||
/* 0x40 */ virtual bool isLeadByte(int a1) const = 0;
|
||||
|
||||
static bool isLeadByte_1Byte(int b);
|
||||
static bool isLeadByte_2Byte(int b);
|
||||
static bool isLeadByte_ShiftJIS(int b);
|
||||
|
||||
void initialize_state();
|
||||
void setCharColor(JUtility::TColor col1);
|
||||
void setGradColor(JUtility::TColor col1, JUtility::TColor col2);
|
||||
f32 drawString_size_scale(f32 posX, f32 posY, f32 width, f32 height, const char* str, u32 usz,
|
||||
bool visible);
|
||||
|
||||
void drawString(int posX, int posY, const char* str, bool visible) {
|
||||
drawString_size(posX, posY, str, strlen(str), visible);
|
||||
}
|
||||
|
||||
void drawString_size(int posX, int posY, const char* str, u32 len, bool visible) {
|
||||
drawString_size_scale(posX, posY, getWidth(), getHeight(), str, len, visible);
|
||||
}
|
||||
|
||||
void drawString_scale(f32 posX, f32 posY, f32 width, f32 height, const char* str,
|
||||
bool visible) {
|
||||
drawString_size_scale(posX, posY, width, height, str, strlen(str), visible);
|
||||
}
|
||||
|
||||
int getWidth(int i_no) const {
|
||||
TWidth width;
|
||||
getWidthEntry(i_no, &width);
|
||||
return width.field_0x1;
|
||||
}
|
||||
|
||||
bool isValid() const { return mValid; }
|
||||
bool isFixed() const { return mFixed; }
|
||||
int getFixedWidth() const { return mFixedWidth; }
|
||||
|
||||
/* 0x04 */ bool mValid;
|
||||
/* 0x05 */ bool mFixed;
|
||||
/* 0x08 */ int mFixedWidth;
|
||||
/* 0x0C */ JUtility::TColor mColor1;
|
||||
/* 0x10 */ JUtility::TColor mColor2;
|
||||
/* 0x14 */ JUtility::TColor mColor3;
|
||||
/* 0x18 */ JUtility::TColor mColor4;
|
||||
};
|
||||
|
||||
#endif /* JUTFONT_H */
|
||||
@@ -0,0 +1,6 @@
|
||||
#ifndef JUTFONTDATA_ASCFONT_FIX12_H
|
||||
#define JUTFONTDATA_ASCFONT_FIX12_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
#endif /* JUTFONTDATA_ASCFONT_FIX12_H */
|
||||
@@ -0,0 +1,283 @@
|
||||
#ifndef JUTGAMEPAD_H
|
||||
#define JUTGAMEPAD_H
|
||||
|
||||
#include "JSystem/JKernel/JKRDisposer.h"
|
||||
#include "dolphin/os/OSTime.h"
|
||||
#include "dolphin/pad/Pad.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
typedef void (*callbackFn)(int, void*);
|
||||
|
||||
namespace CButton {
|
||||
enum {
|
||||
DPAD_LEFT = 0x0001,
|
||||
DPAD_RIGHT = 0x0002,
|
||||
DPAD_DOWN = 0x0004,
|
||||
DPAD_UP = 0x0008,
|
||||
Z = 0x0010,
|
||||
R = 0x0020,
|
||||
L = 0x0040,
|
||||
A = 0x0100,
|
||||
B = 0x0200,
|
||||
X = 0x0400,
|
||||
Y = 0x0800,
|
||||
START = 0x1000,
|
||||
};
|
||||
}
|
||||
|
||||
extern bool sResetSwitchPushing__Q210JUTGamePad13C3ButtonReset;
|
||||
|
||||
struct JUTGamePadRecordBase {
|
||||
virtual void unk0() {}
|
||||
virtual void unk1(PADStatus* pad) {}
|
||||
virtual void unk2() {}
|
||||
|
||||
/* 0x4 */ bool mActive;
|
||||
};
|
||||
|
||||
struct JUTGamePad : public JKRDisposer {
|
||||
public:
|
||||
enum EStickMode {
|
||||
STICK_MODE_1 = 1,
|
||||
};
|
||||
enum EWhichStick {
|
||||
WS_MAIN_STICK,
|
||||
WS_SUB_STICK,
|
||||
};
|
||||
enum EPadPort {
|
||||
Port_Unknown = -1,
|
||||
Port_1,
|
||||
Port_2,
|
||||
Port_3,
|
||||
Port_4,
|
||||
};
|
||||
|
||||
JUTGamePad(JUTGamePad::EPadPort port);
|
||||
virtual ~JUTGamePad();
|
||||
|
||||
void initList();
|
||||
static s32 init();
|
||||
void clear();
|
||||
static u32 read();
|
||||
void assign();
|
||||
void checkResetCallback(OSTime unk);
|
||||
void update();
|
||||
void stopPatternedRumble() { mRumble.stopPatternedRumble(mPortNum); }
|
||||
static void checkResetSwitch();
|
||||
static void clearForReset();
|
||||
static JUTGamePad* getGamePad(int pad_index);
|
||||
static bool recalibrate(u32 pad_mask);
|
||||
|
||||
static void setAnalogMode(u32 mode) {
|
||||
sAnalogMode = mode;
|
||||
PADSetAnalogMode(mode);
|
||||
}
|
||||
|
||||
static void clearResetOccurred() { C3ButtonReset::sResetOccurred = false; }
|
||||
|
||||
static void setResetCallback(callbackFn callback, void* param_0) {
|
||||
C3ButtonReset::sCallback = callback;
|
||||
C3ButtonReset::sCallbackArg = param_0;
|
||||
}
|
||||
|
||||
u32 getButton() const { return mButton.mButton; }
|
||||
|
||||
u32 getTrigger() const { return mButton.mTrigger; }
|
||||
|
||||
f32 getMainStickX() const { return mMainStick.mPosX; }
|
||||
|
||||
f32 getMainStickY() const { return mMainStick.mPosY; }
|
||||
|
||||
f32 getMainStickValue() const { return mMainStick.mValue; }
|
||||
|
||||
s16 getMainStickAngle() const { return mMainStick.mAngle; }
|
||||
|
||||
f32 getSubStickX() const { return mSubStick.mPosX; }
|
||||
|
||||
f32 getSubStickY() const { return mSubStick.mPosY; }
|
||||
|
||||
f32 getSubStickValue() const { return mSubStick.mValue; }
|
||||
|
||||
s16 getSubStickAngle() const { return mSubStick.mAngle; }
|
||||
|
||||
u8 getAnalogA() const { return mButton.mAnalogA; }
|
||||
|
||||
u8 getAnalogB() const { return mButton.mAnalogB; }
|
||||
|
||||
u8 getAnalogL() const { return mButton.mAnalogL; }
|
||||
|
||||
u8 getAnalogR() const { return mButton.mAnalogR; }
|
||||
|
||||
s8 getErrorStatus() const { return mErrorStatus; }
|
||||
|
||||
s16 getPortNum() const { return mPortNum; }
|
||||
|
||||
JUTGamePadRecordBase* getPadReplay() const { return mPadReplay; }
|
||||
|
||||
JUTGamePadRecordBase* getPadRecord() const { return mPadRecord; }
|
||||
|
||||
u32 testTrigger(u32 button) const { return mButton.mTrigger & button; }
|
||||
|
||||
bool isPushing3ButtonReset() const {
|
||||
bool isPushingReset = false;
|
||||
|
||||
if (mPortNum != -1 && mButtonReset.mReset != false) {
|
||||
isPushingReset = true;
|
||||
}
|
||||
return isPushingReset;
|
||||
}
|
||||
|
||||
inline void stopMotorWave() { mRumble.stopPatternedRumbleAtThePeriod(); }
|
||||
void stopMotor() { mRumble.stopMotor(mPortNum, false); }
|
||||
void stopMotorHard() { mRumble.stopMotorHard(mPortNum); }
|
||||
|
||||
static s8 getPortStatus(u32 port) { return mPadStatus[port].error; }
|
||||
|
||||
struct CButton {
|
||||
CButton() { clear(); }
|
||||
void clear();
|
||||
void update(PADStatus const*, u32 unk);
|
||||
void setRepeat(u32 unk0, u32 unk1, u32 unk2);
|
||||
|
||||
/* 0x00 */ u32 mButton;
|
||||
/* 0x04 */ u32 mTrigger; // Pressed Buttons
|
||||
/* 0x08 */ u32 mRelease; // Released Buttons
|
||||
/* 0x0C */ u8 mAnalogA;
|
||||
/* 0x0D */ u8 mAnalogB;
|
||||
/* 0x0E */ u8 mAnalogL;
|
||||
/* 0x0F */ u8 mAnalogR;
|
||||
/* 0x10 */ f32 mAnalogLf;
|
||||
/* 0x14 */ f32 mAnalogRf;
|
||||
/* 0x18 */ u32 mRepeat;
|
||||
/* 0x1C */ u32 field_0x1c;
|
||||
/* 0x20 */ u32 field_0x20;
|
||||
/* 0x24 */ u32 field_0x24;
|
||||
/* 0x28 */ u32 field_0x28;
|
||||
/* 0x2C */ u32 field_0x2c;
|
||||
}; // Size: 0x30
|
||||
|
||||
struct C3ButtonReset {
|
||||
C3ButtonReset() { mReset = false; }
|
||||
|
||||
static u32 sResetPattern;
|
||||
static u32 sResetMaskPattern;
|
||||
static callbackFn sCallback;
|
||||
static void* sCallbackArg;
|
||||
static OSTime sThreshold;
|
||||
static s32 sResetOccurredPort;
|
||||
static bool sResetOccurred;
|
||||
static bool sResetSwitchPushing;
|
||||
|
||||
/* 0x0 */ bool mReset;
|
||||
}; // Size: 0x4
|
||||
|
||||
struct CStick {
|
||||
static f32 sPressPoint;
|
||||
static f32 sReleasePoint;
|
||||
|
||||
CStick() { clear(); }
|
||||
void clear();
|
||||
void clear(JUTGamePad* pad);
|
||||
u32 update(s8 unk0, s8 unk1, JUTGamePad::EStickMode mode, JUTGamePad::EWhichStick stick,
|
||||
u32 unk2);
|
||||
u32 getButton(u32 unk);
|
||||
|
||||
/* 0x0 */ f32 mPosX;
|
||||
/* 0x4 */ f32 mPosY;
|
||||
/* 0x8 */ f32 mValue;
|
||||
/* 0xC */ s16 mAngle;
|
||||
/* 0xE */ s8 field_0xe;
|
||||
/* 0xF */ s8 field_0xf;
|
||||
}; // Size: 0x10
|
||||
|
||||
void stopMotorWaveHard() { mRumble.stopPatternedRumble(mPortNum); }
|
||||
|
||||
struct CRumble {
|
||||
CRumble(JUTGamePad* pad) { clear(pad); }
|
||||
|
||||
static PADMask sChannelMask[4];
|
||||
static bool mStatus[4];
|
||||
static PADMask mEnabled;
|
||||
|
||||
enum ERumble {
|
||||
VAL_0 = 0,
|
||||
VAL_1 = 1,
|
||||
VAL_2 = 2,
|
||||
};
|
||||
|
||||
void clear();
|
||||
void clear(JUTGamePad* pad);
|
||||
static void startMotor(int channel);
|
||||
static void stopMotor(int channel, bool stop);
|
||||
void update(s16 unk0);
|
||||
void triggerPatternedRumble(u32 unk0);
|
||||
void startPatternedRumble(void* unk0, ERumble rumble, u32 unk1);
|
||||
void stopPatternedRumble(s16 pad_port);
|
||||
void stopPatternedRumbleAtThePeriod();
|
||||
static void setEnabled(u32 pad_mask);
|
||||
|
||||
void stopMotorHard(int portNo) { stopMotor(portNo, true); }
|
||||
|
||||
static bool isEnabled(u32 mask) { return mEnabled & mask; }
|
||||
static bool isEnabledPort(int port) { return isEnabled(sChannelMask[port]); }
|
||||
|
||||
/* 0x00 */ u32 field_0x0;
|
||||
/* 0x04 */ u32 field_0x4;
|
||||
/* 0x08 */ u8* field_0x8;
|
||||
/* 0x0C */ u32 field_0xc;
|
||||
/* 0x10 */ u8* field_0x10;
|
||||
}; // Size: 0x14
|
||||
|
||||
void startMotorWave(void* param_2, CRumble::ERumble rumble, u32 param_4) {
|
||||
mRumble.startPatternedRumble(param_2, rumble, param_4);
|
||||
}
|
||||
|
||||
/* 0x18 */ CButton mButton;
|
||||
/* 0x48 */ CStick mMainStick;
|
||||
/* 0x58 */ CStick mSubStick;
|
||||
/* 0x68 */ CRumble mRumble;
|
||||
/* 0x7C */ s16 mPortNum;
|
||||
/* 0x7E */ s8 mErrorStatus;
|
||||
/* 0x80 */ JSULink<JUTGamePad> mLink;
|
||||
/* 0x90 */ JUTGamePadRecordBase* mPadRecord;
|
||||
/* 0x94 */ JUTGamePadRecordBase* mPadReplay;
|
||||
/* 0x98 */ C3ButtonReset mButtonReset;
|
||||
/* 0x9C */ u8 field_0x9c[4];
|
||||
/* 0xA0 */ OSTime mResetTime;
|
||||
/* 0xA8 */ u8 field_0xa8;
|
||||
|
||||
static JSUList<JUTGamePad> mPadList;
|
||||
static bool mListInitialized;
|
||||
static PADStatus mPadStatus[4];
|
||||
static CButton mPadButton[4];
|
||||
static CStick mPadMStick[4];
|
||||
static CStick mPadSStick[4];
|
||||
static EStickMode sStickMode;
|
||||
static u32 sClampMode;
|
||||
static u8 mPadAssign[4];
|
||||
static u32 sSuppressPadReset;
|
||||
static s32 sAnalogMode;
|
||||
static u32 sRumbleSupported;
|
||||
};
|
||||
|
||||
struct JUTGamePadLongPress {
|
||||
static JSUList<JUTGamePadLongPress> sPatternList;
|
||||
void checkCallback(int port, u32 timer);
|
||||
|
||||
u32 getMaskPattern() const { return mMaskPattern; }
|
||||
u32 getPattern() const { return mPattern; }
|
||||
|
||||
/* 0x00 */ u8 field_0x0[0x10];
|
||||
/* 0x10 */ bool mValid;
|
||||
/* 0x11 */ bool field_0x11;
|
||||
/* 0x14 */ u32 mPattern;
|
||||
/* 0x18 */ u32 mMaskPattern;
|
||||
/* 0x1C */ u32 field_0x1c;
|
||||
/* 0x20 */ bool field_0x20[4];
|
||||
/* 0x28 */ OSTime mTimer[4];
|
||||
/* 0x48 */ bool field_0x48[4];
|
||||
/* 0x4C */ void (*mCallback)(s32, JUTGamePadLongPress*, s32);
|
||||
/* 0x50 */ s32 field_0x50;
|
||||
};
|
||||
|
||||
#endif /* JUTGAMEPAD_H */
|
||||
@@ -0,0 +1,36 @@
|
||||
#ifndef JUTGRAPHFIFO_H
|
||||
#define JUTGRAPHFIFO_H
|
||||
|
||||
#include "dolphin/gx/GX.h"
|
||||
|
||||
class JUTGraphFifo {
|
||||
public:
|
||||
/* 802DEB58 */ JUTGraphFifo(u32);
|
||||
|
||||
/* 802DEC34 */ virtual ~JUTGraphFifo();
|
||||
|
||||
void getGpStatus() {
|
||||
GXGetGPStatus((GXBool*)&mGpStatus[0], (GXBool*)&mGpStatus[1], (GXBool*)&mGpStatus[2],
|
||||
(GXBool*)&mGpStatus[3], (GXBool*)&mGpStatus[4]);
|
||||
}
|
||||
|
||||
bool isGPActive() {
|
||||
getGpStatus();
|
||||
return mGpStatus[2] == false;
|
||||
}
|
||||
|
||||
void save() { GXSaveCPUFifo(this->mFifo); }
|
||||
|
||||
static JUTGraphFifo* sCurrentFifo;
|
||||
static bool mGpStatus[5];
|
||||
|
||||
private:
|
||||
/* 0x04 */ GXFifoObj* mFifo;
|
||||
/* 0x08 */ void* mBase;
|
||||
/* 0x0C */ u32 mSize;
|
||||
/* 0x10 */ u8 field_0x10[0xC];
|
||||
};
|
||||
|
||||
inline void JUTCreateFifo(u32 bufSize) { new JUTGraphFifo(bufSize); }
|
||||
|
||||
#endif /* JUTGRAPHFIFO_H */
|
||||
@@ -0,0 +1,37 @@
|
||||
#ifndef JUTNAMETAB_H
|
||||
#define JUTNAMETAB_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
struct ResNTAB {
|
||||
u16 mEntryNum;
|
||||
u16 mPad0;
|
||||
struct Entry {
|
||||
u16 mKeyCode;
|
||||
u16 mOffs;
|
||||
} mEntries[1];
|
||||
|
||||
inline const char* getName(u32 index) const {
|
||||
return ((const char*)mEntries) + mEntries[index].mOffs - 4;
|
||||
}
|
||||
};
|
||||
|
||||
class JUTNameTab {
|
||||
public:
|
||||
JUTNameTab();
|
||||
JUTNameTab(const ResNTAB* pNameTable);
|
||||
virtual ~JUTNameTab() {};
|
||||
|
||||
void setResource(const ResNTAB* pNameTable);
|
||||
s32 getIndex(char const*) const;
|
||||
const char* getName(u16 index) const;
|
||||
u16 calcKeyCode(char const* pName) const;
|
||||
const ResNTAB* getResNameTable() const { return mNameTable; }
|
||||
|
||||
private:
|
||||
/* 0x4 */ const ResNTAB* mNameTable;
|
||||
/* 0x8 */ const char* mpStrData;
|
||||
/* 0xC */ u16 mNameNum;
|
||||
};
|
||||
|
||||
#endif /* JUTNAMETAB_H */
|
||||
@@ -0,0 +1,44 @@
|
||||
#ifndef JUTPALETTE_H
|
||||
#define JUTPALETTE_H
|
||||
|
||||
#include "dolphin/gx/GXEnum.h"
|
||||
#include "dolphin/gx/GXStruct.h"
|
||||
|
||||
enum JUTTransparency { UNK0, UNK1 };
|
||||
|
||||
struct ResTLUT {
|
||||
u8 format;
|
||||
u8 transparency;
|
||||
u16 numColors;
|
||||
};
|
||||
|
||||
class JUTPalette {
|
||||
public:
|
||||
JUTPalette(_GXTlut p1, _GXTlutFmt p2, JUTTransparency p3, u16 p4, void* p5) {
|
||||
this->storeTLUT(p1, p2, p3, p4, p5);
|
||||
}
|
||||
|
||||
JUTPalette(GXTlut tlutNo, ResTLUT* p_tlutRes) {
|
||||
storeTLUT(tlutNo, p_tlutRes);
|
||||
}
|
||||
|
||||
/* 802DE890 */ void storeTLUT(_GXTlut, ResTLUT*);
|
||||
/* 802DE91C */ void storeTLUT(_GXTlut, _GXTlutFmt, JUTTransparency, u16, void*);
|
||||
/* 802DE95C */ bool load();
|
||||
|
||||
u8 getTlutName() const { return mTlutName; }
|
||||
u8 getFormat() const { return mFormat; }
|
||||
u8 getTransparency() const { return mTransparency; }
|
||||
u16 getNumColors() const { return mNumColors; }
|
||||
ResTLUT* getColorTable() const { return mColorTable; }
|
||||
|
||||
private:
|
||||
/* 0x00 */ _GXTlutObj mTlutObj;
|
||||
/* 0x0C */ u8 mTlutName;
|
||||
/* 0x0D */ u8 mFormat;
|
||||
/* 0x10 */ ResTLUT* mColorTable;
|
||||
/* 0x14 */ u16 mNumColors;
|
||||
/* 0x16 */ u8 mTransparency;
|
||||
};
|
||||
|
||||
#endif /* JUTPALETTE_H */
|
||||
@@ -0,0 +1,103 @@
|
||||
#ifndef JUTPROCBAR_H
|
||||
#define JUTPROCBAR_H
|
||||
|
||||
#include "JSystem/JUtility/TColor.h"
|
||||
#include "dolphin/os/OSTime.h"
|
||||
|
||||
class JKRHeap;
|
||||
|
||||
class JUTProcBar {
|
||||
public:
|
||||
class CTime {
|
||||
public:
|
||||
/* 802E7340 */ CTime();
|
||||
|
||||
void start(u8 param_0, u8 param_1, u8 param_2) {
|
||||
mR = param_0;
|
||||
mG = param_1;
|
||||
mB = param_2;
|
||||
mTick = OSGetTick();
|
||||
}
|
||||
|
||||
void end() {
|
||||
mCost = ((OSGetTick() - mTick) * 8) / ((*(u32*)0x800000F8 / 4) / 125000);
|
||||
if (mCost == 0) {
|
||||
mCost = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void accumePeek() {
|
||||
if (++field_0xc >= 0x10 || mCost >= field_0x8) {
|
||||
field_0x8 = mCost;
|
||||
field_0xc = 0;
|
||||
}
|
||||
}
|
||||
|
||||
int calcBarSize(int p1, int p2) { return mCost * p1 / p2; }
|
||||
|
||||
/* 0x00 */ u32 mTick;
|
||||
/* 0x04 */ u32 mCost;
|
||||
/* 0x08 */ u32 field_0x8;
|
||||
/* 0x0C */ u32 field_0xc;
|
||||
/* 0x10 */ u8 mR;
|
||||
/* 0x11 */ u8 mG;
|
||||
/* 0x12 */ u8 mB;
|
||||
};
|
||||
|
||||
class CParamSet {
|
||||
public:
|
||||
/* 0x00 */ int mBarWidth;
|
||||
/* 0x04 */ int mPosX;
|
||||
/* 0x08 */ int mPosY;
|
||||
/* 0x0C */ int mWidth;
|
||||
/* 0x10 */ int mUserPosition;
|
||||
};
|
||||
|
||||
/* 802E5888 */ JUTProcBar();
|
||||
/* 802E599C */ ~JUTProcBar();
|
||||
/* 802E59E0 */ static JUTProcBar* 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; }
|
||||
void setVisible(bool visible) { mVisible = visible; }
|
||||
void setVisibleHeapBar(bool visible) { mHeapBarVisible = visible; }
|
||||
|
||||
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 mUsers[8];
|
||||
/* 0x104 */ int mCostFrame;
|
||||
/* 0x108 */ int field_0x108;
|
||||
/* 0x10C */ bool mVisible;
|
||||
/* 0x110 */ int field_0x110;
|
||||
/* 0x114 */ CParamSet mParams;
|
||||
/* 0x128 */ int field_0x128;
|
||||
/* 0x12C */ JKRHeap* mWatchHeap;
|
||||
/* 0x130 */ bool mHeapBarVisible;
|
||||
};
|
||||
|
||||
#endif /* JUTPROCBAR_H */
|
||||
@@ -0,0 +1,7 @@
|
||||
#ifndef JSYSTEM_JUTILITY_JUTREPORT_H
|
||||
#define JSYSTEM_JUTILITY_JUTREPORT_H
|
||||
|
||||
void JUTReport(int x_pos, int y_pos, const char* str, ...);
|
||||
void JUTReport(int x_pos, int y_pos, int, const char* str, ...);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,74 @@
|
||||
#ifndef JUTRESFONT_H
|
||||
#define JUTRESFONT_H
|
||||
|
||||
#include "JSystem/JUtility/JUTFont.h"
|
||||
#include "dolphin/gx/GXEnum.h"
|
||||
|
||||
class JKRHeap;
|
||||
|
||||
typedef bool (*IsLeadByte_func)(int);
|
||||
|
||||
struct BlockHeader {
|
||||
const BlockHeader* getNext() const { return reinterpret_cast<const BlockHeader*>(reinterpret_cast<const u8*>(this) + size); }
|
||||
u32 magic;
|
||||
u32 size;
|
||||
};
|
||||
|
||||
class JUTResFont : public JUTFont {
|
||||
public:
|
||||
/* 802DF000 */ virtual ~JUTResFont();
|
||||
/* 802DF48C */ virtual void setGX();
|
||||
/* 802DF584 */ virtual void setGX(JUtility::TColor, JUtility::TColor);
|
||||
/* 802DF7C4 */ virtual f32 drawChar_scale(f32, f32, f32, f32, int, bool);
|
||||
/* 802DDFEC */ virtual int getLeading() const;
|
||||
/* 802DE004 */ virtual s32 getAscent() const;
|
||||
/* 802DE010 */ virtual s32 getDescent() const;
|
||||
/* 802DE01C */ virtual s32 getHeight() const;
|
||||
/* 802DDFF8 */ virtual s32 getWidth() const;
|
||||
/* 802DFC64 */ virtual void getWidthEntry(int, JUTFont::TWidth*) const;
|
||||
/* 802DFD0C */ virtual int getCellWidth() const;
|
||||
/* 802DFD58 */ virtual s32 getCellHeight() const;
|
||||
/* 802DDFE0 */ virtual int getFontType() const;
|
||||
/* 802DDFD8 */ virtual ResFONT* getResFont() const;
|
||||
/* 802DFDA4 */ virtual bool isLeadByte(int) const;
|
||||
/* 802DFF60 */ virtual void loadImage(int, _GXTexMapID);
|
||||
/* 802DF344 */ virtual void setBlock();
|
||||
|
||||
/* 802DEF94 */ JUTResFont(ResFONT const*, JKRHeap*);
|
||||
/* 802DEF48 */ JUTResFont();
|
||||
/* 802DF08C */ void deleteMemBlocks_ResFont();
|
||||
/* 802DF0B0 */ void initialize_state();
|
||||
/* 802DF0DC */ bool initiate(ResFONT const*, JKRHeap*);
|
||||
/* 802DF13C */ bool protected_initiate(ResFONT const*, JKRHeap*);
|
||||
/* 802DF248 */ void countBlock();
|
||||
/* 802DFBE8 */ void loadFont(int, _GXTexMapID, JUTFont::TWidth*);
|
||||
/* 802DFDD8 */ int getFontCode(int) const;
|
||||
/* 802E00C4 */ int convertSjis(int, u16*) const;
|
||||
|
||||
inline void delete_and_initialize() {
|
||||
deleteMemBlocks_ResFont();
|
||||
initialize_state();
|
||||
}
|
||||
|
||||
static IsLeadByte_func const saoAboutEncoding_[3];
|
||||
|
||||
// some types uncertain, may need to be fixed
|
||||
/* 0x1C */ int mWidth;
|
||||
/* 0x20 */ int mHeight;
|
||||
/* 0x24 */ _GXTexObj field_0x24;
|
||||
/* 0x44 */ int field_0x44;
|
||||
/* 0x48 */ const ResFONT* mResFont;
|
||||
/* 0x4C */ ResFONT::INF1* mInf1Ptr;
|
||||
/* 0x50 */ void** mMemBlocks;
|
||||
/* 0x54 */ ResFONT::WID1** mpWidthBlocks;
|
||||
/* 0x58 */ ResFONT::GLY1** mpGlyphBlocks;
|
||||
/* 0x5C */ ResFONT::MAP1** mpMapBlocks;
|
||||
/* 0x60 */ u16 mWid1BlockNum;
|
||||
/* 0x62 */ u16 mGly1BlockNum;
|
||||
/* 0x64 */ u16 mMap1BlockNum;
|
||||
/* 0x66 */ u16 field_0x66;
|
||||
/* 0x68 */ u16 mMaxCode;
|
||||
/* 0x6C */ IsLeadByte_func* mIsLeadByte;
|
||||
};
|
||||
|
||||
#endif /* JUTRESFONT_H */
|
||||
@@ -0,0 +1,30 @@
|
||||
#ifndef JUTRESOURCE_H
|
||||
#define JUTRESOURCE_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
class JKRArchive;
|
||||
class JSUInputStream;
|
||||
|
||||
class JUTResReference {
|
||||
private:
|
||||
/* 0x001 */ u8 mType;
|
||||
/* 0x002 */ u8 mNameLength;
|
||||
/* 0x003 */ char mName[0x100];
|
||||
|
||||
public:
|
||||
enum ResType {
|
||||
RESTYPE_Null = 0,
|
||||
RESTYPE_Unk1 = 1,
|
||||
RESTYPE_Unk2 = 2,
|
||||
RESTYPE_Unk3 = 3,
|
||||
RESTYPE_Unk4 = 4,
|
||||
};
|
||||
JUTResReference() { mType = 0; }
|
||||
/* 802DE078 */ void* getResource(JSUInputStream*, u32, JKRArchive*);
|
||||
/* 802DE120 */ void* getResource(void const*, u32, JKRArchive*);
|
||||
/* 802DE1BC */ void* getResource(u32, JKRArchive*);
|
||||
};
|
||||
// only rough size known due to getPointer__7J2DPaneFP20JSURandomInputStreamUlP10JKRArchive
|
||||
|
||||
#endif /* JUTRESOURCE_H */
|
||||
@@ -0,0 +1,106 @@
|
||||
#ifndef JUTTEXTURE_H
|
||||
#define JUTTEXTURE_H
|
||||
|
||||
#include "dolphin/gx/GXEnum.h"
|
||||
#include "dolphin/gx/GXStruct.h"
|
||||
|
||||
class JUTPalette;
|
||||
|
||||
/*
|
||||
* Acts as the header to image data. Usually texture data immediately follows it,
|
||||
* so any pointer arithmetic to go past the end of this structure is so that a
|
||||
* variable sized allocated buffer can be accessed.
|
||||
*/
|
||||
struct ResTIMG {
|
||||
/* 0x00 */ u8 format;
|
||||
/* 0x01 */ u8 alphaEnabled;
|
||||
/* 0x02 */ u16 width;
|
||||
/* 0x04 */ u16 height;
|
||||
/* 0x06 */ u8 wrapS;
|
||||
/* 0x07 */ u8 wrapT;
|
||||
/* 0x08 */ u8 indexTexture;
|
||||
/* 0x09 */ u8 colorFormat;
|
||||
/* 0x0A */ u16 numColors;
|
||||
/* 0x0C */ u32 paletteOffset;
|
||||
/* 0x10 */ u8 mipmapEnabled;
|
||||
/* 0x11 */ u8 doEdgeLOD;
|
||||
/* 0x12 */ u8 biasClamp;
|
||||
/* 0x13 */ u8 maxAnisotropy;
|
||||
/* 0x14 */ u8 minFilter;
|
||||
/* 0x15 */ u8 magFilter;
|
||||
/* 0x16 */ s8 minLOD;
|
||||
/* 0x17 */ s8 maxLOD;
|
||||
/* 0x18 */ u8 mipmapCount;
|
||||
/* 0x19 */ u8 unknown;
|
||||
/* 0x1A */ s16 LODBias;
|
||||
/* 0x1C */ u32 imageOffset;
|
||||
}; // Size: 0x20
|
||||
|
||||
class JUTTexture {
|
||||
public:
|
||||
JUTTexture() {
|
||||
setCaptureFlag(false);
|
||||
mEmbPalette = NULL;
|
||||
mTexInfo = NULL;
|
||||
}
|
||||
|
||||
JUTTexture(const ResTIMG* p_timg, u8 param_1) {
|
||||
mEmbPalette = NULL;
|
||||
storeTIMG(p_timg, param_1);
|
||||
setCaptureFlag(false);
|
||||
}
|
||||
|
||||
~JUTTexture();
|
||||
void storeTIMG(ResTIMG const*, JUTPalette*, _GXTlut);
|
||||
void storeTIMG(ResTIMG const*, u8);
|
||||
void storeTIMG(ResTIMG const*, JUTPalette*);
|
||||
void attachPalette(JUTPalette*);
|
||||
void init();
|
||||
void initTexObj(_GXTlut);
|
||||
void initTexObj();
|
||||
void load(_GXTexMapID);
|
||||
|
||||
const ResTIMG* getTexInfo() const { return mTexInfo; }
|
||||
u8 getFormat() const { return mTexInfo->format; }
|
||||
s32 getTransparency() { return mTexInfo->alphaEnabled; }
|
||||
s32 getWidth() const { return mTexInfo->width; }
|
||||
s32 getHeight() const { return mTexInfo->height; }
|
||||
void setCaptureFlag(bool flag) { mFlags &= 2 | flag; }
|
||||
u8 getCaptureFlag() const { return mFlags & 1; }
|
||||
u8 getEmbPaletteDelFlag() const { return mFlags & 2; }
|
||||
void setEmbPaletteDelFlag(bool flag) { mFlags = (mFlags & 1) | (flag << 1);}
|
||||
u8 getTlutName() const { return mTlutName; }
|
||||
bool operator==(const JUTTexture& other) {
|
||||
return mTexInfo == other.mTexInfo
|
||||
&& field_0x2c == other.field_0x2c
|
||||
&& mWrapS == other.mWrapS
|
||||
&& mWrapT == other.mWrapT
|
||||
&& mMinFilter == other.mMinFilter
|
||||
&& mMagFilter == other.mMagFilter
|
||||
&& mMinLOD == other.mMinLOD
|
||||
&& mMinLOD == other.mMinLOD
|
||||
&& mLODBias == other.mLODBias;
|
||||
}
|
||||
bool operator!=(const JUTTexture& other) {
|
||||
return !operator==(other);
|
||||
}
|
||||
|
||||
private:
|
||||
/* 0x00 */ GXTexObj mTexObj;
|
||||
/* 0x20 */ const ResTIMG* mTexInfo;
|
||||
/* 0x24 */ void* mTexData;
|
||||
/* 0x28 */ JUTPalette* mEmbPalette;
|
||||
/* 0x2C */ JUTPalette* field_0x2c;
|
||||
/* 0x30 */ u8 mWrapS;
|
||||
/* 0x31 */ u8 mWrapT;
|
||||
/* 0x32 */ u8 mMinFilter;
|
||||
/* 0x33 */ u8 mMagFilter;
|
||||
/* 0x34 */ u16 mMinLOD;
|
||||
/* 0x36 */ u16 mMaxLOD;
|
||||
/* 0x38 */ s16 mLODBias;
|
||||
/* 0x3A */ u8 mTlutName;
|
||||
/* 0x3B */ u8 mFlags;
|
||||
/* 0x3C */ void* field_0x3c;
|
||||
};
|
||||
|
||||
#endif /* JUTTEXTURE_H */
|
||||
@@ -0,0 +1,74 @@
|
||||
#ifndef JUTVIDEO_H
|
||||
#define JUTVIDEO_H
|
||||
|
||||
#include "dolphin/gx/GXStruct.h"
|
||||
#include "dolphin/os/OSMessage.h"
|
||||
#include "dolphin/os/OSTime.h"
|
||||
#include "dolphin/vi/vi.h"
|
||||
|
||||
typedef u8 (*Pattern)[2];
|
||||
|
||||
class JUTVideo {
|
||||
public:
|
||||
typedef void (*Callback)(u32);
|
||||
|
||||
JUTVideo(GXRenderModeObj const*);
|
||||
virtual ~JUTVideo();
|
||||
|
||||
// TODO: return types not confirmed
|
||||
/* 802E4C54 */ static JUTVideo* createManager(GXRenderModeObj const*);
|
||||
/* 802E4CAC */ static void destroyManager();
|
||||
/* 802E5088 */ static void drawDoneStart();
|
||||
/* 802E50B0 */ static void dummyNoDrawWait();
|
||||
/* 802E5198 */ void setRenderMode(GXRenderModeObj const*);
|
||||
/* 802E5210 */ void waitRetraceIfNeed();
|
||||
|
||||
/* 802E4E50 */ static void preRetraceProc(u32);
|
||||
/* 802E5144 */ static void postRetraceProc(u32);
|
||||
/* 802E50BC */ static void drawDoneCallback();
|
||||
|
||||
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:
|
||||
static JUTVideo* sManager;
|
||||
static OSTick sVideoLastTick;
|
||||
static OSTick sVideoInterval;
|
||||
|
||||
private:
|
||||
/* 0x04 */ _GXRenderModeObj* mRenderObj;
|
||||
/* 0x08 */ u32 field_0x8;
|
||||
/* 0x0C */ u32 mRetraceCount;
|
||||
/* 0x10 */ u32 field_0x10;
|
||||
/* 0x14 */ u32 field_0x14;
|
||||
/* 0x18 */ u32 field_0x18;
|
||||
/* 0x1C */ VIRetraceCallback mPreRetraceCallback;
|
||||
/* 0x20 */ VIRetraceCallback mPostRetraceCallback;
|
||||
/* 0x24 */ Callback mPreCallback;
|
||||
/* 0x28 */ Callback mPostCallback;
|
||||
/* 0x2C */ bool mSetBlack;
|
||||
/* 0x30 */ s32 mSetBlackFrameCount;
|
||||
/* 0x34 */ OSMessage mMessage;
|
||||
/* 0x38 */ OSMessageQueue mMessageQueue;
|
||||
};
|
||||
|
||||
inline JUTVideo* JUTGetVideoManager() {
|
||||
return JUTVideo::getManager();
|
||||
}
|
||||
|
||||
#endif /* JUTVIDEO_H */
|
||||
@@ -0,0 +1,71 @@
|
||||
#ifndef JUTXFB_H
|
||||
#define JUTXFB_H
|
||||
|
||||
#include "JSystem/JUtility/JUTVideo.h"
|
||||
|
||||
typedef struct _GXRenderModeObj GXRenderModeObj;
|
||||
class JKRHeap;
|
||||
|
||||
class JUTXfb {
|
||||
public:
|
||||
enum EXfbNumber { // TODO: placeholder
|
||||
UNK_0 = 0,
|
||||
UNK_1 = 1,
|
||||
UNK_2 = 2,
|
||||
UNK_3 = 3,
|
||||
};
|
||||
|
||||
/* 802E5214 */ void clearIndex();
|
||||
/* 802E5228 */ void common_init(int);
|
||||
/* 802E5260 */ JUTXfb(_GXRenderModeObj const*, JKRHeap*, JUTXfb::EXfbNumber);
|
||||
/* 802E5308 */ ~JUTXfb();
|
||||
/* 802E5378 */ void delXfb(int);
|
||||
/* 802E53B8 */ static JUTXfb* createManager(JKRHeap*, JUTXfb::EXfbNumber);
|
||||
/* 802E5424 */ static void destroyManager();
|
||||
/* 802E5454 */ void initiate(u16, u16, JKRHeap*, JUTXfb::EXfbNumber);
|
||||
|
||||
s32 getBufferNum() const { return mBufferNum; }
|
||||
s16 getDrawnXfbIndex() const { return mDrawnXfbIndex; }
|
||||
s16 getDrawingXfbIndex() const { return mDrawingXfbIndex; }
|
||||
s16 getDisplayingXfbIndex() const { return mDisplayingXfbIndex; }
|
||||
s32 getSDrawingFlag() const { return mSDrawingFlag; }
|
||||
|
||||
void* getDrawnXfb() const {
|
||||
if (mDrawnXfbIndex >= 0)
|
||||
return mBuffer[mDrawnXfbIndex];
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void* getDrawingXfb() const {
|
||||
if (mDrawingXfbIndex >= 0)
|
||||
return mBuffer[mDrawingXfbIndex];
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void* getDisplayingXfb() const {
|
||||
if (mDisplayingXfbIndex >= 0)
|
||||
return mBuffer[mDisplayingXfbIndex];
|
||||
return NULL;
|
||||
}
|
||||
|
||||
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; }
|
||||
|
||||
private:
|
||||
static JUTXfb* sManager;
|
||||
|
||||
private:
|
||||
/* 0x00 */ void* mBuffer[3];
|
||||
/* 0x0C */ bool mXfbAllocated[3];
|
||||
/* 0x10 */ s32 mBufferNum;
|
||||
/* 0x14 */ s16 mDrawingXfbIndex;
|
||||
/* 0x16 */ s16 mDrawnXfbIndex;
|
||||
/* 0x18 */ s16 mDisplayingXfbIndex;
|
||||
/* 0x1C */ s32 mSDrawingFlag;
|
||||
};
|
||||
|
||||
#endif /* JUTXFB_H */
|
||||
@@ -0,0 +1,34 @@
|
||||
#ifndef TCOLOR_H
|
||||
#define TCOLOR_H
|
||||
|
||||
#include "dolphin/gx/GXStruct.h"
|
||||
|
||||
namespace JUtility {
|
||||
struct TColor : public GXColor {
|
||||
TColor(u8 r, u8 g, u8 b, u8 a) { set(r, g, b, a); }
|
||||
TColor() { set(0xffffffff); }
|
||||
TColor(u32 u32Color) { set(u32Color); }
|
||||
TColor(GXColor color) { set(color); }
|
||||
|
||||
// TColor(const TColor& other) { set(other.toUInt32()); }
|
||||
TColor& operator=(const TColor& other) {
|
||||
((GXColor*)this)->operator=(other);
|
||||
return *this;
|
||||
}
|
||||
|
||||
operator u32() const { return toUInt32(); }
|
||||
u32 toUInt32() const { return *(u32*)&r; }
|
||||
|
||||
void set(u8 cR, u8 cG, u8 cB, u8 cA) {
|
||||
r = cR;
|
||||
g = cG;
|
||||
b = cB;
|
||||
a = cA;
|
||||
}
|
||||
|
||||
void set(u32 u32Color) { *(u32*)&r = u32Color; }
|
||||
void set(GXColor gxColor) { *(GXColor*)&r = gxColor; }
|
||||
};
|
||||
} // namespace JUtility
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user