mirror of
https://github.com/encounter/tp.git
synced 2026-07-11 06:18:46 -07:00
JKernel (#1942)
This commit is contained in:
@@ -10,7 +10,7 @@ class JKRAMCommand;
|
||||
class JKRAramBlock;
|
||||
class JKRAram : public JKRThread {
|
||||
private:
|
||||
JKRAram(u32, u32, long);
|
||||
JKRAram(u32, u32, s32);
|
||||
virtual ~JKRAram();
|
||||
|
||||
/* vt[03] */ void* run(void); /* override */
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
/* 0x98 */ u32 mStackArray[3];
|
||||
|
||||
public:
|
||||
static JKRAram* create(u32, u32, long, long, long);
|
||||
static JKRAram* create(u32, u32, s32, s32, s32);
|
||||
static void checkOkAddress(u8*, u32, JKRAramBlock*, u32);
|
||||
static void changeGroupIdIfNeed(u8*, int);
|
||||
static JKRAramBlock* mainRamToAram(u8*, u32, u32, JKRExpandSwitch, u32, JKRHeap*, int, u32*);
|
||||
@@ -67,7 +67,7 @@ private:
|
||||
static JSUList<JKRAMCommand> sAramCommandList;
|
||||
};
|
||||
|
||||
inline void* JKRAllocFromAram(u32 size, JKRAramHeap::EAllocMode allocMode) {
|
||||
inline JKRAramBlock* JKRAllocFromAram(u32 size, JKRAramHeap::EAllocMode allocMode) {
|
||||
return JKRAram::getAramHeap()->alloc(size, allocMode);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,13 +37,13 @@ public:
|
||||
|
||||
class JKRAramStream : public JKRThread {
|
||||
private:
|
||||
JKRAramStream(long);
|
||||
JKRAramStream(s32);
|
||||
virtual ~JKRAramStream();
|
||||
|
||||
/* vt[03] */ void* run(void); /* override */
|
||||
|
||||
public:
|
||||
static JKRAramStream* create(long);
|
||||
static JKRAramStream* create(s32);
|
||||
|
||||
static s32 readFromAram(void);
|
||||
static s32 writeToAram(JKRAramStreamCommand*);
|
||||
@@ -61,8 +61,12 @@ private:
|
||||
static JKRHeap* transHeap;
|
||||
};
|
||||
|
||||
inline JKRAramStream* JKRCreateAramStreamManager(long priority) {
|
||||
inline JKRAramStream* JKRCreateAramStreamManager(s32 priority) {
|
||||
return JKRAramStream::create(priority);
|
||||
}
|
||||
|
||||
inline JKRAramStreamCommand* JKRStreamToAram_Async(JSUFileInputStream *stream, u32 addr, u32 size, u32 offset, void (*callback)(u32), u32* returnSize) {
|
||||
return JKRAramStream::write_StreamToAram_Async(stream, addr, size, offset, returnSize);
|
||||
}
|
||||
|
||||
#endif /* JKRARAMSTREAM_H */
|
||||
|
||||
@@ -40,10 +40,6 @@ inline u16 read_big_endian_u16(void* ptr) {
|
||||
return ((u16)uptr[0] << 8) | ((u16)uptr[1]);
|
||||
}
|
||||
|
||||
inline u32 JKRDecompExpandSize(u8 * pBuf) {
|
||||
return (pBuf[4] << 0x18) | (pBuf[5] << 0x10) | (pBuf[6] << 8) | pBuf[7];
|
||||
}
|
||||
|
||||
extern u32 sCurrentDirID__10JKRArchive; // JKRArchive::sCurrentDirID
|
||||
|
||||
class JKRArchive : public JKRFileLoader {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
class JKRAssertHeap : public JKRHeap {
|
||||
protected:
|
||||
JKRAssertHeap(void*, unsigned long, JKRHeap*, bool);
|
||||
JKRAssertHeap(void*, u32, JKRHeap*, bool);
|
||||
virtual ~JKRAssertHeap();
|
||||
|
||||
public:
|
||||
|
||||
@@ -32,13 +32,13 @@ public:
|
||||
|
||||
class JKRDecomp : public JKRThread {
|
||||
private:
|
||||
JKRDecomp(long);
|
||||
JKRDecomp(s32);
|
||||
virtual ~JKRDecomp();
|
||||
|
||||
/* vt[03] */ virtual void* run(); /* override */
|
||||
|
||||
public:
|
||||
static JKRDecomp* create(long);
|
||||
static JKRDecomp* create(s32);
|
||||
static JKRDecompCommand* prepareCommand(u8*, u8*, u32, u32, JKRDecompCommand::AsyncCallback);
|
||||
static void sendCommand(JKRDecompCommand*);
|
||||
static bool sync(JKRDecompCommand*, int);
|
||||
@@ -58,7 +58,7 @@ inline void JKRDecompress(u8* srcBuffer, u8* dstBuffer, u32 srcLength, u32 dstLe
|
||||
JKRDecomp::orderSync(srcBuffer, dstBuffer, srcLength, dstLength);
|
||||
}
|
||||
|
||||
inline JKRDecomp* JKRCreateDecompManager(long priority) {
|
||||
inline JKRDecomp* JKRCreateDecompManager(s32 priority) {
|
||||
return JKRDecomp::create(priority);
|
||||
}
|
||||
|
||||
@@ -69,4 +69,8 @@ inline JKRCompression JKRCheckCompressed_noASR(u8 *pBuf) {
|
||||
return compression;
|
||||
}
|
||||
|
||||
inline u32 JKRDecompExpandSize(u8* pBuf) {
|
||||
return (pBuf[4] << 0x18) | (pBuf[5] << 0x10) | (pBuf[6] << 8) | pBuf[7];
|
||||
}
|
||||
|
||||
#endif /* JKRDECOMP_H */
|
||||
|
||||
@@ -20,10 +20,10 @@ public:
|
||||
/* 0x20 */ int field_0x20;
|
||||
/* 0x24 */ int field_0x24;
|
||||
/* 0x28 */ JKRDvdFile* mDvdFile;
|
||||
/* 0x2C */ u32 field_0x2c;
|
||||
/* 0x2C */ u32 mAddress;
|
||||
/* 0x30 */ JKRAramBlock* mBlock;
|
||||
/* 0x34 */ int field_0x34;
|
||||
/* 0x38 */ void (*field_0x38)(u32);
|
||||
/* 0x34 */ JKRExpandSwitch mExpandSwitch;
|
||||
/* 0x38 */ void (*mCallback)(u32);
|
||||
/* 0x3C */ u32 field_0x3c;
|
||||
/* 0x40 */ u32 field_0x40;
|
||||
/* 0x44 */ u32* field_0x44;
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
class JKRDvdFile;
|
||||
class JKRDvdAramRipper {
|
||||
public:
|
||||
static JKRAramBlock* loadToAram(long, u32, JKRExpandSwitch, u32, u32, u32*);
|
||||
static JKRAramBlock* loadToAram(s32, u32, JKRExpandSwitch, u32, u32, u32*);
|
||||
static JKRAramBlock* loadToAram(JKRDvdFile*, u32, JKRExpandSwitch, u32, u32, u32*);
|
||||
static JKRADCommand* loadToAram_Async(JKRDvdFile*, u32, JKRExpandSwitch, void (*)(u32), u32,
|
||||
u32, u32*);
|
||||
|
||||
@@ -15,7 +15,7 @@ class JKRDvdFile : public JKRFile {
|
||||
public:
|
||||
JKRDvdFile();
|
||||
JKRDvdFile(const char*);
|
||||
JKRDvdFile(long);
|
||||
JKRDvdFile(s32);
|
||||
virtual ~JKRDvdFile();
|
||||
|
||||
void initiate(void);
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
/* 0xF4 */ OSThread* mOSThread;
|
||||
|
||||
public:
|
||||
static void doneProcess(long, DVDFileInfo*);
|
||||
static void doneProcess(s32, DVDFileInfo*);
|
||||
|
||||
static JSUList<JKRDvdFile>& getDvdList() { return sDvdList; }
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
|
||||
static void* loadToMainRAM(char const*, u8*, JKRExpandSwitch, u32, JKRHeap*, EAllocDirection,
|
||||
u32, JKRCompression*, u32*);
|
||||
static void* loadToMainRAM(long, u8*, JKRExpandSwitch, u32, JKRHeap*, EAllocDirection, u32,
|
||||
static void* loadToMainRAM(s32, u8*, JKRExpandSwitch, u32, JKRHeap*, EAllocDirection, u32,
|
||||
JKRCompression*, u32*);
|
||||
static void* loadToMainRAM(JKRDvdFile*, u8*, JKRExpandSwitch, u32, JKRHeap*, EAllocDirection,
|
||||
u32, JKRCompression*, u32*);
|
||||
|
||||
@@ -8,7 +8,7 @@ public:
|
||||
JKRFile() : mIsAvailable(false) {}
|
||||
virtual ~JKRFile() {}
|
||||
|
||||
s32 read(void*, long, long);
|
||||
s32 read(void*, s32, s32);
|
||||
|
||||
bool isAvailable() const { return mIsAvailable; }
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
static bool removeResource(void*, JKRFileLoader*);
|
||||
static bool detachResource(void*, JKRFileLoader*);
|
||||
static JKRFileLoader* findVolume(const char**);
|
||||
static const char* fetchVolumeName(char*, long, const char*);
|
||||
static const char* fetchVolumeName(char*, s32, const char*);
|
||||
|
||||
static JKRFileLoader* getCurrentVolume() { return sCurrentVolume; }
|
||||
static void setCurrentVolume(JKRFileLoader* fileLoader) { sCurrentVolume = fileLoader; }
|
||||
|
||||
Reference in New Issue
Block a user