mirror of
https://github.com/zeldaret/tww.git
synced 2026-05-24 23:21:31 -04:00
Merge remote-tracking branch 'upstream/main'
This commit is contained in:
+6
-6
@@ -252,13 +252,13 @@ config.libs = [
|
||||
Object(NonMatching, "m_Do/m_Do_ext.cpp"),
|
||||
Object(NonMatching, "m_Do/m_Do_lib.cpp"),
|
||||
Object(Matching, "m_Do/m_Do_hostIO.cpp"),
|
||||
Object(NonMatching, "m_Do/m_Do_Reset.cpp"),
|
||||
Object(Matching, "m_Do/m_Do_Reset.cpp"),
|
||||
Object(NonMatching, "m_Do/m_Do_dvd_thread.cpp"),
|
||||
Object(NonMatching, "m_Do/m_Do_DVDError.cpp"),
|
||||
Object(Matching, "m_Do/m_Do_DVDError.cpp"),
|
||||
Object(NonMatching, "m_Do/m_Do_MemCard.cpp"),
|
||||
Object(NonMatching, "m_Do/m_Do_MemCardRWmng.cpp"),
|
||||
Object(NonMatching, "m_Do/m_Do_gba_com.cpp"),
|
||||
Object(NonMatching, "m_Do/m_Do_machine_exception.cpp"),
|
||||
Object(Matching, "m_Do/m_Do_machine_exception.cpp"),
|
||||
|
||||
# c
|
||||
Object(NonMatching, "c/c_damagereaction.cpp"),
|
||||
@@ -395,7 +395,7 @@ config.libs = [
|
||||
Object(NonMatching, "d/d_wood.cpp"),
|
||||
Object(NonMatching, "d/d_flower.cpp"),
|
||||
Object(NonMatching, "d/d_item_data.cpp"),
|
||||
Object(NonMatching, "d/d_seafightgame.cpp"),
|
||||
Object(Matching, "d/d_seafightgame.cpp"),
|
||||
Object(NonMatching, "d/d_spline_path.cpp"),
|
||||
Object(NonMatching, "d/d_s_actor_data_mng.cpp"),
|
||||
Object(NonMatching, "d/d_item.cpp"),
|
||||
@@ -760,13 +760,13 @@ config.libs = [
|
||||
Object(NonMatching, "JSystem/JKernel/JKRExpHeap.cpp"),
|
||||
Object(NonMatching, "JSystem/JKernel/JKRSolidHeap.cpp"),
|
||||
Object(Matching, "JSystem/JKernel/JKRDisposer.cpp"),
|
||||
Object(NonMatching, "JSystem/JKernel/JKRThread.cpp"),
|
||||
Object(Matching, "JSystem/JKernel/JKRThread.cpp"),
|
||||
Object(NonMatching, "JSystem/JKernel/JKRAram.cpp"),
|
||||
Object(NonMatching, "JSystem/JKernel/JKRAramHeap.cpp"),
|
||||
Object(NonMatching, "JSystem/JKernel/JKRAramBlock.cpp"),
|
||||
Object(NonMatching, "JSystem/JKernel/JKRAramPiece.cpp"),
|
||||
Object(NonMatching, "JSystem/JKernel/JKRAramStream.cpp"),
|
||||
Object(NonMatching, "JSystem/JKernel/JKRFileLoader.cpp"),
|
||||
Object(Matching, "JSystem/JKernel/JKRFileLoader.cpp"),
|
||||
Object(NonMatching, "JSystem/JKernel/JKRFileFinder.cpp"),
|
||||
Object(NonMatching, "JSystem/JKernel/JKRFileCache.cpp"),
|
||||
Object(NonMatching, "JSystem/JKernel/JKRArchivePub.cpp"),
|
||||
|
||||
@@ -27,8 +27,6 @@ public:
|
||||
private:
|
||||
/* 0x00 */ // vtable
|
||||
/* 0x04 */ // JKRArchive
|
||||
/* 0x5C */ JKRCompression mCompression;
|
||||
/* 0x60 */ EMountDirection mMountDirection;
|
||||
/* 0x64 */ JKRAramBlock* mBlock;
|
||||
/* 0x68 */ JKRDvdFile* mDvdFile;
|
||||
}; // Size = 0x6C
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "JSystem/JKernel/JKRFileLoader.h"
|
||||
#include "global.h"
|
||||
|
||||
class JKRArcFinder;
|
||||
class JKRHeap;
|
||||
|
||||
struct SArcHeader {
|
||||
@@ -129,7 +130,8 @@ public:
|
||||
void* getResource(u16);
|
||||
u32 readIdxResource(void*, u32, u32);
|
||||
u32 readResource(void*, u32, u16);
|
||||
u32 countResource(void) const;
|
||||
u32 countResource(u32) const;
|
||||
JKRArcFinder* getFirstResource(u32) const;
|
||||
u32 getFileAttribute(u32) const;
|
||||
|
||||
SDIFileEntry* findNameResource(const char*) const;
|
||||
@@ -182,13 +184,16 @@ public:
|
||||
|
||||
protected:
|
||||
/* 0x58 */ u32 field_0x58;
|
||||
/* 0x5C */ JKRCompression mCompression;
|
||||
/* 0x60 */ EMountDirection mMountDirection;
|
||||
|
||||
public:
|
||||
static JKRArchive* check_mount_already(s32, JKRHeap*);
|
||||
static JKRArchive* check_mount_already(s32);
|
||||
static JKRArchive* mount(const char*, EMountMode, JKRHeap*, EMountDirection);
|
||||
static JKRArchive* mount(void*, JKRHeap*, EMountDirection);
|
||||
static JKRArchive* mount(s32, EMountMode, JKRHeap*, EMountDirection);
|
||||
static void* getGlbResource(u32, const char*, JKRArchive*);
|
||||
static void readTypeResource(void*, u32, u32, const char*, JKRArchive*);
|
||||
|
||||
static JKRCompression convertAttrToCompressionType(u32 attr) {
|
||||
#define JKRARCHIVE_ATTR_COMPRESSION 0x04
|
||||
|
||||
@@ -24,8 +24,6 @@ public:
|
||||
private:
|
||||
/* 0x00 */ // vtable
|
||||
/* 0x04 */ // JKRArchive
|
||||
/* 0x5C */ int mCompression;
|
||||
/* 0x60 */ EMountDirection mMountDirection;
|
||||
/* 0x64 */ int field_0x64;
|
||||
/* 0x68 */ JKRAramBlock* mAramPart;
|
||||
/* 0x6C */ int field_0x6c;
|
||||
|
||||
@@ -23,8 +23,6 @@ public:
|
||||
private:
|
||||
/* 0x00 */ // vtable
|
||||
/* 0x04 */ // JKRArchive
|
||||
/* 0x5C */ JKRCompression mCompression;
|
||||
/* 0x60 */ EMountDirection mMountDirection;
|
||||
/* 0x64 */ s32 field_0x64;
|
||||
/* 0x68 */ JKRDvdFile* mDvdFile;
|
||||
};
|
||||
|
||||
@@ -56,11 +56,12 @@ protected:
|
||||
void removeUsedBlock(CMemBlock* block);
|
||||
void recycleFreeBlock(CMemBlock* block);
|
||||
void joinTwoBlocks(CMemBlock* block);
|
||||
bool dump_sort_by_address();
|
||||
|
||||
public:
|
||||
s32 getUsedSize(u8 groupId) const;
|
||||
s32 getTotalUsedSize(void) const;
|
||||
|
||||
|
||||
CMemBlock* getHeadUsedList() const { return mHeadUsedList; }
|
||||
void setAllocationMode(EAllocMode mode) {
|
||||
mAllocMode = mode;
|
||||
@@ -76,7 +77,7 @@ public:
|
||||
/* vt[10] */ virtual void do_free(void* ptr); /* override */
|
||||
/* vt[11] */ virtual void do_freeAll(); /* override */
|
||||
/* vt[12] */ virtual void do_freeTail(); /* override */
|
||||
/* vt[13] */ virtual void do_fillFreeArea(); /* override */
|
||||
/* vt[13] */ virtual void do_freeFill(); /* override */
|
||||
/* vt[14] */ virtual s32 do_resize(void* ptr, u32 size); /* override */
|
||||
/* vt[15] */ virtual s32 do_getSize(void* ptr); /* override */
|
||||
/* vt[16] */ virtual s32 do_getFreeSize(); /* override */
|
||||
@@ -84,7 +85,7 @@ public:
|
||||
/* vt[18] */ virtual s32 do_getTotalFreeSize(); /* override */
|
||||
/* vt[19] */ virtual s32 do_changeGroupID(u8 newGroupID); /* override */
|
||||
/* vt[20] */ virtual u8 do_getCurrentGroupId(); /* override */
|
||||
/* vt[21] */ virtual u32 state_register(JKRHeap::TState* p, u32 id) const; /* override */
|
||||
/* vt[21] */ virtual void state_register(JKRHeap::TState* p, u32 id) const; /* override */
|
||||
/* vt[22] */ virtual bool state_compare(JKRHeap::TState const& r1,
|
||||
JKRHeap::TState const& r2) const; /* override */
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
/* vt[10] */ virtual void do_free(void* ptr) = 0;
|
||||
/* vt[11] */ virtual void do_freeAll() = 0;
|
||||
/* vt[12] */ virtual void do_freeTail() = 0;
|
||||
/* vt[13] */ virtual void do_fillFreeArea() = 0;
|
||||
/* vt[13] */ virtual void do_freeFill() = 0;
|
||||
/* vt[14] */ virtual s32 do_resize(void* ptr, u32 size) = 0;
|
||||
/* vt[15] */ virtual s32 do_getSize(void* ptr) = 0;
|
||||
/* vt[16] */ virtual s32 do_getFreeSize() = 0;
|
||||
|
||||
@@ -31,8 +31,6 @@ public:
|
||||
private:
|
||||
/* 0x00 */ // vtable
|
||||
/* 0x04 */ // JKRArchive
|
||||
/* 0x5C */ JKRCompression mCompression;
|
||||
/* 0x60 */ EMountDirection mMountDirection;
|
||||
/* 0x64 */ SArcHeader* mArcHeader;
|
||||
/* 0x68 */ u8* mArchiveData;
|
||||
/* 0x6C */ bool mIsOpen;
|
||||
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
/* vt[10] */ virtual void do_free(void*); /* override */
|
||||
/* vt[11] */ virtual void do_freeAll(void); /* override */
|
||||
/* vt[12] */ virtual void do_freeTail(void); /* override */
|
||||
/* vt[13] */ virtual void do_fillFreeArea(void); /* override */
|
||||
/* vt[13] */ virtual void do_freeFill(void); /* override */
|
||||
/* vt[14] */ virtual s32 do_resize(void*, u32); /* override */
|
||||
/* vt[15] */ virtual s32 do_getSize(void*); /* override */
|
||||
/* vt[16] */ virtual s32 do_getFreeSize(void); /* override */
|
||||
|
||||
@@ -14,53 +14,11 @@ struct JKRThreadName_ {
|
||||
class JUTConsole;
|
||||
class JKRThread : JKRDisposer {
|
||||
public:
|
||||
class TLoad {
|
||||
public:
|
||||
TLoad() {
|
||||
clear();
|
||||
mValid = false;
|
||||
mThreadId = 0;
|
||||
}
|
||||
|
||||
bool isValid() const { return mValid; }
|
||||
u32 getCost() const { return mCost; }
|
||||
u32 getCount() const { return mSwitchCount; }
|
||||
s32 getId() const { return mThreadId; }
|
||||
|
||||
void setValid(bool valid) { mValid = valid; }
|
||||
void setId(s32 id) { mThreadId = id; }
|
||||
void setCurrentTime() { mLastTick = OSGetTick(); }
|
||||
|
||||
void resetCost() { mCost = 0; }
|
||||
void resetCount() { mSwitchCount = 0; }
|
||||
|
||||
void incCount() { mSwitchCount++; }
|
||||
void addCurrentCost() { mCost = mCost + (OSGetTick() - mLastTick); }
|
||||
|
||||
void clear() {
|
||||
resetCount();
|
||||
resetCost();
|
||||
mLastTick = 0;
|
||||
}
|
||||
|
||||
private:
|
||||
/* 0x00 */ bool mValid;
|
||||
/* 0x01 */ u8 padding_0x61[3];
|
||||
/* 0x04 */ u32 mCost;
|
||||
/* 0x08 */ u32 mSwitchCount;
|
||||
/* 0x0C */ OSTick mLastTick;
|
||||
/* 0x10 */ s32 mThreadId;
|
||||
};
|
||||
|
||||
JKRThread(u32 stack_size, int message_count, int param_3);
|
||||
JKRThread(JKRHeap* heap, u32 stack_size, int message_count, int param_4);
|
||||
JKRThread(OSThread* thread, int message_count);
|
||||
virtual ~JKRThread();
|
||||
|
||||
/* vt[03] */ virtual void* run();
|
||||
|
||||
void setCommon_mesgQueue(JKRHeap* heap, int message_count);
|
||||
void setCommon_heapSpecified(JKRHeap* heap, u32 stack_size, int param_3);
|
||||
/* vt[03] */ virtual void* run() { return NULL; }
|
||||
|
||||
OSThread* getThreadRecord() const { return mThreadRecord; }
|
||||
void* getStack() const { return mStackMemory; }
|
||||
@@ -122,9 +80,6 @@ typedef void (*JKRThreadSwitch_PostCallback)(OSThread* current, OSThread* next);
|
||||
class JKRThreadSwitch {
|
||||
public:
|
||||
JKRThreadSwitch(JKRHeap*);
|
||||
virtual void draw(JKRThreadName_* param_1, JUTConsole* param_2);
|
||||
virtual void draw(JKRThreadName_* param_1);
|
||||
virtual ~JKRThreadSwitch();
|
||||
|
||||
static JKRThreadSwitch* createManager(JKRHeap* heap);
|
||||
|
||||
@@ -145,13 +100,9 @@ private:
|
||||
/* 0x00 */ // vtable
|
||||
/* 0x04 */ JKRHeap* mHeap;
|
||||
/* 0x08 */ bool mSetNextHeap;
|
||||
/* 0x09 */ u8 field_0x9[3];
|
||||
/* 0x0C */ u32 field_0xC;
|
||||
/* 0x10 */ u32 field_0x10;
|
||||
/* 0x14 */ u8 field_0x14[4];
|
||||
/* 0x18 */ s64 field_0x18;
|
||||
/* 0x20 */ u32 field_0x20;
|
||||
/* 0x24 */ u32 field_0x24;
|
||||
|
||||
public:
|
||||
virtual ~JKRThreadSwitch() {}
|
||||
};
|
||||
|
||||
struct JKRTask {
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
#ifndef D_A_MGAMEBOARD_H
|
||||
#define D_A_MGAMEBOARD_H
|
||||
|
||||
#include "f_op/f_op_actor_mng.h"
|
||||
#include "d/d_seafightgame.h"
|
||||
#include "d/d_lib.h"
|
||||
|
||||
class dDlst_2DNumber_c;
|
||||
class dDlst_2DMinigame_c;
|
||||
class dDlst_2DObject_c;
|
||||
|
||||
class daMgBoard_c : public fopAc_ac_c {
|
||||
public:
|
||||
void checkClearGame();
|
||||
void getScore();
|
||||
void reqStartGame();
|
||||
void checkEndGame();
|
||||
void setGInfoDraw();
|
||||
void clrGInfoDraw();
|
||||
void CreateHeap();
|
||||
void set_2dposition();
|
||||
void CreateInit();
|
||||
void MiniGameInit();
|
||||
void set_mtx();
|
||||
void _execute();
|
||||
void execGameMain();
|
||||
void execEndGame();
|
||||
void MinigameMain();
|
||||
void CursorMove();
|
||||
void _draw();
|
||||
|
||||
/* 0x290 */ request_of_phase_process_class mPhase;
|
||||
/* 0x298 */ J3DModel* mpBoardModel;
|
||||
/* 0x29C */ J3DModel* mpCursorModel;
|
||||
/* 0x2A0 */ J3DModel* mpHitModel[20];
|
||||
/* 0x2F0 */ J3DModel* mpMissModel[32];
|
||||
/* 0x370 */ J3DModel* mpShip2Model[2];
|
||||
/* 0x378 */ J3DModel* mpShip3Model[2];
|
||||
/* 0x380 */ J3DModel* mpShip4Model;
|
||||
/* 0x384 */ u8 field_0x384[0x468 - 0x384];
|
||||
/* 0x468 */ u8 mBoardPosX;
|
||||
/* 0x469 */ u8 mBoardPosY;
|
||||
/* 0x46A */ u8 field_0x46A[0x46C - 0x46A];
|
||||
/* 0x46C */ int mLastFirePosX;
|
||||
/* 0x470 */ int mLastFirePosY;
|
||||
/* 0x474 */ u8 field_0x474[0x47C - 0x474];
|
||||
/* 0x47C */ dSeaFightGame_info_c mSeaFightGame;
|
||||
/* 0x57C */ u8 field_0x57C[0x580 - 0x57C];
|
||||
/* 0x580 */ int mMissModelCount;
|
||||
/* 0x584 */ int mHitModelCount;
|
||||
/* 0x588 */ s16 mMinigameStartIdx;
|
||||
/* 0x58A */ s16 mMinigameEndIdx;
|
||||
/* 0x58C */ STControl mStickControl;
|
||||
/* 0x5B4 */ cXyz mNPCPos;
|
||||
/* 0x5C0 */ dDlst_2DNumber_c* mpNumber0;
|
||||
/* 0x5C4 */ dDlst_2DNumber_c* mpNumber1;
|
||||
/* 0x5C8 */ dDlst_2DMinigame_c* mpMinigameDList;
|
||||
/* 0x5CC */ dDlst_2DObject_c* mpSquidIcon[3];
|
||||
/* 0x5D8 */ u8 mpBombIcons;
|
||||
/* 0x5D9 */ u8 field_0x5D9[0x638 - 0x5D9];
|
||||
/* 0x638 */ int mState;
|
||||
/* 0x63C */ u8 mbDraw;
|
||||
/* 0x63D */ u8 mbStartGame;
|
||||
/* 0x63E */ u8 mbEndGame;
|
||||
/* 0x63F */ u8 mbForceEnd;
|
||||
/* 0x640 */ u8 mTimer;
|
||||
};
|
||||
|
||||
#endif /* D_A_MGAMEBOARD_H */
|
||||
+4
-1
@@ -4,10 +4,13 @@
|
||||
#include "f_op/f_op_actor_mng.h"
|
||||
#include "d/d_cc_d.h"
|
||||
|
||||
class dBgS_GndChk;
|
||||
class cBgS_PolyInfo;
|
||||
|
||||
namespace daObj {
|
||||
template <typename T>
|
||||
int PrmAbstract(const fopAc_ac_c* actor, T width, T shift) {
|
||||
u32 param = fopAcM_GetParam(actor);
|
||||
u32 param = fopAcM_GetParam((fopAc_ac_c*)actor);
|
||||
return ((1 << width) - 1) & (param >> shift);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
#ifndef D_LIB_H
|
||||
#define D_LIB_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
class STControl {
|
||||
public:
|
||||
void STControl(s16, s16, s16, s16, f32, f32, s16, s16);
|
||||
void setWaitParm(s16, s16, s16, s16, f32, f32, s16, s16);
|
||||
void init();
|
||||
void Xinit();
|
||||
void Yinit();
|
||||
void getValueStick();
|
||||
void getAngleStick();
|
||||
void checkTrigger();
|
||||
void checkLeftTrigger();
|
||||
void checkRightTrigger();
|
||||
void checkUpTrigger();
|
||||
void checkDownTrigger();
|
||||
|
||||
/* 0x00 */ void* vtbl;
|
||||
/* 0x04 */ f32 field_0x04;
|
||||
/* 0x08 */ f32 field_0x08;
|
||||
/* 0x0C */ u8 field_0x0c;
|
||||
/* 0x0D */ u8 field_0x0d;
|
||||
/* 0x0E */ u16 field_0x0e;
|
||||
/* 0x10 */ u16 field_0x10;
|
||||
/* 0x12 */ u16 field_0x12;
|
||||
/* 0x14 */ s16 field_0x14;
|
||||
/* 0x16 */ s16 field_0x16;
|
||||
/* 0x18 */ u16 field_0x18;
|
||||
/* 0x1A */ u16 field_0x1a;
|
||||
/* 0x1C */ u16 field_0x1c;
|
||||
/* 0x1E */ u16 field_0x1e;
|
||||
/* 0x20 */ u16 field_0x20;
|
||||
/* 0x22 */ u16 field_0x22;
|
||||
/* 0x24 */ s16 field_0x24;
|
||||
/* 0x26 */ s16 field_0x26;
|
||||
};
|
||||
|
||||
#endif /* D_LIB_H */
|
||||
@@ -0,0 +1,32 @@
|
||||
#ifndef D_SEAFIGHTGAME_H
|
||||
#define D_SEAFIGHTGAME_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
struct dSeaFightGame_ship_data {
|
||||
/* 0x0 */ u8 m_pos[4][2];
|
||||
/* 0x8 */ u8 field_0x8;
|
||||
/* 0x9 */ u8 field_0x9;
|
||||
/* 0xA */ u8 field_0xa;
|
||||
/* 0xB */ u8 field_0xb;
|
||||
/* 0xC */ u8 field_0xc;
|
||||
/* 0xD */ u8 field_0xd;
|
||||
/* 0xE */ u8 field_0xe;
|
||||
};
|
||||
|
||||
class dSeaFightGame_info_c {
|
||||
public:
|
||||
int init(int, int);
|
||||
int put_ship(u8, u8);
|
||||
bool checkPutShip(int, int, int, int);
|
||||
int attack(u8, u8);
|
||||
|
||||
/* 0x00 */ u8 mGrid[8][8];
|
||||
/* 0x40 */ dSeaFightGame_ship_data mShips[4];
|
||||
/* 0x7C */ u8 mAliveShipNum;
|
||||
/* 0x7D */ u8 mBulletNum;
|
||||
/* 0x7E */ u8 mScore;
|
||||
/* 0x80 */ int mDeadShipNum;
|
||||
};
|
||||
|
||||
#endif /* D_SEAFIGHTGAME_H */
|
||||
+93
-177
@@ -58,52 +58,7 @@ struct fopAcM_search_prm {
|
||||
/* 0x0A */ s8 mSubType;
|
||||
};
|
||||
|
||||
class dBgS_LinChk;
|
||||
class fopAcM_lc_c {
|
||||
public:
|
||||
static dBgS_LinChk* getLineCheck() { return (dBgS_LinChk*)&mLineCheck; }
|
||||
static bool lineCheck(const cXyz*, const cXyz*, const fopAc_ac_c*);
|
||||
static u8 mLineCheck[112];
|
||||
};
|
||||
|
||||
class dBgS_RoofChk;
|
||||
class fopAcM_rc_c {
|
||||
public:
|
||||
static dBgS_RoofChk* getRoofCheck() { return (dBgS_RoofChk*)&mRoofCheck; }
|
||||
static bool roofCheck(const cXyz*);
|
||||
static u8 mRoofCheck[80];
|
||||
static f32 mRoofY;
|
||||
};
|
||||
|
||||
class dBgS_GndChk;
|
||||
class fopAcM_gc_c {
|
||||
public:
|
||||
static dBgS_GndChk* getGroundCheck() { return (dBgS_GndChk*)&mGndCheck; }
|
||||
static bool gndCheck(const cXyz*);
|
||||
static u8 mGndCheck[84]; // this is dBgS_GndChk but all static data in the TU probably needs to be setup first (otherwise causes a reordering problem with the __sinit function)
|
||||
static f32 mGroundY;
|
||||
|
||||
// strange issue where f_op_actor_mng.h can't find the dComIfG_Bgsp() inline even when you include the header
|
||||
// static bool getTriPla(cM3dGPla* pPlane) {
|
||||
// return dComIfG_Bgsp().GetTriPla(mGndCheck,pPlane);
|
||||
// }
|
||||
|
||||
static f32 getGroundY() { return mGroundY; }
|
||||
};
|
||||
|
||||
class dBgS_WtrChk;
|
||||
class fopAcM_wt_c {
|
||||
public:
|
||||
static dBgS_WtrChk* getWaterCheck() { return (dBgS_WtrChk*)&mWaterCheck; }
|
||||
static f32 getWaterY() { return mWaterY[0]; }
|
||||
|
||||
static bool waterCheck(const cXyz*);
|
||||
static u8 mWaterCheck[84 + 4 /* padding */];
|
||||
static f32 mWaterY[1 + 1 /* padding */];
|
||||
};
|
||||
|
||||
class dKy_tevstr_c;
|
||||
class cBgS_PolyInfo;
|
||||
typedef int (*heapCallbackFunc)(fopAc_ac_c*);
|
||||
typedef int (*createFunc)(void*);
|
||||
|
||||
@@ -111,11 +66,11 @@ struct DOUBLE_POS {
|
||||
double x, y, z;
|
||||
};
|
||||
|
||||
inline const s8 fopAcM_GetRoomNo(const fopAc_ac_c* pActor) {
|
||||
inline s8 fopAcM_GetRoomNo(fopAc_ac_c* pActor) {
|
||||
return pActor->current.roomNo;
|
||||
}
|
||||
|
||||
inline u32 fopAcM_GetID(const void* pActor) {
|
||||
inline u32 fopAcM_GetID(void* pActor) {
|
||||
return fpcM_GetID(pActor);
|
||||
}
|
||||
|
||||
@@ -123,7 +78,7 @@ inline s16 fopAcM_GetName(void* pActor) {
|
||||
return fpcM_GetName(pActor);
|
||||
}
|
||||
|
||||
inline MtxP fopAcM_GetMtx(const fopAc_ac_c* pActor) {
|
||||
inline MtxP fopAcM_GetMtx(fopAc_ac_c* pActor) {
|
||||
return pActor->mCullMtx;
|
||||
}
|
||||
|
||||
@@ -152,7 +107,7 @@ inline u32 fopAcM_checkHookCarryNow(fopAc_ac_c* pActor) {
|
||||
return fopAcM_checkStatus(pActor, 0x100000);
|
||||
}
|
||||
|
||||
inline u32 fopAcM_GetParam(const void* pActor) {
|
||||
inline u32 fopAcM_GetParam(void* pActor) {
|
||||
return fpcM_GetParam(pActor);
|
||||
}
|
||||
|
||||
@@ -168,11 +123,11 @@ inline void fopAcM_SetJntCol(fopAc_ac_c* i_actorP, dJntCol_c* i_jntColP) {
|
||||
i_actorP->mJntCol = i_jntColP;
|
||||
}
|
||||
|
||||
inline s16 fopAcM_GetProfName(const void* pActor) {
|
||||
inline s16 fopAcM_GetProfName(void* pActor) {
|
||||
return fpcM_GetProfName(pActor);
|
||||
}
|
||||
|
||||
inline u8 fopAcM_GetGroup(const fopAc_ac_c* p_actor) {
|
||||
inline u8 fopAcM_GetGroup(fopAc_ac_c* p_actor) {
|
||||
return p_actor->mGroup;
|
||||
}
|
||||
|
||||
@@ -244,7 +199,7 @@ inline void fopAcM_cancelHookCarryNow(fopAc_ac_c* actor) {
|
||||
fopAcM_OffStatus(actor, 0x100000);
|
||||
}
|
||||
|
||||
inline s8 fopAcM_GetHomeRoomNo(const fopAc_ac_c* pActor) {
|
||||
inline s8 fopAcM_GetHomeRoomNo(fopAc_ac_c* pActor) {
|
||||
return pActor->orig.roomNo;
|
||||
}
|
||||
|
||||
@@ -284,26 +239,18 @@ inline BOOL fopAcM_IsExecuting(unsigned int id) {
|
||||
return fpcM_IsExecuting(id);
|
||||
}
|
||||
|
||||
inline f32 fopAcM_GetSpeedF(const fopAc_ac_c* p_actor) {
|
||||
inline f32 fopAcM_GetSpeedF(fopAc_ac_c* p_actor) {
|
||||
return p_actor->speedF;
|
||||
}
|
||||
|
||||
inline f32 fopAcM_GetGravity(const fopAc_ac_c* p_actor) {
|
||||
inline f32 fopAcM_GetGravity(fopAc_ac_c* p_actor) {
|
||||
return p_actor->mGravity;
|
||||
}
|
||||
|
||||
inline f32 fopAcM_GetMaxFallSpeed(const fopAc_ac_c* p_actor) {
|
||||
inline f32 fopAcM_GetMaxFallSpeed(fopAc_ac_c* p_actor) {
|
||||
return p_actor->mMaxFallSpeed;
|
||||
}
|
||||
|
||||
inline const cXyz& fopAcM_GetSpeed_p(const fopAc_ac_c* p_actor) {
|
||||
return p_actor->speed;
|
||||
}
|
||||
|
||||
inline const cXyz& fopAcM_GetPosition_p(const fopAc_ac_c* p_actor) {
|
||||
return p_actor->current.pos;
|
||||
}
|
||||
|
||||
inline dJntCol_c* fopAcM_GetJntCol(fopAc_ac_c* i_actor) {
|
||||
return i_actor->mJntCol;
|
||||
}
|
||||
@@ -312,11 +259,11 @@ inline void fopAcM_setCullSizeFar(fopAc_ac_c* i_actor, f32 i_far) {
|
||||
i_actor->mCullSizeFar = i_far;
|
||||
}
|
||||
|
||||
inline f32 fopAcM_getCullSizeFar(const fopAc_ac_c* i_actor) {
|
||||
inline f32 fopAcM_getCullSizeFar(fopAc_ac_c* i_actor) {
|
||||
return i_actor->mCullSizeFar;
|
||||
}
|
||||
|
||||
inline int fopAcM_GetCullSize(const fopAc_ac_c* i_actor) {
|
||||
inline int fopAcM_GetCullSize(fopAc_ac_c* i_actor) {
|
||||
return i_actor->mCullType;
|
||||
}
|
||||
|
||||
@@ -324,11 +271,11 @@ inline BOOL fopAcM_CULLSIZE_IS_BOX(int i_culltype) {
|
||||
return (i_culltype >= 0 && i_culltype < 14) || i_culltype == 14;
|
||||
}
|
||||
|
||||
inline Vec fopAcM_getCullSizeSphereCenter(const fopAc_ac_c* i_actor) {
|
||||
inline Vec fopAcM_getCullSizeSphereCenter(fopAc_ac_c* i_actor) {
|
||||
return i_actor->mCull.mSphere.mCenter;
|
||||
}
|
||||
|
||||
inline f32 fopAcM_getCullSizeSphereR(const fopAc_ac_c* i_actor) {
|
||||
inline f32 fopAcM_getCullSizeSphereR(fopAc_ac_c* i_actor) {
|
||||
return i_actor->mCull.mSphere.mRadius;
|
||||
}
|
||||
|
||||
@@ -337,43 +284,43 @@ inline void dComIfGs_offSwitch(int i_no, int i_roomNo);
|
||||
inline BOOL dComIfGs_isSwitch(s32 i_no, s32 i_roomNo);
|
||||
inline void dComIfGs_offActor(int i_no, int i_roomNo);
|
||||
|
||||
inline void fopAcM_onSwitch(const fopAc_ac_c* pActor, int sw) {
|
||||
return dComIfGs_onSwitch(sw, pActor->orig.roomNo); // Should use fopAcM_GetHomeRoomNo, but that breaks regalloc?
|
||||
inline void fopAcM_onSwitch(fopAc_ac_c* pActor, int sw) {
|
||||
return dComIfGs_onSwitch(sw, fopAcM_GetHomeRoomNo(pActor));
|
||||
}
|
||||
|
||||
inline void fopAcM_offSwitch(const fopAc_ac_c* pActor, int sw) {
|
||||
return dComIfGs_offSwitch(sw, pActor->orig.roomNo); // Should use fopAcM_GetHomeRoomNo, but that breaks regalloc?
|
||||
inline void fopAcM_offSwitch(fopAc_ac_c* pActor, int sw) {
|
||||
return dComIfGs_offSwitch(sw, fopAcM_GetHomeRoomNo(pActor));
|
||||
}
|
||||
|
||||
inline BOOL fopAcM_isSwitch(const fopAc_ac_c* pActor, int sw) {
|
||||
return dComIfGs_isSwitch(sw, pActor->orig.roomNo); // Should use fopAcM_GetHomeRoomNo, but that breaks regalloc?
|
||||
inline BOOL fopAcM_isSwitch(fopAc_ac_c* pActor, int sw) {
|
||||
return dComIfGs_isSwitch(sw, fopAcM_GetHomeRoomNo(pActor));
|
||||
}
|
||||
|
||||
inline fopAc_ac_c* i_fopAcM_SearchByName(s16 proc_id) {
|
||||
inline fopAc_ac_c* fopAcM_SearchByName(s16 proc_id) {
|
||||
return (fopAc_ac_c*)fopAcIt_Judge(fpcSch_JudgeForPName, &proc_id);
|
||||
}
|
||||
|
||||
inline void dComIfGs_onItem(int bitNo, int roomNo);
|
||||
inline void fopAcM_onItem(const fopAc_ac_c* item, int bitNo) {
|
||||
inline void fopAcM_onItem(fopAc_ac_c* item, int bitNo) {
|
||||
dComIfGs_onItem(bitNo, fopAcM_GetHomeRoomNo(item));
|
||||
}
|
||||
|
||||
inline bool dComIfGs_isItem(int bitNo, int roomNo);
|
||||
inline bool fopAcM_isItem(const fopAc_ac_c* item, int bitNo) {
|
||||
inline bool fopAcM_isItem(fopAc_ac_c* item, int bitNo) {
|
||||
return dComIfGs_isItem(bitNo, fopAcM_GetHomeRoomNo(item));
|
||||
}
|
||||
|
||||
inline f32 fopAcM_searchActorDistanceY(const fopAc_ac_c* actorA, const fopAc_ac_c* actorB) {
|
||||
inline f32 fopAcM_searchActorDistanceY(fopAc_ac_c* actorA, fopAc_ac_c* actorB) {
|
||||
return actorB->current.pos.y - actorA->current.pos.y;
|
||||
}
|
||||
|
||||
inline u16 fopAcM_GetSetId(const fopAc_ac_c* p_actor) {
|
||||
inline u16 fopAcM_GetSetId(fopAc_ac_c* p_actor) {
|
||||
return p_actor->mSetID;
|
||||
}
|
||||
|
||||
inline void dComIfGs_onActor(int bitNo, int roomNo);
|
||||
|
||||
inline void fopAcM_onActor(const fopAc_ac_c* p_actor) {
|
||||
inline void fopAcM_onActor(fopAc_ac_c* p_actor) {
|
||||
int setId = fopAcM_GetSetId(p_actor);
|
||||
dComIfGs_onActor(setId, fopAcM_GetHomeRoomNo(p_actor));
|
||||
}
|
||||
@@ -392,37 +339,37 @@ s32 fopAcM_SearchByName(s16 procName, fopAc_ac_c** p_actor);
|
||||
|
||||
fopAcM_prm_class* fopAcM_CreateAppend();
|
||||
|
||||
fopAcM_prm_class* createAppend(u16 enemyNo, u32 parameters, const cXyz* p_pos, int roomNo,
|
||||
const csXyz* p_angle, const cXyz* p_scale, s8 subType,
|
||||
fopAcM_prm_class* createAppend(u16 enemyNo, u32 parameters, cXyz* p_pos, int roomNo,
|
||||
csXyz* p_angle, cXyz* p_scale, s8 subType,
|
||||
unsigned int parentPId);
|
||||
|
||||
void fopAcM_Log(fopAc_ac_c const* p_actor, char const* str);
|
||||
void fopAcM_Log(fopAc_ac_c* p_actor, char* str);
|
||||
|
||||
void fopAcM_delete(fopAc_ac_c* p_actor);
|
||||
|
||||
s32 fopAcM_delete(unsigned int actorID);
|
||||
|
||||
s32 fopAcM_create(s16 procName, u16 enemyNo, u32 parameter, const cXyz* p_pos, int roomNo,
|
||||
const csXyz* p_angle, const cXyz* p_scale, s8 subType, createFunc p_createFunc);
|
||||
s32 fopAcM_create(s16 procName, u16 enemyNo, u32 parameter, cXyz* p_pos, int roomNo,
|
||||
csXyz* p_angle, cXyz* p_scale, s8 subType, createFunc p_createFunc);
|
||||
|
||||
s32 fopAcM_create(s16 procName, u32 parameter, const cXyz* p_pos, int roomNo, const csXyz* p_angle,
|
||||
const cXyz* p_scale, s8 subType);
|
||||
s32 fopAcM_create(s16 procName, u32 parameter, cXyz* p_pos, int roomNo, csXyz* p_angle,
|
||||
cXyz* p_scale, s8 subType);
|
||||
|
||||
void* fopAcM_fastCreate(s16 procName, u32 parameter, const cXyz* p_pos, int roomNo,
|
||||
const csXyz* p_angle, const cXyz* p_scale, s8 subType,
|
||||
void* fopAcM_fastCreate(s16 procName, u32 parameter, cXyz* p_pos, int roomNo,
|
||||
csXyz* p_angle, cXyz* p_scale, s8 subType,
|
||||
createFunc p_createFunc, void* p_createFuncData);
|
||||
|
||||
void* fopAcM_fastCreate(const char* p_actorName, u32 parameter, const cXyz* pActorPos, int roomNo,
|
||||
const csXyz* p_angle, const cXyz* p_scale, createFunc p_createFunc,
|
||||
void* fopAcM_fastCreate(char* p_actorName, u32 parameter, cXyz* pActorPos, int roomNo,
|
||||
csXyz* p_angle, cXyz* p_scale, createFunc p_createFunc,
|
||||
void* p_createFuncData);
|
||||
|
||||
s32 fopAcM_createChild(s16 procName, unsigned int parentPId, u32 parameters, const cXyz* p_pos,
|
||||
int roomNo, const csXyz* p_angle, const cXyz* p_scale, s8 subType,
|
||||
s32 fopAcM_createChild(s16 procName, unsigned int parentPId, u32 parameters, cXyz* p_pos,
|
||||
int roomNo, csXyz* p_angle, cXyz* p_scale, s8 subType,
|
||||
createFunc p_createFunc);
|
||||
|
||||
s32 fopAcM_createChildFromOffset(s16 procName, unsigned int parentProcID, u32 actorParams,
|
||||
const cXyz* p_pos, int roomNo, const csXyz* p_angle,
|
||||
const cXyz* p_scale, s8 subType, createFunc p_createFunc);
|
||||
cXyz* p_pos, int roomNo, csXyz* p_angle,
|
||||
cXyz* p_scale, s8 subType, createFunc p_createFunc);
|
||||
|
||||
void fopAcM_DeleteHeap(fopAc_ac_c* p_actor);
|
||||
|
||||
@@ -451,31 +398,29 @@ void fopAcM_posMove(fopAc_ac_c* p_actor, const cXyz* p_movePos);
|
||||
|
||||
void fopAcM_posMoveF(fopAc_ac_c* p_actor, const cXyz* p_movePos);
|
||||
|
||||
s16 fopAcM_searchActorAngleY(const fopAc_ac_c* p_actorA, const fopAc_ac_c* p_actorB);
|
||||
s16 fopAcM_searchActorAngleY(fopAc_ac_c* p_actorA, fopAc_ac_c* p_actorB);
|
||||
|
||||
s16 fopAcM_searchActorAngleX(const fopAc_ac_c* p_actorA, const fopAc_ac_c* p_actorB);
|
||||
s32 fopAcM_seenActorAngleY(fopAc_ac_c*, fopAc_ac_c*);
|
||||
|
||||
s32 fopAcM_seenActorAngleY(const fopAc_ac_c*, const fopAc_ac_c*);
|
||||
f32 fopAcM_searchActorDistance(fopAc_ac_c* p_actorA, fopAc_ac_c* p_actorB);
|
||||
|
||||
f32 fopAcM_searchActorDistance(const fopAc_ac_c* p_actorA, const fopAc_ac_c* p_actorB);
|
||||
f32 fopAcM_searchActorDistance2(fopAc_ac_c* p_actorA, fopAc_ac_c* p_actorB);
|
||||
|
||||
f32 fopAcM_searchActorDistance2(const fopAc_ac_c* p_actorA, const fopAc_ac_c* p_actorB);
|
||||
f32 fopAcM_searchActorDistanceXZ(fopAc_ac_c* p_actorA, fopAc_ac_c* p_actorB);
|
||||
|
||||
f32 fopAcM_searchActorDistanceXZ(const fopAc_ac_c* p_actorA, const fopAc_ac_c* p_actorB);
|
||||
f32 fopAcM_searchActorDistanceXZ2(fopAc_ac_c* p_actorA, fopAc_ac_c* p_actorB);
|
||||
|
||||
f32 fopAcM_searchActorDistanceXZ2(const fopAc_ac_c* p_actorA, const fopAc_ac_c* p_actorB);
|
||||
|
||||
s32 fopAcM_rollPlayerCrash(const fopAc_ac_c*, f32, u32, f32, f32, int, f32);
|
||||
s32 fopAcM_rollPlayerCrash(fopAc_ac_c*, f32, u32, f32, f32, int, f32);
|
||||
s32 fopAcM_checkCullingBox(f32[3][4], f32, f32, f32, f32, f32, f32);
|
||||
s32 fopAcM_cullingCheck(const fopAc_ac_c*);
|
||||
s32 fopAcM_cullingCheck(fopAc_ac_c*);
|
||||
void* event_second_actor(u16);
|
||||
s32 fopAcM_orderTalkEvent(fopAc_ac_c*, fopAc_ac_c*, u16, u16);
|
||||
s32 fopAcM_orderTalkItemBtnEvent(u16, fopAc_ac_c*, fopAc_ac_c*, u16, u16);
|
||||
s32 fopAcM_orderSpeakEvent(fopAc_ac_c* i_actor, u16 i_priority, u16 i_flag);
|
||||
s32 fopAcM_orderDoorEvent(fopAc_ac_c*, fopAc_ac_c*, u16, u16);
|
||||
s32 fopAcM_orderCatchEvent(fopAc_ac_c*, fopAc_ac_c*, u16, u16);
|
||||
s32 fopAcM_orderOtherEvent(fopAc_ac_c*, const char*, u16, u16, u16);
|
||||
s32 fopAcM_orderOtherEvent(fopAc_ac_c*, fopAc_ac_c*, const char*, u16, u16, u16);
|
||||
s32 fopAcM_orderOtherEvent(fopAc_ac_c*, char*, u16, u16, u16);
|
||||
s32 fopAcM_orderOtherEvent(fopAc_ac_c*, fopAc_ac_c*, char*, u16, u16, u16);
|
||||
s32 fopAcM_orderChangeEventId(fopAc_ac_c*, s16, u16, u16);
|
||||
s32 fopAcM_orderOtherEventId(fopAc_ac_c* actor, s16 eventID, u8 mapToolID, u16 param_3,
|
||||
u16 priority, u16 flag);
|
||||
@@ -484,88 +429,77 @@ s32 fopAcM_orderMapToolAutoNextEvent(fopAc_ac_c*, u8, s16, u16, u16, u16);
|
||||
s32 fopAcM_orderPotentialEvent(fopAc_ac_c*, u16, u16, u16);
|
||||
s32 fopAcM_orderItemEvent(fopAc_ac_c*, u16, u16);
|
||||
s32 fopAcM_orderTreasureEvent(fopAc_ac_c*, fopAc_ac_c*, u16, u16);
|
||||
fopAc_ac_c* fopAcM_getTalkEventPartner(const fopAc_ac_c*);
|
||||
fopAc_ac_c* fopAcM_getItemEventPartner(const fopAc_ac_c*);
|
||||
fopAc_ac_c* fopAcM_getEventPartner(const fopAc_ac_c*);
|
||||
fopAc_ac_c* fopAcM_getTalkEventPartner(fopAc_ac_c*);
|
||||
fopAc_ac_c* fopAcM_getItemEventPartner(fopAc_ac_c*);
|
||||
fopAc_ac_c* fopAcM_getEventPartner(fopAc_ac_c*);
|
||||
|
||||
s32 fopAcM_createItemForPresentDemo(cXyz const* p_pos, int i_itemNo, u8 param_2, int i_itemBitNo,
|
||||
int i_roomNo, csXyz const* p_angle, cXyz const* p_scale);
|
||||
s32 fopAcM_createItemForPresentDemo(cXyz* p_pos, int i_itemNo, u8 param_2, int i_itemBitNo,
|
||||
int i_roomNo, csXyz* p_angle, cXyz* p_scale);
|
||||
|
||||
s32 fopAcM_createItemForTrBoxDemo(cXyz const* p_pos, int i_itemNo, int i_itemBitNo, int i_roomNo,
|
||||
csXyz const* p_angle, cXyz const* p_scale);
|
||||
s32 fopAcM_createItemForTrBoxDemo(cXyz* p_pos, int i_itemNo, int i_itemBitNo, int i_roomNo,
|
||||
csXyz* p_angle, cXyz* p_scale);
|
||||
|
||||
u8 fopAcM_getItemNoFromTableNo(u8 i_tableNo);
|
||||
|
||||
s32 fopAcM_createItemFromEnemyID(u8 i_enemyID, cXyz const* p_pos, int i_itemBitNo, int i_roomNo,
|
||||
csXyz const* p_angle, cXyz const* p_scale, f32* speedF,
|
||||
s32 fopAcM_createItemFromEnemyID(u8 i_enemyID, cXyz* p_pos, int i_itemBitNo, int i_roomNo,
|
||||
csXyz * p_angle, cXyz * p_scale, f32* speedF,
|
||||
f32* speedY);
|
||||
|
||||
s32 fopAcM_createItemFromTable(cXyz const* p_pos, int i_tableNo, int i_itemBitNo, int i_roomNo,
|
||||
csXyz const* p_angle, int param_5, cXyz const* p_scale, f32* speedF,
|
||||
s32 fopAcM_createItemFromTable(cXyz* p_pos, int i_tableNo, int i_itemBitNo, int i_roomNo,
|
||||
csXyz* p_angle, int param_5, cXyz * p_scale, f32* speedF,
|
||||
f32* speedY, bool createDirect);
|
||||
|
||||
s32 fopAcM_createDemoItem(const cXyz* p_pos, int itemNo, int itemBitNo, const csXyz* p_angle,
|
||||
int roomNo, const cXyz* scale, u8 param_7);
|
||||
s32 fopAcM_createDemoItem(cXyz* p_pos, int itemNo, int itemBitNo, csXyz* p_angle,
|
||||
int roomNo, cXyz* scale, u8 param_7);
|
||||
|
||||
s32 fopAcM_createItemForBoss(cXyz* p_pos, int param_2, int roomNo, csXyz* p_angle,
|
||||
cXyz* p_scale, int param_8);
|
||||
|
||||
s32 fopAcM_createItemForMidBoss(const cXyz* p_pos, int i_itemNo, int i_roomNo, const csXyz* p_angle,
|
||||
const cXyz* p_scale, int param_6, int param_7);
|
||||
s32 fopAcM_createItemForMidBoss(cXyz* p_pos, int i_itemNo, int i_roomNo, csXyz* p_angle,
|
||||
cXyz* p_scale, int param_6, int param_7);
|
||||
|
||||
void* fopAcM_createItemForDirectGet(const cXyz* p_pos, int i_itemNo, int i_roomNo,
|
||||
const csXyz* p_angle, const cXyz* p_scale, f32 speedF,
|
||||
void* fopAcM_createItemForDirectGet(cXyz* p_pos, int i_itemNo, int i_roomNo,
|
||||
csXyz* p_angle, cXyz* p_scale, f32 speedF,
|
||||
f32 speedY);
|
||||
|
||||
void* fopAcM_createItemForSimpleDemo(const cXyz* p_pos, int i_itemNo, int i_roomNo,
|
||||
const csXyz* p_angle, const cXyz* p_scale, f32 speedF,
|
||||
void* fopAcM_createItemForSimpleDemo(cXyz* p_pos, int i_itemNo, int i_roomNo,
|
||||
csXyz* p_angle, cXyz* p_scale, f32 speedF,
|
||||
f32 speedY);
|
||||
|
||||
s32 fopAcM_createItem(const cXyz* p_pos, int itemNo, int param_3, int roomNo, const csXyz* p_angle,
|
||||
const cXyz* p_scale, int param_7);
|
||||
s32 fopAcM_createItem(cXyz* p_pos, int itemNo, int param_3, int roomNo, csXyz* p_angle,
|
||||
cXyz* p_scale, int param_7);
|
||||
|
||||
void* fopAcM_fastCreateItem2(const cXyz* p_pos, int itemNo, int param_3, int roomNo, int param_5,
|
||||
const csXyz* p_angle, const cXyz* p_scale);
|
||||
void* fopAcM_fastCreateItem2(cXyz* p_pos, int itemNo, int param_3, int roomNo, int param_5,
|
||||
csXyz* p_angle, cXyz* p_scale);
|
||||
|
||||
void* fopAcM_fastCreateItem(const cXyz* p_pos, int i_itemNo, int i_roomNo, const csXyz* p_angle,
|
||||
const cXyz* p_scale, f32* p_speedF, f32* p_speedY, int param_8,
|
||||
void* fopAcM_fastCreateItem(cXyz* p_pos, int i_itemNo, int i_roomNo, csXyz* p_angle,
|
||||
cXyz* p_scale, f32* p_speedF, f32* p_speedY, int param_8,
|
||||
int param_9, createFunc p_createFunc);
|
||||
|
||||
s32 fopAcM_createBokkuri(u16, const cXyz*, int, int, int, const cXyz*, int, int);
|
||||
s32 fopAcM_createWarpHole(const cXyz*, const csXyz*, int, u8, u8, u8);
|
||||
s32 fopAcM_createBokkuri(u16, cXyz*, int, int, int, cXyz*, int, int);
|
||||
s32 fopAcM_createWarpHole(cXyz*, csXyz*, int, u8, u8, u8);
|
||||
|
||||
fopAc_ac_c* fopAcM_myRoomSearchEnemy(s8 roomNo);
|
||||
|
||||
s32 fopAcM_createDisappear(const fopAc_ac_c*, const cXyz*, u8, u8, u8);
|
||||
s32 fopAcM_createDisappear(fopAc_ac_c*, cXyz*, u8, u8, u8);
|
||||
void fopAcM_setCarryNow(fopAc_ac_c*, int);
|
||||
void fopAcM_cancelCarryNow(fopAc_ac_c*);
|
||||
s32 fopAcM_otoCheck(const fopAc_ac_c*, f32);
|
||||
s32 fopAcM_otherBgCheck(const fopAc_ac_c*, const fopAc_ac_c*);
|
||||
s32 fopAcM_wayBgCheck(const fopAc_ac_c*, f32, f32);
|
||||
s32 fopAcM_plAngleCheck(const fopAc_ac_c*, s16);
|
||||
void fopAcM_effSmokeSet1(u32*, u32*, const cXyz*, const csXyz*, f32, const dKy_tevstr_c*, int);
|
||||
void fopAcM_effHamonSet(u32*, const cXyz*, f32, f32);
|
||||
s32 fopAcM_riverStream(cXyz*, s16*, f32*, f32);
|
||||
s32 fopAcM_carryOffRevise(fopAc_ac_c*);
|
||||
// void vectle_calc(const DOUBLE_POS*, cXyz*);
|
||||
// void get_vectle_calc(const cXyz*, const cXyz*, cXyz*);
|
||||
void fopAcM_setEffectMtx(const fopAc_ac_c*, const J3DModelData*);
|
||||
s32 fopAcM_otoCheck(fopAc_ac_c*, f32);
|
||||
// void vectle_calc(DOUBLE_POS*, cXyz*);
|
||||
// void get_vectle_calc(cXyz*, cXyz*, cXyz*);
|
||||
|
||||
static const char* fopAcM_getProcNameString(const fopAc_ac_c* p_actor);
|
||||
static const char* fopAcM_getProcNameString(fopAc_ac_c* p_actor);
|
||||
|
||||
static const fopAc_ac_c* fopAcM_findObjectCB(fopAc_ac_c const* p_actor, void* p_data);
|
||||
static fopAc_ac_c* fopAcM_findObjectCB(fopAc_ac_c* p_actor, void* p_data);
|
||||
|
||||
fopAc_ac_c* fopAcM_searchFromName(char const* name, u32 param0, u32 param1);
|
||||
fopAc_ac_c* fopAcM_searchFromName(char* name, u32 param0, u32 param1);
|
||||
|
||||
fopAc_ac_c* fopAcM_findObject4EventCB(fopAc_ac_c* p_actor, void* p_data);
|
||||
|
||||
fopAc_ac_c* fopAcM_searchFromName4Event(char const* name, s16 eventID);
|
||||
fopAc_ac_c* fopAcM_searchFromName4Event(char* name, s16 eventID);
|
||||
|
||||
s32 fopAcM_getWaterY(const cXyz*, f32*);
|
||||
void fpoAcM_relativePos(fopAc_ac_c const* actor, cXyz const* p_inPos, cXyz* p_outPos);
|
||||
s32 fopAcM_getWaterStream(const cXyz*, const cBgS_PolyInfo&, cXyz*, int*, int);
|
||||
s16 fopAcM_getPolygonAngle(const cBgS_PolyInfo&, s16);
|
||||
s16 fopAcM_getPolygonAngle(cM3dGPla const* param_0, s16 param_1);
|
||||
void fpoAcM_relativePos(fopAc_ac_c* actor, cXyz* p_inPos, cXyz* p_outPos);
|
||||
|
||||
inline void make_prm_warp_hole(u32* actorParams, u8 p1, u8 p2, u8 p3) {
|
||||
u32 pp1 = (p3 << 0x8);
|
||||
@@ -582,23 +516,23 @@ inline void make_prm_bokkuri(u32* pActorParams, csXyz* p_angle, u8 param_2, u8 p
|
||||
|
||||
inline fopAc_ac_c* dComIfGp_getPlayer(int);
|
||||
|
||||
inline s16 fopAcM_searchPlayerAngleY(const fopAc_ac_c* actor) {
|
||||
inline s16 fopAcM_searchPlayerAngleY(fopAc_ac_c* actor) {
|
||||
return fopAcM_searchActorAngleY(actor, (fopAc_ac_c*)dComIfGp_getPlayer(0));
|
||||
}
|
||||
|
||||
inline f32 fopAcM_searchPlayerDistanceY(const fopAc_ac_c* actor) {
|
||||
inline f32 fopAcM_searchPlayerDistanceY(fopAc_ac_c* actor) {
|
||||
return fopAcM_searchActorDistanceY(actor, (fopAc_ac_c*)dComIfGp_getPlayer(0));
|
||||
}
|
||||
|
||||
inline f32 fopAcM_searchPlayerDistanceXZ2(const fopAc_ac_c* actor) {
|
||||
inline f32 fopAcM_searchPlayerDistanceXZ2(fopAc_ac_c* actor) {
|
||||
return fopAcM_searchActorDistanceXZ2(actor, (fopAc_ac_c*)dComIfGp_getPlayer(0));
|
||||
}
|
||||
|
||||
inline f32 fopAcM_searchPlayerDistanceXZ(const fopAc_ac_c* actor) {
|
||||
inline f32 fopAcM_searchPlayerDistanceXZ(fopAc_ac_c* actor) {
|
||||
return fopAcM_searchActorDistanceXZ(actor, (fopAc_ac_c*)dComIfGp_getPlayer(0));
|
||||
}
|
||||
|
||||
inline f32 fopAcM_searchPlayerDistance(const fopAc_ac_c* actor) {
|
||||
inline f32 fopAcM_searchPlayerDistance(fopAc_ac_c* actor) {
|
||||
return fopAcM_searchActorDistance(actor, (fopAc_ac_c*)dComIfGp_getPlayer(0));
|
||||
}
|
||||
|
||||
@@ -609,29 +543,11 @@ inline void fopAcM_seStartCurrent(fopAc_ac_c* actor, u32 sfxID, u32 param_2) {
|
||||
mDoAud_seStart(sfxID, &actor->current.pos, param_2, dComIfGp_getReverb(roomNo));
|
||||
}
|
||||
|
||||
inline void fopAcM_seStart(const fopAc_ac_c* actor, u32 sfxID, u32 param_2) {
|
||||
inline void fopAcM_seStart(fopAc_ac_c* actor, u32 sfxID, u32 param_2) {
|
||||
s8 roomNo = fopAcM_GetRoomNo(actor);
|
||||
// mDoAud_seStart(sfxID, &actor->mEyePos, param_2, dComIfGp_getReverb(roomNo));
|
||||
}
|
||||
|
||||
inline void fopAcM_seStartLevel(const fopAc_ac_c* actor, u32 sfxID, u32 param_2) {
|
||||
s8 roomNo = fopAcM_GetRoomNo(actor);
|
||||
// i_mDoAud_seStartLevel(sfxID, &actor->mEyePos, param_2, dComIfGp_getReverb(roomNo));
|
||||
}
|
||||
|
||||
inline void fopAcM_seStartCurrentLevel(const fopAc_ac_c* actor, u32 sfxID, u32 param_2) {
|
||||
s8 roomNo = fopAcM_GetRoomNo(actor);
|
||||
// i_mDoAud_seStartLevel(sfxID, &actor->current.pos, param_2, dComIfGp_getReverb(roomNo));
|
||||
}
|
||||
|
||||
inline void fopAcM_offActor(fopAc_ac_c* pActor, u32 flag) {
|
||||
dComIfGs_offActor(flag,fopAcM_GetHomeRoomNo(pActor));
|
||||
}
|
||||
|
||||
inline void fopAcM_OnCarryType(fopAc_ac_c* pActor, fopAcM_CARRY param_2) {
|
||||
pActor->mCarryType |= param_2;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
void fopAcM_initManager__Fv(void);
|
||||
void fopAcM_CreateAppend__Fv(void);
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
#ifndef M_DO_M_DO_DVD_ERROR_H
|
||||
#define M_DO_M_DO_DVD_ERROR_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
void mDoDvdErr_ThdCleanup();
|
||||
|
||||
#endif /* M_DO_M_DO_DVD_ERROR_H */
|
||||
+22
-22
@@ -13,22 +13,11 @@ struct mDoRstData {
|
||||
/* 0x04 */ int mResetPrepare;
|
||||
/* 0x08 */ int m3ButtonReset;
|
||||
/* 0x0C */ int m3ButtonResetPort;
|
||||
/* 0x10 */ bool mShutdown;
|
||||
/* 0x11 */ bool mReturnToMenu;
|
||||
/* 0x12 */ u8 mLogoScnFlag;
|
||||
/* 0x13 */ u8 mProgSeqFlag;
|
||||
/* 0x14 */ u8 mProgChgFlag;
|
||||
/* 0x15 */ u8 mWarningDispFlag;
|
||||
}; // Size = 0x18
|
||||
}; // Size = 0x10
|
||||
|
||||
class mDoRst {
|
||||
public:
|
||||
static void offReturnToMenu() { mResetData->mReturnToMenu = false; }
|
||||
static void offShutdown() { mResetData->mShutdown = false; }
|
||||
static void setWarningDispFlag(u8 flag) { mResetData->mWarningDispFlag = flag; }
|
||||
static void setProgChgFlag(u8 flag) { mResetData->mProgChgFlag = flag; }
|
||||
static void setProgSeqFlag(u8 flag) { mResetData->mProgSeqFlag = flag; }
|
||||
static void setLogoScnFlag(u8 flag) { mResetData->mLogoScnFlag = flag; }
|
||||
#if VERSION != VERSION_JP
|
||||
static void set3ButtonResetPort(int port) { mResetData->m3ButtonResetPort = port; }
|
||||
static void off3ButtonReset() { mResetData->m3ButtonReset = 0; }
|
||||
static void offResetPrepare() { mResetData->mResetPrepare = 0; }
|
||||
@@ -36,24 +25,35 @@ public:
|
||||
mResetData->mReset = 0;
|
||||
mResetData->mResetPrepare = 0;
|
||||
}
|
||||
static u8 getLogoScnFlag() { return mResetData->mLogoScnFlag; }
|
||||
static u8 getProgSeqFlag() { return mResetData->mProgSeqFlag; }
|
||||
static u8 getWarningDispFlag() { return mResetData->mWarningDispFlag; }
|
||||
static BOOL isReturnToMenu() { return mResetData->mReturnToMenu; }
|
||||
static BOOL isShutdown() { return mResetData->mShutdown; }
|
||||
static int isReset() { return mResetData->mReset; }
|
||||
static int get3ButtonResetPort() { return mResetData->m3ButtonResetPort; }
|
||||
static int is3ButtonReset() { return mResetData->m3ButtonReset; }
|
||||
static void onReset() { mResetData->mReset = 1; }
|
||||
static void onReturnToMenu() { mResetData->mReturnToMenu = true; }
|
||||
static void on3ButtonReset() { mResetData->m3ButtonReset = 1; }
|
||||
static void onShutdown() { mResetData->mShutdown = true; }
|
||||
|
||||
static mDoRstData* getResetData();
|
||||
static mDoRstData* i_getResetData() { return mResetData; }
|
||||
static mDoRstData* getResetData() { return mResetData; }
|
||||
static void setResetData(mDoRstData* rstData) { mResetData = rstData; }
|
||||
|
||||
static mDoRstData* mResetData;
|
||||
#else
|
||||
static void set3ButtonResetPort(int port) { m3ButtonResetPort = port; }
|
||||
static void off3ButtonReset() { m3ButtonResetFlag = 0; }
|
||||
static void offResetPrepare() { mResetPrepare = 0; }
|
||||
static void offReset() {
|
||||
mResetFlag = 0;
|
||||
mResetPrepare = 0;
|
||||
}
|
||||
static int isReset() { return mResetFlag; }
|
||||
static int get3ButtonResetPort() { return m3ButtonResetPort; }
|
||||
static int is3ButtonReset() { return m3ButtonResetFlag; }
|
||||
static void onReset() { mResetFlag = 1; }
|
||||
static void on3ButtonReset() { m3ButtonResetFlag = 1; }
|
||||
|
||||
static int mResetPrepare;
|
||||
static int mResetFlag;
|
||||
static int m3ButtonResetFlag;
|
||||
static int m3ButtonResetPort;
|
||||
#endif
|
||||
};
|
||||
|
||||
extern bool mDoDvdErr_initialized;
|
||||
|
||||
@@ -16,6 +16,7 @@ public:
|
||||
static void offResetFlag() { mResetFlag = false; }
|
||||
|
||||
static bool isInitFlag() { return mInitFlag; }
|
||||
static void offInitFlag() { mInitFlag = false; }
|
||||
|
||||
static bool isBgmSet() { return mBgmSet; }
|
||||
static void offBgmSet() { mBgmSet = false; }
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
#ifndef M_DO_M_DO_MACHINE_EXCEPTION_H
|
||||
#define M_DO_M_DO_MACHINE_EXCEPTION_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
class JUTConsole;
|
||||
|
||||
void print_f(char const*, ...);
|
||||
void print(char const*);
|
||||
void dispHeapInfo();
|
||||
void dispGameInfo();
|
||||
void dispDateInfo();
|
||||
void dispConsoleToTerminal();
|
||||
void exception_addition(JUTConsole* pConsole);
|
||||
|
||||
#endif /* M_DO_M_DO_MACHINE_EXCEPTION_H */
|
||||
@@ -3,85 +3,238 @@
|
||||
// Translation Unit: JKRArchivePri.cpp
|
||||
//
|
||||
|
||||
#include "JSystem/JKernel/JKRArchivePri.h"
|
||||
#include "JSystem/JKernel/JKRArchive.h"
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
#include "MSL_C/MSL_Common/Src/ctype.h"
|
||||
#include "MSL_C/string.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
u32 JKRArchive::sCurrentDirID;
|
||||
|
||||
/* 802B8DFC-802B8E48 .text __ct__10JKRArchiveFv */
|
||||
JKRArchive::JKRArchive() {
|
||||
/* Nonmatching */
|
||||
mIsMounted = false;
|
||||
mMountDirection = MOUNT_DIRECTION_HEAD;
|
||||
}
|
||||
|
||||
/* 802B8E48-802B8EE8 .text __ct__10JKRArchiveFlQ210JKRArchive10EMountMode */
|
||||
JKRArchive::JKRArchive(long, JKRArchive::EMountMode) {
|
||||
/* Nonmatching */
|
||||
JKRArchive::JKRArchive(s32 entryNumber, JKRArchive::EMountMode mountMode) {
|
||||
mIsMounted = false;
|
||||
mMountMode = mountMode;
|
||||
mMountCount = 1;
|
||||
field_0x58 = 1;
|
||||
|
||||
mHeap = JKRHeap::findFromRoot(this);
|
||||
if (mHeap == NULL) {
|
||||
mHeap = JKRHeap::getCurrentHeap();
|
||||
}
|
||||
|
||||
mEntryNum = entryNumber;
|
||||
if (getCurrentVolume() == NULL) {
|
||||
setCurrentVolume(this);
|
||||
setCurrentDirID(0);
|
||||
}
|
||||
}
|
||||
|
||||
/* 802B8EE8-802B8F48 .text __dt__10JKRArchiveFv */
|
||||
JKRArchive::~JKRArchive() {
|
||||
/* Nonmatching */
|
||||
}
|
||||
JKRArchive::~JKRArchive() {}
|
||||
|
||||
/* 802B8F48-802B8F94 .text isSameName__10JKRArchiveCFRQ210JKRArchive8CArcNameUlUs */
|
||||
void JKRArchive::isSameName(JKRArchive::CArcName&, unsigned long, unsigned short) const {
|
||||
/* Nonmatching */
|
||||
bool JKRArchive::isSameName(JKRArchive::CArcName& name, u32 nameOffset, u16 nameHash) const {
|
||||
u16 hash = name.getHash();
|
||||
if (hash != nameHash)
|
||||
return false;
|
||||
return strcmp(mStringTable + nameOffset, name.getString()) == 0;
|
||||
}
|
||||
|
||||
/* 802B8F94-802B8FD0 .text findResType__10JKRArchiveCFUl */
|
||||
void JKRArchive::findResType(unsigned long) const {
|
||||
/* Nonmatching */
|
||||
JKRArchive::SDIDirEntry* JKRArchive::findResType(u32 type) const {
|
||||
SDIDirEntry* node = mNodes;
|
||||
u32 count = 0;
|
||||
while (count < mArcInfoBlock->num_nodes) {
|
||||
if (node->type == type) {
|
||||
return node;
|
||||
}
|
||||
|
||||
node++;
|
||||
count++;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* 802B8FD0-802B90A8 .text findDirectory__10JKRArchiveCFPCcUl */
|
||||
void JKRArchive::findDirectory(const char*, unsigned long) const {
|
||||
/* Nonmatching */
|
||||
JKRArchive::SDIDirEntry* JKRArchive::findDirectory(const char* name, u32 directoryId) const {
|
||||
if (name == NULL) {
|
||||
return mNodes + directoryId;
|
||||
}
|
||||
|
||||
CArcName arcName(&name, '/');
|
||||
SDIDirEntry* dirEntry = mNodes + directoryId;
|
||||
SDIFileEntry* fileEntry = mFiles + dirEntry->first_file_index;
|
||||
|
||||
for (int i = 0; i < dirEntry->num_entries; fileEntry++, i++) {
|
||||
if (isSameName(arcName, fileEntry->getNameOffset(), fileEntry->name_hash)) {
|
||||
if (fileEntry->isDirectory()) {
|
||||
return findDirectory(name, fileEntry->data_offset);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* 802B90A8-802B9158 .text findTypeResource__10JKRArchiveCFUlPCc */
|
||||
void JKRArchive::findTypeResource(unsigned long, const char*) const {
|
||||
/* Nonmatching */
|
||||
JKRArchive::SDIFileEntry* JKRArchive::findTypeResource(u32 type, const char* name) const {
|
||||
if (type) {
|
||||
CArcName arcName(name);
|
||||
SDIDirEntry* dirEntry = findResType(type);
|
||||
|
||||
if (dirEntry) {
|
||||
SDIFileEntry* fileEntry = mFiles + dirEntry->first_file_index;
|
||||
for (int i = 0; i < dirEntry->num_entries; fileEntry++, i++) {
|
||||
if (isSameName(arcName, fileEntry->getNameOffset(), fileEntry->getNameHash())) {
|
||||
return fileEntry;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* 802B9158-802B9238 .text findFsResource__10JKRArchiveCFPCcUl */
|
||||
void JKRArchive::findFsResource(const char*, unsigned long) const {
|
||||
/* Nonmatching */
|
||||
JKRArchive::SDIFileEntry* JKRArchive::findFsResource(const char* name, u32 directoryId) const {
|
||||
if (name) {
|
||||
CArcName arcName(&name, '/');
|
||||
SDIDirEntry* dirEntry = mNodes + directoryId;
|
||||
SDIFileEntry* fileEntry = mFiles + dirEntry->first_file_index;
|
||||
|
||||
for (int i = 0; i < dirEntry->num_entries; fileEntry++, i++) {
|
||||
if (isSameName(arcName, fileEntry->getNameOffset(), fileEntry->name_hash)) {
|
||||
if (fileEntry->isDirectory()) {
|
||||
return findFsResource(name, fileEntry->data_offset);
|
||||
}
|
||||
|
||||
if (name == NULL) {
|
||||
return fileEntry;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* 802B9238-802B9260 .text findIdxResource__10JKRArchiveCFUl */
|
||||
void JKRArchive::findIdxResource(unsigned long) const {
|
||||
/* Nonmatching */
|
||||
JKRArchive::SDIFileEntry* JKRArchive::findIdxResource(u32 fileIndex) const {
|
||||
if (fileIndex < mArcInfoBlock->num_file_entries) {
|
||||
return mFiles + fileIndex;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* 802B9260-802B92E8 .text findNameResource__10JKRArchiveCFPCc */
|
||||
void JKRArchive::findNameResource(const char*) const {
|
||||
/* Nonmatching */
|
||||
JKRArchive::SDIFileEntry* JKRArchive::findNameResource(const char* name) const {
|
||||
SDIFileEntry* fileEntry = mFiles;
|
||||
|
||||
CArcName arcName(name);
|
||||
for (int i = 0; i < mArcInfoBlock->num_file_entries; fileEntry++, i++) {
|
||||
if (isSameName(arcName, fileEntry->getNameOffset(), fileEntry->getNameHash())) {
|
||||
return fileEntry;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* 802B92E8-802B9324 .text findPtrResource__10JKRArchiveCFPCv */
|
||||
void JKRArchive::findPtrResource(const void*) const {
|
||||
/* Nonmatching */
|
||||
JKRArchive::SDIFileEntry* JKRArchive::findPtrResource(const void* resource) const {
|
||||
SDIFileEntry* fileEntry = mFiles;
|
||||
for (int i = 0; i < mArcInfoBlock->num_file_entries; fileEntry++, i++) {
|
||||
if (fileEntry->data == resource) {
|
||||
return fileEntry;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* 802B9324-802B93A4 .text findIdResource__10JKRArchiveCFUs */
|
||||
void JKRArchive::findIdResource(unsigned short) const {
|
||||
/* Nonmatching */
|
||||
JKRArchive::SDIFileEntry* JKRArchive::findIdResource(u16 id) const {
|
||||
if (id != 0xFFFF) {
|
||||
SDIFileEntry* fileEntry = mFiles + id;
|
||||
if (fileEntry->file_id == id && fileEntry->isUnknownFlag1()) {
|
||||
return fileEntry;
|
||||
}
|
||||
|
||||
fileEntry = mFiles;
|
||||
for (int i = 0; i < mArcInfoBlock->num_file_entries; fileEntry++, i++) {
|
||||
if (fileEntry->file_id == id && fileEntry->isUnknownFlag1()) {
|
||||
return fileEntry;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* 802B93A4-802B9434 .text store__Q210JKRArchive8CArcNameFPCc */
|
||||
void JKRArchive::CArcName::store(const char*) {
|
||||
/* Nonmatching */
|
||||
void JKRArchive::CArcName::store(const char* name) {
|
||||
mHash = 0;
|
||||
s32 length = 0;
|
||||
while (*name) {
|
||||
s32 ch = tolower(*name);
|
||||
mHash = ch + mHash * 3;
|
||||
if (length < (s32)ARRAY_SIZE(mData)) {
|
||||
mData[length++] = ch;
|
||||
}
|
||||
name++;
|
||||
}
|
||||
|
||||
mLength = (u16)length;
|
||||
mData[length] = 0;
|
||||
}
|
||||
|
||||
/* 802B9434-802B94EC .text store__Q210JKRArchive8CArcNameFPCcc */
|
||||
void JKRArchive::CArcName::store(const char*, char) {
|
||||
/* Nonmatching */
|
||||
const char* JKRArchive::CArcName::store(const char* name, char endChar) {
|
||||
mHash = 0;
|
||||
s32 length = 0;
|
||||
while (*name && *name != endChar) {
|
||||
s32 lch = tolower((int)*name);
|
||||
mHash = lch + mHash * 3;
|
||||
if (length < (s32)ARRAY_SIZE(mData)) {
|
||||
mData[length++] = lch;
|
||||
}
|
||||
name++;
|
||||
}
|
||||
|
||||
mLength = (u16)length;
|
||||
mData[length] = 0;
|
||||
|
||||
if (*name == 0)
|
||||
return NULL;
|
||||
return name + 1;
|
||||
}
|
||||
|
||||
/* 802B94EC-802B9528 .text setExpandSize__10JKRArchiveFPQ210JKRArchive12SDIFileEntryUl */
|
||||
void JKRArchive::setExpandSize(JKRArchive::SDIFileEntry*, unsigned long) {
|
||||
/* Nonmatching */
|
||||
void JKRArchive::setExpandSize(SDIFileEntry* fileEntry, u32 expandSize) {
|
||||
int index = fileEntry - mFiles;
|
||||
if (!mExpandedSize || index >= mArcInfoBlock->num_file_entries)
|
||||
return;
|
||||
|
||||
mExpandedSize[index] = expandSize;
|
||||
}
|
||||
|
||||
/* 802B9528-802B9568 .text getExpandSize__10JKRArchiveCFPQ210JKRArchive12SDIFileEntry */
|
||||
void JKRArchive::getExpandSize(JKRArchive::SDIFileEntry*) const {
|
||||
/* Nonmatching */
|
||||
u32 JKRArchive::getExpandSize(SDIFileEntry* fileEntry) const {
|
||||
int index = fileEntry - mFiles;
|
||||
if (!mExpandedSize || index >= mArcInfoBlock->num_file_entries)
|
||||
return 0;
|
||||
|
||||
return mExpandedSize[index];
|
||||
}
|
||||
|
||||
@@ -3,115 +3,368 @@
|
||||
// Translation Unit: JKRArchivePub.cpp
|
||||
//
|
||||
|
||||
#include "JSystem/JKernel/JKRArchivePub.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "JSystem/JKernel/JKRArchive.h"
|
||||
#include "JSystem/JKernel/JKRAramArchive.h"
|
||||
#include "JSystem/JKernel/JKRCompArchive.h"
|
||||
#include "JSystem/JKernel/JKRDvdArchive.h"
|
||||
#include "JSystem/JKernel/JKRFileFinder.h"
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
#include "JSystem/JKernel/JKRMemArchive.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
#include "dolphin/dvd/dvd.h"
|
||||
|
||||
/* 802B7FB4-802B8008 .text check_mount_already__10JKRArchiveFl */
|
||||
void JKRArchive::check_mount_already(long) {
|
||||
/* Nonmatching */
|
||||
JKRArchive* JKRArchive::check_mount_already(s32 entryNum) {
|
||||
JSUList<JKRFileLoader>& volumeList = getVolumeList();
|
||||
JSUListIterator<JKRFileLoader> iterator;
|
||||
for (iterator = volumeList.getFirst(); iterator != volumeList.getEnd(); ++iterator) {
|
||||
if (iterator->getVolumeType() == 'RARC') {
|
||||
JKRArchive* archive = (JKRArchive*)iterator.getObject();
|
||||
if (archive->mEntryNum == entryNum) {
|
||||
archive->mMountCount++;
|
||||
return archive;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* 802B8008-802B8064 .text mount__10JKRArchiveFPCcQ210JKRArchive10EMountModeP7JKRHeapQ210JKRArchive15EMountDirection */
|
||||
void JKRArchive::mount(const char*, JKRArchive::EMountMode, JKRHeap*, JKRArchive::EMountDirection) {
|
||||
/* Nonmatching */
|
||||
JKRArchive* JKRArchive::mount(const char* path, JKRArchive::EMountMode mountMode, JKRHeap* heap, JKRArchive::EMountDirection mountDirection) {
|
||||
s32 entryNum = DVDConvertPathToEntrynum(path);
|
||||
if (entryNum < 0)
|
||||
return NULL;
|
||||
|
||||
return mount(entryNum, mountMode, heap, mountDirection);
|
||||
}
|
||||
|
||||
/* 802B8064-802B81D0 .text mount__10JKRArchiveFlQ210JKRArchive10EMountModeP7JKRHeapQ210JKRArchive15EMountDirection */
|
||||
void JKRArchive::mount(long, JKRArchive::EMountMode, JKRHeap*, JKRArchive::EMountDirection) {
|
||||
/* Nonmatching */
|
||||
JKRArchive* JKRArchive::mount(s32 entryNum, JKRArchive::EMountMode mountMode, JKRHeap* heap, JKRArchive::EMountDirection mountDirection) {
|
||||
JKRArchive* archive = check_mount_already(entryNum);
|
||||
if (archive != NULL) {
|
||||
return archive;
|
||||
} else {
|
||||
int alignment;
|
||||
if (mountDirection == JKRArchive::MOUNT_DIRECTION_HEAD) {
|
||||
alignment = 4;
|
||||
} else {
|
||||
alignment = -4;
|
||||
}
|
||||
|
||||
JKRArchive* archive;
|
||||
switch (mountMode) {
|
||||
case JKRArchive::MOUNT_MEM:
|
||||
archive = new (heap, alignment) JKRMemArchive(entryNum, mountDirection);
|
||||
break;
|
||||
case JKRArchive::MOUNT_ARAM:
|
||||
archive = new (heap, alignment) JKRAramArchive(entryNum, mountDirection);
|
||||
break;
|
||||
case JKRArchive::MOUNT_DVD:
|
||||
archive = new (heap, alignment) JKRDvdArchive(entryNum, mountDirection);
|
||||
break;
|
||||
case JKRArchive::MOUNT_COMP:
|
||||
archive = new (heap, alignment) JKRCompArchive(entryNum, mountDirection);
|
||||
break;
|
||||
}
|
||||
|
||||
if (archive && archive->getMountMode() == JKRArchive::UNKNOWN_MOUNT_MODE) {
|
||||
delete archive;
|
||||
archive = NULL;
|
||||
}
|
||||
|
||||
return archive;
|
||||
}
|
||||
}
|
||||
|
||||
/* 802B81D0-802B8258 .text becomeCurrent__10JKRArchiveFPCc */
|
||||
void JKRArchive::becomeCurrent(const char*) {
|
||||
/* Nonmatching */
|
||||
bool JKRArchive::becomeCurrent(const char* path) {
|
||||
SDIDirEntry* dirEntry;
|
||||
if (*path == '/') {
|
||||
path++;
|
||||
|
||||
if (*path == '\0')
|
||||
path = NULL;
|
||||
dirEntry = findDirectory(path, 0);
|
||||
} else {
|
||||
dirEntry = findDirectory(path, getCurrentDirID());
|
||||
}
|
||||
|
||||
bool found = dirEntry != NULL;
|
||||
if (found) {
|
||||
setCurrentVolume(this);
|
||||
setCurrentDirID(dirEntry - mNodes);
|
||||
}
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
/* 802B8258-802B82D0 .text getDirEntry__10JKRArchiveCFPQ210JKRArchive9SDirEntryUl */
|
||||
void JKRArchive::getDirEntry(JKRArchive::SDirEntry*, unsigned long) const {
|
||||
/* Nonmatching */
|
||||
bool JKRArchive::getDirEntry(SDirEntry* dirEntry, u32 index) const {
|
||||
SDIFileEntry* fileEntry = findIdxResource(index);
|
||||
if (!fileEntry) {
|
||||
return false;
|
||||
}
|
||||
|
||||
dirEntry->flags = fileEntry->getFlags();
|
||||
dirEntry->id = fileEntry->getFileID();
|
||||
dirEntry->name = mStringTable + fileEntry->getNameOffset();
|
||||
return true;
|
||||
}
|
||||
|
||||
/* 802B82D0-802B8380 .text getGlbResource__10JKRArchiveFUlPCcP10JKRArchive */
|
||||
void JKRArchive::getGlbResource(unsigned long, const char*, JKRArchive*) {
|
||||
/* Nonmatching */
|
||||
void* JKRArchive::getGlbResource(u32 param_0, const char* path, JKRArchive* archive) {
|
||||
void* resource = NULL;
|
||||
if (archive) {
|
||||
return archive->getResource(param_0, path);
|
||||
}
|
||||
|
||||
JSUList<JKRFileLoader>& volumeList = getVolumeList();
|
||||
JSUListIterator<JKRFileLoader> iterator;
|
||||
for (iterator = volumeList.getFirst(); iterator != volumeList.getEnd(); ++iterator) {
|
||||
if (iterator->getVolumeType() == 'RARC') {
|
||||
resource = iterator->getResource(param_0, path);
|
||||
if (resource)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return resource;
|
||||
}
|
||||
|
||||
/* 802B8380-802B8450 .text getResource__10JKRArchiveFPCc */
|
||||
void JKRArchive::getResource(const char*) {
|
||||
/* Nonmatching */
|
||||
void* JKRArchive::getResource(const char* path) {
|
||||
JUT_ASSERT(285, isMounted());
|
||||
SDIFileEntry* fileEntry;
|
||||
if (*path == '/') {
|
||||
fileEntry = findFsResource(path + 1, 0);
|
||||
} else {
|
||||
fileEntry = findFsResource(path, getCurrentDirID());
|
||||
}
|
||||
|
||||
if (fileEntry) {
|
||||
return fetchResource(fileEntry, NULL);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* 802B8450-802B8528 .text getResource__10JKRArchiveFUlPCc */
|
||||
void JKRArchive::getResource(unsigned long, const char*) {
|
||||
/* Nonmatching */
|
||||
void* JKRArchive::getResource(u32 type, const char* path) {
|
||||
JUT_ASSERT(332, isMounted());
|
||||
SDIFileEntry* fileEntry;
|
||||
if (type == 0 || type == '????') {
|
||||
fileEntry = findNameResource(path);
|
||||
} else {
|
||||
fileEntry = findTypeResource(type, path);
|
||||
}
|
||||
|
||||
if (fileEntry) {
|
||||
return fetchResource(fileEntry, NULL);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* 802B8528-802B85F0 .text readTypeResource__10JKRArchiveFPvUlUlPCcP10JKRArchive */
|
||||
void JKRArchive::readTypeResource(void*, unsigned long, unsigned long, const char*, JKRArchive*) {
|
||||
// missing instructions
|
||||
void JKRArchive::readTypeResource(void* buffer, u32 bufferSize, u32 type, const char* path, JKRArchive* archive) {
|
||||
/* Nonmatching */
|
||||
if (archive) {
|
||||
archive->readResource(buffer, bufferSize, type, path);
|
||||
return;
|
||||
}
|
||||
JSUListIterator<JKRFileLoader> iterator;
|
||||
for (iterator = sVolumeList.getFirst(); iterator != sVolumeList.getEnd(); iterator++) {
|
||||
if (iterator->getVolumeType() == 'RARC') {
|
||||
u32 result = iterator->readResource(buffer, bufferSize, type, path);
|
||||
if (result != 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 802B85F0-802B86DC .text readResource__10JKRArchiveFPvUlUlPCc */
|
||||
void JKRArchive::readResource(void*, unsigned long, unsigned long, const char*) {
|
||||
/* Nonmatching */
|
||||
u32 JKRArchive::readResource(void* buffer, u32 bufferSize, u32 type, const char* path) {
|
||||
JUT_ASSERT(491, isMounted());
|
||||
SDIFileEntry* fileEntry;
|
||||
if (type == 0 || type == '????') {
|
||||
fileEntry = findNameResource(path);
|
||||
} else {
|
||||
fileEntry = findTypeResource(type, path);
|
||||
}
|
||||
|
||||
if (fileEntry) {
|
||||
u32 resourceSize;
|
||||
fetchResource(buffer, bufferSize, fileEntry, &resourceSize);
|
||||
return resourceSize;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* 802B86DC-802B87C0 .text readResource__10JKRArchiveFPvUlPCc */
|
||||
void JKRArchive::readResource(void*, unsigned long, const char*) {
|
||||
/* Nonmatching */
|
||||
u32 JKRArchive::readResource(void* buffer, u32 bufferSize, const char* path) {
|
||||
JUT_ASSERT(537, isMounted());
|
||||
SDIFileEntry* fileEntry;
|
||||
if (*path == '/') {
|
||||
fileEntry = findFsResource(path + 1, 0);
|
||||
} else {
|
||||
fileEntry = findFsResource(path, getCurrentDirID());
|
||||
}
|
||||
|
||||
if (fileEntry) {
|
||||
u32 resourceSize;
|
||||
fetchResource(buffer, bufferSize, fileEntry, &resourceSize);
|
||||
return resourceSize;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* 802B87C0-802B8878 .text readIdxResource__10JKRArchiveFPvUlUl */
|
||||
void JKRArchive::readIdxResource(void*, unsigned long, unsigned long) {
|
||||
/* Nonmatching */
|
||||
u32 JKRArchive::readIdxResource(void* buffer, u32 bufferSize, u32 index) {
|
||||
JUT_ASSERT(593, isMounted());
|
||||
SDIFileEntry* fileEntry = findIdxResource(index);
|
||||
if (fileEntry) {
|
||||
u32 resourceSize;
|
||||
fetchResource(buffer, bufferSize, fileEntry, &resourceSize);
|
||||
return resourceSize;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* 802B8878-802B8930 .text readResource__10JKRArchiveFPvUlUs */
|
||||
void JKRArchive::readResource(void*, unsigned long, unsigned short) {
|
||||
/* Nonmatching */
|
||||
u32 JKRArchive::readResource(void* buffer, u32 bufferSize, u16 id) {
|
||||
JUT_ASSERT(627, isMounted());
|
||||
SDIFileEntry* fileEntry = findIdResource(id);
|
||||
if (fileEntry) {
|
||||
u32 resourceSize;
|
||||
fetchResource(buffer, bufferSize, fileEntry, &resourceSize);
|
||||
return resourceSize;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* 802B8930-802B89B8 .text removeResourceAll__10JKRArchiveFv */
|
||||
void JKRArchive::removeResourceAll() {
|
||||
/* Nonmatching */
|
||||
if (mArcInfoBlock && mMountMode != MOUNT_MEM) {
|
||||
SDIFileEntry* fileEntry = mFiles;
|
||||
for (int i = 0; i < mArcInfoBlock->num_file_entries; fileEntry++, i++) {
|
||||
if (fileEntry->data) {
|
||||
JKRFreeToHeap(mHeap, fileEntry->data);
|
||||
fileEntry->data = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 802B89B8-802B8A54 .text removeResource__10JKRArchiveFPv */
|
||||
void JKRArchive::removeResource(void*) {
|
||||
/* Nonmatching */
|
||||
bool JKRArchive::removeResource(void* resource) {
|
||||
JUT_ASSERT(687, resource != 0);
|
||||
SDIFileEntry* fileEntry = findPtrResource(resource);
|
||||
if (fileEntry == NULL)
|
||||
return false;
|
||||
|
||||
fileEntry->data = NULL;
|
||||
JKRFreeToHeap(mHeap, resource);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* 802B8A54-802B8AE4 .text detachResource__10JKRArchiveFPv */
|
||||
void JKRArchive::detachResource(void*) {
|
||||
/* Nonmatching */
|
||||
bool JKRArchive::detachResource(void* resource) {
|
||||
JUT_ASSERT(719, resource != 0);
|
||||
SDIFileEntry* fileEntry = findPtrResource(resource);
|
||||
if (fileEntry == NULL)
|
||||
return false;
|
||||
|
||||
fileEntry->data = NULL;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* 802B8AE4-802B8B6C .text getResSize__10JKRArchiveCFPCv */
|
||||
void JKRArchive::getResSize(const void*) const {
|
||||
/* Nonmatching */
|
||||
u32 JKRArchive::getResSize(const void* resource) const {
|
||||
JUT_ASSERT(746, resource != 0);
|
||||
SDIFileEntry* fileEntry = findPtrResource(resource);
|
||||
if (fileEntry == NULL)
|
||||
return -1;
|
||||
|
||||
return fileEntry->data_size;
|
||||
}
|
||||
|
||||
/* 802B8B6C-802B8BF0 .text countResource__10JKRArchiveCFUl */
|
||||
void JKRArchive::countResource(unsigned long) const {
|
||||
/* Nonmatching */
|
||||
u32 JKRArchive::countResource(u32 type) const {
|
||||
SDIDirEntry* dirEntry = findResType(type);
|
||||
if (dirEntry) {
|
||||
int count = 0;
|
||||
for (int i = dirEntry->first_file_index; i < dirEntry->first_file_index + dirEntry->num_entries; i++) {
|
||||
if (mFiles[i].isUnknownFlag1()) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* 802B8BF0-802B8C50 .text countFile__10JKRArchiveCFPCc */
|
||||
void JKRArchive::countFile(const char*) const {
|
||||
/* Nonmatching */
|
||||
u32 JKRArchive::countFile(const char* path) const {
|
||||
SDIDirEntry* dirEntry;
|
||||
if (*path == '/') {
|
||||
path++;
|
||||
|
||||
if (*path == '\0')
|
||||
path = NULL;
|
||||
dirEntry = findDirectory(path, 0);
|
||||
} else {
|
||||
dirEntry = findDirectory(path, sCurrentDirID);
|
||||
}
|
||||
|
||||
if (dirEntry) {
|
||||
return dirEntry->num_entries;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* 802B8C50-802B8CFC .text getFirstFile__10JKRArchiveCFPCc */
|
||||
void JKRArchive::getFirstFile(const char*) const {
|
||||
/* Nonmatching */
|
||||
JKRFileFinder* JKRArchive::getFirstFile(const char* path) const {
|
||||
SDIDirEntry* dirEntry;
|
||||
if (*path == '/') {
|
||||
path++;
|
||||
|
||||
if (*path == '\0')
|
||||
path = NULL;
|
||||
dirEntry = findDirectory(path, 0);
|
||||
} else {
|
||||
dirEntry = findDirectory(path, sCurrentDirID);
|
||||
}
|
||||
|
||||
if (dirEntry) {
|
||||
return new (JKRHeap::sSystemHeap, 0) JKRArcFinder((JKRArchive*)this, dirEntry->first_file_index, dirEntry->num_entries);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* 802B8CFC-802B8DC4 .text getFirstResource__10JKRArchiveCFUl */
|
||||
void JKRArchive::getFirstResource(unsigned long) const {
|
||||
/* Nonmatching */
|
||||
JKRArcFinder* JKRArchive::getFirstResource(u32 type) const {
|
||||
SDIDirEntry* dirEntry = findResType(type);
|
||||
if (dirEntry && (getFileAttribute(dirEntry->first_file_index) & 1)) {
|
||||
return new (JKRHeap::sSystemHeap, 0) JKRArcFinder((JKRArchive*)this, dirEntry->first_file_index, countResource(type));
|
||||
}
|
||||
return new (JKRHeap::sSystemHeap, 0) JKRArcFinder((JKRArchive*)this, 0, 0);
|
||||
}
|
||||
|
||||
/* 802B8DC4-802B8DFC .text getFileAttribute__10JKRArchiveCFUl */
|
||||
void JKRArchive::getFileAttribute(unsigned long) const {
|
||||
/* Nonmatching */
|
||||
u32 JKRArchive::getFileAttribute(u32 index) const {
|
||||
SDIFileEntry* fileEntry = findIdxResource(index);
|
||||
if (fileEntry) {
|
||||
return fileEntry->getFlags();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4,54 +4,157 @@
|
||||
//
|
||||
|
||||
#include "JSystem/JKernel/JKRFileLoader.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "MSL_C/string.h"
|
||||
#include "MSL_C/MSL_Common/Src/ctype.h"
|
||||
#include "global.h"
|
||||
|
||||
JKRFileLoader* JKRFileLoader::sCurrentVolume;
|
||||
JSUList<JKRFileLoader> JKRFileLoader::sVolumeList;
|
||||
|
||||
/* 802B6770-802B67C8 .text __ct__13JKRFileLoaderFv */
|
||||
JKRFileLoader::JKRFileLoader() {
|
||||
/* Nonmatching */
|
||||
JKRFileLoader::JKRFileLoader() : mFileLoaderLink(this) {
|
||||
mVolumeName = NULL;
|
||||
mVolumeType = 0;
|
||||
mMountCount = 0;
|
||||
}
|
||||
|
||||
/* 802B67C8-802B6854 .text __dt__13JKRFileLoaderFv */
|
||||
JKRFileLoader::~JKRFileLoader() {
|
||||
/* Nonmatching */
|
||||
if (getCurrentVolume() == this) {
|
||||
setCurrentVolume(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/* 802B6854-802B68A4 .text unmount__13JKRFileLoaderFv */
|
||||
void JKRFileLoader::unmount() {
|
||||
/* Nonmatching */
|
||||
s32 count = mMountCount;
|
||||
if (mMountCount != 0) {
|
||||
count--;
|
||||
mMountCount = count;
|
||||
if (count == 0) {
|
||||
delete this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 802B68A4-802B68F0 .text getGlbResource__13JKRFileLoaderFPCc */
|
||||
void JKRFileLoader::getGlbResource(const char*) {
|
||||
/* Nonmatching */
|
||||
void* JKRFileLoader::getGlbResource(const char* name) {
|
||||
const char* name_reference[1];
|
||||
name_reference[0] = name;
|
||||
|
||||
JKRFileLoader* fileLoader = findVolume(name_reference);
|
||||
void* resource;
|
||||
if (fileLoader == NULL) {
|
||||
resource = NULL;
|
||||
} else {
|
||||
resource = fileLoader->getResource(name_reference[0]);
|
||||
}
|
||||
|
||||
return resource;
|
||||
}
|
||||
|
||||
/* 802B68F0-802B6988 .text getGlbResource__13JKRFileLoaderFPCcP13JKRFileLoader */
|
||||
void JKRFileLoader::getGlbResource(const char*, JKRFileLoader*) {
|
||||
/* Nonmatching */
|
||||
void* JKRFileLoader::getGlbResource(const char* name, JKRFileLoader* fileLoader) {
|
||||
void* resource = NULL;
|
||||
if (fileLoader) {
|
||||
return fileLoader->getResource(0, name);
|
||||
}
|
||||
|
||||
JSUList<JKRFileLoader>& volumeList = getVolumeList();
|
||||
JSUListIterator<JKRFileLoader> iterator;
|
||||
for (iterator = volumeList.getFirst(); iterator != volumeList.getEnd(); ++iterator) {
|
||||
resource = iterator->getResource(0, name);
|
||||
if (resource)
|
||||
break;
|
||||
}
|
||||
return resource;
|
||||
}
|
||||
|
||||
/* 802B6988-802B6A20 .text removeResource__13JKRFileLoaderFPvP13JKRFileLoader */
|
||||
void JKRFileLoader::removeResource(void*, JKRFileLoader*) {
|
||||
/* Nonmatching */
|
||||
bool JKRFileLoader::removeResource(void* resource, JKRFileLoader* fileLoader) {
|
||||
if (fileLoader) {
|
||||
return fileLoader->removeResource(resource);
|
||||
}
|
||||
|
||||
JSUList<JKRFileLoader>& volumeList = getVolumeList();
|
||||
JSUListIterator<JKRFileLoader> iterator;
|
||||
for (iterator = volumeList.getFirst(); iterator != volumeList.getEnd(); ++iterator) {
|
||||
if (iterator->removeResource(resource)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* 802B6A20-802B6AB8 .text detachResource__13JKRFileLoaderFPvP13JKRFileLoader */
|
||||
void JKRFileLoader::detachResource(void*, JKRFileLoader*) {
|
||||
/* Nonmatching */
|
||||
bool JKRFileLoader::detachResource(void* resource, JKRFileLoader* fileLoader) {
|
||||
if (fileLoader) {
|
||||
return fileLoader->detachResource(resource);
|
||||
}
|
||||
|
||||
JSUList<JKRFileLoader>& volumeList = getVolumeList();
|
||||
JSUListIterator<JKRFileLoader> iterator;
|
||||
for (iterator = volumeList.getFirst(); iterator != volumeList.getEnd(); ++iterator) {
|
||||
if (iterator->detachResource(resource)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* 802B6AB8-802B6B44 .text findVolume__13JKRFileLoaderFPPCc */
|
||||
void JKRFileLoader::findVolume(const char**) {
|
||||
/* Nonmatching */
|
||||
JKRFileLoader* JKRFileLoader::findVolume(const char** volumeName) {
|
||||
if (*volumeName[0] != '/') {
|
||||
return getCurrentVolume();
|
||||
}
|
||||
|
||||
char volumeNameBuffer[0x101];
|
||||
*volumeName = fetchVolumeName(volumeNameBuffer, ARRAY_SIZE(volumeNameBuffer), *volumeName);
|
||||
|
||||
JSUList<JKRFileLoader>& volumeList = getVolumeList();
|
||||
JSUListIterator<JKRFileLoader> iterator;
|
||||
for (iterator = volumeList.getFirst(); iterator != volumeList.getEnd(); ++iterator) {
|
||||
if (strcmp(volumeNameBuffer, iterator->mVolumeName) == 0) {
|
||||
return iterator.getObject();
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static char rootPath[2] = "/";
|
||||
|
||||
/* 802B6B44-802B6C20 .text fetchVolumeName__13JKRFileLoaderFPclPCc */
|
||||
void JKRFileLoader::fetchVolumeName(char*, long, const char*) {
|
||||
/* Nonmatching */
|
||||
}
|
||||
const char* JKRFileLoader::fetchVolumeName(char* buffer, long bufferSize, const char* path) {
|
||||
if (strcmp(path, "/") == 0) {
|
||||
strcpy(buffer, rootPath);
|
||||
return rootPath;
|
||||
}
|
||||
|
||||
/* 802B6C64-802B6CB8 .text __dt__24JSUList<13JKRFileLoader>Fv */
|
||||
JSUList<JKRFileLoader>::~JSUList() {
|
||||
/* Nonmatching */
|
||||
path++;
|
||||
while (*path != 0 && *path != '/') {
|
||||
if (1 < bufferSize) {
|
||||
int lower_char;
|
||||
int ch = (int)*path;
|
||||
if (ch == -1) {
|
||||
lower_char = -1;
|
||||
} else {
|
||||
lower_char = __lower_map[ch & 0xFF];
|
||||
}
|
||||
|
||||
*buffer = lower_char;
|
||||
buffer++;
|
||||
bufferSize--;
|
||||
}
|
||||
path++;
|
||||
}
|
||||
|
||||
*buffer = '\0';
|
||||
if (*path == '\0') {
|
||||
path = rootPath;
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
@@ -4,54 +4,135 @@
|
||||
//
|
||||
|
||||
#include "JSystem/JKernel/JKRThread.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
JSUList<JKRThread> JKRThread::sThreadList;
|
||||
JKRThreadSwitch* JKRThreadSwitch::sManager;
|
||||
OSThread* preEnd;
|
||||
JKRThreadSwitch_PreCallback JKRThreadSwitch::mUserPreCallback;
|
||||
JKRThreadSwitch_PostCallback JKRThreadSwitch::mUserPostCallback;
|
||||
|
||||
/* 802B3D1C-802B3E38 .text __ct__9JKRThreadFUlii */
|
||||
JKRThread::JKRThread(unsigned long, int, int) {
|
||||
/* Nonmatching */
|
||||
JKRThread::JKRThread(u32 stack_size, int message_count, int param_3) : mThreadListLink(this) {
|
||||
mHeap = JKRHeap::findFromRoot(this);
|
||||
if (mHeap == NULL) {
|
||||
mHeap = JKRGetSystemHeap();
|
||||
}
|
||||
|
||||
mStackSize = stack_size & 0xffffffe0;
|
||||
mStackMemory = JKRAllocFromHeap(mHeap, mStackSize, 0x20);
|
||||
mThreadRecord = (OSThread*)JKRAllocFromHeap(mHeap, sizeof(OSThread), 0x20);
|
||||
|
||||
void* stackBase = (void*)((int)mStackMemory + mStackSize);
|
||||
OSCreateThread(mThreadRecord, start, this, stackBase, mStackSize, param_3, 1);
|
||||
|
||||
mMessageCount = message_count;
|
||||
mMessages = (OSMessage*)JKRAllocFromHeap(mHeap, mMessageCount * sizeof(OSMessage), 0);
|
||||
|
||||
OSInitMessageQueue(&mMessageQueue, mMessages, mMessageCount);
|
||||
getList().append(&mThreadListLink);
|
||||
|
||||
mCurrentHeap = NULL;
|
||||
mCurrentHeapError = NULL;
|
||||
}
|
||||
|
||||
/* 802B3E38-802B3EFC .text __ct__9JKRThreadFP8OSThreadi */
|
||||
JKRThread::JKRThread(OSThread*, int) {
|
||||
/* Nonmatching */
|
||||
JKRThread::JKRThread(OSThread* thread, int message_count) : mThreadListLink(this) {
|
||||
mHeap = NULL;
|
||||
mThreadRecord = thread;
|
||||
mStackSize = (u32)thread->stack_end - (u32)thread->stack_base;
|
||||
mStackMemory = thread->stack_base;
|
||||
|
||||
mMessageCount = message_count;
|
||||
mMessages = (OSMessage*)JKRGetSystemHeap()->alloc(mMessageCount * sizeof(OSMessage), 4);
|
||||
|
||||
OSInitMessageQueue(&mMessageQueue, mMessages, mMessageCount);
|
||||
getList().append(&mThreadListLink);
|
||||
|
||||
mCurrentHeap = NULL;
|
||||
mCurrentHeapError = NULL;
|
||||
}
|
||||
|
||||
/* 802B3EFC-802B3FD4 .text __dt__9JKRThreadFv */
|
||||
JKRThread::~JKRThread() {
|
||||
/* Nonmatching */
|
||||
getList().remove(&mThreadListLink);
|
||||
|
||||
if (mHeap) {
|
||||
BOOL result = OSIsThreadTerminated(mThreadRecord);
|
||||
if (result == FALSE) {
|
||||
OSDetachThread(mThreadRecord);
|
||||
OSCancelThread(mThreadRecord);
|
||||
}
|
||||
JKRFreeToHeap(mHeap, mStackMemory);
|
||||
JKRFreeToHeap(mHeap, mThreadRecord);
|
||||
}
|
||||
i_JKRFree(mMessages);
|
||||
}
|
||||
|
||||
/* 802B3FD4-802B4000 .text start__9JKRThreadFPv */
|
||||
void JKRThread::start(void*) {
|
||||
/* Nonmatching */
|
||||
void* JKRThread::start(void* param) {
|
||||
JKRThread* thread = (JKRThread*)param;
|
||||
return thread->run();
|
||||
}
|
||||
|
||||
/* 802B4000-802B4050 .text __ct__15JKRThreadSwitchFP7JKRHeap */
|
||||
JKRThreadSwitch::JKRThreadSwitch(JKRHeap*) {
|
||||
/* Nonmatching */
|
||||
JKRThreadSwitch::JKRThreadSwitch(JKRHeap* param_0) {
|
||||
mHeap = param_0;
|
||||
OSSetSwitchThreadCallback(JKRThreadSwitch::callback);
|
||||
mSetNextHeap = true;
|
||||
}
|
||||
|
||||
/* 802B4050-802B40EC .text createManager__15JKRThreadSwitchFP7JKRHeap */
|
||||
void JKRThreadSwitch::createManager(JKRHeap*) {
|
||||
/* Nonmatching */
|
||||
JKRThreadSwitch* JKRThreadSwitch::createManager(JKRHeap* heap) {
|
||||
JUT_ASSERT(184, sManager == 0);
|
||||
|
||||
if (!heap) {
|
||||
heap = JKRGetCurrentHeap();
|
||||
}
|
||||
|
||||
sManager = new (heap, 0) JKRThreadSwitch(heap);
|
||||
return sManager;
|
||||
}
|
||||
|
||||
/* 802B40EC-802B41DC .text callback__15JKRThreadSwitchFP8OSThreadP8OSThread */
|
||||
void JKRThreadSwitch::callback(OSThread*, OSThread*) {
|
||||
/* Nonmatching */
|
||||
void JKRThreadSwitch::callback(OSThread* current, OSThread* next) {
|
||||
if (mUserPreCallback) {
|
||||
(*mUserPreCallback)(current, next);
|
||||
}
|
||||
|
||||
if (!current && !next) {
|
||||
preEnd = current;
|
||||
current = NULL;
|
||||
}
|
||||
|
||||
if (!current && !next) {
|
||||
current = preEnd;
|
||||
preEnd = NULL;
|
||||
}
|
||||
|
||||
JSUList<JKRThread>& threadList = JKRThread::getList();
|
||||
JSUListIterator<JKRThread> iterator;
|
||||
for (iterator = threadList.getFirst(); iterator != threadList.getEnd(); ++iterator) {
|
||||
JKRThread* thread = iterator.getObject();
|
||||
|
||||
if (thread->getThreadRecord() == current) {
|
||||
thread->setCurrentHeap(JKRHeap::getCurrentHeap());
|
||||
}
|
||||
|
||||
if (thread->getThreadRecord() == next) {
|
||||
if (sManager->mSetNextHeap) {
|
||||
thread->getCurrentHeap()->becomeCurrentHeap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mUserPostCallback) {
|
||||
(*mUserPostCallback)(current, next);
|
||||
}
|
||||
}
|
||||
|
||||
/* 802B41DC-802B41E4 .text run__9JKRThreadFv */
|
||||
void JKRThread::run() {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
/* 802B41E4-802B422C .text __dt__15JKRThreadSwitchFv */
|
||||
JKRThreadSwitch::~JKRThreadSwitch() {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
/* 802B4270-802B42C4 .text __dt__19JSUList<9JKRThread>Fv */
|
||||
JSUList<JKRThread>::~JSUList() {
|
||||
/* Nonmatching */
|
||||
}
|
||||
static void dummy() {
|
||||
OSReport("Cannot create JKRTask Manager.");
|
||||
OSReport("sManager != 0");
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
// Translation Unit: d_a_mgameboard.cpp
|
||||
//
|
||||
|
||||
#include "d_a_mgameboard.h"
|
||||
#include "d/actor/d_a_mgameboard.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
/* 000000EC-0000010C .text CheckCreateHeap__FP10fopAc_ac_c */
|
||||
|
||||
@@ -128,7 +128,7 @@ bool daObjYgush00_c::_execute() {
|
||||
fopAcM_seStartCurrent(this, 0x61fe, 0);
|
||||
}
|
||||
} else {
|
||||
mpGryw00 = (daObjGryw00_c*)i_fopAcM_SearchByName(PROC_Obj_Gryw00);
|
||||
mpGryw00 = (daObjGryw00_c*)fopAcM_SearchByName(PROC_Obj_Gryw00);
|
||||
}
|
||||
} else {
|
||||
fopAcM_seStartCurrent(this, 0x61fe, 0);
|
||||
|
||||
@@ -127,12 +127,12 @@ namespace daObjMovebox {
|
||||
s32 prm_get_buoy() const { return daObj::PrmAbstract(this, PRM_BUOY_W, PRM_BUOY_S); }
|
||||
s32 prm_get_dmy() const; // Unused?
|
||||
|
||||
BOOL is_switch1() const { return fopAcM_isSwitch(this, prm_get_swSave1()); };
|
||||
BOOL is_switch2() const { return fopAcM_isSwitch(this, prmZ_get_swSave2()); };
|
||||
void on_switch1() const { fopAcM_onSwitch(this, prm_get_swSave1()); };
|
||||
void on_switch2() const { fopAcM_onSwitch(this, prmZ_get_swSave2()); };
|
||||
void off_switch1() const { fopAcM_offSwitch(this, prm_get_swSave1()); };
|
||||
void off_switch2() const { fopAcM_offSwitch(this, prmZ_get_swSave2()); };
|
||||
BOOL is_switch1() const { return fopAcM_isSwitch((Act_c*)this, prm_get_swSave1()); };
|
||||
BOOL is_switch2() const { return fopAcM_isSwitch((Act_c*)this, prmZ_get_swSave2()); };
|
||||
void on_switch1() const { fopAcM_onSwitch((Act_c*)this, prm_get_swSave1()); };
|
||||
void on_switch2() const { fopAcM_onSwitch((Act_c*)this, prmZ_get_swSave2()); };
|
||||
void off_switch1() const { fopAcM_offSwitch((Act_c*)this, prm_get_swSave1()); };
|
||||
void off_switch2() const { fopAcM_offSwitch((Act_c*)this, prmZ_get_swSave2()); };
|
||||
|
||||
void prmZ_init();
|
||||
void prmX_init();
|
||||
|
||||
+111
-11
@@ -3,26 +3,126 @@
|
||||
// Translation Unit: d_seafightgame.cpp
|
||||
//
|
||||
|
||||
#include "d_seafightgame.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "d/d_seafightgame.h"
|
||||
#include "SSystem/SComponent/c_math.h"
|
||||
|
||||
/* 800C1F90-800C20B0 .text init__20dSeaFightGame_info_cFii */
|
||||
void dSeaFightGame_info_c::init(int, int) {
|
||||
/* Nonmatching */
|
||||
int dSeaFightGame_info_c::init(int i_bulletNum, int i_scenario) {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
for (int j = 0; j < 8; j++) {
|
||||
mGrid[i][j] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
mBulletNum = i_bulletNum;
|
||||
mScore = 0;
|
||||
|
||||
switch (i_scenario) {
|
||||
case 1:
|
||||
mAliveShipNum = 1;
|
||||
put_ship(0, 2);
|
||||
break;
|
||||
case 2:
|
||||
mAliveShipNum = 2;
|
||||
put_ship(0, 2);
|
||||
put_ship(1, 3);
|
||||
break;
|
||||
case 3:
|
||||
mAliveShipNum = 3;
|
||||
put_ship(0, 2);
|
||||
put_ship(1, 3);
|
||||
put_ship(2, 4);
|
||||
break;
|
||||
}
|
||||
|
||||
mDeadShipNum = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* 800C20B0-800C225C .text put_ship__20dSeaFightGame_info_cFUcUc */
|
||||
void dSeaFightGame_info_c::put_ship(unsigned char, unsigned char) {
|
||||
/* Nonmatching */
|
||||
int dSeaFightGame_info_c::put_ship(u8 i_shipNo, u8 i_shipSize) {
|
||||
u8 y;
|
||||
u8 x;
|
||||
u8 direction;
|
||||
|
||||
do {
|
||||
direction = (s16)cM_rndF(1000.0f) % 2;
|
||||
y = (int)cM_rndF(8.0f);
|
||||
x = (int)cM_rndF(8.0f);
|
||||
} while (!checkPutShip(y, x, i_shipSize, direction));
|
||||
|
||||
if (direction == 0) {
|
||||
for (int i = 0; i < i_shipSize; i++) {
|
||||
mShips[i_shipNo].m_pos[i][0] = y;
|
||||
mShips[i_shipNo].m_pos[i][1] = x + i;
|
||||
mGrid[y][x + i] = i_shipNo + 102;
|
||||
}
|
||||
|
||||
mShips[i_shipNo].field_0xb = y;
|
||||
mShips[i_shipNo].field_0xc = x;
|
||||
mShips[i_shipNo].field_0xd = 0;
|
||||
mShips[i_shipNo].field_0xe = i_shipSize;
|
||||
} else {
|
||||
for (int i = 0; i < i_shipSize; i++) {
|
||||
mShips[i_shipNo].m_pos[i][0] = y + i;
|
||||
mShips[i_shipNo].m_pos[i][1] = x;
|
||||
mGrid[y + i][x] = i_shipNo + 102;
|
||||
}
|
||||
|
||||
mShips[i_shipNo].field_0xb = y;
|
||||
mShips[i_shipNo].field_0xc = x;
|
||||
mShips[i_shipNo].field_0xd = i_shipSize;
|
||||
mShips[i_shipNo].field_0xe = 0;
|
||||
}
|
||||
|
||||
mShips[i_shipNo].field_0x8 = i_shipSize;
|
||||
mShips[i_shipNo].field_0x9 = i_shipSize;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* 800C225C-800C22FC .text checkPutShip__20dSeaFightGame_info_cFiiii */
|
||||
void dSeaFightGame_info_c::checkPutShip(int, int, int, int) {
|
||||
/* Nonmatching */
|
||||
bool dSeaFightGame_info_c::checkPutShip(int i_y, int i_x, int i_shipSize, int i_direction) {
|
||||
if (i_direction == 0) {
|
||||
for (int i = 0; i < i_shipSize; i++) {
|
||||
if (i_y > 7 || i_x > 7 || mGrid[i_y][i_x] > 100) {
|
||||
return false;
|
||||
}
|
||||
i_x++;
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < i_shipSize; i++) {
|
||||
if (i_y > 7 || i_x > 7 || mGrid[i_y][i_x] > 100) {
|
||||
return false;
|
||||
}
|
||||
i_y++;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* 800C22FC-800C239C .text attack__20dSeaFightGame_info_cFUcUc */
|
||||
void dSeaFightGame_info_c::attack(unsigned char, unsigned char) {
|
||||
/* Nonmatching */
|
||||
}
|
||||
int dSeaFightGame_info_c::attack(u8 i_y, u8 i_x) {
|
||||
int rt = -1;
|
||||
|
||||
u8 uvar1 = mGrid[i_y][i_x];
|
||||
if (uvar1 == 0) {
|
||||
mGrid[i_y][i_x] = 1;
|
||||
} else if (uvar1 > 100) {
|
||||
rt = uvar1 - 102;
|
||||
|
||||
mShips[rt].field_0x9--;
|
||||
if (mShips[rt].field_0x9 == 0) {
|
||||
mAliveShipNum--;
|
||||
mDeadShipNum++;
|
||||
}
|
||||
|
||||
mGrid[i_y][i_x] = 3;
|
||||
} else {
|
||||
return -2;
|
||||
}
|
||||
|
||||
mBulletNum--;
|
||||
mScore++;
|
||||
return rt;
|
||||
}
|
||||
|
||||
@@ -4,24 +4,64 @@
|
||||
//
|
||||
|
||||
#include "m_Do/m_Do_DVDError.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "JSystem/JKernel/JKRThread.h"
|
||||
#include "dolphin/os/OS.h"
|
||||
#include "m_Do/m_Do_dvd_thread.h"
|
||||
#include "m_Do/m_Do_ext.h"
|
||||
|
||||
OSThread DvdErr_thread;
|
||||
u8 DvdErr_stack[0x1000] __attribute__((aligned(16)));
|
||||
|
||||
static OSAlarm Alarm;
|
||||
bool mDoDvdErr_initialized;
|
||||
|
||||
void mDoDvdErr_Watch(void*);
|
||||
void AlarmHandler(OSAlarm*, OSContext*);
|
||||
|
||||
/* 80018BE0-80018CA0 .text mDoDvdErr_ThdInit__Fv */
|
||||
void mDoDvdErr_ThdInit() {
|
||||
/* Nonmatching */
|
||||
if (!mDoDvdErr_initialized) {
|
||||
OSTime time = OSGetTime();
|
||||
OSThread* curThread = OSGetCurrentThread();
|
||||
s32 priority = OSGetThreadPriority(curThread);
|
||||
|
||||
OSCreateThread(&DvdErr_thread, mDoDvdErr_Watch, NULL, DvdErr_stack + sizeof(DvdErr_stack),
|
||||
sizeof(DvdErr_stack), priority - 3, 1);
|
||||
OSResumeThread(&DvdErr_thread);
|
||||
OSCreateAlarm(&Alarm);
|
||||
OSSetPeriodicAlarm(&Alarm, time, OS_BUS_CLOCK / 4, AlarmHandler);
|
||||
|
||||
mDoDvdErr_initialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* 80018CA0-80018CE8 .text mDoDvdErr_ThdCleanup__Fv */
|
||||
void mDoDvdErr_ThdCleanup() {
|
||||
/* Nonmatching */
|
||||
if (mDoDvdErr_initialized) {
|
||||
OSCancelThread(&DvdErr_thread);
|
||||
OSCancelAlarm(&Alarm);
|
||||
mDoDvdErr_initialized = false;
|
||||
}
|
||||
}
|
||||
|
||||
/* 80018CE8-80018D44 .text mDoDvdErr_Watch__FPv */
|
||||
void mDoDvdErr_Watch(void*) {
|
||||
/* Nonmatching */
|
||||
{
|
||||
JKRThread thread(OSGetCurrentThread(), 0);
|
||||
}
|
||||
|
||||
JKRHeap* heap = NULL;
|
||||
heap->becomeCurrentHeap();
|
||||
|
||||
do {
|
||||
if (DVDGetDriveStatus() == DVD_STATE_FATAL_ERROR) {
|
||||
mDoDvdThd::suspend();
|
||||
}
|
||||
OSSuspendThread(&DvdErr_thread);
|
||||
} while (true);
|
||||
}
|
||||
|
||||
/* 80018D44-80018D6C .text AlarmHandler__FP7OSAlarmP9OSContext */
|
||||
void AlarmHandler(OSAlarm*, OSContext*) {
|
||||
/* Nonmatching */
|
||||
OSResumeThread(&DvdErr_thread);
|
||||
}
|
||||
|
||||
+88
-18
@@ -1,32 +1,102 @@
|
||||
//
|
||||
// Generated by dtk
|
||||
// Translation Unit: m_Do_Reset.cpp
|
||||
//
|
||||
/**
|
||||
* m_Do_Reset.cpp
|
||||
* Game Reset Management
|
||||
*/
|
||||
|
||||
#include "m_Do/m_Do_Reset.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "JSystem/JUtility/JUTGamePad.h"
|
||||
#include "JSystem/JUtility/JUTXfb.h"
|
||||
#include "dolphin/gx/GX.h"
|
||||
#include "dolphin/os/OS.h"
|
||||
#include "m_Do/m_Do_DVDError.h"
|
||||
#include "m_Do/m_Do_audio.h"
|
||||
|
||||
/* 80017D40-80017D44 .text my_OSCancelAlarmAll__Fv */
|
||||
void my_OSCancelAlarmAll() {
|
||||
/* Nonmatching */
|
||||
}
|
||||
static void my_OSCancelAlarmAll() {}
|
||||
|
||||
/* 80017D44-80017D7C .text destroyVideo__Fv */
|
||||
void destroyVideo() {
|
||||
/* Nonmatching */
|
||||
JUTVideo::destroyManager();
|
||||
GXSetDrawDoneCallback(NULL);
|
||||
VISetBlack(1);
|
||||
VIFlush();
|
||||
VIWaitForRetrace();
|
||||
}
|
||||
|
||||
#if VERSION == VERSION_JP
|
||||
int mDoRst::mResetFlag;
|
||||
int mDoRst::mResetPrepare;
|
||||
int mDoRst::m3ButtonResetFlag;
|
||||
int mDoRst::m3ButtonResetPort = -1;
|
||||
#else
|
||||
mDoRstData* mDoRst::mResetData;
|
||||
#endif
|
||||
|
||||
/* 80017D7C-80017E40 .text mDoRst_reset__FiUli */
|
||||
void mDoRst_reset(int, unsigned long, int) {
|
||||
/* Nonmatching */
|
||||
void mDoRst_reset(int param_0, unsigned long param_1, int param_2) {
|
||||
if (DVDGetDriveStatus() == DVD_STATE_FATAL_ERROR) {
|
||||
do {
|
||||
} while (true);
|
||||
}
|
||||
|
||||
JUTXfb::getManager()->clearIndex();
|
||||
mDoDvdErr_ThdCleanup();
|
||||
JUTGamePad::clearForReset();
|
||||
mDoAud_zelAudio_c::offInitFlag();
|
||||
|
||||
#if VERSION != VERSION_JP
|
||||
VIWaitForRetrace();
|
||||
VIWaitForRetrace();
|
||||
#endif
|
||||
|
||||
OSThread* gxThread = GXGetCurrentGXThread();
|
||||
s32 enable = OSDisableInterrupts();
|
||||
|
||||
if (gxThread != OSGetCurrentThread()) {
|
||||
OSCancelThread(gxThread);
|
||||
GXSetCurrentGXThread();
|
||||
}
|
||||
|
||||
GXFlush();
|
||||
GXAbortFrame();
|
||||
GXDrawDone();
|
||||
OSRestoreInterrupts(enable);
|
||||
destroyVideo();
|
||||
my_OSCancelAlarmAll();
|
||||
LCDisable();
|
||||
#if VERSION != VERSION_JP
|
||||
OSSetSaveRegion(mDoRst::mResetData, (u8*)&mDoRst::getResetData + 0x10);
|
||||
#endif
|
||||
OSResetSystem(param_0, param_1, param_2);
|
||||
|
||||
do {
|
||||
VIWaitForRetrace();
|
||||
} while (true);
|
||||
}
|
||||
|
||||
/* 80017E40-80017EF0 .text mDoRst_resetCallBack__FiPv */
|
||||
void mDoRst_resetCallBack(int, void*) {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
/* 80017EF0-80017EF8 .text getResetData__6mDoRstFv */
|
||||
void mDoRst::getResetData() {
|
||||
/* Nonmatching */
|
||||
void mDoRst_resetCallBack(int port, void*) {
|
||||
if (!mDoRst::isReset()) {
|
||||
if (port == -1) {
|
||||
JUTGamePad::clearForReset();
|
||||
JUTGamePad::CRumble::setEnabled(0xF0000000);
|
||||
} else {
|
||||
if (mDoRst::is3ButtonReset()) {
|
||||
JUTGamePad::C3ButtonReset::sResetOccurred = false;
|
||||
JUTGamePad::C3ButtonReset::sCallback = mDoRst_resetCallBack;
|
||||
JUTGamePad::C3ButtonReset::sCallbackArg = NULL;
|
||||
return;
|
||||
}
|
||||
mDoRst::on3ButtonReset();
|
||||
mDoRst::set3ButtonResetPort(port);
|
||||
JUTGamePad::clearForReset();
|
||||
JUTGamePad::CRumble::setEnabled(0xF0000000);
|
||||
}
|
||||
#if VERSION != VERSION_JP
|
||||
if (DVDCheckDisk() == 0) {
|
||||
mDoRst_reset(1, 0x80000000, 0);
|
||||
}
|
||||
#endif
|
||||
mDoRst::onReset();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,42 +1,104 @@
|
||||
//
|
||||
// Generated by dtk
|
||||
// Translation Unit: m_Do_machine_exception.cpp
|
||||
//
|
||||
/**
|
||||
* m_Do_machine_exception.cpp
|
||||
* Exception Print Functions
|
||||
*/
|
||||
|
||||
#include "m_Do/m_Do_machine_exception.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "DynamicLink.h"
|
||||
#include "JSystem/JFramework/JFWSystem.h"
|
||||
#include "JSystem/JKernel/JKRAram.h"
|
||||
#include "JSystem/JUtility/JUTConsole.h"
|
||||
#include "d/d_com_inf_game.h"
|
||||
#include "m_Do/m_Do_ext.h"
|
||||
#include "m_Do/m_Do_main.h"
|
||||
|
||||
static JUTConsole* sConsole;
|
||||
|
||||
/* 8001BADC-8001BB68 .text print_f__FPCce */
|
||||
void print_f(const char*, ...) {
|
||||
/* Nonmatching */
|
||||
void print_f(const char* fmt, ...) {
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
JUTConsole_print_f_va_(sConsole, fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
/* 8001BB68-8001BB90 .text print__FPCc */
|
||||
void print(const char*) {
|
||||
/* Nonmatching */
|
||||
void print(const char* string) {
|
||||
sConsole->print(string);
|
||||
}
|
||||
|
||||
static const char* unused_803396f8 = "--------------------------------------\n";
|
||||
|
||||
/* 8001BB90-8001BCEC .text dispHeapInfo__Fv */
|
||||
void dispHeapInfo() {
|
||||
/* Nonmatching */
|
||||
JKRExpHeap* zelda = zeldaHeap;
|
||||
JKRExpHeap* game = gameHeap;
|
||||
JKRExpHeap* archive = archiveHeap;
|
||||
|
||||
u32 zeldaFree = zelda->getFreeSize();
|
||||
u32 gameFree = game->getFreeSize();
|
||||
u32 archiveFree = archive->getFreeSize();
|
||||
u32 zeldaTotal = zelda->getTotalFreeSize();
|
||||
u32 gameTotal = game->getTotalFreeSize();
|
||||
u32 archiveTotal = archive->getTotalFreeSize();
|
||||
|
||||
print("-- Heap Free / TotalFree (KB) --\n");
|
||||
print_f(" Zelda %5d / %5d\n", zeldaFree / 1024, zeldaTotal / 1024);
|
||||
print_f(" Game %5d / %5d\n", gameFree / 1024, gameTotal / 1024);
|
||||
print_f("Archive %5d / %5d\n", archiveFree / 1024, archiveTotal / 1024);
|
||||
print("--------------------------------\n");
|
||||
|
||||
if (JKRAram::getAramHeap()) {
|
||||
JKRAram::getAramHeap()->dump();
|
||||
}
|
||||
DynamicModuleControlBase::dump();
|
||||
g_dComIfG_gameInfo.mResControl.dump();
|
||||
|
||||
zelda->dump_sort();
|
||||
game->dump_sort();
|
||||
archive->dump_sort();
|
||||
}
|
||||
|
||||
/* 8001BCEC-8001BD30 .text dispGameInfo__Fv */
|
||||
void dispGameInfo() {
|
||||
/* Nonmatching */
|
||||
print_f("Start StageName:RoomNo [%s:%d]\n", dComIfGp_getStartStageName(),
|
||||
dComIfGp_getStartStageRoomNo());
|
||||
}
|
||||
|
||||
/* 8001BD30-8001BE84 .text dispDateInfo__Fv */
|
||||
void dispDateInfo() {
|
||||
/* Nonmatching */
|
||||
print("------------- Date Infomation ---------\n");
|
||||
print(" FINAL VERSION\n");
|
||||
print("COMPILE USER: FINAL\n");
|
||||
print_f("COPYDATE : %17s\n", mDoMain::COPYDATE_STRING);
|
||||
|
||||
OSCalendarTime time;
|
||||
OSTicksToCalendarTime(mDoMain::sPowerOnTime, &time);
|
||||
print_f("PowerOnTime: %04d/%2d/%2d %2d:%2d:%2d`%03d\"%03d\n", time.year, time.month,
|
||||
time.day_of_month, time.hours, time.minutes, time.seconds, time.milliseconds,
|
||||
time.microseconds);
|
||||
|
||||
OSTicksToCalendarTime(mDoMain::sHungUpTime, &time);
|
||||
print_f("HungUpTime : %04d/%2d/%2d %2d:%2d:%2d`%03d\"%03d\n", time.year, time.month,
|
||||
time.day_of_month, time.hours, time.minutes, time.seconds, time.milliseconds,
|
||||
time.microseconds);
|
||||
|
||||
OSTicksToCalendarTime(mDoMain::sHungUpTime - mDoMain::sPowerOnTime, &time);
|
||||
print_f("PlayTime : %4d days, %2d:%2d:%2d`%03d\"%03d\n", time.year_day, time.hours,
|
||||
time.minutes, time.seconds, time.milliseconds, time.microseconds);
|
||||
print("---------------------------------------\n");
|
||||
}
|
||||
|
||||
/* 8001BE84-8001BEAC .text dispConsoleToTerminal__Fv */
|
||||
void dispConsoleToTerminal() {
|
||||
/* Nonmatching */
|
||||
JFWSystem::getSystemConsole()->dumpToTerminal(0xFFFFFFFF);
|
||||
}
|
||||
|
||||
/* 8001BEAC-8001BEDC .text exception_addition__FP10JUTConsole */
|
||||
void exception_addition(JUTConsole*) {
|
||||
/* Nonmatching */
|
||||
void exception_addition(JUTConsole* pConsole) {
|
||||
sConsole = pConsole;
|
||||
dispHeapInfo();
|
||||
dispDateInfo();
|
||||
dispConsoleToTerminal();
|
||||
dispGameInfo();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user