mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-07-11 05:04:42 -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();
|
||||
|
||||
@@ -13,7 +13,7 @@ extern "C" {
|
||||
// extern GXRenderModeObj GXNtsc240Int;
|
||||
// extern GXRenderModeObj GXNtsc240IntAa;
|
||||
extern GXRenderModeObj GXNtsc480IntDf;
|
||||
// extern GXRenderModeObj GXNtsc480Int;
|
||||
extern GXRenderModeObj GXNtsc480Int;
|
||||
// extern GXRenderModeObj GXNtsc480IntAa;
|
||||
// extern GXRenderModeObj GXNtsc480Prog;
|
||||
// extern GXRenderModeObj GXNtsc480ProgSoft;
|
||||
|
||||
@@ -3,9 +3,13 @@
|
||||
|
||||
#include "types.h"
|
||||
#include "dolphin/os/OSAlloc.h"
|
||||
#include "dolphin/os/OSArena.h"
|
||||
#include "dolphin/os/OSCache.h"
|
||||
#include "dolphin/os/OSContext.h"
|
||||
#include "dolphin/os/OSError.h"
|
||||
#include "dolphin/os/OSInterrupt.h"
|
||||
#include "dolphin/os/OSModule.h"
|
||||
#include "dolphin/os/OSMemory.h"
|
||||
#include "dolphin/os/OSMessage.h"
|
||||
#include "libforest/osreport.h" /* OSReport funcs */
|
||||
#include "dolphin/os/OSReset.h"
|
||||
|
||||
@@ -26,10 +26,14 @@ typedef void (*OSErrorHandler)(OSError error, OSContext *context, ...);
|
||||
#define OS_ERROR_SYSTEM_INTERRUPT 13
|
||||
#define OS_ERROR_THERMAL_INTERRUPT 14
|
||||
#define OS_ERROR_PROTECTION 15
|
||||
#define OS_ERROR_MAX (OS_ERROR_THERMAL_INTERRUPT + 1)
|
||||
#define OS_ERROR_FPE 16
|
||||
#define OS_ERROR_MAX (OS_ERROR_FPE + 1)
|
||||
|
||||
OSErrorHandler OSSetErrorHandler(OSError error, OSErrorHandler handler);
|
||||
|
||||
extern OSErrorHandler __OSErrorTable[OS_ERROR_MAX];
|
||||
extern u32 __OSFpscrEnableBits;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -11,6 +11,8 @@ static void Config24MB();
|
||||
static void Config48MB();
|
||||
u32 OSGetConsoleSimulatedMemSize(void);
|
||||
|
||||
void OSProtectRange(u32 chan, void* addr, u32 nBytes, u32 control);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
+10
-2
@@ -69,14 +69,22 @@ typedef void (*VIRetraceCallback)(u32 retraceCount);
|
||||
|
||||
#define VIPadFrameBufferWidth(width) ((u16)(((u16)(width) + 15) & ~15))
|
||||
|
||||
void VIConfigure(const struct _GXRenderModeObj *rm);
|
||||
|
||||
void VISetBlack(BOOL);
|
||||
void VIWaitForRetrace();
|
||||
void VIConfigurePan(u16 x_origin, u16 y_origin, u16 width, u16 height);
|
||||
u32 VIGetRetraceCount();
|
||||
u32 VIGetDTVStatus();
|
||||
void VIFlush();
|
||||
|
||||
void VISetNextFrameBuffer(void *fb);
|
||||
VIRetraceCallback VISetPreRetraceCallback(VIRetraceCallback callback);
|
||||
VIRetraceCallback VISetPostRetraceCallback(VIRetraceCallback callback);
|
||||
void* VIGetNextFrameBuffer();
|
||||
void* VIGetCurrentFrameBuffer();
|
||||
void VISetNextFrameBuffer(void* fb);
|
||||
|
||||
void VIInit();
|
||||
void VIFlush();
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
|
||||
@@ -13,6 +13,7 @@ void *memset(void *dest, int ch, size_t count);
|
||||
int memcmp(const void *ptr1, const void *ptr2, size_t num);
|
||||
|
||||
size_t strlen(const char *s);
|
||||
long strtol(const char *str, char **end, int base);
|
||||
char *strcpy(char *dest, const char *src);
|
||||
char *strncpy(char *dest, const char *src, size_t num);
|
||||
int strcmp(const char *s1, const char *s2);
|
||||
|
||||
Reference in New Issue
Block a user