-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stole JKRDisposer, JKRFileLoader and JKRThread from AC, fixed them to match 100%. Also did some light matching in JKRHeap, it's better now. Next, had to change OSThread a little bit because the header was weird. Some symbols not present in sms were removed along the way because why have them when we cannot verify that they match via this particular game. Finally, added progress categories to a couple of libs.
- Loading branch information
Showing
14 changed files
with
1,129 additions
and
1,064 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifndef JKR_ENUM_H | ||
#define JKR_ENUM_H | ||
|
||
|
||
#define JKRCOMPRESSION_NONE 0 | ||
#define JKRCOMPRESSION_YAY0 1 | ||
#define JKRCOMPRESSION_YAZ0 2 | ||
#define JKRCOMPRESSION_ASR 3 | ||
|
||
enum JKRExpandSwitch | ||
{ | ||
EXPAND_SWITCH_DEFAULT, /* Do nothing? treated same as 2 */ | ||
EXPAND_SWITCH_DECOMPRESS, /* Check for compression and decompress */ | ||
EXPAND_SWITCH_NONE /* Do nothing */ | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,73 @@ | ||
#ifndef JKR_FILE_LOADER_HPP | ||
#define JKR_FILE_LOADER_HPP | ||
#ifndef JKR_FILELOADER_HPP | ||
#define JKR_FILELOADER_HPP | ||
|
||
#include <JSystem/J3D/J3DModelLoader.hpp> | ||
#include "JSystem/JKernel/JKREnum.hpp" | ||
#include "JSystem/JKernel/JKRDisposer.hpp" | ||
#include "JSystem/JSupport/JSUList.hpp" | ||
|
||
struct JKRFileLoader { | ||
static J3DModelLoaderDataBase* getGlbResource(const char*); | ||
class JKRFileFinder; | ||
|
||
class JKRFileLoader : public JKRDisposer { | ||
public: | ||
JKRFileLoader(); | ||
|
||
virtual ~JKRFileLoader(); // _08 | ||
virtual void unmount(); // _0C | ||
static JKRFileLoader* getVolume(const char*); | ||
virtual bool becomeCurrent(const char*) = 0; // _10 | ||
virtual void* getResource(const char* path) = 0; // _14 | ||
virtual void* getResource(u32 type, const char* name) = 0; // _18 | ||
virtual size_t readResource(void* resourceBuffer, u32 bufferSize, | ||
const char* path, JKRExpandSwitch expandSwitch) | ||
= 0; // _1C | ||
virtual size_t readResource(void* resourceBuffer, u32 bufferSize, u32 type, | ||
const char* name) | ||
= 0; // _20 | ||
virtual void removeResourceAll() = 0; // _24 | ||
virtual bool removeResource(void*) = 0; // _28 | ||
virtual bool detachResource(void*) = 0; // _2C | ||
virtual long getResSize(const void*) const = 0; // _30 | ||
virtual u32 countFile(const char*) const = 0; // _34 | ||
virtual JKRFileFinder* getFirstFile(const char*) const = 0; // _38 | ||
|
||
bool isMounted() const { return mIsMounted; } | ||
u32 getVolumeType() const { return mVolumeType; } | ||
|
||
static void changeDirectory(const char* dir); | ||
|
||
static void* getGlbResource(const char*); | ||
static void* getGlbResource(const char*, JKRFileLoader* fileLoader); | ||
static long getResSize(void* resourceBuffer, JKRFileLoader* fileLoader); | ||
static size_t readGlbResource(void* resourceBuffer, u32 bufferSize, | ||
const char* path, | ||
JKRExpandSwitch expandSwitch); | ||
|
||
static bool removeResource(void* resourceBuffer, JKRFileLoader* fileLoader); | ||
static bool detachResource(void* resourceBuffer, JKRFileLoader* fileLoader); | ||
|
||
static JKRFileLoader* findVolume(const char**); | ||
static JKRFileFinder* findFirstFile(const char*); | ||
static const char* fetchVolumeName(char*, long, const char*); | ||
|
||
static JKRFileLoader* getCurrentVolume() { return sCurrentVolume; } | ||
static void setCurrentVolume(JKRFileLoader* fileLoader) | ||
{ | ||
sCurrentVolume = fileLoader; | ||
} | ||
static JSUList<JKRFileLoader>& getVolumeList() { return sVolumeList; } | ||
|
||
static JKRFileLoader* sCurrentVolume; | ||
static JSUList<JKRFileLoader> sVolumeList; | ||
|
||
protected: | ||
/* 0x00 */ // vtable | ||
/* 0x04 */ // JKRDisposer | ||
JSULink<JKRFileLoader> mFileLoaderLink; // 0x18 | ||
const char* mVolumeName; // 0x28 | ||
u32 mVolumeType; // 0x2C | ||
bool mIsMounted; // 0x30 | ||
u8 field_0x31[3]; // 0x31 | ||
u32 mMountCount; // 0x34 | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#ifndef JKR_MACRO_HPP | ||
#define JKR_MACRO_HPP | ||
|
||
#define JKR_ISALIGNED(addr, alignment) ((((u32)addr) & (((u32)alignment)-1)) == 0) | ||
#define JKR_ISALIGNED32(addr) (JKR_ISALIGNED(addr, 32)) | ||
|
||
#define JKR_ISNOTALIGNED(addr, alignment) ((((u32)addr) & (((u32)alignment)-1)) != 0) | ||
#define JKR_ISNOTALIGNED32(addr) (JKR_ISNOTALIGNED(addr, 32)) | ||
|
||
#define JKR_ALIGN(addr, alignment) (((u32)addr) & (~(((u32)alignment)-1))) | ||
#define JKR_ALIGN32(addr) (JKR_ALIGN(addr, 32)) | ||
|
||
#endif |
Oops, something went wrong.