mirror of
https://github.com/encounter/tp.git
synced 2026-07-11 06:18:46 -07:00
Various matches (#378)
* Maybe improve JMAEulerToQuat * JKRFileLoader OK * JUTCacheFont work * Match J3DModel::prepareShapePackets * JUTDirectFile OK * JUTDirectPrint OK * Work on JUTProcBar * Work on JUTResFont
This commit is contained in:
@@ -2,14 +2,25 @@
|
||||
#define JUTDIRECTFILE_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/dvd/dvd.h"
|
||||
|
||||
#define JUTDF_BUFSIZE (0x800)
|
||||
|
||||
struct JUTDirectFile {
|
||||
/* 802E8730 */ void fetch32byte();
|
||||
/* 802E8730 */ int fetch32byte();
|
||||
/* 802E87F8 */ JUTDirectFile();
|
||||
/* 802E881C */ ~JUTDirectFile();
|
||||
/* 802E8860 */ bool fopen(char const*);
|
||||
/* 802E88FC */ bool fclose();
|
||||
/* 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 */
|
||||
|
||||
@@ -48,6 +48,8 @@ struct ResFONT {
|
||||
/* 0x18 */ u16 numColumns;
|
||||
/* 0x1A */ u16 textureWidth;
|
||||
/* 0x1C */ u16 textureHeight;
|
||||
/* 0x1E */ u16 padding;
|
||||
/* 0x20 */ u8 data[];
|
||||
};
|
||||
|
||||
/* 0x00 */ u64 magic;
|
||||
|
||||
@@ -14,26 +14,35 @@ public:
|
||||
/* 802E7340 */ CTime();
|
||||
|
||||
void start(u8 param_0, u8 param_1, u8 param_2) {
|
||||
field_0x10 = param_0;
|
||||
field_0x11 = param_1;
|
||||
field_0x12 = param_2;
|
||||
mR = param_0;
|
||||
mG = param_1;
|
||||
mB = param_2;
|
||||
mTick = OSGetTick();
|
||||
}
|
||||
|
||||
void end() {
|
||||
field_0x4 = ((OSGetTick() - mTick) * 8) / ((*(u32*)0x800000F8 / 4) / 125000);
|
||||
if (field_0x4 == 0) {
|
||||
field_0x4 = 1;
|
||||
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 field_0x4;
|
||||
/* 0x04 */ u32 mCost;
|
||||
/* 0x08 */ u32 field_0x8;
|
||||
/* 0x0C */ u32 field_0xc;
|
||||
/* 0x10 */ u8 field_0x10;
|
||||
/* 0x11 */ u8 field_0x11;
|
||||
/* 0x12 */ u8 field_0x12;
|
||||
/* 0x10 */ u8 mR;
|
||||
/* 0x11 */ u8 mG;
|
||||
/* 0x12 */ u8 mB;
|
||||
};
|
||||
|
||||
class CParamSet {
|
||||
@@ -81,12 +90,12 @@ private:
|
||||
/* 0x028 */ CTime mCpu;
|
||||
/* 0x03C */ CTime mGpWait;
|
||||
/* 0x050 */ CTime mWholeLoop;
|
||||
/* 0x064 */ CTime field_0x64[8];
|
||||
/* 0x064 */ CTime mUsers[8];
|
||||
/* 0x104 */ int mCostFrame;
|
||||
/* 0x108 */ int field_0x108;
|
||||
/* 0x10C */ bool mVisible;
|
||||
/* 0x110 */ int field_0x110;
|
||||
/* 0x114 */ CParamSet field_0x114;
|
||||
/* 0x114 */ CParamSet mParams;
|
||||
/* 0x128 */ int field_0x128;
|
||||
/* 0x12C */ JKRHeap* mWatchHeap;
|
||||
/* 0x130 */ bool mHeapBarVisible;
|
||||
|
||||
@@ -10,6 +10,7 @@ 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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user