mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-05-23 06:34:18 -04:00
big progress on JUtility
This commit is contained in:
@@ -50,13 +50,14 @@ struct JUTDbPrint
|
||||
JKRHeap *mHeap; // _10
|
||||
};
|
||||
|
||||
void JUTReport(int x, int y, int show_count, const char* fmt, ...);
|
||||
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void* JC_JUTDbPrint_getManager(void);
|
||||
void JC_JUTDbPrint_setVisible(void*, int); // I know these are C++ but these were used to match a c function so I'll fix these when I need them or fix zurumode update.
|
||||
|
||||
void JUTReport(int x, int y, int show_count, const char* fmt, ...);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
#ifndef _JSYSTEM_JUT_JUTDIRECTFILE_H
|
||||
#define _JSYSTEM_JUT_JUTDIRECTFILE_H
|
||||
|
||||
#include <dolphin/dvd.h>
|
||||
#include "types.h"
|
||||
|
||||
#define JUTDF_BUFSIZE (0x800)
|
||||
|
||||
struct JUTDirectFile
|
||||
{
|
||||
JUTDirectFile();
|
||||
|
||||
~JUTDirectFile();
|
||||
|
||||
bool fopen(const char *);
|
||||
void fclose();
|
||||
int fgets(void *, int);
|
||||
|
||||
// unused/inlined
|
||||
int fetch32byte();
|
||||
void fread(void *, u32);
|
||||
void setPos(u32);
|
||||
void fgetc();
|
||||
|
||||
u8 mBuffer[0x820]; // _000, 0x20 header, 0x800 sector
|
||||
u8 *mSectorStart; // _820, ptr to 0x800 buffer
|
||||
u32 mToRead; // _824, length (max 32 bytes) to read
|
||||
u32 mLength; // _828, length of file
|
||||
u32 mPos; // _82C, position in file
|
||||
bool mIsOpen; // _830, is file open
|
||||
DVDFileInfo mFileInfo; // _834
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -2,10 +2,10 @@
|
||||
#define JUTDIRECTPRINT_H
|
||||
|
||||
#include "types.h"
|
||||
// #include "va_args.h"
|
||||
#include "JSystem/JUtility/TColor.h"
|
||||
#include "libc/stdarg.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
class JUTDirectPrint
|
||||
{
|
||||
private:
|
||||
@@ -14,20 +14,17 @@ private:
|
||||
public:
|
||||
static JUTDirectPrint *start();
|
||||
void erase(int x, int y, int w, int h);
|
||||
void setCharColor(JUtility::TColor color);
|
||||
void setCharColor(u8 r, u8 g, u8 b);
|
||||
void drawChar(int, int, int);
|
||||
void drawString(u16 x, u16 y, char *text);
|
||||
void drawString_f(u16 x, u16 y, const char * text, ...);
|
||||
void changeFrameBuffer(void *framebuffer, u16 w, u16 h );
|
||||
|
||||
// Inline/Unused
|
||||
void printSub(u16, u16, const char *, va_list *, bool);
|
||||
void printSub(u16, u16, const char *, va_list, bool); // TODO: Function signature
|
||||
void print(u16, u16, const char *, ...);
|
||||
|
||||
bool isActive() const { return mFramebuffer != nullptr; }
|
||||
void *getFrameBuffer() { return mFramebuffer; }
|
||||
JUtility::TColor getCharColor() const { return mCharColor; }
|
||||
|
||||
void changeFrameBuffer(void* fb) { changeFrameBuffer(fb, mFbWidth, mFbHeight); }
|
||||
|
||||
static JUTDirectPrint *getManager() { return sDirectPrint; }
|
||||
|
||||
@@ -44,15 +41,6 @@ private:
|
||||
size_t mFbSize; // _0C
|
||||
u8 _10[0x4]; // _10 - unknown
|
||||
u16 *mFrameMemory; // _14
|
||||
JUtility::TColor mCharColor; // _18, Color in RGBA format
|
||||
u16 mCharColorY; // _1C, 1C-2C = color in YCbCr
|
||||
u16 mCharColorCb; // _1E
|
||||
u16 mCharColorCb2; // _20
|
||||
u16 mCharColorCb4; // _22
|
||||
u16 mCharColorCr; // _24
|
||||
u16 mCharColorCr2; // _26
|
||||
u16 mCharColorCr4; // _28
|
||||
u16 _2A; // _2A
|
||||
};
|
||||
|
||||
inline void JUTChangeFrameBuffer(void *buffer, u16 height, u16 width)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
struct JUTConsole;
|
||||
struct JUTDirectPrint;
|
||||
|
||||
typedef void (*JUTErrorHandler)(s32 error, OSContext *context, u32 dsisr, u32 dar);
|
||||
typedef void (*JUTErrorHandler)(OSError error, OSContext *context, u32 dsisr, u32 dar);
|
||||
|
||||
enum ExPrintFlags
|
||||
{
|
||||
|
||||
@@ -28,7 +28,6 @@ struct JUTFader
|
||||
// unused/inlined:
|
||||
void start(int);
|
||||
void setStatus(EStatus, int);
|
||||
void setResetState(bool reset) { mResetting = reset; }
|
||||
|
||||
EStatus getStatus() const { return mStatus; }
|
||||
|
||||
@@ -38,8 +37,6 @@ struct JUTFader
|
||||
EStatus mStatus; // _04 - current status
|
||||
u16 mTicksTarget; // _08 - ticks (calls to control()) to run a fade in/out for
|
||||
u16 mTicksRun; // _0A - ticks the current fade has run
|
||||
bool mResetting; // _0C - probably exclusive to mkdd, holds true when starting the fadeout for reset, sets back to false when fading in
|
||||
u8 _0D[3]; // padding
|
||||
JUtility::TColor mColor; // _10 - color of fade
|
||||
JGeometry::TBox2f mViewBox; // _14 - ortho box to render within
|
||||
int mEStatus; // _24 - ???
|
||||
|
||||
@@ -24,8 +24,8 @@ struct JUTVideo
|
||||
static void drawDoneCallback();
|
||||
|
||||
u32 getEfbHeight() const { return mRenderModeObj->efbHeight; }
|
||||
u32 getXfbHeight() const { return mRenderModeObj->xfbHeight; }
|
||||
u32 getFbWidth() const { return (u16)mRenderModeObj->fbWidth; } // cast required for callDirectDraw
|
||||
u32 getXfbHeight() const { return mRenderModeObj->xfbHeight & 0xffff; }
|
||||
u32 getFbWidth() const { return (u16)mRenderModeObj->fbWidth; }
|
||||
void getBounds(u16& width, u16& height) const {
|
||||
width = getFbWidth();
|
||||
height = getEfbHeight();
|
||||
|
||||
Reference in New Issue
Block a user