mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-11 13:08:33 -04:00
This commit is contained in:
@@ -63,15 +63,19 @@ namespace JUTAssertion {
|
||||
|
||||
u32 getSDevice();
|
||||
void showAssert_f(u32 device, const char* file, int line, const char* msg, ...);
|
||||
void showAssert_f_va(u32 device, const char* file, int line, const char* msg, __va_list args);
|
||||
void setWarningMessage_f(u32 device, char * file, int line, const char * fmt, ...);
|
||||
void setWarningMessage_f_va(u32 device, const char* file, int line, const char* msg, va_list args);
|
||||
void setLogMessage_f(u32 device, char* file, int line, const char* fmt, ...);
|
||||
void setConfirmMessage(u32 param_1, char* file, int line, bool param_4, const char* msg);
|
||||
|
||||
|
||||
inline void showAssert(u32 device, const char* file, int line, const char* msg) {
|
||||
showAssert_f(device, file, line, "%s", msg);
|
||||
}
|
||||
|
||||
inline void setWarningMessage(u32 device, char* file, int line, const char* msg) {
|
||||
setWarningMessage_f(device, file, line, "%s", msg);
|
||||
}
|
||||
};
|
||||
|
||||
extern bool sAssertVisible;
|
||||
|
||||
#endif /* JUTASSERT_H */
|
||||
|
||||
@@ -61,7 +61,16 @@ public:
|
||||
void setPagingType(EPagingType type) { mPagingType = type; }
|
||||
|
||||
static u32 calcCacheSize(u32 param_0, int param_1) { return (ALIGN_NEXT(param_0, 0x20) + 0x40) * param_1; }
|
||||
GXTexObj* getTexObj(void* buffer) { return &((TCachePage*)buffer)->mTexObj; }
|
||||
GXTexObj* getTexObj(void* buffer) const { return &((TCachePage*)buffer)->mTexObj; }
|
||||
void delete_and_initialize() { deleteMemBlocks_CacheFont(); initialize_state(); }
|
||||
|
||||
u32 getCachePage() const {
|
||||
return mCachePage;
|
||||
}
|
||||
|
||||
int getMaxSheetSize() const {
|
||||
return mMaxSheetSize;
|
||||
}
|
||||
|
||||
private:
|
||||
/* 0x70 */ u32 mTotalWidSize;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "JSystem/JGadget/linklist.h"
|
||||
#include "JSystem/JKernel/JKRDisposer.h"
|
||||
#include "JSystem/JUtility/JUTFont.h"
|
||||
#include <cstdarg>
|
||||
#include <stdarg>
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jutility
|
||||
@@ -71,15 +71,18 @@ public:
|
||||
bool isVisible() const { return mVisible; }
|
||||
void setVisible(bool visible) { mVisible = visible; }
|
||||
|
||||
u8 getLineAttr(int param_0) { return mBuf[(field_0x20 + 2) * param_0]; }
|
||||
u8 getLineAttr(int param_0) const { return mBuf[(field_0x20 + 2) * param_0]; }
|
||||
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 result;
|
||||
int diff = param_1 - param_0;
|
||||
if (diff >= 0) {
|
||||
return diff;
|
||||
result = diff;
|
||||
} else {
|
||||
result = diff + mMaxLines;
|
||||
}
|
||||
return diff += mMaxLines;
|
||||
return result;
|
||||
}
|
||||
|
||||
int prevIndex(int index) const {
|
||||
|
||||
@@ -28,10 +28,10 @@ public:
|
||||
JUTDbPrint(JUTFont*, JKRHeap*);
|
||||
static JUTDbPrint* start(JUTFont*, JKRHeap*);
|
||||
JUTFont* changeFont(JUTFont*);
|
||||
void enter(int, int, int, char const*, int);
|
||||
void enter(int, int, int, const char*, int);
|
||||
void flush(int, int, int, int);
|
||||
void flush();
|
||||
void drawString(int, int, int, u8 const*);
|
||||
void drawString(int, int, int, const u8*);
|
||||
|
||||
static JUTDbPrint* getManager() { return sDebugPrint; }
|
||||
|
||||
|
||||
@@ -17,6 +17,8 @@ struct JUTDirectFile {
|
||||
void fclose();
|
||||
int fgets(void*, int);
|
||||
|
||||
bool isOpened() const { return mIsOpen; }
|
||||
|
||||
/* 0x000 */ u8 mBuffer[0x820];
|
||||
/* 0x820 */ u8* mSectorStart;
|
||||
/* 0x824 */ u32 mToRead;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define JUTDIRECTPRINT_H
|
||||
|
||||
#include "JSystem/JUtility/TColor.h"
|
||||
#include <cstdarg>
|
||||
#include <stdarg>
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jutility
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "JSystem/JKernel/JKRThread.h"
|
||||
#include "JSystem/JUtility/JUTGamePad.h"
|
||||
#include <cstdarg>
|
||||
#include <stdarg>
|
||||
#include <dolphin/gx.h>
|
||||
#include <dolphin/os.h>
|
||||
#include "global.h"
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
|
||||
class JUTExMapFile {
|
||||
public:
|
||||
JUTExMapFile(char* path) : mLink(this) { mPath = path; }
|
||||
JUTExMapFile(const char* path) : mLink(this) { mPath = const_cast<char*>(path); }
|
||||
|
||||
public:
|
||||
/* 0x00 */ char* mPath;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define JUTFONT_H
|
||||
|
||||
#include "JSystem/JUtility/TColor.h"
|
||||
#include "string.h"
|
||||
#include <string>
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jutility
|
||||
@@ -114,8 +114,8 @@ public:
|
||||
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);
|
||||
s32 drawString_size(int posX, int posY, const char* str, u32 len, bool visible) {
|
||||
return drawString_size_scale(posX, posY, getWidth(), getHeight(), str, len, visible);
|
||||
}
|
||||
|
||||
void drawString_scale(f32 posX, f32 posY, f32 width, f32 height, const char* str,
|
||||
@@ -132,6 +132,10 @@ public:
|
||||
bool isValid() const { return mValid; }
|
||||
bool isFixed() const { return mFixed; }
|
||||
int getFixedWidth() const { return mFixedWidth; }
|
||||
void setFixedWidth(bool fixed, int width) {
|
||||
mFixed = fixed;
|
||||
mFixedWidth = width;
|
||||
}
|
||||
int getOffset(int i_no) const {
|
||||
JUTFont::TWidth width;
|
||||
getWidthEntry(i_no, &width);
|
||||
|
||||
@@ -61,6 +61,7 @@ public:
|
||||
void checkResetCallback(OSTime holdTime);
|
||||
void update();
|
||||
void stopPatternedRumble() { mRumble.stopPatternedRumble(mPortNum); }
|
||||
void setButtonRepeat(u32, u32, u32);
|
||||
|
||||
static void checkResetSwitch();
|
||||
static void clearForReset();
|
||||
@@ -72,6 +73,8 @@ public:
|
||||
PADSetAnalogMode(mode);
|
||||
}
|
||||
|
||||
static int getClampMode() { return sClampMode; }
|
||||
|
||||
static void clearResetOccurred() { C3ButtonReset::sResetOccurred = false; }
|
||||
|
||||
static void setResetCallback(callbackFn callback, void* arg) {
|
||||
@@ -81,6 +84,8 @@ public:
|
||||
|
||||
u32 getButton() const { return mButton.mButton; }
|
||||
u32 getTrigger() const { return mButton.mTrigger; }
|
||||
u32 getRelease() const { return mButton.mRelease; }
|
||||
u32 getRepeat() const { return mButton.mRepeat; }
|
||||
f32 getMainStickX() const { return mMainStick.mPosX; }
|
||||
f32 getMainStickY() const { return mMainStick.mPosY; }
|
||||
f32 getMainStickValue() const { return mMainStick.mValue; }
|
||||
@@ -100,6 +105,7 @@ public:
|
||||
JUTGamePadRecordBase* getPadReplay() const { return mPadReplay; }
|
||||
JUTGamePadRecordBase* getPadRecord() const { return mPadRecord; }
|
||||
|
||||
bool testButton(u32 button) const { return mButton.mButton & button; }
|
||||
bool testTrigger(u32 button) const { return mButton.mTrigger & button; }
|
||||
|
||||
bool isPushing3ButtonReset() const {
|
||||
@@ -108,7 +114,7 @@ public:
|
||||
|
||||
void stopMotorWave() { mRumble.stopPatternedRumbleAtThePeriod(); }
|
||||
void stopMotor() { mRumble.stopMotor(mPortNum, false); }
|
||||
void stopMotorHard() { mRumble.stopMotorHard(mPortNum); }
|
||||
void stopMotorHard() { CRumble::stopMotorHard(mPortNum); }
|
||||
|
||||
static s8 getPortStatus(EPadPort port) {
|
||||
JUT_ASSERT(360, 0 <= port && port < 4);
|
||||
@@ -178,7 +184,7 @@ public:
|
||||
CRumble(JUTGamePad* pad) { clear(pad); }
|
||||
|
||||
static u32 sChannelMask[4];
|
||||
static bool mStatus[4];
|
||||
static u8 mStatus[4];
|
||||
static u32 mEnabled;
|
||||
|
||||
enum ERumble {
|
||||
@@ -198,9 +204,18 @@ public:
|
||||
void stopPatternedRumbleAtThePeriod();
|
||||
static void setEnabled(u32 mask);
|
||||
|
||||
void stopMotorHard(int port) { stopMotor(port, true); }
|
||||
static void stopMotor(int port) { stopMotor(port, false); }
|
||||
static void stopMotorHard(int port) { stopMotor(port, true); }
|
||||
|
||||
static bool isEnabled(u32 mask) { return mEnabled & mask; }
|
||||
static bool isEnabled(u32 mask) {
|
||||
bool result;
|
||||
if (mEnabled & mask) {
|
||||
result = true;
|
||||
} else {
|
||||
result = false;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static bool isEnabledPort(int port) {
|
||||
JUT_ASSERT(250, 0 <= port && port < 4);
|
||||
@@ -271,4 +286,6 @@ struct JUTGamePadLongPress {
|
||||
/* 0x50 */ s32 field_0x50;
|
||||
};
|
||||
|
||||
inline void JUTReadGamePad() { JUTGamePad::read(); }
|
||||
|
||||
#endif /* JUTGAMEPAD_H */
|
||||
|
||||
@@ -13,12 +13,13 @@ public:
|
||||
|
||||
virtual ~JUTGraphFifo();
|
||||
|
||||
void getGpStatus() {
|
||||
static bool* getGpStatus() {
|
||||
GXGetGPStatus((GXBool*)&mGpStatus[0], (GXBool*)&mGpStatus[1], (GXBool*)&mGpStatus[2],
|
||||
(GXBool*)&mGpStatus[3], (GXBool*)&mGpStatus[4]);
|
||||
return mGpStatus;
|
||||
}
|
||||
|
||||
bool isGPActive() {
|
||||
static bool isGPActive() {
|
||||
getGpStatus();
|
||||
return mGpStatus[2] == false;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ struct ResTLUT {
|
||||
*/
|
||||
class JUTPalette {
|
||||
public:
|
||||
JUTPalette(_GXTlut p1, _GXTlutFmt p2, JUTTransparency p3, u16 p4, void* p5) {
|
||||
JUTPalette(GXTlut p1, GXTlutFmt p2, JUTTransparency p3, u16 p4, void* p5) {
|
||||
this->storeTLUT(p1, p2, p3, p4, p5);
|
||||
}
|
||||
|
||||
@@ -29,18 +29,18 @@ public:
|
||||
storeTLUT(tlutNo, p_tlutRes);
|
||||
}
|
||||
|
||||
void storeTLUT(_GXTlut, ResTLUT*);
|
||||
void storeTLUT(_GXTlut, _GXTlutFmt, JUTTransparency, u16, void*);
|
||||
void storeTLUT(GXTlut, ResTLUT*);
|
||||
void storeTLUT(GXTlut, GXTlutFmt, JUTTransparency, u16, void*);
|
||||
bool load();
|
||||
|
||||
u8 getTlutName() const { return mTlutName; }
|
||||
u8 getFormat() const { return mFormat; }
|
||||
u8 getTransparency() const { return mTransparency; }
|
||||
GXTlut getTlutName() const { return GXTlut(mTlutName); }
|
||||
GXTlutFmt getFormat() const { return GXTlutFmt(mFormat); }
|
||||
JUTTransparency getTransparency() const { return JUTTransparency(mTransparency); }
|
||||
u16 getNumColors() const { return mNumColors; }
|
||||
ResTLUT* getColorTable() const { return mColorTable; }
|
||||
|
||||
private:
|
||||
/* 0x00 */ _GXTlutObj mTlutObj;
|
||||
/* 0x00 */ GXTlutObj mTlutObj;
|
||||
/* 0x0C */ u8 mTlutName;
|
||||
/* 0x0D */ u8 mFormat;
|
||||
/* 0x10 */ ResTLUT* mColorTable;
|
||||
|
||||
@@ -62,6 +62,7 @@ public:
|
||||
/* 0x0C */ int mWidth;
|
||||
/* 0x10 */ int mUserPosition;
|
||||
|
||||
CParamSet() {}
|
||||
void setBarWidth(int width) { mBarWidth = width; }
|
||||
void setPosition(int x, int y) {
|
||||
mPosX = x;
|
||||
|
||||
@@ -79,6 +79,7 @@ public:
|
||||
/* 0x6C */ const IsLeadByte_func* mIsLeadByte;
|
||||
};
|
||||
|
||||
extern u8 const JUTResFONT_Ascfont_fix12[16736];
|
||||
extern u8 const JUTResFONT_Ascfont_fix12[];
|
||||
extern u8 const JUTResFONT_Ascfont_fix16[];
|
||||
|
||||
#endif /* JUTRESFONT_H */
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define JUTTEXTURE_H
|
||||
|
||||
#include <dolphin/gx.h>
|
||||
#include <stdint.h>
|
||||
#include <stdint>
|
||||
|
||||
class JUTPalette;
|
||||
|
||||
@@ -59,24 +59,23 @@ public:
|
||||
}
|
||||
|
||||
~JUTTexture();
|
||||
void storeTIMG(ResTIMG const*, JUTPalette*, _GXTlut);
|
||||
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(GXTlut);
|
||||
void initTexObj();
|
||||
void load(_GXTexMapID);
|
||||
void load(GXTexMapID);
|
||||
|
||||
const ResTIMG* getTexInfo() const { return mTexInfo; }
|
||||
s32 getFormat() const { return mTexInfo->format; }
|
||||
s32 getTransparency() { return mTexInfo->alphaEnabled; }
|
||||
s32 getTransparency() const { 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; }
|
||||
bool getCaptureFlag() const { return mFlags & 1; }
|
||||
bool getEmbPaletteDelFlag() const { return mFlags & 2; }
|
||||
void setEmbPaletteDelFlag(bool flag) { mFlags = (mFlags & 1) | (flag << 1);}
|
||||
int getTlutName() const { return mTlutName; }
|
||||
bool operator==(const JUTTexture& other) {
|
||||
|
||||
@@ -28,16 +28,20 @@ public:
|
||||
static void destroyManager();
|
||||
void initiate(u16, u16, JKRHeap*, JUTXfb::EXfbNumber);
|
||||
|
||||
s32 getBufferNum() const { return mBufferNum; }
|
||||
s32 getBufferNum() { 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* result;
|
||||
if (mDrawnXfbIndex >= 0) {
|
||||
result = mBuffer[mDrawnXfbIndex];
|
||||
} else {
|
||||
result = NULL;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void* getDrawingXfb() const {
|
||||
|
||||
Reference in New Issue
Block a user