diff --git a/config/GZ2E01/splits.txt b/config/GZ2E01/splits.txt index a65b9ec21b9..b9d94938551 100644 --- a/config/GZ2E01/splits.txt +++ b/config/GZ2E01/splits.txt @@ -88,7 +88,7 @@ m_Do/m_Do_Reset.cpp: .text start:0x800155D8 end:0x800157F4 .text start:0x800157F4 end:0x800157FC .rodata start:0x80374198 end:0x803741A8 - .sbss start:0x80450C78 end:0x80450C90 + .sbss start:0x80450C78 end:0x80450C80 m_Do/m_Do_dvd_thread.cpp: .text start:0x800157FC end:0x8001659C @@ -96,10 +96,12 @@ m_Do/m_Do_dvd_thread.cpp: .rodata start:0x803741A8 end:0x803743F8 .data start:0x803A34A8 end:0x803A34F8 .bss start:0x803DD940 end:0x803DECC0 + .sbss start:0x80450C80 end:0x80450C88 m_Do/m_Do_DVDError.cpp: .text start:0x8001659C end:0x8001672C .bss start:0x803DECC0 end:0x803DFC20 + .sbss start:0x80450C88 end:0x80450C90 m_Do/m_Do_MemCard.cpp: .text start:0x8001672C end:0x80017498 diff --git a/config/GZ2E01/symbols.txt b/config/GZ2E01/symbols.txt index 735998d6985..1a64fb559f6 100644 --- a/config/GZ2E01/symbols.txt +++ b/config/GZ2E01/symbols.txt @@ -21670,7 +21670,7 @@ mBlureRate__13mDoGph_gInf_c = .sbss:0x80450BE5; // type:object size:0x1 scope:gl mFade__13mDoGph_gInf_c = .sbss:0x80450BE6; // type:object size:0x1 scope:global align:1 data:byte mAutoForcus__13mDoGph_gInf_c = .sbss:0x80450BE7; // type:object size:0x1 scope:global align:1 data:byte data_80450BE8 = .sbss:0x80450BE8; // type:object size:0x1 scope:local align:1 data:byte -mDebugFill = .sbss:0x80450BF0; // type:object size:0x1 scope:local align:1 data:byte +mDebugFill__6mDoMch = .sbss:0x80450BF0; // type:object size:0x1 scope:local align:1 data:byte solidHeapErrors = .sbss:0x80450BF4; // type:object size:0x4 scope:global align:4 data:4byte gameHeapErrors = .sbss:0x80450BF8; // type:object size:0x4 scope:global align:4 data:4byte zeldaHeapErrors = .sbss:0x80450BFC; // type:object size:0x4 scope:global align:4 data:4byte @@ -21709,7 +21709,7 @@ struct_80450C7C = .sbss:0x80450C7C; // type:object size:0x1 scope:global align:1 struct_80450C7D = .sbss:0x80450C7D; // type:object size:0x1 scope:global align:1 struct_80450C7E = .sbss:0x80450C7E; // type:object size:0x1 scope:global align:1 struct_80450C7F = .sbss:0x80450C7F; // type:object size:0x1 scope:global align:1 -SyncWidthSound = .sbss:0x80450C80; // type:object size:0x1 scope:global align:1 data:byte +SyncWidthSound__9mDoDvdThd = .sbss:0x80450C80; // type:object size:0x1 scope:global align:1 data:byte sDefaultDirection = .sbss:0x80450C81; // type:object size:0x1 scope:global align:1 data:byte struct_80450C82 = .sbss:0x80450C82; // type:object size:0x1 scope:global align:1 struct_80450C83 = .sbss:0x80450C83; // type:object size:0x1 scope:global align:1 diff --git a/config/GZ2J01/splits.txt b/config/GZ2J01/splits.txt index 760a21d8503..c124b19d78f 100644 --- a/config/GZ2J01/splits.txt +++ b/config/GZ2J01/splits.txt @@ -87,7 +87,7 @@ m_Do/m_Do_lib.cpp: m_Do/m_Do_Reset.cpp: .text start:0x800155D8 end:0x800157FC .rodata start:0x80376638 end:0x80376648 - .sbss start:0x8044ADB8 end:0x8044ADD0 + .sbss start:0x8044ADB8 end:0x8044ADC0 m_Do/m_Do_dvd_thread.cpp: .text start:0x800157FC end:0x8001659C @@ -95,10 +95,12 @@ m_Do/m_Do_dvd_thread.cpp: .rodata start:0x80376648 end:0x80376898 .data start:0x8039D608 end:0x8039D658 .bss start:0x803D7A80 end:0x803D8E00 + .sbss start:0x8044ADC0 end:0x8044ADC8 m_Do/m_Do_DVDError.cpp: .text start:0x8001659C end:0x8001672C .bss start:0x803D8E00 end:0x803D9D60 + .sbss start:0x8044ADC8 end:0x8044ADD0 m_Do/m_Do_MemCard.cpp: .text start:0x8001672C end:0x80017498 diff --git a/config/GZ2J01/symbols.txt b/config/GZ2J01/symbols.txt index faabb1f8ed9..7788d897a91 100644 --- a/config/GZ2J01/symbols.txt +++ b/config/GZ2J01/symbols.txt @@ -21690,7 +21690,7 @@ mBlureRate__13mDoGph_gInf_c = .sbss:0x8044AD25; // type:object size:0x1 data:byt mFade__13mDoGph_gInf_c = .sbss:0x8044AD26; // type:object size:0x1 data:byte mAutoForcus__13mDoGph_gInf_c = .sbss:0x8044AD27; // type:object size:0x1 data:byte lbl_8044AD28 = .sbss:0x8044AD28; // type:object size:0x8 data:byte -mDebugFill = .sbss:0x8044AD30; // type:object size:0x1 data:byte +mDebugFill__6mDoMch = .sbss:0x8044AD30; // type:object size:0x1 data:byte solidHeapErrors = .sbss:0x8044AD34; // type:object size:0x4 scope:global align:4 data:4byte gameHeapErrors = .sbss:0x8044AD38; // type:object size:0x4 scope:global align:4 data:4byte zeldaHeapErrors = .sbss:0x8044AD3C; // type:object size:0x4 scope:global align:4 data:4byte @@ -21725,7 +21725,7 @@ aram_cache_size = .sbss:0x8044ADA8; // type:object size:0x4 scope:global align:4 mSystemFar__14mDoLib_clipper = .sbss:0x8044ADB0; // type:object size:0x4 scope:global align:4 data:float mFovyRate__14mDoLib_clipper = .sbss:0x8044ADB4; // type:object size:0x4 scope:global align:4 data:float mResetData__6mDoRst = .sbss:0x8044ADB8; // type:object size:0x4 scope:global align:4 data:4byte -SyncWidthSound = .sbss:0x8044ADC0; // type:object size:0x1 data:byte +SyncWidthSound__9mDoDvdThd = .sbss:0x8044ADC0; // type:object size:0x1 data:byte sDefaultDirection = .sbss:0x8044ADC1; // type:object size:0x7 data:byte mDoDvdErr_initialized = .sbss:0x8044ADC8; // type:object size:0x1 data:byte sConsole = .sbss:0x8044ADD0; // type:object size:0x4 scope:global align:4 data:4byte diff --git a/config/GZ2P01/splits.txt b/config/GZ2P01/splits.txt index 40894b09563..78ffa110f62 100644 --- a/config/GZ2P01/splits.txt +++ b/config/GZ2P01/splits.txt @@ -87,7 +87,7 @@ m_Do/m_Do_lib.cpp: m_Do/m_Do_Reset.cpp: .text start:0x8001558C end:0x800157B0 .rodata start:0x80374FD8 end:0x80374FE8 - .sbss start:0x80452C38 end:0x80452C50 + .sbss start:0x80452C38 end:0x80452C40 m_Do/m_Do_dvd_thread.cpp: .text start:0x800157B0 end:0x80016550 @@ -95,10 +95,12 @@ m_Do/m_Do_dvd_thread.cpp: .rodata start:0x80374FE8 end:0x80375238 .data start:0x803A5188 end:0x803A51D8 .bss start:0x803DF8E0 end:0x803E0C60 + .sbss start:0x80452C40 end:0x80452C48 m_Do/m_Do_DVDError.cpp: .text start:0x80016550 end:0x800166E0 .bss start:0x803E0C60 end:0x803E1BC0 + .sbss start:0x80452C48 end:0x80452C50 m_Do/m_Do_MemCard.cpp: .text start:0x800166E0 end:0x8001744C diff --git a/config/GZ2P01/symbols.txt b/config/GZ2P01/symbols.txt index b693df47006..cae796fa89c 100644 --- a/config/GZ2P01/symbols.txt +++ b/config/GZ2P01/symbols.txt @@ -21731,7 +21731,7 @@ aram_cache_size = .sbss:0x80452C28; // type:object size:0x4 scope:global align:4 mSystemFar__14mDoLib_clipper = .sbss:0x80452C30; // type:object size:0x4 scope:global align:4 data:float mFovyRate__14mDoLib_clipper = .sbss:0x80452C34; // type:object size:0x4 scope:global align:4 data:float mResetData__6mDoRst = .sbss:0x80452C38; // type:object size:0x4 scope:global align:4 data:4byte -SyncWidthSound = .sbss:0x80452C40; // type:object size:0x1 data:byte +SyncWidthSound__9mDoDvdThd = .sbss:0x80452C40; // type:object size:0x1 data:byte sDefaultDirection = .sbss:0x80452C41; // type:object size:0x7 data:byte mDoDvdErr_initialized = .sbss:0x80452C48; // type:object size:0x1 data:byte sConsole = .sbss:0x80452C50; // type:object size:0x4 scope:global align:4 data:4byte diff --git a/configure.py b/configure.py index beab213e69b..a09c61cd60e 100755 --- a/configure.py +++ b/configure.py @@ -264,6 +264,22 @@ elif config.version == "RZDE01_00" or config.version == "RZDE01_02" or config.ve else: cflags_base.extend(["-O4,p", "-inline auto", "-RTTI off", "-str reuse", "-multibyte"]) +USE_REVOLUTION_SDK_VERSIONS = [ + "RZDE01_00", # Wii USA Rev 0 + "RZDE01_02", # Wii USA Rev 2 + "RZDP01", # Wii PAL + "RZDJ01", # Wii JPN + "RZDK01", # Wii KOR + "DZDE01", # Wii USA Kiosk Demo + "DZDP01", # Wii PAL Kiosk Demo + "Shield", # Shield + "ShieldP", # Shield Production + "ShieldD", # Shield Debug +] + +if config.version in USE_REVOLUTION_SDK_VERSIONS: + cflags_base.extend(["-D__REVOLUTION_SDK__"]) + # Debug flags if args.debug: # Or -sym dwarf-2 for Wii compilers diff --git a/include/DynamicLink.h b/include/DynamicLink.h index db282a3ee9c..21ea5b722f5 100644 --- a/include/DynamicLink.h +++ b/include/DynamicLink.h @@ -1,7 +1,9 @@ #ifndef DYNAMICLINK_H #define DYNAMICLINK_H -#include "dolphin/os.h" +#include +#include "JSystem/JKernel/JKRHeap.h" +#include "global.h" class JKRArchive; class JKRFileCache; @@ -23,6 +25,8 @@ struct DynamicModuleControlBase { virtual void dump(); #endif /* 80262470 */ static void dump(); + static void dump(char*); + /* 802631FC */ virtual void dump2() {}; /* 802631DC */ virtual bool do_load() {return true;}; /* 802631F4 */ virtual BOOL do_load_async() {return true;}; @@ -39,8 +43,23 @@ struct DynamicModuleControlBase { inline DynamicModuleControlBase* getNextClass() { return mNext; } bool isLinked() const { return mLinkCount != 0; } + #if DEBUG + static void resetDoLinkCount() {} // TODO + static void dumpTag() {} // TODO + #endif + static DynamicModuleControlBase* mFirst; static DynamicModuleControlBase* mLast; + + #if DEBUG + static u8 verbose; + #endif + + #if PLATFORM_WII || PLATFORM_SHIELD + static JKRHeap* getHeap() { return m_heap; } + + static JKRHeap* m_heap; + #endif }; struct DynamicModuleControl : DynamicModuleControlBase { diff --git a/include/JSystem/J3DGraphBase/J3DSys.h b/include/JSystem/J3DGraphBase/J3DSys.h index 141ec0296ea..b819dd07936 100644 --- a/include/JSystem/J3DGraphBase/J3DSys.h +++ b/include/JSystem/J3DGraphBase/J3DSys.h @@ -162,7 +162,7 @@ struct J3DSys { Mtx& getModelDrawMtx(u16 no) { return mModelDrawMtx[no]; } J3DShapePacket* getShapePacket() { return mShapePacket; } - void setViewMtx(Mtx m) { MTXCopy(m, mViewMtx); } + void setViewMtx(const Mtx m) { MTXCopy(m, mViewMtx); } J3DModel* getModel() { return mModel; } diff --git a/include/JSystem/J3DGraphLoader/J3DModelSaver.h b/include/JSystem/J3DGraphLoader/J3DModelSaver.h new file mode 100644 index 00000000000..239a43fc522 --- /dev/null +++ b/include/JSystem/J3DGraphLoader/J3DModelSaver.h @@ -0,0 +1,14 @@ +#ifndef J3DMODELSAVER_H +#define J3DMODELSAVER_H + +#include "JSystem/J3DGraphAnimator/J3DModel.h" + +enum J3DBinaryDisplayListSaverFlag { + J3DBinaryDisplayListSaverFlag_UNK_1 = 1, +}; + +namespace J3DModelSaverDataBase { + void* saveBinaryDisplayList(const J3DModel*, J3DBinaryDisplayListSaverFlag, u32); +}; + +#endif diff --git a/include/JSystem/JFramework/JFWDisplay.h b/include/JSystem/JFramework/JFWDisplay.h index cb43d8e07e3..79a115046c1 100644 --- a/include/JSystem/JFramework/JFWDisplay.h +++ b/include/JSystem/JFramework/JFWDisplay.h @@ -101,6 +101,9 @@ public: void resetFader() { setFader(NULL); } JUTFader* getFader() const { return mFader; } void setClearColor(JUtility::TColor color) { mClearColor = color; } + int getEfbWidth() const { return JUTVideo::getManager()->getFbWidth(); } + int getEfbHeight() const { return JUTVideo::getManager()->getEfbHeight(); } + JUTXfb* getXfbManager() const { return mXfbManager; } static JFWDisplay* sManager; diff --git a/include/JSystem/JHostIO/JORServer.h b/include/JSystem/JHostIO/JORServer.h index 99fdf51f9d8..acec1227bb7 100644 --- a/include/JSystem/JHostIO/JORServer.h +++ b/include/JSystem/JHostIO/JORServer.h @@ -7,6 +7,9 @@ #include "JSystem/JUtility/JUTAssert.h" void JOR_MESSAGELOOP(); +void JOR_INIT(); +void JOR_SETROOTNODE(const char*, JORReflexible*, u32, u32); + u32 JORMessageBox(const char* message, const char* title, u32 style); struct JOREventCallbackListNode { diff --git a/include/JSystem/JKernel/JKRAram.h b/include/JSystem/JKernel/JKRAram.h index ef935112ee3..2d992749ce0 100644 --- a/include/JSystem/JKernel/JKRAram.h +++ b/include/JSystem/JKernel/JKRAram.h @@ -89,6 +89,18 @@ inline JKRAramBlock *JKRMainRamToAram(u8 *buf, u32 bufSize, u32 alignedSize, JKR return JKRAram::mainRamToAram(buf, bufSize, alignedSize, expandSwitch, fileSize, heap, id, pSize); } +inline u32 JKRGetAramTotalFreeSize() { + return JKRAram::getAramHeap()->getTotalFreeSize(); +} + +inline u32 JKRGetAramFreeSize() { + return JKRAram::getAramHeap()->getFreeSize(); +} + +inline u32 JKRGetAramUsedSize(u8 param_0) { + return JKRAram::getAramHeap()->getUsedSize(param_0); +} + // void JKRDecompressFromAramToMainRam(u32, void*, u32, u32, u32, u32*); #endif /* JKRARAM_H */ diff --git a/include/JSystem/JKernel/JKRAramArchive.h b/include/JSystem/JKernel/JKRAramArchive.h index 2ea5f2863b9..131dccbaa8b 100644 --- a/include/JSystem/JKernel/JKRAramArchive.h +++ b/include/JSystem/JKernel/JKRAramArchive.h @@ -27,7 +27,6 @@ public: static u32 fetchResource_subroutine(u32, u32, u8*, u32, int); static u32 fetchResource_subroutine(u32, u32, JKRHeap*, int, u8**); -private: /* 0x00 */ // vtable /* 0x04 */ // JKRArchive /* 0x64 */ JKRAramBlock* mBlock; diff --git a/include/JSystem/JKernel/JKRAramHeap.h b/include/JSystem/JKernel/JKRAramHeap.h index 14f786a21ff..3dd0bbd741e 100644 --- a/include/JSystem/JKernel/JKRAramHeap.h +++ b/include/JSystem/JKernel/JKRAramHeap.h @@ -26,10 +26,10 @@ public: JKRAramBlock* alloc(u32, EAllocMode); JKRAramBlock* allocFromHead(u32); JKRAramBlock* allocFromTail(u32); - u32 getFreeSize(void); - u32 getTotalFreeSize(void); - // u32 getUsedSize(void); - void dump(void); + u32 getFreeSize(); + u32 getTotalFreeSize(); + u32 getUsedSize(u8); + void dump(); void free(JKRAramBlock *block) { delete block; } diff --git a/include/JSystem/JUtility/JUTProcBar.h b/include/JSystem/JUtility/JUTProcBar.h index 42111ee765c..f5099956d40 100644 --- a/include/JSystem/JUtility/JUTProcBar.h +++ b/include/JSystem/JUtility/JUTProcBar.h @@ -96,6 +96,7 @@ public: void setCostFrame(int frame) { mCostFrame = frame; } void setVisible(bool visible) { mVisible = visible; } void setVisibleHeapBar(bool visible) { mHeapBarVisible = visible; } + void setWatchHeap(JKRHeap* pHeap) { mWatchHeap = pHeap; } static JUTProcBar* getManager() { return sManager; } diff --git a/include/c/c_dylink.h b/include/c/c_dylink.h index e77ca3c2e16..8d213efd4af 100644 --- a/include/c/c_dylink.h +++ b/include/c/c_dylink.h @@ -23,4 +23,6 @@ BOOL cDyl_IsLinked(s16 i_ProfName); BOOL cDyl_Unlink(s16 i_ProfName); int cDyl_LinkASync(s16 i_ProfName); +BOOL cCc_Check(); + #endif /* C_C_DYLINK_H */ diff --git a/include/d/actor/d_a_alink.h b/include/d/actor/d_a_alink.h index 3c6ce1aef56..28c160a6bd5 100644 --- a/include/d/actor/d_a_alink.h +++ b/include/d/actor/d_a_alink.h @@ -3750,9 +3750,9 @@ public: s16 getHookshotStopTime() const { return field_0x3026; } bool getHookshotLeft() const { return field_0x3020 == 0; } - static int getBallModelIdx() { return 0x25; } - static int getBallBtkIdx() { return 0x49; } - static int getBallBrkIdx() { return 0x41; } + static u16 getBallModelIdx() { return 0x25; } + static u16 getBallBtkIdx() { return 0x49; } + static u16 getBallBrkIdx() { return 0x41; } bool checkRootTransClearMode() { return field_0x2f99 & 7; } bool checkRootTransZClearMode() { return field_0x2f99 & 4; } @@ -3828,6 +3828,8 @@ public: u16 getReadyItem() { return dComIfGp_getSelectItem(mSelectItemId); } + static u32 getOtherHeapSize() { return 0xF0A60; } + static daAlink_BckData const m_mainBckShield[20]; static daAlink_BckData const m_mainBckSword[5]; static daAlink_BckData const m_mainBckFishing[28]; diff --git a/include/d/actor/d_a_guard_mng.h b/include/d/actor/d_a_guard_mng.h index 4d7e2e6c526..8b2262d3947 100644 --- a/include/d/actor/d_a_guard_mng.h +++ b/include/d/actor/d_a_guard_mng.h @@ -56,7 +56,7 @@ public: } int create() { - fopAcM_SetupActor(this, daGuardMng_c); + fopAcM_ct(this, daGuardMng_c); create_init(); return cPhs_COMPLEATE_e; } diff --git a/include/d/actor/d_a_midna.h b/include/d/actor/d_a_midna.h index efadec9dc7f..d5a885f6291 100644 --- a/include/d/actor/d_a_midna.h +++ b/include/d/actor/d_a_midna.h @@ -391,6 +391,8 @@ public: onStateFlg0(daMidna_FLG0(FLG0_PORTAL_OBJ_CALL | FLG0_TAG_WAIT)); } + static u32 getOtherHeapSize() { return 0x1D0; } + static daMidna_texData_s const m_texDataTable[21]; static daMidna_anmData_s const m_anmDataTable[53]; diff --git a/include/d/actor/d_a_tag_arena.h b/include/d/actor/d_a_tag_arena.h index 829a4cbd5f0..bb2d1581852 100644 --- a/include/d/actor/d_a_tag_arena.h +++ b/include/d/actor/d_a_tag_arena.h @@ -6,7 +6,7 @@ class daTagArena_c : public fopAc_ac_c { public: int create() { - fopAcM_SetupActor(this, daTagArena_c); + fopAcM_ct(this, daTagArena_c); return cPhs_COMPLEATE_e; } diff --git a/include/d/actor/d_a_tag_assistance.h b/include/d/actor/d_a_tag_assistance.h index 6b93b9e5c36..73f71e297f2 100644 --- a/include/d/actor/d_a_tag_assistance.h +++ b/include/d/actor/d_a_tag_assistance.h @@ -11,7 +11,7 @@ public: } int create() { - fopAcM_SetupActor(this, daTagAssist_c); + fopAcM_ct(this, daTagAssist_c); create_init(); return cPhs_COMPLEATE_e; } diff --git a/include/d/actor/d_a_tag_chkpoint.h b/include/d/actor/d_a_tag_chkpoint.h index 887ff97f9c0..c13c63c75e5 100644 --- a/include/d/actor/d_a_tag_chkpoint.h +++ b/include/d/actor/d_a_tag_chkpoint.h @@ -14,7 +14,7 @@ public: u8 getSwBit2() { return fopAcM_GetParam(this) >> 16; } int create() { - fopAcM_SetupActor(this, daTag_Chk_c); + fopAcM_ct(this, daTag_Chk_c); if (getAreaType() == 0) { scale.x *= 50.0f; diff --git a/include/d/actor/d_a_tag_gra.h b/include/d/actor/d_a_tag_gra.h index 7586d399182..9d2eaef1bde 100644 --- a/include/d/actor/d_a_tag_gra.h +++ b/include/d/actor/d_a_tag_gra.h @@ -30,7 +30,7 @@ public: } int create() { - fopAcM_SetupActor(this, daTagGra_c); + fopAcM_ct(this, daTagGra_c); if (getMode() == 2) { if (dComIfGs_isSwitch(getSwBit(),fopAcM_GetRoomNo(this))) { diff --git a/include/d/actor/d_a_tag_schedule.h b/include/d/actor/d_a_tag_schedule.h index 7acd08601fd..67fd4841677 100644 --- a/include/d/actor/d_a_tag_schedule.h +++ b/include/d/actor/d_a_tag_schedule.h @@ -6,7 +6,7 @@ class daTagSchedule_c : public fopAc_ac_c { public: int create() { - fopAcM_SetupActor(this, daTagSchedule_c); + fopAcM_ct(this, daTagSchedule_c); return cPhs_COMPLEATE_e; } diff --git a/include/d/actor/d_a_tag_theB_hint.h b/include/d/actor/d_a_tag_theB_hint.h index 5eabf046c6d..25d708f1a0b 100644 --- a/include/d/actor/d_a_tag_theB_hint.h +++ b/include/d/actor/d_a_tag_theB_hint.h @@ -68,7 +68,7 @@ public: } int create() { - fopAcM_SetupActor(this, daTagTheBHint_c); + fopAcM_ct(this, daTagTheBHint_c); field_0x568 = pow(scale.x * 100.0f,2.0f); return cPhs_COMPLEATE_e; } diff --git a/include/d/d_attention.h b/include/d/d_attention.h index 879f88aeba5..865bd1baf16 100644 --- a/include/d/d_attention.h +++ b/include/d/d_attention.h @@ -249,6 +249,7 @@ public: void runDebugDisp0(); #endif + JKRSolidHeap* getHeap() { return heap; } fopAc_ac_c* getCatghTarget() { return mCatghTarget.getCatghTarget(); } fopAc_ac_c* getZHintTarget() { return mZHintTarget.getZHintTarget(); } u8 getCatchChgItem() { return mCatghTarget.getChangeItem(); } diff --git a/include/d/d_bg_s.h b/include/d/d_bg_s.h index c6727486a50..9a2213c4cd4 100644 --- a/include/d/d_bg_s.h +++ b/include/d/d_bg_s.h @@ -141,6 +141,8 @@ public: fopAc_ac_c* GetActorPointer(cBgS_PolyInfo const& param_0) const { return cBgS::GetActorPointer(param_0); } f32 GroundCross(cBgS_GndChk* i_gndChk) { return (f32)((cBgS*)this)->GroundCross(i_gndChk); } + void ChkDeleteActorRegist(fopAc_ac_c*); + #ifdef DEBUG /* 0x1404 */ u8 field_0x1404[0x1408 - 0x1404]; /* 0x1408 */ dBgS_HIO m_hio; diff --git a/include/d/d_cc_s.h b/include/d/d_cc_s.h index af4428d1d41..8ca908dd5ec 100644 --- a/include/d/d_cc_s.h +++ b/include/d/d_cc_s.h @@ -59,6 +59,8 @@ public: mMass_Mng.SetAttr(radius, height, param_2, param_3); } + void ChkActor(fopAc_ac_c*); + static bool m_mtrl_hit_tbl[64]; // /* 0x0000 */ cCcS mCCcS; diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index 34a08bc3439..910a2979750 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.h @@ -295,6 +295,7 @@ public: dEvent_manager_c& getEvtManager() { return mEvtManager; } dAttention_c* getAttention() { return &mAttention; } dStage_startStage_c* getStartStage() { return &mStartStage; } + dSmplMdl_draw_c* getSimpleModel() { return mSimpleModel; } void setCurrentGrafPort(J2DOrthoGraph* i_graf) { mCurrentGrafPort = i_graf; } void setCurrentWindow(dDlst_window_c* i_window) { mCurrentWindow = i_window; } @@ -589,6 +590,7 @@ public: void setExpHeap2D(void* heap) { mItemInfo.mExpHeap2D = (JKRExpHeap*)heap; } void setMsgExpHeap(void* heap) { mItemInfo.mMsgExpHeap = (JKRExpHeap*)heap; } + JKRArchive* getMsgDtArchive() { return mMsgDtArchive[0]; } JKRArchive* getMsgDtArchive(int idx) { return mMsgDtArchive[idx]; } JKRArchive* getMsgArchive(int idx) { return mMsgArchive[idx]; } JKRArchive* getMsgCommonArchive() { return mMsgCommonArchive; } @@ -864,6 +866,10 @@ extern GXColor g_clearColor; extern GXColor g_whiteColor; extern GXColor g_saftyWhiteColor; +inline void dComIfG_ct() { + g_dComIfG_gameInfo.ct(); +} + int dComLbG_PhaseHandler(request_of_phase_process_class*, request_of_phase_process_fn*, void*); BOOL dComIfG_resetToOpening(scene_class* scene); char* dComIfG_getRoomArcName(int roomNo); @@ -979,6 +985,10 @@ inline void* dComIfG_getObjectRes(const char* i_arcName, int i_index) { return g_dComIfG_gameInfo.mResControl.getObjectRes(i_arcName, i_index); } +inline void dComIfG_dumpResControl() { + g_dComIfG_gameInfo.mResControl.dump(); +} + inline dBgS& dComIfG_Bgsp() { return g_dComIfG_gameInfo.play.mBgs; } @@ -1816,6 +1826,10 @@ inline void dComIfGs_removeZone(int i_zoneNo) { g_dComIfG_gameInfo.info.removeZone(i_zoneNo); } +inline dSmplMdl_draw_c* dComIfGp_getSimpleModel() { + return g_dComIfG_gameInfo.play.getSimpleModel(); +} + inline int dComIfGp_addSimpleModel(J3DModelData* i_modelData, int roomNo, u8 i_drawBG) { return g_dComIfG_gameInfo.play.addSimpleModel(i_modelData, roomNo, i_drawBG); } @@ -2314,6 +2328,10 @@ inline JKRArchive* dComIfGp_getDemoMsgArchive() { return g_dComIfG_gameInfo.play.getDemoMsgArchive(); } +inline JKRArchive* dComIfGp_getMsgDtArchive() { + return g_dComIfG_gameInfo.play.getMsgDtArchive(); +} + inline JKRArchive* dComIfGp_getMsgDtArchive(int idx) { return g_dComIfG_gameInfo.play.getMsgDtArchive(idx); } diff --git a/include/d/d_demo.h b/include/d/d_demo.h index ce72547a31f..513ffbb2bf2 100644 --- a/include/d/d_demo.h +++ b/include/d/d_demo.h @@ -361,7 +361,11 @@ public: /* 80039EEC */ static void setBranchId(u16, s16); /* 80039F04 */ static void reset(); - static dDemo_actor_c* getActor(u8 param_0) { return m_object->getActor(param_0); } + static dDemo_actor_c* getActor(u8 param_0) { + JUT_ASSERT(546, m_object != NULL); + return m_object->getActor(param_0); + } + static u32 getFrameNoMsg() { return m_frameNoMsg; } static s32 getMode() { return m_mode; } static u32 getFrame() { return m_frame; } diff --git a/include/d/d_particle.h b/include/d/d_particle.h index c1c01f91ff1..956466a758e 100644 --- a/include/d/d_particle.h +++ b/include/d/d_particle.h @@ -403,6 +403,8 @@ public: void draw2DmenuFore(JPADrawInfo* i_drawInfo) { draw(i_drawInfo, 17); } void draw2DmenuBack(JPADrawInfo* i_drawInfo) { draw(i_drawInfo, 18); } + JKRSolidHeap* getHeap() { return mHeap; } + JKRSolidHeap* getSceneHeap() { return m_sceneHeap; } JKRExpHeap* getResHeap() { return m_resHeap; } void levelAllForceOnEventMove() { field_0x210.allForceOnEventMove(); } diff --git a/include/d/d_resorce.h b/include/d/d_resorce.h index 9da681c3f0b..3d00f861e63 100644 --- a/include/d/d_resorce.h +++ b/include/d/d_resorce.h @@ -67,6 +67,7 @@ public: int setObjectRes(char const* i_arcName, void* i_archiveRes, u32 i_bufferSize, JKRHeap* i_heap); int setStageRes(char const* i_arcName, JKRHeap* i_heap); void dump(); + void dump(char*); int getObjectResName2Index(char const* i_arcName, char const* i_resName); static int setRes(char const* i_arcName, dRes_info_c* i_resInfo, int i_infoNum, char const* i_path, u8 i_mountDirection, JKRHeap* i_heap); @@ -126,6 +127,12 @@ public: dRes_info_c* getStageResInfo(const char* i_arcName) { return getResInfo(i_arcName, mStageInfo, ARRAY_SIZEU(mStageInfo)); } + + #if DEBUG + void dumpTag() { + // TODO + } + #endif /* 0x0000 */ dRes_info_c mObjectInfo[128]; /* 0x1200 */ dRes_info_c mStageInfo[64]; diff --git a/include/d/d_s_play.h b/include/d/d_s_play.h index 190402d1e62..e6a96442986 100644 --- a/include/d/d_s_play.h +++ b/include/d/d_s_play.h @@ -15,13 +15,17 @@ public: /* 0x7C */ s16 mShortReg[10]; }; -class dScnPly_reg_HIO_c { +class dScnPly_reg_HIO_c : public JORReflexible { public: /* 8025AD78 */ virtual ~dScnPly_reg_HIO_c() {} - /* 0x4 */ u8 field_0x4[0x8 - 0x4]; #ifdef DEBUG + void genMessage(JORMContext*); + + /* 0x4 */ s8 id; /* 0x8 */ dScnPly_reg_childHIO_c mChildReg[26]; +#else + /* 0x4 */ u8 field_0x4[0x8 - 0x4]; #endif }; @@ -50,7 +54,7 @@ public: virtual void genMessage(JORMContext*); virtual ~dScnPly_preset_HIO_c() {} - /* 0x0004 */ u8 field_0x4; + /* 0x0004 */ s8 field_0x4; /* 0x0005 */ u8 field_0x5; /* 0x0006 */ u8 mPresetData[10000]; /* 0x2716 */ u8 field_0x2716; diff --git a/include/d/d_s_play_env.h b/include/d/d_s_play_env.h index b8b0172e202..f67306fd082 100644 --- a/include/d/d_s_play_env.h +++ b/include/d/d_s_play_env.h @@ -8,14 +8,37 @@ public: /* 8025AC0C */ virtual ~dScnPly_env_otherHIO_c() {} void genMessage(JORMContext*); - /* 0x04 */ f32 mShadowDensity; - /* 0x08 */ u8 mLODBias; - /* 0x09 */ u8 field_0x9; - /* 0x0A */ u8 mDispTransCylinder; #ifdef DEBUG - /* 0x0B */ u8 field_0xb[0x46 - 0xb]; - /* 0x46 */ u8 field_0x46; - /* 0x47 */ u8 field_0x47[0x4f - 0x47]; + /* 0x04 */ s8 field_0x04; + #endif + + /* 0x08 */ f32 mShadowDensity; + + #ifdef DEBUG + /* 0x0C */ f32 mCullFarValue; + /* 0x10 */ f32 mRailSize; + /* 0x14 */ s16 mRailColorR; + /* 0x16 */ s16 mRailColorG; + /* 0x18 */ s16 mRailColorB; + /* 0x1A */ s16 field_0x1a; + /* 0x1C */ s16 field_0x1c[20]; + #endif + + /* 0x44 */ u8 mAdjustLODBias; + /* 0x45 */ u8 field_0x45; + /* 0x46 */ u8 mDisplayTransparentCyl; + + #ifdef DEBUG + /* 0x47 */ u8 mDisplayShadows; + /* 0x48 */ u8 mDisplayShadowImage; + /* 0x49 */ u8 mDisplayShadowPoly; + /* 0x4A */ u8 mDisplayCullBox; + /* 0x4B */ u8 mLoadAllRooms; + /* 0x4C */ u8 mDepthOfField; + /* 0x4D */ u8 mDisplayParticleInfo; + /* 0x4E */ u8 field_0x4e; + /* 0x4F */ u8 field_0x4f; + /* 0x50 */ u8 mAdjustCullFar; #endif }; diff --git a/include/d/d_stage.h b/include/d/d_stage.h index d027dc99415..9976a4b801d 100644 --- a/include/d/d_stage.h +++ b/include/d/d_stage.h @@ -1153,6 +1153,8 @@ public: return cLib_onBit(mStatus[i_roomNo].mFlag, flag); } + static JKRExpHeap* getMemoryBlockHeap(int i_no) { return mMemoryBlock[i_no]; } + static const int MEMORY_BLOCK_MAX = 19; static JKRExpHeap* mMemoryBlock[MEMORY_BLOCK_MAX]; @@ -1426,7 +1428,7 @@ inline u32 dStage_FileList_dt_GetEnemyAppear1Flag(dStage_FileList_dt_c* p_fList) return p_fList->mParameters & 0x20000000; } -inline int dStage_FileList_dt_GetBitSw(dStage_FileList_dt_c* p_fList) { +inline u8 dStage_FileList_dt_GetBitSw(dStage_FileList_dt_c* p_fList) { return p_fList->mBitSw; } diff --git a/include/d/d_tresure.h b/include/d/d_tresure.h index f6649180e22..54c776227c1 100644 --- a/include/d/d_tresure.h +++ b/include/d/d_tresure.h @@ -94,6 +94,10 @@ public: offStatus(0, param_0, i_flag); } + static typeGroupData_c* getTypeGroupData() { + return mTypeGroupData; + } + static u8 const typeToTypeGroup[17][2]; static type_group_list mTypeGroupListAll[17]; static typeGroupData_c* mTypeGroupData; diff --git a/include/dolphin/ai.h b/include/dolphin/ai.h index 84db3343b08..a42a59da2f1 100644 --- a/include/dolphin/ai.h +++ b/include/dolphin/ai.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_AI_H_ #define _DOLPHIN_AI_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -48,3 +51,4 @@ void AIReset(void); #endif #endif +#endif diff --git a/include/dolphin/ax.h b/include/dolphin/ax.h index 0148446ee81..c43a3cb6390 100644 --- a/include/dolphin/ax.h +++ b/include/dolphin/ax.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_AX_H_ #define _DOLPHIN_AX_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -322,4 +325,5 @@ extern u16 axDspSlave[AX_DSP_SLAVE_LENGTH]; } #endif +#endif #endif // _DOLPHIN_AX_H_ diff --git a/include/dolphin/axart.h b/include/dolphin/axart.h index 46c375f71ce..1f12409f8f0 100644 --- a/include/dolphin/axart.h +++ b/include/dolphin/axart.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_AXART_H_ #define _DOLPHIN_AXART_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include @@ -221,4 +224,5 @@ void AXARTLpf(AXART_LPF*, AXVPB*); } #endif +#endif #endif // _DOLPHIN_AXART_H_ diff --git a/include/dolphin/axfx.h b/include/dolphin/axfx.h index 53933c858f4..93b34d33b6f 100644 --- a/include/dolphin/axfx.h +++ b/include/dolphin/axfx.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_AXFX_H_ #define _DOLPHIN_AXFX_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -193,4 +196,5 @@ void AXFXReverbStdCallback(AXFX_BUFFERUPDATE* bufferUpdate, AXFX_REVERBSTD* reve } #endif +#endif #endif // _DOLPHIN_AXFX_H_ diff --git a/include/dolphin/base/PPCArch.h b/include/dolphin/base/PPCArch.h index 35f5da9c710..fa67b8a0217 100644 --- a/include/dolphin/base/PPCArch.h +++ b/include/dolphin/base/PPCArch.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_PPCARCH #define _DOLPHIN_PPCARCH +#ifdef __REVOLUTION_SDK__ +#include +#else #include "dolphin/types.h" #ifdef __cplusplus @@ -539,4 +542,5 @@ void PMInstructions(void); } #endif +#endif #endif // _DOLPHIN_PPCARCH diff --git a/include/dolphin/db.h b/include/dolphin/db.h index c62f188e404..0a35c061988 100644 --- a/include/dolphin/db.h +++ b/include/dolphin/db.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_DB_H_ #define _DOLPHIN_DB_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include @@ -19,4 +22,5 @@ u32 DBRead(u8*, u32); } #endif +#endif #endif // _DOLPHIN_DB_H_ diff --git a/include/dolphin/db/DBInterface.h b/include/dolphin/db/DBInterface.h index 7bfa3542724..58a90f1e5de 100644 --- a/include/dolphin/db/DBInterface.h +++ b/include/dolphin/db/DBInterface.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_DBINTERFACE_H_ #define _DOLPHIN_DBINTERFACE_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -29,3 +32,4 @@ void __DBSetPresent(u32 value); #endif #endif +#endif diff --git a/include/dolphin/dolphin.h b/include/dolphin/dolphin.h index ac1ebcf7b0d..a81740a6cf0 100644 --- a/include/dolphin/dolphin.h +++ b/include/dolphin/dolphin.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_H_ #define _DOLPHIN_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include #include @@ -22,3 +25,4 @@ #include #endif +#endif diff --git a/include/dolphin/dsp.h b/include/dolphin/dsp.h index e3a20b90889..a9790c37d90 100644 --- a/include/dolphin/dsp.h +++ b/include/dolphin/dsp.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_DSP_H_ #define _DOLPHIN_DSP_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -55,3 +58,4 @@ DSPTaskInfo* __DSPGetCurrentTask(void); #endif #endif +#endif diff --git a/include/dolphin/dvd.h b/include/dolphin/dvd.h index ae036cad3fc..382e82c318f 100644 --- a/include/dolphin/dvd.h +++ b/include/dolphin/dvd.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_DVD_H_ #define _DOLPHIN_DVD_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -234,3 +237,4 @@ void DVDDumpWaitingQueue(void); #endif #endif +#endif diff --git a/include/dolphin/exi.h b/include/dolphin/exi.h index f094c361308..17cfc7d563a 100644 --- a/include/dolphin/exi.h +++ b/include/dolphin/exi.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_EXI_H_ #define _DOLPHIN_EXI_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -101,3 +104,4 @@ char* EXIGetTypeString(u32 type); #endif #endif +#endif diff --git a/include/dolphin/gd.h b/include/dolphin/gd.h index 57c929dad62..2a39517353c 100644 --- a/include/dolphin/gd.h +++ b/include/dolphin/gd.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GD_H_ #define _DOLPHIN_GD_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include #include @@ -12,3 +15,4 @@ #include #endif +#endif diff --git a/include/dolphin/gd/GDBase.h b/include/dolphin/gd/GDBase.h index 3e148c32282..264f25bc4d8 100644 --- a/include/dolphin/gd/GDBase.h +++ b/include/dolphin/gd/GDBase.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GD_BASE_H #define _DOLPHIN_GD_BASE_H +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include #include @@ -149,3 +152,4 @@ static inline u32 GDGetGDLObjOffset(const GDLObj* dl) { #endif #endif +#endif diff --git a/include/dolphin/gd/GDFile.h b/include/dolphin/gd/GDFile.h index 3589fbb7ee9..8ccd30a19b3 100644 --- a/include/dolphin/gd/GDFile.h +++ b/include/dolphin/gd/GDFile.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GD_FILE_H #define _DOLPHIN_GD_FILE_H +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -29,3 +32,4 @@ s32 GDReadDLFile(const char* fName, u32* numDLs, u32* numPLs, GDGList** DLDescAr #endif #endif +#endif diff --git a/include/dolphin/gd/GDGeometry.h b/include/dolphin/gd/GDGeometry.h index 3b0424fbd4b..77bb3137253 100644 --- a/include/dolphin/gd/GDGeometry.h +++ b/include/dolphin/gd/GDGeometry.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GD_GEOMETRY_H_ #define _DOLPHIN_GD_GEOMETRY_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -522,3 +525,4 @@ void GDSetCoPlanar(u8 enable); #endif #endif +#endif diff --git a/include/dolphin/gd/GDIndirect.h b/include/dolphin/gd/GDIndirect.h index 4ca854c31b3..80064d577cc 100644 --- a/include/dolphin/gd/GDIndirect.h +++ b/include/dolphin/gd/GDIndirect.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GD_INDIRECT_H_ #define _DOLPHIN_GD_INDIRECT_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include #include @@ -89,3 +92,4 @@ void __GDSetIndTexMask(u32 mask); #endif #endif +#endif diff --git a/include/dolphin/gd/GDLight.h b/include/dolphin/gd/GDLight.h index 549b07a26eb..a725830fe45 100644 --- a/include/dolphin/gd/GDLight.h +++ b/include/dolphin/gd/GDLight.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GD_LIGHT_H_ #define _DOLPHIN_GD_LIGHT_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include #include "global.h" @@ -72,3 +75,4 @@ inline static u16 __GDLightID2Offset(GXLightID id) { #endif #endif +#endif diff --git a/include/dolphin/gd/GDPixel.h b/include/dolphin/gd/GDPixel.h index 158b04ec1f6..8d9611f22f9 100644 --- a/include/dolphin/gd/GDPixel.h +++ b/include/dolphin/gd/GDPixel.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GD_PIXEL_H #define _DOLPHIN_GD_PIXEL_H +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include @@ -93,3 +96,4 @@ void GDSetDrawSync(u16 token); #endif #endif +#endif diff --git a/include/dolphin/gd/GDTev.h b/include/dolphin/gd/GDTev.h index baec8b5e2ec..f81cba54edb 100644 --- a/include/dolphin/gd/GDTev.h +++ b/include/dolphin/gd/GDTev.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GD_TEV_H #define _DOLPHIN_GD_TEV_H +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include @@ -131,3 +134,4 @@ void GDSetTevOrder(GXTevStageID evenStage, GXTexCoordID coord0, GXTexMapID map0, #endif #endif +#endif diff --git a/include/dolphin/gd/GDTexture.h b/include/dolphin/gd/GDTexture.h index 2370cbb52ba..d041de665b5 100644 --- a/include/dolphin/gd/GDTexture.h +++ b/include/dolphin/gd/GDTexture.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GD_TEXTURE_H #define _DOLPHIN_GD_TEXTURE_H +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include @@ -125,3 +128,4 @@ void GDLoadTlutRaw(u32 tlut_ptr_raw, u32 tmem_addr, GXTlutSize size); #endif #endif +#endif diff --git a/include/dolphin/gd/GDTransform.h b/include/dolphin/gd/GDTransform.h index 8d0159fdb0a..e3699519f9b 100644 --- a/include/dolphin/gd/GDTransform.h +++ b/include/dolphin/gd/GDTransform.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GD_TRANSFORM_H_ #define _DOLPHIN_GD_TRANSFORM_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include #include @@ -54,3 +57,4 @@ void GDSetProjection(const Mtx44 mtx, GXProjectionType type); #endif #endif +#endif diff --git a/include/dolphin/gf.h b/include/dolphin/gf.h index 50676aeab80..31a7fd59103 100644 --- a/include/dolphin/gf.h +++ b/include/dolphin/gf.h @@ -1,9 +1,13 @@ #ifndef _DOLPHIN_GF_H_ #define _DOLPHIN_GF_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include #include #include #endif +#endif diff --git a/include/dolphin/gf/GFGeometry.h b/include/dolphin/gf/GFGeometry.h index 759d18c3552..4d6c885807a 100644 --- a/include/dolphin/gf/GFGeometry.h +++ b/include/dolphin/gf/GFGeometry.h @@ -1,6 +1,9 @@ -#ifndef GFGEOMETRY_H -#define GFGEOMETRY_H +#ifndef _DOLPHIN_GF_GFGEOMETRY_H_ +#define _DOLPHIN_GF_GFGEOMETRY_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #define GF_GEN_MODE(nTexGens, nChans, nTevs, cm, nInds) \ @@ -38,4 +41,5 @@ static inline void GFWriteXFCmd(u16 addr, u32 val) { void GFSetGenMode2(u8 nTexGens, u8 nChans, u8 nTevs, u8 nInds, GXCullMode cm); -#endif /* GFGEOMETRY_H */ +#endif +#endif /* _DOLPHIN_GF_GFGEOMETRY_H_ */ diff --git a/include/dolphin/gf/GFLight.h b/include/dolphin/gf/GFLight.h index 15d9644340c..570f58e88e2 100644 --- a/include/dolphin/gf/GFLight.h +++ b/include/dolphin/gf/GFLight.h @@ -1,8 +1,12 @@ -#ifndef GFLIGHT_H -#define GFLIGHT_H +#ifndef _DOLPHIN_GF_GFLIGHT_H +#define _DOLPHIN_GF_GFLIGHT_H +#ifdef __REVOLUTION_SDK__ +#include +#else #include void GFSetChanAmbColor(GXChannelID chan, GXColor color); -#endif /* GFLIGHT_H */ +#endif +#endif /* _DOLPHIN_GF_GFLIGHT_H */ diff --git a/include/dolphin/gf/GFPixel.h b/include/dolphin/gf/GFPixel.h index 9260dcf348e..a200b776f19 100644 --- a/include/dolphin/gf/GFPixel.h +++ b/include/dolphin/gf/GFPixel.h @@ -1,6 +1,9 @@ -#ifndef GFPIXEL_H -#define GFPIXEL_H +#ifndef _DOLPHIN_GF_GFPIXEL_H +#define _DOLPHIN_GF_GFPIXEL_H +#ifdef __REVOLUTION_SDK__ +#include +#else #include void GFSetFog(GXFogType type, f32 startz, f32 endz, f32 nearz, f32 farz, GXColor color); @@ -10,4 +13,5 @@ void GFSetBlendModeEtc(GXBlendMode type, GXBlendFactor src_factor, u8 dither_enable); void GFSetZMode(u8 compare_enable, GXCompare func, u8 update_enable); -#endif /* GFPIXEL_H */ +#endif +#endif /* _DOLPHIN_GF_GFPIXEL_H */ diff --git a/include/dolphin/gf/GFTev.h b/include/dolphin/gf/GFTev.h index 49921795e85..2a20479e707 100644 --- a/include/dolphin/gf/GFTev.h +++ b/include/dolphin/gf/GFTev.h @@ -1,8 +1,12 @@ -#ifndef GFTEV_H -#define GFTEV_H +#ifndef _DOLPHIN_GF_GFTEV_H +#define _DOLPHIN_GF_GFTEV_H +#ifdef __REVOLUTION_SDK__ +#include +#else #include void GFSetTevColorS10(GXTevRegID reg, GXColorS10 color); -#endif /* GFTEV_H */ +#endif +#endif /* _DOLPHIN_GF_GFTEV_H */ diff --git a/include/dolphin/gx.h b/include/dolphin/gx.h index 0e90e543e17..100fe8a8d95 100644 --- a/include/dolphin/gx.h +++ b/include/dolphin/gx.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GX_H_ #define _DOLPHIN_GX_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include #include @@ -38,3 +41,4 @@ void GXSetDrawSync(u16 token); #endif #endif +#endif diff --git a/include/dolphin/gx/GXBump.h b/include/dolphin/gx/GXBump.h index 2a24dc69f84..61118c08763 100644 --- a/include/dolphin/gx/GXBump.h +++ b/include/dolphin/gx/GXBump.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GX_GXBUMP_H_ #define _DOLPHIN_GX_GXBUMP_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -27,3 +30,4 @@ void __GXSetIndirectMask(u32 mask); #endif #endif +#endif diff --git a/include/dolphin/gx/GXCommandList.h b/include/dolphin/gx/GXCommandList.h index 9adae3cb791..e89037e7741 100644 --- a/include/dolphin/gx/GXCommandList.h +++ b/include/dolphin/gx/GXCommandList.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GX_GXCOMMANDLIST_H_ #define _DOLPHIN_GX_GXCOMMANDLIST_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #define GX_NOP 0x00 @@ -35,3 +38,4 @@ extern u8 GXTexImage3Ids[8]; extern u8 GXTexTlutIds[8]; #endif +#endif diff --git a/include/dolphin/gx/GXCpu2Efb.h b/include/dolphin/gx/GXCpu2Efb.h index 46aa3e3369e..32263310b95 100644 --- a/include/dolphin/gx/GXCpu2Efb.h +++ b/include/dolphin/gx/GXCpu2Efb.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GX_GXCPU2EFB_H_ #define _DOLPHIN_GX_GXCPU2EFB_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -27,3 +30,4 @@ u32 GXDecompressZ16(u32 z16, GXZFmt16 zfmt); #endif #endif +#endif diff --git a/include/dolphin/gx/GXCull.h b/include/dolphin/gx/GXCull.h index cac43818127..14a3fcbfd3b 100644 --- a/include/dolphin/gx/GXCull.h +++ b/include/dolphin/gx/GXCull.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GX_GXCULL_H_ #define _DOLPHIN_GX_GXCULL_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -16,3 +19,4 @@ void GXSetCoPlanar(GXBool enable); #endif #endif +#endif diff --git a/include/dolphin/gx/GXDispList.h b/include/dolphin/gx/GXDispList.h index 357fb8f7e0a..fb6fd3d400b 100644 --- a/include/dolphin/gx/GXDispList.h +++ b/include/dolphin/gx/GXDispList.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GX_GXDISPLIST_H_ #define _DOLPHIN_GX_GXDISPLIST_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -16,3 +19,4 @@ void GXCallDisplayList(void* list, u32 nbytes); #endif #endif +#endif diff --git a/include/dolphin/gx/GXDraw.h b/include/dolphin/gx/GXDraw.h index c8e779345a2..75e58d7408f 100644 --- a/include/dolphin/gx/GXDraw.h +++ b/include/dolphin/gx/GXDraw.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GX_GXDRAW_H_ #define _DOLPHIN_GX_GXDRAW_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -22,3 +25,4 @@ u32 GXGenNormalTable(u8 depth, f32* table); #endif #endif +#endif diff --git a/include/dolphin/gx/GXEnum.h b/include/dolphin/gx/GXEnum.h index cd84f223996..49f97ace7bf 100644 --- a/include/dolphin/gx/GXEnum.h +++ b/include/dolphin/gx/GXEnum.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GX_GXENUM_H_ #define _DOLPHIN_GX_GXENUM_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include typedef u8 GXBool; @@ -922,3 +925,4 @@ typedef enum _GXCPRegs { } GXCPRegs; #endif +#endif diff --git a/include/dolphin/gx/GXFifo.h b/include/dolphin/gx/GXFifo.h index 069f36a4eaf..8dbc0203638 100644 --- a/include/dolphin/gx/GXFifo.h +++ b/include/dolphin/gx/GXFifo.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GX_GXFIFO_H_ #define _DOLPHIN_GX_GXFIFO_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include @@ -44,3 +47,4 @@ void GXRestoreWriteGatherPipe(void); #endif #endif +#endif diff --git a/include/dolphin/gx/GXFrameBuffer.h b/include/dolphin/gx/GXFrameBuffer.h index 73b513fa32e..99b1af436f4 100644 --- a/include/dolphin/gx/GXFrameBuffer.h +++ b/include/dolphin/gx/GXFrameBuffer.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GX_GXFRAMEBUFFER_H_ #define _DOLPHIN_GX_GXFRAMEBUFFER_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include @@ -64,3 +67,4 @@ f32 GXGetYScaleFactor(u16 efbHeight, u16 xfbHeight); #endif #endif +#endif diff --git a/include/dolphin/gx/GXGeometry.h b/include/dolphin/gx/GXGeometry.h index c12a6f1b467..f2e9965ad0f 100644 --- a/include/dolphin/gx/GXGeometry.h +++ b/include/dolphin/gx/GXGeometry.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GX_GXGEOMETRY_H_ #define _DOLPHIN_GX_GXGEOMETRY_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include @@ -45,3 +48,4 @@ void GXEnableTexOffsets(GXTexCoordID coord, u8 line_enable, u8 point_enable); #endif #endif +#endif diff --git a/include/dolphin/gx/GXGet.h b/include/dolphin/gx/GXGet.h index d1ba630a46c..553201d51f6 100644 --- a/include/dolphin/gx/GXGet.h +++ b/include/dolphin/gx/GXGet.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GX_GXGET_H_ #define _DOLPHIN_GX_GXGET_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include @@ -62,3 +65,4 @@ void GXGetScissor(u32* left, u32* top, u32* wd, u32* ht); #endif #endif +#endif diff --git a/include/dolphin/gx/GXLighting.h b/include/dolphin/gx/GXLighting.h index 83c5aae423a..fb1af068826 100644 --- a/include/dolphin/gx/GXLighting.h +++ b/include/dolphin/gx/GXLighting.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GX_GXLIGHTING_H_ #define _DOLPHIN_GX_GXLIGHTING_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include @@ -30,3 +33,4 @@ void GXSetChanCtrl(GXChannelID chan, GXBool enable, GXColorSrc amb_src, GXColorS #endif #endif +#endif diff --git a/include/dolphin/gx/GXManage.h b/include/dolphin/gx/GXManage.h index fd899d36199..2a5784b84ad 100644 --- a/include/dolphin/gx/GXManage.h +++ b/include/dolphin/gx/GXManage.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GX_GXMANAGE_H_ #define _DOLPHIN_GX_GXMANAGE_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -34,3 +37,4 @@ GXDrawDoneCallback GXSetDrawDoneCallback(GXDrawDoneCallback cb); #endif #endif +#endif diff --git a/include/dolphin/gx/GXPerf.h b/include/dolphin/gx/GXPerf.h index bd1b474aa8b..f579e4201a8 100644 --- a/include/dolphin/gx/GXPerf.h +++ b/include/dolphin/gx/GXPerf.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GX_GXPERF_H_ #define _DOLPHIN_GX_GXPERF_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -28,3 +31,4 @@ u32 GXReadClksPerVtx(void); #endif #endif +#endif diff --git a/include/dolphin/gx/GXPixel.h b/include/dolphin/gx/GXPixel.h index d61838d1a99..ed3e245db59 100644 --- a/include/dolphin/gx/GXPixel.h +++ b/include/dolphin/gx/GXPixel.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GX_GXPIXEL_H_ #define _DOLPHIN_GX_GXPIXEL_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include @@ -28,3 +31,4 @@ void GXSetFogColor(GXColor color); #endif #endif +#endif diff --git a/include/dolphin/gx/GXStruct.h b/include/dolphin/gx/GXStruct.h index 0e7dc0be690..faba188d249 100644 --- a/include/dolphin/gx/GXStruct.h +++ b/include/dolphin/gx/GXStruct.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GX_GXSTRUCT_H_ #define _DOLPHIN_GX_GXSTRUCT_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include @@ -73,3 +76,4 @@ typedef struct _GXVtxAttrFmtList { #endif #endif +#endif diff --git a/include/dolphin/gx/GXTev.h b/include/dolphin/gx/GXTev.h index 8deb22d0837..a804fd0ccd9 100644 --- a/include/dolphin/gx/GXTev.h +++ b/include/dolphin/gx/GXTev.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GX_GXTEV_H_ #define _DOLPHIN_GX_GXTEV_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include @@ -31,3 +34,4 @@ void GXSetNumTevStages(u8 nStages); #endif #endif +#endif diff --git a/include/dolphin/gx/GXTexture.h b/include/dolphin/gx/GXTexture.h index f42dc2295a9..e84dcffe470 100644 --- a/include/dolphin/gx/GXTexture.h +++ b/include/dolphin/gx/GXTexture.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GX_GXTEXTURE_H_ #define _DOLPHIN_GX_GXTEXTURE_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include @@ -50,3 +53,4 @@ void GXInitTexObjMaxAniso(GXTexObj* obj, GXAnisotropy max_aniso); #endif #endif +#endif diff --git a/include/dolphin/gx/GXTransform.h b/include/dolphin/gx/GXTransform.h index 1e7f94e5796..f433f65f445 100644 --- a/include/dolphin/gx/GXTransform.h +++ b/include/dolphin/gx/GXTransform.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GX_GXTRANSFORM_H_ #define _DOLPHIN_GX_GXTRANSFORM_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -30,5 +33,5 @@ void GXSetZScaleOffset(f32 scale, f32 offset); #ifdef __cplusplus } #endif - +#endif #endif diff --git a/include/dolphin/gx/GXVerify.h b/include/dolphin/gx/GXVerify.h index 93a1b29e58c..b1a299e0da5 100644 --- a/include/dolphin/gx/GXVerify.h +++ b/include/dolphin/gx/GXVerify.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GX_GXVERIFY_H_ #define _DOLPHIN_GX_GXVERIFY_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include @@ -27,3 +30,4 @@ void __GXVerifyVATImm(GXAttr attr, GXCompCnt cnt, GXCompType type, u8 frac); #endif #endif +#endif diff --git a/include/dolphin/gx/GXVert.h b/include/dolphin/gx/GXVert.h index 91b7d7cc0ba..c508e164bbb 100644 --- a/include/dolphin/gx/GXVert.h +++ b/include/dolphin/gx/GXVert.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_GX_GXVERT_H_ #define _DOLPHIN_GX_GXVERT_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include @@ -138,3 +141,4 @@ FUNC_1PARAM(GXMatrixIndex, u8) #endif #endif +#endif diff --git a/include/dolphin/mix.h b/include/dolphin/mix.h index f58b3d63dc6..aa9a22b1dd9 100644 --- a/include/dolphin/mix.h +++ b/include/dolphin/mix.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_MIX_H_ #define _DOLPHIN_MIX_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include @@ -92,4 +95,5 @@ void MIXUpdateSettings(void); } #endif +#endif #endif // _DOLPHIN_MIX_H_ diff --git a/include/dolphin/mtx.h b/include/dolphin/mtx.h index 4d20a6cc4de..c818376fa37 100644 --- a/include/dolphin/mtx.h +++ b/include/dolphin/mtx.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_MTX_H_ #define _DOLPHIN_MTX_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -381,3 +384,4 @@ void C_QUATCompA(const Quaternion* qprev, const Quaternion* q, const Quaternion* #endif #endif +#endif diff --git a/include/dolphin/os.h b/include/dolphin/os.h index c38031b3246..e3034658d38 100644 --- a/include/dolphin/os.h +++ b/include/dolphin/os.h @@ -3,6 +3,9 @@ #include +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include void OSReportInit(void); @@ -351,3 +354,4 @@ static inline void OSInitFastCast(void) { #endif #endif +#endif diff --git a/include/dolphin/os/OSAlarm.h b/include/dolphin/os/OSAlarm.h index 31050391818..43e48221425 100644 --- a/include/dolphin/os/OSAlarm.h +++ b/include/dolphin/os/OSAlarm.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_OSALARM_H_ #define _DOLPHIN_OSALARM_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -33,4 +36,5 @@ void OSCancelAlarms(u32 tag); } #endif +#endif #endif // _DOLPHIN_OSALARM_H_ diff --git a/include/dolphin/os/OSAlloc.h b/include/dolphin/os/OSAlloc.h index 77eb88661fa..426b6ae4391 100644 --- a/include/dolphin/os/OSAlloc.h +++ b/include/dolphin/os/OSAlloc.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_OSALLOC_H_ #define _DOLPHIN_OSALLOC_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -32,3 +35,4 @@ void OSVisitAllocated(void (*visitor)(void*, u32)); #endif #endif +#endif diff --git a/include/dolphin/os/OSCache.h b/include/dolphin/os/OSCache.h index 89e7ce96bad..2b4bbfd07e0 100644 --- a/include/dolphin/os/OSCache.h +++ b/include/dolphin/os/OSCache.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_OSCACHE_H_ #define _DOLPHIN_OSCACHE_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -36,3 +39,4 @@ void __OSCacheInit(void); #endif #endif +#endif diff --git a/include/dolphin/os/OSContext.h b/include/dolphin/os/OSContext.h index cbb0b92e4e5..900baf40af3 100644 --- a/include/dolphin/os/OSContext.h +++ b/include/dolphin/os/OSContext.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_OSCONTEXT_H_ #define _DOLPHIN_OSCONTEXT_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -171,3 +174,4 @@ void OSFillFPUContext(OSContext* context); #endif #endif +#endif diff --git a/include/dolphin/os/OSDC.h b/include/dolphin/os/OSDC.h index bab2d68edcb..995c1630cc7 100644 --- a/include/dolphin/os/OSDC.h +++ b/include/dolphin/os/OSDC.h @@ -1,6 +1,10 @@ #ifndef _DOLPHIN_OSDC_H_ #define _DOLPHIN_OSDC_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else + #ifdef __cplusplus extern "C" { #endif @@ -21,3 +25,4 @@ void DCBlockInvalidate(void* addr); #endif #endif +#endif diff --git a/include/dolphin/os/OSError.h b/include/dolphin/os/OSError.h index 4a2fc7bd71a..aeeaede1485 100644 --- a/include/dolphin/os/OSError.h +++ b/include/dolphin/os/OSError.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_OSERROR_H_ #define _DOLPHIN_OSERROR_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -36,3 +39,4 @@ extern OSErrorHandler __OSErrorTable[17]; #endif #endif +#endif diff --git a/include/dolphin/os/OSException.h b/include/dolphin/os/OSException.h index e9a2f225697..0b909ca202d 100644 --- a/include/dolphin/os/OSException.h +++ b/include/dolphin/os/OSException.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_OSEXCEPTION_H_ #define _DOLPHIN_OSEXCEPTION_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include @@ -58,4 +61,5 @@ __OSExceptionHandler __OSGetExceptionHandler(__OSException exception); } #endif +#endif #endif // _DOLPHIN_OSEXCEPTION_H_ diff --git a/include/dolphin/os/OSExec.h b/include/dolphin/os/OSExec.h index af0dc4da0c0..7fd5380b705 100644 --- a/include/dolphin/os/OSExec.h +++ b/include/dolphin/os/OSExec.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_OSEXEC_H_ #define _DOLPHIN_OSEXEC_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -33,3 +36,4 @@ void OSExecl(const char* dolfile, const char* arg0, ...); #endif #endif +#endif diff --git a/include/dolphin/os/OSFont.h b/include/dolphin/os/OSFont.h index 1fff41a6296..1c1d480ab4f 100644 --- a/include/dolphin/os/OSFont.h +++ b/include/dolphin/os/OSFont.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_OSFONT_H_ #define _DOLPHIN_OSFONT_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include @@ -56,3 +59,4 @@ int OSSetFontWidth(int fixed); #endif #endif +#endif diff --git a/include/dolphin/os/OSIC.h b/include/dolphin/os/OSIC.h index 3309d3a6f15..20156e68747 100644 --- a/include/dolphin/os/OSIC.h +++ b/include/dolphin/os/OSIC.h @@ -1,6 +1,10 @@ #ifndef _DOLPHIN_OSIC_H_ #define _DOLPHIN_OSIC_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else + #ifdef __cplusplus extern "C" { #endif @@ -18,3 +22,4 @@ void ICSync(void); #endif #endif +#endif diff --git a/include/dolphin/os/OSInterrupt.h b/include/dolphin/os/OSInterrupt.h index fb74135a2b6..37e4f969580 100644 --- a/include/dolphin/os/OSInterrupt.h +++ b/include/dolphin/os/OSInterrupt.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_OSINTERRUPT_H_ #define _DOLPHIN_OSINTERRUPT_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include @@ -116,3 +119,4 @@ OSInterruptMask __OSUnmaskInterrupts(OSInterruptMask mask); #endif #endif +#endif diff --git a/include/dolphin/os/OSL2.h b/include/dolphin/os/OSL2.h index 01b4a620c0d..0622de06dd4 100644 --- a/include/dolphin/os/OSL2.h +++ b/include/dolphin/os/OSL2.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_OSL2_H_ #define _DOLPHIN_OSL2_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -18,3 +21,4 @@ void L2SetWriteThrough(BOOL writeThrough); #endif #endif +#endif diff --git a/include/dolphin/os/OSLC.h b/include/dolphin/os/OSLC.h index af49708b146..c266b20e7b3 100644 --- a/include/dolphin/os/OSLC.h +++ b/include/dolphin/os/OSLC.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_OSLC_H_ #define _DOLPHIN_OSLC_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -17,3 +20,4 @@ void LCAllocNoInvalidate(void *addr, u32 nBytes); #endif #endif +#endif diff --git a/include/dolphin/os/OSMemory.h b/include/dolphin/os/OSMemory.h index a5debebc90b..b1eaaf498c3 100644 --- a/include/dolphin/os/OSMemory.h +++ b/include/dolphin/os/OSMemory.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_OSMEMORY_H_ #define _DOLPHIN_OSMEMORY_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -26,3 +29,4 @@ u32 OSGetConsoleSimulatedMemSize(void); #endif #endif +#endif diff --git a/include/dolphin/os/OSMessage.h b/include/dolphin/os/OSMessage.h index 8cdd3f1b028..0660be565de 100644 --- a/include/dolphin/os/OSMessage.h +++ b/include/dolphin/os/OSMessage.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_OSMESSAGE_H_ #define _DOLPHIN_OSMESSAGE_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -30,4 +33,5 @@ int OSJamMessage(OSMessageQueue* mq, void* msg, s32 flags); } #endif +#endif #endif // _DOLPHIN_OSMESSAGE_H_ diff --git a/include/dolphin/os/OSModule.h b/include/dolphin/os/OSModule.h index 6e66e9b0032..d104cf7a189 100644 --- a/include/dolphin/os/OSModule.h +++ b/include/dolphin/os/OSModule.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_OSMODULE_H_ #define _DOLPHIN_OSMODULE_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -115,3 +118,4 @@ void OSNotifyUnlink(OSModuleInfo* module); #endif #endif +#endif diff --git a/include/dolphin/os/OSMutex.h b/include/dolphin/os/OSMutex.h index ef5565eb67f..58985f7a3c4 100644 --- a/include/dolphin/os/OSMutex.h +++ b/include/dolphin/os/OSMutex.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_OSMUTEX_H_ #define _DOLPHIN_OSMUTEX_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -31,3 +34,4 @@ void OSSignalCond(OSCond* cond); #endif #endif +#endif diff --git a/include/dolphin/os/OSReboot.h b/include/dolphin/os/OSReboot.h index 65095347934..517851aa34d 100644 --- a/include/dolphin/os/OSReboot.h +++ b/include/dolphin/os/OSReboot.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_OSREBOOT_H_ #define _DOLPHIN_OSREBOOT_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -17,3 +20,4 @@ void __OSReboot(u32 resetCode, u32 bootDol); #endif #endif +#endif diff --git a/include/dolphin/os/OSReset.h b/include/dolphin/os/OSReset.h index 15c2ba62fff..221861a4a6d 100644 --- a/include/dolphin/os/OSReset.h +++ b/include/dolphin/os/OSReset.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_OSRESET_H_ #define _DOLPHIN_OSRESET_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -37,3 +40,4 @@ u32 OSSetBootDol(u32 dolOffset); #endif #endif +#endif diff --git a/include/dolphin/os/OSResetSW.h b/include/dolphin/os/OSResetSW.h index 3c630b85736..88a7f194f43 100644 --- a/include/dolphin/os/OSResetSW.h +++ b/include/dolphin/os/OSResetSW.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_OSRESETSW_H_ #define _DOLPHIN_OSRESETSW_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -18,3 +21,4 @@ BOOL OSGetResetButtonState(void); #endif #endif +#endif diff --git a/include/dolphin/os/OSRtc.h b/include/dolphin/os/OSRtc.h index 583043f4a41..e35525dae98 100644 --- a/include/dolphin/os/OSRtc.h +++ b/include/dolphin/os/OSRtc.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_OSRTC_H_ #define _DOLPHIN_OSRTC_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -81,4 +84,5 @@ void OSSetWirelessID(s32 chan, u16 id); } #endif +#endif #endif // _DOLPHIN_OSRTC_H_ diff --git a/include/dolphin/os/OSSemaphore.h b/include/dolphin/os/OSSemaphore.h index aac23811a8e..93b942f9e1b 100644 --- a/include/dolphin/os/OSSemaphore.h +++ b/include/dolphin/os/OSSemaphore.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_OSSEMAPHORE_H_ #define _DOLPHIN_OSSEMAPHORE_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -22,4 +25,5 @@ s32 OSGetSemaphoreCount(OSSemaphore* sem); } #endif +#endif #endif // _DOLPHIN_OSSEMAPHORE_H_ diff --git a/include/dolphin/os/OSSerial.h b/include/dolphin/os/OSSerial.h index 7c38395f715..c6dd0a59e4b 100644 --- a/include/dolphin/os/OSSerial.h +++ b/include/dolphin/os/OSSerial.h @@ -1,6 +1,10 @@ #ifndef _DOLPHIN_OSSERIAL_H #define _DOLPHIN_OSSERIAL_H +#ifdef __REVOLUTION_SDK__ +#include +#else #include +#endif #endif // _DOLPHIN_OSSERIAL_H diff --git a/include/dolphin/os/OSThread.h b/include/dolphin/os/OSThread.h index 5511c7595bf..c1135759832 100644 --- a/include/dolphin/os/OSThread.h +++ b/include/dolphin/os/OSThread.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_OSTHREAD_H_ #define _DOLPHIN_OSTHREAD_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -110,3 +113,4 @@ OSSwitchThreadCallback OSSetSwitchThreadCallback(OSSwitchThreadCallback callback #endif #endif +#endif diff --git a/include/dolphin/os/OSTime.h b/include/dolphin/os/OSTime.h index 118adee7c2a..b6e9fd7b8c9 100644 --- a/include/dolphin/os/OSTime.h +++ b/include/dolphin/os/OSTime.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_OSTIME_H_ #define _DOLPHIN_OSTIME_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -41,4 +44,5 @@ extern "C" { } #endif +#endif #endif // _DOLPHIN_OSTIME_H_ diff --git a/include/dolphin/os/OSTimer.h b/include/dolphin/os/OSTimer.h index 490cccb67ce..caa4076ffed 100644 --- a/include/dolphin/os/OSTimer.h +++ b/include/dolphin/os/OSTimer.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_OSTIMER_H_ #define _DOLPHIN_OSTIMER_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -18,4 +21,5 @@ void OSStopTimer(void); } #endif +#endif #endif // _DOLPHIN_OSTIMER_H_ diff --git a/include/dolphin/os/OSUtf.h b/include/dolphin/os/OSUtf.h index 2f721d5787d..44c908ef0f2 100644 --- a/include/dolphin/os/OSUtf.h +++ b/include/dolphin/os/OSUtf.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_OSUTF_H_ #define _DOLPHIN_OSUTF_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -20,4 +23,5 @@ u32 OSSJIStoUTF32(u16 sjis); } #endif +#endif #endif // _DOLPHIN_OSUTF_H_ diff --git a/include/dolphin/pad.h b/include/dolphin/pad.h index d966b80945d..eb208d4287a 100644 --- a/include/dolphin/pad.h +++ b/include/dolphin/pad.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_PAD_H_ #define _DOLPHIN_PAD_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -102,3 +105,4 @@ void PADClampCircle(PADStatus* status); #endif #endif +#endif diff --git a/include/dolphin/seq.h b/include/dolphin/seq.h index 754798093d5..8c950ca2a38 100644 --- a/include/dolphin/seq.h +++ b/include/dolphin/seq.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_SEQ_H_ #define _DOLPHIN_SEQ_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -51,4 +54,5 @@ s32 SEQGetVolume(SEQSEQUENCE* sequence); } #endif +#endif #endif // _DOLPHIN_SEQ_H_ diff --git a/include/dolphin/si.h b/include/dolphin/si.h index 04b01ba4d7f..ed1b442ad82 100644 --- a/include/dolphin/si.h +++ b/include/dolphin/si.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_SI_H_ #define _DOLPHIN_SI_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #ifdef __cplusplus @@ -172,4 +175,5 @@ void SIControlSteering(s32 chan, u32 control, s32 level); } #endif +#endif #endif // _DOLPHIN_SI_H_ diff --git a/include/dolphin/sp.h b/include/dolphin/sp.h index 52f4fff0202..4401b8c9fc4 100644 --- a/include/dolphin/sp.h +++ b/include/dolphin/sp.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_SP_H_ #define _DOLPHIN_SP_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include @@ -38,3 +41,4 @@ void SPPrepareEnd(SPSoundEntry* sound, AXVPB* axvpb); #endif #endif +#endif diff --git a/include/dolphin/syn.h b/include/dolphin/syn.h index 8373c5db914..0b8848f9d49 100644 --- a/include/dolphin/syn.h +++ b/include/dolphin/syn.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_SYN_H_ #define _DOLPHIN_SYN_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include @@ -169,4 +172,5 @@ u8 SYNGetMidiController(SYNSYNTH* synth, u8 midiChannel, u8 function); } #endif +#endif #endif // _DOLPHIN_SYN_H_ diff --git a/include/dolphin/types.h b/include/dolphin/types.h index 9d061526b5f..a44be3988c1 100644 --- a/include/dolphin/types.h +++ b/include/dolphin/types.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_TYPES_H_ #define _DOLPHIN_TYPES_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else typedef signed char s8; typedef unsigned char u8; typedef signed short int s16; @@ -56,3 +59,4 @@ typedef unsigned int uint; #include "stddef.h" #endif +#endif diff --git a/include/dolphin/vi.h b/include/dolphin/vi.h index af41844266e..b8fa79160e2 100644 --- a/include/dolphin/vi.h +++ b/include/dolphin/vi.h @@ -1,7 +1,11 @@ #ifndef _DOLPHIN_VI_H_ #define _DOLPHIN_VI_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include #endif +#endif diff --git a/include/dolphin/vi/vifuncs.h b/include/dolphin/vi/vifuncs.h index eb95984ede5..b05611a4276 100644 --- a/include/dolphin/vi/vifuncs.h +++ b/include/dolphin/vi/vifuncs.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_VIFUNCS_H_ #define _DOLPHIN_VIFUNCS_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #include #include @@ -34,3 +37,4 @@ u32 VIGetDTVStatus(void); #endif #endif +#endif diff --git a/include/dolphin/vi/vitypes.h b/include/dolphin/vi/vitypes.h index 983a89b7ea1..998082d3c95 100644 --- a/include/dolphin/vi/vitypes.h +++ b/include/dolphin/vi/vitypes.h @@ -1,6 +1,9 @@ #ifndef _DOLPHIN_VITYPES_H_ #define _DOLPHIN_VITYPES_H_ +#ifdef __REVOLUTION_SDK__ +#include +#else #include #define VI_TVMODE(format, interlace) (((format) << 2) + (interlace)) @@ -39,3 +42,4 @@ typedef enum { typedef void (*VIRetraceCallback)(u32 retraceCount); #endif +#endif diff --git a/include/f_ap/f_ap_game.h b/include/f_ap/f_ap_game.h index f7cf3d6ca79..b5cc371d809 100644 --- a/include/f_ap/f_ap_game.h +++ b/include/f_ap/f_ap_game.h @@ -2,41 +2,106 @@ #define F_AP_F_AP_GAME_H #include "JSystem/JUtility/TColor.h" +#include "JSystem/JHostIO/JORReflexible.h" +#include "JSystem/JFramework/JFWDisplay.h" +#include "JSystem/JUtility/JUTAssert.h" +#include void fapGm_After(); void fapGm_Create(); void fapGm_Execute(); -class fapGm_HIO_c { +struct CaptureScreen { + CaptureScreen(const JFWDisplay* i_display) { + field_0x0 = i_display; + field_0x4 = 0; + } + + /* 0x0 */ const JFWDisplay* field_0x0; + /* 0x4 */ int field_0x4; +}; + +class fapGm_HIO_c : public JORReflexible { public: /* 80018944 */ fapGm_HIO_c(); + + #if DEBUG + virtual void listenPropertyEvent(const JORPropertyEvent*); + virtual void genMessage(JORMContext*); + #endif /* 80018AE0 */ virtual ~fapGm_HIO_c(); + #if DEBUG + static void startCpuTimer(); + static void stopCpuTimer(const char*); + static void printCpuTimer(const char*); + static void executeCaptureScreen(); + + static void createCaptureScreen() { + mCaptureScreen = new CaptureScreen(JFWDisplay::getManager()); + JUT_ASSERT(46, mCaptureScreen != NULL); + } + + static void onCpuTimer() { + m_CpuTimerOn = TRUE; + } + + static void offCpuTimer() { + m_CpuTimerOff = FALSE; + } + #endif + + #if DEBUG + static u8 m_CpuTimerOn; + static u8 m_CpuTimerOff; + static u8 m_CpuTimerStart; + static u32 m_CpuTimerTick; + + static CaptureScreen* mCaptureScreen; + static void* mCaptureScreenBuffer; + static s16 mCaptureScreenFlag; + static u16 mCaptureScreenWidth; + static u16 mCaptureScreenHeight; + static u16 mCaptureScreenLinePf; + static u16 mCaptureScreenLineNum; + static u8 mCaptureScreenNumH; + static u8 mCaptureScreenNumV; + + static u8 mParticle254Fix; + #endif + /* 0x04 */ s8 field_0x04; /* 0x05 */ u8 field_0x03[3]; /* 0x08 */ JUtility::TColor mColor; /* 0x0C */ f32 mLROnValue; /* 0x10 */ f32 mLROffValue; - /* 0x14 */ bool mUsingHostIO; + /* 0x14 */ u8 mUsingHostIO; /* 0x15 */ u8 mDisplayMeter; /* 0x16 */ u8 mDisplayPrint; - /* 0x17 */ bool mDisplay2D; - /* 0x18 */ bool mDisplayParticle; - /* 0x19 */ bool mDisplayProcessID; - /* 0x1A */ bool mMemBlockOff; + /* 0x17 */ u8 mDisplay2D; + /* 0x18 */ u8 mDisplayParticle; + /* 0x19 */ u8 mDisplayProcessID; + #if DEBUG + /* 0x1A */ u8 mTrapFilter; + /* 0x1B */ u8 mGammaCorrection; + #endif + /* 0x1A */ u8 mMemBlockOff; /* 0x1C */ s16 mRegister0; /* 0x1E */ s16 mRegister1; /* 0x20 */ s16 mRegister2; /* 0x22 */ s16 mRegister3; + #if DEBUG + /* 0x26 */ u8 field_0x26[2]; + #endif /* 0x24 */ JUtility::TColor mLetterTopColor; /* 0x28 */ JUtility::TColor mLetterBottomColor; /* 0x2C */ JUtility::TColor mLetterTopShadowColor; /* 0x30 */ JUtility::TColor mLetterBottomShadowColor; - /* 0x34 */ u16 mLetterPositionX; - /* 0x36 */ u16 mLetterPositionY; - /* 0x38 */ u16 mLineSpacing; - /* 0x3A */ u16 mLetterSpacing; - /* 0x3C */ u16 mLetterFontSize; + /* 0x34 */ s16 mLetterPositionX; + /* 0x36 */ s16 mLetterPositionY; + /* 0x38 */ s16 mLineSpacing; + /* 0x3A */ s16 mLetterSpacing; + /* 0x3C */ s16 mLetterFontSize; /* 0x3E */ u8 mBackgroundAlpha; }; // Size: 0x40 @@ -70,4 +135,58 @@ inline f32 fapGmHIO_getLROffValue() { return g_HIO.mLROffValue; } +inline u8 fapGmHIO_getHostIO() { + return g_HIO.mUsingHostIO; +} + +struct fapGm_dataMem { + enum HeapType_e { + HeapType_Error_e, + HeapType_ARAM_e, + HeapType_Root_e, + HeapType_System_e, + HeapType_Zelda_e, + HeapType_Archive_e, + HeapType_Game_e, + HeapType_Command_e, + HeapType_Stage_e, + HeapType_J2D_e, + HeapType_Dynamic_e, + }; + + enum TagAttribute_e { + TagAtt_Fixed_e, + TagAtt_Variable_e, + }; + + enum TagType_e { + TagType_Audio_e, + TagType_Particle_e, + TagType_System_e, + TagType_Unknown_e, + TagType_Message_e, + TagType_2D_e, + TagType_Player_e, + TagType_Archive_e, + TagType_ArchiveSub_e, + TagType_ArchiveStage_e, + TagType_ArchiveStageSub_e, + TagType_Program_e, + TagType_Object_e, + TagType_Stage_e, + TagType_Heap_e, + }; + + static void printfTag(int, int, int, const char*, void*, u32, const char*, const char*); + static int findParentHeap(void*); + static void dumpTag(); + static void dumpCsv(); + + static int getCsvSize() { return strlen(mCsv); } + static char* getCsv() { return mCsv; } + static inline char* getCsvEnd() { return mCsv + strlen(mCsv); } + + static char mCsv[0x8000]; +}; + #endif /* F_AP_F_AP_GAME_H */ diff --git a/include/f_op/f_op_actor.h b/include/f_op/f_op_actor.h index c995c9a3669..8c567e50465 100644 --- a/include/f_op/f_op_actor.h +++ b/include/f_op/f_op_actor.h @@ -284,19 +284,39 @@ STATIC_ASSERT(sizeof(fopAc_ac_c) == 0x568); class fopEn_enemy_c : public fopAc_ac_c { public: + enum fopEn_flag { + fopEn_flag_Down = 0x1, + fopEn_flag_CutDownHit = 0x2, + fopEn_flag_WolfDownStart = 0x4, + fopEn_flag_Dead = 0x8, + fopEn_flag_WolfDownPull = 0x10, + fopEn_flag_WolfDownPullEnd = 0x20, + fopEn_flag_WolfBiteDamage = 0x40, + fopEn_flag_HeadLock = 0x80, + + fopEn_flag_WolfNoLock = 0x200, + }; + + enum fopEn_throwMode { + fopEn_throwMode_Catch = 0x2, + fopEn_throwMode_Dash = 0x4, + fopEn_throwMode_ThrowLeft = 0x8, + fopEn_throwMode_ThrowRight = 0x10, + }; + /* 80019404 */ BOOL initBallModel(); /* 800194FC */ bool checkBallModelDraw(); /* 80019520 */ void setBallModelEffect(dKy_tevstr_c*); /* 800196A0 */ void drawBallModel(dKy_tevstr_c*); - bool checkWolfNoLock() const { return mFlags & 0x200; } - bool checkHeadLockFlg() const { return mFlags & 0x80; } - bool checkWolfBiteDamage() const { return mFlags & 0x40; } - bool checkWolfDownPullFlg() const { return mFlags & 0x10; } - bool checkDownFlg() { return mFlags & 0x1; } - bool checkCutDownHitFlg() const { return mFlags & 0x2; } - bool checkWolfDownStartFlg() const { return mFlags & 0x4; } - bool checkDeadFlg() const { return mFlags & 0x8; } + bool checkWolfNoLock() const { return mFlags & fopEn_flag_WolfNoLock; } + bool checkHeadLockFlg() const { return mFlags & fopEn_flag_HeadLock; } + bool checkWolfBiteDamage() const { return mFlags & fopEn_flag_WolfBiteDamage; } + bool checkWolfDownPullFlg() const { return mFlags & fopEn_flag_WolfDownPull; } + bool checkDownFlg() { return mFlags & fopEn_flag_Down; } + bool checkCutDownHitFlg() const { return mFlags & fopEn_flag_CutDownHit; } + bool checkWolfDownStartFlg() const { return mFlags & fopEn_flag_WolfDownStart; } + bool checkDeadFlg() const { return mFlags & fopEn_flag_Dead; } bool checkThrowMode(u8 param_1) const { return mThrowMode & param_1; } u32* getMidnaBindID(int i_idx) { return mMidnaBindID + i_idx; } @@ -304,28 +324,28 @@ public: cXyz& getDownPos() { return mDownPos; } cXyz& getHeadLockPos() { return mHeadLockPos; } - void onCutDownHitFlg() { mFlags |= 2; } - void onWolfBiteDamage() { mFlags |= 0x40; } - void onWolfDownStartFlg() { mFlags |= 0x14; } - void onWolfDownPullEndFlg() { mFlags |= 0x20; } - void onWolfNoLock() { mFlags |= 0x200; } - void onDownFlg() { mFlags |= 1; } - void onHeadLockFlg() { mFlags |= 0x80; } + void onCutDownHitFlg() { mFlags |= fopEn_flag_CutDownHit; } + void onWolfBiteDamage() { mFlags |= fopEn_flag_WolfBiteDamage; } + void onWolfDownStartFlg() { mFlags |= (fopEn_flag_WolfDownPull | fopEn_flag_WolfDownStart); } + void onWolfDownPullEndFlg() { mFlags |= fopEn_flag_WolfDownPullEnd; } + void onWolfNoLock() { mFlags |= fopEn_flag_WolfNoLock; } + void onDownFlg() { mFlags |= fopEn_flag_Down; } + void onHeadLockFlg() { mFlags |= fopEn_flag_HeadLock; } - void offWolfBiteDamage() { mFlags &= ~0x40; } - void offCutDownHitFlg() { mFlags &= ~0x2; } - void offWolfDownPullFlg() { mFlags &= ~0x10; } - void offDownFlg() { mFlags &= ~0x17; } - void offWolfNoLock() { mFlags &= ~0x200; } - void offHeadLockFlg() { mFlags &= ~0x80; } + void offWolfBiteDamage() { mFlags &= ~fopEn_flag_WolfBiteDamage; } + void offCutDownHitFlg() { mFlags &= ~fopEn_flag_CutDownHit; } + void offWolfDownPullFlg() { mFlags &= ~fopEn_flag_WolfDownPull; } + void offDownFlg() { mFlags &= ~(fopEn_flag_WolfDownPull | fopEn_flag_WolfDownStart | fopEn_flag_CutDownHit | fopEn_flag_Down); } + void offWolfNoLock() { mFlags &= ~fopEn_flag_WolfNoLock; } + void offHeadLockFlg() { mFlags &= ~fopEn_flag_HeadLock; } void offThrowMode(u8 throwMode) { mThrowMode &= ~throwMode; } void setMidnaBindMode(u8 i_bindMode) { mMidnaBindMode = i_bindMode; } void setMidnaBindID(u8 i_idx, u32 i_bindID) { mMidnaBindID[i_idx] = i_bindID; } - void setThrowModeCatch() { mThrowMode |= 2; } - void setThrowModeDash() { mThrowMode |= 4; } - void setThrowModeThrowRight() { mThrowMode |= 0x10; } - void setThrowModeThrowLeft() { mThrowMode |= 8; } + void setThrowModeCatch() { mThrowMode |= fopEn_throwMode_Catch; } + void setThrowModeDash() { mThrowMode |= fopEn_throwMode_Dash; } + void setThrowModeThrowRight() { mThrowMode |= fopEn_throwMode_ThrowRight; } + void setThrowModeThrowLeft() { mThrowMode |= fopEn_throwMode_ThrowLeft; } void setDownPos(const cXyz* i_pos) { mDownPos = *i_pos; } void setHeadLockPos(const cXyz* i_pos) { mHeadLockPos = *i_pos; } @@ -337,7 +357,7 @@ public: /* 0x58C */ u8 field_0x58c; /* 0x58D */ u8 mThrowMode; /* 0x58E */ u16 mFlags; - /* 0x590 */ f32 field_0x590; + /* 0x590 */ f32 mAnmFrame; /* 0x594 */ u32 mEffectID1; /* 0x598 */ u32 mEffectID2; /* 0x59C */ u32 mMidnaBindID[3]; diff --git a/include/f_op/f_op_actor_mng.h b/include/f_op/f_op_actor_mng.h index 33c0f513008..545d650dc7e 100644 --- a/include/f_op/f_op_actor_mng.h +++ b/include/f_op/f_op_actor_mng.h @@ -12,7 +12,7 @@ #include "f_pc/f_pc_manager.h" #include "m_Do/m_Do_hostIO.h" -#define fopAcM_SetupActor(ptr, ClassName) \ +#define fopAcM_ct(ptr, ClassName) \ if (!fopAcM_CheckCondition(ptr, fopAcCnd_INIT_e)) { \ new (ptr) ClassName(); \ fopAcM_OnCondition(ptr, fopAcCnd_INIT_e); \ @@ -693,7 +693,7 @@ s32 fopAcM_riverStream(cXyz*, s16*, f32*, f32); s32 fopAcM_carryOffRevise(fopAc_ac_c*); void fopAcM_setEffectMtx(const fopAc_ac_c*, const J3DModelData*); -static const char* fopAcM_getProcNameString(const fopAc_ac_c* i_actor); +const char* fopAcM_getProcNameString(const fopAc_ac_c* i_actor); static const fopAc_ac_c* fopAcM_findObjectCB(fopAc_ac_c const* i_actor, void* i_data); @@ -709,6 +709,8 @@ 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 fopAcM_DrawCullingBox(const fopAc_ac_c*, const GXColor&); + inline void make_prm_warp_hole(u32* o_params, u8 prm1, u8 prm2, u8 prm3) { u32 pprm1 = (prm3 << 0x8); u32 pprm2 = (prm2 << 0x10); @@ -824,6 +826,11 @@ inline void fopAcM_setWarningMessage_f(const fopAc_ac_c* i_actor, const char* i_ #endif } +void fopAcM_showAssert_f(const fopAc_ac_c*, const char*, int, const char*, ...); + +#define fopAcM_assert(line, actor, COND, msg) \ + (COND) ? (void)0 : (fopAcM_showAssert_f(actor, __FILE__, line, msg)); + #ifdef DEBUG #define fopAcM_setWarningMessage(i_actor, i_filename, i_line, i_msg) \ fopAcM_setWarningMessage_f(i_actor, i_filename, i_line, i_msg) diff --git a/include/f_op/f_op_msg.h b/include/f_op/f_op_msg.h index 53fc419f621..72a57b594fa 100644 --- a/include/f_op/f_op_msg.h +++ b/include/f_op/f_op_msg.h @@ -38,4 +38,8 @@ struct msg_class { extern leafdraw_method_class g_fopMsg_Method; +namespace fopMsg { + extern u8 MemCheck; +} + #endif /* F_OP_F_OP_MSG_H */ diff --git a/include/f_pc/f_pc_layer_iter.h b/include/f_pc/f_pc_layer_iter.h index 2fb33ad90e8..49e6bf5eaf9 100644 --- a/include/f_pc/f_pc_layer_iter.h +++ b/include/f_pc/f_pc_layer_iter.h @@ -15,6 +15,7 @@ typedef void* (*fpcLyIt_JudgeFunc)(void*, void*); s32 fpcLyIt_OnlyHere(layer_class* i_layer, fpcLyIt_OnlyHereFunc i_func, void* i_data); s32 fpcLyIt_OnlyHereLY(layer_class* i_layer, fpcLyIt_OnlyHereFunc i_func, void* i_data); +s32 fpcLyIt_All(fpcLyIt_OnlyHereFunc i_func, void* i_data); void* fpcLyIt_Judge(layer_class* i_layer, fpcLyIt_JudgeFunc i_func, void* i_data); void* fpcLyIt_AllJudge(fpcLyIt_JudgeFunc i_func, void* i_data); diff --git a/include/m_Do/m_Do_MemCard.h b/include/m_Do/m_Do_MemCard.h index 84647669503..128a6a6b52f 100644 --- a/include/m_Do/m_Do_MemCard.h +++ b/include/m_Do/m_Do_MemCard.h @@ -163,4 +163,8 @@ inline void mDoMemCd_setCardStatus(s32 fileNo, CARDStat* stat) { g_mDoMemCd_control.setCardStatus(fileNo, stat); } +inline void mDoMemCd_UpDate() { + g_mDoMemCd_control.update(); +} + #endif /* M_DO_M_DO_MEMCARD_H */ diff --git a/include/m_Do/m_Do_Reset.h b/include/m_Do/m_Do_Reset.h index a40d331ef42..76272c37747 100644 --- a/include/m_Do/m_Do_Reset.h +++ b/include/m_Do/m_Do_Reset.h @@ -6,9 +6,6 @@ void mDoRst_reset(int, u32, int); void mDoRst_resetCallBack(int, void*); -extern bool SyncWidthSound; -extern u8 sDefaultDirection; - struct mDoRstData { /* 0x00 */ int mReset; /* 0x04 */ int mResetPrepare; diff --git a/include/m_Do/m_Do_dvd_thread.h b/include/m_Do/m_Do_dvd_thread.h index f0df50ac9bb..505778cbe4f 100644 --- a/include/m_Do/m_Do_dvd_thread.h +++ b/include/m_Do/m_Do_dvd_thread.h @@ -120,6 +120,11 @@ struct mDoDvdThd { static OSThread l_thread; static mDoDvdThdStack l_threadStack; static mDoDvdThd_param_c l_param; + + static u8 verbose; + static u8 DVDLogoMode; + static bool SyncWidthSound; + static u8 Report_DVDRead; }; #endif /* M_DO_M_DO_DVD_THREAD_H */ diff --git a/include/m_Do/m_Do_ext.h b/include/m_Do/m_Do_ext.h index 5af346ec4f8..8cd94087478 100644 --- a/include/m_Do/m_Do_ext.h +++ b/include/m_Do/m_Do_ext.h @@ -859,7 +859,12 @@ void mDoExt_modelUpdateDL(J3DModel* i_model); J3DModel* mDoExt_J3DModel__create(J3DModelData* i_modelData, u32 i_modelFlag, u32 i_differedDlistFlag); +extern u32 aram_cache_size; void mDoExt_setAraCacheSize(u32 size); +inline u32 mDoExt_getAraCacheSize() { + return aram_cache_size; +} + int mDoExt_resIDToIndex(JKRArchive* p_archive, u16 id); void mDoExt_modelEntryDL(J3DModel* i_model); void mDoExt_brkAnmRemove(J3DModelData* i_modelData); diff --git a/include/m_Do/m_Do_ext2.h b/include/m_Do/m_Do_ext2.h new file mode 100644 index 00000000000..45c72fe6ef3 --- /dev/null +++ b/include/m_Do/m_Do_ext2.h @@ -0,0 +1,30 @@ +#ifndef M_DO_EXT2_H +#define M_DO_EXT2_H + +#include "JSystem/JKernel/JKRHeap.h" + +class FixedMemoryCheck { +public: + FixedMemoryCheck(u32*, u32, JKRHeap*); + + void alloc(); + void save(); + void check(); + void diff(); + + static void easyCreate(void*, s32); + static void easyCreate(void*, u32); + static void checkAll(); + static void diffAll(); + static void saveAll(); + + /* 0x00 */ u32* field_0x00; + /* 0x04 */ u32 field_0x04; + /* 0x08 */ u32* field_0x08; + /* 0x0C */ JKRHeap* mpHeap; + /* 0x10 */ int field_0x10; + /* 0x14 */ u8 field_0x14; + /* 0x18 */ FixedMemoryCheck* field_0x18; +}; + +#endif diff --git a/include/m_Do/m_Do_graphic.h b/include/m_Do/m_Do_graphic.h index ed795a07731..2910ab9e50d 100644 --- a/include/m_Do/m_Do_graphic.h +++ b/include/m_Do/m_Do_graphic.h @@ -27,6 +27,7 @@ public: void setBlendColor(GXColor i_color) { mBlendColor = i_color; } void setMonoColor(GXColor i_color) { mMonoColor = i_color; } void setMode(u8 i_mode) { mMode = i_mode; } + void* getBuffer() { return m_buffer; } /* 0x00 */ GXColor mBlendColor; /* 0x04 */ GXColor mMonoColor; @@ -147,6 +148,15 @@ public: static void setWideZoomLightProjection(Mtx m) {} static void setFrameRate(u16 i_rate) { JFWDisplay::getManager()->setFrameRate(i_rate); } + static int getFrameBufferSize() { + #define RoundUp16b(x) (u16)(((u16)(x) + 16 - 1) & ~(16 - 1)) + return RoundUp16b(JFWDisplay::getManager()->getEfbWidth()) * JFWDisplay::getManager()->getEfbHeight() * 2; + } + + static void* getFrameBufferMemory() { + return JFWDisplay::getManager()->getXfbManager()->getDisplayingXfb(); + } + // NONMATCHING - Need to define all mDoGph_gInf_c shieldD members static u8 isWide() { #if PLATFORM_WII || PLATFORM_SHIELD @@ -183,6 +193,11 @@ public: static bool mAutoForcus; #if PLATFORM_WII || PLATFORM_SHIELD + static JKRHeap* getHeap() { + return m_heap; + } + + static JKRHeap* m_heap; static cXyz m_nowEffPos; static cXyz m_oldEffPos; static cXyz m_oldOldEffPos; diff --git a/include/m_Do/m_Do_machine.h b/include/m_Do/m_Do_machine.h index 75b275a7d2f..4fe72f05f09 100644 --- a/include/m_Do/m_Do_machine.h +++ b/include/m_Do/m_Do_machine.h @@ -13,6 +13,7 @@ void exceptionRestart(); void myExceptionCallback(u16, OSContext*, u32, u32); void my_SysPrintHeap(char const*, void*, u32); void mDoMch_HeapCheckAll(); +void mDoMch_HeapFreeFillAll(); int mDoMch_Create(); extern GXRenderModeObj g_ntscZeldaProg; @@ -29,4 +30,17 @@ public: static GXRenderModeObj* mRenderModeObj; }; +namespace mDoMch { + extern u8 mDebugFill; + extern u8 mDebugFillNotuse; + extern u8 mDebugFillNew; + extern u8 mDebugFillDelete; + + extern u8 myHeapVerbose; + extern u8 myHeapCallbackCheck; + extern u8 FpscrEnableBits; + extern u8 GXWarningLevel; + extern u8 GXWarningExecuteFrame; +}; + #endif /* M_DO_M_DO_MACHINE_H */ diff --git a/include/m_Do/m_Do_main.h b/include/m_Do/m_Do_main.h index 6ece441c63d..f005c5c9d79 100644 --- a/include/m_Do/m_Do_main.h +++ b/include/m_Do/m_Do_main.h @@ -26,16 +26,23 @@ public: u32& getUsedCountRef() { return mUsedCount; } u32& getTotalUsedSizeRef() { return mTotalUsedSize; } JKRExpHeap* getHeap() { return mHeap; } - void setHeap(JKRExpHeap* i_heap) { mHeap = i_heap; } void setHeapSize(u32 i_size) { mTargetHeapSize = i_size; } s32 getMaxTotalUsedSize() const { return mMaxTotalUsedSize; } s32 getMaxTotalFreeSize() { return mMaxTotalFreeSize; } const char* getName() const { return mName; } + const char* getJName() const { return mJName; } void saveRelBase() { mUsedCount = getUsedCount(); mTotalUsedSize = mHeap->getTotalUsedSize(); } + void setHeap(JKRExpHeap* i_heap) { + mHeap = i_heap; + if (i_heap != NULL) { + mTargetHeapSize = i_heap->getHeapSize(); + } + } + u32 getTargetHeapSize() const { return mTargetHeapSize; } u32 getRelUsedCount() const { return getUsedCount() - mUsedCount; } diff --git a/include/m_Do/m_Do_printf.h b/include/m_Do/m_Do_printf.h index d27e5bd627d..84d6c080b42 100644 --- a/include/m_Do/m_Do_printf.h +++ b/include/m_Do/m_Do_printf.h @@ -9,4 +9,16 @@ void mDoPrintf_vprintf_Thread(char const*, va_list); void mDoPrintf_vprintf(const char*, va_list); extern "C" void mDoPrintf_VReport(const char*, va_list); +extern u32 print_counts; +extern u32 print_errors; +extern u32 print_warings; +extern u32 print_systems; +extern u8 print_initialized; + +extern u8 print_mutex_initialized; +extern u8 print_highPriority; +extern u8 print_threadID; +extern u8 print_callerPC; +extern u8 print_callerPCLevel; + #endif /* M_DO_M_DO_PRINTF_H */ diff --git a/include/revolution/ai.h b/include/revolution/ai.h new file mode 100644 index 00000000000..340da848b2f --- /dev/null +++ b/include/revolution/ai.h @@ -0,0 +1,50 @@ +#ifndef _REVOLUTION_AI_H_ +#define _REVOLUTION_AI_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void (*AISCallback)(u32 count); +typedef void (*AIDCallback)(); + +#define AI_STREAM_START 1 +#define AI_STREAM_STOP 0 + +#define AI_SAMPLERATE_32KHZ 0 +#define AI_SAMPLERATE_48KHZ 1 + +AIDCallback AIRegisterDMACallback(AIDCallback callback); +void AIInitDMA(u32 start_addr, u32 length); +BOOL AIGetDMAEnableFlag(void); +void AIStartDMA(void); +void AIStopDMA(void); +u32 AIGetDMABytesLeft(void); +u32 AIGetDMAStartAddr(void); +u32 AIGetDMALength(void); +BOOL AICheckInit(void); +AISCallback AIRegisterStreamCallback(AISCallback callback); +u32 AIGetStreamSampleCount(void); +void AIResetStreamSampleCount(void); +void AISetStreamTrigger(u32 trigger); +u32 AIGetStreamTrigger(void); +void AISetStreamPlayState(u32 state); +u32 AIGetStreamPlayState(void); +void AISetDSPSampleRate(u32 rate); +u32 AIGetDSPSampleRate(void); +void AISetStreamSampleRate(u32 rate); +u32 AIGetStreamSampleRate(void); +void AISetStreamVolLeft(u8 vol); +u8 AIGetStreamVolLeft(void); +void AISetStreamVolRight(u8 vol); +u8 AIGetStreamVolRight(void); +void AIInit(u8* stack); +void AIReset(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/amc/AmcExi2Comm.h b/include/revolution/amc/AmcExi2Comm.h new file mode 100644 index 00000000000..0fff2a34b0e --- /dev/null +++ b/include/revolution/amc/AmcExi2Comm.h @@ -0,0 +1,123 @@ +#ifndef _REVOLUTION_AMC_AMCEXI2COMM_H_ +#define _REVOLUTION_AMC_AMCEXI2COMM_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum +{ + AMC_EXI_NO_ERROR = 0, + AMC_EXI_UNSELECTED, +} AmcExiError; + +// --------------------------------------------------------------------------- +// +// void EXI2_Init( volatile unsigned char **inputPendingPtrRef, +// EXICallback monitorCallback ); +// +// Description: Initialize the EXI2 driver (without interrupts). The +// parameter 'inputPendingPtrref' is a flag showing whether input +// is waiting in the EXI2 buffer and 'monitorCallback' is a +// pointer to a callback function that is invoked at the end of +// the EXI2 ISR. +// +// --------------------------------------------------------------------------- +void EXI2_Init(volatile unsigned char **inputPendingPtrRef, EXICallback monitorCallback); + +// --------------------------------------------------------------------------- +// +// void EXI2_EnableInterrupts( void ); +// +// Description: Enable EXI2 interrupts. This function must be called to use +// interrupts on the EXI2 interface. Call this function only +// after EXI2_Init() has been invoked. +// +// --------------------------------------------------------------------------- +void EXI2_EnableInterrupts( void ); + + + +// --------------------------------------------------------------------------- +// +// int EXI2_Poll( void ); +// +// Description: Returns the number of bytes waiting to be read in the EXI2 +// buffer. +// +// --------------------------------------------------------------------------- +int EXI2_Poll( void ); + + + +// --------------------------------------------------------------------------- +// +// AmcExiError EXI2_ReadN( void *bytes, unsigned long length ); +// +// Description: Read length bytes and return in bytes[] array. +// +// Returns: One of AMC_EXI_*. +// +// --------------------------------------------------------------------------- +AmcExiError EXI2_ReadN( void *bytes, unsigned long length); + + + +// --------------------------------------------------------------------------- +// +// AmcExiError EXI2_WriteN( const void *bytes, unsigned long length ); +// +// Description: Write length bytes stored in bytes[] array. +// +// Returns: One of AMC_EXI_*. +// +// --------------------------------------------------------------------------- +AmcExiError EXI2_WriteN( const void *bytes, unsigned long length); + + + +// --------------------------------------------------------------------------- +// +// void EXI2_Reserve( void ); +// +// Description: Disable non-monitor communications over the EXI2 port. +// This function must be called before the monitor takes +// control of the processor. +// +// --------------------------------------------------------------------------- +void EXI2_Reserve( void ); + + + +// --------------------------------------------------------------------------- +// +// void EXI2_Unreserve( void ); +// +// Description: Re-enable non-monitor communications over the EXI2 port. +// This function must be called just before the monitor +// gives control of the processor back to the application. +// +// --------------------------------------------------------------------------- +void EXI2_Unreserve( void ); + + + +// --------------------------------------------------------------------------- +// +// AmcExiError EXI2_GetStatusReg( u16* pu16StatusReg ); +// +// Description: Read and store the value of the status register into +// *pu16StatusReg. +// +// Returns: One of AMC_EXI_*. +// --------------------------------------------------------------------------- +AmcExiError EXI2_GetStatusReg( u16* pu16StatusReg ); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/amc/AmcTypes.h b/include/revolution/amc/AmcTypes.h new file mode 100644 index 00000000000..b9fa6ac9aec --- /dev/null +++ b/include/revolution/amc/AmcTypes.h @@ -0,0 +1,9 @@ +#ifndef _INCLUDE_REVOLUTION_AMCTYPES_H_ +#define _INCLUDE_REVOLUTION_AMCTYPES_H_ + +#include + +// EXI callback function pointer type +typedef void (*EXICallback)(s32 chan, OSContext* context); + +#endif diff --git a/include/revolution/ax.h b/include/revolution/ax.h new file mode 100644 index 00000000000..a1a85ddd870 --- /dev/null +++ b/include/revolution/ax.h @@ -0,0 +1,325 @@ +#ifndef _REVOLUTION_AX_H_ +#define _REVOLUTION_AX_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct _AXPBMIX { + /* 0x00 */ u16 vL; + /* 0x02 */ u16 vDeltaL; + /* 0x04 */ u16 vR; + /* 0x06 */ u16 vDeltaR; + /* 0x08 */ u16 vAuxAL; + /* 0x0A */ u16 vDeltaAuxAL; + /* 0x0C */ u16 vAuxAR; + /* 0x0E */ u16 vDeltaAuxAR; + /* 0x10 */ u16 vAuxBL; + /* 0x12 */ u16 vDeltaAuxBL; + /* 0x14 */ u16 vAuxBR; + /* 0x16 */ u16 vDeltaAuxBR; + /* 0x18 */ u16 vAuxBS; + /* 0x1A */ u16 vDeltaAuxBS; + /* 0x1C */ u16 vS; + /* 0x1E */ u16 vDeltaS; + /* 0x20 */ u16 vAuxAS; + /* 0x22 */ u16 vDeltaAuxAS; +} AXPBMIX; + +typedef struct _AXPBITD { + /* 0x00 */ u16 flag; + /* 0x02 */ u16 bufferHi; + /* 0x04 */ u16 bufferLo; + /* 0x06 */ u16 shiftL; + /* 0x08 */ u16 shiftR; + /* 0x0A */ u16 targetShiftL; + /* 0x0C */ u16 targetShiftR; +} AXPBITD; + +typedef struct _AXPBUPDATE { + /* 0x00 */ u16 updNum[5]; + /* 0x0A */ u16 dataHi; + /* 0x0C */ u16 dataLo; +} AXPBUPDATE; + +typedef struct _AXPBDPOP { + /* 0x00 */ s16 aL; + /* 0x02 */ s16 aAuxAL; + /* 0x04 */ s16 aAuxBL; + /* 0x06 */ s16 aR; + /* 0x08 */ s16 aAuxAR; + /* 0x0A */ s16 aAuxBR; + /* 0x0C */ s16 aS; + /* 0x0E */ s16 aAuxAS; + /* 0x10 */ s16 aAuxBS; +} AXPBDPOP; + +typedef struct _AXPBVE { + /* 0x00 */ u16 currentVolume; + /* 0x02 */ s16 currentDelta; +} AXPBVE; + +typedef struct _AXPBFIR { + /* 0x00 */ u16 numCoefs; + /* 0x02 */ u16 coefsHi; + /* 0x04 */ u16 coefsLo; +} AXPBFIR; + +typedef struct _AXPBADDR { + /* 0x00 */ u16 loopFlag; + /* 0x02 */ u16 format; + /* 0x04 */ u16 loopAddressHi; + /* 0x06 */ u16 loopAddressLo; + /* 0x08 */ u16 endAddressHi; + /* 0x0A */ u16 endAddressLo; + /* 0x0C */ u16 currentAddressHi; + /* 0x0E */ u16 currentAddressLo; +} AXPBADDR; + +typedef struct _AXPBADPCM { + /* 0x00 */ u16 a[8][2]; + /* 0x20 */ u16 gain; + /* 0x22 */ u16 pred_scale; + /* 0x24 */ u16 yn1; + /* 0x26 */ u16 yn2; +} AXPBADPCM; + +typedef struct _AXPBSRC { + /* 0x00 */ u16 ratioHi; + /* 0x02 */ u16 ratioLo; + /* 0x04 */ u16 currentAddressFrac; + /* 0x06 */ u16 last_samples[4]; +} AXPBSRC; + +typedef struct _AXPBADPCMLOOP { + /* 0x00 */ u16 loop_pred_scale; + /* 0x02 */ u16 loop_yn1; + /* 0x04 */ u16 loop_yn2; +} AXPBADPCMLOOP; + +typedef struct _AXPBLPF { + u16 on; + u16 yn1; + u16 a0; + u16 b0; +} AXPBLPF; + +typedef struct _AXPB { + /* 0x00 */ u16 nextHi; + /* 0x02 */ u16 nextLo; + /* 0x04 */ u16 currHi; + /* 0x06 */ u16 currLo; + /* 0x08 */ u16 srcSelect; + /* 0x0A */ u16 coefSelect; + /* 0x0C */ u16 mixerCtrl; + /* 0x0E */ u16 state; + /* 0x10 */ u16 type; + /* 0x12 */ AXPBMIX mix; + /* 0x36 */ AXPBITD itd; + /* 0x44 */ AXPBUPDATE update; + /* 0x52 */ AXPBDPOP dpop; + /* 0x64 */ AXPBVE ve; + /* 0x68 */ AXPBFIR fir; + /* 0x6E */ AXPBADDR addr; + /* 0x7E */ AXPBADPCM adpcm; + /* 0xA6 */ AXPBSRC src; + /* 0xB4 */ AXPBADPCMLOOP adpcmLoop; + /* 0xBA */ AXPBLPF lpf; + /* 0xC2 */ u16 pad[25]; +} AXPB; + +typedef struct _AXVPB { + /* 0x000 */ void* next; + /* 0x004 */ void* prev; + /* 0x008 */ void* next1; + /* 0x00C */ u32 priority; + /* 0x010 */ void (*callback)(void*); + /* 0x014 */ u32 userContext; + /* 0x018 */ u32 index; + /* 0x01C */ u32 sync; + /* 0x020 */ u32 depop; + /* 0x024 */ u32 updateMS; + /* 0x028 */ u32 updateCounter; + /* 0x02C */ u32 updateTotal; + /* 0x030 */ u16* updateWrite; + /* 0x034 */ u16 updateData[128]; + /* 0x134 */ void* itdBuffer; + /* 0x138 */ AXPB pb; +} AXVPB; + +typedef struct _AXPBITDBUFFER { + /* 0x00 */ s16 data[32]; +} AXPBITDBUFFER; + +typedef struct _AXPBU { + /* 0x00 */ u16 data[128]; +} AXPBU; + +typedef struct _AXSPB { + /* 0x00 */ u16 dpopLHi; + /* 0x02 */ u16 dpopLLo; + /* 0x04 */ s16 dpopLDelta; + /* 0x06 */ u16 dpopRHi; + /* 0x08 */ u16 dpopRLo; + /* 0x0A */ s16 dpopRDelta; + /* 0x0C */ u16 dpopSHi; + /* 0x0E */ u16 dpopSLo; + /* 0x10 */ s16 dpopSDelta; + /* 0x12 */ u16 dpopALHi; + /* 0x14 */ u16 dpopALLo; + /* 0x16 */ s16 dpopALDelta; + /* 0x18 */ u16 dpopARHi; + /* 0x1A */ u16 dpopARLo; + /* 0x1C */ s16 dpopARDelta; + /* 0x1E */ u16 dpopASHi; + /* 0x20 */ u16 dpopASLo; + /* 0x22 */ s16 dpopASDelta; + /* 0x24 */ u16 dpopBLHi; + /* 0x26 */ u16 dpopBLLo; + /* 0x28 */ s16 dpopBLDelta; + /* 0x2A */ u16 dpopBRHi; + /* 0x2C */ u16 dpopBRLo; + /* 0x2E */ s16 dpopBRDelta; + /* 0x30 */ u16 dpopBSHi; + /* 0x32 */ u16 dpopBSLo; + /* 0x34 */ s16 dpopBSDelta; +} AXSPB; + +typedef struct _AXPROFILE { + /* 0x00 */ u64 axFrameStart; + /* 0x08 */ u64 auxProcessingStart; + /* 0x10 */ u64 auxProcessingEnd; + /* 0x18 */ u64 userCallbackStart; + /* 0x20 */ u64 userCallbackEnd; + /* 0x28 */ u64 axFrameEnd; + /* 0x30 */ u32 axNumVoices; +} AXPROFILE; + +typedef struct AX_AUX_DATA { + /* 0x00 */ s32* l; + /* 0x00 */ s32* r; + /* 0x00 */ s32* s; +} AX_AUX_DATA; + +typedef struct AX_AUX_DATA_DPL2 { + /* 0x00 */ s32* l; + /* 0x00 */ s32* r; + /* 0x00 */ s32* ls; + /* 0x00 */ s32* rs; +} AX_AUX_DATA_DPL2; + +typedef void (*AXCallback)(); + +#define AX_DSP_SLAVE_LENGTH 0xF80 +#define AX_MAX_VOICES 64 + +#define AX_SRC_TYPE_NONE 0 +#define AX_SRC_TYPE_LINEAR 1 +#define AX_SRC_TYPE_4TAP_8K 2 +#define AX_SRC_TYPE_4TAP_12K 3 +#define AX_SRC_TYPE_4TAP_16K 4 + +// sync flags +#define AX_SYNC_FLAG_COPYALL (1 << 31) +#define AX_SYNC_FLAG_UNK1 (1 << 30) // reserved, unused? +#define AX_SYNC_FLAG_UNK2 (1 << 29) // reserved, unused? +#define AX_SYNC_FLAG_UNK3 (1 << 28) // reserved, unused? +#define AX_SYNC_FLAG_UNK4 (1 << 27) // reserved, unused? +#define AX_SYNC_FLAG_UNK5 (1 << 26) // reserved, unused? +#define AX_SYNC_FLAG_UNK6 (1 << 25) // reserved, unused? +#define AX_SYNC_FLAG_UNK7 (1 << 24) // reserved, unused? +#define AX_SYNC_FLAG_UNK8 (1 << 23) // reserved, unused? +#define AX_SYNC_FLAG_UNK9 (1 << 22) // reserved, unused? +#define AX_SYNC_FLAG_UNK10 (1 << 21) // reserved, unused? +#define AX_SYNC_FLAG_COPYADPCMLOOP (1 << 20) +#define AX_SYNC_FLAG_COPYRATIO (1 << 19) +#define AX_SYNC_FLAG_COPYSRC (1 << 18) +#define AX_SYNC_FLAG_COPYADPCM (1 << 17) +#define AX_SYNC_FLAG_COPYCURADDR (1 << 16) +#define AX_SYNC_FLAG_COPYENDADDR (1 << 15) +#define AX_SYNC_FLAG_COPYLOOPADDR (1 << 14) +#define AX_SYNC_FLAG_COPYLOOP (1 << 13) +#define AX_SYNC_FLAG_COPYADDR (1 << 12) +#define AX_SYNC_FLAG_COPYFIR (1 << 11) +#define AX_SYNC_FLAG_SWAPVOL (1 << 10) +#define AX_SYNC_FLAG_COPYVOL (1 << 9) +#define AX_SYNC_FLAG_COPYDPOP (1 << 8) +#define AX_SYNC_FLAG_COPYUPDATE (1 << 7) +#define AX_SYNC_FLAG_COPYTSHIFT (1 << 6) +#define AX_SYNC_FLAG_COPYITD (1 << 5) +#define AX_SYNC_FLAG_COPYAXPBMIX (1 << 4) +#define AX_SYNC_FLAG_COPYTYPE (1 << 3) +#define AX_SYNC_FLAG_COPYSTATE (1 << 2) +#define AX_SYNC_FLAG_COPYMXRCTRL (1 << 1) +#define AX_SYNC_FLAG_COPYSELECT (1 << 0) + +#define AX_PRIORITY_STACKS 32 + +// AX +void AXInit(void); +void AXInitEx(u32 outputBufferMode); +void AXQuit(void); + +// AXAlloc +void AXFreeVoice(AXVPB* p); +AXVPB* AXAcquireVoice(u32 priority, void (*callback)(void *), u32 userContext); +void AXSetVoicePriority(AXVPB* p, u32 priority); + +// AXAux +void AXRegisterAuxACallback(void (*callback)(void*, void*), void* context); +void AXRegisterAuxBCallback(void (*callback)(void*, void*), void* context); + +// AXCL +void AXSetMode(u32 mode); +u32 AXGetMode(void); + +// AXOut +extern AXPROFILE __AXLocalProfile; + +void AXSetStepMode(u32 i); +AXCallback AXRegisterCallback(AXCallback callback); + +// AXProf +void AXInitProfile(AXPROFILE* profile, u32 maxProfiles); +u32 AXGetProfile(void); + +// AXVPB +void AXSetVoiceSrcType(AXVPB* p, u32 type); +void AXSetVoiceState(AXVPB* p, u16 state); +void AXSetVoiceType(AXVPB* p, u16 type); +void AXSetVoiceMix(AXVPB* p, AXPBMIX* mix); +void AXSetVoiceItdOn(AXVPB* p); +void AXSetVoiceItdTarget(AXVPB* p, u16 lShift, u16 rShift); +void AXSetVoiceUpdateIncrement(AXVPB* p); +void AXSetVoiceUpdateWrite(AXVPB* p, u16 param, u16 data); +void AXSetVoiceDpop(AXVPB* p, AXPBDPOP* dpop); +void AXSetVoiceVe(AXVPB* p, AXPBVE* ve); +void AXSetVoiceVeDelta(AXVPB* p, s16 delta); +void AXSetVoiceFir(AXVPB* p, AXPBFIR* fir); +void AXSetVoiceAddr(AXVPB* p, AXPBADDR* addr); +void AXSetVoiceLoop(AXVPB* p, u16 loop); +void AXSetVoiceLoopAddr(AXVPB* p, u32 addr); +void AXSetVoiceEndAddr(AXVPB* p, u32 addr); +void AXSetVoiceCurrentAddr(AXVPB* p, u32 addr); +void AXSetVoiceAdpcm(AXVPB* p, AXPBADPCM* adpcm); +void AXSetVoiceSrc(AXVPB* p, AXPBSRC* src_); +void AXSetVoiceSrcRatio(AXVPB* p, f32 ratio); +void AXSetVoiceAdpcmLoop(AXVPB* p, AXPBADPCMLOOP* adpcmloop); +void AXSetMaxDspCycles(u32 cycles); +u32 AXGetMaxDspCycles(void); +u32 AXGetDspCycles(void); +void AXSetVoiceLpf(AXVPB* p, AXPBLPF* lpf); +void AXSetVoiceLpfCoefs(AXVPB* p, u16 a0, u16 b0); +void AXGetLpfCoefs(u16 freq, u16* a0, u16* b0); + +// DSPCode +extern u16 axDspSlaveLength; +extern u16 axDspSlave[AX_DSP_SLAVE_LENGTH]; + +#ifdef __cplusplus +} +#endif + +#endif // _REVOLUTION_AX_H_ diff --git a/include/revolution/axart.h b/include/revolution/axart.h new file mode 100644 index 00000000000..1ef2ca1dcc7 --- /dev/null +++ b/include/revolution/axart.h @@ -0,0 +1,224 @@ +#ifndef _REVOLUTION_AXART_H_ +#define _REVOLUTION_AXART_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +enum __axart_type { + AXART_TYPE_NONE, + AXART_TYPE_3D, + AXART_TYPE_PANNING, + AXART_TYPE_ITD, + AXART_TYPE_SRC, + AXART_TYPE_PITCH, + AXART_TYPE_PITCH_ENV, + AXART_TYPE_PITCH_MOD, + AXART_TYPE_VOLUME, + AXART_TYPE_AUX_A_VOLUME, + AXART_TYPE_AUX_B_VOLUME, + AXART_TYPE_VOLUME_ENV, + AXART_TYPE_AUX_A_VOLUME_ENV, + AXART_TYPE_AUX_B_VOLUME_ENV, + AXART_TYPE_VOLUME_MOD, + AXART_TYPE_AUX_A_VOLUME_MOD, + AXART_TYPE_AUX_B_VOLUME_MOD, + AXART_TYPE_LPF, + + AXART_TYPE_NUM +}; + +typedef struct { + void* next; + u32 type; +} AXART_ART; + +typedef struct { + f32* lfo; + u32 length; + f32 delta; + u32 sampleIndex; + f32 counter; + f32 sample1; + f32 sample; + f32 output; +} AXART_LFO; + +typedef struct { + AXART_ART art; + f32 hAngle; + f32 vAngle; + f32 dist; + f32 closingSpeed; + u32 update; + u8 pan; + u8 span; + u8 src; + u16 itdL; + u16 itdR; + f32 pitch; + s32 attenuation; +} AXART_3D; + +typedef struct { + AXART_ART art; + u8 pan; + u8 span; +} AXART_PANNING; + +typedef struct { + AXART_ART art; + u16 itdL; + u16 itdR; +} AXART_ITD; + +typedef struct { + AXART_ART art; + u8 src; +} AXART_SRC; + +typedef struct { + AXART_ART art; + s32 cents; +} AXART_PITCH; + +typedef struct { + AXART_ART art; + s32 delta; + s32 target; + s32 cents; +} AXART_PITCH_ENV; + +typedef struct { + AXART_ART art; + AXART_LFO lfo; + s32 cents; +} AXART_PITCH_MOD; + +typedef struct { + AXART_ART art; + s32 attenuation; +} AXART_VOLUME; + +typedef struct { + AXART_ART art; + s32 attenuation; +} AXART_AUXA_VOLUME; + +typedef struct { + AXART_ART art; + s32 attenuation; +} AXART_AUXB_VOLUME; + +typedef struct { + AXART_ART art; + s32 delta; + s32 target; + s32 attenuation; +} AXART_VOLUME_ENV; + +typedef struct { + AXART_ART art; + s32 delta; + s32 target; + s32 attenuation; +} AXART_AUXA_VOLUME_ENV; + +typedef struct { + AXART_ART art; + s32 delta; + s32 target; + s32 attenuation; +} AXART_AUXB_VOLUME_ENV; + +typedef struct { + AXART_ART art; + AXART_LFO lfo; + s32 attenuation; +} AXART_VOLUME_MOD; + +typedef struct { + AXART_ART art; + AXART_LFO lfo; + s32 attenuation; +} AXART_AUXA_VOLUME_MOD; + +typedef struct { + AXART_ART art; + AXART_LFO lfo; + s32 attenuation; +} AXART_AUXB_VOLUME_MOD; + +typedef struct { + AXART_ART art; + u32 initLPF; + u32 frequency; + u32 update; +} AXART_LPF; + +typedef struct { + void* next; + void* prev; + AXVPB* axvpb; + f32 sampleRate; + AXART_ART* articulators; +} AXART_SOUND; + +#define AXART_SINE_CNT 64 +extern f32 AXARTSine[AXART_SINE_CNT]; + +// axart +void AXARTInit(void); +void AXARTQuit(void); +void AXARTServiceSounds(void); +void AXARTAddSound(AXART_SOUND* sound); +void AXARTRemoveSound(AXART_SOUND* sound); +void AXARTInitLfo(AXART_LFO* lfo, f32* samples, u32 length, f32 delta); +void AXARTInitArt3D(AXART_3D* articulator); +void AXARTInitArtPanning(AXART_PANNING* articulator); +void AXARTInitArtItd(AXART_ITD* articulator); +void AXARTInitArtSrctype(AXART_SRC* articulator); +void AXARTInitArtPitch(AXART_PITCH* articulator); +void AXARTInitArtPitchEnv(AXART_PITCH_ENV* articulator); +void AXARTInitArtPitchMod(AXART_PITCH_MOD* articulator); +void AXARTInitArtVolume(AXART_VOLUME* articulator); +void AXARTInitArtAuxAVolume(AXART_AUXA_VOLUME* articulator); +void AXARTInitArtAuxBVolume(AXART_AUXB_VOLUME* articulator); +void AXARTInitArtVolumeEnv(AXART_VOLUME_ENV* articulator); +void AXARTInitArtAuxAVolumeEnv(AXART_AUXA_VOLUME_ENV* articulator); +void AXARTInitArtAuxBVolumeEnv(AXART_AUXB_VOLUME_ENV* articulator); +void AXARTInitArtVolumeMod(AXART_VOLUME_MOD* articulator); +void AXARTInitArtAuxAVolumeMod(AXART_AUXA_VOLUME_MOD* articulator); +void AXARTInitArtAuxBVolumeMod(AXART_AUXB_VOLUME_MOD* articulator); +void AXARTInitArtLpf(AXART_LPF* articulator); + +// axart3d +void AXARTSet3DDistanceScale(f32 scale); +void AXARTSet3DDopplerScale(f32 scale); +void AXART3DSound(AXART_3D* articulator); + +// axartcents +f32 AXARTCents(s32 cents); + +// axartenv +void AXARTPitchEnv(AXART_PITCH_ENV* articulator); +void AXARTVolumeEnv(AXART_VOLUME_ENV* articulator); + +// axartlfo +void AXARTLfo(AXART_LFO* lfo); + +// axartsound +void AXARTServiceSound(AXART_SOUND* sound); +void AXARTAddArticulator(AXART_SOUND* sound, AXART_ART* articulator); + +// axartlpf +void AXARTLpf(AXART_LPF*, AXVPB*); + +#ifdef __cplusplus +} +#endif + +#endif // _REVOLUTION_AXART_H_ diff --git a/include/revolution/axfx.h b/include/revolution/axfx.h new file mode 100644 index 00000000000..259e73e7b54 --- /dev/null +++ b/include/revolution/axfx.h @@ -0,0 +1,196 @@ +#ifndef _REVOLUTION_AXFX_H_ +#define _REVOLUTION_AXFX_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct AXFX_REVSTD_DELAYLINE { + /* 0x00 */ s32 inPoint; + /* 0x04 */ s32 outPoint; + /* 0x08 */ s32 length; + /* 0x0C */ f32* inputs; + /* 0x10 */ f32 lastOutput; +} AXFX_REVSTD_DELAYLINE; + +typedef struct AXFX_REVSTD_WORK { + /* 0x000 */ AXFX_REVSTD_DELAYLINE AP[6]; + /* 0x078 */ AXFX_REVSTD_DELAYLINE C[6]; + /* 0x0F0 */ f32 allPassCoeff; + /* 0x0F4 */ f32 combCoef[6]; + /* 0x10C */ f32 lpLastout[3]; + /* 0x118 */ f32 level; + /* 0x11C */ f32 damping; + /* 0x120 */ s32 preDelayTime; + /* 0x124 */ f32* preDelayLine[3]; + /* 0x130 */ f32* preDelayPtr[3]; +} AXFX_REVSTD_WORK; + +typedef struct AXFX_REVERBSTD { + /* 0x000 */ AXFX_REVSTD_WORK rv; + /* 0x13C */ u8 tempDisableFX; + /* 0x140 */ f32 coloration; + /* 0x144 */ f32 mix; + /* 0x148 */ f32 time; + /* 0x14C */ f32 damping; + /* 0x150 */ f32 preDelay; +} AXFX_REVERBSTD; + +typedef struct AXFX_BUFFERUPDATE { + /* 0x00 */ s32* left; + /* 0x04 */ s32* right; + /* 0x08 */ s32* surround; +} AXFX_BUFFERUPDATE; + +typedef struct AXFX_BUFFERUPDATE_DPL2 { + /* 0x00 */ s32* L; + /* 0x04 */ s32* R; + /* 0x08 */ s32* Ls; + /* 0x0C */ s32* Rs; +} AXFX_BUFFERUPDATE_DPL2; + +// REVHI Structs + +typedef struct AXFX_REVHI_DELAYLINE { + /* 0x00 */ s32 inPoint; + /* 0x04 */ s32 outPoint; + /* 0x08 */ s32 length; + /* 0x0C */ f32* inputs; + /* 0x10 */ f32 lastOutput; +} AXFX_REVHI_DELAYLINE; + +typedef struct AXFX_REVHI_WORK { + /* 0x000 */ AXFX_REVHI_DELAYLINE AP[9]; + /* 0x0B4 */ AXFX_REVHI_DELAYLINE C[9]; + /* 0x168 */ f32 allPassCoeff; + /* 0x16C */ f32 combCoef[9]; + /* 0x190 */ f32 lpLastout[3]; + /* 0x19C */ f32 level; + /* 0x1A0 */ f32 damping; + /* 0x1A4 */ s32 preDelayTime; + /* 0x1A8 */ f32 crosstalk; + /* 0x1AC */ f32* preDelayLine[3]; + /* 0x1B8 */ f32* preDelayPtr[3]; +} AXFX_REVHI_WORK; + +typedef struct AXFX_REVHI_WORK_DPL2 { + /* 0x000 */ AXFX_REVHI_DELAYLINE AP[12]; + /* 0x0F0 */ AXFX_REVHI_DELAYLINE C[12]; + /* 0x1E0 */ f32 allPassCoeff; + /* 0x1E4 */ f32 combCoef[12]; + /* 0x214 */ f32 lpLastout[4]; + /* 0x224 */ f32 level; + /* 0x228 */ f32 damping; + /* 0x22C */ s32 preDelayTime; + /* 0x230 */ f32 crosstalk; + /* 0x234 */ f32* preDelayLine[4]; + /* 0x244 */ f32* preDelayPtr[4]; +} AXFX_REVHI_WORK_DPL2; + +typedef struct AXFX_REVERBHI { + /* 0x000 */ AXFX_REVHI_WORK rv; + /* 0x1C4 */ u8 tempDisableFX; + /* 0x1C8 */ f32 coloration; + /* 0x1CC */ f32 mix; + /* 0x1D0 */ f32 time; + /* 0x1D4 */ f32 damping; + /* 0x1D8 */ f32 preDelay; + /* 0x1DC */ f32 crosstalk; +} AXFX_REVERBHI; + +typedef struct AXFX_REVERBHI_DPL2 { + /* 0x000 */ AXFX_REVHI_WORK_DPL2 rv; + /* 0x254 */ u8 tempDisableFX; + /* 0x258 */ f32 coloration; + /* 0x25C */ f32 mix; + /* 0x260 */ f32 time; + /* 0x264 */ f32 damping; + /* 0x268 */ f32 preDelay; +} AXFX_REVERBHI_DPL2; + +typedef struct AXFX_DELAY { + /* 0x00 */ u32 currentSize[3]; + /* 0x0C */ u32 currentPos[3]; + /* 0x18 */ u32 currentFeedback[3]; + /* 0x24 */ u32 currentOutput[3]; + /* 0x30 */ s32* left; + /* 0x34 */ s32* right; + /* 0x38 */ s32* sur; + /* 0x3C */ u32 delay[3]; + /* 0x48 */ u32 feedback[3]; + /* 0x54 */ u32 output[3]; +} AXFX_DELAY; + +typedef struct AXFX_CHORUS_SRCINFO { + /* 0x00 */ s32* dest; + /* 0x04 */ s32* smpBase; + /* 0x08 */ s32* old; + /* 0x0C */ u32 posLo; + /* 0x10 */ u32 posHi; + /* 0x14 */ u32 pitchLo; + /* 0x18 */ u32 pitchHi; + /* 0x1C */ u32 trigger; + /* 0x20 */ u32 target; +} AXFX_CHORUS_SRCINFO; + +typedef struct AXFX_CHORUS_WORK { + /* 0x00 */ s32* lastLeft[3]; + /* 0x0C */ s32* lastRight[3]; + /* 0x18 */ s32* lastSur[3]; + /* 0x24 */ u8 currentLast; + /* 0x28 */ s32 oldLeft[4]; + /* 0x38 */ s32 oldRight[4]; + /* 0x48 */ s32 oldSur[4]; + /* 0x58 */ u32 currentPosLo; + /* 0x5C */ u32 currentPosHi; + /* 0x60 */ s32 pitchOffset; + /* 0x64 */ u32 pitchOffsetPeriodCount; + /* 0x68 */ u32 pitchOffsetPeriod; + /* 0x6C */ AXFX_CHORUS_SRCINFO src; +} AXFX_CHORUS_WORK; + +typedef struct AXFX_CHORUS { + /* 0x00 */ AXFX_CHORUS_WORK work; + /* 0x90 */ u32 baseDelay; + /* 0x94 */ u32 variation; + /* 0x98 */ u32 period; +} AXFX_CHORUS; + +// chorus +int AXFXChorusInit(AXFX_CHORUS* c); +int AXFXChorusShutdown(AXFX_CHORUS* c); +int AXFXChorusSettings(AXFX_CHORUS* c); +void AXFXChorusCallback(AXFX_BUFFERUPDATE* bufferUpdate, AXFX_CHORUS* chorus); + +// delay +void AXFXDelayCallback(AXFX_BUFFERUPDATE* bufferUpdate, AXFX_DELAY* delay); +int AXFXDelaySettings(AXFX_DELAY* delay); +int AXFXDelayInit(AXFX_DELAY* delay); +int AXFXDelayShutdown(AXFX_DELAY* delay); + +// reverb_hi +void DoCrossTalk(s32* l, s32* r, f32 cross, f32 invcross); +int AXFXReverbHiInit(AXFX_REVERBHI* rev); +int AXFXReverbHiShutdown(AXFX_REVERBHI* rev); +int AXFXReverbHiSettings(AXFX_REVERBHI* rev); +void AXFXReverbHiCallback(AXFX_BUFFERUPDATE* bufferUpdate, AXFX_REVERBHI* reverb); + +// reverb_hi_4ch +int AXFXReverbHiInitDpl2(AXFX_REVERBHI_DPL2* reverb); +int AXFXReverbHiShutdownDpl2(AXFX_REVERBHI_DPL2* reverb); +int AXFXReverbHiSettingsDpl2(AXFX_REVERBHI_DPL2* rev); +void AXFXReverbHiCallbackDpl2(AXFX_BUFFERUPDATE_DPL2* bufferUpdate, AXFX_REVERBHI_DPL2* reverb); + +// reverb_std +int AXFXReverbStdInit(AXFX_REVERBSTD* rev); +int AXFXReverbStdShutdown(AXFX_REVERBSTD* rev); +int AXFXReverbStdSettings(AXFX_REVERBSTD* rev); +void AXFXReverbStdCallback(AXFX_BUFFERUPDATE* bufferUpdate, AXFX_REVERBSTD* reverb); + +#ifdef __cplusplus +} +#endif + +#endif // _REVOLUTION_AXFX_H_ diff --git a/include/revolution/base/PPCArch.h b/include/revolution/base/PPCArch.h new file mode 100644 index 00000000000..65afa279955 --- /dev/null +++ b/include/revolution/base/PPCArch.h @@ -0,0 +1,542 @@ +#ifndef _REVOLUTION_PPCARCH +#define _REVOLUTION_PPCARCH + +#include "dolphin/types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define CTR 9 +#define XER 1 +#define LR 8 + +#define UPMC1 937 +#define UPMC2 938 +#define UPMC3 941 +#define UPMC4 942 + +#define USIA 939 + +#define UMMCR0 936 +#define UMMCR1 940 + +#define HID0 1008 +#define HID1 1009 + +#define PVR 287 + +#define IBAT0U 528 +#define IBAT0L 529 +#define IBAT1U 530 +#define IBAT1L 531 +#define IBAT2U 532 +#define IBAT2L 533 +#define IBAT3U 534 +#define IBAT3L 535 + +#define DBAT0U 536 +#define DBAT0L 537 +#define DBAT1U 538 +#define DBAT1L 539 +#define DBAT2U 540 +#define DBAT2L 541 +#define DBAT3U 542 +#define DBAT3L 543 + +#define SDR1 25 + +#define SPRG0 272 +#define SPRG1 273 +#define SPRG2 274 +#define SPRG3 275 + +#define DAR 19 +#define DSISR 18 + +#define SRR0 26 +#define SRR1 27 + +#define EAR 282 + +#define DABR 1013 + +#define TBL 284 +#define TBU 285 + +#define L2CR 1017 + +#define DEC 22 + +#define IABR 1010 + +#define PMC1 953 +#define PMC2 954 +#define PMC3 957 +#define PMC4 958 + +#define SIA 955 + +#define MMCR0 952 +#define MMCR1 956 + +#define THRM1 1020 +#define THRM2 1021 +#define THRM3 1022 + +#define ICTC 1019 + +#define GQR0 912 +#define GQR1 913 +#define GQR2 914 +#define GQR3 915 +#define GQR4 916 +#define GQR5 917 +#define GQR6 918 +#define GQR7 919 + +#define HID2 920 + +#define WPAR 921 + +#define DMA_U 922 +#define DMA_L 923 + +#define MSR_POW 0x00040000 // Power Management +#define MSR_ILE 0x00010000 // Interrupt Little Endian +#define MSR_EE 0x00008000 // external interrupt +#define MSR_PR 0x00004000 // privilege level(should be 0) +#define MSR_FP 0x00002000 // floating point available +#define MSR_ME 0x00001000 // machine check enable +#define MSR_FE0 0x00000800 // floating point exception enable +#define MSR_SE 0x00000400 // single step trace enable +#define MSR_BE 0x00000200 // branch trace enable +#define MSR_FE1 0x00000100 // floating point exception enable +#define MSR_IP 0x00000040 // Exception prefix +#define MSR_IR 0x00000020 // instruction relocate +#define MSR_DR 0x00000010 // data relocate +#define MSR_PM 0x00000004 // Performance monitor marked mode +#define MSR_RI 0x00000002 // Recoverable interrupt +#define MSR_LE 0x00000001 // Little Endian + +#define MSR_POW_BIT 13 // Power Management +#define MSR_ILE_BIT 15 // Interrupt Little Endian +#define MSR_EE_BIT 16 // external interrupt +#define MSR_PR_BIT 17 // privilege level (should be 0) +#define MSR_FP_BIT 18 // floating point available +#define MSR_ME_BIT 19 // machine check enable +#define MSR_FE0_BIT 20 // floating point exception enable +#define MSR_SE_BIT 21 // single step trace enable +#define MSR_BE_BIT 22 // branch trace enable +#define MSR_FE1_BIT 23 // floating point exception enable +#define MSR_IP_BIT 25 // Exception prefix +#define MSR_IR_BIT 26 // instruction relocate +#define MSR_DR_BIT 27 // data relocate +#define MSR_PM_BIT 29 // Performance monitor marked mode +#define MSR_RI_BIT 30 // Recoverable interrupt +#define MSR_LE_BIT 31 // Little Endian + +/*---------------------------------------------------------------------------* + HID0 bits + *---------------------------------------------------------------------------*/ +#define HID0_EMCP 0x80000000u // Enable MCP +#define HID0_DBP 0x40000000u // Enable 60x bus address and data parity chk +#define HID0_EBA 0x20000000u // Enable 60x address parity checking +#define HID0_EBD 0x10000000u // Enable 60x data parity checking +#define HID0_BCLK 0x08000000u // CLK_OUT output enable and clk selection +#define HID0_ECLK 0x02000000u // CLK_OUT output enable and clk selection +#define HID0_PAR 0x01000000u // Disable !ARTRY precharge +#define HID0_DOZE 0x00800000u // Doze mode enable +#define HID0_NAP 0x00400000u // Nap mode enable +#define HID0_SLEEP 0x00200000u // Sleep mode enable +#define HID0_DPM 0x00100000u // Dynamic power management enable +#define HID0_NHR 0x00010000u // Not hard reset (0 hard reset if s/w set it) +#define HID0_ICE 0x00008000u // Instruction cache enable +#define HID0_DCE 0x00004000u // Data cache enable +#define HID0_ILOCK 0x00002000u // ICache lock +#define HID0_DLOCK 0x00001000u // DCache lock +#define HID0_ICFI 0x00000800u // ICache flash invalidate +#define HID0_DCFI 0x00000400u // DCache flash invalidate +#define HID0_SPD 0x00000200u // Speculative cache access enable (0 enable) +#define HID0_IFEM 0x00000100u // Enable M bit on bus for Ifetch +#define HID0_SGE 0x00000080u // Store gathering enable +#define HID0_DCFA 0x00000040u // DCache flush assist - set before a flush +#define HID0_BTIC 0x00000020u // Branch target icache enable +#define HID0_ABE 0x00000008u // Address bcast enable +#define HID0_BHT 0x00000004u // Branch history table enable +#define HID0_NOOPTI 0x00000001u // No-op Dcache touch instructions + +#define HID0_ICE_BIT 16 // Instruction cache enable +#define HID0_DCE_BIT 17 // Data cache enable +#define HID0_ILOCK_BIT 18 // ICache lock +#define HID0_DLOCK_BIT 19 // DCache lock + +#define HID2_LSQE 0x80000000 // L/S quantize enable +#define HID2_WPE 0x40000000 // Write pipe enable +#define HID2_PSE 0x20000000 // Paired single enable +#define HID2_LCE 0x10000000 // Locked cache enable + +#define HID2_DCHERR 0x00800000 // ERROR: dcbz_l cache hit +#define HID2_DNCERR 0x00400000 // ERROR: DMA access to normal cache +#define HID2_DCMERR 0x00200000 // ERROR: DMA cache miss error +#define HID2_DQOERR 0x00100000 // ERROR: DMA queue overflow +#define HID2_DCHEE 0x00080000 // dcbz_l cache hit error enable +#define HID2_DNCEE 0x00040000 // DMA access to normal cache error enable +#define HID2_DCMEE 0x00020000 // DMA cache miss error error enable +#define HID2_DQOEE 0x00010000 // DMA queue overflow error enable + +#define HID2_DMAQL_MASK 0x0F000000 // DMA queue length mask +#define HID2_DMAQL_SHIFT 24 // DMA queue shift + +#define HID2_LSQE_BIT 0 +#define HID2_WPE_BIT 1 +#define HID2_PSE_BIT 2 +#define HID2_LCE_BIT 3 + +#define HID2_DCHERR_BIT 8 +#define HID2_DNCERR_BIT 9 +#define HID2_DCMERR_BIT 10 +#define HID2_DQOERR_BIT 11 +#define HID2_DCHEE_BIT 12 +#define HID2_DNCEE_BIT 13 +#define HID2_DCMEE_BIT 14 +#define HID2_DQOEE_BIT 15 + +#define GQR_LOAD_SCALE_MASK 0x3F000000 // load scale field +#define GQR_LOAD_TYPE_MASK 0x00070000 // load type field +#define GQR_STORE_SCALE_MASK 0x00003F00 // store scale field +#define GQR_STORE_TYPE_MASK 0x00000007 // store type field + +typedef struct +{ + u32 _pad0 :2; + u32 loadScale :6; + u32 _pad1 :5; + u32 loadType :3; + u32 _pad2 :2; + u32 storeScale :6; + u32 _pad3 :5; + u32 storeType :3; +} PPC_GQR_t; + +typedef union +{ + u32 val; + PPC_GQR_t f; +} PPC_GQR_u; + + +#define DMA_U_ADDR_MASK 0xFFFFFFE0 // Start addr in memory +#define DMA_U_LEN_U_MASK 0x0000001F // lines to transfer (U) + +#define DMA_L_LC_ADDR_MASK 0xFFFFFFE0 // Start addr in LC +#define DMA_L_LOAD 0x00000010 // 0 - store, 1 - load +#define DMA_L_STORE 0x00000000 // 0 - store, 1 - load +#define DMA_L_LEN_MASK 0x0000000C // lines to transfer (L) +#define DMA_L_TRIGGER 0x00000002 // 0 - cmd inactive, 1 - cmd rdy +#define DMA_L_FLUSH 0x00000001 // 1 - Flush DMA queue + +typedef struct +{ + u32 memAddr :27; + u32 dmaLenU :5; +} PPC_DMA_U_t; + +typedef union +{ + u32 val; + PPC_DMA_U_t f; +} PPC_DMA_U_u; + + +typedef struct +{ + u32 lcAddr :27; + u32 dmaLd :1; + u32 dmaLenL :2; + u32 dmaTrigger :1; + u32 dmaFlush :1; +} PPC_DMA_L_t; + + +typedef union +{ + u32 val; + PPC_DMA_L_t f; +} PPC_DMA_L_u; + + +#define WPAR_ADDR 0xFFFFFFE0 // 32byte gather address +#define WPAR_BNE 0x00000001 // Buffer not empty (R) + +#define SRR1_DMA_BIT 0x00200000 +#define SRR1_L2DP_BIT 0x00100000 + +#define L2CR_L2E 0x80000000 // L2 Enable +#define L2CR_L2PE 0x40000000 // L2 data parity generation and checking enable + +#define L2CR_L2SIZ_256K 0x10000000 // L2 size 256K +#define L2CR_L2SIZ_512K 0x20000000 // L2 size 512 +#define L2CR_L2SIZ_1M 0x30000000 // L2 size 1M + +#define L2CR_L2CLK_1_0 0x02000000 // L2 clock ratio 1 +#define L2CR_L2CLK_1_5 0x04000000 // L2 clock ratio 1.5 +#define L2CR_L2CLK_2_0 0x08000000 // L2 clock ratio 2 +#define L2CR_L2CLK_2_5 0x0A000000 // L2 clock ratio 2.5 +#define L2CR_L2CLK_3_0 0x0C000000 // L2 clock ratio 3 + +#define L2CR_RAM_FLOW_THRU_BURST 0x00000000 // L2 RAM type flow-through sync. burst SRAM +#define L2CR_RAM_PIPELINE_BURST 0x01000000 // L2 RAM type pipelined sync. burst SRAM +#define L2CR_RAM_PIPELINE_LATE 0x01800000 // L2 RAM type pipelined sync. late-write SRAM + +#define L2CR_L2DO 0x00400000 // Data only +#define L2CR_L2I 0x00200000 // Global invalidate +#define L2CR_L2CTL 0x00100000 // ZZ enable +#define L2CR_L2WT 0x00080000 // L2 write through +#define L2CR_L2TS 0x00040000 // L2 test support + +#define L2CR_L2OH_0_5 0x00000000 // L2 output hold 0.5 ns +#define L2CR_L2OH_1_0 0x00010000 // L2 output hold 1.0 ns + +#define L2CR_L2SL 0x00008000 // L2 DLL slow +#define L2CR_L2DF 0x00004000 // L2 differential clock +#define L2CR_L2BYP 0x00002000 // L2 DLL bypass +#define L2CR_L2CS 0x00000200 // L2 clock stop +#define L2CR_L2DRO 0x00000100 // L2 DLL rollover checkstop enable +#define L2CR_L2CTR_MASK 0x000000FE // L2 counter value mask +#define L2CR_L2IP 0x00000001 // L2 global invalidate in progress + +#define MMCR0_DIS 0x80000000 // Disables counting unconditionally +#define MMCR0_DP 0x40000000 // Disables counting while in supervisor mode +#define MMCR0_DU 0x20000000 // Disables counting while in user mode +#define MMCR0_DMS 0x10000000 // Disables counting while MSR[PM] is set +#define MMCR0_DMR 0x08000000 // Disables counting while MSR[PM] is zero +#define MMCR0_ENINT 0x04000000 // Enables performance monitor interrupt signaling +#define MMCR0_DISCOUNT 0x02000000 // Disables counting of PMCn when a performance monitor interrupt is signaled or... +#define MMCR0_RTCSELECT_MASK 0x01800000 // 64-bit time base, bit selection enable +#define MMCR0_RTCSELECT_63 0x00000000 // Pick bit 63 to count +#define MMCR0_RTCSELECT_55 0x00800000 // Pick bit 55 to count +#define MMCR0_RTCSELECT_51 0x01000000 // Pick bit 51 to count +#define MMCR0_RTCSELECT_47 0x01800000 // Pick bit 47 to count +#define MMCR0_INTONBITTRANS 0x00400000 // Causes interrupt signaling on bit transition from off to on +#define MMCR0_THRESHOLD_MASK 0x003F0000 // Threshold value +#define MMCR0_THRESHOLD(n) ((n) << 16) // Threshold value (0 - 63) +#define MMCR0_PMC1INTCONTROL 0x00008000 // Enables interrupt signaling due to PMC1 counter overflow +#define MMCR0_PMC2INTCONTROL 0x00004000 // Enables interrupt signaling due to PMC2-PMC4 counter overflow +#define MMCR0_PMCTRIGGER 0x00002000 // Can be used to trigger counting of PMC2-PMC4 after PMC1 has overflowed or... +#define MMCR0_PMC1SELECT_MASK 0x00001FC0 // PMC1 input selector +#define MMCR0_PMC2SELECT_MASK 0x0000003F // PMC2 input selector + +#define MMCR1_PMC3SELECT_MASK 0xF8000000 // PMC3 input selector +#define MMCR1_PMC4SELECT_MASK 0x07C00000 // PMC4 input selector + +#define PMC1_OV 0x80000000 // Overflow +#define PMC1_COUNTER 0x7FFFFFFF // Counter value +#define PMC2_OV 0x80000000 // Overflow +#define PMC2_COUNTER 0x7FFFFFFF // Counter value +#define PMC3_OV 0x80000000 // Overflow +#define PMC3_COUNTER 0x7FFFFFFF // Counter value +#define PMC4_OV 0x80000000 // Overflow +#define PMC4_COUNTER 0x7FFFFFFF // Counter value + +/*---------------------------------------------------------------------------* + PMC1 Events + *---------------------------------------------------------------------------*/ +#define MMCR0_PMC1_HOLD 0x00000000 // Register holds current value +#define MMCR0_PMC1_CYCLE 0x00000040 // Processor cycles +#define MMCR0_PMC1_INSTRUCTION 0x00000080 // # of instructions completed. +#define MMCR0_PMC1_TRANSITION 0x000000C0 // # of transitions for 0 to 1 +#define MMCR0_PMC1_DISPATCHED 0x00000100 // # of instructions dispatched +#define MMCR0_PMC1_EIEIO 0x00000140 // # of eieio instructions completed +#define MMCR0_PMC1_ITLB_CYCLE 0x00000180 // # of cycles spent performing table search op. for the ITLB +#define MMCR0_PMC1_L2_HIT 0x000001C0 // # of access that hit the L2. +#define MMCR0_PMC1_EA 0x00000200 // # of valid instruction EAs delivered to the memory subsystem +#define MMCR0_PMC1_IABR 0x00000240 // # of time the address of an instruction matches the IABR +#define MMCR0_PMC1_L1_MISS 0x00000280 // # of loads that miss the L1 +#define MMCR0_PMC1_Bx_UNRESOLVED 0x000002C0 // # of branches that are unresolved when processed +#define MMCR0_PMC1_Bx_STALL_CYCLE 0x00000300 // # of cycles that dispatcher stalls due to a second + // unresolved branch in the instruction stream +#define MMCR0_PMC1_IC_FETCH_MISS 0x00000340 // # of times an instruction fetch missed the L1 Icache +#define MMCR0_PMC2_HOLD 0x00000000 // Register holds current value +#define MMCR0_PMC2_CYCLE 0x00000001 // Processor cycles +#define MMCR0_PMC2_INSTRUCTION 0x00000002 // # of instructions completed +#define MMCR0_PMC2_TRANSITION 0x00000003 // # of time-base (lower) bit transitions +#define MMCR0_PMC2_DISPATCHED 0x00000004 // # of instructions dispatched +#define MMCR0_PMC2_IC_MISS 0x00000005 // # of L1 instruction cache misses +#define MMCR0_PMC2_ITLB_MISS 0x00000006 // # of ITLB misses +#define MMCR0_PMC2_L2_I_MISS 0x00000007 // # of L2 instruction misses +#define MMCR0_PMC2_Bx_FALL_TROUGH 0x00000008 // # of fall-through branches +#define MMCR0_PMC2_PR_SWITCH 0x00000009 // # of MSR[PR] bit toggles +#define MMCR0_PMC2_RESERVED_LOAD 0x0000000A // # of reserved loads completed +#define MMCR0_PMC2_LOAD_STORE 0x0000000B // # of completed loads and stores +#define MMCR0_PMC2_SNOOP 0x0000000C // # of snoops +#define MMCR0_PMC2_L1_CASTOUT 0x0000000D // # of L1 castouts to L2 +#define MMCR0_PMC2_SYSTEM 0x0000000E // # of completed system unit instructions +#define MMCR0_PMC2_IC_FETCH_MISS 0x0000000F // # of instruction fetch misses in the L1 +#define MMCR0_PMC2_Bx_OUT_OF_ORDER 0x00000010 // # of branches allowing out-of-order execution + +/*---------------------------------------------------------------------------* + PMC3 Events + *---------------------------------------------------------------------------*/ +#define MMCR1_PMC3_HOLD 0x00000000 // Register holds current value +#define MMCR1_PMC3_CYCLE 0x08000000 // Processor cycles +#define MMCR1_PMC3_INSTRUCTION 0x10000000 // # of instructions completed +#define MMCR1_PMC3_TRANSITION 0x18000000 // # of time-base (lower) bit transitions +#define MMCR1_PMC3_DISPATCHED 0x20000000 // # of instructions dispatched +#define MMCR1_PMC3_DC_MISS 0x28000000 // # of L1 data cache misses +#define MMCR1_PMC3_DTLB_MISS 0x30000000 // # of DTLB misses +#define MMCR1_PMC3_L2_D_MISS 0x38000000 // # of L2 data misses +#define MMCR1_PMC3_Bx_TAKEN 0x40000000 // # predicted branches that were taken +#define MMCR1_PMC3_PM_SWITCH 0x48000000 // # of transitions between marked and unmarked processes +#define MMCR1_PMC3_COND_STORE 0x50000000 // # of store conditional instructions completed +#define MMCR1_PMC3_FPU 0x58000000 // # of instructions completed from the FPU +#define MMCR1_PMC3_L2_SNOOP_CASTOUT 0x60000000 // # of L2 castout caused by snoops to modified lines +#define MMCR1_PMC3_L2_HIT 0x68000000 // # of cache operations that hit in the L2 cache +#define MMCR1_PMC3_L1_MISS_CYCLE 0x78000000 // # of cycles generated by L1 load misses +#define MMCR1_PMC3_Bx_SECOND 0x80000000 // # of branches in the second speculative branch + // resolved correctly +#define MMCR1_PMC3_BPU_LR_CR 0x88000000 // # of cycles the BPU stalls due to LR or CR unresolved + // dependencies + +#define MMCR1_PMC4_HOLD 0x00000000 // Register holds current value +#define MMCR1_PMC4_CYCLE 0x00400000 // Processor cycles +#define MMCR1_PMC4_INSTRUCTION 0x00800000 // # of instructions completed +#define MMCR1_PMC4_TRANSITION 0x00C00000 // # of time-base (lower) bit transitions +#define MMCR1_PMC4_DISPATCHED 0x01000000 // # of instructions dispatched +#define MMCR1_PMC4_L2_CASTOUT 0x01400000 // # of L2 castouts +#define MMCR1_PMC4_DTLB_CYCLE 0x01800000 // # of cycles spent performing table searches for DTLB accesses +#define MMCR1_PMC4_Bx_MISSED 0x02000000 // # of mispredicted branches +#define MMCR1_PMC4_COND_STORE_INT 0x02800000 // # of store conditional instructions completed + // with reservation intact +#define MMCR1_PMC4_SYNC 0x02C00000 // # of completed sync instructions +#define MMCR1_PMC4_SNOOP_RETRY 0x03000000 // # of snoop request retries +#define MMCR1_PMC4_INTEGER 0x03400000 // # of completed integer operations +#define MMCR1_PMC4_BPU_THIRD 0x03800000 // # of cycles the BPU cannot process new branches + // due to having two unresolved branches +#define MMCR1_PMC4_DC_MISS 0x07C00000 // # of L1 data cache misses + +/*---------------------------------------------------------------------------* + FPSCR bits + *---------------------------------------------------------------------------*/ +#ifndef FPSCR_FX +#define FPSCR_FX 0x80000000 // Exception summary +#define FPSCR_FEX 0x40000000 // Enabled exception summary +#define FPSCR_VX 0x20000000 // Invalid operation +#define FPSCR_OX 0x10000000 // Overflow exception +#define FPSCR_UX 0x08000000 // Underflow exception +#define FPSCR_ZX 0x04000000 // Zero divide exception +#define FPSCR_XX 0x02000000 // Inexact exception +#define FPSCR_VXSNAN 0x01000000 // SNaN +#define FPSCR_VXISI 0x00800000 // Infinity - Infinity +#define FPSCR_VXIDI 0x00400000 // Infinity / Infinity +#define FPSCR_VXZDZ 0x00200000 // 0 / 0 +#define FPSCR_VXIMZ 0x00100000 // Infinity * 0 +#define FPSCR_VXVC 0x00080000 // Invalid compare +#define FPSCR_FR 0x00040000 // Fraction rounded +#define FPSCR_FI 0x00020000 // Fraction inexact +#define FPSCR_VXSOFT 0x00000400 // Software request +#define FPSCR_VXSQRT 0x00000200 // Invalid square root +#define FPSCR_VXCVI 0x00000100 // Invalid integer convert +#define FPSCR_VE 0x00000080 // Invalid operation exception enable +#define FPSCR_OE 0x00000040 // Overflow exception enable +#define FPSCR_UE 0x00000020 // Underflow exception enable +#define FPSCR_ZE 0x00000010 // Zero divide exception enable +#define FPSCR_XE 0x00000008 // Inexact exception enable +#define FPSCR_NI 0x00000004 // Non-IEEE mode +#endif + +#ifndef FPSCR_FX_BIT +#define FPSCR_FX_BIT 0 // Exception summary +#define FPSCR_FEX_BIT 1 // Enabled exception summary +#define FPSCR_VX_BIT 2 // Invalid operation +#define FPSCR_OX_BIT 3 // Overflow exception +#define FPSCR_UX_BIT 4 // Underflow exception +#define FPSCR_ZX_BIT 5 // Zero divide exception +#define FPSCR_XX_BIT 6 // Inexact exception +#define FPSCR_VXSNAN_BIT 7 // SNaN +#define FPSCR_VXISI_BIT 8 // Infinity - Infinity +#define FPSCR_VXIDI_BIT 9 // Infinity / Infinity +#define FPSCR_VXZDZ_BIT 10 // 0 / 0 +#define FPSCR_VXIMZ_BIT 11 // Infinity * 0 +#define FPSCR_VXVC_BIT 12 // Invalid compare +#define FPSCR_FR_BIT 13 // Fraction rounded +#define FPSCR_FI_BIT 14 // Fraction inexact +#define FPSCR_VXSOFT_BIT 21 // Software request +#define FPSCR_VXSQRT_BIT 22 // Invalid square root +#define FPSCR_VXCVI_BIT 23 // Invalid integer convert +#define FPSCR_VE_BIT 24 // Invalid operation exception enable +#define FPSCR_OE_BIT 25 // Overflow exception enable +#define FPSCR_UE_BIT 26 // Underflow exception enable +#define FPSCR_ZE_BIT 27 // Zero divide exception enable +#define FPSCR_XE_BIT 28 // Inexact exception enable +#define FPSCR_NI_BIT 29 // Non-IEEE mode +#endif + +union FpscrUnion { + f64 f; + struct { + u32 fpscr_pad; + u32 fpscr; + } u; +}; + +// PPCArch +u32 PPCMfmsr(); +void PPCMtmsr(u32 newMSR); +u32 PPCOrMsr(u32 value); +u32 PPCMfhid0(); +void PPCMthid0(u32 newHID0); +u32 PPCMfl2cr(); +void PPCMtl2cr(u32 newL2cr); +void PPCMtdec(u32 newDec); +void PPCSync(); +void PPCHalt(); +u32 PPCMffpscr(); +void PPCMtfpscr(u32 newFPSCR); +u32 PPCMfhid2(); +void PPCMthid2(u32 newhid2); +u32 PPCMfwpar(); +void PPCMtwpar(u32 newwpar); +void PPCEnableSpeculation(); +void PPCDisableSpeculation(); +void PPCSetFpIEEEMode(); +void PPCSetFpNonIEEEMode(); +u32 PPCMfpmc4(); +u32 PPCMfpmc3(); +u32 PPCMfpmc1(); +void PPCMtpmc1(u32 newPmc1); +void PPCMtpmc2(u32 newPmc1); +void PPCMtpmc3(u32 newPmc1); +void PPCMtpmc4(u32 newPmc1); +void PPCMtmmcr0(u32 newMmcr0); +void PPCMtmmcr1(u32 newMmcr0); +void PPCMtdmaU(u32 newdmau); +void PPCMtdmaL(u32 newdmal); +u32 PPCMfdec(void); +u32 PPCMfpmc2(void); +u32 PPCAndMsr(u32 value); +u32 PPCAndCMsr(u32 value); +u32 PPCMfhid1(); +void PPCEieio(); +u32 PPCMfmmcr0(); +u32 PPCMfmmcr1(); +u32 PPCMfpmc2(); +u32 PPCMfsia(); +void PPCMtsia(u32 newSia); +u32 PPCMfdmaL(); +u32 PPCMfpvr(); +u32 PPCMfdmaU(); + +// PPCPm +void PMBegin(void); +void PMEnd(void); +void PMCycles(void); +void PML1FetchMisses(void); +void PML1MissCycles(void); +void PMInstructions(void); + +#ifdef __cplusplus +} +#endif + +#endif // _REVOLUTION_PPCARCH diff --git a/include/revolution/db.h b/include/revolution/db.h new file mode 100644 index 00000000000..2282c261da4 --- /dev/null +++ b/include/revolution/db.h @@ -0,0 +1,22 @@ +#ifndef _REVOLUTION_DB_H_ +#define _REVOLUTION_DB_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define OS_DBINTERFACE_ADDR 0x00000040 + +BOOL DBIsDebuggerPresent(void); +void DBPrintf(char* str, ...); +s32 DBQueryData(void); +u32 DBRead(u8*, u32); + +#ifdef __cplusplus +} +#endif + +#endif // _REVOLUTION_DB_H_ diff --git a/include/revolution/db/DBInterface.h b/include/revolution/db/DBInterface.h new file mode 100644 index 00000000000..e350326a2e3 --- /dev/null +++ b/include/revolution/db/DBInterface.h @@ -0,0 +1,31 @@ +#ifndef _REVOLUTION_DBINTERFACE_H_ +#define _REVOLUTION_DBINTERFACE_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct DBInterface { + u32 bPresent; + u32 exceptionMask; + void (*ExceptionDestination)(void); + void* exceptionReturn; +} DBInterface; + +extern DBInterface* __DBInterface; + +void DBInit(void); +void DBInitComm(int* inputFlagPtr, int* mtrCallback); +void __DBExceptionDestination(void); +void __DBExceptionDestinationAux(void); +BOOL __DBIsExceptionMarked(__OSException exception); +void __DBMarkException(u8 exception, int value); +void __DBSetPresent(u32 value); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/dsp.h b/include/revolution/dsp.h new file mode 100644 index 00000000000..e8fc5762ae9 --- /dev/null +++ b/include/revolution/dsp.h @@ -0,0 +1,57 @@ +#ifndef _REVOLUTION_DSP_H_ +#define _REVOLUTION_DSP_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void (*DSPCallback)(void* task); +typedef struct STRUCT_DSP_TASK DSPTaskInfo; + +typedef struct STRUCT_DSP_TASK { + /* 0x00 */ volatile u32 state; + /* 0x04 */ volatile u32 priority; + /* 0x08 */ volatile u32 flags; + /* 0x0C */ u16* iram_mmem_addr; + /* 0x10 */ u32 iram_length; + /* 0x14 */ u32 iram_addr; + /* 0x18 */ u16* dram_mmem_addr; + /* 0x1C */ u32 dram_length; + /* 0x20 */ u32 dram_addr; + /* 0x24 */ u16 dsp_init_vector; + /* 0x26 */ u16 dsp_resume_vector; + /* 0x28 */ DSPCallback init_cb; + /* 0x2C */ DSPCallback res_cb; + /* 0x30 */ DSPCallback done_cb; + /* 0x34 */ DSPCallback req_cb; + /* 0x38 */ DSPTaskInfo* next; + /* 0x3C */ DSPTaskInfo* prev; + /* 0x40 */ OSTime t_context; + /* 0x48 */ OSTime t_task; +} DSPTaskInfo; + +u32 DSPCheckMailToDSP(void); +u32 DSPCheckMailFromDSP(void); +u32 DSPReadCPUToDSPMbox(void); +u32 DSPReadMailFromDSP(void); +void DSPSendMailToDSP(u32 mail); +void DSPAssertInt(void); +void DSPInit(void); +BOOL DSPCheckInit(void); +void DSPReset(void); +void DSPHalt(void); +void DSPUnhalt(void); +u32 DSPGetDMAStatus(void); +__declspec(weak) DSPTaskInfo* DSPAddTask(DSPTaskInfo* task); +DSPTaskInfo* DSPCancelTask(DSPTaskInfo* task); +DSPTaskInfo* DSPAssertTask(DSPTaskInfo* task); + +DSPTaskInfo* __DSPGetCurrentTask(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/dvd.h b/include/revolution/dvd.h new file mode 100644 index 00000000000..67e8bd21be0 --- /dev/null +++ b/include/revolution/dvd.h @@ -0,0 +1,236 @@ +#ifndef _REVOLUTION_DVD_H_ +#define _REVOLUTION_DVD_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define DVD_ASSERTMSGLINE(line, cond, msg) \ + if (!(cond)) \ + OSPanic(__FILE__, line, msg) + +#define DVD_ASSERTMSG1LINE(line, cond, msg, arg1) \ + if (!(cond)) \ + OSPanic(__FILE__, line, msg, arg1) + +#define DVD_ASSERTMSG2LINE(line, cond, msg, arg1, arg2) \ + if (!(cond)) \ + OSPanic(__FILE__, line, msg, arg1, arg2) + +#define DVD_RESULT_GOOD 0 +#define DVD_RESULT_FATAL_ERROR -1 +#define DVD_RESULT_IGNORED -2 +#define DVD_RESULT_CANCELED -6 + +#define DVD_STATE_FATAL_ERROR -1 +#define DVD_STATE_END 0 +#define DVD_STATE_BUSY 1 +#define DVD_STATE_WAITING 2 +#define DVD_STATE_COVER_CLOSED 3 +#define DVD_STATE_NO_DISK 4 +#define DVD_STATE_COVER_OPEN 5 +#define DVD_STATE_WRONG_DISK 6 +#define DVD_STATE_MOTOR_STOPPED 7 +#define DVD_STATE_PAUSING 8 +#define DVD_STATE_IGNORED 9 +#define DVD_STATE_CANCELED 10 +#define DVD_STATE_RETRY 11 + +#define DVD_MIN_TRANSFER_SIZE 32 + +// could be bitfields +#define DVD_INTTYPE_TC 1 +#define DVD_INTTYPE_DE 2 +// unk type 3 +#define DVD_INTTYPE_CVR 4 + +// DVD Commands +#define DVD_COMMAND_NONE 0 +#define DVD_COMMAND_READ 1 +#define DVD_COMMAND_SEEK 2 +#define DVD_COMMAND_CHANGE_DISK 3 +#define DVD_COMMAND_BSREAD 4 +#define DVD_COMMAND_READID 5 +#define DVD_COMMAND_INITSTREAM 6 +#define DVD_COMMAND_CANCELSTREAM 7 +#define DVD_COMMAND_STOP_STREAM_AT_END 8 +#define DVD_COMMAND_REQUEST_AUDIO_ERROR 9 +#define DVD_COMMAND_REQUEST_PLAY_ADDR 10 +#define DVD_COMMAND_REQUEST_START_ADDR 11 +#define DVD_COMMAND_REQUEST_LENGTH 12 +#define DVD_COMMAND_AUDIO_BUFFER_CONFIG 13 +#define DVD_COMMAND_INQUIRY 14 +#define DVD_COMMAND_BS_CHANGE_DISK 15 +#define DVD_COMMAND_UNK_16 16 + +typedef struct DVDDiskID { + char gameName[4]; + char company[2]; + u8 diskNumber; + u8 gameVersion; + u8 streaming; + u8 streamingBufSize; + u8 padding[22]; +} DVDDiskID; + +typedef struct DVDCommandBlock DVDCommandBlock; +typedef void (*DVDCBCallback)(s32 result, DVDCommandBlock* block); +typedef void (*DVDLowCallback)(u32); + +typedef void (*DVDCommandCheckerCallback)(u32); +typedef void (*DVDCommandChecker)(DVDCommandBlock*, DVDCommandCheckerCallback); + +struct DVDCommandBlock { + /* 0x00 */ DVDCommandBlock* next; + /* 0x04 */ DVDCommandBlock* prev; + /* 0x08 */ u32 command; + /* 0x0C */ s32 state; + /* 0x10 */ u32 offset; + /* 0x14 */ u32 length; + /* 0x18 */ void* addr; + /* 0x1C */ u32 currTransferSize; + /* 0x20 */ u32 transferredSize; + /* 0x24 */ DVDDiskID* id; + /* 0x28 */ DVDCBCallback callback; + /* 0x2C */ void* userData; +}; + +typedef struct DVDFileInfo DVDFileInfo; +typedef void (*DVDCallback)(s32 result, DVDFileInfo *fileInfo); +struct DVDFileInfo { + /* 0x00 */ DVDCommandBlock cb; + /* 0x30 */ u32 startAddr; + /* 0x34 */ u32 length; + /* 0x38 */ DVDCallback callback; +}; + +typedef struct { + u32 entryNum; + u32 location; + u32 next; +} DVDDir; + +typedef struct { + u32 entryNum; + BOOL isDir; + char* name; +} DVDDirEntry; + +typedef struct DVDBB2 { + /* 0x00 */ u32 bootFilePosition; + /* 0x04 */ u32 FSTPosition; + /* 0x08 */ u32 FSTLength; + /* 0x0C */ u32 FSTMaxLength; + /* 0x10 */ void* FSTAddress; + /* 0x14 */ u32 userPosition; + /* 0x18 */ u32 userLength; + /* 0x1C */ u32 padding0; +} DVDBB2; + +typedef struct DVDDriveInfo { + /* 0x00 */ u16 revisionLevel; + /* 0x02 */ u16 deviceCode; + /* 0x04 */ u32 releaseDate; + /* 0x08 */ u8 padding[24]; +} DVDDriveInfo; + +// DVD +void DVDInit(void); +int DVDReadAbsAsyncPrio(DVDCommandBlock* block, void* addr, s32 length, s32 offset, DVDCBCallback callback, s32 prio); +int DVDSeekAbsAsyncPrio(DVDCommandBlock* block, s32 offset, DVDCBCallback callback, s32 prio); +int DVDReadAbsAsyncForBS(DVDCommandBlock* block, void* addr, s32 length, s32 offset, DVDCBCallback callback); +int DVDReadDiskID(DVDCommandBlock* block, DVDDiskID* diskID, DVDCBCallback callback); +int DVDPrepareStreamAbsAsync(DVDCommandBlock* block, u32 length, u32 offset, DVDCBCallback callback); +int DVDCancelStreamAsync(DVDCommandBlock* block, DVDCBCallback callback); +s32 DVDCancelStream(DVDCommandBlock* block); +int DVDStopStreamAtEndAsync(DVDCommandBlock* block, DVDCBCallback callback); +s32 DVDStopStreamAtEnd(DVDCommandBlock* block); +int DVDGetStreamErrorStatusAsync(DVDCommandBlock* block, DVDCBCallback callback); +s32 DVDGetStreamErrorStatus(DVDCommandBlock* block); +int DVDGetStreamPlayAddrAsync(DVDCommandBlock* block, DVDCBCallback callback); +s32 DVDGetStreamPlayAddr(DVDCommandBlock* block); +int DVDGetStreamStartAddrAsync(DVDCommandBlock* block, DVDCBCallback callback); +s32 DVDGetStreamStartAddr(DVDCommandBlock* block); +int DVDGetStreamLengthAsync(DVDCommandBlock* block, DVDCBCallback callback); +s32 DVDGetStreamLength(DVDCommandBlock* block); +int DVDChangeDiskAsyncForBS(DVDCommandBlock* block, DVDCBCallback callback); +int DVDChangeDiskAsync(DVDCommandBlock* block, DVDDiskID* id, DVDCBCallback callback); +s32 DVDChangeDisk(DVDCommandBlock* block, DVDDiskID* id); +int DVDStopMotorAsync(DVDCommandBlock* block, DVDCBCallback callback); +s32 DVDStopMotor(DVDCommandBlock* block); +int DVDInquiryAsync(DVDCommandBlock* block, DVDDriveInfo* info, DVDCBCallback callback); +s32 DVDInquiry(DVDCommandBlock* block, DVDDriveInfo* info); +void DVDReset(void); +int DVDResetRequired(void); +s32 DVDGetCommandBlockStatus(const DVDCommandBlock* block); +s32 DVDGetDriveStatus(void); +BOOL DVDSetAutoInvalidation(BOOL autoInval); +void DVDPause(void); +void DVDResume(void); +int DVDCancelAsync(DVDCommandBlock* block, DVDCBCallback callback); +s32 DVDCancel(volatile DVDCommandBlock* block); +int DVDCancelAllAsync(DVDCBCallback callback); +s32 DVDCancelAll(void); +DVDDiskID* DVDGetCurrentDiskID(void); +BOOL DVDCheckDisk(void); + +// DVD FATAL +int DVDSetAutoFatalMessaging(BOOL enable); + +// DVD FS +s32 DVDConvertPathToEntrynum(const char* pathPtr); +BOOL DVDFastOpen(s32 entrynum, DVDFileInfo* fileInfo); +BOOL DVDOpen(const char* fileName, DVDFileInfo* fileInfo); +BOOL DVDClose(DVDFileInfo* fileInfo); +BOOL DVDGetCurrentDir(char* path, u32 maxlen); +BOOL DVDChangeDir(const char* dirName); +BOOL DVDReadAsyncPrio(DVDFileInfo* fileInfo, void* addr, s32 length, s32 offset, + DVDCallback callback, s32 prio); +s32 DVDReadPrio(DVDFileInfo* fileInfo, void* addr, s32 length, s32 offset, s32 prio); +int DVDSeekAsyncPrio(DVDFileInfo* fileInfo, s32 offset, void (* callback)(s32, DVDFileInfo *), s32 prio); +s32 DVDSeekPrio(DVDFileInfo* fileInfo, s32 offset, s32 prio); +s32 DVDGetFileInfoStatus(const DVDFileInfo* fileInfo); +BOOL DVDFastOpenDir(s32 entrynum, DVDDir* dir); +int DVDOpenDir(const char* dirName, DVDDir* dir); +int DVDReadDir(DVDDir* dir, DVDDirEntry* dirent); +int DVDCloseDir(DVDDir* dir); +void DVDRewindDir(DVDDir* dir); +void* DVDGetFSTLocation(void); +BOOL DVDPrepareStreamAsync(DVDFileInfo* fileInfo, u32 length, u32 offset, DVDCallback callback); +s32 DVDPrepareStream(DVDFileInfo* fileInfo, u32 length, u32 offset); +s32 DVDGetTransferredSize(DVDFileInfo* fileinfo); + +#define DVDReadAsync(fileInfo, addr, length, offset, callback) \ + DVDReadAsyncPrio((fileInfo), (addr), (length), (offset), (callback), 2) + +// DVD ID UTILS +int DVDCompareDiskID(const DVDDiskID* id1, const DVDDiskID* id2); +DVDDiskID* DVDGenerateDiskID(DVDDiskID* id, const char* game, const char* company, u8 diskNum, u8 version); + +// DVD LOW +BOOL DVDLowRead(void* addr, u32 length, u32 offset, DVDLowCallback callback); +BOOL DVDLowSeek(u32 offset, DVDLowCallback callback); +BOOL DVDLowWaitCoverClose(DVDLowCallback callback); +BOOL DVDLowReadDiskID(DVDDiskID* diskID, DVDLowCallback callback); +BOOL DVDLowStopMotor(DVDLowCallback callback); +BOOL DVDLowRequestError(DVDLowCallback callback); +BOOL DVDLowInquiry(DVDDriveInfo* info, DVDLowCallback callback); +BOOL DVDLowAudioStream(u32 subcmd, u32 length, u32 offset, DVDLowCallback callback); +BOOL DVDLowRequestAudioStatus(u32 subcmd, DVDLowCallback callback); +BOOL DVDLowAudioBufferConfig(BOOL enable, u32 size, DVDLowCallback callback); +void DVDLowReset(void); +DVDLowCallback DVDLowSetResetCoverCallback(DVDLowCallback callback); +BOOL DVDLowBreak(void); +DVDLowCallback DVDLowClearCallback(void); +u32 DVDLowGetCoverStatus(void); + +// DVD QUEUE +void DVDDumpWaitingQueue(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/exi.h b/include/revolution/exi.h new file mode 100644 index 00000000000..9672a30aa6b --- /dev/null +++ b/include/revolution/exi.h @@ -0,0 +1,103 @@ +#ifndef _REVOLUTION_EXI_H_ +#define _REVOLUTION_EXI_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define EXI_MEMORY_CARD_59 0x00000004 +#define EXI_MEMORY_CARD_123 0x00000008 +#define EXI_MEMORY_CARD_251 0x00000010 +#define EXI_MEMORY_CARD_507 0x00000020 + +#define EXI_MEMORY_CARD_1019 0x00000040 +#define EXI_MEMORY_CARD_2043 0x00000080 + +#define EXI_MEMORY_CARD_1019A 0x00000140 +#define EXI_MEMORY_CARD_1019B 0x00000240 +#define EXI_MEMORY_CARD_1019C 0x00000340 +#define EXI_MEMORY_CARD_1019D 0x00000440 +#define EXI_MEMORY_CARD_1019E 0x00000540 +#define EXI_MEMORY_CARD_1019F 0x00000640 +#define EXI_MEMORY_CARD_1019G 0x00000740 + +#define EXI_MEMORY_CARD_2043A 0x00000180 +#define EXI_MEMORY_CARD_2043B 0x00000280 +#define EXI_MEMORY_CARD_2043C 0x00000380 +#define EXI_MEMORY_CARD_2043D 0x00000480 +#define EXI_MEMORY_CARD_2043E 0x00000580 +#define EXI_MEMORY_CARD_2043F 0x00000680 +#define EXI_MEMORY_CARD_2043G 0x00000780 + +#define EXI_USB_ADAPTER 0x01010000 +#define EXI_NPDP_GDEV 0x01020000 + +#define EXI_MODEM 0x02020000 +#define EXI_ETHER 0x04020200 +#define EXI_MIC 0x04060000 +#define EXI_AD16 0x04120000 +#define EXI_RS232C 0x04040404 +#define EXI_ETHER_VIEWER 0x04220001 +#define EXI_STREAM_HANGER 0x04130000 + +#define EXI_MARLIN 0x03010000 + +#define EXI_IS_VIEWER 0x05070000 + +#define EXI_READ 0 +#define EXI_WRITE 1 + +#define EXI_FREQ_1M 0 +#define EXI_FREQ_2M 1 +#define EXI_FREQ_4M 2 +#define EXI_FREQ_8M 3 +#define EXI_FREQ_16M 4 +#define EXI_FREQ_32M 5 + +typedef void (*EXICallback)(s32 chan, OSContext* context); +typedef struct EXIControl { + EXICallback exiCallback; + EXICallback tcCallback; + EXICallback extCallback; + volatile u32 state; + int immLen; + u8* immBuf; + u32 dev; + u32 id; + s32 idTime; + int items; + struct { + u32 dev; + EXICallback callback; + } queue[3]; +} EXIControl; + +EXICallback EXISetExiCallback(s32 channel, EXICallback callback); + +void EXIInit(void); +BOOL EXILock(s32 channel, u32 device, EXICallback callback); +BOOL EXIUnlock(s32 channel); +BOOL EXISelect(s32 channel, u32 device, u32 frequency); +BOOL EXIDeselect(s32 channel); +BOOL EXIImm(s32 channel, void* buffer, s32 length, u32 type, EXICallback callback); +BOOL EXIImmEx(s32 channel, void* buffer, s32 length, u32 type); +BOOL EXIDma(s32 channel, void* buffer, s32 length, u32 type, EXICallback callback); +BOOL EXISync(s32 channel); +BOOL EXIProbe(s32 channel); +s32 EXIProbeEx(s32 channel); +BOOL EXIAttach(s32 channel, EXICallback callback); +BOOL EXIDetach(s32 channel); +u32 EXIGetState(s32 channel); +s32 EXIGetID(s32 channel, u32 device, u32* id); +void EXIProbeReset(void); +int EXISelectSD(s32 chan, u32 dev, u32 freq); +s32 EXIGetType(s32 chan, u32 dev, u32* type); +char* EXIGetTypeString(u32 type); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/fake_tgmath.h b/include/revolution/fake_tgmath.h new file mode 100644 index 00000000000..41a982106d4 --- /dev/null +++ b/include/revolution/fake_tgmath.h @@ -0,0 +1,66 @@ +#pragma cplusplus on + +extern inline float sqrtf(float x) { + static const double _half=.5; + static const double _three=3.0; + volatile float y; + if(x > 0.0f) { + double guess = __frsqrte((double)x); // returns an approximation to + guess = _half*guess*(_three - guess*guess*x); // now have 12 sig bits + guess = _half*guess*(_three - guess*guess*x); // now have 24 sig bits + guess = _half*guess*(_three - guess*guess*x); // now have 32 sig bits + y=(float)(x*guess); + return y ; + } + return x ; +} + +extern inline float sqrt(float x) { + static const double _half=.5; + static const double _three=3.0; + volatile float y; + if(x > 0.0f) { + double guess = __frsqrte((double)x); // returns an approximation to + guess = _half*guess*(_three - guess*guess*x); // now have 12 sig bits + guess = _half*guess*(_three - guess*guess*x); // now have 24 sig bits + guess = _half*guess*(_three - guess*guess*x); // now have 32 sig bits + guess = _half*guess*(_three - guess*guess*x); // now have 32 sig bits + + y=(float)(x*guess); + return y ; + } + return x ; +} + +extern inline float fabs(float x) { +#if __MIPS__ + return fabsf(x); +#else + (*(int*)&x)&=0x7fffffff; + return x; +#endif +} + +extern inline float fabsf(float x) { + return __fabsf(x); +} + +extern float cosf(float); +extern inline float cos(float x) { + return cosf(x); +} + +inline float floor(float x) { + int i=(int)x; + float y=x-(float)i; + + if(!y || x > 8388608.0f) + return x ; // x is already an int + + if(x < 0) + return (float)--i; + // x < 0 -> int conversion of x above rounded toward zero(so decrement) + return (float)i; +} + +#pragma cplusplus reset diff --git a/include/revolution/gd.h b/include/revolution/gd.h new file mode 100644 index 00000000000..bb7a3288120 --- /dev/null +++ b/include/revolution/gd.h @@ -0,0 +1,14 @@ +#ifndef _REVOLUTION_GD_H_ +#define _REVOLUTION_GD_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/include/revolution/gd/GDBase.h b/include/revolution/gd/GDBase.h new file mode 100644 index 00000000000..02427ac6796 --- /dev/null +++ b/include/revolution/gd/GDBase.h @@ -0,0 +1,151 @@ +#ifndef _REVOLUTION_GD_BASE_H +#define _REVOLUTION_GD_BASE_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void (*GDOverflowCb)(void); + +typedef struct _GDLObj { + u8* start; + u32 length; + u8* ptr; + u8* top; +} GDLObj; + +extern GDLObj* __GDCurrentDL; + +void GDInitGDLObj(GDLObj* dl, void* start, u32 length); +void GDFlushCurrToMem(void); +void GDPadCurr32(void); +void GDOverflowed(void); +void GDSetOverflowCallback(GDOverflowCb callback); +GDOverflowCb GDGetOverflowCallback(void); + +inline static void GDOverflowCheck(u32 size) { + if (__GDCurrentDL->ptr + size > __GDCurrentDL->top) { + GDOverflowed(); + } +} + +inline static void __GDWrite(u8 data) { + *__GDCurrentDL->ptr++ = data; +} + +inline static void GDWrite_u8(u8 data) { + GDOverflowCheck(sizeof(u8)); + __GDWrite(data); +} + +inline static void GDWrite_u16(u16 data) { + GDOverflowCheck(sizeof(u16)); + __GDWrite((u8)((data >> 8))); + __GDWrite((u8)((data >> 0) & 0xFF)); +} + +inline static void GDWrite_u24(u32 data) { + GDOverflowCheck(3); + __GDWrite((u8)((data >> 16) & 0xFF)); + __GDWrite((u8)((data >> 8) & 0xFF)); + __GDWrite((u8)((data >> 0) & 0xFF)); +} + +inline static void GDWrite_u32(u32 data) { + GDOverflowCheck(sizeof(u32)); + __GDWrite((u8)((data >> 24) & 0xFF)); + __GDWrite((u8)((data >> 16) & 0xFF)); + __GDWrite((u8)((data >> 8) & 0xFF)); + __GDWrite((u8)((data >> 0) & 0xFF)); +} + +inline static void GDWrite_f32(f32 data) { + union { + f32 f; + u32 u; + } fid; + fid.f = data; + GDWrite_u32(fid.u); +} + +inline static void GDWriteXFCmdHdr(u16 addr, u8 len) { + GDWrite_u8(GX_LOAD_XF_REG); + GDWrite_u16(len - 1); + GDWrite_u16(addr); +} + +inline static void GDWriteXFCmd(u16 addr, u32 val) { + GDWrite_u8(GX_LOAD_XF_REG); + GDWrite_u16(0); + GDWrite_u16(addr); + GDWrite_u32(val); +} + +inline static void GDWriteXFIndxDCmd(u16 addr, u8 len, u16 index) { + GDWrite_u8(GX_LOAD_INDX_D); + GDWrite_u16(index); + GDWrite_u16((len - 1) << 12 | addr); +} + +inline static void GDWriteXFIndxACmd(u16 addr, u8 len, u16 index) { + GDWrite_u8(GX_LOAD_INDX_A); + GDWrite_u16(index); + GDWrite_u16(((len - 1) << 12) | addr); +} + +inline static void GDWriteXFIndxBCmd(u16 addr, u8 len, u16 index) { + GDWrite_u8(GX_LOAD_INDX_B); + GDWrite_u16(index); + GDWrite_u16(((len - 1) << 12) | addr); +} + +inline static void GDWriteXFIndxCCmd(u16 addr, u8 len, u16 index) { + GDWrite_u8(GX_LOAD_INDX_C); + GDWrite_u16(index); + GDWrite_u16(((len - 1) << 12) | addr); +} + +inline static void GDWriteCPCmd(u8 addr, u32 val) { + GDWrite_u8(GX_LOAD_CP_REG); + GDWrite_u8(addr); + GDWrite_u32(val); +} + +inline static void GDWriteBPCmd(u32 regval) { + GDWrite_u8(GX_LOAD_BP_REG); + GDWrite_u32(regval); +} + +inline static void GDSetCurrent(GDLObj* dl) { + __GDCurrentDL = dl; +} + +static inline u32 GDGetCurrOffset(void) { + return (u32)(__GDCurrentDL->ptr - __GDCurrentDL->start); +} + +static inline void GDSetCurrOffset(u32 offset) { + __GDCurrentDL->ptr = __GDCurrentDL->start + offset; +} + +static inline void* GDGetCurrPointer(void) { + return (void*)__GDCurrentDL->ptr; +} + +static inline u8* GDGetCurrPointer2(void) { + return __GDCurrentDL->ptr; +} + +static inline u32 GDGetGDLObjOffset(const GDLObj* dl) { + return (u32)(dl->ptr - dl->start); +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/gd/GDFile.h b/include/revolution/gd/GDFile.h new file mode 100644 index 00000000000..6105de8f728 --- /dev/null +++ b/include/revolution/gd/GDFile.h @@ -0,0 +1,31 @@ +#ifndef _REVOLUTION_GD_FILE_H +#define _REVOLUTION_GD_FILE_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define GD_FILE_VERSION_NUMBER 0x11223344 + +typedef struct _GDGList { + void* ptr; + u32 byteLength; +} GDGList; + +typedef struct _GDFileHeader { + u32 versionNumber; + u32 numDLs; + u32 numPLs; + GDGList* DLDescArray; + GDGList* PLDescArray; +} GDFileHeader; + +s32 GDReadDLFile(const char* fName, u32* numDLs, u32* numPLs, GDGList** DLDescArray, GDGList** PLDescArray); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/gd/GDGeometry.h b/include/revolution/gd/GDGeometry.h new file mode 100644 index 00000000000..16969bd37e1 --- /dev/null +++ b/include/revolution/gd/GDGeometry.h @@ -0,0 +1,524 @@ +#ifndef _REVOLUTION_GD_GEOMETRY_H_ +#define _REVOLUTION_GD_GEOMETRY_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +// Command processor register IDs +#define CP_REG_MTXIDXA_ID 0x30 // Matrix index A +#define CP_REG_MTXIDXB_ID 0x40 // Matrix index B +#define CP_REG_VCD_LO_ID 0x50 // Vertex descriptor (lo) +#define CP_REG_VCD_HI_ID 0x60 // Vertex descriptor (hi) +#define CP_REG_VAT_GRP0_ID 0x70 // Vertex attribute table (group 0) +#define CP_REG_VAT_GRP1_ID 0x80 // Vertex attribute table (group 1) +#define CP_REG_VAT_GRP2_ID 0x90 // Vertex attribute table (group 2) +#define CP_REG_ARRAYBASE_ID 0xA0 // Vertex array start/base +#define CP_REG_ARRAYSTRIDE_ID 0xB0 // Vertex array stride + +// XF locators for textures +// Projection type [30-30] +#define GX_XF_TEX_PROJTYPE_ST 30 +#define GX_XF_TEX_PROJTYPE_END 30 + +// Input format [29-29] +#define GX_XF_TEX_INPUTFORM_ST 29 +#define GX_XF_TEX_INPUTFORM_END 29 + +// Texture gen type [25-27] +#define GX_XF_TEX_TEXGENTYPE_ST 25 +#define GX_XF_TEX_TEXGENTYPE_END 27 + +// Source row [20-24] +#define GX_XF_TEX_SRCROW_ST 20 +#define GX_XF_TEX_SRCROW_END 24 + +// Bump source texture [17-19] +#define GX_XF_TEX_BUMPSRCTEX_ST 17 +#define GX_XF_TEX_BUMPSRCTEX_END 19 + +// Bump source light [14-16] +#define GX_XF_TEX_BUMPSRCLIGHT_ST 14 +#define GX_XF_TEX_BUMPSRCLIGHT_END 16 + +// Blitting processor registers. +#define GX_BP_REG_GENMODE 0x0 // gen mode + +// display copy filters +#define GX_BP_REG_DISPCOPYFILTER0 0x1 // display copy filter 0 +#define GX_BP_REG_DISPCOPYFILTER1 0x2 // display copy filter 1 +#define GX_BP_REG_DISPCOPYFILTER2 0x3 // display copy filter 2 +#define GX_BP_REG_DISPCOPYFILTER3 0x4 // display copy filter 3 + +// indirect matrices +#define GX_BP_REG_INDMTX0A 0x6 // indirect matrix 0A +#define GX_BP_REG_INDMTX0B 0x7 // indirect matrix 0B +#define GX_BP_REG_INDMTX0C 0x8 // indirect matrix 0C +#define GX_BP_REG_INDMTX1A 0x9 // indirect matrix 1A +#define GX_BP_REG_INDMTX1B 0xA // indirect matrix 1B +#define GX_BP_REG_INDMTX1C 0xB // indirect matrix 1C +#define GX_BP_REG_INDMTX2A 0xC // indirect matrix 2A +#define GX_BP_REG_INDMTX2B 0xD // indirect matrix 2B +#define GX_BP_REG_INDMTX2C 0xE // indirect matrix 2C +#define GX_BP_REG_INDIMASK 0xF // indirect mask + +// indirect TEV stages +#define GX_BP_REG_INDTEVSTAGE0 0x10 // indirect TEV stage 0 +#define GX_BP_REG_INDTEVSTAGE1 0x11 // indirect TEV stage 1 +#define GX_BP_REG_INDTEVSTAGE2 0x12 // indirect TEV stage 2 +#define GX_BP_REG_INDTEVSTAGE3 0x13 // indirect TEV stage 3 +#define GX_BP_REG_INDTEVSTAGE4 0x14 // indirect TEV stage 4 +#define GX_BP_REG_INDTEVSTAGE5 0x15 // indirect TEV stage 5 +#define GX_BP_REG_INDTEVSTAGE6 0x16 // indirect TEV stage 6 +#define GX_BP_REG_INDTEVSTAGE7 0x17 // indirect TEV stage 7 +#define GX_BP_REG_INDTEVSTAGE8 0x18 // indirect TEV stage 8 +#define GX_BP_REG_INDTEVSTAGE9 0x19 // indirect TEV stage 9 +#define GX_BP_REG_INDTEVSTAGE10 0x1A // indirect TEV stage 10 +#define GX_BP_REG_INDTEVSTAGE11 0x1B // indirect TEV stage 11 +#define GX_BP_REG_INDTEVSTAGE12 0x1C // indirect TEV stage 12 +#define GX_BP_REG_INDTEVSTAGE13 0x1D // indirect TEV stage 13 +#define GX_BP_REG_INDTEVSTAGE14 0x1E // indirect TEV stage 14 +#define GX_BP_REG_INDTEVSTAGE15 0x1F // indirect TEV stage 15 + +// performance manips +#define GX_BP_REG_SCISSORTL 0x20 // scissor top left +#define GX_BP_REG_SCISSORBR 0x21 // scissor bottom right +#define GX_BP_REG_LINEPTWIDTH 0x22 // line point width +#define GX_BP_REG_PERF0TRI 0x23 // performance 0 (triangle) +#define GX_BP_REG_PERF0QUAD 0x24 // performance 0 (quad) + +// rasters +#define GX_BP_REG_RAS1_SS0 0x25 +#define GX_BP_REG_RAS1_SS1 0x26 +#define GX_BP_REG_RAS1_IREF 0x27 +#define GX_BP_REG_RAS1_TREF0 0x28 +#define GX_BP_REG_RAS1_TREF1 0x29 +#define GX_BP_REG_RAS1_TREF2 0x2A +#define GX_BP_REG_RAS1_TREF3 0x2B +#define GX_BP_REG_RAS1_TREF4 0x2C +#define GX_BP_REG_RAS1_TREF5 0x2D +#define GX_BP_REG_RAS1_TREF6 0x2E +#define GX_BP_REG_RAS1_TREF7 0x2F + +// setup sizes +#define GX_BP_REG_SU_SSIZE0 0x30 +#define GX_BP_REG_SU_TSIZE0 0x31 +#define GX_BP_REG_SU_SSIZE1 0x32 +#define GX_BP_REG_SU_TSIZE1 0x33 +#define GX_BP_REG_SU_SSIZE2 0x34 +#define GX_BP_REG_SU_TSIZE2 0x35 +#define GX_BP_REG_SU_SSIZE3 0x36 +#define GX_BP_REG_SU_TSIZE3 0x37 +#define GX_BP_REG_SU_SSIZE4 0x38 +#define GX_BP_REG_SU_TSIZE4 0x39 +#define GX_BP_REG_SU_SSIZE5 0x3A +#define GX_BP_REG_SU_TSIZE5 0x3B +#define GX_BP_REG_SU_SSIZE6 0x3C +#define GX_BP_REG_SU_TSIZE6 0x3D +#define GX_BP_REG_SU_SSIZE7 0x3E +#define GX_BP_REG_SU_TSIZE7 0x3F + +// Z and blend controls +#define GX_BP_REG_ZMODE 0x40 +#define GX_BP_REG_BLENDMODE 0x41 +#define GX_BP_REG_DSTALPHA 0x42 +#define GX_BP_REG_ZCONTROL 0x43 +#define GX_BP_REG_FIELDMASK 0x44 +#define GX_BP_REG_DRAWDONE 0x45 +#define GX_BP_REG_PETOKEN 0x47 +#define GX_BP_REG_PETOKENINT 0x48 + +// copying +#define GX_BP_REG_TEXCOPYSRCXY 0x49 +#define GX_BP_REG_TEXCOPYSRCWH 0x4A +#define GX_BP_REG_TEXCOPYDST 0x4B +#define GX_BP_REG_DISPCOPYSTRIDE 0x4D +#define GX_BP_REG_DISPCOPYSCALEY 0x4E +#define GX_BP_REG_COPYCLEARAR 0x4F +#define GX_BP_REG_COPYCLEARGB 0x50 +#define GX_BP_REG_COPYCLEARZ 0x51 +#define GX_BP_REG_COPYFILTER0 0x53 +#define GX_BP_REG_COPYFILTER1 0x54 + +// +#define GX_BP_REG_BOUNDINGBOX0 0x55 +#define GX_BP_REG_BOUNDINGBOX1 0x56 + +#define GX_BP_REG_SCISSOROFFSET 0x59 + +// texture memory +#define GX_BP_REG_TMEMPRELOADADDR 0x60 +#define GX_BP_REG_TMEMPRELOADEVEN 0x61 +#define GX_BP_REG_TMEMPRELOADODD 0x62 +#define GX_BP_REG_TMEMPRELOADMODE 0x63 +#define GX_BP_REG_TMEMTLUTSRC 0x64 +#define GX_BP_REG_TMEMTLUTDST 0x65 +#define GX_BP_REG_TMEMTEXINVALIDATE 0x66 + +// performance 1 +#define GX_BP_REG_PERF1 0x67 +#define GX_BP_REG_FIELDMODE 0x68 + +// set modes +#define GX_BP_REG_SETMODE0_TEX0 0x80 +#define GX_BP_REG_SETMODE0_TEX1 0x81 +#define GX_BP_REG_SETMODE0_TEX2 0x82 +#define GX_BP_REG_SETMODE0_TEX3 0x83 +#define GX_BP_REG_SETMODE1_TEX0 0x84 +#define GX_BP_REG_SETMODE1_TEX1 0x85 +#define GX_BP_REG_SETMODE1_TEX2 0x86 +#define GX_BP_REG_SETMODE1_TEX3 0x87 + +// set images +#define GX_BP_REG_SETIMAGE0_TEX0 0x88 +#define GX_BP_REG_SETIMAGE0_TEX1 0x89 +#define GX_BP_REG_SETIMAGE0_TEX2 0x8A +#define GX_BP_REG_SETIMAGE0_TEX3 0x8B +#define GX_BP_REG_SETIMAGE1_TEX0 0x8C +#define GX_BP_REG_SETIMAGE1_TEX1 0x8D +#define GX_BP_REG_SETIMAGE1_TEX2 0x8E +#define GX_BP_REG_SETIMAGE1_TEX3 0x8F +#define GX_BP_REG_SETIMAGE2_TEX0 0x90 +#define GX_BP_REG_SETIMAGE2_TEX1 0x91 +#define GX_BP_REG_SETIMAGE2_TEX2 0x92 +#define GX_BP_REG_SETIMAGE2_TEX3 0x93 +#define GX_BP_REG_SETIMAGE3_TEX0 0x94 +#define GX_BP_REG_SETIMAGE3_TEX1 0x95 +#define GX_BP_REG_SETIMAGE3_TEX2 0x96 +#define GX_BP_REG_SETIMAGE3_TEX3 0x97 + +// set texture lookups +#define GX_BP_REG_SETTLUT_TEX0 0x98 +#define GX_BP_REG_SETTLUT_TEX1 0x99 +#define GX_BP_REG_SETTLUT_TEX2 0x9A +#define GX_BP_REG_SETTLUT_TEX3 0x9B + +// set modes continued +#define GX_BP_REG_SETMODE0_TEX4 0xA0 +#define GX_BP_REG_SETMODE0_TEX5 0xA1 +#define GX_BP_REG_SETMODE0_TEX6 0xA2 +#define GX_BP_REG_SETMODE0_TEX7 0xA3 +#define GX_BP_REG_SETMODE1_TEX4 0xA4 +#define GX_BP_REG_SETMODE1_TEX5 0xA5 +#define GX_BP_REG_SETMODE1_TEX6 0xA6 +#define GX_BP_REG_SETMODE1_TEX7 0xA7 + +// set images continued +#define GX_BP_REG_SETIMAGE0_TEX4 0xA8 +#define GX_BP_REG_SETIMAGE0_TEX5 0xA9 +#define GX_BP_REG_SETIMAGE0_TEX6 0xAA +#define GX_BP_REG_SETIMAGE0_TEX7 0xAB +#define GX_BP_REG_SETIMAGE1_TEX4 0xAC +#define GX_BP_REG_SETIMAGE1_TEX5 0xAD +#define GX_BP_REG_SETIMAGE1_TEX6 0xAE +#define GX_BP_REG_SETIMAGE1_TEX7 0xAF +#define GX_BP_REG_SETIMAGE2_TEX4 0xB0 +#define GX_BP_REG_SETIMAGE2_TEX5 0xB1 +#define GX_BP_REG_SETIMAGE2_TEX6 0xB2 +#define GX_BP_REG_SETIMAGE2_TEX7 0xB3 +#define GX_BP_REG_SETIMAGE3_TEX4 0xB4 +#define GX_BP_REG_SETIMAGE3_TEX5 0xB5 +#define GX_BP_REG_SETIMAGE3_TEX6 0xB6 +#define GX_BP_REG_SETIMAGE3_TEX7 0xB7 + +// set texture lookups continued +#define GX_BP_REG_SETTLUT_TEX4 0xB8 +#define GX_BP_REG_SETTLUT_TEX5 0xB9 +#define GX_BP_REG_SETTLUT_TEX6 0xBA +#define GX_BP_REG_SETTLUT_TEX7 0xBB + +// TEV color manips +#define GX_BP_REG_TEVCOLORCOMBINER0 0xC0 +#define GX_BP_REG_TEVALPHACOMBINER0 0xC1 +#define GX_BP_REG_TEVCOLORCOMBINER1 0xC2 +#define GX_BP_REG_TEVALPHACOMBINER1 0xC3 +#define GX_BP_REG_TEVCOLORCOMBINER2 0xC4 +#define GX_BP_REG_TEVALPHACOMBINER2 0xC5 +#define GX_BP_REG_TEVCOLORCOMBINER3 0xC6 +#define GX_BP_REG_TEVALPHACOMBINER3 0xC7 +#define GX_BP_REG_TEVCOLORCOMBINER4 0xC8 +#define GX_BP_REG_TEVALPHACOMBINER4 0xC9 +#define GX_BP_REG_TEVCOLORCOMBINER5 0xCA +#define GX_BP_REG_TEVALPHACOMBINER5 0xCB +#define GX_BP_REG_TEVCOLORCOMBINER6 0xCC +#define GX_BP_REG_TEVALPHACOMBINER6 0xCD +#define GX_BP_REG_TEVCOLORCOMBINER7 0xCE +#define GX_BP_REG_TEVALPHACOMBINER7 0xCF +#define GX_BP_REG_TEVCOLORCOMBINER8 0xD0 +#define GX_BP_REG_TEVALPHACOMBINER8 0xD1 +#define GX_BP_REG_TEVCOLORCOMBINER9 0xD2 +#define GX_BP_REG_TEVALPHACOMBINER9 0xD3 +#define GX_BP_REG_TEVCOLORCOMBINER10 0xD4 +#define GX_BP_REG_TEVALPHACOMBINER10 0xD5 +#define GX_BP_REG_TEVCOLORCOMBINER11 0xD6 +#define GX_BP_REG_TEVALPHACOMBINER11 0xD7 +#define GX_BP_REG_TEVCOLORCOMBINER12 0xD8 +#define GX_BP_REG_TEVALPHACOMBINER12 0xD9 +#define GX_BP_REG_TEVCOLORCOMBINER13 0xDA +#define GX_BP_REG_TEVALPHACOMBINER13 0xDB +#define GX_BP_REG_TEVCOLORCOMBINER14 0xDC +#define GX_BP_REG_TEVALPHACOMBINER14 0xDD +#define GX_BP_REG_TEVCOLORCOMBINER15 0xDE +#define GX_BP_REG_TEVALPHACOMBINER15 0xDF + +// TEV registers +#define GX_BP_REG_TEVREG0LO 0xE0 +#define GX_BP_REG_TEVREG0HI 0xE1 +#define GX_BP_REG_TEVREG1LO 0xE2 +#define GX_BP_REG_TEVREG1HI 0xE3 +#define GX_BP_REG_TEVREG2LO 0xE4 +#define GX_BP_REG_TEVREG2HI 0xE5 +#define GX_BP_REG_TEVREG3LO 0xE6 +#define GX_BP_REG_TEVREG3HI 0xE7 + +// fog registers +#define GX_BP_REG_FOGRANGE 0xE8 +#define GX_BP_REG_FOGRANGEK0 0xE9 +#define GX_BP_REG_FOGRANGEK1 0xEA +#define GX_BP_REG_FOGRANGEK2 0xEB +#define GX_BP_REG_FOGRANGEK3 0xEC +#define GX_BP_REG_FOGRANGEK4 0xED +#define GX_BP_REG_FOGPARAM0 0xEE +#define GX_BP_REG_FOGPARAM1 0xEF +#define GX_BP_REG_FOGPARAM2 0xF0 +#define GX_BP_REG_FOGPARAM3 0xF1 +#define GX_BP_REG_FOGCOLOR 0xF2 + +// performance manip registers +#define GX_BP_REG_ALPHACOMPARE 0xF3 +#define GX_BP_REG_ZTEXTURE0 0xF4 +#define GX_BP_REG_ZTEXTURE1 0xF5 + +// TEV K selectors +#define GX_BP_REG_TEVKSEL0 0xF6 +#define GX_BP_REG_TEVKSEL1 0xF7 +#define GX_BP_REG_TEVKSEL2 0xF8 +#define GX_BP_REG_TEVKSEL3 0xF9 +#define GX_BP_REG_TEVKSEL4 0xFA +#define GX_BP_REG_TEVKSEL5 0xFB +#define GX_BP_REG_TEVKSEL6 0xFC +#define GX_BP_REG_TEVKSEL7 0xFD + +// SS mask +#define GX_BP_REG_SSMASK 0xFE + +// Transform Unit Registers +#define GX_XF_REG_ERROR 0x1000 +#define GX_XF_REG_DIAGNOSTICS 0x1001 +#define GX_XF_REG_STATE0 0x1002 +#define GX_XF_REG_STATE1 0x1003 +#define GX_XF_REG_CLOCK 0x1004 +#define GX_XF_REG_CLIPDISABLE 0x1005 +#define GX_XF_REG_PERF0 0x1006 +#define GX_XF_REG_PERF1 0x1007 +#define GX_XF_REG_INVERTEXSPEC 0x1008 +#define GX_XF_REG_NUMCOLORS 0x1009 +#define GX_XF_REG_AMBIENT0 0x100A +#define GX_XF_REG_AMBIENT1 0x100B +#define GX_XF_REG_MATERIAL0 0x100C +#define GX_XF_REG_MATERIAL1 0x100D +#define GX_XF_REG_COLOR0CNTRL 0x100E +#define GX_XF_REG_COLOR1CNTRL 0x100F +#define GX_XF_REG_ALPHA0CNTRL 0x1010 +#define GX_XF_REG_ALPHA1CNTRL 0x1011 +#define GX_XF_REG_DUALTEXTRAN 0x1012 +#define GX_XF_REG_MATRIXINDEX0 0x1018 +#define GX_XF_REG_MATRIXINDEX1 0x1019 +#define GX_XF_REG_SCALEX 0x101A +#define GX_XF_REG_SCALEY 0x101B +#define GX_XF_REG_SCALEZ 0x101C +#define GX_XF_REG_OFFSETX 0x101D +#define GX_XF_REG_OFFSETY 0x101E +#define GX_XF_REG_OFFSETZ 0x101F +#define GX_XF_REG_PROJECTIONA 0x1020 +#define GX_XF_REG_PROJECTIONB 0x1021 +#define GX_XF_REG_PROJECTIONC 0x1022 +#define GX_XF_REG_PROJECTIOND 0x1023 +#define GX_XF_REG_PROJECTIONE 0x1024 +#define GX_XF_REG_PROJECTIONF 0x1025 +#define GX_XF_REG_PROJECTORTHO 0x1026 +#define GX_XF_REG_NUMTEX 0x103F +#define GX_XF_REG_TEX0 0x1040 +#define GX_XF_REG_TEX1 0x1041 +#define GX_XF_REG_TEX2 0x1042 +#define GX_XF_REG_TEX3 0x1043 +#define GX_XF_REG_TEX4 0x1044 +#define GX_XF_REG_TEX5 0x1045 +#define GX_XF_REG_TEX6 0x1046 +#define GX_XF_REG_TEX7 0x1047 +#define GX_XF_REG_DUALTEX0 0x1050 +#define GX_XF_REG_DUALTEX1 0x1051 +#define GX_XF_REG_DUALTEX2 0x1052 +#define GX_XF_REG_DUALTEX3 0x1053 +#define GX_XF_REG_DUALTEX4 0x1054 +#define GX_XF_REG_DUALTEX5 0x1055 +#define GX_XF_REG_DUALTEX6 0x1056 +#define GX_XF_REG_DUALTEX7 0x1057 + +#define CP_REG_VCD_LO(pnMtxIdx, txMtxIdxMask, posn, norm, col0, col1) \ + ( \ + (pnMtxIdx) << 0 | \ + (txMtxIdxMask) << 1 | \ + (posn) << 9 | \ + (norm) << 11 | \ + (col0) << 13 | \ + (col1) << 15 \ + ) + +#define CP_REG_VCD_HI(tex0, tex1, tex2, tex3, tex4, tex5, tex6, tex7) \ + ( \ + (tex0) << 0 | \ + (tex1) << 2 | \ + (tex2) << 4 | \ + (tex3) << 6 | \ + (tex4) << 8 | \ + (tex5) << 10 | \ + (tex6) << 12 | \ + (tex7) << 14 \ + ) + +#define CP_REG_VAT_GRP0(posCnt, posType, posFrac, nrmCnt, nrmType, c0Cnt, c0Type, c1Cnt, c1Type, tx0Cnt, tx0Type, tx0Frac, p12, nrmIdx3) \ + ( \ + (posCnt) << 0 | \ + (posType) << 1 | \ + (posFrac) << 4 | \ + (nrmCnt) << 9 | \ + (nrmType) << 10 | \ + (c0Cnt) << 13 | \ + (c0Type) << 14 | \ + (c1Cnt) << 17 | \ + (c1Type) << 18 | \ + (tx0Cnt) << 21 | \ + (tx0Type) << 22 | \ + (tx0Frac) << 25 | \ + (p12) << 30 | \ + (nrmIdx3) << 31 \ + ) + +#define CP_REG_VAT_GRP1(tx1Cnt, tx1Type, tx1Frac, tx2Cnt, tx2Type, tx2Frac, tx3Cnt, tx3Type, tx3Frac, tx4Cnt, tx4Type, p11) \ + ( \ + (tx1Cnt) << 0 | \ + (tx1Type) << 1 | \ + (tx1Frac) << 4 | \ + (tx2Cnt) << 9 | \ + (tx2Type) << 10 | \ + (tx2Frac) << 13 | \ + (tx3Cnt) << 18 | \ + (tx3Type) << 19 | \ + (tx3Frac) << 22 | \ + (tx4Cnt) << 27 | \ + (tx4Type) << 28 | \ + p11 << 31 \ + ) + +#define CP_REG_VAT_GRP2(tx4Frac, tx5Cnt, tx5Type, tx5Frac, tx6Cnt, tx6Type, tx6Frac, tx7Cnt, tx7Type, tx7Frac) \ + ( \ + (tx4Frac) << 0 | \ + (tx5Cnt) << 5 | \ + (tx5Type) << 6 | \ + (tx5Frac) << 9 | \ + (tx6Cnt) << 14 | \ + (tx6Type) << 15 | \ + (tx6Frac) << 18 | \ + (tx7Cnt) << 23 | \ + (tx7Type) << 24 | \ + (tx7Frac) << 27 \ + ) + +// Transform unit register IDs +#define XF_REG_ERROR_ID 0x1000 +#define XF_REG_DIAGNOSTICS_ID 0x1001 +#define XF_REG_STATE0_ID 0x1002 +#define XF_REG_STATE1_ID 0x1003 +#define XF_REG_CLOCK_ID 0x1004 +#define XF_REG_CLIPDISABLE_ID 0x1005 +#define XF_REG_PERF0_ID 0x1006 +#define XF_REG_PERF1_ID 0x1007 +#define XF_REG_INVERTEXSPEC_ID 0x1008 +#define XF_REG_NUMCOLORS_ID 0x1009 +#define XF_REG_DUALTEXTRAN_ID 0x1012 +#define XF_REG_SCALEX_ID 0x101A +#define XF_REG_SCALEY_ID 0x101B +#define XF_REG_SCALEZ_ID 0x101C +#define XF_REG_OFFSETX_ID 0x101D +#define XF_REG_OFFSETY_ID 0x101E +#define XF_REG_OFFSETZ_ID 0x101F +#define XF_REG_NUMTEX_ID 0x103F +#define XF_REG_TEX0_ID 0x1040 +#define XF_REG_TEX1_ID 0x1041 +#define XF_REG_TEX2_ID 0x1042 +#define XF_REG_TEX3_ID 0x1043 +#define XF_REG_TEX4_ID 0x1044 +#define XF_REG_TEX5_ID 0x1045 +#define XF_REG_TEX6_ID 0x1046 +#define XF_REG_TEX7_ID 0x1047 +#define XF_REG_DUALTEX0_ID 0x1050 +#define XF_REG_DUALTEX1_ID 0x1051 +#define XF_REG_DUALTEX2_ID 0x1052 +#define XF_REG_DUALTEX3_ID 0x1053 +#define XF_REG_DUALTEX4_ID 0x1054 +#define XF_REG_DUALTEX5_ID 0x1055 +#define XF_REG_DUALTEX6_ID 0x1056 +#define XF_REG_DUALTEX7_ID 0x1057 + +#define XF_REG_INVTXSPEC(ncols, nnorms, ntexs) \ + ( \ + (ncols) << 0 | \ + (nnorms) << 2 | \ + (ntexs) << 4 \ + ) + +#define XF_REG_TEX(proj, form, tgType, row, embossRow, embossLit) \ + ( \ + (proj) << 1 | \ + (form) << 2 | \ + (tgType) << 4 | \ + (row) << 7 | \ + (embossRow) << 12 | \ + (embossLit) << 15 \ + ) + +#define XF_REG_DUALTEX(mtx, normalize) \ + ( \ + (mtx) << 0 | \ + (normalize) << 8 \ + ) + +#define BP_GEN_MODE(nTexGens, nChans, nTevs, p4, nInds) \ + ( \ + (u32)(nTexGens) << 0 | \ + (u32)(nChans) << 4 | \ + (u32)(nTevs) << 10 | \ + (u32)(p4) << 14 | \ + (u32)(nInds) << 16 \ + ) + +#define BP_LP_SIZE(lineWidth, pointSize, lineOffset, pointOffset, lineHalfAspect, p5) \ + ( \ + (u32)(lineWidth) << 0 | \ + (u32)(pointSize) << 8 | \ + (u32)(lineOffset) << 16 | \ + (u32)(pointOffset) << 19 | \ + (u32)(lineHalfAspect) << 22 | \ + (u32)(p5) << 24 \ + ) + +void GDSetVtxDescv(const GXVtxDescList* attrPtr); +void GDSetVtxAttrFmtv(GXVtxFmt vtxfmt, const GXVtxAttrFmtList* list); +void GDSetArray(GXAttr attr, void* base_ptr, u8 stride); +void GDSetArrayRaw(GXAttr attr, u32 base_ptr_raw, u8 stride); +void GDPatchArrayPtr(void* base_ptr); +void GDSetTexCoordGen(GXTexCoordID dst_coord, GXTexGenType func, GXTexGenSrc src_param, u8 normalize, u32 postmtx); +void GDSetCullMode(GXCullMode mode); +void GDSetGenMode(u8 nTexGens, u8 nChans, u8 nTevs); +void GDSetGenMode2(u8 nTexGens, u8 nChans, u8 nTevs, u8 nInds, GXCullMode cm); +void GDSetLPSize(u8 lineWidth, u8 pointSize, GXTexOffset lineOffset, GXTexOffset pointOffset, u8 lineHalfAspect); +void GDSetCoPlanar(u8 enable); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/gd/GDIndirect.h b/include/revolution/gd/GDIndirect.h new file mode 100644 index 00000000000..ea79ebaab00 --- /dev/null +++ b/include/revolution/gd/GDIndirect.h @@ -0,0 +1,91 @@ +#ifndef _REVOLUTION_GD_INDIRECT_H_ +#define _REVOLUTION_GD_INDIRECT_H_ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define BP_TEV_INDIRECT(ind_stage, format, bias_sel, alpha_sel, mtx_sel, wrap_s, wrap_t, utc_lod, add_prev, id) \ + ( \ + (u32)(ind_stage) << 0 | \ + (u32)(format) << 2 | \ + (u32)(bias_sel) << 4 | \ + (u32)(alpha_sel) << 7 | \ + (u32)(mtx_sel) << 9 | \ + (u32)(wrap_s) << 13 | \ + (u32)(wrap_t) << 16 | \ + (u32)(utc_lod) << 19 | \ + (u32)(add_prev) << 20 | \ + (u32)(id) << 24 \ + ) + +#define BP_IND_MTX(m0, m1, scale_exp, id) \ + ( \ + (u32)(m0) << 0 | \ + (u32)(m1) << 11 | \ + (u32)(scale_exp) << 22 | \ + (u32)(id) << 24 \ + ) + +#define BP_IND_TEXCOORD_SCALE(scaleS0, scaleT0, scaleS1, scaleT1, id) \ + ( \ + (u32)(scaleS0) << 0 | \ + (u32)(scaleT0) << 4 | \ + (u32)(scaleS1) << 8 | \ + (u32)(scaleT1) << 12 | \ + (u32)(id) << 24 \ + ) + +#define BP_IND_TEX_ORDER(map0, coord0, map1, coord1, map2, coord2, map3, coord3, id) \ + ( \ + (u32)(map0) << 0 | \ + (u32)(coord0) << 3 | \ + (u32)(map1) << 6 | \ + (u32)(coord1) << 9 | \ + (u32)(map2) << 12 | \ + (u32)(coord2) << 15 | \ + (u32)(map3) << 18 | \ + (u32)(coord3) << 21 | \ + (u32)(id) << 24 \ + ) + +#define BP_IND_MASK(mask, id) \ + ( \ + (u32)(mask) << 0 | \ + (u32)(id) << 24 \ + ) + +void GDSetTevIndirect(GXTevStageID tev_stage, GXIndTexStageID ind_stage, + GXIndTexFormat format, GXIndTexBiasSel bias_sel, + GXIndTexMtxID matrix_sel, GXIndTexWrap wrap_s, + GXIndTexWrap wrap_t, u8 add_prev, u8 utc_lod, + GXIndTexAlphaSel alpha_sel); +void GDSetIndTexMtx(GXIndTexMtxID mtx_id, const f32 offset[2][3], s8 scale_exp); +void GDSetIndTexCoordScale(GXIndTexStageID indStageEven, GXIndTexScale scaleS0, + GXIndTexScale scaleT0, GXIndTexScale scaleS1, + GXIndTexScale scaleT1); +void GDSetIndTexOrder(GXTexCoordID texCoord0, GXTexMapID texMap0, + GXTexCoordID texCoord1, GXTexMapID texMap1, + GXTexCoordID texCoord2, GXTexMapID texMap2, + GXTexCoordID texCoord3, GXTexMapID texMap3); +void GDSetTevDirect(GXTevStageID tev_stage); +void GDSetTevIndWarp(GXTevStageID tev_stage, GXIndTexStageID ind_stage, u8 signed_offset, u8 replace_mode, GXIndTexMtxID matrix_sel); +void GDSetTevIndTile(GXTevStageID tev_stage, GXIndTexStageID ind_stage, + u16 tilesize_s, u16 tilesize_t, u16 tilespacing_s, + u16 tilespacing_t, GXIndTexFormat format, + GXIndTexMtxID matrix_sel, GXIndTexBiasSel bias_sel, + GXIndTexAlphaSel alpha_sel); +void GDSetTevIndBumpST(GXTevStageID tev_stage, GXIndTexStageID ind_stage, GXIndTexMtxID matrix_sel); +void GDSetTevIndBumpXYZ(GXTevStageID tev_stage, GXIndTexStageID ind_stage, GXIndTexMtxID matrix_sel); +void GDSetTevIndRepeat(GXTevStageID tev_stage); +void __GDSetIndTexMask(u32 mask); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/gd/GDLight.h b/include/revolution/gd/GDLight.h new file mode 100644 index 00000000000..f5ee020f5d6 --- /dev/null +++ b/include/revolution/gd/GDLight.h @@ -0,0 +1,74 @@ +#ifndef _REVOLUTION_GD_LIGHT_H_ +#define _REVOLUTION_GD_LIGHT_H_ + +#include +#include +#include "global.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define XF_LIGHT_ID 0x0600 +#define XF_LIGHT_COLOR_ID 0x0603 +#define XF_LIGHT_ATTN_ID 0x0604 +#define XF_LIGHT_DISTATTN_ID 0x0607 +#define XF_LIGHT_POS_ID 0x060A +#define XF_LIGHT_SPEC_DIR_ID 0x060A +#define XF_LIGHT_DIR_ID 0x060D + +#define XF_REG_AMBIENT0_ID 0x100A +#define XF_REG_AMBIENT1_ID 0x100B +#define XF_REG_MATERIAL0_ID 0x100C +#define XF_REG_MATERIAL1_ID 0x100D +#define XF_REG_COLOR0CNTRL_ID 0x100E +#define XF_REG_COLOR1CNTRL_ID 0x100F +#define XF_REG_ALPHA0CNTRL_ID 0x1010 +#define XF_REG_ALPHA1CNTRL_ID 0x1011 + +#define XF_REG_CHAN_CTRL(matsrc, enable, lightmask0, ambsrc, diff_fn, p5, p6, lightmask4) \ + ( \ + (u32)(matsrc) << 0 | \ + (u32)(enable) << 1 | \ + (u32)(lightmask0) << 2 | \ + (u32)(ambsrc) << 6 | \ + (u32)(diff_fn) << 7 | \ + (u32)(p5) << 9 | \ + (u32)(p6) << 10 | \ + (u32)(lightmask4) << 11 \ + ) + +void GDSetLightAttn(GXLightID light, f32 a0, f32 a1, f32 a2, f32 k0, f32 k1, f32 k2); +void GDSetLightSpot(GXLightID light, f32 cutoff, GXSpotFn spot_func); +void GDSetLightDistAttn(GXLightID light, f32 ref_dist, f32 ref_br, GXDistAttnFn dist_func); +void GDSetLightColor(GXLightID light, GXColor color); +void GDSetLightPos(GXLightID light, f32 x, f32 y, f32 z); +void GDSetLightDir(GXLightID light, f32 nx, f32 ny, f32 nz); +void GDSetSpecularDirHA(GXLightID light, f32 nx, f32 ny, f32 nz, f32 hx, f32 hy, f32 hz); +void GDSetSpecularDir(GXLightID light, f32 nx, f32 ny, f32 nz); +void GDLoadLightObjIndx(u32 lt_obj_indx, GXLightID light); +void GDSetChanAmbColor(GXChannelID chan, GXColor color); +void GDSetChanMatColor(GXChannelID chan, GXColor color); +void GDSetChanCtrl(GXChannelID chan, u8 enable, GXColorSrc amb_src, + GXColorSrc mat_src, u32 light_mask, GXDiffuseFn diff_fn, + GXAttnFn attn_fn); + +inline static u16 __GDLightID2Index(GXLightID id) { + u16 idx; + + idx = 0x1F - __cntlzw(id); + if (idx > 7) { + idx = 0; + } + return idx; +} + +inline static u16 __GDLightID2Offset(GXLightID id) { + return __GDLightID2Index(id) * 16; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/gd/GDPixel.h b/include/revolution/gd/GDPixel.h new file mode 100644 index 00000000000..ce377aca98f --- /dev/null +++ b/include/revolution/gd/GDPixel.h @@ -0,0 +1,95 @@ +#ifndef _REVOLUTION_GD_PIXEL_H +#define _REVOLUTION_GD_PIXEL_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define BP_FOG_UNK0(a, id) \ + ( \ + (u32)(a) << 0 | \ + (u32)(id) << 24 \ + ) + +#define BP_FOG_UNK1(b_m, id) \ + ( \ + (u32)(b_m) << 0 | \ + (u32)(id) << 24 \ + ) + +#define BP_FOG_UNK2(b_expn, id) \ + ( \ + (u32)(b_expn) << 0 | \ + (u32)(id) << 24 \ + ) + +#define BP_FOG_UNK3(c, proj, fsel, id) \ + ( \ + (u32)(c) << 0 | \ + (u32)(proj) << 20 | \ + (u32)(fsel) << 21 | \ + (u32)(id) << 24 \ + ) + +#define BP_FOG_COLOR(r, g, b, id) \ + ( \ + (u32)(b) << 0 | \ + (u32)(g) << 8 | \ + (u32)(r) << 16 | \ + (u32)(id) << 24 \ + ) + +#define BP_BLEND_MODE(enable, enable_logic, enable_dither, enable_color_update, enable_alpha_update, dst_factor, src_factor, blend_sub, logic_op, id) \ + ( \ + (u32)(enable) << 0 | \ + (u32)(enable_logic) << 1 | \ + (u32)(enable_dither) << 2 | \ + (u32)(enable_color_update) << 3 | \ + (u32)(enable_alpha_update) << 4 | \ + (u32)(dst_factor) << 5 | \ + (u32)(src_factor) << 8 | \ + (u32)(blend_sub) << 11 | \ + (u32)(logic_op) << 12 | \ + (u32)(id) << 24 \ + ) + +#define BP_Z_MODE(enable_compare, compare_fn, enable_update, id) \ + ( \ + (u32)(enable_compare) << 0 | \ + (u32)(compare_fn) << 1 | \ + (u32)(enable_update) << 4 | \ + (u32)(id) << 24 \ + ) + +#define BP_DST_ALPHA(alpha, enable, id) \ + ( \ + (u32)(alpha) << 0 | \ + (u32)(enable) << 8 | \ + (u32)(id) << 24 \ + ) + +#define BP_TOKEN(token, id) \ + ( \ + (u32)(token) << 0 | \ + (u32)(id) << 24 \ + ) + +void GDSetFog(GXFogType type, f32 startz, f32 endz, f32 nearz, f32 farz, GXColor color); +void GDSetBlendMode(GXBlendMode type, GXBlendFactor src_factor, GXBlendFactor dst_factor, GXLogicOp logic_op); +void GDSetBlendModeEtc(GXBlendMode type, GXBlendFactor src_factor, + GXBlendFactor dst_factor, GXLogicOp logic_op, + u8 color_update_enable, + u8 alpha_update_enable, + u8 dither_enable); +void GDSetZMode(u8 compare_enable, GXCompare func, u8 update_enable); +void GDSetDstAlpha(u8 enable, u8 alpha); +void GDSetDrawSync(u16 token); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/gd/GDTev.h b/include/revolution/gd/GDTev.h new file mode 100644 index 00000000000..b7e61ee021a --- /dev/null +++ b/include/revolution/gd/GDTev.h @@ -0,0 +1,133 @@ +#ifndef _REVOLUTION_GD_TEV_H +#define _REVOLUTION_GD_TEV_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define BP_TEV_COLOR(d, c, b, a, bias, op, clamp, scale, out, id) \ + ( \ + (u32)(d) << 0 | \ + (u32)(c) << 4 | \ + (u32)(b) << 8 | \ + (u32)(a) << 12 | \ + (u32)(bias) << 16 | \ + (u32)(op) << 18 | \ + (u32)(clamp) << 19 | \ + (u32)(scale) << 20 | \ + (u32)(out) << 22 | \ + (u32)(id) << 24 \ + ) + +#define BP_TEV_ALPHA(ras_sel, tex_sel, d, c, b, a, bias, op, clamp, scale, out, id) \ + ( \ + (u32)(ras_sel) << 0 | \ + (u32)(tex_sel) << 2 | \ + (u32)(d) << 4 | \ + (u32)(c) << 7 | \ + (u32)(b) << 10 | \ + (u32)(a) << 13 | \ + (u32)(bias) << 16 | \ + (u32)(op) << 18 | \ + (u32)(clamp) << 19 | \ + (u32)(scale) << 20 | \ + (u32)(out) << 22 | \ + (u32)(id) << 24 \ + ) + +#define BP_TEV_COLOR_REG_RA(r, a, reg, id) \ + ( \ + (u32)(r) << 0 | \ + (u32)(a) << 12 | \ + (u32)(reg) << 23 | \ + (u32)(id) << 24 \ + ) + +#define BP_TEV_COLOR_REG_BG(b, g, reg, id) \ + ( \ + (u32)(b) << 0 | \ + (u32)(g) << 12 | \ + (u32)(reg) << 23 | \ + (u32)(id) << 24 \ + ) + +#define BP_TEV_KSEL(rb, ga, kcsel0, kasel0, kcsel1, kasel1, id) \ + ( \ + (u32)(rb) << 0 | \ + (u32)(ga) << 2 | \ + (u32)(kcsel0) << 4 | \ + (u32)(kasel0) << 9 | \ + (u32)(kcsel1) << 14 | \ + (u32)(kasel1) << 19 | \ + (u32)(id) << 24 \ + ) + +#define BP_ALPHA_COMPARE(ref0, ref1, comp0, comp1, op, id) \ + ( \ + (u32)(ref0) << 0 | \ + (u32)(ref1) << 8 | \ + (u32)(comp0) << 16 | \ + (u32)(comp1) << 19 | \ + (u32)(op) << 22 | \ + (u32)(id) << 24 \ + ) + +#define BP_ZTEX_PARAMS_0(bias, id) \ + ( \ + (u32)(bias) << 0 | \ + (u32)(id) << 24 \ + ) + +#define BP_ZTEX_PARAMS_1(zfmt, op, id) \ + ( \ + (u32)(zfmt) << 0 | \ + (u32)(op) << 2 | \ + (u32)(id) << 24 \ + ) + +#define BP_TEV_ORDER(map0, coord0, enable0, color0, map1, coord1, enable1, color1, id) \ + ( \ + (u32)(map0) << 0 | \ + (u32)(coord0) << 3 | \ + (u32)(enable0) << 6 | \ + (u32)(color0) << 7 | \ + (u32)(map1) << 12 | \ + (u32)(coord1) << 15 | \ + (u32)(enable1) << 18 | \ + (u32)(color1) << 19 | \ + (u32)(id) << 24 \ + ) + +void GDSetTevOp(GXTevStageID stage, GXTevMode mode); +void GDSetTevColorCalc(GXTevStageID stage, GXTevColorArg a, GXTevColorArg b, + GXTevColorArg c, GXTevColorArg d, GXTevOp op, + GXTevBias bias, GXTevScale scale, u8 clamp, + GXTevRegID out_reg); +void GDSetTevAlphaCalcAndSwap(GXTevStageID stage, GXTevAlphaArg a, + GXTevAlphaArg b, GXTevAlphaArg c, GXTevAlphaArg d, + GXTevOp op, GXTevBias bias, GXTevScale scale, + u8 clamp, GXTevRegID out_reg, + GXTevSwapSel ras_sel, GXTevSwapSel tex_sel); +void GDSetTevColor(GXTevRegID reg, GXColor color); +void GDSetTevColorS10(GXTevRegID reg, GXColorS10 color); +void GDSetTevKColor(GXTevKColorID reg, GXColor color); +void GDSetTevKonstantSel(GXTevStageID evenStage, GXTevKColorSel kcsel0, + GXTevKAlphaSel kasel0, GXTevKColorSel kcsel1, + GXTevKAlphaSel kasel1); +void GDSetTevSwapModeTable(GXTevSwapSel table, GXTevColorChan red, + GXTevColorChan green, GXTevColorChan blue, + GXTevColorChan alpha); +void GDSetAlphaCompare(GXCompare comp0, u8 ref0, GXAlphaOp op, GXCompare comp1, u8 ref1); +void GDSetZTexture(GXZTexOp op, GXTexFmt fmt, u32 bias); +void GDSetTevOrder(GXTevStageID evenStage, GXTexCoordID coord0, GXTexMapID map0, + GXChannelID color0, GXTexCoordID coord1, GXTexMapID map1, + GXChannelID color1); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/gd/GDTexture.h b/include/revolution/gd/GDTexture.h new file mode 100644 index 00000000000..7aba7164861 --- /dev/null +++ b/include/revolution/gd/GDTexture.h @@ -0,0 +1,127 @@ +#ifndef _REVOLUTION_GD_TEXTURE_H +#define _REVOLUTION_GD_TEXTURE_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define BP_TEX_MODE0(wrap_s, wrap_t, mag_filt, min_filt, edge_lod, lod_bias, max_aniso, bias_clamp, id) \ + ( \ + (u32)(wrap_s) << 0 | \ + (u32)(wrap_t) << 2 | \ + (u32)(mag_filt) << 4 | \ + (u32)(min_filt) << 5 | \ + (u32)(edge_lod) << 8 | \ + (u32)(lod_bias) << 9 | \ + (u32)(max_aniso) << 19 | \ + (u32)(bias_clamp) << 21 | \ + (u32)(id) << 24 \ + ) + +#define BP_TEX_MODE1(min_lod, max_lod, id) \ + ( \ + (u32)(min_lod) << 0 | \ + (u32)(max_lod) << 8 | \ + (u32)(id) << 24 \ + ) + +#define BP_IMAGE_ATTR(width, height, format, id) \ + ( \ + (u32)(width) << 0 | \ + (u32)(height) << 10 | \ + (u32)(format) << 20 | \ + (u32)(id) << 24 \ + ) + +#define BP_IMAGE_PTR(ptr, id) \ + ( \ + (u32)(ptr) << 0 | \ + (u32)(id) << 24 \ + ) + +#define BP_TEX_CACHE_EVEN(tmem, size0, size1, type, id) \ + ( \ + (u32)(tmem) << 0 | \ + (u32)(size0) << 15 | \ + (u32)(size1) << 18 | \ + (u32)(type) << 21 | \ + (u32)(id) << 24 \ + ) + +#define BP_TEX_CACHE_ODD(tmem, size0, size1, id) \ + ( \ + (u32)(tmem) << 0 | \ + (u32)(size0) << 15 | \ + (u32)(size1) << 18 | \ + (u32)(id) << 24 \ + ) + +#define BP_TEX_TLUT(tmem, format, id) \ + ( \ + (u32)(tmem) << 0 | \ + (u32)(format) << 10 | \ + (u32)(id) << 24 \ + ) + +#define BP_TEXCOORD_S_SCALE(s_scale, s_bias, s_wrap, line_offset, point_offset, id) \ + ( \ + (u32)(s_scale) << 0 | \ + (u32)(s_bias) << 16 | \ + (u32)(s_wrap) << 17 | \ + (u32)(line_offset) << 18 | \ + (u32)(point_offset) << 19 | \ + (u32)(id) << 24 \ + ) + +#define BP_TEXCOORD_T_SCALE(t_scale, t_bias, t_wrap, id) \ + ( \ + (u32)(t_scale) << 0 | \ + (u32)(t_bias) << 16 | \ + (u32)(t_wrap) << 17 | \ + (u32)(id) << 24 \ + ) + +#define BP_LOAD_TLUT0(ptr, id) \ + ( \ + (u32)(ptr) << 0 | \ + (u32)(id) << 24 \ + ) + +#define BP_LOAD_TLUT1(ptr, size, id) \ + ( \ + (u32)(ptr) << 0 | \ + (u32)(size) << 10 | \ + (u32)(id) << 24 \ + ) + +void GDSetTexLookupMode(GXTexMapID id, GXTexWrapMode wrap_s, + GXTexWrapMode wrap_t, GXTexFilter min_filt, + GXTexFilter mag_filt, f32 min_lod, f32 max_lod, + f32 lod_bias, u8 bias_clamp, u8 do_edge_lod, + GXAnisotropy max_aniso); + +void GDSetTexImgAttr(GXTexMapID id, u16 width, u16 height, GXTexFmt format); +void GDSetTexImgPtr(GXTexMapID id, void* image_ptr); +void GDSetTexImgPtrRaw(GXTexMapID id, u32 image_ptr_raw); +void GDPatchTexImgPtr(void* image_ptr); +void GDSetTexCached(GXTexMapID id, u32 tmem_even, GXTexCacheSize size_even, + u32 tmem_odd, GXTexCacheSize size_odd); +void GDSetTexPreLoaded(GXTexMapID id, u32 tmem_even, u32 tmem_odd); +void GDSetTexTlut(GXTexMapID id, u32 tmem_addr, GXTlutFmt format); +void GDSetTexCoordScale(GXTexCoordID coord, u16 s_scale, u16 t_scale); +void GDSetTexCoordScale2(GXTexCoordID coord, u16 s_scale, u8 s_bias, + u8 s_wrap, u16 t_scale, u8 t_bias, u8 t_wrap); +void GDSetTexCoordScaleAndTOEs(GXTexCoordID coord, u16 s_scale, u8 s_bias, + u8 s_wrap, u16 t_scale, u8 t_bias, u8 t_wrap, + u8 line_offset, u8 point_offset); +void GDLoadTlut(void* tlut_ptr, u32 tmem_addr, GXTlutSize size); +void GDLoadTlutRaw(u32 tlut_ptr_raw, u32 tmem_addr, GXTlutSize size); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/gd/GDTransform.h b/include/revolution/gd/GDTransform.h new file mode 100644 index 00000000000..18d53f98a25 --- /dev/null +++ b/include/revolution/gd/GDTransform.h @@ -0,0 +1,56 @@ +#ifndef _REVOLUTION_GD_TRANSFORM_H_ +#define _REVOLUTION_GD_TRANSFORM_H_ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define CP_MTX_REG_A_ID 0x30 +#define CP_MTX_REG_B_ID 0x40 + +#define XF_REG_MATRIXINDEX0_ID 0x1018 +#define XF_REG_MATRIXINDEX1_ID 0x1019 +#define XF_REG_PROJECTIONA_ID 0x1020 +#define XF_REG_PROJECTIONB_ID 0x1021 +#define XF_REG_PROJECTIONC_ID 0x1022 +#define XF_REG_PROJECTIOND_ID 0x1023 +#define XF_REG_PROJECTIONE_ID 0x1024 +#define XF_REG_PROJECTIONF_ID 0x1025 +#define XF_REG_PROJECTORTHO_ID 0x1026 + +#define CP_MTX_REG_A(pn, t0, t1, t2, t3) \ + ( \ + (u32)(pn) << 0 | \ + (u32)(t0) << 6 | \ + (u32)(t1) << 12 | \ + (u32)(t2) << 18 | \ + (u32)(t3) << 24 \ + ) + +#define CP_MTX_REG_B(t4, t5, t6, t7) \ + ( \ + (u32)(t4) << 0 | \ + (u32)(t5) << 6 | \ + (u32)(t6) << 12 | \ + (u32)(t7) << 18 \ + ) + +void GDLoadPosMtxImm(const Mtx mtx, u32 id); +void GDLoadPosMtxIndx(u16 mtx_indx, u32 id); +void GDLoadNrmMtxImm(const Mtx mtx, u32 id); +void GDLoadNrmMtxImm3x3(const f32 mtx[3][3], u32 id); +void GDLoadNrmMtxIndx3x3(u16 mtx_indx, u32 id); +void GDLoadTexMtxImm(const Mtx mtx, u32 id, GXTexMtxType type); +void GDLoadTexMtxIndx(u16 mtx_indx, u32 id, GXTexMtxType type); +void GDSetCurrentMtx(u32 pn, u32 t0, u32 t1, u32 t2, u32 t3, u32 t4, u32 t5, u32 t6, u32 t7); +void GDSetProjection(const Mtx44 mtx, GXProjectionType type); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/gf.h b/include/revolution/gf.h new file mode 100644 index 00000000000..7cb0b253927 --- /dev/null +++ b/include/revolution/gf.h @@ -0,0 +1,9 @@ +#ifndef _REVOLUTION_GF_H_ +#define _REVOLUTION_GF_H_ + +#include +#include +#include +#include + +#endif diff --git a/include/revolution/gf/GFGeometry.h b/include/revolution/gf/GFGeometry.h new file mode 100644 index 00000000000..0a8a2c9a8ca --- /dev/null +++ b/include/revolution/gf/GFGeometry.h @@ -0,0 +1,41 @@ +#ifndef _REVOLUTION_GF_GFGEOMETRY_H +#define _REVOLUTION_GF_GFGEOMETRY_H + +#include + +#define GF_GEN_MODE(nTexGens, nChans, nTevs, cm, nInds) \ + ( \ + (u32)(nTexGens) << 0 | \ + (u32)(nChans) << 4 | \ + (u32)(nTevs) << 10 | \ + (u32)(cm) << 14 | \ + (u32)(nInds) << 16 \ + ) + +static inline void GFWrite_u8(u8 data) { + GXCmd1u8(data); +} + +static inline void GFWrite_u32(u32 data) { + GXCmd1u32(data); +} + +static inline void GFWrite_u16(u16 data) { + GXCmd1u16(data); +} + +static inline void GFWriteBPCmd(u32 regval) { + GFWrite_u8(GX_LOAD_BP_REG); + GFWrite_u32(regval); +} + +static inline void GFWriteXFCmd(u16 addr, u32 val) { + GFWrite_u8(GX_LOAD_XF_REG); + GFWrite_u16(0); + GFWrite_u16(addr); + GFWrite_u32(val); +} + +void GFSetGenMode2(u8 nTexGens, u8 nChans, u8 nTevs, u8 nInds, GXCullMode cm); + +#endif /* _REVOLUTION_GF_GFGEOMETRY_H */ diff --git a/include/revolution/gf/GFLight.h b/include/revolution/gf/GFLight.h new file mode 100644 index 00000000000..0de95863a3f --- /dev/null +++ b/include/revolution/gf/GFLight.h @@ -0,0 +1,8 @@ +#ifndef _REVOLUTION_GF_GFLIGHT_H +#define _REVOLUTION_GF_GFLIGHT_H + +#include + +void GFSetChanAmbColor(GXChannelID chan, GXColor color); + +#endif /* _REVOLUTION_GF_GFLIGHT_H */ diff --git a/include/revolution/gf/GFPixel.h b/include/revolution/gf/GFPixel.h new file mode 100644 index 00000000000..a536840c543 --- /dev/null +++ b/include/revolution/gf/GFPixel.h @@ -0,0 +1,13 @@ +#ifndef _REVOLUTION_GF_GFPIXEL_H +#define _REVOLUTION_GF_GFPIXEL_H + +#include + +void GFSetFog(GXFogType type, f32 startz, f32 endz, f32 nearz, f32 farz, GXColor color); +void GFSetBlendModeEtc(GXBlendMode type, GXBlendFactor src_factor, + GXBlendFactor dst_factor, GXLogicOp logic_op, + u8 color_update_enable, u8 alpha_update_enable, + u8 dither_enable); +void GFSetZMode(u8 compare_enable, GXCompare func, u8 update_enable); + +#endif /* _REVOLUTION_GF_GFPIXEL_H */ diff --git a/include/revolution/gf/GFTev.h b/include/revolution/gf/GFTev.h new file mode 100644 index 00000000000..ad7a2a5b03e --- /dev/null +++ b/include/revolution/gf/GFTev.h @@ -0,0 +1,8 @@ +#ifndef _REVOLUTION_GF_GFTEV_H +#define _REVOLUTION_GF_GFTEV_H + +#include + +void GFSetTevColorS10(GXTevRegID reg, GXColorS10 color); + +#endif /* _REVOLUTION_GF_GFTEV_H */ diff --git a/include/revolution/gx.h b/include/revolution/gx.h new file mode 100644 index 00000000000..708b85e8b24 --- /dev/null +++ b/include/revolution/gx.h @@ -0,0 +1,40 @@ +#ifndef _REVOLUTION_GX_H_ +#define _REVOLUTION_GX_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// unsorted GX externs + +#ifdef __cplusplus +extern "C" { +#endif + +// GXMisc +void (*GXSetDrawSyncCallback(void (*cb)(u16)))(u16); +void GXSetDrawSync(u16 token); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/gx/GXBump.h b/include/revolution/gx/GXBump.h new file mode 100644 index 00000000000..9b4f9273e22 --- /dev/null +++ b/include/revolution/gx/GXBump.h @@ -0,0 +1,29 @@ +#ifndef _REVOLUTION_GX_GXBUMP_H_ +#define _REVOLUTION_GX_GXBUMP_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void GXSetTevIndirect(GXTevStageID tev_stage, GXIndTexStageID ind_stage, GXIndTexFormat format, GXIndTexBiasSel bias_sel, GXIndTexMtxID matrix_sel, GXIndTexWrap wrap_s, GXIndTexWrap wrap_t, GXBool add_prev, GXBool utc_lod, GXIndTexAlphaSel alpha_sel); +void GXSetIndTexMtx(GXIndTexMtxID mtx_id, const f32 offset[2][3], s8 scale_exp); +void GXSetIndTexCoordScale(GXIndTexStageID ind_state, GXIndTexScale scale_s, GXIndTexScale scale_t); +void GXSetIndTexOrder(GXIndTexStageID ind_stage, GXTexCoordID tex_coord, GXTexMapID tex_map); +void GXSetNumIndStages(u8 nIndStages); +void GXSetTevDirect(GXTevStageID tev_stage); +void GXSetTevIndWarp(GXTevStageID tev_stage, GXIndTexStageID ind_stage, u8 signed_offset, u8 replace_mode, GXIndTexMtxID matrix_sel); +void GXSetTevIndTile(GXTevStageID tev_stage, GXIndTexStageID ind_stage, u16 tilesize_s, + u16 tilesize_t, u16 tilespacing_s, u16 tilespacing_t, GXIndTexFormat format, + GXIndTexMtxID matrix_sel, GXIndTexBiasSel bias_sel, GXIndTexAlphaSel alpha_sel); +void GXSetTevIndBumpST(GXTevStageID tev_stage, GXIndTexStageID ind_stage, GXIndTexMtxID matrix_sel); +void GXSetTevIndBumpXYZ(GXTevStageID tev_stage, GXIndTexStageID ind_stage, GXIndTexMtxID matrix_sel); +void GXSetTevIndRepeat(GXTevStageID tev_stage); +void __GXSetIndirectMask(u32 mask); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/gx/GXCommandList.h b/include/revolution/gx/GXCommandList.h new file mode 100644 index 00000000000..a7ce1fdb3f2 --- /dev/null +++ b/include/revolution/gx/GXCommandList.h @@ -0,0 +1,37 @@ +#ifndef _REVOLUTION_GX_GXCOMMANDLIST_H_ +#define _REVOLUTION_GX_GXCOMMANDLIST_H_ + +#include + +#define GX_NOP 0x00 +#define GX_LOAD_CP_REG 0x08 +#define GX_LOAD_XF_REG 0x10 +#define GX_LOAD_INDX_A 0x20 +#define GX_LOAD_INDX_B 0x28 +#define GX_LOAD_INDX_C 0x30 +#define GX_LOAD_INDX_D 0x38 +#define GX_LOAD_BP_REG 0x61 + +#define GX_DRAW_QUADS 0x80 +#define GX_DRAW_TRIANGLES 0x90 +#define GX_DRAW_TRIANGLE_STRIP 0x98 +#define GX_DRAW_TRIANGLE_FAN 0xA0 +#define GX_DRAW_LINES 0xA8 +#define GX_DRAW_LINE_STRIP 0xB0 +#define GX_DRAW_POINTS 0xB8 + +#define GX_CMD_CALL_DL 0x40 +#define GX_CMD_INVAL_VTX 0x48 + +#define GX_OPCODE_MASK 0xF8 +#define GX_VAT_MASK 0x07 + +extern u8 GXTexMode0Ids[8]; +extern u8 GXTexMode1Ids[8]; +extern u8 GXTexImage0Ids[8]; +extern u8 GXTexImage1Ids[8]; +extern u8 GXTexImage2Ids[8]; +extern u8 GXTexImage3Ids[8]; +extern u8 GXTexTlutIds[8]; + +#endif diff --git a/include/revolution/gx/GXCpu2Efb.h b/include/revolution/gx/GXCpu2Efb.h new file mode 100644 index 00000000000..16ba190ea23 --- /dev/null +++ b/include/revolution/gx/GXCpu2Efb.h @@ -0,0 +1,29 @@ +#ifndef _REVOLUTION_GX_GXCPU2EFB_H_ +#define _REVOLUTION_GX_GXCPU2EFB_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void GXPokeAlphaMode(GXCompare func, u8 threshold); +void GXPokeAlphaRead(GXAlphaReadMode mode); +void GXPokeAlphaUpdate(GXBool update_enable); +void GXPokeBlendMode(GXBlendMode type, GXBlendFactor src_factor, GXBlendFactor dst_factor, GXLogicOp op); +void GXPokeColorUpdate(GXBool update_enable); +void GXPokeDstAlpha(GXBool enable, u8 alpha); +void GXPokeDither(GXBool dither); +void GXPokeZMode(GXBool compare_enable, GXCompare func, GXBool update_enable); +void GXPeekARGB(u16 x, u16 y, u32* color); +void GXPokeARGB(u16 x, u16 y, u32 color); +void GXPeekZ(u16 x, u16 y, u32* z); +void GXPokeZ(u16 x, u16 y, u32 z); +u32 GXCompressZ16(u32 z24, GXZFmt16 zfmt); +u32 GXDecompressZ16(u32 z16, GXZFmt16 zfmt); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/gx/GXCull.h b/include/revolution/gx/GXCull.h new file mode 100644 index 00000000000..2c33e1bb74e --- /dev/null +++ b/include/revolution/gx/GXCull.h @@ -0,0 +1,18 @@ +#ifndef _REVOLUTION_GX_GXCULL_H_ +#define _REVOLUTION_GX_GXCULL_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void GXSetScissor(u32 left, u32 top, u32 wd, u32 ht); +void GXSetCullMode(GXCullMode mode); +void GXSetCoPlanar(GXBool enable); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/gx/GXDispList.h b/include/revolution/gx/GXDispList.h new file mode 100644 index 00000000000..81c9e400df5 --- /dev/null +++ b/include/revolution/gx/GXDispList.h @@ -0,0 +1,18 @@ +#ifndef _REVOLUTION_GX_GXDISPLIST_H_ +#define _REVOLUTION_GX_GXDISPLIST_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void GXBeginDisplayList(void* list, u32 size); +u32 GXEndDisplayList(void); +void GXCallDisplayList(void* list, u32 nbytes); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/gx/GXDraw.h b/include/revolution/gx/GXDraw.h new file mode 100644 index 00000000000..6dd46a83669 --- /dev/null +++ b/include/revolution/gx/GXDraw.h @@ -0,0 +1,24 @@ +#ifndef _REVOLUTION_GX_GXDRAW_H_ +#define _REVOLUTION_GX_GXDRAW_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void GXDrawCylinder(u8 numEdges); +void GXDrawTorus(f32 rc, u8 numc, u8 numt); +void GXDrawSphere(u8 numMajor, u8 numMinor); +void GXDrawCube(void); +void GXDrawDodeca(void); +void GXDrawOctahedron(void); +void GXDrawIcosahedron(void); +void GXDrawSphere1(u8 depth); +u32 GXGenNormalTable(u8 depth, f32* table); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/gx/GXEnum.h b/include/revolution/gx/GXEnum.h new file mode 100644 index 00000000000..0a719b51038 --- /dev/null +++ b/include/revolution/gx/GXEnum.h @@ -0,0 +1,924 @@ +#ifndef _REVOLUTION_GX_GXENUM_H_ +#define _REVOLUTION_GX_GXENUM_H_ + +#include + +typedef u8 GXBool; + +#define GX_FALSE ((GXBool)0) +#define GX_TRUE ((GXBool)1) + +#define GX_ENABLE ((GXBool)1) +#define GX_DISABLE ((GXBool)0) + +typedef enum _GXProjectionType { + GX_PERSPECTIVE, + GX_ORTHOGRAPHIC, +} GXProjectionType; + +typedef enum _GXCompare { + GX_NEVER, + GX_LESS, + GX_EQUAL, + GX_LEQUAL, + GX_GREATER, + GX_NEQUAL, + GX_GEQUAL, + GX_ALWAYS, +} GXCompare; + +typedef enum _GXAlphaOp { + GX_AOP_AND, + GX_AOP_OR, + GX_AOP_XOR, + GX_AOP_XNOR, + GX_MAX_ALPHAOP, +} GXAlphaOp; + +typedef enum _GXZFmt16 { + GX_ZC_LINEAR, + GX_ZC_NEAR, + GX_ZC_MID, + GX_ZC_FAR, +} GXZFmt16; + +typedef enum _GXGamma { + GX_GM_1_0, + GX_GM_1_7, + GX_GM_2_2, +} GXGamma; + +typedef enum _GXPixelFmt { + GX_PF_RGB8_Z24, + GX_PF_RGBA6_Z24, + GX_PF_RGB565_Z16, + GX_PF_Z24, + GX_PF_Y8, + GX_PF_U8, + GX_PF_V8, + GX_PF_YUV420, +} GXPixelFmt; + +typedef enum _GXPrimitive { + GX_QUADS = 0x80, + GX_TRIANGLES = 0x90, + GX_TRIANGLESTRIP = 0x98, + GX_TRIANGLEFAN = 0xA0, + GX_LINES = 0xA8, + GX_LINESTRIP = 0xB0, + GX_POINTS = 0xB8, +} GXPrimitive; + +typedef enum _GXVtxFmt { + GX_VTXFMT0, + GX_VTXFMT1, + GX_VTXFMT2, + GX_VTXFMT3, + GX_VTXFMT4, + GX_VTXFMT5, + GX_VTXFMT6, + GX_VTXFMT7, + GX_MAX_VTXFMT, +} GXVtxFmt; + +typedef enum _GXAttr { + GX_VA_PNMTXIDX, + GX_VA_TEX0MTXIDX, + GX_VA_TEX1MTXIDX, + GX_VA_TEX2MTXIDX, + GX_VA_TEX3MTXIDX, + GX_VA_TEX4MTXIDX, + GX_VA_TEX5MTXIDX, + GX_VA_TEX6MTXIDX, + GX_VA_TEX7MTXIDX, + GX_VA_POS, + GX_VA_NRM, + GX_VA_CLR0, + GX_VA_CLR1, + GX_VA_TEX0, + GX_VA_TEX1, + GX_VA_TEX2, + GX_VA_TEX3, + GX_VA_TEX4, + GX_VA_TEX5, + GX_VA_TEX6, + GX_VA_TEX7, + GX_POS_MTX_ARRAY, + GX_NRM_MTX_ARRAY, + GX_TEX_MTX_ARRAY, + GX_LIGHT_ARRAY, + GX_VA_NBT, + GX_VA_MAX_ATTR, + GX_VA_NULL = 0xFF, +} GXAttr; + +typedef enum _GXAttrType { + GX_NONE, + GX_DIRECT, + GX_INDEX8, + GX_INDEX16, +} GXAttrType; + +#define _GX_TF_CTF 0x20 +#define _GX_TF_ZTF 0x10 + +typedef enum _GXTexFmt { + GX_TF_I4 = 0x0, + GX_TF_I8 = 0x1, + GX_TF_IA4 = 0x2, + GX_TF_IA8 = 0x3, + GX_TF_RGB565 = 0x4, + GX_TF_RGB5A3 = 0x5, + GX_TF_RGBA8 = 0x6, + GX_TF_CMPR = 0xE, + + GX_CTF_R4 = 0x0 | _GX_TF_CTF, + GX_CTF_RA4 = 0x2 | _GX_TF_CTF, + GX_CTF_RA8 = 0x3 | _GX_TF_CTF, + GX_CTF_YUVA8 = 0x6 | _GX_TF_CTF, + GX_CTF_A8 = 0x7 | _GX_TF_CTF, + GX_CTF_R8 = 0x8 | _GX_TF_CTF, + GX_CTF_G8 = 0x9 | _GX_TF_CTF, + GX_CTF_B8 = 0xA | _GX_TF_CTF, + GX_CTF_RG8 = 0xB | _GX_TF_CTF, + GX_CTF_GB8 = 0xC | _GX_TF_CTF, + + GX_TF_Z8 = 0x1 | _GX_TF_ZTF, + GX_TF_Z16 = 0x3 | _GX_TF_ZTF, + GX_TF_Z24X8 = 0x6 | _GX_TF_ZTF, + + GX_CTF_Z4 = 0x0 | _GX_TF_ZTF | _GX_TF_CTF, + GX_CTF_Z8M = 0x9 | _GX_TF_ZTF | _GX_TF_CTF, + GX_CTF_Z8L = 0xA | _GX_TF_ZTF | _GX_TF_CTF, + GX_CTF_Z16L = 0xC | _GX_TF_ZTF | _GX_TF_CTF, + + GX_TF_A8 = GX_CTF_A8, +} GXTexFmt; + +typedef enum _GXCITexFmt { + GX_TF_C4 = 0x8, + GX_TF_C8 = 0x9, + GX_TF_C14X2 = 0xA, +} GXCITexFmt; + +typedef enum _GXTexWrapMode { + GX_CLAMP, + GX_REPEAT, + GX_MIRROR, + GX_MAX_TEXWRAPMODE, +} GXTexWrapMode; + +typedef enum _GXTexFilter { + GX_NEAR, + GX_LINEAR, + GX_NEAR_MIP_NEAR, + GX_LIN_MIP_NEAR, + GX_NEAR_MIP_LIN, + GX_LIN_MIP_LIN, +} GXTexFilter; + +typedef enum _GXAnisotropy { + GX_ANISO_1, + GX_ANISO_2, + GX_ANISO_4, + GX_MAX_ANISOTROPY, +} GXAnisotropy; + +typedef enum _GXTexMapID { + GX_TEXMAP0, + GX_TEXMAP1, + GX_TEXMAP2, + GX_TEXMAP3, + GX_TEXMAP4, + GX_TEXMAP5, + GX_TEXMAP6, + GX_TEXMAP7, + GX_MAX_TEXMAP, + GX_TEXMAP_NULL = 0xFF, + GX_TEX_DISABLE = 0x100, +} GXTexMapID; + +typedef enum _GXTexCoordID { + GX_TEXCOORD0, + GX_TEXCOORD1, + GX_TEXCOORD2, + GX_TEXCOORD3, + GX_TEXCOORD4, + GX_TEXCOORD5, + GX_TEXCOORD6, + GX_TEXCOORD7, + GX_MAX_TEXCOORD, + GX_TEXCOORD_NULL = 0xFF, +} GXTexCoordID; + +typedef enum _GXTevStageID { + GX_TEVSTAGE0, + GX_TEVSTAGE1, + GX_TEVSTAGE2, + GX_TEVSTAGE3, + GX_TEVSTAGE4, + GX_TEVSTAGE5, + GX_TEVSTAGE6, + GX_TEVSTAGE7, + GX_TEVSTAGE8, + GX_TEVSTAGE9, + GX_TEVSTAGE10, + GX_TEVSTAGE11, + GX_TEVSTAGE12, + GX_TEVSTAGE13, + GX_TEVSTAGE14, + GX_TEVSTAGE15, + GX_MAX_TEVSTAGE, +} GXTevStageID; + +typedef enum _GXTevMode { + GX_MODULATE, + GX_DECAL, + GX_BLEND, + GX_REPLACE, + GX_PASSCLR, +} GXTevMode; + +typedef enum _GXTexMtxType { + GX_MTX3x4, + GX_MTX2x4, +} GXTexMtxType; + +typedef enum _GXTexGenType { + GX_TG_MTX3x4, + GX_TG_MTX2x4, + GX_TG_BUMP0, + GX_TG_BUMP1, + GX_TG_BUMP2, + GX_TG_BUMP3, + GX_TG_BUMP4, + GX_TG_BUMP5, + GX_TG_BUMP6, + GX_TG_BUMP7, + GX_TG_SRTG, +} GXTexGenType; + +typedef enum _GXPosNrmMtx { + GX_PNMTX0 = 0, + GX_PNMTX1 = 3, + GX_PNMTX2 = 6, + GX_PNMTX3 = 9, + GX_PNMTX4 = 12, + GX_PNMTX5 = 15, + GX_PNMTX6 = 18, + GX_PNMTX7 = 21, + GX_PNMTX8 = 24, + GX_PNMTX9 = 27, +} GXPosNrmMtx; + +typedef enum _GXTexMtx { + GX_TEXMTX0 = 30, + GX_TEXMTX1 = 33, + GX_TEXMTX2 = 36, + GX_TEXMTX3 = 39, + GX_TEXMTX4 = 42, + GX_TEXMTX5 = 45, + GX_TEXMTX6 = 48, + GX_TEXMTX7 = 51, + GX_TEXMTX8 = 54, + GX_TEXMTX9 = 57, + GX_IDENTITY = 60, +} GXTexMtx; + +typedef enum _GXChannelID { + GX_COLOR0, + GX_COLOR1, + GX_ALPHA0, + GX_ALPHA1, + GX_COLOR0A0, + GX_COLOR1A1, + GX_COLOR_ZERO, + GX_ALPHA_BUMP, + GX_ALPHA_BUMPN, + GX_COLOR_NULL = 0xFF, +} GXChannelID; + +typedef enum _GXTexGenSrc { + GX_TG_POS, + GX_TG_NRM, + GX_TG_BINRM, + GX_TG_TANGENT, + GX_TG_TEX0, + GX_TG_TEX1, + GX_TG_TEX2, + GX_TG_TEX3, + GX_TG_TEX4, + GX_TG_TEX5, + GX_TG_TEX6, + GX_TG_TEX7, + GX_TG_TEXCOORD0, + GX_TG_TEXCOORD1, + GX_TG_TEXCOORD2, + GX_TG_TEXCOORD3, + GX_TG_TEXCOORD4, + GX_TG_TEXCOORD5, + GX_TG_TEXCOORD6, + GX_TG_COLOR0, + GX_TG_COLOR1, +} GXTexGenSrc; + +typedef enum _GXBlendMode { + GX_BM_NONE, + GX_BM_BLEND, + GX_BM_LOGIC, + GX_BM_SUBTRACT, + GX_MAX_BLENDMODE, +} GXBlendMode; + +typedef enum _GXBlendFactor { + GX_BL_ZERO, + GX_BL_ONE, + GX_BL_SRCCLR, + GX_BL_INVSRCCLR, + GX_BL_SRCALPHA, + GX_BL_INVSRCALPHA, + GX_BL_DSTALPHA, + GX_BL_INVDSTALPHA, + GX_BL_DSTCLR = GX_BL_SRCCLR, + GX_BL_INVDSTCLR = GX_BL_INVSRCCLR, +} GXBlendFactor; + +typedef enum _GXLogicOp { + GX_LO_CLEAR, + GX_LO_AND, + GX_LO_REVAND, + GX_LO_COPY, + GX_LO_INVAND, + GX_LO_NOOP, + GX_LO_XOR, + GX_LO_OR, + GX_LO_NOR, + GX_LO_EQUIV, + GX_LO_INV, + GX_LO_REVOR, + GX_LO_INVCOPY, + GX_LO_INVOR, + GX_LO_NAND, + GX_LO_SET, +} GXLogicOp; + +typedef enum _GXCompCnt { + GX_POS_XY = 0, + GX_POS_XYZ = 1, + GX_NRM_XYZ = 0, + GX_NRM_NBT = 1, + GX_NRM_NBT3 = 2, + GX_CLR_RGB = 0, + GX_CLR_RGBA = 1, + GX_TEX_S = 0, + GX_TEX_ST = 1, +} GXCompCnt; + +typedef enum _GXCompType { + GX_U8 = 0, + GX_S8 = 1, + GX_U16 = 2, + GX_S16 = 3, + GX_F32 = 4, + GX_RGB565 = 0, + GX_RGB8 = 1, + GX_RGBX8 = 2, + GX_RGBA4 = 3, + GX_RGBA6 = 4, + GX_RGBA8 = 5, +} GXCompType; + +typedef enum _GXPTTexMtx { + GX_PTTEXMTX0 = 64, + GX_PTTEXMTX1 = 67, + GX_PTTEXMTX2 = 70, + GX_PTTEXMTX3 = 73, + GX_PTTEXMTX4 = 76, + GX_PTTEXMTX5 = 79, + GX_PTTEXMTX6 = 82, + GX_PTTEXMTX7 = 85, + GX_PTTEXMTX8 = 88, + GX_PTTEXMTX9 = 91, + GX_PTTEXMTX10 = 94, + GX_PTTEXMTX11 = 97, + GX_PTTEXMTX12 = 100, + GX_PTTEXMTX13 = 103, + GX_PTTEXMTX14 = 106, + GX_PTTEXMTX15 = 109, + GX_PTTEXMTX16 = 112, + GX_PTTEXMTX17 = 115, + GX_PTTEXMTX18 = 118, + GX_PTTEXMTX19 = 121, + GX_PTIDENTITY = 125, +} GXPTTexMtx; + +typedef enum _GXTevRegID { + GX_TEVPREV, + GX_TEVREG0, + GX_TEVREG1, + GX_TEVREG2, + GX_MAX_TEVREG, +} GXTevRegID; + +typedef enum _GXDiffuseFn { + GX_DF_NONE, + GX_DF_SIGN, + GX_DF_CLAMP, +} GXDiffuseFn; + +typedef enum _GXColorSrc { + GX_SRC_REG, + GX_SRC_VTX, +} GXColorSrc; + +typedef enum _GXAttnFn { + GX_AF_SPEC, + GX_AF_SPOT, + GX_AF_NONE, +} GXAttnFn; + +typedef enum _GXLightID { + GX_LIGHT0 = 0x001, + GX_LIGHT1 = 0x002, + GX_LIGHT2 = 0x004, + GX_LIGHT3 = 0x008, + GX_LIGHT4 = 0x010, + GX_LIGHT5 = 0x020, + GX_LIGHT6 = 0x040, + GX_LIGHT7 = 0x080, + GX_MAX_LIGHT = 0x100, + GX_LIGHT_NULL = 0, +} GXLightID; + +typedef enum _GXTexOffset { + GX_TO_ZERO, + GX_TO_SIXTEENTH, + GX_TO_EIGHTH, + GX_TO_FOURTH, + GX_TO_HALF, + GX_TO_ONE, + GX_MAX_TEXOFFSET, +} GXTexOffset; + +typedef enum _GXSpotFn { + GX_SP_OFF, + GX_SP_FLAT, + GX_SP_COS, + GX_SP_COS2, + GX_SP_SHARP, + GX_SP_RING1, + GX_SP_RING2, +} GXSpotFn; + +typedef enum _GXDistAttnFn { + GX_DA_OFF, + GX_DA_GENTLE, + GX_DA_MEDIUM, + GX_DA_STEEP, +} GXDistAttnFn; + +typedef enum _GXCullMode { + GX_CULL_NONE, + GX_CULL_FRONT, + GX_CULL_BACK, + GX_CULL_ALL +} GXCullMode; + +typedef enum _GXTevSwapSel { + GX_TEV_SWAP0 = 0, + GX_TEV_SWAP1, + GX_TEV_SWAP2, + GX_TEV_SWAP3, + GX_MAX_TEVSWAP +} GXTevSwapSel; + +typedef enum _GXTevColorChan { + GX_CH_RED = 0, + GX_CH_GREEN, + GX_CH_BLUE, + GX_CH_ALPHA +} GXTevColorChan; + +typedef enum _GXFogType { + GX_FOG_NONE = 0, + GX_FOG_PERSP_LIN = 2, + GX_FOG_PERSP_EXP = 4, + GX_FOG_PERSP_EXP2 = 5, + GX_FOG_PERSP_REVEXP = 6, + GX_FOG_PERSP_REVEXP2 = 7, + GX_FOG_ORTHO_LIN = 10, + GX_FOG_ORTHO_EXP = 12, + GX_FOG_ORTHO_EXP2 = 13, + GX_FOG_ORTHO_REVEXP = 14, + GX_FOG_ORTHO_REVEXP2 = 15, + GX_FOG_LIN = 2, + GX_FOG_EXP = 4, + GX_FOG_EXP2 = 5, + GX_FOG_REVEXP = 6, + GX_FOG_REVEXP2 = 7, +} GXFogType; + +typedef enum _GXTevColorArg { + GX_CC_CPREV = 0, + GX_CC_APREV = 1, + GX_CC_C0 = 2, + GX_CC_A0 = 3, + GX_CC_C1 = 4, + GX_CC_A1 = 5, + GX_CC_C2 = 6, + GX_CC_A2 = 7, + GX_CC_TEXC = 8, + GX_CC_TEXA = 9, + GX_CC_RASC = 10, + GX_CC_RASA = 11, + GX_CC_ONE = 12, + GX_CC_HALF = 13, + GX_CC_KONST = 14, + GX_CC_ZERO = 15, + GX_CC_TEXRRR = 16, + GX_CC_TEXGGG = 17, + GX_CC_TEXBBB = 18, + GX_CC_QUARTER = 14, +} GXTevColorArg; + +typedef enum _GXTevAlphaArg { + GX_CA_APREV = 0, + GX_CA_A0 = 1, + GX_CA_A1 = 2, + GX_CA_A2 = 3, + GX_CA_TEXA = 4, + GX_CA_RASA = 5, + GX_CA_KONST = 6, + GX_CA_ZERO = 7, + GX_CA_ONE = 6, +} GXTevAlphaArg; + +typedef enum _GXTevOp { + GX_TEV_ADD = 0, + GX_TEV_SUB = 1, + GX_TEV_COMP_R8_GT = 8, + GX_TEV_COMP_R8_EQ = 9, + GX_TEV_COMP_GR16_GT = 10, + GX_TEV_COMP_GR16_EQ = 11, + GX_TEV_COMP_BGR24_GT = 12, + GX_TEV_COMP_BGR24_EQ = 13, + GX_TEV_COMP_RGB8_GT = 14, + GX_TEV_COMP_RGB8_EQ = 15, + GX_TEV_COMP_A8_GT = GX_TEV_COMP_RGB8_GT, + GX_TEV_COMP_A8_EQ = GX_TEV_COMP_RGB8_EQ +} GXTevOp; + +typedef enum _GXTevBias { + GX_TB_ZERO, + GX_TB_ADDHALF, + GX_TB_SUBHALF, + GX_MAX_TEVBIAS +} GXTevBias; + +typedef enum _GXTevScale { + GX_CS_SCALE_1, + GX_CS_SCALE_2, + GX_CS_SCALE_4, + GX_CS_DIVIDE_2, + GX_MAX_TEVSCALE +} GXTevScale; + +typedef enum _GXTevKColorSel { + GX_TEV_KCSEL_1 = 0x00, + GX_TEV_KCSEL_7_8 = 0x01, + GX_TEV_KCSEL_3_4 = 0x02, + GX_TEV_KCSEL_5_8 = 0x03, + GX_TEV_KCSEL_1_2 = 0x04, + GX_TEV_KCSEL_3_8 = 0x05, + GX_TEV_KCSEL_1_4 = 0x06, + GX_TEV_KCSEL_1_8 = 0x07, + GX_TEV_KCSEL_K0 = 0x0C, + GX_TEV_KCSEL_K1 = 0x0D, + GX_TEV_KCSEL_K2 = 0x0E, + GX_TEV_KCSEL_K3 = 0x0F, + GX_TEV_KCSEL_K0_R = 0x10, + GX_TEV_KCSEL_K1_R = 0x11, + GX_TEV_KCSEL_K2_R = 0x12, + GX_TEV_KCSEL_K3_R = 0x13, + GX_TEV_KCSEL_K0_G = 0x14, + GX_TEV_KCSEL_K1_G = 0x15, + GX_TEV_KCSEL_K2_G = 0x16, + GX_TEV_KCSEL_K3_G = 0x17, + GX_TEV_KCSEL_K0_B = 0x18, + GX_TEV_KCSEL_K1_B = 0x19, + GX_TEV_KCSEL_K2_B = 0x1A, + GX_TEV_KCSEL_K3_B = 0x1B, + GX_TEV_KCSEL_K0_A = 0x1C, + GX_TEV_KCSEL_K1_A = 0x1D, + GX_TEV_KCSEL_K2_A = 0x1E, + GX_TEV_KCSEL_K3_A = 0x1F +} GXTevKColorSel; + +typedef enum _GXTevKAlphaSel { + GX_TEV_KASEL_1 = 0x00, + GX_TEV_KASEL_7_8 = 0x01, + GX_TEV_KASEL_3_4 = 0x02, + GX_TEV_KASEL_5_8 = 0x03, + GX_TEV_KASEL_1_2 = 0x04, + GX_TEV_KASEL_3_8 = 0x05, + GX_TEV_KASEL_1_4 = 0x06, + GX_TEV_KASEL_1_8 = 0x07, + GX_TEV_KASEL_K0_R = 0x10, + GX_TEV_KASEL_K1_R = 0x11, + GX_TEV_KASEL_K2_R = 0x12, + GX_TEV_KASEL_K3_R = 0x13, + GX_TEV_KASEL_K0_G = 0x14, + GX_TEV_KASEL_K1_G = 0x15, + GX_TEV_KASEL_K2_G = 0x16, + GX_TEV_KASEL_K3_G = 0x17, + GX_TEV_KASEL_K0_B = 0x18, + GX_TEV_KASEL_K1_B = 0x19, + GX_TEV_KASEL_K2_B = 0x1A, + GX_TEV_KASEL_K3_B = 0x1B, + GX_TEV_KASEL_K0_A = 0x1C, + GX_TEV_KASEL_K1_A = 0x1D, + GX_TEV_KASEL_K2_A = 0x1E, + GX_TEV_KASEL_K3_A = 0x1F +} GXTevKAlphaSel; + +typedef enum _GXTevKColorID { + GX_KCOLOR0 = 0, + GX_KCOLOR1, + GX_KCOLOR2, + GX_KCOLOR3, + GX_MAX_KCOLOR +} GXTevKColorID; + +typedef enum _GXZTexOp { + GX_ZT_DISABLE, + GX_ZT_ADD, + GX_ZT_REPLACE, + GX_MAX_ZTEXOP, +} GXZTexOp; + +typedef enum _GXIndTexFormat { + GX_ITF_8, + GX_ITF_5, + GX_ITF_4, + GX_ITF_3, + GX_MAX_ITFORMAT, +} GXIndTexFormat; + +typedef enum _GXIndTexBiasSel { + GX_ITB_NONE, + GX_ITB_S, + GX_ITB_T, + GX_ITB_ST, + GX_ITB_U, + GX_ITB_SU, + GX_ITB_TU, + GX_ITB_STU, + GX_MAX_ITBIAS, +} GXIndTexBiasSel; + +typedef enum _GXIndTexAlphaSel { + GX_ITBA_OFF, + GX_ITBA_S, + GX_ITBA_T, + GX_ITBA_U, + GX_MAX_ITBALPHA, +} GXIndTexAlphaSel; + +typedef enum _GXIndTexMtxID { + GX_ITM_OFF, + GX_ITM_0, + GX_ITM_1, + GX_ITM_2, + GX_ITM_S0 = 5, + GX_ITM_S1, + GX_ITM_S2, + GX_ITM_T0 = 9, + GX_ITM_T1, + GX_ITM_T2, +} GXIndTexMtxID; + +typedef enum _GXIndTexWrap { + GX_ITW_OFF, + GX_ITW_256, + GX_ITW_128, + GX_ITW_64, + GX_ITW_32, + GX_ITW_16, + GX_ITW_0, + GX_MAX_ITWRAP, +} GXIndTexWrap; + +typedef enum _GXIndTexStageID { + GX_INDTEXSTAGE0, + GX_INDTEXSTAGE1, + GX_INDTEXSTAGE2, + GX_INDTEXSTAGE3, + GX_MAX_INDTEXSTAGE, +} GXIndTexStageID; + +typedef enum _GXIndTexScale { + GX_ITS_1, + GX_ITS_2, + GX_ITS_4, + GX_ITS_8, + GX_ITS_16, + GX_ITS_32, + GX_ITS_64, + GX_ITS_128, + GX_ITS_256, + GX_MAX_ITSCALE, +} GXIndTexScale; + +typedef enum _GXPerf0 { + GX_PERF0_VERTICES, + GX_PERF0_CLIP_VTX, + GX_PERF0_CLIP_CLKS, + GX_PERF0_XF_WAIT_IN, + GX_PERF0_XF_WAIT_OUT, + GX_PERF0_XF_XFRM_CLKS, + GX_PERF0_XF_LIT_CLKS, + GX_PERF0_XF_BOT_CLKS, + GX_PERF0_XF_REGLD_CLKS, + GX_PERF0_XF_REGRD_CLKS, + GX_PERF0_CLIP_RATIO, + + GX_PERF0_TRIANGLES, + GX_PERF0_TRIANGLES_CULLED, + GX_PERF0_TRIANGLES_PASSED, + GX_PERF0_TRIANGLES_SCISSORED, + GX_PERF0_TRIANGLES_0TEX, + GX_PERF0_TRIANGLES_1TEX, + GX_PERF0_TRIANGLES_2TEX, + GX_PERF0_TRIANGLES_3TEX, + GX_PERF0_TRIANGLES_4TEX, + GX_PERF0_TRIANGLES_5TEX, + GX_PERF0_TRIANGLES_6TEX, + GX_PERF0_TRIANGLES_7TEX, + GX_PERF0_TRIANGLES_8TEX, + GX_PERF0_TRIANGLES_0CLR, + GX_PERF0_TRIANGLES_1CLR, + GX_PERF0_TRIANGLES_2CLR, + + GX_PERF0_QUAD_0CVG, + GX_PERF0_QUAD_NON0CVG, + GX_PERF0_QUAD_1CVG, + GX_PERF0_QUAD_2CVG, + GX_PERF0_QUAD_3CVG, + GX_PERF0_QUAD_4CVG, + GX_PERF0_AVG_QUAD_CNT, + + GX_PERF0_CLOCKS, + GX_PERF0_NONE, +} GXPerf0; + +typedef enum _GXPerf1 { + GX_PERF1_TEXELS, + GX_PERF1_TX_IDLE, + GX_PERF1_TX_REGS, + GX_PERF1_TX_MEMSTALL, + GX_PERF1_TC_CHECK1_2, + GX_PERF1_TC_CHECK3_4, + GX_PERF1_TC_CHECK5_6, + GX_PERF1_TC_CHECK7_8, + GX_PERF1_TC_MISS, + + GX_PERF1_VC_ELEMQ_FULL, + GX_PERF1_VC_MISSQ_FULL, + GX_PERF1_VC_MEMREQ_FULL, + GX_PERF1_VC_STATUS7, + GX_PERF1_VC_MISSREP_FULL, + GX_PERF1_VC_STREAMBUF_LOW, + GX_PERF1_VC_ALL_STALLS, + GX_PERF1_VERTICES, + + GX_PERF1_FIFO_REQ, + GX_PERF1_CALL_REQ, + GX_PERF1_VC_MISS_REQ, + GX_PERF1_CP_ALL_REQ, + + GX_PERF1_CLOCKS, + GX_PERF1_NONE, +} GXPerf1; + +typedef enum _GXVCachePerf { + GX_VC_POS = 0, + GX_VC_NRM = 1, + GX_VC_CLR0 = 2, + GX_VC_CLR1 = 3, + GX_VC_TEX0 = 4, + GX_VC_TEX1 = 5, + GX_VC_TEX2 = 6, + GX_VC_TEX3 = 7, + GX_VC_TEX4 = 8, + GX_VC_TEX5 = 9, + GX_VC_TEX6 = 10, + GX_VC_TEX7 = 11, + GX_VC_ALL = 15, +} GXVCachePerf; + +typedef enum _GXClipMode { + GX_CLIP_ENABLE = 0, + GX_CLIP_DISABLE = 1, +} GXClipMode; + +typedef enum _GXFBClamp { + GX_CLAMP_NONE = 0, + GX_CLAMP_TOP = 1, + GX_CLAMP_BOTTOM = 2, +} GXFBClamp; + +typedef enum _GXCopyMode { + GX_COPY_PROGRESSIVE = 0, + GX_COPY_INTLC_EVEN = 2, + GX_COPY_INTLC_ODD = 3, +} GXCopyMode; + +typedef enum _GXAlphaReadMode { + GX_READ_00, + GX_READ_FF, + GX_READ_NONE, +} GXAlphaReadMode; + +typedef enum _GXTexCacheSize { + GX_TEXCACHE_32K, + GX_TEXCACHE_128K, + GX_TEXCACHE_512K, + GX_TEXCACHE_NONE, +} GXTexCacheSize; + +typedef enum _GXTlut { + GX_TLUT0, + GX_TLUT1, + GX_TLUT2, + GX_TLUT3, + GX_TLUT4, + GX_TLUT5, + GX_TLUT6, + GX_TLUT7, + GX_TLUT8, + GX_TLUT9, + GX_TLUT10, + GX_TLUT11, + GX_TLUT12, + GX_TLUT13, + GX_TLUT14, + GX_TLUT15, + GX_BIGTLUT0, + GX_BIGTLUT1, + GX_BIGTLUT2, + GX_BIGTLUT3, +} GXTlut; + +typedef enum _GXTlutFmt { + GX_TL_IA8, + GX_TL_RGB565, + GX_TL_RGB5A3, + GX_MAX_TLUTFMT, +} GXTlutFmt; + +typedef enum _GXTlutSize { + GX_TLUT_16 = 1, + GX_TLUT_32 = 2, + GX_TLUT_64 = 4, + GX_TLUT_128 = 8, + GX_TLUT_256 = 16, + GX_TLUT_512 = 32, + GX_TLUT_1K = 64, + GX_TLUT_2K = 128, + GX_TLUT_4K = 256, + GX_TLUT_8K = 512, + GX_TLUT_16K = 1024, +} GXTlutSize; + +typedef enum _GXMiscToken { + GX_MT_XF_FLUSH = 1, + GX_MT_DL_SAVE_CONTEXT = 2, + GX_MT_ABORT_WAIT_COPYOUT = 3, + GX_MT_NULL = 0, +} GXMiscToken; + +// temporary +typedef enum _GXCommand { + GX_CMD_LOAD_INDX_A = 0x20, + GX_CMD_LOAD_INDX_B = 0x28, + GX_CMD_LOAD_INDX_C = 0x30, + GX_CMD_LOAD_INDX_D = 0x38, + + GX_CMD_LOAD_CP_REG = 0x08, + GX_CMD_LOAD_XF_REG = 0x10, + GX_CMD_LOAD_BP_REG = 0x61, +} GXCommand; + +typedef enum _GXCPRegs { + GX_CP_REG_MTXIDXA = 0x30, // Matrix index A + GX_CP_REG_MTXIDXB = 0x40, // Matrix index B + GX_CP_REG_VCD_LO = 0x50, // Vertex descriptor (lo) + GX_CP_REG_VCD_HI = 0x60, // Vertex descriptor (hi) + GX_CP_REG_VAT_GRP0 = 0x70, // Vertex attribute table (group 0) + GX_CP_REG_VAT_GRP1 = 0x80, // Vertex attribute table (group 1) + GX_CP_REG_VAT_GRP2 = 0x90, // Vertex attribute table (group 2) + GX_CP_REG_ARRAYBASE = 0xA0, // Vertex array start/base + GX_CP_REG_ARRAYSTRIDE = 0xB0, // Vertex array stride +} GXCPRegs; + +#endif diff --git a/include/revolution/gx/GXFifo.h b/include/revolution/gx/GXFifo.h new file mode 100644 index 00000000000..b595b4c6fc8 --- /dev/null +++ b/include/revolution/gx/GXFifo.h @@ -0,0 +1,46 @@ +#ifndef _REVOLUTION_GX_GXFIFO_H_ +#define _REVOLUTION_GX_GXFIFO_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + u8 pad[128]; +} GXFifoObj; + +typedef void (*GXBreakPtCallback)(void); + +void GXInitFifoBase(GXFifoObj* fifo, void* base, u32 size); +void GXInitFifoPtrs(GXFifoObj* fifo, void* readPtr, void* writePtr); +void GXInitFifoLimits(GXFifoObj* fifo, u32 hiWatermark, u32 loWatermark); +void GXSetCPUFifo(GXFifoObj* fifo); +void GXSetGPFifo(GXFifoObj* fifo); +void GXSaveCPUFifo(GXFifoObj* fifo); +void GXSaveGPFifo(GXFifoObj* fifo); +void GXGetGPStatus(GXBool* overhi, GXBool* underlow, GXBool* readIdle, GXBool* cmdIdle, GXBool* brkpt); +void GXGetFifoStatus(GXFifoObj* fifo, GXBool* overhi, GXBool* underflow, u32* fifoCount, GXBool* cpuWrite, GXBool* gpRead, GXBool* fifowrap); +void GXGetFifoPtrs(GXFifoObj* fifo, void** readPtr, void** writePtr); +void* GXGetFifoBase(const GXFifoObj* fifo); +u32 GXGetFifoSize(const GXFifoObj* fifo); +void GXGetFifoLimits(const GXFifoObj* fifo, u32* hi, u32* lo); +GXBreakPtCallback GXSetBreakPtCallback(GXBreakPtCallback cb); +void GXEnableBreakPt(void* break_pt); +void GXDisableBreakPt(void); +OSThread* GXSetCurrentGXThread(void); +OSThread* GXGetCurrentGXThread(void); +GXFifoObj* GXGetCPUFifo(void); +GXFifoObj* GXGetGPFifo(void); +u32 GXGetOverflowCount(void); +u32 GXResetOverflowCount(void); +volatile void* GXRedirectWriteGatherPipe(void* ptr); +void GXRestoreWriteGatherPipe(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/gx/GXFrameBuffer.h b/include/revolution/gx/GXFrameBuffer.h new file mode 100644 index 00000000000..e1e538f47f5 --- /dev/null +++ b/include/revolution/gx/GXFrameBuffer.h @@ -0,0 +1,66 @@ +#ifndef _REVOLUTION_GX_GXFRAMEBUFFER_H_ +#define _REVOLUTION_GX_GXFRAMEBUFFER_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define GX_MAX_Z24 0x00ffffff + +extern GXRenderModeObj GXNtsc240Ds; +extern GXRenderModeObj GXNtsc240DsAa; +extern GXRenderModeObj GXNtsc240Int; +extern GXRenderModeObj GXNtsc240IntAa; +extern GXRenderModeObj GXNtsc480IntDf; +extern GXRenderModeObj GXNtsc480Int; +extern GXRenderModeObj GXNtsc480IntAa; +extern GXRenderModeObj GXNtsc480Prog; +extern GXRenderModeObj GXNtsc480ProgAa; +extern GXRenderModeObj GXMpal240Ds; +extern GXRenderModeObj GXMpal240DsAa; +extern GXRenderModeObj GXMpal240Int; +extern GXRenderModeObj GXMpal240IntAa; +extern GXRenderModeObj GXMpal480IntDf; +extern GXRenderModeObj GXMpal480Int; +extern GXRenderModeObj GXMpal480IntAa; +extern GXRenderModeObj GXPal264Ds; +extern GXRenderModeObj GXPal264DsAa; +extern GXRenderModeObj GXPal264Int; +extern GXRenderModeObj GXPal264IntAa; +extern GXRenderModeObj GXPal528IntDf; +extern GXRenderModeObj GXPal528Int; +extern GXRenderModeObj GXPal528IntAa; +extern GXRenderModeObj GXEurgb60Hz240Ds; +extern GXRenderModeObj GXEurgb60Hz240DsAa; +extern GXRenderModeObj GXEurgb60Hz240Int; +extern GXRenderModeObj GXEurgb60Hz240IntAa; +extern GXRenderModeObj GXEurgb60Hz480IntDf; +extern GXRenderModeObj GXEurgb60Hz480Int; +extern GXRenderModeObj GXEurgb60Hz480IntAa; + +void GXAdjustForOverscan(const GXRenderModeObj* rmin, GXRenderModeObj* rmout, u16 hor, u16 ver); +void GXSetDispCopySrc(u16 left, u16 top, u16 wd, u16 ht); +void GXSetTexCopySrc(u16 left, u16 top, u16 wd, u16 ht); +void GXSetDispCopyDst(u16 wd, u16 ht); +void GXSetTexCopyDst(u16 wd, u16 ht, GXTexFmt fmt, GXBool mipmap); +void GXSetDispCopyFrame2Field(GXCopyMode mode); +void GXSetCopyClamp(GXFBClamp clamp); +u32 GXSetDispCopyYScale(f32 vscale); +void GXSetCopyClear(GXColor clear_clr, u32 clear_z); +void GXSetCopyFilter(GXBool aa, const u8 sample_pattern[12][2], GXBool vf, const u8 vfilter[7]); +void GXSetDispCopyGamma(GXGamma gamma); +void GXCopyDisp(void* dest, GXBool clear); +void GXCopyTex(void* dest, GXBool clear); +void GXClearBoundingBox(void); +void GXReadBoundingBox(u16* left, u16* top, u16* right, u16* bottom); +u16 GXGetNumXfbLines(u16 efbHeight, f32 yScale); +f32 GXGetYScaleFactor(u16 efbHeight, u16 xfbHeight); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/gx/GXGeometry.h b/include/revolution/gx/GXGeometry.h new file mode 100644 index 00000000000..8bbf9e49d99 --- /dev/null +++ b/include/revolution/gx/GXGeometry.h @@ -0,0 +1,47 @@ +#ifndef _REVOLUTION_GX_GXGEOMETRY_H_ +#define _REVOLUTION_GX_GXGEOMETRY_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void __GXCalculateVLim(); +void GXSetVtxDesc(GXAttr attr, GXAttrType type); +void GXSetVtxDescv(const GXVtxDescList* attrPtr); +void GXClearVtxDesc(void); +void GXSetVtxAttrFmt(GXVtxFmt vtxfmt, GXAttr attr, GXCompCnt cnt, GXCompType type, u8 frac); +void GXSetVtxAttrFmtv(GXVtxFmt vtxfmt, const GXVtxAttrFmtList* list); +void GXSetArray(GXAttr attr, void* base_ptr, u8 stride); +void GXInvalidateVtxCache(void); +void GXSetTexCoordGen2(GXTexCoordID dst_coord, GXTexGenType func, GXTexGenSrc src_param, u32 mtx, GXBool normalize, u32 pt_texmtx); +void GXSetNumTexGens(u8 nTexGens); + +static inline void GXSetTexCoordGen(GXTexCoordID dst_coord, GXTexGenType func, GXTexGenSrc src_param, u32 mtx) { + GXSetTexCoordGen2(dst_coord, func, src_param, mtx, GX_FALSE, GX_PTIDENTITY); +} + +void GXBegin(GXPrimitive type, GXVtxFmt vtxfmt, u16 nverts); + +static inline void GXEnd(void) { +#if DEBUG + extern GXBool __GXinBegin; + extern void OSPanic(const char* file, int line, const char* msg, ...); + if (!__GXinBegin) { + OSPanic(__FILE__, 127, "GXEnd: called without a GXBegin"); + } + __GXinBegin = GX_FALSE; +#endif +} + +void GXSetLineWidth(u8 width, GXTexOffset texOffsets); +void GXSetPointSize(u8 pointSize, GXTexOffset texOffsets); +void GXEnableTexOffsets(GXTexCoordID coord, u8 line_enable, u8 point_enable); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/gx/GXGet.h b/include/revolution/gx/GXGet.h new file mode 100644 index 00000000000..c20612d9211 --- /dev/null +++ b/include/revolution/gx/GXGet.h @@ -0,0 +1,64 @@ +#ifndef _REVOLUTION_GX_GXGET_H_ +#define _REVOLUTION_GX_GXGET_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +// Attr +void GXGetVtxDesc(GXAttr attr, GXAttrType* type); +void GXGetVtxDescv(GXVtxDescList* vcd); +void GXGetVtxAttrFmt(GXVtxFmt fmt, GXAttr attr, GXCompCnt* cnt, GXCompType* type, u8* frac); +void GXGetVtxAttrFmtv(GXVtxFmt fmt, GXVtxAttrFmtList* vat); + +// Geometry +void GXGetLineWidth(u8* width, GXTexOffset* texOffsets); +void GXGetPointSize(u8* pointSize, GXTexOffset* texOffsets); +void GXGetCullMode(GXCullMode* mode); + +// Light +void GXGetLightAttnA(const GXLightObj* lt_obj, f32* a0, f32* a1, f32* a2); +void GXGetLightAttnK(const GXLightObj* lt_obj, f32* k0, f32* k1, f32* k2); +void GXGetLightPos(const GXLightObj* lt_obj, f32* x, f32* y, f32* z); +void GXGetLightDir(const GXLightObj* lt_obj, f32* nx, f32* ny, f32* nz); +void GXGetLightColor(const GXLightObj* lt_obj, GXColor* color); + +// Texture +GXBool GXGetTexObjMipMap(const GXTexObj* to); +GXTexFmt GXGetTexObjFmt(const GXTexObj* to); +u16 GXGetTexObjWidth(const GXTexObj* to); +u16 GXGetTexObjHeight(const GXTexObj* to); +GXTexWrapMode GXGetTexObjWrapS(const GXTexObj* to); +GXTexWrapMode GXGetTexObjWrapT(const GXTexObj* to); +void* GXGetTexObjData(const GXTexObj* to);; +void GXGetTexObjAll(const GXTexObj* obj, void** image_ptr, u16* width, u16* height, GXTexFmt* format, GXTexWrapMode* wrap_s, GXTexWrapMode* wrap_t, u8* mipmap); +void GXGetTexObjLODAll(const GXTexObj* tex_obj, GXTexFilter* min_filt, GXTexFilter* mag_filt, f32* min_lod, f32* max_lod, f32* lod_bias, u8* bias_clamp, u8* do_edge_lod, GXAnisotropy* max_aniso); +GXTexFilter GXGetTexObjMinFilt(const GXTexObj* tex_obj); +GXTexFilter GXGetTexObjMagFilt(const GXTexObj* tex_obj); +f32 GXGetTexObjMinLOD(const GXTexObj* tex_obj); +f32 GXGetTexObjMaxLOD(const GXTexObj* tex_obj); +f32 GXGetTexObjLODBias(const GXTexObj* tex_obj); +GXBool GXGetTexObjBiasClamp(const GXTexObj* tex_obj); +GXBool GXGetTexObjEdgeLOD(const GXTexObj* tex_obj); +GXAnisotropy GXGetTexObjMaxAniso(const GXTexObj* tex_obj); +u32 GXGetTexObjTlut(const GXTexObj* tex_obj); +void GXGetTlutObjAll(const GXTlutObj* tlut_obj, void** data, GXTlutFmt* format, u16* numEntries); +void* GXGetTlutObjData(const GXTlutObj* tlut_obj); +GXTlutFmt GXGetTlutObjFmt(const GXTlutObj* tlut_obj); +u16 GXGetTlutObjNumEntries(const GXTlutObj* tlut_obj); +void GXGetTexRegionAll(const GXTexRegion* region, u8* is_cached, u8* is_32b_mipmap, u32* tmem_even, u32* size_even, u32* tmem_odd, u32* size_odd); +void GXGetTlutRegionAll(const GXTlutRegion* region, u32* tmem_addr, GXTlutSize* tlut_size); + +// Transform +void GXGetProjectionv(f32* ptr); +void GXGetViewportv(f32* vp); +void GXGetScissor(u32* left, u32* top, u32* wd, u32* ht); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/gx/GXLighting.h b/include/revolution/gx/GXLighting.h new file mode 100644 index 00000000000..099c20f2dbc --- /dev/null +++ b/include/revolution/gx/GXLighting.h @@ -0,0 +1,32 @@ +#ifndef _REVOLUTION_GX_GXLIGHTING_H_ +#define _REVOLUTION_GX_GXLIGHTING_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void GXInitLightAttn(GXLightObj* lt_obj, f32 a0, f32 a1, f32 a2, f32 k0, f32 k1, f32 k2); +void GXInitLightAttnA(GXLightObj* lt_obj, f32 a0, f32 a1, f32 a2); +void GXInitLightAttnK(GXLightObj* lt_obj, f32 k0, f32 k1, f32 k2); +void GXInitLightSpot(GXLightObj* lt_obj, f32 cutoff, GXSpotFn spot_func); +void GXInitLightDistAttn(GXLightObj* lt_obj, f32 ref_dist, f32 ref_br, GXDistAttnFn dist_func); +void GXInitLightPos(GXLightObj* lt_obj, f32 x, f32 y, f32 z); +void GXInitLightDir(GXLightObj* lt_obj, f32 nx, f32 ny, f32 nz); +void GXInitSpecularDir(GXLightObj* lt_obj, f32 nx, f32 ny, f32 nz); +void GXInitSpecularDirHA(GXLightObj* lt_obj, f32 nx, f32 ny, f32 nz, f32 hx, f32 hy, f32 hz); +void GXInitLightColor(GXLightObj* lt_obj, GXColor color); +void GXLoadLightObjImm(const GXLightObj* lt_obj, GXLightID light); +void GXLoadLightObjIndx(u32 lt_obj_indx, GXLightID light); +void GXSetChanAmbColor(GXChannelID chan, GXColor amb_color); +void GXSetChanMatColor(GXChannelID chan, GXColor mat_color); +void GXSetNumChans(u8 nChans); +void GXSetChanCtrl(GXChannelID chan, GXBool enable, GXColorSrc amb_src, GXColorSrc mat_src, u32 light_mask, GXDiffuseFn diff_fn, GXAttnFn attn_fn); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/gx/GXManage.h b/include/revolution/gx/GXManage.h new file mode 100644 index 00000000000..e0c592d6f49 --- /dev/null +++ b/include/revolution/gx/GXManage.h @@ -0,0 +1,36 @@ +#ifndef _REVOLUTION_GX_GXMANAGE_H_ +#define _REVOLUTION_GX_GXMANAGE_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void (*GXDrawSyncCallback)(u16 token); +typedef void (*GXDrawDoneCallback)(void); + +// Init +BOOL IsWriteGatherBufferEmpty(void); +GXFifoObj* GXInit(void* base, u32 size); + +// Misc +void GXSetMisc(GXMiscToken token, u32 val); +void GXFlush(void); +void GXResetWriteGatherPipe(void); +void GXAbortFrame(void); +void GXSetDrawSync(u16 token); +u16 GXReadDrawSync(void); +void GXSetDrawDone(void); +void GXWaitDrawDone(void); +void GXDrawDone(void); +void GXPixModeSync(void); +void GXTexModeSync(void); +GXDrawSyncCallback GXSetDrawSyncCallback(GXDrawSyncCallback cb); +GXDrawDoneCallback GXSetDrawDoneCallback(GXDrawDoneCallback cb); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/gx/GXPerf.h b/include/revolution/gx/GXPerf.h new file mode 100644 index 00000000000..86a7ce5852a --- /dev/null +++ b/include/revolution/gx/GXPerf.h @@ -0,0 +1,30 @@ +#ifndef _REVOLUTION_GX_GXPERF_H_ +#define _REVOLUTION_GX_GXPERF_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void GXSetGPMetric(GXPerf0 perf0, GXPerf1 perf1); +void GXReadGPMetric(u32* cnt0, u32* cnt1); +void GXClearGPMetric(void); +u32 GXReadGP0Metric(void); +u32 GXReadGP1Metric(void); +void GXReadMemMetric(u32* cp_req, u32* tc_req, u32* cpu_rd_req, u32* cpu_wr_req, u32* dsp_req, u32* io_req, u32* vi_req, u32* pe_req, u32* rf_req, u32* fi_req); +void GXClearMemMetric(void); +void GXReadPixMetric(u32* top_pixels_in, u32* top_pixels_out, u32* bot_pixels_in, u32* bot_pixels_out, u32* clr_pixels_in, u32* copy_clks); +void GXClearPixMetric(void); +void GXSetVCacheMetric(GXVCachePerf attr); +void GXReadVCacheMetric(u32* check, u32* miss, u32* stall); +void GXClearVCacheMetric(void); +void GXInitXfRasMetric(void); +void GXReadXfRasMetric(u32* xf_wait_in, u32* xf_wait_out, u32* ras_busy, u32* clocks); +u32 GXReadClksPerVtx(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/gx/GXPixel.h b/include/revolution/gx/GXPixel.h new file mode 100644 index 00000000000..a92a4b4ce73 --- /dev/null +++ b/include/revolution/gx/GXPixel.h @@ -0,0 +1,30 @@ +#ifndef _REVOLUTION_GX_GXPIXEL_H_ +#define _REVOLUTION_GX_GXPIXEL_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void GXSetFog(GXFogType type, f32 startz, f32 endz, f32 nearz, f32 farz, GXColor color); +void GXInitFogAdjTable(GXFogAdjTable* table, u16 width, const f32 projmtx[4][4]); +void GXSetFogRangeAdj(GXBool enable, u16 center, const GXFogAdjTable* table); +void GXSetBlendMode(GXBlendMode type, GXBlendFactor src_factor, GXBlendFactor dst_factor, GXLogicOp op); +void GXSetColorUpdate(GXBool update_enable); +void GXSetAlphaUpdate(GXBool update_enable); +void GXSetZMode(GXBool compare_enable, GXCompare func, GXBool update_enable); +void GXSetZCompLoc(GXBool before_tex); +void GXSetPixelFmt(GXPixelFmt pix_fmt, GXZFmt16 z_fmt); +void GXSetDither(GXBool dither); +void GXSetDstAlpha(GXBool enable, u8 alpha); +void GXSetFieldMask(GXBool odd_mask, GXBool even_mask); +void GXSetFieldMode(GXBool field_mode, GXBool half_aspect_ratio); +void GXSetFogColor(GXColor color); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/gx/GXStruct.h b/include/revolution/gx/GXStruct.h new file mode 100644 index 00000000000..4a875fb02ba --- /dev/null +++ b/include/revolution/gx/GXStruct.h @@ -0,0 +1,75 @@ +#ifndef _REVOLUTION_GX_GXSTRUCT_H_ +#define _REVOLUTION_GX_GXSTRUCT_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct _GXRenderModeObj { + /* 0x00 */ VITVMode viTVmode; + /* 0x04 */ u16 fbWidth; + /* 0x06 */ u16 efbHeight; + /* 0x08 */ u16 xfbHeight; + /* 0x0A */ u16 viXOrigin; + /* 0x0C */ u16 viYOrigin; + /* 0x0E */ u16 viWidth; + /* 0x10 */ u16 viHeight; + /* 0x14 */ VIXFBMode xFBmode; + /* 0x18 */ u8 field_rendering; + /* 0x19 */ u8 aa; + /* 0x20 */ u8 sample_pattern[12][2]; + /* 0x38 */ u8 vfilter[7]; +} GXRenderModeObj; + +typedef struct _GXColor { + u8 r, g, b, a; +} GXColor; + +typedef struct _GXColorS10 { + s16 r, g, b, a; +} GXColorS10; + +typedef struct _GXTexObj { + u32 dummy[8]; +} GXTexObj; + +typedef struct _GXLightObj { + u32 dummy[16]; +} GXLightObj; + +typedef struct _GXTexRegion { + u32 dummy[4]; +} GXTexRegion; + +typedef struct _GXTlutObj { + u32 dummy[3]; +} GXTlutObj; + +typedef struct _GXTlutRegion { + u32 dummy[4]; +} GXTlutRegion; + +typedef struct _GXFogAdjTable { + u16 r[10]; +} GXFogAdjTable; + +typedef struct _GXVtxDescList { + GXAttr attr; + GXAttrType type; +} GXVtxDescList; + +typedef struct _GXVtxAttrFmtList { + GXAttr attr; + GXCompCnt cnt; + GXCompType type; + u8 frac; +} GXVtxAttrFmtList; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/gx/GXTev.h b/include/revolution/gx/GXTev.h new file mode 100644 index 00000000000..375195aa36e --- /dev/null +++ b/include/revolution/gx/GXTev.h @@ -0,0 +1,33 @@ +#ifndef _REVOLUTION_GX_GXTEV_H_ +#define _REVOLUTION_GX_GXTEV_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void GXSetTevOp(GXTevStageID id, GXTevMode mode); +void GXSetTevColorIn(GXTevStageID stage, GXTevColorArg a, GXTevColorArg b, GXTevColorArg c, GXTevColorArg d); +void GXSetTevAlphaIn(GXTevStageID stage, GXTevAlphaArg a, GXTevAlphaArg b, GXTevAlphaArg c, GXTevAlphaArg d); +void GXSetTevColorOp(GXTevStageID stage, GXTevOp op, GXTevBias bias, GXTevScale scale, GXBool clamp, GXTevRegID out_reg); +void GXSetTevAlphaOp(GXTevStageID stage, GXTevOp op, GXTevBias bias, GXTevScale scale, GXBool clamp, GXTevRegID out_reg); +void GXSetTevColor(GXTevRegID id, GXColor color); +void GXSetTevColorS10(GXTevRegID id, GXColorS10 color); +void GXSetTevKColor(GXTevKColorID id, GXColor color); +void GXSetTevKColorSel(GXTevStageID stage, GXTevKColorSel sel); +void GXSetTevKAlphaSel(GXTevStageID stage, GXTevKAlphaSel sel); +void GXSetTevSwapMode(GXTevStageID stage, GXTevSwapSel ras_sel, GXTevSwapSel tex_sel); +void GXSetTevSwapModeTable(GXTevSwapSel table, GXTevColorChan red, GXTevColorChan green, GXTevColorChan blue, GXTevColorChan alpha); +void GXSetTevClampMode(void); +void GXSetAlphaCompare(GXCompare comp0, u8 ref0, GXAlphaOp op, GXCompare comp1, u8 ref1); +void GXSetZTexture(GXZTexOp op, GXTexFmt fmt, u32 bias); +void GXSetTevOrder(GXTevStageID stage, GXTexCoordID coord, GXTexMapID map, GXChannelID color); +void GXSetNumTevStages(u8 nStages); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/gx/GXTexture.h b/include/revolution/gx/GXTexture.h new file mode 100644 index 00000000000..bdac23c866f --- /dev/null +++ b/include/revolution/gx/GXTexture.h @@ -0,0 +1,52 @@ +#ifndef _REVOLUTION_GX_GXTEXTURE_H_ +#define _REVOLUTION_GX_GXTEXTURE_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef GXTexRegion *(*GXTexRegionCallback)(GXTexObj* t_obj, GXTexMapID id); +typedef GXTlutRegion *(*GXTlutRegionCallback)(u32 idx); + +u32 GXGetTexBufferSize(u16 width, u16 height, u32 format, u8 mipmap, u8 max_lod); +void GXInitTexObj(GXTexObj* obj, void* image_ptr, u16 width, u16 height, GXTexFmt format, GXTexWrapMode wrap_s, GXTexWrapMode wrap_t, u8 mipmap); +void GXInitTexObjCI(GXTexObj* obj, void* image_ptr, u16 width, u16 height, GXCITexFmt format, GXTexWrapMode wrap_s, GXTexWrapMode wrap_t, u8 mipmap, u32 tlut_name); +void GXInitTexObjLOD(GXTexObj* obj, GXTexFilter min_filt, GXTexFilter mag_filt, + f32 min_lod, f32 max_lod, f32 lod_bias, GXBool bias_clamp, + GXBool do_edge_lod, GXAnisotropy max_aniso); +void GXInitTexObjData(GXTexObj* obj, void* image_ptr); +void GXInitTexObjWrapMode(GXTexObj* obj, GXTexWrapMode s, GXTexWrapMode t); +void GXInitTexObjTlut(GXTexObj* obj, u32 tlut_name); +void GXInitTexObjUserData(GXTexObj* obj, void* user_data); +void* GXGetTexObjUserData(const GXTexObj* obj); +void GXLoadTexObjPreLoaded(GXTexObj* obj, GXTexRegion* region, GXTexMapID id); +void GXLoadTexObj(GXTexObj* obj, GXTexMapID id); +void GXInitTlutObj(GXTlutObj* tlut_obj, void* lut, GXTlutFmt fmt, u16 n_entries); +void GXLoadTlut(GXTlutObj* tlut_obj, u32 tlut_name); +void GXInitTexCacheRegion(GXTexRegion* region, u8 is_32b_mipmap, u32 tmem_even, GXTexCacheSize size_even, u32 tmem_odd, GXTexCacheSize size_odd); +void GXInitTexPreLoadRegion(GXTexRegion* region, u32 tmem_even, u32 size_even, u32 tmem_odd, u32 size_odd); +void GXInitTlutRegion(GXTlutRegion* region, u32 tmem_addr, GXTlutSize tlut_size); +void GXInvalidateTexRegion(GXTexRegion* region); +void GXInvalidateTexAll(void); +GXTexRegionCallback GXSetTexRegionCallback(GXTexRegionCallback f); +GXTlutRegionCallback GXSetTlutRegionCallback(GXTlutRegionCallback f); +void GXPreLoadEntireTexture(GXTexObj* tex_obj, GXTexRegion* region); +void GXSetTexCoordScaleManually(GXTexCoordID coord, u8 enable, u16 ss, u16 ts); +void GXSetTexCoordCylWrap(GXTexCoordID coord, u8 s_enable, u8 t_enable); +void GXSetTexCoordBias(GXTexCoordID coord, u8 s_enable, u8 t_enable); +void GXInitTexObjFilter(GXTexObj* obj, GXTexFilter min_filt, GXTexFilter mag_filt); +void GXInitTexObjMaxLOD(GXTexObj* obj, f32 max_lod); +void GXInitTexObjMinLOD(GXTexObj* obj, f32 min_lod); +void GXInitTexObjLODBias(GXTexObj* obj, f32 lod_bias); +void GXInitTexObjBiasClamp(GXTexObj* obj, u8 bias_clamp); +void GXInitTexObjEdgeLOD(GXTexObj* obj, u8 do_edge_lod); +void GXInitTexObjMaxAniso(GXTexObj* obj, GXAnisotropy max_aniso); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/gx/GXTransform.h b/include/revolution/gx/GXTransform.h new file mode 100644 index 00000000000..19026d185c5 --- /dev/null +++ b/include/revolution/gx/GXTransform.h @@ -0,0 +1,34 @@ +#ifndef _REVOLUTION_GX_GXTRANSFORM_H_ +#define _REVOLUTION_GX_GXTRANSFORM_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define GX_PROJECTION_SZ 7 +#define GX_VIEWPORT_SZ 6 + +void GXProject(f32 x, f32 y, f32 z, const f32 mtx[3][4], const f32* pm, const f32* vp, f32* sx, f32* sy, f32* sz); +void GXSetProjection(const f32 mtx[4][4], GXProjectionType type); +void GXSetProjectionv(const f32* ptr); +void GXLoadPosMtxImm(const f32 mtx[3][4], u32 id); +void GXLoadPosMtxIndx(u16 mtx_indx, u32 id); +void GXLoadNrmMtxImm(const f32 mtx[3][4], u32 id); +void GXLoadNrmMtxImm3x3(const f32 mtx[3][3], u32 id); +void GXLoadNrmMtxIndx3x3(u16 mtx_indx, u32 id); +void GXSetCurrentMtx(u32 id); +void GXLoadTexMtxImm(const f32 mtx[][4], u32 id, GXTexMtxType type); +void GXLoadTexMtxIndx(u16 mtx_indx, u32 id, GXTexMtxType type); +void GXSetViewportJitter(f32 left, f32 top, f32 wd, f32 ht, f32 nearz, f32 farz, u32 field); +void GXSetViewport(f32 left, f32 top, f32 wd, f32 ht, f32 nearz, f32 farz); +void GXSetScissorBoxOffset(s32 x_off, s32 y_off); +void GXSetClipMode(GXClipMode mode); +void GXSetZScaleOffset(f32 scale, f32 offset); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/gx/GXVerify.h b/include/revolution/gx/GXVerify.h new file mode 100644 index 00000000000..5262d5c6753 --- /dev/null +++ b/include/revolution/gx/GXVerify.h @@ -0,0 +1,29 @@ +#ifndef _REVOLUTION_GX_GXVERIFY_H_ +#define _REVOLUTION_GX_GXVERIFY_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + GX_WARN_NONE, + GX_WARN_SEVERE, + GX_WARN_MEDIUM, + GX_WARN_ALL +} GXWarningLevel; + +typedef void (*GXVerifyCallback)(GXWarningLevel level, u32 id, char* msg); + +void GXSetVerifyLevel(GXWarningLevel level); +GXVerifyCallback GXSetVerifyCallback(GXVerifyCallback cb); + +void __GXVerifyVATImm(GXAttr attr, GXCompCnt cnt, GXCompType type, u8 frac); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/gx/GXVert.h b/include/revolution/gx/GXVert.h new file mode 100644 index 00000000000..1ecbeb25068 --- /dev/null +++ b/include/revolution/gx/GXVert.h @@ -0,0 +1,140 @@ +#ifndef _REVOLUTION_GX_GXVERT_H_ +#define _REVOLUTION_GX_GXVERT_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define GXFIFO_ADDR 0xCC008000 + +typedef union { + u8 u8; + u16 u16; + u32 u32; + u64 u64; + s8 s8; + s16 s16; + s32 s32; + s64 s64; + f32 f32; + f64 f64; +} PPCWGPipe; + +#ifdef __MWERKS__ +volatile PPCWGPipe GXWGFifo AT_ADDRESS(GXFIFO_ADDR); +#else +#define GXWGFifo (*(volatile PPCWGPipe *)GXFIFO_ADDR) +#endif + +#if DEBUG + +// external functions + +#define FUNC_1PARAM(name, T) void name##1##T(const T x); +#define FUNC_2PARAM(name, T) void name##2##T(const T x, const T y); +#define FUNC_3PARAM(name, T) void name##3##T(const T x, const T y, const T z); +#define FUNC_4PARAM(name, T) void name##4##T(const T x, const T y, const T z, const T w); +#define FUNC_INDEX8(name) void name##1x8(const u8 x); +#define FUNC_INDEX16(name) void name##1x16(const u16 x); + +#else + +// inline functions + +#define FUNC_1PARAM(name, T) \ +static inline void name##1##T(const T x) { GXWGFifo.T = x; } + +#define FUNC_2PARAM(name, T) \ +static inline void name##2##T(const T x, const T y) { GXWGFifo.T = x; GXWGFifo.T = y; } + +#define FUNC_3PARAM(name, T) \ +static inline void name##3##T(const T x, const T y, const T z) { GXWGFifo.T = x; GXWGFifo.T = y; GXWGFifo.T = z; } + +#define FUNC_4PARAM(name, T) \ +static inline void name##4##T(const T x, const T y, const T z, const T w) { GXWGFifo.T = x; GXWGFifo.T = y; GXWGFifo.T = z; GXWGFifo.T = w; } + +#define FUNC_INDEX8(name) \ +static inline void name##1x8(const u8 x) { GXWGFifo.u8 = x; } + +#define FUNC_INDEX16(name) \ +static inline void name##1x16(const u16 x) { GXWGFifo.u16 = x; } + +#endif + +// GXCmd +FUNC_1PARAM(GXCmd, u8) +FUNC_1PARAM(GXCmd, u16) +FUNC_1PARAM(GXCmd, u32) + +// GXParam +FUNC_1PARAM(GXParam, u8) +FUNC_1PARAM(GXParam, u16) +FUNC_1PARAM(GXParam, u32) +FUNC_1PARAM(GXParam, s8) +FUNC_1PARAM(GXParam, s16) +FUNC_1PARAM(GXParam, s32) +FUNC_1PARAM(GXParam, f32) +FUNC_3PARAM(GXParam, f32) +FUNC_4PARAM(GXParam, f32) + +// GXPosition +FUNC_3PARAM(GXPosition, f32) +FUNC_3PARAM(GXPosition, u8) +FUNC_3PARAM(GXPosition, s8) +FUNC_3PARAM(GXPosition, u16) +FUNC_3PARAM(GXPosition, s16) +FUNC_2PARAM(GXPosition, f32) +FUNC_2PARAM(GXPosition, u8) +FUNC_2PARAM(GXPosition, s8) +FUNC_2PARAM(GXPosition, u16) +FUNC_2PARAM(GXPosition, s16) +FUNC_INDEX16(GXPosition) +FUNC_INDEX8(GXPosition) + +// GXNormal +FUNC_3PARAM(GXNormal, f32) +FUNC_3PARAM(GXNormal, s16) +FUNC_3PARAM(GXNormal, s8) +FUNC_INDEX16(GXNormal) +FUNC_INDEX8(GXNormal) + +// GXColor +FUNC_4PARAM(GXColor, u8) +FUNC_1PARAM(GXColor, u32) +FUNC_3PARAM(GXColor, u8) +FUNC_1PARAM(GXColor, u16) +FUNC_INDEX16(GXColor) +FUNC_INDEX8(GXColor) + +// GXTexCoord +FUNC_2PARAM(GXTexCoord, f32) +FUNC_2PARAM(GXTexCoord, s16) +FUNC_2PARAM(GXTexCoord, u16) +FUNC_2PARAM(GXTexCoord, s8) +FUNC_2PARAM(GXTexCoord, u8) +FUNC_1PARAM(GXTexCoord, f32) +FUNC_1PARAM(GXTexCoord, s16) +FUNC_1PARAM(GXTexCoord, u16) +FUNC_1PARAM(GXTexCoord, s8) +FUNC_1PARAM(GXTexCoord, u8) +FUNC_INDEX16(GXTexCoord) +FUNC_INDEX8(GXTexCoord) + +// GXMatrixIndex +FUNC_1PARAM(GXMatrixIndex, u8) + +#undef FUNC_1PARAM +#undef FUNC_2PARAM +#undef FUNC_3PARAM +#undef FUNC_4PARAM +#undef FUNC_INDEX8 +#undef FUNC_INDEX16 + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/hw_regs.h b/include/revolution/hw_regs.h new file mode 100644 index 00000000000..fd81060f151 --- /dev/null +++ b/include/revolution/hw_regs.h @@ -0,0 +1,116 @@ +#ifndef _REVOLUTION_HW_REGS_H_ +#define _REVOLUTION_HW_REGS_H_ + +#include + +#ifdef __MWERKS__ +volatile u16 __VIRegs[59] AT_ADDRESS(0xCC002000); +volatile u32 __PIRegs[12] AT_ADDRESS(0xCC003000); +volatile u16 __MEMRegs[64] AT_ADDRESS(0xCC004000); +volatile u16 __DSPRegs[] AT_ADDRESS(0xCC005000); +volatile u32 __DIRegs[] AT_ADDRESS(0xCC006000); +volatile u32 __SIRegs[0x100] AT_ADDRESS(0xCC006400); +volatile u32 __EXIRegs[0x40] AT_ADDRESS(0xCC006800); +volatile u32 __AIRegs[8] AT_ADDRESS(0xCC006C00); +#else +#define __VIRegs ((volatile u16 *)0xCC002000) +#define __PIRegs ((volatile u32 *)0xCC003000) +#define __MEMRegs ((volatile u16 *)0xCC004000) +#define __DSPRegs ((volatile u16 *)0xCC005000) +#define __DIRegs ((volatile u32 *)0xCC006000) +#define __SIRegs ((volatile u32 *)0xCC006400) +#define __EXIRegs ((volatile u32 *)0xCC006800) +#define __AIRegs ((volatile u32 *)0xCC006C00) +#endif + +// Offsets for __VIRegs + +// offsets for __VIRegs[i] +#define VI_VERT_TIMING (0) +#define VI_DISP_CONFIG (1) +#define VI_HORIZ_TIMING_0L (2) +#define VI_HORIZ_TIMING_0U (3) +#define VI_HORIZ_TIMING_1L (4) +#define VI_HORIZ_TIMING_1U (5) +#define VI_VERT_TIMING_ODD (6) +#define VI_VERT_TIMING_ODD_U (7) +#define VI_VERT_TIMING_EVEN (8) +#define VI_VERT_TIMING_EVEN_U (9) + +#define VI_BBI_ODD (10) // burst blanking interval +#define VI_BBI_ODD_U (11) // burst blanking interval +#define VI_BBI_EVEN (12) // burst blanking interval +#define VI_BBI_EVEN_U (13) // burst blanking interval + +#define VI_TOP_FIELD_BASE_LEFT (14) // top in 2d, top of left pic in 3d +#define VI_TOP_FIELD_BASE_LEFT_U (15) // top in 2d, top of left pic in 3d + +#define VI_TOP_FIELD_BASE_RIGHT (16) // top of right pic in 3d +#define VI_TOP_FIELD_BASE_RIGHT_U (17) // top of right pic in 3d + +#define VI_BTTM_FIELD_BASE_LEFT (18) // bottom in 2d, bottom of left pic in 3d +#define VI_BTTM_FIELD_BASE_LEFT_U (19) // bottom in 2d, bottom of left pic in 3d + +#define VI_BTTM_FIELD_BASE_RIGHT (20) // bottom of right pic in 3d +#define VI_BTTM_FIELD_BASE_RIGHT_U (21) // bottom of right pic in 3d + +#define VI_VERT_COUNT (22) // vertical display position +#define VI_HORIZ_COUNT (23) // horizontal display position + +#define VI_DISP_INT_0 (24) // display interrupt 0L +#define VI_DISP_INT_0U (25) // display interrupt 0U +#define VI_DISP_INT_1 (26) // display interrupt 1L +#define VI_DISP_INT_1U (27) // display interrupt 1U +#define VI_DISP_INT_2 (28) // display interrupt 2L +#define VI_DISP_INT_2U (29) // display interrupt 2U +#define VI_DISP_INT_3 (30) // display interrupt 3L +#define VI_DISP_INT_3U (31) // display interrupt 3U + +#define VI_HSW (36) // horizontal scaling width +#define VI_HSR (37) // horizontal scaling register + +#define VI_FCT_0 (38) // filter coefficient table 0L +#define VI_FCT_0U (39) // filter coefficient table 0U +#define VI_FCT_1 (40) // filter coefficient table 1L +#define VI_FCT_1U (41) // filter coefficient table 1U +#define VI_FCT_2 (42) // filter coefficient table 2L +#define VI_FCT_2U (43) // filter coefficient table 2U +#define VI_FCT_3 (44) // filter coefficient table 3L +#define VI_FCT_3U (45) // filter coefficient table 3U +#define VI_FCT_4 (46) // filter coefficient table 4L +#define VI_FCT_4U (47) // filter coefficient table 4U +#define VI_FCT_5 (48) // filter coefficient table 5L +#define VI_FCT_5U (49) // filter coefficient table 5U +#define VI_FCT_6 (50) // filter coefficient table 6L +#define VI_FCT_6U (51) // filter coefficient table 6U + +#define VI_CLOCK_SEL (54) // clock select +#define VI_DTV_STAT (55) // DTV status + +#define VI_WIDTH (56) + +// offsets for __DSPRegs[i] +#define DSP_MAILBOX_IN_HI (0) +#define DSP_MAILBOX_IN_LO (1) +#define DSP_MAILBOX_OUT_HI (2) +#define DSP_MAILBOX_OUT_LO (3) +#define DSP_CONTROL_STATUS (5) + +#define DSP_ARAM_SIZE (9) +#define DSP_ARAM_MODE (11) +#define DSP_ARAM_REFRESH (13) +#define DSP_ARAM_DMA_MM_HI (16) // Main mem address +#define DSP_ARAM_DMA_MM_LO (17) +#define DSP_ARAM_DMA_ARAM_HI (18) // ARAM address +#define DSP_ARAM_DMA_ARAM_LO (19) +#define DSP_ARAM_DMA_SIZE_HI (20) // DMA buffer size +#define DSP_ARAM_DMA_SIZE_LO (21) + +#define DSP_DMA_START_HI (24) // DMA start address +#define DSP_DMA_START_LO (25) +#define DSP_DMA_CONTROL_LEN (27) +#define DSP_DMA_BYTES_LEFT (29) + +#define DSP_DMA_START_FLAG (0x8000) // set to start DSP + +#endif diff --git a/include/revolution/mix.h b/include/revolution/mix.h new file mode 100644 index 00000000000..20f10b6905c --- /dev/null +++ b/include/revolution/mix.h @@ -0,0 +1,95 @@ +#ifndef _REVOLUTION_MIX_H_ +#define _REVOLUTION_MIX_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define MIX_SOUND_MODE_MONO 0 +#define MIX_SOUND_MODE_STEREO 1 +#define MIX_SOUND_MODE_SURROUND 2 +#define MIX_SOUND_MODE_DPL2 3 + +typedef struct MIXChannel { + /* 0x00 */ AXVPB* axvpb; + /* 0x04 */ u32 mode; + /* 0x08 */ int input; + /* 0x0C */ int auxA; + /* 0x10 */ int auxB; + /* 0x14 */ int pan; + /* 0x18 */ int span; + /* 0x1C */ int fader; + /* 0x20 */ int l; + /* 0x24 */ int r; + /* 0x28 */ int f; + /* 0x2C */ int b; + /* 0x30 */ int l1; + /* 0x34 */ int r1; + /* 0x38 */ u16 v; + /* 0x3A */ u16 v1; + /* 0x3C */ u16 vL; + /* 0x3E */ u16 vL1; + /* 0x40 */ u16 vR; + /* 0x42 */ u16 vR1; + /* 0x44 */ u16 vS; + /* 0x46 */ u16 vS1; + /* 0x48 */ u16 vAL; + /* 0x4A */ u16 vAL1; + /* 0x4C */ u16 vAR; + /* 0x4E */ u16 vAR1; + /* 0x50 */ u16 vAS; + /* 0x52 */ u16 vAS1; + /* 0x54 */ u16 vBL; + /* 0x56 */ u16 vBL1; + /* 0x58 */ u16 vBR; + /* 0x5A */ u16 vBR1; + /* 0x5C */ u16 vBS; + /* 0x5E */ u16 vBS1; +} MIXChannel; + +void MIXInit(void); +void MIXQuit(void); +void MIXSetSoundMode(u32 mode); +u32 MIXGetSoundMode(void); +void MIXInitChannel(AXVPB* axvpb, u32 mode, int input, int auxA, int auxB, int pan, int span, int fader); +void MIXReleaseChannel(AXVPB* axvpb); +void MIXResetControls(AXVPB* p); +void MIXSetInput(AXVPB* p, int dB); +void MIXAdjustInput(AXVPB* p, int dB); +int MIXGetInput(AXVPB* p); +void MIXAuxAPostFader(AXVPB* p); +void MIXAuxAPreFader(AXVPB* p); +int MIXAuxAIsPostFader(AXVPB* p); +void MIXSetAuxA(AXVPB* p, int dB); +void MIXAdjustAuxA(AXVPB* p, int dB); +int MIXGetAuxA(AXVPB* p); +void MIXAuxBPostFader(AXVPB* p); +void MIXAuxBPreFader(AXVPB* p); +int MIXAuxBIsPostFader(AXVPB* p); +void MIXSetAuxB(AXVPB* p, int dB); +void MIXAdjustAuxB(AXVPB* p, int dB); +int MIXGetAuxB(AXVPB* p); +void MIXSetPan(AXVPB* p, int pan); +void MIXAdjustPan(AXVPB* p, int pan); +int MIXGetPan(AXVPB* p); +void MIXSetSPan(AXVPB* p, int span); +void MIXAdjustSPan(AXVPB* p, int span); +int MIXGetSPan(AXVPB* p); +void MIXMute(AXVPB* p); +void MIXUnMute(AXVPB* p); +int MIXIsMute(AXVPB* p); +void MIXSetFader(AXVPB* p, int dB); +void MIXAdjustFader(AXVPB* p, int dB); +int MIXGetFader(AXVPB* p); +void MIXSetDvdStreamFader(int dB); +int MIXGetDvdStreamFader(void); +void MIXUpdateSettings(void); + +#ifdef __cplusplus +} +#endif + +#endif // _REVOLUTION_MIX_H_ diff --git a/include/revolution/mtx.h b/include/revolution/mtx.h index 91519664aef..bb1051f696a 100644 --- a/include/revolution/mtx.h +++ b/include/revolution/mtx.h @@ -1,5 +1,5 @@ -#ifndef _DOLPHIN_MTX_H_ -#define _DOLPHIN_MTX_H_ +#ifndef _REVOLUTION_MTX_H_ +#define _REVOLUTION_MTX_H_ #include diff --git a/include/revolution/os.h b/include/revolution/os.h new file mode 100644 index 00000000000..f2525f86684 --- /dev/null +++ b/include/revolution/os.h @@ -0,0 +1,354 @@ +#ifndef _REVOLUTION_OS_H_ +#define _REVOLUTION_OS_H_ + +#include + +#include +#include +void OSReportInit(void); +void OSVAttention(const char* fmt, va_list args); + +#ifdef __cplusplus +extern "C" { +#endif + +typedef s64 OSTime; +typedef u32 OSTick; + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// private macro, maybe shouldn't be defined here? +#define OFFSET(addr, align) (((u32)(addr) & ((align)-1))) + +#define DOLPHIN_ALIGNMENT 32 + +// Upper words of the masks, since UIMM is only 16 bits +#define OS_CACHED_REGION_PREFIX 0x8000 +#define OS_UNCACHED_REGION_PREFIX 0xC000 +#define OS_PHYSICAL_MASK 0x3FFF + +#define OS_BASE_CACHED (OS_CACHED_REGION_PREFIX << 16) +#define OS_BASE_UNCACHED (OS_UNCACHED_REGION_PREFIX << 16) + +#ifdef __MWERKS__ +u32 __OSPhysicalMemSize AT_ADDRESS(OS_BASE_CACHED | 0x0028); +volatile int __OSTVMode AT_ADDRESS(OS_BASE_CACHED | 0x00CC); +OSThreadQueue __OSActiveThreadQueue AT_ADDRESS(OS_BASE_CACHED | 0x00DC); +OSThread* __OSCurrentThread AT_ADDRESS(OS_BASE_CACHED | 0x00E4); +u32 __OSSimulatedMemSize AT_ADDRESS(OS_BASE_CACHED | 0x00F0); +u32 __OSBusClock AT_ADDRESS(OS_BASE_CACHED | 0x00F8); +u32 __OSCoreClock AT_ADDRESS(OS_BASE_CACHED | 0x00FC); +volatile u16 __OSDeviceCode AT_ADDRESS(OS_BASE_CACHED | 0x30E6); +u16 __OSWirelessPadFixMode AT_ADDRESS(OS_BASE_CACHED | 0x30E0); + +// unknowns +OSThread* __gUnkThread1 AT_ADDRESS(OS_BASE_CACHED | 0x00D8); +int __gUnknown800030C0[2] AT_ADDRESS(OS_BASE_CACHED | 0x30C0); +u8 __gUnknown800030E3 AT_ADDRESS(OS_BASE_CACHED | 0x30E3); +#else +#define __OSBusClock (*(u32 *)(OS_BASE_CACHED | 0x00F8)) +#define __OSCoreClock (*(u32 *)(OS_BASE_CACHED | 0x00FC)) +#endif + +#define OS_BUS_CLOCK __OSBusClock +#define OS_CORE_CLOCK __OSCoreClock +#define OS_TIMER_CLOCK (OS_BUS_CLOCK/4) + +#define OSTicksToSeconds(ticks) ((ticks) / (OS_TIMER_CLOCK)) +#define OSTicksToMilliseconds(ticks) ((ticks) / (OS_TIMER_CLOCK/1000)) +#define OSTicksToMicroseconds(ticks) ((ticks) * 8 / (OS_TIMER_CLOCK/125000)) +#define OSSecondsToTicks(sec) ((sec) * (OS_TIMER_CLOCK)) +#define OSMillisecondsToTicks(msec) ((msec) * (OS_TIMER_CLOCK / 1000)) +#define OSNanosecondsToTicks(nsec) (((nsec) * (OS_TIMER_CLOCK / 125000)) / 8000) +#define OSMicrosecondsToTicks(usec) (((usec) * (OS_TIMER_CLOCK / 125000)) / 8) + +u32 OSGetConsoleType(void); +void OSInit(void); +void OSRegisterVersion(const char* id); + +void* OSGetArenaHi(void); +void* OSGetArenaLo(void); +void OSSetArenaHi(void* newHi); +void OSSetArenaLo(void* newLo); +void* OSAllocFromMEM1ArenaLo(u32 size, u32 align); +void* OSAllocFromMEM1ArenaHi(u32 size, u32 align); + +u32 OSGetPhysicalMemSize(void); + +void __OSPSInit(void); +void __OSFPRInit(void); +u32 __OSGetDIConfig(void); + +void OSDefaultExceptionHandler(__OSException exception, OSContext* context); + +typedef struct OSCalendarTime { + /* 0x00 */ int sec; + /* 0x04 */ int min; + /* 0x08 */ int hour; + /* 0x0C */ int mday; + /* 0x10 */ int mon; + /* 0x14 */ int year; + /* 0x18 */ int wday; + /* 0x1C */ int yday; + /* 0x20 */ int msec; + /* 0x24 */ int usec; +} OSCalendarTime; + +#include +typedef struct OSBootInfo_s { + DVDDiskID DVDDiskID; + u32 magic; + u32 version; + u32 memorySize; + u32 consoleType; + void* arenaLo; + void* arenaHi; + void* FSTLocation; + u32 FSTMaxLength; +} OSBootInfo; + +typedef struct OSStopwatch { + char* name; + u32 hits; + OSTime total; + OSTime min; + OSTime max; + OSTime last; + BOOL running; + u32 _padding; +} OSStopwatch; + +void OSInitStopwatch(OSStopwatch* sw, char* name); +void OSStartStopwatch(OSStopwatch* sw); +void OSStopStopwatch(OSStopwatch* sw); +OSTime OSCheckStopwatch(OSStopwatch* sw); +void OSResetStopwatch(OSStopwatch* sw); +void OSDumpStopwatch(OSStopwatch* sw); + +OSTick OSGetTick(void); +OSTime OSGetTime(void); +void OSTicksToCalendarTime(OSTime ticks, OSCalendarTime* td); +OSTime OSCalendarTimeToTicks(OSCalendarTime* td); +BOOL OSEnableInterrupts(void); +BOOL OSDisableInterrupts(void); +BOOL OSRestoreInterrupts(BOOL level); + +#define OS_CONSOLE_MASK 0xF0000000 +#define OS_CONSOLE_RETAIL 0x00000000 +#define OS_CONSOLE_DEVELOPMENT 0x10000000 +#define OS_CONSOLE_TDEV 0x20000000 + +#define OS_CONSOLE_RETAIL4 0x00000004 +#define OS_CONSOLE_RETAIL3 0x00000003 +#define OS_CONSOLE_RETAIL2 0x00000002 +#define OS_CONSOLE_RETAIL1 0x00000001 +#define OS_CONSOLE_TDEVHW4 0x20000007 +#define OS_CONSOLE_TDEVHW3 0x20000006 +#define OS_CONSOLE_TDEVHW2 0x20000005 +#define OS_CONSOLE_TDEVHW1 0x20000004 +#define OS_CONSOLE_DEVHW4 0x10000007 +#define OS_CONSOLE_DEVHW3 0x10000006 +#define OS_CONSOLE_DEVHW2 0x10000005 +#define OS_CONSOLE_DEVHW1 0x10000004 +#define OS_CONSOLE_MINNOW 0x10000003 +#define OS_CONSOLE_ARTHUR 0x10000002 +#define OS_CONSOLE_PC_EMULATOR 0x10000001 +#define OS_CONSOLE_EMULATOR 0x10000000 + +#define OS_SOUND_MODE_MONO 0 +#define OS_SOUND_MODE_STEREO 1 + +u32 OSGetSoundMode(void); +void OSSetSoundMode(u32 mode); + +__declspec(weak) void OSReport(const char* msg, ...); +__declspec(weak) void OSVReport(const char* msg, va_list list); +__declspec(weak) void OSPanic(const char* file, int line, const char* msg, ...); +void OSFatal(GXColor fg, GXColor bg, const char* msg); + +// do these belong here? +__declspec(weak) void OSAttention(const char* msg, ...); +__declspec(weak) void OSReport_Error(const char* fmt, ...); +__declspec(weak) void OSReport_FatalError(const char* fmt, ...); +__declspec(weak) void OSReport_System(const char* fmt, ...); +__declspec(weak) void OSReport_Warning(const char* fmt, ...); +__declspec(weak) void OSReportDisable(void); +__declspec(weak) void OSReportEnable(void); +__declspec(weak) void OSReportForceEnableOff(void); +__declspec(weak) void OSReportForceEnableOn(void); +__declspec(weak) void OSVReport(const char* format, va_list list); + +__declspec(weak) void OSSwitchFiberEx(u32, u32, u32, u32, u32, u32); + +#ifdef DEBUG +#define OS_REPORT(...) OSReport(__VA_ARGS__) +#define OS_WARNING(...) OSReport_Warning(__VA_ARGS__) +#define OS_REPORT_ERROR(...) OSReport_Error(__VA_ARGS__) +#define OS_PANIC(line, msg) OSPanic(__FILE__, line, msg) +#else +#define OS_REPORT(...) +#define OS_WARNING(...) +#define OS_REPORT_ERROR(...) +#define OS_PANIC(...) +#endif + +extern u8 __OSReport_disable; +extern u8 __OSReport_Error_disable; +extern u8 __OSReport_Warning_disable; +extern u8 __OSReport_System_disable; +extern u8 __OSReport_enable; + +#define OSRoundUp32B(x) (((u32)(x) + 32 - 1) & ~(32 - 1)) +#define OSRoundDown32B(x) (((u32)(x)) & ~(32 - 1)) + +void* OSPhysicalToCached(u32 paddr); +void* OSPhysicalToUncached(u32 paddr); +u32 OSCachedToPhysical(void* caddr); +u32 OSUncachedToPhysical(void* ucaddr); +void* OSCachedToUncached(void* caddr); +void* OSUncachedToCached(void* ucaddr); + +#if !DEBUG +#define OSPhysicalToCached(paddr) ((void*) ((u32)(OS_BASE_CACHED + (u32)(paddr)))) +#define OSPhysicalToUncached(paddr) ((void*) ((u32)(OS_BASE_UNCACHED + (u32)(paddr)))) +#define OSCachedToPhysical(caddr) ((u32) ((u32)(caddr) - OS_BASE_CACHED)) +#define OSUncachedToPhysical(ucaddr) ((u32) ((u32)(ucaddr) - OS_BASE_UNCACHED)) +#define OSCachedToUncached(caddr) ((void*) ((u8*)(caddr) + (OS_BASE_UNCACHED - OS_BASE_CACHED))) +#define OSUncachedToCached(ucaddr) ((void*) ((u8*)(ucaddr) - (OS_BASE_UNCACHED - OS_BASE_CACHED))) +#endif + +// unsorted externs +extern OSTime __OSGetSystemTime(void); +__declspec(weak) extern int __OSIsGcam; +extern OSExecParams __OSRebootParams; +extern OSTime __OSStartTime; +extern int __OSInIPL; + +// helper for assert line numbers in different revisions +#if SDK_REVISION < 1 + #define LINE(l0, l1, l2) (l0) +#elif SDK_REVISION < 2 + #define LINE(l0, l1, l2) (l1) +#else + #define LINE(l0, l1, l2) (l2) +#endif + +#ifdef DEBUG +#define ASSERTLINE(line, cond) \ + ((cond) || (OSPanic(__FILE__, line, "Failed assertion " #cond), 0)) + +#define ASSERTMSGLINE(line, cond, msg) \ + ((cond) || (OSPanic(__FILE__, line, msg), 0)) + +// This is dumb but we dont have a Metrowerks way to do variadic macros in the macro to make this done in a not scrubby way. +#define ASSERTMSG1LINE(line, cond, msg, arg1) \ + ((cond) || (OSPanic(__FILE__, line, msg, arg1), 0)) + +#define ASSERTMSG2LINE(line, cond, msg, arg1, arg2) \ + ((cond) || (OSPanic(__FILE__, line, msg, arg1, arg2), 0)) + +#define ASSERTMSGLINEV(line, cond, ...) \ + ((cond) || (OSPanic(__FILE__, line, __VA_ARGS__), 0)) + +#else +#define ASSERTLINE(line, cond) (void)0 +#define ASSERTMSGLINE(line, cond, msg) (void)0 +#define ASSERTMSG1LINE(line, cond, msg, arg1) (void)0 +#define ASSERTMSG2LINE(line, cond, msg, arg1, arg2) (void)0 +#define ASSERTMSGLINEV(line, cond, ...) (void)0 +#endif + +#define ASSERT(cond) ASSERTLINE(__LINE__, cond) + +inline s16 __OSf32tos16(register f32 inF) { + register s16 out; + u32 tmp; + register u32* tmpPtr = &tmp; + // clang-format off +#ifdef __MWERKS__ + asm { + psq_st inF, 0(tmpPtr), 0x1, 5 + lha out, 0(tmpPtr) + } +#endif + // clang-format on + + return out; +} + +inline void OSf32tos16(f32* f, s16* out) { + *out = __OSf32tos16(*f); +} + +inline u8 __OSf32tou8(register f32 inF) { + register u8 out; + u32 tmp; + register u32* tmpPtr = &tmp; + // clang-format off +#ifdef __MWERKS__ + asm { + psq_st inF, 0(tmpPtr), 0x1, 2 + lbz out, 0(tmpPtr) + } +#endif + // clang-format on + + return out; +} + +inline void OSf32tou8(f32* f, u8* out) { + *out = __OSf32tou8(*f); +} + +static inline void OSInitFastCast(void) { + // clang-format off +#ifdef __MWERKS__ + asm { + li r3, 4 + oris r3, r3, 4 + mtspr 0x392, r3 + li r3, 5 + oris r3, r3, 5 + mtspr 0x393, r3 + li r3, 6 + oris r3, r3, 6 + mtspr 0x394, r3 + li r3, 7 + oris r3, r3, 7 + mtspr 0x395, r3 + } +#endif + // clang-format on +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/os/OSAlarm.h b/include/revolution/os/OSAlarm.h new file mode 100644 index 00000000000..1f1ad948ad6 --- /dev/null +++ b/include/revolution/os/OSAlarm.h @@ -0,0 +1,36 @@ +#ifndef _REVOLUTION_OSALARM_H_ +#define _REVOLUTION_OSALARM_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OSAlarm OSAlarm; +typedef void (*OSAlarmHandler)(OSAlarm* alarm, OSContext* context); +struct OSAlarm { + OSAlarmHandler handler; + u32 tag; + OSTime fire; + OSAlarm* prev; + OSAlarm* next; + OSTime period; + OSTime start; +}; + +BOOL OSCheckAlarmQueue(void); +void OSInitAlarm(void); +void OSCreateAlarm(OSAlarm* alarm); +void OSSetAlarm(OSAlarm* alarm, OSTime tick, OSAlarmHandler handler); +void OSSetAbsAlarm(OSAlarm* alarm, OSTime time, OSAlarmHandler handler); +void OSSetPeriodicAlarm(OSAlarm* alarm, OSTime start, OSTime period, OSAlarmHandler handler); +void OSCancelAlarm(OSAlarm *alarm); +void OSSetAlarmTag(OSAlarm* alarm, u32 tag); +void OSCancelAlarms(u32 tag); + +#ifdef __cplusplus +} +#endif + +#endif // _REVOLUTION_OSALARM_H_ diff --git a/include/revolution/os/OSAlloc.h b/include/revolution/os/OSAlloc.h new file mode 100644 index 00000000000..50245521e3d --- /dev/null +++ b/include/revolution/os/OSAlloc.h @@ -0,0 +1,34 @@ +#ifndef _REVOLUTION_OSALLOC_H_ +#define _REVOLUTION_OSALLOC_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef int OSHeapHandle; + +extern volatile OSHeapHandle __OSCurrHeap; + +void* OSAllocFromHeap(int heap, u32 size); +void* OSAllocFixed(void* rstart, void* rend); +void OSFreeToHeap(int heap, void* ptr); +int OSSetCurrentHeap(int heap); +void* OSInitAlloc(void* arenaStart, void* arenaEnd, int maxHeaps); +int OSCreateHeap(void* start, void* end); +void OSDestroyHeap(int heap); +void OSAddToHeap(int heap, void* start, void* end); +s32 OSCheckHeap(int heap); +u32 OSReferentSize(void* ptr); +void OSDumpHeap(int heap); +void OSVisitAllocated(void (*visitor)(void*, u32)); + +#define OSAlloc(size) OSAllocFromHeap(__OSCurrHeap, (size)) +#define OSFree(ptr) OSFreeToHeap(__OSCurrHeap, (ptr)) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/os/OSCache.h b/include/revolution/os/OSCache.h new file mode 100644 index 00000000000..f35a1db9e1b --- /dev/null +++ b/include/revolution/os/OSCache.h @@ -0,0 +1,38 @@ +#ifndef _REVOLUTION_OSCACHE_H_ +#define _REVOLUTION_OSCACHE_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void DCInvalidateRange(void* addr, u32 nBytes); +void DCFlushRange(void* addr, u32 nBytes); +void DCStoreRange(void* addr, u32 nBytes); +void DCFlushRangeNoSync(void* addr, u32 nBytes); +void DCStoreRangeNoSync(void* addr, u32 nBytes); +void DCZeroRange(void* addr, u32 nBytes); +void DCTouchRange(void* addr, u32 nBytes); +void ICInvalidateRange(void* addr, u32 nBytes); + +#define LC_BASE_PREFIX 0xE000 +#define LC_BASE (LC_BASE_PREFIX << 16) +#define LCGetBase() ((void*)LC_BASE) + +void LCEnable(void); +void LCDisable(void); +void LCLoadBlocks(void* destTag, void* srcAddr, u32 numBlocks); +void LCStoreBlocks(void* destAddr, void* srcTag, u32 numBlocks); +u32 LCLoadData(void* destAddr, void* srcAddr, u32 nBytes); +u32 LCStoreData(void* destAddr, void* srcAddr, u32 nBytes); +u32 LCQueueLength(void); +void LCQueueWait(u32 len); +void LCFlushQueue(void); +void __OSCacheInit(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/os/OSContext.h b/include/revolution/os/OSContext.h new file mode 100644 index 00000000000..0f1f462f1f2 --- /dev/null +++ b/include/revolution/os/OSContext.h @@ -0,0 +1,173 @@ +#ifndef _REVOLUTION_OSCONTEXT_H_ +#define _REVOLUTION_OSCONTEXT_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define __OS_CONTEXT_FRAME 768 + +#define OS_CONTEXT_R0 0 +#define OS_CONTEXT_R1 4 +#define OS_CONTEXT_R2 8 +#define OS_CONTEXT_R3 12 +#define OS_CONTEXT_R4 16 +#define OS_CONTEXT_R5 20 +#define OS_CONTEXT_R6 24 +#define OS_CONTEXT_R7 28 +#define OS_CONTEXT_R8 32 +#define OS_CONTEXT_R9 36 +#define OS_CONTEXT_R10 40 +#define OS_CONTEXT_R11 44 +#define OS_CONTEXT_R12 48 +#define OS_CONTEXT_R13 52 +#define OS_CONTEXT_R14 56 +#define OS_CONTEXT_R15 60 +#define OS_CONTEXT_R16 64 +#define OS_CONTEXT_R17 68 +#define OS_CONTEXT_R18 72 +#define OS_CONTEXT_R19 76 +#define OS_CONTEXT_R20 80 +#define OS_CONTEXT_R21 84 +#define OS_CONTEXT_R22 88 +#define OS_CONTEXT_R23 92 +#define OS_CONTEXT_R24 96 +#define OS_CONTEXT_R25 100 +#define OS_CONTEXT_R26 104 +#define OS_CONTEXT_R27 108 +#define OS_CONTEXT_R28 112 +#define OS_CONTEXT_R29 116 +#define OS_CONTEXT_R30 120 +#define OS_CONTEXT_R31 124 + +#define OS_CONTEXT_CR 128 +#define OS_CONTEXT_LR 132 +#define OS_CONTEXT_CTR 136 +#define OS_CONTEXT_XER 140 + +#define OS_CONTEXT_FPR0 144 +#define OS_CONTEXT_FPR1 152 +#define OS_CONTEXT_FPR2 160 +#define OS_CONTEXT_FPR3 168 +#define OS_CONTEXT_FPR4 176 +#define OS_CONTEXT_FPR5 184 +#define OS_CONTEXT_FPR6 192 +#define OS_CONTEXT_FPR7 200 +#define OS_CONTEXT_FPR8 208 +#define OS_CONTEXT_FPR9 216 +#define OS_CONTEXT_FPR10 224 +#define OS_CONTEXT_FPR11 232 +#define OS_CONTEXT_FPR12 240 +#define OS_CONTEXT_FPR13 248 +#define OS_CONTEXT_FPR14 256 +#define OS_CONTEXT_FPR15 264 +#define OS_CONTEXT_FPR16 272 +#define OS_CONTEXT_FPR17 280 +#define OS_CONTEXT_FPR18 288 +#define OS_CONTEXT_FPR19 296 +#define OS_CONTEXT_FPR20 304 +#define OS_CONTEXT_FPR21 312 +#define OS_CONTEXT_FPR22 320 +#define OS_CONTEXT_FPR23 328 +#define OS_CONTEXT_FPR24 336 +#define OS_CONTEXT_FPR25 344 +#define OS_CONTEXT_FPR26 352 +#define OS_CONTEXT_FPR27 360 +#define OS_CONTEXT_FPR28 368 +#define OS_CONTEXT_FPR29 376 +#define OS_CONTEXT_FPR30 384 +#define OS_CONTEXT_FPR31 392 + +#define OS_CONTEXT_FPSCR 400 + +#define OS_CONTEXT_SRR0 408 +#define OS_CONTEXT_SRR1 412 + +#define OS_CONTEXT_MODE 416 +#define OS_CONTEXT_STATE 418 + +#define OS_CONTEXT_GQR0 420 +#define OS_CONTEXT_GQR1 424 +#define OS_CONTEXT_GQR2 428 +#define OS_CONTEXT_GQR3 432 +#define OS_CONTEXT_GQR4 436 +#define OS_CONTEXT_GQR5 440 +#define OS_CONTEXT_GQR6 444 +#define OS_CONTEXT_GQR7 448 +#define __OSCONTEXT_PADDING 452 + +#define OS_CONTEXT_PSF0 456 +#define OS_CONTEXT_PSF1 464 +#define OS_CONTEXT_PSF2 472 +#define OS_CONTEXT_PSF3 480 +#define OS_CONTEXT_PSF4 488 +#define OS_CONTEXT_PSF5 496 +#define OS_CONTEXT_PSF6 504 +#define OS_CONTEXT_PSF7 512 +#define OS_CONTEXT_PSF8 520 +#define OS_CONTEXT_PSF9 528 +#define OS_CONTEXT_PSF10 536 +#define OS_CONTEXT_PSF11 544 +#define OS_CONTEXT_PSF12 552 +#define OS_CONTEXT_PSF13 560 +#define OS_CONTEXT_PSF14 568 +#define OS_CONTEXT_PSF15 576 +#define OS_CONTEXT_PSF16 584 +#define OS_CONTEXT_PSF17 592 +#define OS_CONTEXT_PSF18 600 +#define OS_CONTEXT_PSF19 608 +#define OS_CONTEXT_PSF20 616 +#define OS_CONTEXT_PSF21 624 +#define OS_CONTEXT_PSF22 632 +#define OS_CONTEXT_PSF23 640 +#define OS_CONTEXT_PSF24 648 +#define OS_CONTEXT_PSF25 656 +#define OS_CONTEXT_PSF26 664 +#define OS_CONTEXT_PSF27 672 +#define OS_CONTEXT_PSF28 680 +#define OS_CONTEXT_PSF29 688 +#define OS_CONTEXT_PSF30 696 +#define OS_CONTEXT_PSF31 704 +#define OS_CONTEXT_STATE_EXC 0x02u + +#define OS_CONTEXT_STATE_FPSAVED 0x01u + +typedef struct OSContext { + /* 0x000 */ u32 gpr[32]; + /* 0x080 */ u32 cr; + /* 0x084 */ u32 lr; + /* 0x088 */ u32 ctr; + /* 0x08C */ u32 xer; + /* 0x090 */ f64 fpr[32]; + /* 0x190 */ u32 fpscr_pad; + /* 0x194 */ u32 fpscr; + /* 0x198 */ u32 srr0; + /* 0x19C */ u32 srr1; + /* 0x1A0 */ u16 mode; + /* 0x1A2 */ u16 state; + /* 0x1A4 */ u32 gqr[8]; + /* 0x1C4 */ u32 psf_pad; + /* 0x1C8 */ f64 psf[32]; +} OSContext; + +u32 OSGetStackPointer(void); +void OSDumpContext(OSContext* context); +void OSLoadContext(OSContext* context); +u32 OSSaveContext(OSContext* context); +void OSClearContext(OSContext* context); +OSContext* OSGetCurrentContext(void); +void OSSetCurrentContext(OSContext* context); +void OSLoadFPUContext(OSContext* fpucontext); +void OSSaveFPUContext(OSContext* fpucontext); +u32 OSSwitchStack(u32 newsp); +int OSSwitchFiber(u32 pc, u32 newsp); +void OSInitContext(OSContext* context, u32 pc, u32 newsp); +void OSFillFPUContext(OSContext* context); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/os/OSDC.h b/include/revolution/os/OSDC.h new file mode 100644 index 00000000000..74dc87bcfbc --- /dev/null +++ b/include/revolution/os/OSDC.h @@ -0,0 +1,23 @@ +#ifndef _REVOLUTION_OSDC_H_ +#define _REVOLUTION_OSDC_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +void DCFlashInvalidate(void); +void DCEnable(void); +void DCDisable(void); +void DCFreeze(void); +void DCUnfreeze(void); +void DCTouchLoad(void* addr); +void DCBlockZero(void* addr); +void DCBlockStore(void* addr); +void DCBlockFlush(void* addr); +void DCBlockInvalidate(void* addr); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/os/OSError.h b/include/revolution/os/OSError.h new file mode 100644 index 00000000000..bfe3a4486e7 --- /dev/null +++ b/include/revolution/os/OSError.h @@ -0,0 +1,38 @@ +#ifndef _REVOLUTION_OSERROR_H_ +#define _REVOLUTION_OSERROR_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef u16 OSError; +typedef void (*OSErrorHandler)(OSError error, OSContext* context, ...); + +#define OS_ERROR_SYSTEM_RESET 0 +#define OS_ERROR_MACHINE_CHECK 1 +#define OS_ERROR_DSI 2 +#define OS_ERROR_ISI 3 +#define OS_ERROR_EXTERNAL_INTERRUPT 4 +#define OS_ERROR_ALIGNMENT 5 +#define OS_ERROR_PROGRAM 6 +#define OS_ERROR_FLOATING_POINT 7 +#define OS_ERROR_DECREMENTER 8 +#define OS_ERROR_SYSTEM_CALL 9 +#define OS_ERROR_TRACE 10 +#define OS_ERROR_PERFORMACE_MONITOR 11 +#define OS_ERROR_BREAKPOINT 12 +#define OS_ERROR_SYSTEM_INTERRUPT 13 +#define OS_ERROR_THERMAL_INTERRUPT 14 +#define OS_ERROR_MAX (OS_ERROR_THERMAL_INTERRUPT + 1) + +OSErrorHandler OSSetErrorHandler(OSError error, OSErrorHandler handler); +extern u32 __OSFpscrEnableBits; +extern OSErrorHandler __OSErrorTable[17]; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/os/OSException.h b/include/revolution/os/OSException.h new file mode 100644 index 00000000000..c2ee00a479c --- /dev/null +++ b/include/revolution/os/OSException.h @@ -0,0 +1,61 @@ +#ifndef _REVOLUTION_OSEXCEPTION_H_ +#define _REVOLUTION_OSEXCEPTION_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define __OS_EXCEPTION_SYSTEM_RESET 0 +#define __OS_EXCEPTION_MACHINE_CHECK 1 +#define __OS_EXCEPTION_DSI 2 +#define __OS_EXCEPTION_ISI 3 +#define __OS_EXCEPTION_EXTERNAL_INTERRUPT 4 +#define __OS_EXCEPTION_ALIGNMENT 5 +#define __OS_EXCEPTION_PROGRAM 6 +#define __OS_EXCEPTION_FLOATING_POINT 7 +#define __OS_EXCEPTION_DECREMENTER 8 +#define __OS_EXCEPTION_SYSTEM_CALL 9 +#define __OS_EXCEPTION_TRACE 10 +#define __OS_EXCEPTION_PERFORMACE_MONITOR 11 +#define __OS_EXCEPTION_BREAKPOINT 12 +#define __OS_EXCEPTION_SYSTEM_INTERRUPT 13 +#define __OS_EXCEPTION_THERMAL_INTERRUPT 14 +#define __OS_EXCEPTION_MEMORY_PROTECTION 15 +#define __OS_EXCEPTION_FLOATING_POINT_EXCEPTION 16 +#define __OS_EXCEPTION_MAX \ + (__OS_EXCEPTION_THERMAL_INTERRUPT+1) + +typedef u8 __OSException; +typedef void (*__OSExceptionHandler)(__OSException exception, OSContext* context); + +__OSExceptionHandler __OSSetExceptionHandler(__OSException exception, __OSExceptionHandler handler); +__OSExceptionHandler __OSGetExceptionHandler(__OSException exception); + +#define OS_EXCEPTION_SAVE_GPRS(context) \ + stw r0, OS_CONTEXT_R0(context); \ + stw r1, OS_CONTEXT_R1(context); \ + stw r2, OS_CONTEXT_R2(context); \ + stmw r6, OS_CONTEXT_R6(context); \ + mfspr r0, GQR1; \ + stw r0, OS_CONTEXT_GQR1(context); \ + mfspr r0, GQR2; \ + stw r0, OS_CONTEXT_GQR2(context); \ + mfspr r0, GQR3; \ + stw r0, OS_CONTEXT_GQR3(context); \ + mfspr r0, GQR4; \ + stw r0, OS_CONTEXT_GQR4(context); \ + mfspr r0, GQR5; \ + stw r0, OS_CONTEXT_GQR5(context); \ + mfspr r0, GQR6; \ + stw r0, OS_CONTEXT_GQR6(context); \ + mfspr r0, GQR7; \ + stw r0, OS_CONTEXT_GQR7(context); + +#ifdef __cplusplus +} +#endif + +#endif // _REVOLUTION_OSEXCEPTION_H_ diff --git a/include/revolution/os/OSExec.h b/include/revolution/os/OSExec.h new file mode 100644 index 00000000000..a2f384c06e6 --- /dev/null +++ b/include/revolution/os/OSExec.h @@ -0,0 +1,35 @@ +#ifndef _REVOLUTION_OSEXEC_H_ +#define _REVOLUTION_OSEXEC_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + BOOL valid; + u32 restartCode; + u32 bootDol; + void* regionStart; + void* regionEnd; + int argsUseDefault; + void* argsAddr; +} OSExecParams; + +typedef int (*appGetNextCallback)(void*, u32*, u32*); +typedef void (*appInitCallback)(void (*)(char*)); +typedef void* (*appGetEntryCallback)(); +typedef void (*AppLoaderCallback)(appInitCallback*, appGetNextCallback*, appGetEntryCallback*); + +OSExecParams* __OSExecParams AT_ADDRESS(0x800030F0); +s32 __OSAppLoaderOffset AT_ADDRESS(0x800030F4); + +void OSExecv(const char* dolfile, const char** argv); +void OSExecl(const char* dolfile, const char* arg0, ...); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/os/OSFont.h b/include/revolution/os/OSFont.h new file mode 100644 index 00000000000..5e6cf76e268 --- /dev/null +++ b/include/revolution/os/OSFont.h @@ -0,0 +1,58 @@ +#ifndef _REVOLUTION_OSFONT_H_ +#define _REVOLUTION_OSFONT_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define OS_FONT_ENCODE_ANSI 0u +#define OS_FONT_ENCODE_SJIS 1u +#define OS_FONT_ENCODE_MAX 5u +#define OS_FONT_SIZE_ANSI (288 + 131072) // 9 sheets +#define OS_FONT_SIZE_SJIS (3840 + 1179648) // 1 sheet +#define OS_FONT_ROM_SIZE_ANSI 0x03000 +#define OS_FONT_ROM_SIZE_SJIS 0x4D000 + +typedef struct OSFontHeader { + u16 fontType; + u16 firstChar; + u16 lastChar; + u16 invalChar; + u16 ascent; + u16 descent; + u16 width; + u16 leading; + u16 cellWidth; + u16 cellHeight; + u32 sheetSize; + u16 sheetFormat; + u16 sheetColumn; + u16 sheetRow; + u16 sheetWidth; + u16 sheetHeight; + u16 widthTable; + u32 sheetImage; + u32 sheetFullSize; + u8 c0; + u8 c1; + u8 c2; + u8 c3; +} OSFontHeader; + +u16 OSGetFontEncode(void); +u16 OSSetFontEncode(u16 encode); +BOOL OSInitFont(OSFontHeader* fontData); +u32 OSLoadFont(OSFontHeader* fontData, void* tmp); +char* OSGetFontTexture(const char* string, void** image, s32* x, s32* y, s32* width); +char* OSGetFontWidth(const char* string, s32* width); +char* OSGetFontTexel(const char* string, void* image, s32 pos, s32 stride, s32* width); +int OSSetFontWidth(int fixed); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/os/OSIC.h b/include/revolution/os/OSIC.h new file mode 100644 index 00000000000..163c42d1ed2 --- /dev/null +++ b/include/revolution/os/OSIC.h @@ -0,0 +1,20 @@ +#ifndef _REVOLUTION_OSIC_H_ +#define _REVOLUTION_OSIC_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +void ICFlashInvalidate(void); +void ICEnable(void); +void ICDisable(void); +void ICFreeze(void); +void ICUnfreeze(void); +void ICBlockInvalidate(void *addr); +void ICSync(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/os/OSInterrupt.h b/include/revolution/os/OSInterrupt.h new file mode 100644 index 00000000000..babf3fe1ff8 --- /dev/null +++ b/include/revolution/os/OSInterrupt.h @@ -0,0 +1,118 @@ +#ifndef _REVOLUTION_OSINTERRUPT_H_ +#define _REVOLUTION_OSINTERRUPT_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef s16 __OSInterrupt; +typedef u32 OSInterruptMask; + +#define __OS_INTERRUPT_MEM_0 0 +#define __OS_INTERRUPT_MEM_1 1 +#define __OS_INTERRUPT_MEM_2 2 +#define __OS_INTERRUPT_MEM_3 3 +#define __OS_INTERRUPT_MEM_ADDRESS 4 +#define __OS_INTERRUPT_DSP_AI 5 +#define __OS_INTERRUPT_DSP_ARAM 6 +#define __OS_INTERRUPT_DSP_DSP 7 +#define __OS_INTERRUPT_AI_AI 8 +#define __OS_INTERRUPT_EXI_0_EXI 9 +#define __OS_INTERRUPT_EXI_0_TC 10 +#define __OS_INTERRUPT_EXI_0_EXT 11 +#define __OS_INTERRUPT_EXI_1_EXI 12 +#define __OS_INTERRUPT_EXI_1_TC 13 +#define __OS_INTERRUPT_EXI_1_EXT 14 +#define __OS_INTERRUPT_EXI_2_EXI 15 +#define __OS_INTERRUPT_EXI_2_TC 16 +#define __OS_INTERRUPT_PI_CP 17 +#define __OS_INTERRUPT_PI_PE_TOKEN 18 +#define __OS_INTERRUPT_PI_PE_FINISH 19 +#define __OS_INTERRUPT_PI_SI 20 +#define __OS_INTERRUPT_PI_DI 21 +#define __OS_INTERRUPT_PI_RSW 22 +#define __OS_INTERRUPT_PI_ERROR 23 +#define __OS_INTERRUPT_PI_VI 24 +#define __OS_INTERRUPT_PI_DEBUG 25 +#define __OS_INTERRUPT_PI_HSP 26 +#define __OS_INTERRUPT_MAX 32 + +#define OS_INTERRUPTMASK(interrupt) (0x80000000u >> (interrupt)) + +#define OS_INTERRUPTMASK_MEM_0 OS_INTERRUPTMASK(__OS_INTERRUPT_MEM_0) +#define OS_INTERRUPTMASK_MEM_1 OS_INTERRUPTMASK(__OS_INTERRUPT_MEM_1) +#define OS_INTERRUPTMASK_MEM_2 OS_INTERRUPTMASK(__OS_INTERRUPT_MEM_2) +#define OS_INTERRUPTMASK_MEM_3 OS_INTERRUPTMASK(__OS_INTERRUPT_MEM_3) +#define OS_INTERRUPTMASK_MEM_ADDRESS OS_INTERRUPTMASK(__OS_INTERRUPT_MEM_ADDRESS) +#define OS_INTERRUPTMASK_MEM_RESET \ + (OS_INTERRUPTMASK_MEM_0 | OS_INTERRUPTMASK_MEM_1 | OS_INTERRUPTMASK_MEM_2 | \ + OS_INTERRUPTMASK_MEM_3) +#define OS_INTERRUPTMASK_MEM \ + (OS_INTERRUPTMASK_MEM_0 | OS_INTERRUPTMASK_MEM_1 | OS_INTERRUPTMASK_MEM_2 | \ + OS_INTERRUPTMASK_MEM_3 | OS_INTERRUPTMASK_MEM_ADDRESS) +#define OS_INTERRUPTMASK_DSP_AI OS_INTERRUPTMASK(__OS_INTERRUPT_DSP_AI) +#define OS_INTERRUPTMASK_DSP_ARAM OS_INTERRUPTMASK(__OS_INTERRUPT_DSP_ARAM) +#define OS_INTERRUPTMASK_DSP_DSP OS_INTERRUPTMASK(__OS_INTERRUPT_DSP_DSP) +#define OS_INTERRUPTMASK_DSP \ + (OS_INTERRUPTMASK_DSP_AI | OS_INTERRUPTMASK_DSP_ARAM | OS_INTERRUPTMASK_DSP_DSP) +#define OS_INTERRUPTMASK_AI_AI OS_INTERRUPTMASK(__OS_INTERRUPT_AI_AI) +#define OS_INTERRUPTMASK_AI (OS_INTERRUPTMASK_AI_AI) +#define OS_INTERRUPTMASK_EXI_0_EXI OS_INTERRUPTMASK(__OS_INTERRUPT_EXI_0_EXI) +#define OS_INTERRUPTMASK_EXI_0_TC OS_INTERRUPTMASK(__OS_INTERRUPT_EXI_0_TC) +#define OS_INTERRUPTMASK_EXI_0_EXT OS_INTERRUPTMASK(__OS_INTERRUPT_EXI_0_EXT) +#define OS_INTERRUPTMASK_EXI_0 \ + (OS_INTERRUPTMASK_EXI_0_EXI | OS_INTERRUPTMASK_EXI_0_TC | OS_INTERRUPTMASK_EXI_0_EXT) +#define OS_INTERRUPTMASK_EXI_1_EXI OS_INTERRUPTMASK(__OS_INTERRUPT_EXI_1_EXI) +#define OS_INTERRUPTMASK_EXI_1_TC OS_INTERRUPTMASK(__OS_INTERRUPT_EXI_1_TC) +#define OS_INTERRUPTMASK_EXI_1_EXT OS_INTERRUPTMASK(__OS_INTERRUPT_EXI_1_EXT) +#define OS_INTERRUPTMASK_EXI_1 \ + (OS_INTERRUPTMASK_EXI_1_EXI | OS_INTERRUPTMASK_EXI_1_TC | OS_INTERRUPTMASK_EXI_1_EXT) +#define OS_INTERRUPTMASK_EXI_2_EXI OS_INTERRUPTMASK(__OS_INTERRUPT_EXI_2_EXI) +#define OS_INTERRUPTMASK_EXI_2_TC OS_INTERRUPTMASK(__OS_INTERRUPT_EXI_2_TC) +#define OS_INTERRUPTMASK_EXI_2 (OS_INTERRUPTMASK_EXI_2_EXI | OS_INTERRUPTMASK_EXI_2_TC) +#define OS_INTERRUPTMASK_EXI \ + (OS_INTERRUPTMASK_EXI_0_EXI | OS_INTERRUPTMASK_EXI_0_TC | OS_INTERRUPTMASK_EXI_0_EXT | \ + OS_INTERRUPTMASK_EXI_1_EXI | OS_INTERRUPTMASK_EXI_1_TC | OS_INTERRUPTMASK_EXI_1_EXT | \ + OS_INTERRUPTMASK_EXI_2_EXI | OS_INTERRUPTMASK_EXI_2_TC) +#define OS_INTERRUPTMASK_PI_PE_TOKEN OS_INTERRUPTMASK(__OS_INTERRUPT_PI_PE_TOKEN) +#define OS_INTERRUPTMASK_PI_PE_FINISH OS_INTERRUPTMASK(__OS_INTERRUPT_PI_PE_FINISH) +#define OS_INTERRUPTMASK_PI_PE (OS_INTERRUPTMASK_PI_PE_TOKEN | OS_INTERRUPTMASK_PI_PE_FINISH) +#define OS_INTERRUPTMASK_PI_CP OS_INTERRUPTMASK(__OS_INTERRUPT_PI_CP) +#define OS_INTERRUPTMASK_PI_SI OS_INTERRUPTMASK(__OS_INTERRUPT_PI_SI) +#define OS_INTERRUPTMASK_PI_DI OS_INTERRUPTMASK(__OS_INTERRUPT_PI_DI) +#define OS_INTERRUPTMASK_PI_RSW OS_INTERRUPTMASK(__OS_INTERRUPT_PI_RSW) +#define OS_INTERRUPTMASK_PI_ERROR OS_INTERRUPTMASK(__OS_INTERRUPT_PI_ERROR) +#define OS_INTERRUPTMASK_PI_VI OS_INTERRUPTMASK(__OS_INTERRUPT_PI_VI) +#define OS_INTERRUPTMASK_PI_DEBUG OS_INTERRUPTMASK(__OS_INTERRUPT_PI_DEBUG) +#define OS_INTERRUPTMASK_PI_HSP OS_INTERRUPTMASK(__OS_INTERRUPT_PI_HSP) +#define OS_INTERRUPTMASK_PI \ + (OS_INTERRUPTMASK_PI_CP | OS_INTERRUPTMASK_PI_SI | OS_INTERRUPTMASK_PI_DI | \ + OS_INTERRUPTMASK_PI_RSW | OS_INTERRUPTMASK_PI_ERROR | OS_INTERRUPTMASK_PI_VI | \ + OS_INTERRUPTMASK_PI_PE_TOKEN | OS_INTERRUPTMASK_PI_PE_FINISH | OS_INTERRUPTMASK_PI_DEBUG | \ + OS_INTERRUPTMASK_PI_HSP) + +typedef void (*__OSInterruptHandler)(__OSInterrupt interrupt, OSContext* context); + +extern volatile __OSInterrupt __OSLastInterrupt; +extern volatile u32 __OSLastInterruptSrr0; +extern volatile OSTime __OSLastInterruptTime; + +__OSInterruptHandler __OSSetInterruptHandler(__OSInterrupt interrupt, __OSInterruptHandler handler); + +__OSInterruptHandler __OSGetInterruptHandler(__OSInterrupt interrupt); + +void __OSDispatchInterrupt(__OSException exception, OSContext* context); + +OSInterruptMask OSGetInterruptMask(void); +OSInterruptMask OSSetInterruptMask(OSInterruptMask mask); +OSInterruptMask __OSMaskInterrupts(OSInterruptMask mask); +OSInterruptMask __OSUnmaskInterrupts(OSInterruptMask mask); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/os/OSL2.h b/include/revolution/os/OSL2.h new file mode 100644 index 00000000000..f48bd39fed4 --- /dev/null +++ b/include/revolution/os/OSL2.h @@ -0,0 +1,20 @@ +#ifndef _REVOLUTION_OSL2_H_ +#define _REVOLUTION_OSL2_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void L2Enable(void); +void L2Disable(void); +void L2GlobalInvalidate(void); +void L2SetDataOnly(BOOL dataOnly); +void L2SetWriteThrough(BOOL writeThrough); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/os/OSLC.h b/include/revolution/os/OSLC.h new file mode 100644 index 00000000000..7c59f5f5fb1 --- /dev/null +++ b/include/revolution/os/OSLC.h @@ -0,0 +1,19 @@ +#ifndef _REVOLUTION_OSLC_H_ +#define _REVOLUTION_OSLC_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void LCAllocOneTag(BOOL invalidate, void *tag); +void LCAllocTags(BOOL invalidate, void *startTag, u32 numBlocks); +void LCAlloc(void *addr, u32 nBytes); +void LCAllocNoInvalidate(void *addr, u32 nBytes); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/os/OSMemory.h b/include/revolution/os/OSMemory.h new file mode 100644 index 00000000000..9d4bbdd8819 --- /dev/null +++ b/include/revolution/os/OSMemory.h @@ -0,0 +1,28 @@ +#ifndef _REVOLUTION_OSMEMORY_H_ +#define _REVOLUTION_OSMEMORY_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define OS_PROTECT_CHAN0 0 +#define OS_PROTECT_CHAN1 1 +#define OS_PROTECT_CHAN2 2 +#define OS_PROTECT_CHAN3 3 + +#define OS_PROTECT_CONTROL_NONE 0x00 +#define OS_PROTECT_CONTROL_READ 0x01 +#define OS_PROTECT_CONTROL_WRITE 0x02 +#define OS_PROTECT_CONTROL_RDWR (OS_PROTECT_CONTROL_READ | OS_PROTECT_CONTROL_WRITE) + +void OSProtectRange(u32 chan, void* addr, u32 nBytes, u32 control); +u32 OSGetPhysicalMemSize(void); +u32 OSGetConsoleSimulatedMemSize(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/os/OSMessage.h b/include/revolution/os/OSMessage.h new file mode 100644 index 00000000000..a7d0fa4e41f --- /dev/null +++ b/include/revolution/os/OSMessage.h @@ -0,0 +1,33 @@ +#ifndef _REVOLUTION_OSMESSAGE_H_ +#define _REVOLUTION_OSMESSAGE_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void* OSMessage; + +#define OS_MESSAGE_NOBLOCK 0 +#define OS_MESSAGE_BLOCK 1 + +typedef struct { + OSThreadQueue queueSend; + OSThreadQueue queueReceive; + void* msgArray; + s32 msgCount; + s32 firstIndex; + s32 usedCount; +} OSMessageQueue; + +void OSInitMessageQueue(OSMessageQueue* mq, void* msgArray, s32 msgCount); +int OSSendMessage(OSMessageQueue* mq, void* msg, s32 flags); +int OSReceiveMessage(OSMessageQueue* mq, void* msg, s32 flags); +int OSJamMessage(OSMessageQueue* mq, void* msg, s32 flags); + +#ifdef __cplusplus +} +#endif + +#endif // _REVOLUTION_OSMESSAGE_H_ diff --git a/include/revolution/os/OSModule.h b/include/revolution/os/OSModule.h new file mode 100644 index 00000000000..079a259ba36 --- /dev/null +++ b/include/revolution/os/OSModule.h @@ -0,0 +1,117 @@ +#ifndef _REVOLUTION_OSMODULE_H_ +#define _REVOLUTION_OSMODULE_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define OS_MODULE_VERSION 3 +typedef struct OSModuleHeader OSModuleHeader; + +typedef u32 OSModuleID; +typedef struct OSModuleQueue OSModuleQueue; +typedef struct OSModuleLink OSModuleLink; +typedef struct OSModuleInfo OSModuleInfo; +typedef struct OSSectionInfo OSSectionInfo; +typedef struct OSImportInfo OSImportInfo; +typedef struct OSRel OSRel; + +struct OSModuleQueue { + OSModuleInfo* head; + OSModuleInfo* tail; +}; + +struct OSModuleLink { + OSModuleInfo* next; + OSModuleInfo* prev; +}; + +struct OSModuleInfo { + OSModuleID id; // unique identifier for the module + OSModuleLink link; // doubly linked list of modules + u32 numSections; // # of sections + u32 sectionInfoOffset; // offset to section info table + u32 nameOffset; // offset to module name + u32 nameSize; // size of module name + u32 version; // version number +}; + +struct OSModuleHeader { + // CAUTION: info must be the 1st member + OSModuleInfo info; + + // OS_MODULE_VERSION == 1 + u32 bssSize; // total size of bss sections in bytes + u32 relOffset; + u32 impOffset; + u32 impSize; // size in bytes + u8 prologSection; // section # for prolog function + u8 epilogSection; // section # for epilog function + u8 unresolvedSection; // section # for unresolved function + u8 bssSection; // section # for bss section (set at run-time) + u32 prolog; // prolog function offset + u32 epilog; // epilog function offset + u32 unresolved; // unresolved function offset + + // OS_MODULE_VERSION == 2 +#if (2 <= OS_MODULE_VERSION) + u32 align; // module alignment constraint + u32 bssAlign; // bss alignment constraint +#endif + + // OS_MODULE_VERSION == 3 +#if (3 <= OS_MODULE_VERSION) + u32 fixSize; +#endif +}; + +#define OSGetSectionInfo(module) ((OSSectionInfo*)(((OSModuleInfo*)(module))->sectionInfoOffset)) + +struct OSSectionInfo { + u32 offset; + u32 size; +}; + +// OSSectionInfo.offset bit +#define OS_SECTIONINFO_EXEC 0x1 +#define OS_SECTIONINFO_OFFSET(offset) ((offset) & ~0x1) + +struct OSImportInfo { + OSModuleID id; // external module id + u32 offset; // offset to OSRel instructions +}; + +struct OSRel { + u16 offset; // byte offset from the previous entry + u8 type; + u8 section; + u32 addend; +}; + +#define R_REVOLUTION_NOP 201 // C9h current offset += OSRel.offset +#define R_REVOLUTION_SECTION 202 // CAh current section = OSRel.section +#define R_REVOLUTION_END 203 // CBh +#define R_REVOLUTION_MRKREF 204 // CCh + +void OSSetStringTable(void* stringTable); +BOOL OSLink(OSModuleInfo* newModule, void* bss); + +#if (3 <= OS_MODULE_VERSION) +BOOL OSLinkFixed(OSModuleInfo* newModule, void* bss); +#endif + +BOOL OSUnlink(OSModuleInfo* oldModule); + +OSModuleInfo* OSSearchModule(void* ptr, u32* section, u32* offset); + +// debugger notification +void OSNotifyLink(OSModuleInfo* module); +void OSNotifyUnlink(OSModuleInfo* module); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/os/OSMutex.h b/include/revolution/os/OSMutex.h new file mode 100644 index 00000000000..f5ea089b73e --- /dev/null +++ b/include/revolution/os/OSMutex.h @@ -0,0 +1,33 @@ +#ifndef _REVOLUTION_OSMUTEX_H_ +#define _REVOLUTION_OSMUTEX_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct OSMutex { + /* 0x00 */ OSThreadQueue queue; + /* 0x08 */ OSThread* thread; + /* 0x0C */ s32 count; + /* 0x10 */ OSMutexLink link; +}; + +typedef struct OSCond { + OSThreadQueue queue; +} OSCond; + +void OSInitMutex(OSMutex* mutex); +void OSLockMutex(OSMutex* mutex); +void OSUnlockMutex(OSMutex* mutex); +BOOL OSTryLockMutex(OSMutex* mutex); +void OSInitCond(OSCond* cond); +void OSWaitCond(OSCond* cond, OSMutex* mutex); +void OSSignalCond(OSCond* cond); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/os/OSReboot.h b/include/revolution/os/OSReboot.h new file mode 100644 index 00000000000..cd62bbe72a4 --- /dev/null +++ b/include/revolution/os/OSReboot.h @@ -0,0 +1,19 @@ +#ifndef _REVOLUTION_OSREBOOT_H_ +#define _REVOLUTION_OSREBOOT_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void OSSetSaveRegion(void* start, void* end); +void OSGetSaveRegion(void** start, void** end); +void OSGetSavedRegion(void** start, void** end); +void __OSReboot(u32 resetCode, u32 bootDol); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/os/OSReset.h b/include/revolution/os/OSReset.h new file mode 100644 index 00000000000..9e3f9ead453 --- /dev/null +++ b/include/revolution/os/OSReset.h @@ -0,0 +1,39 @@ +#ifndef _REVOLUTION_OSRESET_H_ +#define _REVOLUTION_OSRESET_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define OS_RESET_RESTART 0 +#define OS_RESET_HOTRESET 1 +#define OS_RESET_SHUTDOWN 2 + +typedef struct OSResetFunctionInfo OSResetFunctionInfo; +typedef struct OSResetFunctionQueue { + OSResetFunctionInfo* head; + OSResetFunctionInfo* tail; +} OSResetFunctionQueue; + +typedef BOOL (*OSResetFunction)(BOOL); + +struct OSResetFunctionInfo { + OSResetFunction func; + u32 priority; + OSResetFunctionInfo* next; + OSResetFunctionInfo* prev; +}; + +void OSRegisterResetFunction(OSResetFunctionInfo* info); +void OSUnregisterResetFunction(OSResetFunctionInfo* info); +void OSResetSystem(int reset, u32 resetCode, BOOL forceMenu); +u32 OSGetResetCode(); +u32 OSSetBootDol(u32 dolOffset); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/os/OSResetSW.h b/include/revolution/os/OSResetSW.h new file mode 100644 index 00000000000..6124c02b4d0 --- /dev/null +++ b/include/revolution/os/OSResetSW.h @@ -0,0 +1,20 @@ +#ifndef _REVOLUTION_OSRESETSW_H_ +#define _REVOLUTION_OSRESETSW_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void (*OSResetCallback)(void); + +OSResetCallback OSSetResetCallback(OSResetCallback callback); +BOOL OSGetResetSwitchState(void); +BOOL OSGetResetButtonState(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/os/OSRtc.h b/include/revolution/os/OSRtc.h new file mode 100644 index 00000000000..5226b30026e --- /dev/null +++ b/include/revolution/os/OSRtc.h @@ -0,0 +1,84 @@ +#ifndef _REVOLUTION_OSRTC_H_ +#define _REVOLUTION_OSRTC_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +// make the assert happy +#define OS_SOUND_MODE_MONO 0 +#define OS_SOUND_MODE_STEREO 1 + +// make the asserts happy +#define OS_VIDEO_MODE_NTSC 0 +#define OS_VIDEO_MODE_MPAL 2 + +#define OS_PROGRESSIVE_MODE_OFF 0 +#define OS_PROGRESSIVE_MODE_ON 1 + +#define OS_EURGB60_OFF 0 +#define OS_EURGB60_ON 1 + +#define OS_LANGUAGE_ENGLISH 0 +#define OS_LANGUAGE_GERMAN 1 +#define OS_LANGUAGE_FRENCH 2 +#define OS_LANGUAGE_SPANISH 3 +#define OS_LANGUAGE_ITALIAN 4 +#define OS_LANGUAGE_DUTCH 5 + +typedef struct OSSram { + u16 checkSum; + u16 checkSumInv; + u32 ead0; + u32 ead1; + u32 counterBias; + s8 displayOffsetH; + u8 ntd; + u8 language; + u8 flags; +} OSSram; + +typedef struct OSSramEx { + u8 flashID[2][12]; + u32 wirelessKeyboardID; + u16 wirelessPadID[4]; + u8 dvdErrorCode; + u8 _padding0; + u8 flashIDCheckSum[2]; + u16 gbs; + u8 _padding1[2]; +} OSSramEx; + +#define SRAM_SIZE (sizeof(OSSram) + sizeof(OSSramEx)) + +typedef struct SramControl { + u8 sram[SRAM_SIZE]; // dummy for OSSram + OSSramEx + u32 offset; + BOOL enabled; + BOOL locked; + int sync; + void (*callback)(); +} SramControl; + +u32 OSGetSoundMode(void); +void OSSetSoundMode(u32 mode); +u32 OSGetVideoMode(void); +void OSSetVideoMode(u32 mode); +u8 OSGetLanguage(void); +void OSSetLanguage(u8 language); +u16 OSGetGbsMode(void); +void OSSetGbsMode(u16 mode); +u32 OSGetProgressiveMode(void); +void OSSetProgressiveMode(u32 on); +u32 OSGetEuRgb60Mode(void); +void OSSetEuRgb60Mode(u32 on); +u16 OSGetWirelessID(s32 chan); +void OSSetWirelessID(s32 chan, u16 id); + +#ifdef __cplusplus +} +#endif + +#endif // _REVOLUTION_OSRTC_H_ diff --git a/include/revolution/os/OSSemaphore.h b/include/revolution/os/OSSemaphore.h new file mode 100644 index 00000000000..1b21f384bf4 --- /dev/null +++ b/include/revolution/os/OSSemaphore.h @@ -0,0 +1,25 @@ +#ifndef _REVOLUTION_OSSEMAPHORE_H_ +#define _REVOLUTION_OSSEMAPHORE_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OSSemaphore { + s32 count; + OSThreadQueue queue; +} OSSemaphore; + +void OSInitSemaphore(OSSemaphore* sem, s32 count); +s32 OSWaitSemaphore(OSSemaphore* sem); +s32 OSTryWaitSemaphore(OSSemaphore* sem); +s32 OSSignalSemaphore(OSSemaphore* sem); +s32 OSGetSemaphoreCount(OSSemaphore* sem); + +#ifdef __cplusplus +} +#endif + +#endif // _REVOLUTION_OSSEMAPHORE_H_ diff --git a/include/revolution/os/OSSerial.h b/include/revolution/os/OSSerial.h new file mode 100644 index 00000000000..96c5cd9b169 --- /dev/null +++ b/include/revolution/os/OSSerial.h @@ -0,0 +1,6 @@ +#ifndef _REVOLUTION_OSSERIAL_H +#define _REVOLUTION_OSSERIAL_H + +#include + +#endif // _REVOLUTION_OSSERIAL_H diff --git a/include/revolution/os/OSThread.h b/include/revolution/os/OSThread.h new file mode 100644 index 00000000000..cd67538d351 --- /dev/null +++ b/include/revolution/os/OSThread.h @@ -0,0 +1,112 @@ +#ifndef _REVOLUTION_OSTHREAD_H_ +#define _REVOLUTION_OSTHREAD_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef s32 OSPriority; + +typedef struct OSThread OSThread; +typedef struct OSMutex OSMutex; +typedef struct OSThreadQueue OSThreadQueue; +typedef struct OSMutexQueue OSMutexQueue; +typedef struct OSThreadLink OSThreadLink; +typedef struct OSMutexLink OSMutexLink; + +struct OSThreadQueue { + OSThread* head; + OSThread* tail; +}; + +struct OSThreadLink { + OSThread* next; + OSThread* prev; +}; + +struct OSMutexQueue { + OSMutex* head; + OSMutex* tail; +}; + +struct OSMutexLink { + OSMutex* next; + OSMutex* prev; +}; + +struct OSThread { + /* 0x000 */ OSContext context; + /* 0x2C8 */ u16 state; + /* 0x2CA */ u16 attr; + /* 0x2CC */ s32 suspend; + /* 0x2D0 */ OSPriority priority; + /* 0x2D4 */ OSPriority base; + /* 0x2D8 */ void* val; + /* 0x2DC */ OSThreadQueue* queue; + /* 0x2E0 */ OSThreadLink link; + /* 0x2E8 */ OSThreadQueue queueJoin; + /* 0x2F0 */ OSMutex* mutex; + /* 0x2F4 */ OSMutexQueue queueMutex; + /* 0x2FC */ OSThreadLink linkActive; + /* 0x304 */ u8* stackBase; + /* 0x308 */ u32* stackEnd; + /* 0x30C */ s32 error; + /* 0x310 */ void* specific[2]; +}; + +enum OS_THREAD_STATE { + OS_THREAD_STATE_READY = 1, + OS_THREAD_STATE_RUNNING = 2, + OS_THREAD_STATE_WAITING = 4, + OS_THREAD_STATE_MORIBUND = 8, +}; + +#define OS_PRIORITY_MIN 0 // highest +#define OS_PRIORITY_MAX 31 // lowest +#define OS_PRIORITY_IDLE OS_PRIORITY_MAX + +#define OS_THREAD_SPECIFIC_MAX 2 + +#define OS_THREAD_ATTR_DETACH 0x0001u + +#define OS_THREAD_STACK_MAGIC 0xDEADBABE + +typedef void (*OSSwitchThreadCallback)(OSThread*, OSThread*); +typedef void (*OSIdleFunction)(void*); + +void OSInitThreadQueue(OSThreadQueue* queue); +void OSSleepThread(OSThreadQueue* queue); +void OSWakeupThread(OSThreadQueue* queue); +s32 OSSuspendThread(OSThread* thread); +s32 OSResumeThread(OSThread* thread); +OSThread* OSGetCurrentThread(void); +s32 OSEnableScheduler(void); +s32 OSDisableScheduler(void); +void OSCancelThread(OSThread* thread); +void OSClearStack(u8 val); +BOOL OSIsThreadSuspended(OSThread* thread); +BOOL OSIsThreadTerminated(OSThread* thread); +void OSYieldThread(void); +int OSCreateThread(OSThread* thread, void* (*func)(void*), void* param, void* stack, u32 stackSize, OSPriority priority, u16 attr); +void OSExitThread(void* val); +int OSJoinThread(OSThread* thread, void* val); +void OSDetachThread(OSThread* thread); +int OSSetThreadPriority(OSThread* thread, OSPriority priority); +s32 OSGetThreadPriority(OSThread* thread); +OSThread* OSSetIdleFunction(OSIdleFunction idleFunction, void* param, void* stack, u32 stackSize); +OSThread* OSGetIdleFunction(void); +s32 OSCheckActiveThreads(void); +void OSSetThreadSpecific(s32 index, void* ptr); +void* OSGetThreadSpecific(s32 index); + +OSSwitchThreadCallback OSSetSwitchThreadCallback(OSSwitchThreadCallback callback); + +#define IsSuspended(suspend) (suspend > 0) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/os/OSTime.h b/include/revolution/os/OSTime.h new file mode 100644 index 00000000000..abd8eaa2f61 --- /dev/null +++ b/include/revolution/os/OSTime.h @@ -0,0 +1,44 @@ +#ifndef _REVOLUTION_OSTIME_H_ +#define _REVOLUTION_OSTIME_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +// Time base frequency = 1/4 bus clock +#define OS_TIME_SPEED (OS_BUS_CLOCK / 4) + +// OS time -> Real time +#define OS_TICKS_TO_SEC(x) ((x) / (OS_TIME_SPEED)) +#define OS_TICKS_TO_MSEC(x) ((x) / (OS_TIME_SPEED / 1000)) +#define OS_TICKS_TO_USEC(x) (((x)*8) / (OS_TIME_SPEED / 125000)) +#define OS_TICKS_TO_NSEC(x) (((x)*8000) / (OS_TIME_SPEED / 125000)) + +// Real time -> OS time +#define OS_SEC_TO_TICKS(x) ((x) * (OS_TIME_SPEED)) +#define OS_MSEC_TO_TICKS(x) ((x) * (OS_TIME_SPEED / 1000)) +#define OS_USEC_TO_TICKS(x) ((x) * (OS_TIME_SPEED / 125000) / 8) +#define OS_NSEC_TO_TICKS(x) ((x) * (OS_TIME_SPEED / 125000) / 8000) + +#define USEC_MAX 1000 +#define MSEC_MAX 1000 +#define MONTH_MAX 12 +#define WEEK_DAY_MAX 7 +#define YEAR_DAY_MAX 365 + +#define SECS_IN_MIN 60 +#define SECS_IN_HOUR (SECS_IN_MIN * 60) +#define SECS_IN_DAY (SECS_IN_HOUR * 24) +#define SECS_IN_YEAR (SECS_IN_DAY * 365) + +#define BIAS 0xB2575 + +#define __OSSystemTime (OSTime*)0x800030D8 + +#ifdef __cplusplus +} +#endif + +#endif // _REVOLUTION_OSTIME_H_ diff --git a/include/revolution/os/OSTimer.h b/include/revolution/os/OSTimer.h new file mode 100644 index 00000000000..2e12593ae92 --- /dev/null +++ b/include/revolution/os/OSTimer.h @@ -0,0 +1,21 @@ +#ifndef _REVOLUTION_OSTIMER_H_ +#define _REVOLUTION_OSTIMER_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void (*OSTimerCallback)(void); + +OSTimerCallback OSSetTimerCallback(OSTimerCallback callback); +void OSInitTimer(u32 time, u32 mode); +void OSStartTimer(void); +void OSStopTimer(void); + +#ifdef __cplusplus +} +#endif + +#endif // _REVOLUTION_OSTIMER_H_ diff --git a/include/revolution/os/OSUtf.h b/include/revolution/os/OSUtf.h new file mode 100644 index 00000000000..974599035bf --- /dev/null +++ b/include/revolution/os/OSUtf.h @@ -0,0 +1,23 @@ +#ifndef _REVOLUTION_OSUTF_H_ +#define _REVOLUTION_OSUTF_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +char* OSUTF8to32(const char* utf8, u32* utf32); +char* OSUTF32to8(u32 utf32, char* utf8); +u16* OSUTF16to32(const u16* utf16, u32* utf32); +u16* OSUTF32to16(u32 utf32, u16* utf16); +u8 OSUTF32toANSI(u32 utf32); +u32 OSANSItoUTF32(u8 ansi); +u16 OSUTF32toSJIS(u32 utf32); +u32 OSSJIStoUTF32(u16 sjis); + +#ifdef __cplusplus +} +#endif + +#endif // _REVOLUTION_OSUTF_H_ diff --git a/include/revolution/pad.h b/include/revolution/pad.h new file mode 100644 index 00000000000..a220ddd1cbf --- /dev/null +++ b/include/revolution/pad.h @@ -0,0 +1,104 @@ +#ifndef _REVOLUTION_PAD_H_ +#define _REVOLUTION_PAD_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define PAD_SPEC_0 0 +#define PAD_SPEC_1 1 +#define PAD_SPEC_2 2 +#define PAD_SPEC_3 3 +#define PAD_SPEC_4 4 +#define PAD_SPEC_5 5 + +#define PAD_MOTOR_STOP 0 +#define PAD_MOTOR_RUMBLE 1 +#define PAD_MOTOR_STOP_HARD 2 + +#define PAD_CHAN0_BIT 0x80000000 +#define PAD_CHAN1_BIT 0x40000000 +#define PAD_CHAN2_BIT 0x20000000 +#define PAD_CHAN3_BIT 0x10000000 + +#define PAD_MAX_CONTROLLERS 4 + +#define PAD_BUTTON_LEFT (1 << 0) // 0x0001 +#define PAD_BUTTON_RIGHT (1 << 1) // 0x0002 +#define PAD_BUTTON_DOWN (1 << 2) // 0x0004 +#define PAD_BUTTON_UP (1 << 3) // 0x0008 +#define PAD_TRIGGER_Z (1 << 4) // 0x0010 +#define PAD_TRIGGER_R (1 << 5) // 0x0020 +#define PAD_TRIGGER_L (1 << 6) // 0x0040 +#define PAD_BUTTON_A (1 << 8) // 0x0100 +#define PAD_BUTTON_B (1 << 9) // 0x0200 +#define PAD_BUTTON_X (1 << 10) // 0x0400 +#define PAD_BUTTON_Y (1 << 11) // 0x0800 +#define PAD_BUTTON_MENU (1 << 12) // 0x1000 +#define PAD_BUTTON_START (1 << 12) // 0x1000 + +#define PAD_ERR_NONE 0 +#define PAD_ERR_NO_CONTROLLER -1 +#define PAD_ERR_NOT_READY -2 +#define PAD_ERR_TRANSFER -3 + +#define RES_WIRELESS_LITE 0x40000 + +typedef struct PADStatus { + /* 0x00 */ u16 button; + /* 0x02 */ s8 stickX; + /* 0x03 */ s8 stickY; + /* 0x04 */ s8 substickX; + /* 0x05 */ s8 substickY; + /* 0x06 */ u8 triggerLeft; + /* 0x07 */ u8 triggerRight; + /* 0x08 */ u8 analogA; + /* 0x09 */ u8 analogB; + /* 0x0A */ s8 err; +} PADStatus; + +typedef struct PADClampRegion { + u8 minTrigger; + u8 maxTrigger; + s8 minStick; + s8 maxStick; + s8 xyStick; + s8 minSubstick; + s8 maxSubstick; + s8 xySubstick; + s8 radStick; + s8 radSubstick; +} PADClampRegion; + +typedef void (*PADSamplingCallback)(void); + +// Pad +int PADReset(u32 mask); +BOOL PADRecalibrate(u32 mask); +BOOL PADInit(); +u32 PADRead(PADStatus* status); +void PADSetSamplingRate(u32 msec); +void __PADTestSamplingRate(u32 tvmode); +void PADControlAllMotors(const u32* commandArray); +void PADControlMotor(s32 chan, u32 command); +void PADSetSpec(u32 spec); +u32 PADGetSpec(); +int PADGetType(s32 chan, u32* type); +BOOL PADSync(void); +void PADSetAnalogMode(u32 mode); +BOOL __PADDisableRecalibration(BOOL disable); +BOOL PADIsBarrel(s32 chan); + +PADSamplingCallback PADSetSamplingCallback(PADSamplingCallback callback); + +// Padclamp +void PADClamp(PADStatus* status); +void PADClampCircle(PADStatus* status); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/revolution.h b/include/revolution/revolution.h new file mode 100644 index 00000000000..f8bb1b995f3 --- /dev/null +++ b/include/revolution/revolution.h @@ -0,0 +1,18 @@ +#ifndef _REVOLUTION_H_ +#define _REVOLUTION_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/include/revolution/sc.h b/include/revolution/sc.h new file mode 100644 index 00000000000..dd389bb3ebc --- /dev/null +++ b/include/revolution/sc.h @@ -0,0 +1,34 @@ +#ifndef _REVOLUTION_SC_H_ +#define _REVOLUTION_SC_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void SCInit(void); +u32 SCCheckStatus(void); +int SCReloadConfFileAsync(void* bufp, u32 bufSize, int); +BOOL SCFindByteArrayItem(u8* data, u32, u32 itemID); +BOOL SCFindIntegerItem(int* data, u32 itemID, u8 type); +BOOL SCFindU8Item(u8* data, u32 itemID); +BOOL SCFindS8Item(s8* data, u32 itemID); +BOOL SCFindU32Item(u32* data, u32 itemID); +u8 SCGetAspectRatio(void); +u8 SCGetDisplayOffsetH(void); +BOOL SCGetIdleMode(u8* data); +u8 SCGetLanguage(void); +u8 SCGetProgressiveMode(void); +u8 SCGetScreenSaverMode(void); +u8 SCGetSoundMode(void); +u8 SCGetCounterBias(void); +BOOL SCGetProductAreaString(const char*, int); +u32 SCGetProductArea(void); +u32 SCGetProductGameRegion(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/seq.h b/include/revolution/seq.h new file mode 100644 index 00000000000..63617707bff --- /dev/null +++ b/include/revolution/seq.h @@ -0,0 +1,54 @@ +#ifndef _REVOLUTION_SEQ_H_ +#define _REVOLUTION_SEQ_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct _SEQTRACK { + /* 0x00 */ void* sequence; + /* 0x04 */ u8* start; + /* 0x08 */ u8* end; + /* 0x0C */ u8* current; + /* 0x10 */ u8 status; + /* 0x14 */ f32 beatsPerSec; + /* 0x18 */ u32 defaultTicksPerFrame; + /* 0x1C */ u32 ticksPerFrame; + /* 0x20 */ u32 delay; + /* 0x24 */ u32 state; +} SEQTRACK; + +typedef struct _SEQSEQUENCE { + /* 0x0000 */ void* next; + /* 0x0004 */ u32 state; + /* 0x0008 */ u16 nTracks; + /* 0x000A */ s16 timeFormat; + /* 0x000C */ u32 tracksRunning; + /* 0x0010 */ u32 end; + /* 0x0014 */ SYNSYNTH synth; + /* 0x3154 */ void (*callback[128])(void*, u8); + /* 0x3354 */ SEQTRACK track[64]; +} SEQSEQUENCE; + +#define SEQ_ALL_TRACKS -1 + +void SEQInit(void); +void SEQQuit(void); +void SEQRunAudioFrame(void); +void SEQAddSequence(SEQSEQUENCE* sequence, u8* midiStream, void* wt, u32 aramBase, u32 zeroBase, u32 priorityVoiceAlloc, u32 priorityNoteOn, u32 priorityNoteRelease); +void SEQRemoveSequence(SEQSEQUENCE* sequence); +void SEQRegisterControllerCallback(SEQSEQUENCE* sequence, u8 controller, void (*callback)(void*, u8)); +void SEQSetState(SEQSEQUENCE* sequence, u32 state); +u32 SEQGetState(SEQSEQUENCE* sequence); +void SEQSetTempo(SEQSEQUENCE* sequence, u32 trackIndex, f32 bpm); +f32 SEQGetTempo(SEQSEQUENCE* sequence, u32 trackIndex); +void SEQSetVolume(SEQSEQUENCE* sequence, s32 dB); +s32 SEQGetVolume(SEQSEQUENCE* sequence); + +#ifdef __cplusplus +} +#endif + +#endif // _REVOLUTION_SEQ_H_ diff --git a/include/revolution/si.h b/include/revolution/si.h new file mode 100644 index 00000000000..48ecdcb9af0 --- /dev/null +++ b/include/revolution/si.h @@ -0,0 +1,175 @@ +#ifndef _REVOLUTION_SI_H_ +#define _REVOLUTION_SI_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define SI_MAX_CHAN 4 +#define SI_MAX_TYPE 4 + +#define SI_COMCSR_IDX 13 +#define SI_STATUS_IDX 14 + +#define SI_COMCSR_TCINT_MASK (1 << 31) +#define SI_COMCSR_TCINTMSK_MASK (1 << 30) +#define SI_COMCSR_COMERR_MASK (1 << 29) +#define SI_COMCSR_RDSTINT_MASK (1 << 28) +#define SI_COMCSR_RDSTINTMSK_MASK (1 << 27) + +// 4 bits of padding +#define SI_COMCSR_OUTLNGTH_MASK (1 << 22) \ + | (1 << 21) \ + | (1 << 20) \ + | (1 << 19) \ + | (1 << 18) \ + | (1 << 17) \ + | (1 << 16) + +// 1 bit of padding +#define SI_COMCSR_INLNGTH_MASK (1 << 14) \ + | (1 << 13) \ + | (1 << 12) \ + | (1 << 11) \ + | (1 << 10) \ + | (1 << 9) \ + | (1 << 8) + +// 5 bits of padding +#define SI_COMCSR_CHANNEL_MASK (1 << 2) \ + | (1 << 1) + +#define SI_COMCSR_TSTART_MASK (1 << 0) + +#define SI_ERROR_UNDER_RUN 0x0001 +#define SI_ERROR_OVER_RUN 0x0002 +#define SI_ERROR_COLLISION 0x0004 +#define SI_ERROR_NO_RESPONSE 0x0008 +#define SI_ERROR_WRST 0x0010 +#define SI_ERROR_RDST 0x0020 +#define SI_ERROR_UNKNOWN 0x0040 +#define SI_ERROR_BUSY 0x0080 + +#define SI_TYPE_MASK 0x18000000u +#define SI_TYPE_N64 0x00000000u +#define SI_TYPE_DOLPHIN 0x08000000u +#define SI_TYPE_GC SI_TYPE_DOLPHIN +#define SI_GC_WIRELESS 0x80000000 +#define SI_GC_NOMOTOR 0x20000000 +#define SI_GC_STANDARD 0x01000000 +#define SI_WIRELESS_RECEIVED 0x40000000 +#define SI_WIRELESS_IR 0x04000000 +#define SI_WIRELESS_STATE 0x02000000 +#define SI_WIRELESS_ORIGIN 0x00200000 +#define SI_WIRELESS_FIX_ID 0x00100000 +#define SI_WIRELESS_TYPE 0x000f0000 +#define SI_WIRELESS_LITE_MASK 0x000c0000 +#define SI_WIRELESS_LITE 0x00040000 +#define SI_WIRELESS_CONT_MASK 0x00080000 +#define SI_WIRELESS_CONT 0x00000000 +#define SI_WIRELESS_ID 0x00c0ff00 +#define SI_WIRELESS_TYPE_ID (SI_WIRELESS_TYPE | SI_WIRELESS_ID) +#define SI_N64_CONTROLLER (SI_TYPE_N64 | 0x05000000) +#define SI_N64_MIC (SI_TYPE_N64 | 0x00010000) +#define SI_N64_KEYBOARD (SI_TYPE_N64 | 0x00020000) +#define SI_N64_MOUSE (SI_TYPE_N64 | 0x02000000) +#define SI_GBA (SI_TYPE_N64 | 0x00040000) +#define SI_GC_CONTROLLER (SI_TYPE_GC | SI_GC_STANDARD) +#define SI_GC_RECEIVER (SI_TYPE_GC | SI_GC_WIRELESS) +#define SI_GC_WAVEBIRD (SI_TYPE_GC | SI_GC_WIRELESS | SI_GC_STANDARD | SI_WIRELESS_STATE | SI_WIRELESS_FIX_ID) +#define SI_GC_KEYBOARD (SI_TYPE_GC | 0x00200000) +#define SI_GC_STEERING (SI_TYPE_GC | 0x00000000) + +typedef void (*SICallback)(s32 chan, u32 sr, OSContext *context); +typedef void (*SITypeCallback)(s32 chan, u32 type); + +typedef struct { + s32 chan; + u32 poll; + u32 inputBytes; + void* input; + SICallback callback; +} SIControl; + +typedef struct { + s32 chan; + void* output; + u32 outputBytes; + void* input; + u32 inputBytes; + SICallback callback; + OSTime fire; +} SIPacket; + +// SIBios +BOOL SIBusy(void); +BOOL SIIsChanBusy(s32 chan); +BOOL SIRegisterPollingHandler(__OSInterruptHandler handler); +BOOL SIUnregisterPollingHandler(__OSInterruptHandler handler); +void SIInit(void); +u32 SISync(void); +u32 SIGetStatus(s32 chan); +void SISetCommand(s32 chan, u32 command); +u32 SIGetCommand(s32 chan); +void SITransferCommands(void); +u32 SISetXY(u32 x, u32 y); +u32 SIEnablePolling(u32 poll); +u32 SIDisablePolling(u32 poll); +BOOL SIGetResponse(s32 chan, void* data); +BOOL SITransfer(s32 chan, void* output, u32 outputBytes, void* input, u32 inputBytes, SICallback callback, OSTime delay); +u32 SIGetType(s32 chan); +u32 SIGetTypeAsync(s32 chan, SITypeCallback callback); +u32 SIDecodeType(u32 type); +u32 SIProbe(s32 chan); +char* SIGetTypeString(u32 type); + +extern u32 __PADFixBits; + +// SISamplingRate +void SISetSamplingRate(u32 msec); +void SIRefreshSamplingRate(void); + +// SISteering +typedef void (*SISteeringCallback)(s32 chan, s32); + +typedef struct { + u8 output[3]; + u8 input[8]; + u32 outputBytes; + u32 inputBytes; + SISteeringCallback callback; + s32 ret; + OSThreadQueue threadQueue; + void (*proc)(s32); +} SISteeringControl; + +typedef struct { + u16 button; + u8 misc; + s8 steering; + u8 gas; + u8 brake; + u8 left; + u8 right; + s8 err; +} SISteeringStatus; + +extern SISteeringControl __SISteering[4]; +extern u32 __SISteeringEnableBits; +extern BOOL __SIResetSteering; + +void SIInitSteering(void); +s32 SIResetSteeringAsync(s32 chan, SISteeringCallback callback); +s32 SIResetSteering(s32 chan); + +s32 SIReadSteering(s32 chan, SISteeringStatus* status); +void (* SISetSteeringSamplingCallback(void (*callback)()))(); +void SIControlSteering(s32 chan, u32 control, s32 level); + +#ifdef __cplusplus +} +#endif + +#endif // _REVOLUTION_SI_H_ diff --git a/include/revolution/sp.h b/include/revolution/sp.h new file mode 100644 index 00000000000..d5141a86ca7 --- /dev/null +++ b/include/revolution/sp.h @@ -0,0 +1,40 @@ +#ifndef _REVOLUTION_SP_H_ +#define _REVOLUTION_SP_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + AXPBADPCM adpcm; + AXPBADPCMLOOP adpcmloop; +} SPADPCM; + +typedef struct { + u32 type; + u32 sampleRate; + u32 loopAddr; + u32 loopEndAddr; + u32 endAddr; + u32 currentAddr; + SPADPCM* adpcm; +} SPSoundEntry; + +typedef struct { + u32 entries; + SPSoundEntry sound[1]; +} SPSoundTable; + +void SPInitSoundTable(SPSoundTable* table, u32 aramBase, u32 zeroBase); +SPSoundEntry* SPGetSoundEntry(SPSoundTable* table, u32 index); +void SPPrepareSound(SPSoundEntry* sound, AXVPB* axvpb, u32 sampleRate); +void SPPrepareEnd(SPSoundEntry* sound, AXVPB* axvpb); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/syn.h b/include/revolution/syn.h new file mode 100644 index 00000000000..98afb43f340 --- /dev/null +++ b/include/revolution/syn.h @@ -0,0 +1,172 @@ +#ifndef _REVOLUTION_SYN_H_ +#define _REVOLUTION_SYN_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define SYN_INPUT_BUFFER_SIZE 0x100 + +typedef struct WTINST { + /* 0x00 */ u16 keyRegion[128]; +} WTINST; + +typedef struct WTREGION { + /* 0x00 */ u8 unityNote; + /* 0x01 */ u8 keyGroup; + /* 0x02 */ s16 fineTune; + /* 0x04 */ s32 attn; + /* 0x08 */ u32 loopStart; + /* 0x0C */ u32 loopLength; + /* 0x10 */ u32 articulationIndex; + /* 0x14 */ u32 sampleIndex; +} WTREGION; + +typedef struct WTART { + /* 0x00 */ s32 lfoFreq; + /* 0x04 */ s32 lfoDelay; + /* 0x08 */ s32 lfoAtten; + /* 0x0C */ s32 lfoPitch; + /* 0x10 */ s32 lfoMod2Atten; + /* 0x14 */ s32 lfoMod2Pitch; + /* 0x18 */ s32 eg1Attack; + /* 0x1C */ s32 eg1Decay; + /* 0x20 */ s32 eg1Sustain; + /* 0x24 */ s32 eg1Release; + /* 0x28 */ s32 eg1Vel2Attack; + /* 0x2C */ s32 eg1Key2Decay; + /* 0x30 */ s32 eg2Attack; + /* 0x34 */ s32 eg2Decay; + /* 0x38 */ s32 eg2Sustain; + /* 0x3C */ s32 eg2Release; + /* 0x40 */ s32 eg2Vel2Attack; + /* 0x44 */ s32 eg2Key2Decay; + /* 0x48 */ s32 eg2Pitch; + /* 0x4C */ s32 pan; +} WTART; + +typedef struct WTSAMPLE { + /* 0x00 */ u16 format; + /* 0x02 */ u16 sampleRate; + /* 0x04 */ u32 offset; + /* 0x08 */ u32 length; + /* 0x0C */ u16 adpcmIndex; +} WTSAMPLE; + +typedef struct WTADPCM { + /* 0x00 */ u16 a[8][2]; + /* 0x20 */ u16 gain; + /* 0x22 */ u16 pred_scale; + /* 0x24 */ u16 yn1; + /* 0x26 */ u16 yn2; + /* 0x28 */ u16 loop_pred_scale; + /* 0x2A */ u16 loop_yn1; + /* 0x2C */ u16 loop_yn2; +} WTADPCM; + +typedef struct SYNSYNTH { + /* 0x0000 */ void* next; + /* 0x0004 */ WTINST* percussiveInst; + /* 0x0008 */ WTINST* melodicInst; + /* 0x000C */ WTREGION* region; + /* 0x0010 */ WTART* art; + /* 0x0014 */ WTSAMPLE* sample; + /* 0x0018 */ WTADPCM* adpcm; + /* 0x001C */ u32 aramBaseWord; + /* 0x0020 */ u32 aramBaseByte; + /* 0x0024 */ u32 aramBaseNibble; + /* 0x0028 */ u32 zeroBaseWord; + /* 0x002C */ u32 zeroBaseByte; + /* 0x0030 */ u32 zeroBaseNibble; + /* 0x0034 */ u32 priorityVoiceAlloc; + /* 0x0038 */ u32 priorityNoteOn; + /* 0x003C */ u32 priorityNoteRelease; + /* 0x0040 */ WTINST* inst[16]; + /* 0x0080 */ s32 masterVolume; + /* 0x0084 */ u8 controller[16][128]; + /* 0x0844 */ u8 rpn[16]; + /* 0x0894 */ s16 dataEntry[16]; + /* 0x08B4 */ s32 pwMaxCents[16]; + /* 0x08F4 */ s32 pwCents[16]; + /* 0x0934 */ s32 volAttn[16]; + /* 0x0974 */ s32 expAttn[16]; + /* 0x09B4 */ s32 auxAAttn[16]; + /* 0x09F4 */ s32 auxBAttn[16]; + /* 0x0A34 */ u8 input[SYN_INPUT_BUFFER_SIZE][3]; + /* 0x0D34 */ u8* inputPosition; + /* 0x0D38 */ u32 inputCounter; + /* 0x0D3C */ u32 notes; + /* 0x0D40 */ void* keyGroup[16][16]; + /* 0x1140 */ void* voice[16][128]; +} SYNSYNTH; + +typedef struct SYNVOICE { + /* 0x00 */ void* next; + /* 0x04 */ AXVPB* axvpb; + /* 0x08 */ SYNSYNTH* synth; + /* 0x0C */ u8 midiChannel; + /* 0x0D */ u8 keyNum; + /* 0x0E */ u8 keyVel; + /* 0x0F */ u8 pan; + /* 0x10 */ u8 keyGroup; + /* 0x14 */ WTREGION* region; + /* 0x18 */ WTART* art; + /* 0x1C */ WTSAMPLE* sample; + /* 0x20 */ WTADPCM* adpcm; + /* 0x24 */ u32 hold; + /* 0x28 */ u32 type; + /* 0x2C */ f32 srcRatio; + /* 0x30 */ s32 cents; + /* 0x34 */ s32 attn; + /* 0x38 */ s32 lfoState; + /* 0x3C */ s32 lfoAttn; + /* 0x40 */ s32 lfoCents; + /* 0x44 */ s32 lfoFreq; + /* 0x48 */ s32 lfoDelay; + /* 0x4C */ s32 lfoAttn_; + /* 0x50 */ s32 lfoCents_; + /* 0x54 */ s32 lfoModAttn; + /* 0x58 */ s32 lfoModCents; + /* 0x5C */ u32 veState; + /* 0x60 */ s32 veAttn; + /* 0x64 */ s32 veAttack; + /* 0x68 */ s32 veAttackDelta; + /* 0x6C */ s32 veDecay; + /* 0x70 */ s32 veSustain; + /* 0x74 */ s32 veRelease; + /* 0x78 */ u32 peState; + /* 0x7C */ s32 peCents; + /* 0x80 */ s32 peAttack; + /* 0x84 */ s32 peDecay; + /* 0x88 */ s32 peSustain; + /* 0x8C */ s32 peRelease; + /* 0x90 */ s32 pePitch; +} SYNVOICE; + +// sample formats +#define SYN_SAMPLE_FORMAT_ADPCM 0 +#define SYN_SAMPLE_FORMAT_PCM16 1 +#define SYN_SAMPLE_FORMAT_PCM8 2 + +// SYN +void SYNInit(void); +void SYNQuit(void); +void SYNRunAudioFrame(void); +void SYNInitSynth(SYNSYNTH* synth, void* wavetable, u32 aramBase, u32 zeroBase, u32 priorityVoiceAlloc, u32 priorityNoteOn, u32 priorityNoteRelease); +void SYNQuitSynth(SYNSYNTH* synth); +void SYNMidiInput(SYNSYNTH* synth, u8* input); +void SYNSetMasterVolume(SYNSYNTH* synth, s32 dB); +s32 SYNGetMasterVolume(SYNSYNTH* synth); +u32 SYNGetActiveNotes(SYNSYNTH* synth); + +// SYNCTRL +u8 SYNGetMidiController(SYNSYNTH* synth, u8 midiChannel, u8 function); + +#ifdef __cplusplus +} +#endif + +#endif // _REVOLUTION_SYN_H_ diff --git a/include/revolution/types.h b/include/revolution/types.h index 9d061526b5f..fdb5fb8ef66 100644 --- a/include/revolution/types.h +++ b/include/revolution/types.h @@ -1,5 +1,5 @@ -#ifndef _DOLPHIN_TYPES_H_ -#define _DOLPHIN_TYPES_H_ +#ifndef _REVOLUTION_TYPES_H_ +#define _REVOLUTION_TYPES_H_ typedef signed char s8; typedef unsigned char u8; diff --git a/include/revolution/vi.h b/include/revolution/vi.h new file mode 100644 index 00000000000..c347e33f279 --- /dev/null +++ b/include/revolution/vi.h @@ -0,0 +1,7 @@ +#ifndef _REVOLUTION_VI_H_ +#define _REVOLUTION_VI_H_ + +#include +#include + +#endif diff --git a/include/revolution/vi/vifuncs.h b/include/revolution/vi/vifuncs.h new file mode 100644 index 00000000000..3c1647b37f6 --- /dev/null +++ b/include/revolution/vi/vifuncs.h @@ -0,0 +1,36 @@ +#ifndef _REVOLUTION_VIFUNCS_H_ +#define _REVOLUTION_VIFUNCS_H_ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +VIRetraceCallback VISetPreRetraceCallback(VIRetraceCallback cb); +VIRetraceCallback VISetPostRetraceCallback(VIRetraceCallback cb); +void VIInit(void); +void VIWaitForRetrace(void); +void VIConfigure(const GXRenderModeObj* rm); +void VIConfigurePan(u16 xOrg, u16 yOrg, u16 width, u16 height); +void VIFlush(void); +void VISetNextFrameBuffer(void* fb); +void VISetNextRightFrameBuffer(void* fb); +void VISetBlack(BOOL black); +void VISet3D(BOOL threeD); +u32 VIGetRetraceCount(void); +u32 VIGetNextField(void); +u32 VIGetCurrentLine(void); +u32 VIGetTvFormat(void); +void* VIGetNextFrameBuffer(void); +void* VIGetCurrentFrameBuffer(void); +u32 VIGetScanMode(void); +u32 VIGetDTVStatus(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/revolution/vi/vitypes.h b/include/revolution/vi/vitypes.h new file mode 100644 index 00000000000..807af6d5e99 --- /dev/null +++ b/include/revolution/vi/vitypes.h @@ -0,0 +1,41 @@ +#ifndef _REVOLUTION_VITYPES_H_ +#define _REVOLUTION_VITYPES_H_ + +#include + +#define VI_TVMODE(format, interlace) (((format) << 2) + (interlace)) + +#define VI_INTERLACE 0 +#define VI_NON_INTERLACE 1 +#define VI_PROGRESSIVE 2 + +#define VI_NTSC 0 +#define VI_PAL 1 +#define VI_MPAL 2 +#define VI_DEBUG 3 +#define VI_DEBUG_PAL 4 +#define VI_EURGB60 5 + +typedef enum { + VI_TVMODE_NTSC_INT = VI_TVMODE(VI_NTSC, VI_INTERLACE), + VI_TVMODE_NTSC_DS = VI_TVMODE(VI_NTSC, VI_NON_INTERLACE), + VI_TVMODE_NTSC_PROG = VI_TVMODE(VI_NTSC, VI_PROGRESSIVE), + VI_TVMODE_PAL_INT = VI_TVMODE(VI_PAL, VI_INTERLACE), + VI_TVMODE_PAL_DS = VI_TVMODE(VI_PAL, VI_NON_INTERLACE), + VI_TVMODE_EURGB60_INT = VI_TVMODE(VI_EURGB60, VI_INTERLACE), + VI_TVMODE_EURGB60_DS = VI_TVMODE(VI_EURGB60, VI_NON_INTERLACE), + VI_TVMODE_MPAL_INT = VI_TVMODE(VI_MPAL, VI_INTERLACE), + VI_TVMODE_MPAL_DS = VI_TVMODE(VI_MPAL, VI_NON_INTERLACE), + VI_TVMODE_DEBUG_INT = VI_TVMODE(VI_DEBUG, VI_INTERLACE), + VI_TVMODE_DEBUG_PAL_INT = VI_TVMODE(VI_DEBUG_PAL, VI_INTERLACE), + VI_TVMODE_DEBUG_PAL_DS = VI_TVMODE(VI_DEBUG_PAL, VI_NON_INTERLACE) +} VITVMode; + +typedef enum { + VI_XFBMODE_SF = 0, + VI_XFBMODE_DF +} VIXFBMode; + +typedef void (*VIRetraceCallback)(u32 retraceCount); + +#endif diff --git a/src/d/actor/d_a_L7demo_dr.cpp b/src/d/actor/d_a_L7demo_dr.cpp index f9df3dbaffa..dc8c98b55d4 100644 --- a/src/d/actor/d_a_L7demo_dr.cpp +++ b/src/d/actor/d_a_L7demo_dr.cpp @@ -361,7 +361,7 @@ BOOL daDr_c::check_start() { /* 805AA224-805AA42C 001064 0208+00 1/1 0/0 0/0 .text create__6daDr_cFv */ int daDr_c::create() { - fopAcM_SetupActor(this, daDr_c); + fopAcM_ct(this, daDr_c); int phase_state; if (dComIfG_play_c::getLayerNo(0) == 3) { diff --git a/src/d/actor/d_a_L7low_dr.cpp b/src/d/actor/d_a_L7low_dr.cpp index ae2c7d91638..c7df44bfa90 100644 --- a/src/d/actor/d_a_L7low_dr.cpp +++ b/src/d/actor/d_a_L7low_dr.cpp @@ -149,7 +149,7 @@ int daL7lowDr_c::CreateHeap() { /* 805AAD58-805AAE88 0007D8 0130+00 1/1 0/0 0/0 .text create__11daL7lowDr_cFv */ int daL7lowDr_c::create() { - fopAcM_SetupActor(this, daL7lowDr_c); + fopAcM_ct(this, daL7lowDr_c); int phase_state = dComIfG_resLoad(&mPhase, "L7lowDr"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_L7op_demo_dr.cpp b/src/d/actor/d_a_L7op_demo_dr.cpp index 738d50088d0..1d546695beb 100644 --- a/src/d/actor/d_a_L7op_demo_dr.cpp +++ b/src/d/actor/d_a_L7op_demo_dr.cpp @@ -806,7 +806,7 @@ BOOL daL7ODR_c::check_start() { /* 805ADAC0-805ADCD8 002AA0 0218+00 1/1 0/0 0/0 .text create__9daL7ODR_cFv */ int daL7ODR_c::create() { - fopAcM_SetupActor(this, daL7ODR_c); + fopAcM_ct(this, daL7ODR_c); field_0x8b7 = 0; int phase_state = dComIfG_resLoad(&mPhase, "B_DR"); diff --git a/src/d/actor/d_a_alink.cpp b/src/d/actor/d_a_alink.cpp index 35fdf985634..b75b3258e67 100644 --- a/src/d/actor/d_a_alink.cpp +++ b/src/d/actor/d_a_alink.cpp @@ -4650,7 +4650,7 @@ int daAlink_c::setStartProcInit() { /* 800A5CC8-800A660C 0A0608 0944+00 1/1 0/0 0/0 .text create__9daAlink_cFv */ int daAlink_c::create() { - fopAcM_SetupActor(this, daAlink_c); + fopAcM_ct(this, daAlink_c); static int bgWaitFlg = 0; diff --git a/src/d/actor/d_a_alldie.cpp b/src/d/actor/d_a_alldie.cpp index 8eb07522695..7a44b6a7813 100644 --- a/src/d/actor/d_a_alldie.cpp +++ b/src/d/actor/d_a_alldie.cpp @@ -159,7 +159,7 @@ static int daAlldie_Delete(daAlldie_c* i_this) { /* 804D5BF0-804D5D1C 000450 012C+00 1/0 0/0 0/0 .text daAlldie_Create__FP10fopAc_ac_c */ int daAlldie_c::create() { - fopAcM_SetupActor(this, daAlldie_c); + fopAcM_ct(this, daAlldie_c); s8 roomNo = fopAcM_GetRoomNo(this); diff --git a/src/d/actor/d_a_andsw.cpp b/src/d/actor/d_a_andsw.cpp index e0129a0f344..c3e5e63879a 100644 --- a/src/d/actor/d_a_andsw.cpp +++ b/src/d/actor/d_a_andsw.cpp @@ -39,7 +39,7 @@ int daAndsw_c::Create() { /* 804579B8-80457A20 0000B8 0068+00 1/1 0/0 0/0 .text create__9daAndsw_cFv */ int daAndsw_c::create() { - fopAcM_SetupActor(this, daAndsw_c); + fopAcM_ct(this, daAndsw_c); if (!Create()) { return cPhs_ERROR_e; } diff --git a/src/d/actor/d_a_andsw2.cpp b/src/d/actor/d_a_andsw2.cpp index 94869a41132..b726ab3ee3a 100644 --- a/src/d/actor/d_a_andsw2.cpp +++ b/src/d/actor/d_a_andsw2.cpp @@ -119,7 +119,7 @@ daAndsw2_c::~daAndsw2_c() {} /* 804D6120-804D63A4 0003A0 0284+00 2/1 0/0 0/0 .text create__10daAndsw2_cFv */ int daAndsw2_c::create() { int sw = getSwbit(); - fopAcM_SetupActor(this, daAndsw2_c); + fopAcM_ct(this, daAndsw2_c); switch (getType()) { case 0: diff --git a/src/d/actor/d_a_arrow.cpp b/src/d/actor/d_a_arrow.cpp index 990e3cfb5bf..2509741d0d5 100644 --- a/src/d/actor/d_a_arrow.cpp +++ b/src/d/actor/d_a_arrow.cpp @@ -1180,7 +1180,7 @@ static void* daAlink_searchHorseZelda(fopAc_ac_c* param_0, void* param_1) { /* 8049D440-8049D808 0038C0 03C8+00 1/1 0/0 0/0 .text create__9daArrow_cFv */ cPhs__Step daArrow_c::create() { - fopAcM_SetupActor(this, daArrow_c); + fopAcM_ct(this, daArrow_c); mArrowType = fopAcM_GetParamBit(this, 8, 8); fopAcM_SetParam(this, (u8)fopAcM_GetParam(this)); diff --git a/src/d/actor/d_a_b_bh.cpp b/src/d/actor/d_a_b_bh.cpp index 94f4d80e478..5bf2ca645ad 100644 --- a/src/d/actor/d_a_b_bh.cpp +++ b/src/d/actor/d_a_b_bh.cpp @@ -1495,7 +1495,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 805B2AF8-805B2F54 004978 045C+00 1/0 0/0 0/0 .text daB_BH_Create__FP10fopAc_ac_c */ static int daB_BH_Create(fopAc_ac_c* i_this) { b_bh_class* a_this = (b_bh_class*)i_this; - fopAcM_SetupActor(a_this, b_bh_class); + fopAcM_ct(a_this, b_bh_class); int phase_state = dComIfG_resLoad(&a_this->mPhase, "B_BH"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_b_bq.cpp b/src/d/actor/d_a_b_bq.cpp index bd76686dcb3..25598292e71 100644 --- a/src/d/actor/d_a_b_bq.cpp +++ b/src/d/actor/d_a_b_bq.cpp @@ -2505,7 +2505,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 805B969C-805B9B3C 00621C 04A0+00 1/0 0/0 0/0 .text daB_BQ_Create__FP10fopAc_ac_c */ static int daB_BQ_Create(fopAc_ac_c* i_this) { b_bq_class* a_this = (b_bq_class*)i_this; - fopAcM_SetupActor(a_this, b_bq_class); + fopAcM_ct(a_this, b_bq_class); int phase_state = dComIfG_resLoad(&a_this->mPhase, "B_bq"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_b_dr.cpp b/src/d/actor/d_a_b_dr.cpp index c123c261646..0a3bc78266f 100644 --- a/src/d/actor/d_a_b_dr.cpp +++ b/src/d/actor/d_a_b_dr.cpp @@ -4102,7 +4102,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 805C5974-805C62B0 00ABF4 093C+00 1/1 0/0 0/0 .text create__8daB_DR_cFv */ int daB_DR_c::create() { - fopAcM_SetupActor(this, daB_DR_c); + fopAcM_ct(this, daB_DR_c); int phase_state = dComIfG_resLoad(&mPhase, "B_DR"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_b_dre.cpp b/src/d/actor/d_a_b_dre.cpp index 50ec6148c57..fee3997043f 100644 --- a/src/d/actor/d_a_b_dre.cpp +++ b/src/d/actor/d_a_b_dre.cpp @@ -902,7 +902,7 @@ static int daB_DRE_Execute(daB_DRE_c* i_this) { /* 805CA944-805CAC3C 002F04 02F8+00 1/1 0/0 0/0 .text create__9daB_DRE_cFv */ int daB_DRE_c::create() { - fopAcM_SetupActor(this, daB_DRE_c); + fopAcM_ct(this, daB_DRE_c); int phase_state = dComIfG_resLoad(&mPhase, "B_DR"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_b_ds.cpp b/src/d/actor/d_a_b_ds.cpp index 9808511d459..4b616ffb941 100644 --- a/src/d/actor/d_a_b_ds.cpp +++ b/src/d/actor/d_a_b_ds.cpp @@ -5514,7 +5514,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 805DB974-805DC1E8 010834 0874+00 1/1 0/0 0/0 .text create__8daB_DS_cFv */ cPhs__Step daB_DS_c::create() { - fopAcM_SetupActor(this, daB_DS_c); + fopAcM_ct(this, daB_DS_c); cPhs__Step phase_state = (cPhs__Step)dComIfG_resLoad(&mPhase, "B_DS"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_b_gg.cpp b/src/d/actor/d_a_b_gg.cpp index 1619b1ac706..1f4d5ecc93d 100644 --- a/src/d/actor/d_a_b_gg.cpp +++ b/src/d/actor/d_a_b_gg.cpp @@ -4352,7 +4352,7 @@ static int daB_GG_Delete(daB_GG_c* a_this) { /* 805EBBE4-805EC424 00D8C4 0840+00 1/1 0/0 0/0 .text Create__8daB_GG_cFv */ int daB_GG_c::Create() { - fopAcM_SetupActor(this, daB_GG_c); + fopAcM_ct(this, daB_GG_c); int phase_state = dComIfG_resLoad(&mPhase, "B_gg"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_b_gm.cpp b/src/d/actor/d_a_b_gm.cpp index 2d8e1a1bbf4..f07b5b8ce77 100644 --- a/src/d/actor/d_a_b_gm.cpp +++ b/src/d/actor/d_a_b_gm.cpp @@ -2110,7 +2110,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 805F35A8-805F38E4 005D48 033C+00 1/0 0/0 0/0 .text daB_GM_Create__FP10fopAc_ac_c */ static int daB_GM_Create(fopAc_ac_c* i_this) { b_gm_class* a_this = (b_gm_class*)i_this; - fopAcM_SetupActor(a_this, b_gm_class); + fopAcM_ct(a_this, b_gm_class); int phase_state = dComIfG_resLoad(&a_this->mPhase, "B_gm"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_b_gnd.cpp b/src/d/actor/d_a_b_gnd.cpp index e49ee6056c9..da46d848c1c 100644 --- a/src/d/actor/d_a_b_gnd.cpp +++ b/src/d/actor/d_a_b_gnd.cpp @@ -4810,7 +4810,7 @@ static int useHeapInit(fopAc_ac_c* a_this) { /* 806014B0-80601960 00CB50 04B0+00 1/0 0/0 0/0 .text daB_GND_Create__FP10fopAc_ac_c */ static int daB_GND_Create(fopAc_ac_c* a_this) { b_gnd_class* i_this = (b_gnd_class*)a_this; - fopAcM_SetupActor(i_this, b_gnd_class); + fopAcM_ct(i_this, b_gnd_class); int phase_state = dComIfG_resLoad(&i_this->mPhaseReq, "B_gnd"); int h_phase_state = dComIfG_resLoad(&i_this->mHorsePhaseReq, "B_hg"); diff --git a/src/d/actor/d_a_b_go.cpp b/src/d/actor/d_a_b_go.cpp index 476a1ee1121..c8e68d4e760 100644 --- a/src/d/actor/d_a_b_go.cpp +++ b/src/d/actor/d_a_b_go.cpp @@ -238,7 +238,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 80603A54-80603CA0 000994 024C+00 1/0 0/0 0/0 .text daB_GO_Create__FP10fopAc_ac_c */ static int daB_GO_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, b_go_class); + fopAcM_ct(i_this, b_go_class); b_go_class* a_this = (b_go_class*)i_this; OS_REPORT("B_GO//////////////B_GO SET 0 !!\n"); diff --git a/src/d/actor/d_a_b_gos.cpp b/src/d/actor/d_a_b_gos.cpp index 7c2e59f4182..e27f22c3dfc 100644 --- a/src/d/actor/d_a_b_gos.cpp +++ b/src/d/actor/d_a_b_gos.cpp @@ -360,7 +360,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 80604E5C-80605024 000CDC 01C8+00 1/0 0/0 0/0 .text daB_GOS_Create__FP10fopAc_ac_c */ static int daB_GOS_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, b_gos_class); + fopAcM_ct(i_this, b_gos_class); b_gos_class* a_this = (b_gos_class*)i_this; OS_REPORT("B_GOS//////////////B_GOS SET 0 !!\n"); diff --git a/src/d/actor/d_a_b_mgn.cpp b/src/d/actor/d_a_b_mgn.cpp index 06db9677c98..7ccffc7a4af 100644 --- a/src/d/actor/d_a_b_mgn.cpp +++ b/src/d/actor/d_a_b_mgn.cpp @@ -3457,7 +3457,7 @@ static int useHeapInit(fopAc_ac_c* a_this) { /* 8060F0D0-8060F548 009A90 0478+00 1/1 0/0 0/0 .text create__9daB_MGN_cFv */ int daB_MGN_c::create() { - fopAcM_SetupActor(this, daB_MGN_c); + fopAcM_ct(this, daB_MGN_c); field_0xafb = fopAcM_GetParam(this); diff --git a/src/d/actor/d_a_b_ob.cpp b/src/d/actor/d_a_b_ob.cpp index 02bd744023e..dde55e3723d 100644 --- a/src/d/actor/d_a_b_ob.cpp +++ b/src/d/actor/d_a_b_ob.cpp @@ -3528,7 +3528,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 80619C5C-8061A0C0 0097DC 0464+00 1/0 0/0 0/0 .text daB_OB_Create__FP10fopAc_ac_c */ static int daB_OB_Create(fopAc_ac_c* i_this) { b_ob_class* a_this = (b_ob_class*)i_this; - fopAcM_SetupActor(i_this, b_ob_class); + fopAcM_ct(i_this, b_ob_class); OS_REPORT("B_OB//////////////B_OB SET 0 !!\n"); diff --git a/src/d/actor/d_a_b_oh.cpp b/src/d/actor/d_a_b_oh.cpp index 2003e1325bc..97447d08fde 100644 --- a/src/d/actor/d_a_b_oh.cpp +++ b/src/d/actor/d_a_b_oh.cpp @@ -773,7 +773,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 8061D3E4-8061D718 001DA4 0334+00 1/0 0/0 0/0 .text daB_OH_Create__FP10fopAc_ac_c */ static int daB_OH_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, b_oh_class); + fopAcM_ct(i_this, b_oh_class); b_oh_class* this_ = (b_oh_class*)i_this; int phase = dComIfG_resLoad(&this_->mPhase, "B_oh"); diff --git a/src/d/actor/d_a_b_oh2.cpp b/src/d/actor/d_a_b_oh2.cpp index 32388a9d4bc..7c774d9b41a 100644 --- a/src/d/actor/d_a_b_oh2.cpp +++ b/src/d/actor/d_a_b_oh2.cpp @@ -276,7 +276,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 8061E868-8061E9EC 000C28 0184+00 1/0 0/0 0/0 .text daB_OH2_Create__FP10fopAc_ac_c */ static int daB_OH2_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, b_oh2_class); + fopAcM_ct(i_this, b_oh2_class); b_oh2_class* _this = static_cast(i_this); int phase = dComIfG_resLoad(&_this->mPhase, "B_oh"); diff --git a/src/d/actor/d_a_b_tn.cpp b/src/d/actor/d_a_b_tn.cpp index 69079d4591a..c85d5608aed 100644 --- a/src/d/actor/d_a_b_tn.cpp +++ b/src/d/actor/d_a_b_tn.cpp @@ -5118,7 +5118,7 @@ static int useHeapInit(fopAc_ac_c* actor) { /* 8062CD78-8062D2F0 00E278 0578+00 1/1 0/0 0/0 .text create__8daB_TN_cFv */ int daB_TN_c::create() { - fopAcM_SetupActor(this, daB_TN_c); + fopAcM_ct(this, daB_TN_c); mSwitchNo = fopAcM_GetParam(this); mType = fopAcM_GetParamBit(this, 8, 8); diff --git a/src/d/actor/d_a_b_yo.cpp b/src/d/actor/d_a_b_yo.cpp index 9ca23a03436..3e6a86ad76a 100644 --- a/src/d/actor/d_a_b_yo.cpp +++ b/src/d/actor/d_a_b_yo.cpp @@ -3310,7 +3310,7 @@ static int useHeapInit2(fopAc_ac_c* i_this) { /* 806389C0-80639214 009640 0854+00 1/1 0/0 0/0 .text create__8daB_YO_cFv */ cPhs__Step daB_YO_c::create() { - fopAcM_SetupActor(this, daB_YO_c); + fopAcM_ct(this, daB_YO_c); cPhs__Step step; mSwNo = fopAcM_GetParam(this) & 0xff; diff --git a/src/d/actor/d_a_b_yo_ice.cpp b/src/d/actor/d_a_b_yo_ice.cpp index b02c9cd6505..d0fd991ca57 100644 --- a/src/d/actor/d_a_b_yo_ice.cpp +++ b/src/d/actor/d_a_b_yo_ice.cpp @@ -1047,7 +1047,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 8063D5D0-8063D8FC 003570 032C+00 1/1 0/0 0/0 .text create__9daB_YOI_cFv */ // data/rodata swap cPhs__Step daB_YOI_c::create() { - fopAcM_SetupActor(this, daB_YOI_c); + fopAcM_ct(this, daB_YOI_c); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhase, "B_YO"); if (step == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_b_zant.cpp b/src/d/actor/d_a_b_zant.cpp index 66cb1cb6a00..e1749690ab1 100644 --- a/src/d/actor/d_a_b_zant.cpp +++ b/src/d/actor/d_a_b_zant.cpp @@ -5573,7 +5573,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 8064E190-8064E724 010170 0594+00 1/1 0/0 0/0 .text create__10daB_ZANT_cFv */ int daB_ZANT_c::create() { - fopAcM_SetupActor(this, daB_ZANT_c); + fopAcM_ct(this, daB_ZANT_c); OS_REPORT("B_ZANT PARAM %x\n", fopAcM_GetParam(this)); mSwbit = fopAcM_GetParam(this); diff --git a/src/d/actor/d_a_b_zant_magic.cpp b/src/d/actor/d_a_b_zant_magic.cpp index 973f849c42a..b8fc12bd19c 100644 --- a/src/d/actor/d_a_b_zant_magic.cpp +++ b/src/d/actor/d_a_b_zant_magic.cpp @@ -251,7 +251,7 @@ static int daB_ZANTM_Delete(daB_ZANTM_c* i_this) { /* 8064FF54-806500A8 000854 0154+00 1/1 0/0 0/0 .text create__11daB_ZANTM_cFv */ int daB_ZANTM_c::create() { - fopAcM_SetupActor(this, daB_ZANTM_c); + fopAcM_ct(this, daB_ZANTM_c); OS_REPORT("B_ZANTM PARAM %x\n", fopAcM_GetParam(this)); mPrm = fopAcM_GetParam(this); diff --git a/src/d/actor/d_a_b_zant_mobile.cpp b/src/d/actor/d_a_b_zant_mobile.cpp index 2572c6107dc..b85efa5c283 100644 --- a/src/d/actor/d_a_b_zant_mobile.cpp +++ b/src/d/actor/d_a_b_zant_mobile.cpp @@ -458,7 +458,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 80652038-806522F4 001998 02BC+00 1/1 0/0 0/0 .text create__11daB_ZANTZ_cFv */ int daB_ZANTZ_c::create() { - fopAcM_SetupActor(this, daB_ZANTZ_c); + fopAcM_ct(this, daB_ZANTZ_c); int phase_state = dComIfG_resLoad(&mPhase, "B_oh"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_b_zant_sima.cpp b/src/d/actor/d_a_b_zant_sima.cpp index fa262270c01..464a44bcb88 100644 --- a/src/d/actor/d_a_b_zant_sima.cpp +++ b/src/d/actor/d_a_b_zant_sima.cpp @@ -206,7 +206,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 806531E8-80653304 000888 011C+00 1/1 0/0 0/0 .text create__11daB_ZANTS_cFv */ int daB_ZANTS_c::create() { - fopAcM_SetupActor(this, daB_ZANTS_c); + fopAcM_ct(this, daB_ZANTS_c); int phase_state = dComIfG_resLoad(&mPhase, "MAGNESIMA"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_balloon_2D.cpp b/src/d/actor/d_a_balloon_2D.cpp index f56a512f455..b43bc5ac1a1 100644 --- a/src/d/actor/d_a_balloon_2D.cpp +++ b/src/d/actor/d_a_balloon_2D.cpp @@ -593,7 +593,7 @@ void daBalloon2D_HIO_c::resetAddScoreSetFlag() { /* 80655250-80655304 001E70 00B4+00 1/0 0/0 0/0 .text daBalloon2D_create__FP13daBalloon2D_c */ // NONMATCHING - vtable static int daBalloon2D_create(daBalloon2D_c* i_this) { - fopAcM_SetupActor(i_this, daBalloon2D_c); + fopAcM_ct(i_this, daBalloon2D_c); return i_this->create(); } diff --git a/src/d/actor/d_a_bd.cpp b/src/d/actor/d_a_bd.cpp index 3ca4cf34c4b..8ace7700935 100644 --- a/src/d/actor/d_a_bd.cpp +++ b/src/d/actor/d_a_bd.cpp @@ -1014,7 +1014,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 804D981C-804D9BB8 002CBC 039C+00 1/0 0/0 0/0 .text daBd_Create__FP10fopAc_ac_c */ static int daBd_Create(fopAc_ac_c* i_act_this) { bd_class* i_this = (bd_class*)i_act_this; - fopAcM_SetupActor(i_act_this, bd_class); + fopAcM_ct(i_act_this, bd_class); int phase_state = dComIfG_resLoad(&i_this->mPhase, "Bd"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_bg.cpp b/src/d/actor/d_a_bg.cpp index 4fa9b88f381..f00759e8a69 100644 --- a/src/d/actor/d_a_bg.cpp +++ b/src/d/actor/d_a_bg.cpp @@ -507,7 +507,7 @@ int daBg_c::create() { field_0x5f1 = 0; if (this->heap == NULL) { - fopAcM_SetupActor(this, daBg_c); + fopAcM_ct(this, daBg_c); home.roomNo = roomNo; current.roomNo = roomNo; diff --git a/src/d/actor/d_a_bg_obj.cpp b/src/d/actor/d_a_bg_obj.cpp index 4663e62f5aa..849174ead36 100644 --- a/src/d/actor/d_a_bg_obj.cpp +++ b/src/d/actor/d_a_bg_obj.cpp @@ -1403,7 +1403,7 @@ int daBgObj_c::Delete() { /* 8045C330-8045C444 002D50 0114+00 1/0 0/0 0/0 .text daBgObj_create1st__FP9daBgObj_c */ static int daBgObj_create1st(daBgObj_c* i_this) { - fopAcM_SetupActor(i_this, daBgObj_c); + fopAcM_ct(i_this, daBgObj_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_boomerang.cpp b/src/d/actor/d_a_boomerang.cpp index cdd52be8b8d..1a34d28520a 100644 --- a/src/d/actor/d_a_boomerang.cpp +++ b/src/d/actor/d_a_boomerang.cpp @@ -1483,7 +1483,7 @@ static dCcD_SrcCyl l_windAtCylSrc = { /* 804A2084-804A230C 004044 0288+00 1/1 0/0 0/0 .text create__13daBoomerang_cFv */ int daBoomerang_c::create() { fpc_ProcID id = fopAcM_GetID(this); - fopAcM_SetupActor(this, daBoomerang_c); + fopAcM_ct(this, daBoomerang_c); if (!fopAcM_entrySolidHeap(this, daBoomerang_createHeap, 0xC0D0)) { return cPhs_ERROR_e; diff --git a/src/d/actor/d_a_bullet.cpp b/src/d/actor/d_a_bullet.cpp index 72c42b7871f..db770588767 100644 --- a/src/d/actor/d_a_bullet.cpp +++ b/src/d/actor/d_a_bullet.cpp @@ -40,7 +40,7 @@ daBullet_c::~daBullet_c() { /* 80655B08-80655C90 0002A8 0188+00 1/1 0/0 0/0 .text create__10daBullet_cFv */ int daBullet_c::create() { - fopAcM_SetupActor(this, daBullet_c); + fopAcM_ct(this, daBullet_c); mType = getTypeFromParam(); int phase_state = dComIfG_resLoad(&mPhase, getResName()); diff --git a/src/d/actor/d_a_canoe.cpp b/src/d/actor/d_a_canoe.cpp index 7a638c6166c..6dcc6281804 100644 --- a/src/d/actor/d_a_canoe.cpp +++ b/src/d/actor/d_a_canoe.cpp @@ -99,7 +99,7 @@ static dCcD_SrcCyl l_cylSrc = { /* 804DA740-804DAB18 0002E0 03D8+00 1/1 0/0 0/0 .text create__9daCanoe_cFv */ int daCanoe_c::create() { - fopAcM_SetupActor(this, daCanoe_c); + fopAcM_ct(this, daCanoe_c); if (strcmp(dComIfGp_getStartStageName(), "F_SP127") == 0) { /* dSv_event_flag_c::F_0463 - Fishing Pond - Reserved for fishing */ diff --git a/src/d/actor/d_a_coach_2D.cpp b/src/d/actor/d_a_coach_2D.cpp index 180ab9eb228..829bb3d1ab3 100644 --- a/src/d/actor/d_a_coach_2D.cpp +++ b/src/d/actor/d_a_coach_2D.cpp @@ -345,7 +345,7 @@ void daCoach2D_c::setBrkAnime(bool param_0) { /* 8065764C-806576D4 000D6C 0088+00 1/0 0/0 0/0 .text daCoach2D_create__FP11daCoach2D_c */ static int daCoach2D_create(daCoach2D_c* i_this) { - fopAcM_SetupActor(i_this, daCoach2D_c); + fopAcM_ct(i_this, daCoach2D_c); return i_this->create(); } diff --git a/src/d/actor/d_a_coach_fire.cpp b/src/d/actor/d_a_coach_fire.cpp index 04d46b63028..a3b99064042 100644 --- a/src/d/actor/d_a_coach_fire.cpp +++ b/src/d/actor/d_a_coach_fire.cpp @@ -164,7 +164,7 @@ static int daCoachFire_Delete(daCoachFire_c* i_this) { /* 806581C0-806582AC 0006C0 00EC+00 1/0 0/0 0/0 .text daCoachFire_Create__FP10fopAc_ac_c */ static int daCoachFire_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, daCoachFire_c); + fopAcM_ct(i_this, daCoachFire_c); static_cast(i_this)->create_init(); return cPhs_COMPLEATE_e; } diff --git a/src/d/actor/d_a_crod.cpp b/src/d/actor/d_a_crod.cpp index c43ac55a716..e0a7da80cee 100644 --- a/src/d/actor/d_a_crod.cpp +++ b/src/d/actor/d_a_crod.cpp @@ -79,7 +79,7 @@ static dCcD_SrcCps l_atCpsSrc = { /* 804A2F18-804A31F8 000158 02E0+00 1/1 0/0 0/0 .text create__8daCrod_cFv */ int daCrod_c::create() { - fopAcM_SetupActor(this, daCrod_c); + fopAcM_ct(this, daCrod_c); if (fopAcM_GetParam(this) == 6) { fopAcM_setStageLayer(this); diff --git a/src/d/actor/d_a_cstaF.cpp b/src/d/actor/d_a_cstaF.cpp index 2b30c2e071a..848da95d970 100644 --- a/src/d/actor/d_a_cstaF.cpp +++ b/src/d/actor/d_a_cstaF.cpp @@ -110,7 +110,7 @@ static dCcD_SrcCyl l_cylSrc = { /* 804DDBB4-804DE0C4 0002D4 0510+00 1/1 0/0 0/0 .text create__9daCstaF_cFv */ int daCstaF_c::create() { - fopAcM_SetupActor(this, daCstaF_c); + fopAcM_ct(this, daCstaF_c); m_type = fopAcM_GetParam(this) & 0xF; if (m_type >= 2) { diff --git a/src/d/actor/d_a_cstatue.cpp b/src/d/actor/d_a_cstatue.cpp index aedfedabde6..768b942aa67 100644 --- a/src/d/actor/d_a_cstatue.cpp +++ b/src/d/actor/d_a_cstatue.cpp @@ -219,7 +219,7 @@ int daCstatue_c::create() { static int const heapSize[daCstatueType_N] = {4368, 2208, 4688, 6240, 6240}; - fopAcM_SetupActor(this, daCstatue_c); + fopAcM_ct(this, daCstatue_c); mType = (fopAcM_GetParam(this) >> 8) & 0xf; if (mType == daCstatueType_Normal2) { mType = daCstatueType_Small; diff --git a/src/d/actor/d_a_demo00.cpp b/src/d/actor/d_a_demo00.cpp index 405468f97a6..a3eaed0c682 100644 --- a/src/d/actor/d_a_demo00.cpp +++ b/src/d/actor/d_a_demo00.cpp @@ -1814,7 +1814,7 @@ static int daDemo00_Delete(daDemo00_c* i_this) { static int daDemo00_Create(fopAc_ac_c* a_this) { // NONMATCHING daDemo00_c* i_this = (daDemo00_c*)a_this; - fopAcM_SetupActor(a_this, daDemo00_c); + fopAcM_ct(a_this, daDemo00_c); i_this->field_0x6a2 = 0; i_this->mground2 = 0; diff --git a/src/d/actor/d_a_demo_item.cpp b/src/d/actor/d_a_demo_item.cpp index 94a9be0dbd7..8de81066c0a 100644 --- a/src/d/actor/d_a_demo_item.cpp +++ b/src/d/actor/d_a_demo_item.cpp @@ -481,7 +481,7 @@ static int daDitem_Delete(daDitem_c* i_this) { } int daDitem_c::create() { - fopAcM_SetupActor(this, daDitem_c); + fopAcM_ct(this, daDitem_c); m_itemNo = daDitem_prm::getNo(this); diff --git a/src/d/actor/d_a_disappear.cpp b/src/d/actor/d_a_disappear.cpp index 4317a2a74a3..99ca78f15b3 100644 --- a/src/d/actor/d_a_disappear.cpp +++ b/src/d/actor/d_a_disappear.cpp @@ -106,7 +106,7 @@ static void set_disappear(disappear_class* i_this, f32 i_scale) { /* 804A9364-804A9458 0004C4 00F4+00 1/0 0/0 0/0 .text daDisappear_Create__FP10fopAc_ac_c */ static int daDisappear_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, disappear_class); + fopAcM_ct(i_this, disappear_class); disappear_class* this_ = (disappear_class*)i_this; this_->field_0x567 = fopAcM_GetParam(this_); diff --git a/src/d/actor/d_a_dmidna.cpp b/src/d/actor/d_a_dmidna.cpp index 0ee3293fe46..d23ffd5e564 100644 --- a/src/d/actor/d_a_dmidna.cpp +++ b/src/d/actor/d_a_dmidna.cpp @@ -31,7 +31,7 @@ static int daDmidna_createHeap(fopAc_ac_c* i_this) { /* 8045CFE4-8045D094 000184 00B0+00 1/1 0/0 0/0 .text create__10daDmidna_cFv */ int daDmidna_c::create() { - fopAcM_SetupActor(this, daDmidna_c); + fopAcM_ct(this, daDmidna_c); int phase = dComIfG_resLoad(&mPhase, l_arcName); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_do.cpp b/src/d/actor/d_a_do.cpp index a31049cd700..f6ffcc76839 100644 --- a/src/d/actor/d_a_do.cpp +++ b/src/d/actor/d_a_do.cpp @@ -2452,7 +2452,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 8066E81C-8066EAE4 006BBC 02C8+00 1/0 0/0 0/0 .text daDo_Create__FP10fopAc_ac_c */ static cPhs__Step daDo_Create(fopAc_ac_c* i_this) { do_class* _this = static_cast(i_this); - fopAcM_SetupActor(i_this, do_class); + fopAcM_ct(i_this, do_class); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&_this->mPhase, "Do"); diff --git a/src/d/actor/d_a_door_boss.cpp b/src/d/actor/d_a_door_boss.cpp index cb4623685d2..5e196d96743 100644 --- a/src/d/actor/d_a_door_boss.cpp +++ b/src/d/actor/d_a_door_boss.cpp @@ -115,7 +115,7 @@ int daBdoor_c::CreateInit() { /* 8066F8E4-8066F9D8 000544 00F4+00 1/1 0/0 0/0 .text create__9daBdoor_cFv */ cPhs__Step daBdoor_c::create() { - fopAcM_SetupActor(this, daBdoor_c); + fopAcM_ct(this, daBdoor_c); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhaseReq, getArcName()); if (step == cPhs_COMPLEATE_e) { if (!fopAcM_entrySolidHeap(this, CheckCreateHeap, 0xa000)) { diff --git a/src/d/actor/d_a_door_bossL1.cpp b/src/d/actor/d_a_door_bossL1.cpp index dd2026e8565..587c2a1beee 100644 --- a/src/d/actor/d_a_door_bossL1.cpp +++ b/src/d/actor/d_a_door_bossL1.cpp @@ -346,7 +346,7 @@ int daBdoorL1_c::CreateInit() { /* 804E28E4-804E2A98 000BC4 01B4+00 1/1 0/0 0/0 .text create__11daBdoorL1_cFv */ int daBdoorL1_c::create() { - fopAcM_SetupActor(this, daBdoorL1_c); + fopAcM_ct(this, daBdoorL1_c); int rv = dComIfG_resLoad(&mPhase1, getArcName()); if (rv != cPhs_COMPLEATE_e) { return rv; diff --git a/src/d/actor/d_a_door_bossL5.cpp b/src/d/actor/d_a_door_bossL5.cpp index 3fc1f72cf6a..f11d2df1c99 100644 --- a/src/d/actor/d_a_door_bossL5.cpp +++ b/src/d/actor/d_a_door_bossL5.cpp @@ -142,7 +142,7 @@ int daBdoorL5_c::CreateInit() { /* 8067106C-806711FC 0004AC 0190+00 1/1 0/0 0/0 .text create__11daBdoorL5_cFv */ int daBdoorL5_c::create() { - fopAcM_SetupActor(this, daBdoorL5_c); + fopAcM_ct(this, daBdoorL5_c); int rv = dComIfG_resLoad(&mPhase1, getArcName()); if (rv != cPhs_COMPLEATE_e) { return rv; diff --git a/src/d/actor/d_a_door_dbdoor00.cpp b/src/d/actor/d_a_door_dbdoor00.cpp index 91cf8c5e2b2..a85b58a4bb4 100644 --- a/src/d/actor/d_a_door_dbdoor00.cpp +++ b/src/d/actor/d_a_door_dbdoor00.cpp @@ -165,7 +165,7 @@ int daDbDoor00_c::CreateInit() { /* 8045D9A8-8045DA68 0006A8 00C0+00 1/1 0/0 0/0 .text create__12daDbDoor00_cFv */ int daDbDoor00_c::create() { - fopAcM_SetupActor(this, daDbDoor00_c); + fopAcM_ct(this, daDbDoor00_c); int phase = dComIfG_resLoad(&mPhaseReq2, getAlwaysArcName()); if (phase != cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_door_knob00.cpp b/src/d/actor/d_a_door_knob00.cpp index 543088dd324..5c3e764fc8b 100644 --- a/src/d/actor/d_a_door_knob00.cpp +++ b/src/d/actor/d_a_door_knob00.cpp @@ -155,7 +155,7 @@ int daKnob20_c::CreateInit() { /* 8045ED1C-8045EE14 00053C 00F8+00 1/1 0/0 0/0 .text create__10daKnob20_cFv */ int daKnob20_c::create() { - fopAcM_SetupActor(this, daKnob20_c); + fopAcM_ct(this, daKnob20_c); int phase = dComIfG_resLoad(&mPhase2, getAlwaysArcName()); if (phase != cPhs_COMPLEATE_e) { return phase; diff --git a/src/d/actor/d_a_door_mbossL1.cpp b/src/d/actor/d_a_door_mbossL1.cpp index e421add66b1..25f299b4952 100644 --- a/src/d/actor/d_a_door_mbossL1.cpp +++ b/src/d/actor/d_a_door_mbossL1.cpp @@ -523,7 +523,7 @@ int daMBdoorL1_c::CreateInit() { /* 80673B9C-80673D98 0013DC 01FC+00 1/1 0/0 0/0 .text create__12daMBdoorL1_cFv */ int daMBdoorL1_c::create() { - fopAcM_SetupActor(this, daMBdoorL1_c); + fopAcM_ct(this, daMBdoorL1_c); int rv = dComIfG_resLoad(&mPhase1, getArcName()); if (rv != cPhs_COMPLEATE_e) { return rv; diff --git a/src/d/actor/d_a_door_push.cpp b/src/d/actor/d_a_door_push.cpp index 053989c664c..a50727b31a7 100644 --- a/src/d/actor/d_a_door_push.cpp +++ b/src/d/actor/d_a_door_push.cpp @@ -373,7 +373,7 @@ int daDoorPush_c::Delete() { /* 80678DAC-80678E38 00106C 008C+00 1/0 0/0 0/0 .text daDoorPush_create1st__FP12daDoorPush_c */ static int daDoorPush_create1st(daDoorPush_c* i_this) { - fopAcM_SetupActor(i_this, daDoorPush_c); + fopAcM_ct(i_this, daDoorPush_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_door_shutter.cpp b/src/d/actor/d_a_door_shutter.cpp index 16b54cd45e1..604a04827fd 100644 --- a/src/d/actor/d_a_door_shutter.cpp +++ b/src/d/actor/d_a_door_shutter.cpp @@ -2235,7 +2235,7 @@ static int daDoor20_Delete(daDoor20_c* i_this) { /* 80466618-8046670C 005B58 00F4+00 1/0 0/0 0/0 .text daDoor20_Create__FP10fopAc_ac_c */ static int daDoor20_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, daDoor20_c); + fopAcM_ct(i_this, daDoor20_c); return static_cast(i_this)->create(); } diff --git a/src/d/actor/d_a_dshutter.cpp b/src/d/actor/d_a_dshutter.cpp index a208ae24883..c5ea74bc1f5 100644 --- a/src/d/actor/d_a_dshutter.cpp +++ b/src/d/actor/d_a_dshutter.cpp @@ -240,7 +240,7 @@ AUDIO_INSTANCES; /* 80467C7C-80467DF8 00085C 017C+00 1/0 0/0 0/0 .text daDsh_Create__FP10fopAc_ac_c */ int daDsh_c::create() { - fopAcM_SetupActor(this, daDsh_c); + fopAcM_ct(this, daDsh_c); mType = getType(); diff --git a/src/d/actor/d_a_e_ai.cpp b/src/d/actor/d_a_e_ai.cpp index 99cc68db945..24969d87a6f 100644 --- a/src/d/actor/d_a_e_ai.cpp +++ b/src/d/actor/d_a_e_ai.cpp @@ -912,7 +912,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 8067B8E4-8067BAEC 002864 0208+00 1/1 0/0 0/0 .text Create__10e_ai_classFv */ int e_ai_class::Create() { - fopAcM_SetupActor(this, e_ai_class); + fopAcM_ct(this, e_ai_class); int phase_state = dComIfG_resLoad(&m_phase, "E_AI"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_arrow.cpp b/src/d/actor/d_a_e_arrow.cpp index ae5bae42a94..69b2a6d7a71 100644 --- a/src/d/actor/d_a_e_arrow.cpp +++ b/src/d/actor/d_a_e_arrow.cpp @@ -682,7 +682,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 8067E428-8067E724 001D48 02FC+00 1/0 0/0 0/0 .text daE_ARROW_Create__FP10fopAc_ac_c */ static int daE_ARROW_Create(fopAc_ac_c* i_this) { e_arrow_class* const a_this = static_cast(i_this); - fopAcM_SetupActor(i_this, e_arrow_class); + fopAcM_ct(i_this, e_arrow_class); if (fopAcM_GetParam(a_this) & 0x80000000) { a_this->mResName = "E_rdy"; diff --git a/src/d/actor/d_a_e_ba.cpp b/src/d/actor/d_a_e_ba.cpp index 6157cf05c26..a7cb01b070a 100644 --- a/src/d/actor/d_a_e_ba.cpp +++ b/src/d/actor/d_a_e_ba.cpp @@ -1035,7 +1035,7 @@ static cPhs__Step daE_BA_Create(fopAc_ac_c* i_this) { } // mSphAttr }; - fopAcM_SetupActor(i_this, e_ba_class); + fopAcM_ct(i_this, e_ba_class); e_ba_class* _this = (e_ba_class*)i_this; _this->mType = (fopAcM_GetParam(_this) & 0xf000) >> 12; diff --git a/src/d/actor/d_a_e_bee.cpp b/src/d/actor/d_a_e_bee.cpp index 8662d5f971b..05b4f02caec 100644 --- a/src/d/actor/d_a_e_bee.cpp +++ b/src/d/actor/d_a_e_bee.cpp @@ -739,7 +739,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 80684E24-80685224 0026A4 0400+00 1/0 0/0 0/0 .text daE_Bee_Create__FP10fopAc_ac_c */ static cPhs__Step daE_Bee_Create(fopAc_ac_c* i_this) { e_bee_class* _this = static_cast(i_this); - fopAcM_SetupActor(_this, e_bee_class); + fopAcM_ct(_this, e_bee_class); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&_this->mPhase, "E_bee"); if (step == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_bg.cpp b/src/d/actor/d_a_e_bg.cpp index f5e5dbb67da..1ca226d8d77 100644 --- a/src/d/actor/d_a_e_bg.cpp +++ b/src/d/actor/d_a_e_bg.cpp @@ -1362,7 +1362,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 80689C38-8068A07C 004518 0444+00 1/1 0/0 0/0 .text create__8daE_BG_cFv */ int daE_BG_c::create() { - fopAcM_SetupActor(this, daE_BG_c); + fopAcM_ct(this, daE_BG_c); field_0x68d = fopAcM_GetParam(this); if (field_0x68d == 0xff) { diff --git a/src/d/actor/d_a_e_bi.cpp b/src/d/actor/d_a_e_bi.cpp index baa96bbad92..c721115fcef 100644 --- a/src/d/actor/d_a_e_bi.cpp +++ b/src/d/actor/d_a_e_bi.cpp @@ -888,7 +888,7 @@ static int useHeapInit(fopAc_ac_c* a_this) { /* 8068CC00-8068D080 002700 0480+00 1/0 0/0 0/0 .text daE_BI_Create__FP10fopAc_ac_c */ static cPhs__Step daE_BI_Create(fopAc_ac_c* a_this) { - fopAcM_SetupActor(a_this, e_bi_class); + fopAcM_ct(a_this, e_bi_class); e_bi_class* i_this = (e_bi_class*)a_this; cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&i_this->mPhase, "E_BI"); diff --git a/src/d/actor/d_a_e_bi_leaf.cpp b/src/d/actor/d_a_e_bi_leaf.cpp index bee19a57aa6..3cded1250c6 100644 --- a/src/d/actor/d_a_e_bi_leaf.cpp +++ b/src/d/actor/d_a_e_bi_leaf.cpp @@ -103,7 +103,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { */ static int daE_BI_LEAF_Create(fopAc_ac_c* i_this) { e_bi_leaf_class* a_this = static_cast(i_this); - fopAcM_SetupActor(a_this, e_bi_leaf_class); + fopAcM_ct(a_this, e_bi_leaf_class); int phase_state = dComIfG_resLoad(&a_this->mPhase, "E_BI"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_bs.cpp b/src/d/actor/d_a_e_bs.cpp index c7cb7faa430..5ef0769af60 100644 --- a/src/d/actor/d_a_e_bs.cpp +++ b/src/d/actor/d_a_e_bs.cpp @@ -845,7 +845,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 80690224-806905B8 0021E4 0394+00 1/0 0/0 0/0 .text daE_BS_Create__FP10fopAc_ac_c */ static int daE_BS_Create(fopAc_ac_c* i_this) { e_bs_class* a_this = (e_bs_class*)i_this; - fopAcM_SetupActor(i_this, e_bs_class); + fopAcM_ct(i_this, e_bs_class); int phase_state = dComIfG_resLoad(&a_this->phase, "E_BS"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_bu.cpp b/src/d/actor/d_a_e_bu.cpp index 423a8ad89ce..cc19217ca4a 100644 --- a/src/d/actor/d_a_e_bu.cpp +++ b/src/d/actor/d_a_e_bu.cpp @@ -1051,7 +1051,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 80693BD4-80693FC0 002B14 03EC+00 1/0 0/0 0/0 .text daE_BU_Create__FP10fopAc_ac_c */ static int daE_BU_Create(fopAc_ac_c* i_this) { e_bu_class* a_this = (e_bu_class*)i_this; - fopAcM_SetupActor(i_this, e_bu_class); + fopAcM_ct(i_this, e_bu_class); int phase_state = dComIfG_resLoad(&a_this->phase, "E_BU"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_bug.cpp b/src/d/actor/d_a_e_bug.cpp index f102bd119df..c6d941628d9 100644 --- a/src/d/actor/d_a_e_bug.cpp +++ b/src/d/actor/d_a_e_bug.cpp @@ -838,7 +838,7 @@ static int useHeapInit(fopAc_ac_c* a_this) { static cPhs__Step daE_Bug_Create(fopAc_ac_c* a_this) { e_bug_class* i_this = (e_bug_class*)a_this; - fopAcM_SetupActor(a_this, e_bug_class); + fopAcM_ct(a_this, e_bug_class); cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&i_this->mPhase, "E_bug"); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_cr.cpp b/src/d/actor/d_a_e_cr.cpp index 72316d5d1f8..ec53ea6428a 100644 --- a/src/d/actor/d_a_e_cr.cpp +++ b/src/d/actor/d_a_e_cr.cpp @@ -500,7 +500,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 8069936C-806995E0 00144C 0274+00 1/0 0/0 0/0 .text daE_CR_Create__FP10fopAc_ac_c */ static int daE_CR_Create(fopAc_ac_c* i_this) { e_cr_class* a_this = (e_cr_class*)i_this; - fopAcM_SetupActor(i_this, e_cr_class); + fopAcM_ct(i_this, e_cr_class); int phase_state = dComIfG_resLoad(&a_this->phase, "E_CR"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_cr_egg.cpp b/src/d/actor/d_a_e_cr_egg.cpp index 2ee85ca4750..6f63a44090e 100644 --- a/src/d/actor/d_a_e_cr_egg.cpp +++ b/src/d/actor/d_a_e_cr_egg.cpp @@ -173,7 +173,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { */ static int daE_CR_EGG_Create(fopAc_ac_c* i_this) { e_cr_egg_class* a_this = (e_cr_egg_class*)i_this; - fopAcM_SetupActor(i_this, e_cr_egg_class); + fopAcM_ct(i_this, e_cr_egg_class); int phase_state = dComIfG_resLoad(&a_this->phase, "E_CR"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_db.cpp b/src/d/actor/d_a_e_db.cpp index 411bfe7f468..b959d4415e1 100644 --- a/src/d/actor/d_a_e_db.cpp +++ b/src/d/actor/d_a_e_db.cpp @@ -2099,7 +2099,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 806A0B54-806A106C 006154 0518+00 1/0 0/0 0/0 .text daE_DB_Create__FP10fopAc_ac_c */ static int daE_DB_Create(fopAc_ac_c* i_this) { e_db_class* a_this = (e_db_class*)i_this; - fopAcM_SetupActor(i_this, e_db_class); + fopAcM_ct(i_this, e_db_class); int phase_state = dComIfG_resLoad(&a_this->phase, "E_db"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_db_leaf.cpp b/src/d/actor/d_a_e_db_leaf.cpp index 9b8a78bcebf..ecf1a8c537d 100644 --- a/src/d/actor/d_a_e_db_leaf.cpp +++ b/src/d/actor/d_a_e_db_leaf.cpp @@ -51,7 +51,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 806A205C-806A210C 00029C 00B0+00 1/0 0/0 0/0 .text daE_DB_LEAF_Create__FP10fopAc_ac_c */ static int daE_DB_LEAF_Create(fopAc_ac_c* i_this) { e_db_leaf_class* leaf = (e_db_leaf_class*)i_this; - fopAcM_SetupActor(leaf, e_db_leaf_class); + fopAcM_ct(leaf, e_db_leaf_class); int ret = dComIfG_resLoad(&leaf->mPhase, "E_DB"); if (ret == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_dd.cpp b/src/d/actor/d_a_e_dd.cpp index 6baaa5143ac..d8a9404d5f9 100644 --- a/src/d/actor/d_a_e_dd.cpp +++ b/src/d/actor/d_a_e_dd.cpp @@ -1694,7 +1694,7 @@ static int kabe_initial_pos_set(e_dd_class* i_this) { /* 806A65C4-806A69A4 004444 03E0+00 1/0 0/0 0/0 .text daE_DD_Create__FP10fopAc_ac_c */ static cPhs__Step daE_DD_Create(fopAc_ac_c* a_this) { e_dd_class* i_this = (e_dd_class*)a_this; - fopAcM_SetupActor(a_this, e_dd_class); + fopAcM_ct(a_this, e_dd_class); cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&i_this->mPhase, "E_dd"); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_df.cpp b/src/d/actor/d_a_e_df.cpp index 97308ec8ae0..feea52c0e80 100644 --- a/src/d/actor/d_a_e_df.cpp +++ b/src/d/actor/d_a_e_df.cpp @@ -683,7 +683,7 @@ static int daE_DF_Delete(daE_DF_c* i_this) { /* 806A9678-806A9930 002078 02B8+00 1/1 0/0 0/0 .text Create__8daE_DF_cFv */ int daE_DF_c::Create() { - fopAcM_SetupActor(this, daE_DF_c); + fopAcM_ct(this, daE_DF_c); cPhs__Step rv = (cPhs__Step)dComIfG_resLoad(&mPhaseReq, "E_DF"); if (rv == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_dk.cpp b/src/d/actor/d_a_e_dk.cpp index 903fb6c8d12..d2f94aeed78 100644 --- a/src/d/actor/d_a_e_dk.cpp +++ b/src/d/actor/d_a_e_dk.cpp @@ -1025,7 +1025,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 806ACE14-806AD0AC 002D14 0298+00 1/1 0/0 0/0 .text create__8daE_DK_cFv */ int daE_DK_c::create() { - fopAcM_SetupActor(this, daE_DK_c); + fopAcM_ct(this, daE_DK_c); s32 loadRes = dComIfG_resLoad(&mPhaseReq, "E_DK"); if (loadRes == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_dn.cpp b/src/d/actor/d_a_e_dn.cpp index c83ba45a5fe..1e16c3f5fe1 100644 --- a/src/d/actor/d_a_e_dn.cpp +++ b/src/d/actor/d_a_e_dn.cpp @@ -3331,7 +3331,7 @@ static int useHeapInit(fopAc_ac_c* a_this) { static cPhs__Step daE_DN_Create(fopAc_ac_c* a_this) { e_dn_class* i_this = (e_dn_class*)a_this; - fopAcM_SetupActor(a_this, e_dn_class); + fopAcM_ct(a_this, e_dn_class); cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&i_this->mPhase, "E_dn"); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_dt.cpp b/src/d/actor/d_a_e_dt.cpp index 8f54497be7b..22bd5da0ae1 100644 --- a/src/d/actor/d_a_e_dt.cpp +++ b/src/d/actor/d_a_e_dt.cpp @@ -2539,7 +2539,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 806B5460-806B592C 007C40 04CC+00 1/1 0/0 0/0 .text create__8daE_DT_cFv */ cPhs__Step daE_DT_c::create() { - fopAcM_SetupActor(this, daE_DT_c); + fopAcM_ct(this, daE_DT_c); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhase[0], "E_DT"); if (step != cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_fb.cpp b/src/d/actor/d_a_e_fb.cpp index b3a964fda3f..4b53d6021f0 100644 --- a/src/d/actor/d_a_e_fb.cpp +++ b/src/d/actor/d_a_e_fb.cpp @@ -925,7 +925,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 806B88E0-806B8C1C 002520 033C+00 1/1 0/0 0/0 .text create__8daE_FB_cFv */ cPhs__Step daE_FB_c::create() { - fopAcM_SetupActor(this, daE_FB_c); + fopAcM_ct(this, daE_FB_c); mType = fopAcM_GetParam(this); swBit0 = (fopAcM_GetParam(this) & 0xFF00) >> 8; swBit1 = (fopAcM_GetParam(this) & 0xFF0000) >> 16; diff --git a/src/d/actor/d_a_e_fk.cpp b/src/d/actor/d_a_e_fk.cpp index 83c8dd6b212..9fa0e469151 100644 --- a/src/d/actor/d_a_e_fk.cpp +++ b/src/d/actor/d_a_e_fk.cpp @@ -784,7 +784,7 @@ void daE_FK_c::CreateChk() { /* 806BB004-806BB324 001D64 0320+00 1/1 0/0 0/0 .text Create__8daE_FK_cFv */ int daE_FK_c::Create() { - fopAcM_SetupActor(this, daE_FK_c); + fopAcM_ct(this, daE_FK_c); int phase_state = dComIfG_resLoad(&mPhase, "E_fk"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_fm.cpp b/src/d/actor/d_a_e_fm.cpp index b98fcd5ae4f..9e6f07aa8fb 100644 --- a/src/d/actor/d_a_e_fm.cpp +++ b/src/d/actor/d_a_e_fm.cpp @@ -3691,7 +3691,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 804F9614-804F9B64 00A614 0550+00 1/0 0/0 0/0 .text daE_FM_Create__FP10fopAc_ac_c */ static int daE_FM_Create(fopAc_ac_c* i_this) { e_fm_class* a_this = (e_fm_class*)i_this; - fopAcM_SetupActor(a_this, e_fm_class); + fopAcM_ct(a_this, e_fm_class); static dCcD_SrcSph cc_sph_src = { { diff --git a/src/d/actor/d_a_e_fs.cpp b/src/d/actor/d_a_e_fs.cpp index fd616532321..fddd3ceba63 100644 --- a/src/d/actor/d_a_e_fs.cpp +++ b/src/d/actor/d_a_e_fs.cpp @@ -743,7 +743,7 @@ static int useHeapIe_fst(fopAc_ac_c* i_this) { /* 806BD838-806BDD38 001E58 0500+00 1/0 0/0 0/0 .text daE_Fs_Create__FP10fopAc_ac_c */ static cPhs__Step daE_Fs_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, e_fs_class); + fopAcM_ct(i_this, e_fs_class); e_fs_class* _this = (e_fs_class*)(i_this); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&_this->mPhase, "E_FS"); diff --git a/src/d/actor/d_a_e_fz.cpp b/src/d/actor/d_a_e_fz.cpp index f5be87ec6a8..592c55860ff 100644 --- a/src/d/actor/d_a_e_fz.cpp +++ b/src/d/actor/d_a_e_fz.cpp @@ -957,7 +957,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 806C0CD0-806C1208 002470 0538+00 1/1 0/0 0/0 .text create__8daE_FZ_cFv */ s32 daE_FZ_c::create() { - fopAcM_SetupActor(this,daE_FZ_c); + fopAcM_ct(this,daE_FZ_c); s32 phase = dComIfG_resLoad(&mPhaseReq,"E_FZ"); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_ga.cpp b/src/d/actor/d_a_e_ga.cpp index 7f6d17d02ac..0b253dc9cc9 100644 --- a/src/d/actor/d_a_e_ga.cpp +++ b/src/d/actor/d_a_e_ga.cpp @@ -205,7 +205,7 @@ static int daE_Ga_Create(fopAc_ac_c* i_this) { static const int l_bmdidx[] = {3}; e_ga_class* a_this = (e_ga_class*)i_this; - fopAcM_SetupActor(i_this, e_ga_class); + fopAcM_ct(i_this, e_ga_class); int phase_state = dComIfG_resLoad(&a_this->phase, "E_Ga"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_gb.cpp b/src/d/actor/d_a_e_gb.cpp index 781b0b55065..a4a2057e760 100644 --- a/src/d/actor/d_a_e_gb.cpp +++ b/src/d/actor/d_a_e_gb.cpp @@ -1608,7 +1608,7 @@ static cPhs__Step daE_GB_Create(fopAc_ac_c* a_this) { }; e_gb_class* i_this = (e_gb_class*)a_this; - fopAcM_SetupActor(a_this, e_gb_class); + fopAcM_ct(a_this, e_gb_class); cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&i_this->mPhase, "E_gb"); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_ge.cpp b/src/d/actor/d_a_e_ge.cpp index 8a880532034..68203511b91 100644 --- a/src/d/actor/d_a_e_ge.cpp +++ b/src/d/actor/d_a_e_ge.cpp @@ -1335,7 +1335,7 @@ int daE_GE_c::create() { } // mSphAttr }; - fopAcM_SetupActor(this, daE_GE_c); + fopAcM_ct(this, daE_GE_c); mSwitch = fopAcM_GetParam(this) >> 8; if (mSwitch != 0xFF && dComIfGs_isSwitch(mSwitch, fopAcM_GetRoomNo(this))) { diff --git a/src/d/actor/d_a_e_gi.cpp b/src/d/actor/d_a_e_gi.cpp index 5094e8297c9..180700e6d3c 100644 --- a/src/d/actor/d_a_e_gi.cpp +++ b/src/d/actor/d_a_e_gi.cpp @@ -1058,7 +1058,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 806D027C-806D0608 002EDC 038C+00 1/1 0/0 0/1 .text create__8daE_GI_cFv */ int daE_GI_c::create() { - fopAcM_SetupActor(this, daE_GI_c); + fopAcM_ct(this, daE_GI_c); OS_REPORT("E_GI PARAM %x\n", fopAcM_GetParam(this)); mSwbit = fopAcM_GetParam(this); diff --git a/src/d/actor/d_a_e_gm.cpp b/src/d/actor/d_a_e_gm.cpp index 7c98ce671d4..2259c2a02e8 100644 --- a/src/d/actor/d_a_e_gm.cpp +++ b/src/d/actor/d_a_e_gm.cpp @@ -1759,7 +1759,7 @@ static u16 const l_heapsize[4] = { /* 806D6CF0-806D71F4 005B70 0504+00 1/1 0/0 0/0 .text create__8daE_GM_cFv */ cPhs__Step daE_GM_c::create() { - fopAcM_SetupActor(this, daE_GM_c); + fopAcM_ct(this, daE_GM_c); mType = fopAcM_GetParam(this); if (mType == 0xFF) { diff --git a/src/d/actor/d_a_e_gob.cpp b/src/d/actor/d_a_e_gob.cpp index 64c9c80e65e..1fdd6eee1c7 100644 --- a/src/d/actor/d_a_e_gob.cpp +++ b/src/d/actor/d_a_e_gob.cpp @@ -2300,7 +2300,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 806DE69C-806DEA10 0066FC 0374+00 1/0 0/0 0/0 .text daE_GOB_Create__FP10fopAc_ac_c */ static int daE_GOB_Create(fopAc_ac_c* i_this) { e_gob_class* a_this = (e_gob_class*)i_this; - fopAcM_SetupActor(a_this, e_gob_class); + fopAcM_ct(a_this, e_gob_class); OS_REPORT("E_GOB//////////////E_GOB SET 0 !!\n"); diff --git a/src/d/actor/d_a_e_gs.cpp b/src/d/actor/d_a_e_gs.cpp index e6878a35e8a..ff269705a51 100644 --- a/src/d/actor/d_a_e_gs.cpp +++ b/src/d/actor/d_a_e_gs.cpp @@ -200,7 +200,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 806DFC00-806DFD5C 000880 015C+00 1/0 0/0 0/0 .text daE_GS_Create__FP10fopAc_ac_c */ static int daE_GS_Create(fopAc_ac_c* i_this) { e_gs_class* a_this = (e_gs_class*)i_this; - fopAcM_SetupActor(i_this, e_gs_class); + fopAcM_ct(i_this, e_gs_class); int phase_state = dComIfG_resLoad(&a_this->phase, "E_gs"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_hb.cpp b/src/d/actor/d_a_e_hb.cpp index 99e27d1c175..f9afb696177 100644 --- a/src/d/actor/d_a_e_hb.cpp +++ b/src/d/actor/d_a_e_hb.cpp @@ -1403,7 +1403,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 804FFD60-80500264 0040E0 0504+00 1/0 0/0 0/0 .text daE_HB_Create__FP10fopAc_ac_c */ static int daE_HB_Create(fopAc_ac_c* i_this) { e_hb_class* a_this = (e_hb_class*)i_this; - fopAcM_SetupActor(i_this, e_hb_class); + fopAcM_ct(i_this, e_hb_class); int phase_state = dComIfG_resLoad(&a_this->phase, "E_hb"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_hb_leaf.cpp b/src/d/actor/d_a_e_hb_leaf.cpp index 35ffe0e7af9..2ef3b9f35b2 100644 --- a/src/d/actor/d_a_e_hb_leaf.cpp +++ b/src/d/actor/d_a_e_hb_leaf.cpp @@ -67,7 +67,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { */ static int daE_HB_LEAF_Create(fopAc_ac_c* i_this) { e_hb_leaf_class* a_this = static_cast(i_this); - fopAcM_SetupActor(a_this, e_hb_leaf_class); + fopAcM_ct(a_this, e_hb_leaf_class); int phase_state = dComIfG_resLoad(&a_this->mPhase, "E_HB"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_hp.cpp b/src/d/actor/d_a_e_hp.cpp index 11897fa65ca..78a9362f393 100644 --- a/src/d/actor/d_a_e_hp.cpp +++ b/src/d/actor/d_a_e_hp.cpp @@ -1213,7 +1213,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 806E951C-806E9900 00381C 03E4+00 1/1 0/0 0/0 .text create__8daE_HP_cFv */ int daE_HP_c::create() { - fopAcM_SetupActor(this, daE_HP_c); + fopAcM_ct(this, daE_HP_c); s32 loadResult = dComIfG_resLoad(&mPhaseReq, "E_HP"); if (loadResult == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_hz.cpp b/src/d/actor/d_a_e_hz.cpp index 7dd1bdf6871..32f9f3eba79 100644 --- a/src/d/actor/d_a_e_hz.cpp +++ b/src/d/actor/d_a_e_hz.cpp @@ -2011,7 +2011,7 @@ int daE_HZ_c::create() { } // mSphAttr }; - fopAcM_SetupActor(this, daE_HZ_c); + fopAcM_ct(this, daE_HZ_c); dKy_tevstr_init(&mTevStr, home.roomNo, 0xFF); diff --git a/src/d/actor/d_a_e_hzelda.cpp b/src/d/actor/d_a_e_hzelda.cpp index d88081638fd..25eca4ea3ca 100644 --- a/src/d/actor/d_a_e_hzelda.cpp +++ b/src/d/actor/d_a_e_hzelda.cpp @@ -1395,7 +1395,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { */ static int daE_HZELDA_Create(fopAc_ac_c* i_this) { e_hzelda_class* a_this = (e_hzelda_class*)i_this; - fopAcM_SetupActor(a_this, e_hzelda_class); + fopAcM_ct(a_this, e_hzelda_class); int phase_state = dComIfG_resLoad(&a_this->mPhase, "Hzelda"); a_this->mPrm0 = fopAcM_GetParam(i_this); diff --git a/src/d/actor/d_a_e_is.cpp b/src/d/actor/d_a_e_is.cpp index 6bb86720504..73b067ef51b 100644 --- a/src/d/actor/d_a_e_is.cpp +++ b/src/d/actor/d_a_e_is.cpp @@ -652,7 +652,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 806F736C-806F76B4 001A0C 0348+00 1/0 0/0 0/0 .text daE_IS_Create__FP10fopAc_ac_c */ static int daE_IS_Create(fopAc_ac_c* i_this) { e_is_class* a_this = (e_is_class*)i_this; - fopAcM_SetupActor(i_this, e_is_class); + fopAcM_ct(i_this, e_is_class); int phase_state = dComIfG_resLoad(&a_this->phase, "E_IS"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_kg.cpp b/src/d/actor/d_a_e_kg.cpp index 5520ea1a187..c038b177bcb 100644 --- a/src/d/actor/d_a_e_kg.cpp +++ b/src/d/actor/d_a_e_kg.cpp @@ -710,7 +710,7 @@ static int daE_KG_Create(fopAc_ac_c* i_this) { } // mSphAttr }; - fopAcM_SetupActor(i_this, e_kg_class); + fopAcM_ct(i_this, e_kg_class); e_kg_class* a_this = (e_kg_class*) i_this; int phase = dComIfG_resLoad(&a_this->mPhase, "E_kg"); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_kk.cpp b/src/d/actor/d_a_e_kk.cpp index 18d12d4fce5..d0bcb744a7e 100644 --- a/src/d/actor/d_a_e_kk.cpp +++ b/src/d/actor/d_a_e_kk.cpp @@ -1398,7 +1398,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 806FE6B8-806FED20 004098 0668+00 1/1 0/0 0/0 .text create__8daE_KK_cFv */ int daE_KK_c::create() { - fopAcM_SetupActor(this, daE_KK_c); + fopAcM_ct(this, daE_KK_c); int phase_state = dComIfG_resLoad(&mPhaseReq, "E_KK"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_kr.cpp b/src/d/actor/d_a_e_kr.cpp index 662199050b6..8566cf877fd 100644 --- a/src/d/actor/d_a_e_kr.cpp +++ b/src/d/actor/d_a_e_kr.cpp @@ -2324,7 +2324,7 @@ static int daE_Kr_Create(fopAc_ac_c* i_this) { e_kr_class* kr = (e_kr_class*)i_this; s32 loadResult = dComIfG_resLoad(&kr->mPhase, "E_kr"); - fopAcM_SetupActor(i_this, e_kr_class); + fopAcM_ct(i_this, e_kr_class); if (loadResult == cPhs_COMPLEATE_e) { OS_REPORT("PARAM %x\n", fopAcM_GetParam(i_this)); diff --git a/src/d/actor/d_a_e_mb.cpp b/src/d/actor/d_a_e_mb.cpp index a833f432b4e..4b4cd39d2b3 100644 --- a/src/d/actor/d_a_e_mb.cpp +++ b/src/d/actor/d_a_e_mb.cpp @@ -702,7 +702,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 80708584-8070879C 002504 0218+00 1/0 0/0 0/0 .text daE_MB_Create__FP10fopAc_ac_c */ static int daE_MB_Create(fopAc_ac_c* i_this) { e_mb_class* a_this = (e_mb_class*)i_this; - fopAcM_SetupActor(a_this, e_mb_class); + fopAcM_ct(a_this, e_mb_class); int phase_state = dComIfG_resLoad(&a_this->mPhase, "E_mb"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_md.cpp b/src/d/actor/d_a_e_md.cpp index f262de43100..6475b034831 100644 --- a/src/d/actor/d_a_e_md.cpp +++ b/src/d/actor/d_a_e_md.cpp @@ -403,7 +403,7 @@ static int daE_MD_Execute(daE_MD_c* i_this) { /* 8070A044-8070A3CC 0012C4 0388+00 1/1 0/0 0/0 .text create__8daE_MD_cFv */ int daE_MD_c::create() { - fopAcM_SetupActor(this, daE_MD_c); + fopAcM_ct(this, daE_MD_c); int phase_state = dComIfG_resLoad(&mPhase, "E_MD"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_mf.cpp b/src/d/actor/d_a_e_mf.cpp index cb8f610ce04..903033a969d 100644 --- a/src/d/actor/d_a_e_mf.cpp +++ b/src/d/actor/d_a_e_mf.cpp @@ -3193,7 +3193,7 @@ static int useHeapInit(fopAc_ac_c* a_this) { static cPhs__Step daE_MF_Create(fopAc_ac_c* a_this) { e_mf_class* i_this = (e_mf_class*)a_this; - fopAcM_SetupActor(a_this, e_mf_class); + fopAcM_ct(a_this, e_mf_class); cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&i_this->mPhase, "E_mf"); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_mk.cpp b/src/d/actor/d_a_e_mk.cpp index 528d8457534..4f44dbd124e 100644 --- a/src/d/actor/d_a_e_mk.cpp +++ b/src/d/actor/d_a_e_mk.cpp @@ -2798,7 +2798,7 @@ static int daE_MK_Create(fopAc_ac_c* i_actor) { e_mk_class* mk = (e_mk_class*)i_actor; - fopAcM_SetupActor(&mk->enemy, e_mk_class); + fopAcM_ct(&mk->enemy, e_mk_class); int phase = dComIfG_resLoad(&mk->mPhase, "E_mk"); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_mk_bo.cpp b/src/d/actor/d_a_e_mk_bo.cpp index 2bcf8249606..f0c6ceffebd 100644 --- a/src/d/actor/d_a_e_mk_bo.cpp +++ b/src/d/actor/d_a_e_mk_bo.cpp @@ -761,7 +761,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 8071F168-8071F3D0 002568 0268+00 1/0 0/0 0/0 .text daE_MK_BO_Create__FP10fopAc_ac_c */ static int daE_MK_BO_Create(fopAc_ac_c* i_this) { e_mk_bo_class* a_this = (e_mk_bo_class*)i_this; - fopAcM_SetupActor(i_this, e_mk_bo_class); + fopAcM_ct(i_this, e_mk_bo_class); int phase_state = dComIfG_resLoad(&a_this->phase, "E_mk"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_mm.cpp b/src/d/actor/d_a_e_mm.cpp index 41192eb68b2..39cc112e1c3 100644 --- a/src/d/actor/d_a_e_mm.cpp +++ b/src/d/actor/d_a_e_mm.cpp @@ -1052,7 +1052,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 8072218C-8072256C 0028AC 03E0+00 1/0 0/0 0/0 .text daE_MM_Create__FP10fopAc_ac_c */ static int daE_MM_Create(fopAc_ac_c* actor) { - fopAcM_SetupActor(actor, e_mm_class); + fopAcM_ct(actor, e_mm_class); e_mm_class* i_this = (e_mm_class*)actor; int phase_state = dComIfG_resLoad(&i_this->phase, "E_MM"); diff --git a/src/d/actor/d_a_e_ms.cpp b/src/d/actor/d_a_e_ms.cpp index ac6f942456b..9c70d4e5029 100644 --- a/src/d/actor/d_a_e_ms.cpp +++ b/src/d/actor/d_a_e_ms.cpp @@ -1029,7 +1029,7 @@ static int daE_MS_Create(fopAc_ac_c* actor) { e_ms_class* i_this = (e_ms_class*)actor; - fopAcM_SetupActor(i_this, e_ms_class); + fopAcM_ct(i_this, e_ms_class); int phase = dComIfG_resLoad(&i_this->mPhaseReq, "E_MS"); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_nest.cpp b/src/d/actor/d_a_e_nest.cpp index 6c2bb01c872..9a81c1c7f25 100644 --- a/src/d/actor/d_a_e_nest.cpp +++ b/src/d/actor/d_a_e_nest.cpp @@ -989,7 +989,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 80503FCC-805044AC 00312C 04E0+00 1/0 0/0 0/0 .text daE_Nest_Create__FP10fopAc_ac_c */ static cPhs__Step daE_Nest_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, e_nest_class); + fopAcM_ct(i_this, e_nest_class); e_nest_class* _this = static_cast(i_this); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&_this->mPhase, "E_nest"); diff --git a/src/d/actor/d_a_e_nz.cpp b/src/d/actor/d_a_e_nz.cpp index f0505c12c25..487b69f71d6 100644 --- a/src/d/actor/d_a_e_nz.cpp +++ b/src/d/actor/d_a_e_nz.cpp @@ -704,7 +704,7 @@ static int useHeapInit(fopAc_ac_c* a_this) { /* 8072B7C4-8072BA74 001EC4 02B0+00 1/0 0/0 0/0 .text daE_NZ_Create__FP10fopAc_ac_c */ static int daE_NZ_Create(fopAc_ac_c* a_this) { e_nz_class* i_this = (e_nz_class*)a_this; - fopAcM_SetupActor(a_this, e_nz_class); + fopAcM_ct(a_this, e_nz_class); int phase = dComIfG_resLoad(&i_this->mPhase, "E_NZ"); if (phase == cPhs_COMPLEATE_e) { OS_REPORT("E_NZ PARAM %x\n", fopAcM_GetParam(a_this)); diff --git a/src/d/actor/d_a_e_oc.cpp b/src/d/actor/d_a_e_oc.cpp index 30a1d0d5319..a92b3ad77e9 100644 --- a/src/d/actor/d_a_e_oc.cpp +++ b/src/d/actor/d_a_e_oc.cpp @@ -2509,7 +2509,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 80734DA8-807352AC 0088C8 0504+00 1/1 0/0 0/0 .text create__8daE_OC_cFv */ cPhs__Step daE_OC_c::create() { - fopAcM_SetupActor(this, daE_OC_c); + fopAcM_ct(this, daE_OC_c); field_0x6b4 = fopAcM_GetParam(this) & 0xff; if (field_0x6b4 == 0xff) { field_0x6b4 = 0; diff --git a/src/d/actor/d_a_e_oct_bg.cpp b/src/d/actor/d_a_e_oct_bg.cpp index 49bf54634d2..a8121ab0108 100644 --- a/src/d/actor/d_a_e_oct_bg.cpp +++ b/src/d/actor/d_a_e_oct_bg.cpp @@ -832,7 +832,7 @@ int daE_OctBg_c::CreateHeap() { /* 80739424-807397B8 003304 0394+00 1/1 0/0 0/0 .text create__11daE_OctBg_cFv */ int daE_OctBg_c::create() { - fopAcM_SetupActor(this, daE_OctBg_c); + fopAcM_ct(this, daE_OctBg_c); int rv = dComIfG_resLoad(&mPhase, "E_bg"); if (rv == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_ot.cpp b/src/d/actor/d_a_e_ot.cpp index 5df9ad2008f..e640d33f570 100644 --- a/src/d/actor/d_a_e_ot.cpp +++ b/src/d/actor/d_a_e_ot.cpp @@ -784,7 +784,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 8073C31C-8073C77C 00213C 0460+00 1/1 0/0 0/0 .text create__8daE_OT_cFv */ cPhs__Step daE_OT_c::create() { - fopAcM_SetupActor(this, daE_OT_c); + fopAcM_ct(this, daE_OT_c); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhase, "E_OT"); if (step == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_ph.cpp b/src/d/actor/d_a_e_ph.cpp index 6795d0cfa5b..4da2d26538b 100644 --- a/src/d/actor/d_a_e_ph.cpp +++ b/src/d/actor/d_a_e_ph.cpp @@ -1199,7 +1199,7 @@ static int daE_PH_Execute(daE_PH_c* i_this) { /* 80741428-80741A44 0040C8 061C+00 1/1 0/0 0/0 .text create__8daE_PH_cFv */ int daE_PH_c::create() { - fopAcM_SetupActor(this, daE_PH_c); + fopAcM_ct(this, daE_PH_c); int phase_state = dComIfG_resLoad(&mPhase, "E_PH"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_pm.cpp b/src/d/actor/d_a_e_pm.cpp index d4783fedada..640032cf9f5 100644 --- a/src/d/actor/d_a_e_pm.cpp +++ b/src/d/actor/d_a_e_pm.cpp @@ -2868,7 +2868,7 @@ void daE_PM_c::SkipChk() { /* 8074B4DC-8074B834 0096DC 0358+00 1/1 0/0 0/0 .text Create__8daE_PM_cFv */ cPhs__Step daE_PM_c::Create() { - fopAcM_SetupActor(this, daE_PM_c); + fopAcM_ct(this, daE_PM_c); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhase, "E_PM"); if (step == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_po.cpp b/src/d/actor/d_a_e_po.cpp index afe1621ec12..ba04f098ab5 100644 --- a/src/d/actor/d_a_e_po.cpp +++ b/src/d/actor/d_a_e_po.cpp @@ -2909,7 +2909,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 80756020-80756900 009BC0 08E0+00 1/0 0/0 0/0 .text daE_PO_Create__FP10fopAc_ac_c */ static int daE_PO_Create(fopAc_ac_c* i_act_this) { e_po_class* i_this = (e_po_class*)i_act_this; - fopAcM_SetupActor(i_act_this, e_po_class); + fopAcM_ct(i_act_this, e_po_class); int phase_state = dComIfG_resLoad(&i_this->mPhase, "E_PO"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_pz.cpp b/src/d/actor/d_a_e_pz.cpp index 60e05c4327b..8ca58707f60 100644 --- a/src/d/actor/d_a_e_pz.cpp +++ b/src/d/actor/d_a_e_pz.cpp @@ -2512,7 +2512,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 8076010C-807607EC 007C8C 06E0+00 1/1 0/0 0/0 .text create__8daE_PZ_cFv */ int daE_PZ_c::create() { - fopAcM_SetupActor(this, daE_PZ_c); + fopAcM_ct(this, daE_PZ_c); int phase_state = dComIfG_resLoad(&mPhase, "E_PZ"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_rb.cpp b/src/d/actor/d_a_e_rb.cpp index 7d9e534de7f..f8057677f06 100644 --- a/src/d/actor/d_a_e_rb.cpp +++ b/src/d/actor/d_a_e_rb.cpp @@ -790,7 +790,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 8076424C-80764624 001FAC 03D8+00 1/0 0/0 0/0 .text daE_RB_Create__FP10fopAc_ac_c */ static int daE_RB_Create(fopAc_ac_c* i_this) { e_rb_class* a_this = (e_rb_class*)i_this; - fopAcM_SetupActor(i_this, e_rb_class); + fopAcM_ct(i_this, e_rb_class); int phase_state = dComIfG_resLoad(&a_this->phase, "E_rb"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_rd.cpp b/src/d/actor/d_a_e_rd.cpp index cf02587932f..a093feac269 100644 --- a/src/d/actor/d_a_e_rd.cpp +++ b/src/d/actor/d_a_e_rd.cpp @@ -7165,7 +7165,7 @@ static int useHeapInit(fopAc_ac_c* a_this) { static cPhs__Step daE_RD_Create(fopAc_ac_c* a_this) { e_rd_class* i_this = (e_rd_class*)a_this; - fopAcM_SetupActor(a_this, e_rd_class); + fopAcM_ct(a_this, e_rd_class); i_this->field_0x5b6 = fopAcM_GetParam(a_this); i_this->field_0x5b7 = i_this->field_0x5b6; diff --git a/src/d/actor/d_a_e_rdb.cpp b/src/d/actor/d_a_e_rdb.cpp index ae996c85875..28cea25602c 100644 --- a/src/d/actor/d_a_e_rdb.cpp +++ b/src/d/actor/d_a_e_rdb.cpp @@ -1850,7 +1850,7 @@ static int daE_RDB_Create(fopAc_ac_c* actor) { }; e_rdb_class* i_this = (e_rdb_class*)actor; - fopAcM_SetupActor(actor, e_rdb_class); + fopAcM_ct(actor, e_rdb_class); int phase = dComIfG_resLoad(&i_this->mPhase, "E_rdb"); i_this->field_0x5b6 = fopAcM_GetParam(actor); diff --git a/src/d/actor/d_a_e_rdy.cpp b/src/d/actor/d_a_e_rdy.cpp index 4c9fc92300d..eb81681b741 100644 --- a/src/d/actor/d_a_e_rdy.cpp +++ b/src/d/actor/d_a_e_rdy.cpp @@ -4873,7 +4873,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 80778D90-80779340 00D0B0 05B0+00 1/0 0/0 0/0 .text daE_RDY_Create__FP10fopAc_ac_c */ static cPhs__Step daE_RDY_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, e_rdy_class); + fopAcM_ct(i_this, e_rdy_class); e_rdy_class* _this = (e_rdy_class*)i_this; _this->field_0x5b6 = fopAcM_GetParam(_this) & 0xff; diff --git a/src/d/actor/d_a_e_s1.cpp b/src/d/actor/d_a_e_s1.cpp index 51da7d25998..2066bebda6e 100644 --- a/src/d/actor/d_a_e_s1.cpp +++ b/src/d/actor/d_a_e_s1.cpp @@ -2128,7 +2128,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 8077FE38-807803F4 005398 05BC+00 1/0 0/0 0/0 .text daE_S1_Create__FP10fopAc_ac_c */ static int daE_S1_Create(fopAc_ac_c* i_this) { e_s1_class* a_this = (e_s1_class*)i_this; - fopAcM_SetupActor(a_this, e_s1_class); + fopAcM_ct(a_this, e_s1_class); int phase_state = dComIfG_resLoad(&a_this->mPhase, "E_S2"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_sb.cpp b/src/d/actor/d_a_e_sb.cpp index 7ec5e014847..8a6d8f81d54 100644 --- a/src/d/actor/d_a_e_sb.cpp +++ b/src/d/actor/d_a_e_sb.cpp @@ -1149,7 +1149,7 @@ static int daE_SB_Delete(daE_SB_c* i_this) { /* 80784720-80784B58 0031C0 0438+00 1/1 0/0 0/0 .text Create__8daE_SB_cFv */ cPhs__Step daE_SB_c::Create() { - fopAcM_SetupActor(this, daE_SB_c); + fopAcM_ct(this, daE_SB_c); cPhs__Step phase = (cPhs__Step) dComIfG_resLoad(&mPhaseReq, "E_SB"); if (phase == cPhs_COMPLEATE_e) { field_0x61a = fopAcM_GetParam(this); diff --git a/src/d/actor/d_a_e_sf.cpp b/src/d/actor/d_a_e_sf.cpp index 7b5c42b3750..a493f946ce1 100644 --- a/src/d/actor/d_a_e_sf.cpp +++ b/src/d/actor/d_a_e_sf.cpp @@ -1775,7 +1775,7 @@ static int useHeapInit(fopAc_ac_c* a_this) { /* 80788F88-80789418 003F48 0490+00 1/0 0/0 0/0 .text daE_SF_Create__FP10fopAc_ac_c */ static cPhs__Step daE_SF_Create(fopAc_ac_c* a_this) { e_sf_class* i_this = (e_sf_class*)a_this; - fopAcM_SetupActor(a_this, e_sf_class); + fopAcM_ct(a_this, e_sf_class); cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&i_this->mPhase, "E_sf"); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_sg.cpp b/src/d/actor/d_a_e_sg.cpp index ba33acf40c0..dc8f4f70671 100644 --- a/src/d/actor/d_a_e_sg.cpp +++ b/src/d/actor/d_a_e_sg.cpp @@ -1200,7 +1200,7 @@ static int daE_SG_Create(fopAc_ac_c* i_this) { }; e_sg_class* a_this = static_cast(i_this); - fopAcM_SetupActor(i_this, e_sg_class); + fopAcM_ct(i_this, e_sg_class); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&a_this->mPhaseReq, "E_sg"); diff --git a/src/d/actor/d_a_e_sm.cpp b/src/d/actor/d_a_e_sm.cpp index 3f12f8e8bc7..cdd670aefb9 100644 --- a/src/d/actor/d_a_e_sm.cpp +++ b/src/d/actor/d_a_e_sm.cpp @@ -1951,7 +1951,7 @@ void daE_SM_c::initCoSph() { /* 80797858-80797CE0 005718 0488+00 1/1 0/0 0/0 .text Create__8daE_SM_cFv */ cPhs__Step daE_SM_c::Create() { - fopAcM_SetupActor(this, daE_SM_c); + fopAcM_ct(this, daE_SM_c); cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&mPhase, "E_SM"); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_sm2.cpp b/src/d/actor/d_a_e_sm2.cpp index 5e026f38ed7..dab6159c33f 100644 --- a/src/d/actor/d_a_e_sm2.cpp +++ b/src/d/actor/d_a_e_sm2.cpp @@ -1462,7 +1462,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 8079C480-8079CB28 003A20 06A8+00 1/0 0/0 0/0 .text daE_SM2_Create__FP10fopAc_ac_c */ static int daE_SM2_Create(fopAc_ac_c* i_this) { e_sm2_class* a_this = (e_sm2_class*)i_this; - fopAcM_SetupActor(i_this, e_sm2_class); + fopAcM_ct(i_this, e_sm2_class); OS_REPORT("E_SM2//////////////E_SM2 SET 0 !!\n"); diff --git a/src/d/actor/d_a_e_st.cpp b/src/d/actor/d_a_e_st.cpp index 06fdc9b373a..2839e5322af 100644 --- a/src/d/actor/d_a_e_st.cpp +++ b/src/d/actor/d_a_e_st.cpp @@ -3023,7 +3023,7 @@ static BOOL roof_initial_pos_set(e_st_class* i_this) { /* 807A586C-807A5CF4 007B6C 0488+00 1/0 0/0 0/0 .text daE_ST_Create__FP10fopAc_ac_c */ static cPhs__Step daE_ST_Create(fopAc_ac_c* a_this) { e_st_class* i_this = (e_st_class*)a_this; - fopAcM_SetupActor(a_this, e_st_class); + fopAcM_ct(a_this, e_st_class); cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&i_this->mPhase, "E_st"); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_st_line.cpp b/src/d/actor/d_a_e_st_line.cpp index 03ee8e4b167..f451f4d81dd 100644 --- a/src/d/actor/d_a_e_st_line.cpp +++ b/src/d/actor/d_a_e_st_line.cpp @@ -94,7 +94,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 807A707C-807A7220 00019C 01A4+00 1/0 0/0 0/0 .text daE_ST_LINE_Create__FP10fopAc_ac_c */ static int daE_ST_LINE_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, e_st_line_class); + fopAcM_ct(i_this, e_st_line_class); e_st_line_class* a_this = (e_st_line_class*)i_this; int phase_state = dComIfG_resLoad(&a_this->mPhase, "E_st"); diff --git a/src/d/actor/d_a_e_sw.cpp b/src/d/actor/d_a_e_sw.cpp index 9028a4f3714..48344213993 100644 --- a/src/d/actor/d_a_e_sw.cpp +++ b/src/d/actor/d_a_e_sw.cpp @@ -1693,7 +1693,7 @@ static int useHeapInit(fopAc_ac_c* a_this) { /* 807AC31C-807AC854 004FFC 0538+00 1/1 0/0 0/0 .text create__8daE_SW_cFv */ cPhs__Step daE_SW_c::create() { - fopAcM_SetupActor(this, daE_SW_c); + fopAcM_ct(this, daE_SW_c); field_0x68c = fopAcM_GetParam(this) & 15; if (field_0x68c == 15) { diff --git a/src/d/actor/d_a_e_th.cpp b/src/d/actor/d_a_e_th.cpp index a0b579e36c4..a0c9040dc6f 100644 --- a/src/d/actor/d_a_e_th.cpp +++ b/src/d/actor/d_a_e_th.cpp @@ -1225,7 +1225,7 @@ static int useHeapInit(fopAc_ac_c* a_this) { /* 807B36D0-807B3B58 003430 0488+00 1/0 0/0 0/0 .text daE_TH_Create__FP10fopAc_ac_c */ static int daE_TH_Create(fopAc_ac_c* a_this) { e_th_class* i_this = (e_th_class*)a_this; - fopAcM_SetupActor(i_this, e_th_class); + fopAcM_ct(i_this, e_th_class); int phase_state = dComIfG_resLoad(&i_this->mPhase, "E_th"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_th_ball.cpp b/src/d/actor/d_a_e_th_ball.cpp index 6ced02308c5..a8c9456a1e5 100644 --- a/src/d/actor/d_a_e_th_ball.cpp +++ b/src/d/actor/d_a_e_th_ball.cpp @@ -1087,7 +1087,7 @@ static int useHeapInit(fopAc_ac_c* a_this) { */ static int daE_TH_BALL_Create(fopAc_ac_c* a_this) { e_th_ball_class* i_this = (e_th_ball_class*)a_this; - fopAcM_SetupActor(i_this, e_th_ball_class); + fopAcM_ct(i_this, e_th_ball_class); int phase_state = dComIfG_resLoad(&i_this->mPhase, "E_th_ball"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_tk.cpp b/src/d/actor/d_a_e_tk.cpp index 3206023da2f..639b5a91ced 100644 --- a/src/d/actor/d_a_e_tk.cpp +++ b/src/d/actor/d_a_e_tk.cpp @@ -710,7 +710,7 @@ static dCcD_SrcSph cc_sph_src = { /* 807B9DB8-807BA0C4 001CB8 030C+00 1/0 0/0 0/0 .text daE_TK_Create__FP10fopAc_ac_c */ static int daE_TK_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, e_tk_class); + fopAcM_ct(i_this, e_tk_class); e_tk_class* const a_this = static_cast(i_this); cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&a_this->mPhaseReq, "E_tk"); diff --git a/src/d/actor/d_a_e_tk2.cpp b/src/d/actor/d_a_e_tk2.cpp index a091086f2e4..c277d90ef1b 100644 --- a/src/d/actor/d_a_e_tk2.cpp +++ b/src/d/actor/d_a_e_tk2.cpp @@ -521,7 +521,7 @@ static dCcD_SrcSph cc_sph_src = { /* 807BB94C-807BBC00 0014CC 02B4+00 1/0 0/0 0/0 .text daE_TK2_Create__FP10fopAc_ac_c */ static int daE_TK2_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, e_tk2_class); + fopAcM_ct(i_this, e_tk2_class); e_tk2_class* a_this = static_cast(i_this); cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&a_this->mPhaseReq, "E_tk2"); diff --git a/src/d/actor/d_a_e_tk_ball.cpp b/src/d/actor/d_a_e_tk_ball.cpp index 97cff666a72..6a51dfe6b32 100644 --- a/src/d/actor/d_a_e_tk_ball.cpp +++ b/src/d/actor/d_a_e_tk_ball.cpp @@ -395,7 +395,7 @@ static int daE_TK_BALL_Create(fopAc_ac_c* i_this) { } // mSphAttr }; - fopAcM_SetupActor(i_this, e_tk_ball_class); + fopAcM_ct(i_this, e_tk_ball_class); e_tk_ball_class* a_this = static_cast(i_this); a_this->mType = fopAcM_GetParam(a_this); diff --git a/src/d/actor/d_a_e_vt.cpp b/src/d/actor/d_a_e_vt.cpp index 440a285b247..48af765ccd3 100644 --- a/src/d/actor/d_a_e_vt.cpp +++ b/src/d/actor/d_a_e_vt.cpp @@ -3857,7 +3857,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 807CD668-807CDAD8 00B168 0470+00 1/1 0/0 0/0 .text create__8daE_VA_cFv */ int daE_VA_c::create() { - fopAcM_SetupActor(this, daE_VA_c); + fopAcM_ct(this, daE_VA_c); int phase_state = dComIfG_resLoad(&mPhase, "E_VA"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_warpappear.cpp b/src/d/actor/d_a_e_warpappear.cpp index 416a0654718..72440680e7f 100644 --- a/src/d/actor/d_a_e_warpappear.cpp +++ b/src/d/actor/d_a_e_warpappear.cpp @@ -876,7 +876,7 @@ static int useHeapInit(fopAc_ac_c* actor) { /* 807D1F40-807D206C 0027E0 012C+00 1/0 0/0 0/0 .text daE_Warpappear_Create__FP10fopAc_ac_c */ static int daE_Warpappear_Create(fopAc_ac_c* actor) { - fopAcM_SetupActor(actor, e_warpappear_class); + fopAcM_ct(actor, e_warpappear_class); e_warpappear_class* i_this = (e_warpappear_class*)actor; int phase = dComIfG_resLoad(&i_this->mPhase, "Kytag04"); diff --git a/src/d/actor/d_a_e_wb.cpp b/src/d/actor/d_a_e_wb.cpp index a587121f7bd..504c007a55b 100644 --- a/src/d/actor/d_a_e_wb.cpp +++ b/src/d/actor/d_a_e_wb.cpp @@ -5628,7 +5628,7 @@ static int useHeapInit(fopAc_ac_c* a_this) { /* 807E13A8-807E1CB0 00F008 0908+00 1/0 0/0 0/0 .text daE_WB_Create__FP10fopAc_ac_c */ static int daE_WB_Create(fopAc_ac_c* a_this) { - fopAcM_SetupActor(a_this, e_wb_class); + fopAcM_ct(a_this, e_wb_class); e_wb_class* i_this = (e_wb_class*)a_this; OS_REPORT("//////////////E_WB SET 555 !!\n"); diff --git a/src/d/actor/d_a_e_ws.cpp b/src/d/actor/d_a_e_ws.cpp index ded83ae93e2..96a2d21e836 100644 --- a/src/d/actor/d_a_e_ws.cpp +++ b/src/d/actor/d_a_e_ws.cpp @@ -899,7 +899,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 807E6860-807E6C10 002F40 03B0+00 1/1 0/0 0/0 .text create__8daE_WS_cFv */ int daE_WS_c::create() { - fopAcM_SetupActor(this, daE_WS_c); + fopAcM_ct(this, daE_WS_c); int phase_state = dComIfG_resLoad(&mPhase, "E_WS"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_ww.cpp b/src/d/actor/d_a_e_ww.cpp index 7a053eeaea9..f58bf09765e 100644 --- a/src/d/actor/d_a_e_ww.cpp +++ b/src/d/actor/d_a_e_ww.cpp @@ -2224,7 +2224,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 807EE63C-807EEB38 00703C 04FC+00 1/1 0/0 0/0 .text create__8daE_WW_cFv */ int daE_WW_c::create() { - fopAcM_SetupActor(this, daE_WW_c); + fopAcM_ct(this, daE_WW_c); int phase_state = dComIfG_resLoad(&mPhase, "E_WW"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_yc.cpp b/src/d/actor/d_a_e_yc.cpp index ea9fef674d3..7e9ea8fd3b1 100644 --- a/src/d/actor/d_a_e_yc.cpp +++ b/src/d/actor/d_a_e_yc.cpp @@ -773,7 +773,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 807F239C-807F26BC 0025BC 0320+00 1/0 0/0 0/0 .text daE_YC_Create__FP10fopAc_ac_c */ static cPhs__Step daE_YC_Create(fopAc_ac_c* i_this) { e_yc_class* _this = static_cast(i_this); - fopAcM_SetupActor(i_this, e_yc_class); + fopAcM_ct(i_this, e_yc_class); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&_this->mPhase, "E_yc"); if (step == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_yd.cpp b/src/d/actor/d_a_e_yd.cpp index bd0b47a63dd..93ce6a1f28f 100644 --- a/src/d/actor/d_a_e_yd.cpp +++ b/src/d/actor/d_a_e_yd.cpp @@ -1407,7 +1407,7 @@ static int daE_YD_Create(fopAc_ac_c* i_this) { } // mSphAttr }; - fopAcM_SetupActor(i_this, e_yd_class); + fopAcM_ct(i_this, e_yd_class); e_yd_class* a_this = (e_yd_class*)i_this; s32 loadRv = dComIfG_resLoad(&a_this->field_0x5ac, "E_yd"); diff --git a/src/d/actor/d_a_e_yd_leaf.cpp b/src/d/actor/d_a_e_yd_leaf.cpp index 6d58e45c888..f3e017b1e84 100644 --- a/src/d/actor/d_a_e_yd_leaf.cpp +++ b/src/d/actor/d_a_e_yd_leaf.cpp @@ -74,7 +74,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { */ static int daE_YD_LEAF_Create(fopAc_ac_c* i_this) { e_yd_leaf_class* a_this = static_cast(i_this); - fopAcM_SetupActor(a_this, e_yd_leaf_class); + fopAcM_ct(a_this, e_yd_leaf_class); int phase_state = dComIfG_resLoad(&a_this->mPhase, "E_YD"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_yh.cpp b/src/d/actor/d_a_e_yh.cpp index dbaddcdf60d..783f4c3fae0 100644 --- a/src/d/actor/d_a_e_yh.cpp +++ b/src/d/actor/d_a_e_yh.cpp @@ -2151,7 +2151,7 @@ static int useHeapInit(fopAc_ac_c* a_this) { /* 808034BC-808039DC 0060DC 0520+00 1/0 0/0 0/0 .text daE_YH_Create__FP10fopAc_ac_c */ static int daE_YH_Create(fopAc_ac_c* a_this) { e_yh_class* i_this = (e_yh_class*)a_this; - fopAcM_SetupActor(a_this, e_yh_class); + fopAcM_ct(a_this, e_yh_class); int rv = dComIfG_resLoad(&i_this->mPhase, "E_yd"); if (rv == cPhs_COMPLEATE_e) { OS_REPORT("E_YH PARAM %x\n", fopAcM_GetParam(a_this)); diff --git a/src/d/actor/d_a_e_yk.cpp b/src/d/actor/d_a_e_yk.cpp index ce0d42ded75..80dadc62397 100644 --- a/src/d/actor/d_a_e_yk.cpp +++ b/src/d/actor/d_a_e_yk.cpp @@ -1474,7 +1474,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { */ /* 808071F4-808075CC 002AB4 03D8+00 1/0 0/0 0/0 .text daE_YK_Create__FP10fopAc_ac_c */ static int daE_YK_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, e_yk_class); + fopAcM_ct(i_this, e_yk_class); e_yk_class* yk = (e_yk_class*)i_this; int phase_step = dComIfG_resLoad(&yk->mPhase,"E_YK"); diff --git a/src/d/actor/d_a_e_ym.cpp b/src/d/actor/d_a_e_ym.cpp index 93edc7b188f..be48a338fa2 100644 --- a/src/d/actor/d_a_e_ym.cpp +++ b/src/d/actor/d_a_e_ym.cpp @@ -3410,7 +3410,7 @@ void daE_YM_c::setHideType() { /* 80814BA4-80815224 00CB64 0680+00 2/1 0/0 0/0 .text create__8daE_YM_cFv */ int daE_YM_c::create() { - fopAcM_SetupActor(this, daE_YM_c); + fopAcM_ct(this, daE_YM_c); mType = fopAcM_GetParam(this); if (mType == 0xFF) { diff --git a/src/d/actor/d_a_e_ym_tag.cpp b/src/d/actor/d_a_e_ym_tag.cpp index 6bfd9a471c0..67e961cccef 100644 --- a/src/d/actor/d_a_e_ym_tag.cpp +++ b/src/d/actor/d_a_e_ym_tag.cpp @@ -58,7 +58,7 @@ static int daE_YM_TAG_Delete(daE_YM_TAG_c* i_this) { /* 80815F28-80815F90 0001A8 0068+00 1/1 0/0 0/0 .text create__12daE_YM_TAG_cFv */ int daE_YM_TAG_c::create() { - fopAcM_SetupActor(this, daE_YM_TAG_c); + fopAcM_ct(this, daE_YM_TAG_c); if ((u8)fopAcM_GetParam(this) == 0xFF) { return cPhs_ERROR_e; } diff --git a/src/d/actor/d_a_e_ymb.cpp b/src/d/actor/d_a_e_ymb.cpp index 4d7faa4bc62..b06bc750230 100644 --- a/src/d/actor/d_a_e_ymb.cpp +++ b/src/d/actor/d_a_e_ymb.cpp @@ -3237,7 +3237,7 @@ static int useHeapInit(fopAc_ac_c* a_this) { /* 80820DD0-808211BC 00ADB0 03EC+00 1/1 0/0 0/0 .text create__9daE_YMB_cFv */ cPhs__Step daE_YMB_c::create() { - fopAcM_SetupActor(this, daE_YMB_c); + fopAcM_ct(this, daE_YMB_c); mSwitchBit = fopAcM_GetParam(this); if (mSwitchBit != 0xFF) { diff --git a/src/d/actor/d_a_e_yr.cpp b/src/d/actor/d_a_e_yr.cpp index 4a6061c5aad..0f525f7b9fb 100644 --- a/src/d/actor/d_a_e_yr.cpp +++ b/src/d/actor/d_a_e_yr.cpp @@ -2499,7 +2499,7 @@ static int daE_Yr_Create(fopAc_ac_c* i_this) { e_yr_class* yr = (e_yr_class*)i_this; s32 loadResult = dComIfG_resLoad(&yr->mPhaseReq, "E_Yr"); - fopAcM_SetupActor(i_this, e_yr_class); + fopAcM_ct(i_this, e_yr_class); if (loadResult == cPhs_COMPLEATE_e) { // "It won't reset because it's already been defeated" diff --git a/src/d/actor/d_a_e_zh.cpp b/src/d/actor/d_a_e_zh.cpp index ed2a4b2d46a..19fc8d2e47e 100644 --- a/src/d/actor/d_a_e_zh.cpp +++ b/src/d/actor/d_a_e_zh.cpp @@ -2209,7 +2209,7 @@ static int useHeapInit(fopAc_ac_c* a_this) { /* 8082E730-8082ECEC 0057F0 05BC+00 1/1 0/0 0/0 .text create__8daE_ZH_cFv */ cPhs__Step daE_ZH_c::create() { - fopAcM_SetupActor(this, daE_ZH_c); + fopAcM_ct(this, daE_ZH_c); cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&mPhase, "E_ZH"); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_zm.cpp b/src/d/actor/d_a_e_zm.cpp index 8c402943804..4eb53ab116d 100644 --- a/src/d/actor/d_a_e_zm.cpp +++ b/src/d/actor/d_a_e_zm.cpp @@ -933,7 +933,7 @@ static int useHeapInit(fopAc_ac_c* a_this) { /* 80832064-80832580 002804 051C+00 1/1 0/0 0/0 .text create__8daE_ZM_cFv */ cPhs__Step daE_ZM_c::create() { - fopAcM_SetupActor(this, daE_ZM_c); + fopAcM_ct(this, daE_ZM_c); cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&mPhase, "E_ZM"); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_e_zs.cpp b/src/d/actor/d_a_e_zs.cpp index 40c2b4e3352..343feda135f 100644 --- a/src/d/actor/d_a_e_zs.cpp +++ b/src/d/actor/d_a_e_zs.cpp @@ -531,7 +531,7 @@ static void useHeapInit(fopAc_ac_c* i_this) { /* 80834884-80834BA8 0018C4 0324+00 1/1 0/0 0/0 .text create__8daE_ZS_cFv */ int daE_ZS_c::create() { - fopAcM_SetupActor(this, daE_ZS_c); + fopAcM_ct(this, daE_ZS_c); int phase = dComIfG_resLoad(&mPhase, "E_ZS"); if (phase == cPhs_COMPLEATE_e) { OS_REPORT("E_ZS PARAM %x\n", fopAcM_GetParam(this)); diff --git a/src/d/actor/d_a_econt.cpp b/src/d/actor/d_a_econt.cpp index bc65ee45541..8044b25c1f5 100644 --- a/src/d/actor/d_a_econt.cpp +++ b/src/d/actor/d_a_econt.cpp @@ -72,7 +72,7 @@ static int daEcont_Delete(econt_class* i_this) { /* 805196E4-80519774 000244 0090+00 1/0 0/0 0/0 .text daEcont_Create__FP10fopAc_ac_c */ static int daEcont_Create(fopAc_ac_c* i_this) { econt_class* encounter = (econt_class*)i_this; - fopAcM_SetupActor(i_this, econt_class); + fopAcM_ct(i_this, econt_class); dTimer_createTimer(8,0x989298,2,0,210.0f,410.0f,32.0f,419.0f); encounter->field_0x5b8[0] = 0x14; return cPhs_COMPLEATE_e; diff --git a/src/d/actor/d_a_ep.cpp b/src/d/actor/d_a_ep.cpp index 9748a60b6e5..95dfb660aa9 100644 --- a/src/d/actor/d_a_ep.cpp +++ b/src/d/actor/d_a_ep.cpp @@ -900,7 +900,7 @@ static int daEp_Create(fopAc_ac_c* a_this) { int rv; ep_class* i_this = (ep_class*)a_this; - fopAcM_SetupActor(a_this, ep_class); + fopAcM_ct(a_this, ep_class); rv = dComIfG_resLoad(&i_this->mPhase, "Ep"); if (rv == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_formation_mng.cpp b/src/d/actor/d_a_formation_mng.cpp index d8472dd1ade..b17bf3e819f 100644 --- a/src/d/actor/d_a_formation_mng.cpp +++ b/src/d/actor/d_a_formation_mng.cpp @@ -365,7 +365,7 @@ static int daFmtMng_Create(fopAc_ac_c* param_0) { /* 808374B4-8083750C 001FD4 0058+00 1/1 0/0 0/0 .text create__10daFmtMng_cFv */ int daFmtMng_c::create() { - fopAcM_SetupActor(this, daFmtMng_c); + fopAcM_ct(this, daFmtMng_c); create_init(); return 4; } diff --git a/src/d/actor/d_a_fr.cpp b/src/d/actor/d_a_fr.cpp index 278c9f29b83..6b66c4c1c83 100644 --- a/src/d/actor/d_a_fr.cpp +++ b/src/d/actor/d_a_fr.cpp @@ -705,7 +705,7 @@ static BOOL useHeapIfrt(fopAc_ac_c* a_this) { static int daFr_Create(fopAc_ac_c* a_this) { fopAc_ac_c* actor = a_this; fr_class* i_this = (fr_class*)actor; - fopAcM_SetupActor(i_this, fr_class); + fopAcM_ct(i_this, fr_class); int phase_state = dComIfG_resLoad(&i_this->mPhase, "Fr"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_grass.cpp b/src/d/actor/d_a_grass.cpp index 0102c19c1f2..1a860135a1a 100644 --- a/src/d/actor/d_a_grass.cpp +++ b/src/d/actor/d_a_grass.cpp @@ -155,7 +155,7 @@ static void dGrass_Tex_Change() {} /* 8051C2B0-8051C304 000650 0054+00 1/0 0/0 0/0 .text daGrass_create__FP9daGrass_c */ static int daGrass_create(daGrass_c* i_this) { - fopAcM_SetupActor(i_this, daGrass_c); + fopAcM_ct(i_this, daGrass_c); return i_this->create(); } diff --git a/src/d/actor/d_a_hitobj.cpp b/src/d/actor/d_a_hitobj.cpp index cdddac5c797..a33609f94e0 100644 --- a/src/d/actor/d_a_hitobj.cpp +++ b/src/d/actor/d_a_hitobj.cpp @@ -60,7 +60,7 @@ static dCcD_SrcSph cc_sph_src = { /* 8046B400-8046B53C 000120 013C+00 1/0 0/0 0/0 .text daHitobj_Create__FP10fopAc_ac_c */ static int daHitobj_Create(fopAc_ac_c* i_this) { hitobj_class* hitobj = (hitobj_class*)i_this; - fopAcM_SetupActor(i_this, hitobj_class); + fopAcM_ct(i_this, hitobj_class); int ret = dComIfG_resLoad(&hitobj->mPhase,"Hitobj"); diff --git a/src/d/actor/d_a_horse.cpp b/src/d/actor/d_a_horse.cpp index c4f12697c7d..8aa8fbcfae4 100644 --- a/src/d/actor/d_a_horse.cpp +++ b/src/d/actor/d_a_horse.cpp @@ -586,7 +586,7 @@ BOOL daHorse_c::checkEnding() { /* 80839498-80839CFC 001658 0864+00 1/1 0/0 0/0 .text create__9daHorse_cFv */ int daHorse_c::create() { - fopAcM_SetupActor(this, daHorse_c); + fopAcM_ct(this, daHorse_c); if (checkEnding()) { onStateFlg0(FLG0_UNK_8000); diff --git a/src/d/actor/d_a_hozelda.cpp b/src/d/actor/d_a_hozelda.cpp index 8b71b28fc8a..88b834e39f2 100644 --- a/src/d/actor/d_a_hozelda.cpp +++ b/src/d/actor/d_a_hozelda.cpp @@ -208,7 +208,7 @@ static int daHoZelda_modelCallBack(J3DJoint* i_joint, int param_1) { /* 808469B0-80846C4C 000B90 029C+00 1/1 0/0 0/0 .text create__11daHoZelda_cFv */ int daHoZelda_c::create() { - fopAcM_SetupActor(this, daHoZelda_c); + fopAcM_ct(this, daHoZelda_c); int phase_state = dComIfG_resLoad(&mPhase, l_arcName); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_izumi_gate.cpp b/src/d/actor/d_a_izumi_gate.cpp index 8108785160e..3bf461af280 100644 --- a/src/d/actor/d_a_izumi_gate.cpp +++ b/src/d/actor/d_a_izumi_gate.cpp @@ -48,7 +48,7 @@ static char* l_arcName = "M_IzmGate"; /* 80849184-80849260 000164 00DC+00 1/0 0/0 0/0 .text daIzumiGate_Create__FP10fopAc_ac_c */ int daIzumiGate_c::create() { - fopAcM_SetupActor(this, daIzumiGate_c); + fopAcM_ct(this, daIzumiGate_c); int phase = dComIfG_resLoad(&mPhaseReq, l_arcName); if (phase == cPhs_COMPLEATE_e) { int objectName = dComIfG_getObjctResName2Index(l_arcName, "M_IzumiGate_b.dzb"); diff --git a/src/d/actor/d_a_kago.cpp b/src/d/actor/d_a_kago.cpp index 1dae0174ac1..35d50436e5a 100644 --- a/src/d/actor/d_a_kago.cpp +++ b/src/d/actor/d_a_kago.cpp @@ -3822,7 +3822,7 @@ static int useHeapInit(fopAc_ac_c* param_0) { /* 808544D8-80854928 00B018 0450+00 1/1 0/0 0/0 .text create__8daKago_cFv */ int daKago_c::create() { - fopAcM_SetupActor(this, daKago_c); + fopAcM_ct(this, daKago_c); u32 param = (u8)fopAcM_GetParam(this); if ((param & 0xff) != 0xff) { diff --git a/src/d/actor/d_a_kytag00.cpp b/src/d/actor/d_a_kytag00.cpp index c6c31ed9120..a60f4d3250d 100644 --- a/src/d/actor/d_a_kytag00.cpp +++ b/src/d/actor/d_a_kytag00.cpp @@ -432,7 +432,7 @@ static int daKytag00_Delete(kytag00_class* i_this) { /* 8046C7BC-8046C978 00111C 01BC+00 1/0 0/0 0/0 .text daKytag00_Create__FP10fopAc_ac_c */ static int daKytag00_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, kytag00_class); + fopAcM_ct(i_this, kytag00_class); kytag00_class* a_this = (kytag00_class*)i_this; a_this->field_0x56e = 0; diff --git a/src/d/actor/d_a_kytag01.cpp b/src/d/actor/d_a_kytag01.cpp index e084ba97dbb..18952c86bf5 100644 --- a/src/d/actor/d_a_kytag01.cpp +++ b/src/d/actor/d_a_kytag01.cpp @@ -176,7 +176,7 @@ static int daKytag01_Delete(kytag01_class* i_this) { /* 808557EC-80855984 00080C 0198+00 1/0 0/0 0/0 .text daKytag01_Create__FP10fopAc_ac_c */ static int daKytag01_Create(fopAc_ac_c* i_this) { kytag01_class* a_this = (kytag01_class*)i_this; - fopAcM_SetupActor(i_this, kytag01_class); + fopAcM_ct(i_this, kytag01_class); if ((a_this->argument & 0xFF) == 2) { a_this->mNamiInnerRange = i_this->scale.x * 100.0f; diff --git a/src/d/actor/d_a_kytag02.cpp b/src/d/actor/d_a_kytag02.cpp index 96cb3db3a5b..c5c458c2f1a 100644 --- a/src/d/actor/d_a_kytag02.cpp +++ b/src/d/actor/d_a_kytag02.cpp @@ -104,7 +104,7 @@ static int daKytag02_Create(fopAc_ac_c* i_this) { dScnKy_env_light_c* env_light = dKy_getEnvlight(); dKyw_get_wind_vec(); - fopAcM_SetupActor(i_this, kytag02_class); + fopAcM_ct(i_this, kytag02_class); kytag02_class* a_this = (kytag02_class*)i_this; a_this->field_0x574 = 0; diff --git a/src/d/actor/d_a_kytag03.cpp b/src/d/actor/d_a_kytag03.cpp index ef13866247a..018c74b7a9b 100644 --- a/src/d/actor/d_a_kytag03.cpp +++ b/src/d/actor/d_a_kytag03.cpp @@ -428,7 +428,7 @@ static int daKytag03_Delete(kytag03_class* i_this) { /* 80857470-80857648 001610 01D8+00 1/0 0/0 0/0 .text daKytag03_Create__FP10fopAc_ac_c */ static int daKytag03_Create(fopAc_ac_c* i_this) { kytag03_class* a_this = (kytag03_class*)i_this; - fopAcM_SetupActor(i_this, kytag03_class); + fopAcM_ct(i_this, kytag03_class); a_this->field_0x584 = (fopAcM_GetParam(i_this) >> 0x18) & 3; a_this->field_0x585 = fopAcM_GetParam(i_this); diff --git a/src/d/actor/d_a_kytag04.cpp b/src/d/actor/d_a_kytag04.cpp index 05268485e47..d813d7fd7ee 100644 --- a/src/d/actor/d_a_kytag04.cpp +++ b/src/d/actor/d_a_kytag04.cpp @@ -262,7 +262,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 8046D59C-8046D9C8 000ABC 042C+00 1/0 0/0 0/0 .text daKytag04_Create__FP10fopAc_ac_c */ static int daKytag04_Create(fopAc_ac_c* i_this) { kytag04_class* a_this = (kytag04_class*)i_this; - fopAcM_SetupActor(i_this, kytag04_class); + fopAcM_ct(i_this, kytag04_class); a_this->mNeedDropNum = i_this->current.angle.z & 0xFF; diff --git a/src/d/actor/d_a_kytag05.cpp b/src/d/actor/d_a_kytag05.cpp index c9e7ee8813b..e8f1bad2c59 100644 --- a/src/d/actor/d_a_kytag05.cpp +++ b/src/d/actor/d_a_kytag05.cpp @@ -32,7 +32,7 @@ static int daKytag05_Delete(kytag05_class* i_this) { /* 80528A78-80528B10 000098 0098+00 1/0 0/0 0/0 .text daKytag05_Create__FP10fopAc_ac_c */ static int daKytag05_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, kytag05_class); + fopAcM_ct(i_this, kytag05_class); kytag05_class* a_this = static_cast(i_this); a_this->field_0x56c = fopAcM_GetParam(a_this) >> 8; diff --git a/src/d/actor/d_a_kytag06.cpp b/src/d/actor/d_a_kytag06.cpp index e349f31d1b5..2493cd0b5b0 100644 --- a/src/d/actor/d_a_kytag06.cpp +++ b/src/d/actor/d_a_kytag06.cpp @@ -1153,7 +1153,7 @@ static void daKytag06_type03_init(fopAc_ac_c* i_this) { /* 80859C88-80859E68 002508 01E0+00 2/0 0/0 0/0 .text daKytag06_Create__FP10fopAc_ac_c */ static int daKytag06_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, kytag06_class); + fopAcM_ct(i_this, kytag06_class); kytag06_class* a_this = static_cast(i_this); a_this->mType = (fopAcM_GetParam(a_this) >> 0x18) & 0xF; diff --git a/src/d/actor/d_a_kytag07.cpp b/src/d/actor/d_a_kytag07.cpp index a0cfebe86ee..3414583a3a6 100644 --- a/src/d/actor/d_a_kytag07.cpp +++ b/src/d/actor/d_a_kytag07.cpp @@ -54,7 +54,7 @@ static int daKytag07_Delete(kytag07_class* i_this) { static int daKytag07_Create(fopAc_ac_c* i_this) { kytag07_class* a_this = (kytag07_class*)i_this; - fopAcM_SetupActor(a_this, kytag07_class); + fopAcM_ct(a_this, kytag07_class); a_this->mLightInfluence.mPosition = i_this->current.pos; a_this->mLightInfluence.mColor.r = fopAcM_GetParam(i_this) & 0xFF; diff --git a/src/d/actor/d_a_kytag08.cpp b/src/d/actor/d_a_kytag08.cpp index d99e2f7ff0c..a7ff80bff68 100644 --- a/src/d/actor/d_a_kytag08.cpp +++ b/src/d/actor/d_a_kytag08.cpp @@ -244,7 +244,7 @@ static int daKytag08_Create(fopAc_ac_c* i_this) { cXyz scale(1.0f, 1.0f, 1.0f); dScnKy_env_light_c* env_light = dKy_getEnvlight(); - fopAcM_SetupActor(a_this, kytag08_class); + fopAcM_ct(a_this, kytag08_class); int phase = dComIfG_resLoad(&a_this->mPhase, "Kytag08"); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_kytag09.cpp b/src/d/actor/d_a_kytag09.cpp index 32c3df7f940..16c8c9991ca 100644 --- a/src/d/actor/d_a_kytag09.cpp +++ b/src/d/actor/d_a_kytag09.cpp @@ -129,7 +129,7 @@ static int daKytag09_Create(fopAc_ac_c* i_this) { kytag09_class* a_this = (kytag09_class*)i_this; a_this->mType = fopAcM_GetParam(i_this) & 0xFF; - fopAcM_SetupActor(a_this, kytag09_class); + fopAcM_ct(a_this, kytag09_class); int phase; if (a_this->mType != 1) { diff --git a/src/d/actor/d_a_kytag10.cpp b/src/d/actor/d_a_kytag10.cpp index 23ab34dc63b..274906c2230 100644 --- a/src/d/actor/d_a_kytag10.cpp +++ b/src/d/actor/d_a_kytag10.cpp @@ -180,7 +180,7 @@ static int daKytag10_Delete(kytag10_class* i_this) { /* 80529248-805293F8 0006C8 01B0+00 1/0 0/0 0/0 .text daKytag10_Create__FP10fopAc_ac_c */ static int daKytag10_Create(fopAc_ac_c* i_this) { kytag10_class* a_this = (kytag10_class*)i_this; - fopAcM_SetupActor(i_this, kytag10_class); + fopAcM_ct(i_this, kytag10_class); u8 prm0 = fopAcM_GetParam(i_this); if (prm0 == 0xFF) { diff --git a/src/d/actor/d_a_kytag11.cpp b/src/d/actor/d_a_kytag11.cpp index eac590d8bdd..517c6d3b806 100644 --- a/src/d/actor/d_a_kytag11.cpp +++ b/src/d/actor/d_a_kytag11.cpp @@ -99,7 +99,7 @@ static int daKytag11_Delete(kytag11_class* i_this) { /* 805297A8-80529854 000308 00AC+00 1/0 0/0 0/0 .text daKytag11_Create__FP10fopAc_ac_c */ static int daKytag11_Create(fopAc_ac_c* i_this) { kytag11_class* a_this = (kytag11_class*)i_this; - fopAcM_SetupActor(i_this, kytag11_class); + fopAcM_ct(i_this, kytag11_class); a_this->mNewTime = fopAcM_GetParam(i_this) & 0x1F; a_this->mStopTime = (fopAcM_GetParam(i_this) >> 5) & 0x1F; diff --git a/src/d/actor/d_a_kytag12.cpp b/src/d/actor/d_a_kytag12.cpp index 628cfc4574d..dbc7f0c9805 100644 --- a/src/d/actor/d_a_kytag12.cpp +++ b/src/d/actor/d_a_kytag12.cpp @@ -1026,7 +1026,7 @@ static int daKytag12_Delete(kytag12_class* i_this) { /* 8085EE48-8085EEF4 003388 00AC+00 1/0 0/0 0/0 .text daKytag12_Create__FP10fopAc_ac_c */ static int daKytag12_Create(fopAc_ac_c* i_this) { kytag12_class* a_this = (kytag12_class*)i_this; - fopAcM_SetupActor(a_this, kytag12_class); + fopAcM_ct(a_this, kytag12_class); a_this->field_0x574 = fopAcM_GetParam(i_this); a_this->field_0x576 = 0; diff --git a/src/d/actor/d_a_kytag13.cpp b/src/d/actor/d_a_kytag13.cpp index ecbdbecfcc3..a3b5ac034f5 100644 --- a/src/d/actor/d_a_kytag13.cpp +++ b/src/d/actor/d_a_kytag13.cpp @@ -364,7 +364,7 @@ static int daKytag13_Delete(kytag13_class* i_this) { /* 80860210-80860450 001090 0240+00 1/0 0/0 0/0 .text daKytag13_Create__FP10fopAc_ac_c */ static int daKytag13_Create(fopAc_ac_c* i_this) { kytag13_class* a_this = (kytag13_class*)i_this; - fopAcM_SetupActor(i_this, kytag13_class); + fopAcM_ct(i_this, kytag13_class); if (i_this->home.roomNo != dComIfGp_roomControl_getStayNo()) { return 0; diff --git a/src/d/actor/d_a_kytag14.cpp b/src/d/actor/d_a_kytag14.cpp index b19f218af5c..0386b9816e9 100644 --- a/src/d/actor/d_a_kytag14.cpp +++ b/src/d/actor/d_a_kytag14.cpp @@ -81,7 +81,7 @@ static int daKytag14_Delete(kytag14_class*) { /* 80529B44-80529BE0 000224 009C+00 1/0 0/0 0/0 .text daKytag14_Create__FP10fopAc_ac_c */ static int daKytag14_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, kytag14_class); + fopAcM_ct(i_this, kytag14_class); kytag14_class* a_this = static_cast(i_this); a_this->mSavePoint = fopAcM_GetParam(a_this) & 0xFF; diff --git a/src/d/actor/d_a_kytag15.cpp b/src/d/actor/d_a_kytag15.cpp index ea79054742b..97da6664c21 100644 --- a/src/d/actor/d_a_kytag15.cpp +++ b/src/d/actor/d_a_kytag15.cpp @@ -108,7 +108,7 @@ static int daKytag15_Create(fopAc_ac_c* i_this) { a_this->field_0x58c = 0; } - fopAcM_SetupActor(a_this, kytag15_class); + fopAcM_ct(a_this, kytag15_class); if (a_this->field_0x58c == 0) { if (!dKy_daynight_check()) { diff --git a/src/d/actor/d_a_kytag16.cpp b/src/d/actor/d_a_kytag16.cpp index f33afcf954b..9cb243a88bb 100644 --- a/src/d/actor/d_a_kytag16.cpp +++ b/src/d/actor/d_a_kytag16.cpp @@ -92,7 +92,7 @@ static int daKytag16_Delete(kytag16_class* i_this) { /* 80860EAC-8086112C 0002CC 0280+00 2/0 0/0 0/0 .text daKytag16_Create__FP10fopAc_ac_c */ static int daKytag16_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, kytag16_class); + fopAcM_ct(i_this, kytag16_class); kytag16_class* a_this = (kytag16_class*)i_this; a_this->mSwitch = fopAcM_GetParam(a_this) & 0xFF; diff --git a/src/d/actor/d_a_kytag17.cpp b/src/d/actor/d_a_kytag17.cpp index 95f28f2f920..987c076d8fd 100644 --- a/src/d/actor/d_a_kytag17.cpp +++ b/src/d/actor/d_a_kytag17.cpp @@ -34,7 +34,7 @@ static int daKytag17_Delete(kytag17_class* i_this) { static int daKytag17_Create(fopAc_ac_c* i_this) { kytag17_class* a_this = (kytag17_class*)i_this; - fopAcM_SetupActor(a_this, kytag17_class); + fopAcM_ct(a_this, kytag17_class); a_this->mParameters = fopAcM_GetParam(a_this); g_env_light.light_mask_type = a_this->mParameters; diff --git a/src/d/actor/d_a_mant.cpp b/src/d/actor/d_a_mant.cpp index 2974ed0055a..635133181b6 100644 --- a/src/d/actor/d_a_mant.cpp +++ b/src/d/actor/d_a_mant.cpp @@ -748,7 +748,7 @@ static int daMant_Delete(mant_class* i_this) { static int daMant_Create(fopAc_ac_c* i_this) { mant_class* m_this = (mant_class*)i_this; - fopAcM_SetupActor(m_this, mant_class); + fopAcM_ct(m_this, mant_class); //m_this->field_0x0570.field_0x74 = 0; m_this->field_0x259c = fopAcM_GetParam(i_this); diff --git a/src/d/actor/d_a_mg_fish.cpp b/src/d/actor/d_a_mg_fish.cpp index fb8889b8727..28cba5a79b2 100644 --- a/src/d/actor/d_a_mg_fish.cpp +++ b/src/d/actor/d_a_mg_fish.cpp @@ -3861,7 +3861,7 @@ static int daMg_Fish_Create(fopAc_ac_c* i_this) { 0.708f, }; - fopAcM_SetupActor(i_this, mg_fish_class); + fopAcM_ct(i_this, mg_fish_class); mg_fish_class* a_this = (mg_fish_class*)i_this; diff --git a/src/d/actor/d_a_mg_rod.cpp b/src/d/actor/d_a_mg_rod.cpp index 60a66360d0d..2303bff1f7f 100644 --- a/src/d/actor/d_a_mg_rod.cpp +++ b/src/d/actor/d_a_mg_rod.cpp @@ -6234,7 +6234,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 804BA83C-804BAC0C 01133C 03D0+00 1/0 0/0 0/0 .text dmg_rod_Create__FP10fopAc_ac_c */ static int dmg_rod_Create(fopAc_ac_c* i_this) { dmg_rod_class* a_this = (dmg_rod_class*)i_this; - fopAcM_SetupActor(i_this, dmg_rod_class); + fopAcM_ct(i_this, dmg_rod_class); a_this->arg0 = fopAcM_GetParam(i_this); a_this->arg1 = (fopAcM_GetParam(i_this) & 0xFF00) >> 8; diff --git a/src/d/actor/d_a_midna.cpp b/src/d/actor/d_a_midna.cpp index b7fc6497c64..c82604c51fe 100644 --- a/src/d/actor/d_a_midna.cpp +++ b/src/d/actor/d_a_midna.cpp @@ -503,7 +503,7 @@ static int daMidna_createHeap(fopAc_ac_c* i_this) { /* 804BD274-804BD8B8 0010D4 0644+00 1/1 0/0 0/0 .text create__9daMidna_cFv */ cPhs__Step daMidna_c::create() { - fopAcM_SetupActor(this, daMidna_c); + fopAcM_ct(this, daMidna_c); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhase, l_arcName); if (step == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_mirror.cpp b/src/d/actor/d_a_mirror.cpp index 489bd337b1c..06812298a1e 100644 --- a/src/d/actor/d_a_mirror.cpp +++ b/src/d/actor/d_a_mirror.cpp @@ -482,7 +482,7 @@ void daMirror_c::setModelMtx() { /* 80872018-8087206C 0014D8 0054+00 1/0 0/0 0/0 .text daMirror_create__FP10daMirror_c */ static int daMirror_create(daMirror_c* i_this) { - fopAcM_SetupActor(i_this, daMirror_c); + fopAcM_ct(i_this, daMirror_c); return i_this->daMirror_c::create(); } diff --git a/src/d/actor/d_a_movie_player.cpp b/src/d/actor/d_a_movie_player.cpp index 5710a61ccde..97976d4e398 100644 --- a/src/d/actor/d_a_movie_player.cpp +++ b/src/d/actor/d_a_movie_player.cpp @@ -3712,7 +3712,7 @@ int daMP_c::daMP_c_Draw() { /* 80878E60-80878EC4 006780 0064+00 1/0 0/0 0/0 .text daMP_c_Callback_Init__6daMP_cFP10fopAc_ac_c */ int daMP_c::daMP_c_Callback_Init(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, daMP_c); + fopAcM_ct(i_this, daMP_c); return ((daMP_c*)i_this)->daMP_c_Init(); } diff --git a/src/d/actor/d_a_myna.cpp b/src/d/actor/d_a_myna.cpp index 8337a617bac..04ec9c82219 100644 --- a/src/d/actor/d_a_myna.cpp +++ b/src/d/actor/d_a_myna.cpp @@ -310,7 +310,7 @@ daMyna_c::BaseMotionFunc daMyna_c::mBaseMotionTBL[] = { /* 809460A0-80946284 000520 01E4+00 1/1 0/0 0/0 .text create__8daMyna_cFv */ int daMyna_c::create() { - fopAcM_SetupActor(this, daMyna_c); + fopAcM_ct(this, daMyna_c); cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&mPhase, "Npc_myna"); if (phase != cPhs_COMPLEATE_e) { return phase; diff --git a/src/d/actor/d_a_nbomb.cpp b/src/d/actor/d_a_nbomb.cpp index 720d550d5c6..628d9027725 100644 --- a/src/d/actor/d_a_nbomb.cpp +++ b/src/d/actor/d_a_nbomb.cpp @@ -183,7 +183,7 @@ static int daNbomb_createHeap(fopAc_ac_c* i_this) { /* 804C7324-804C7B44 000644 0820+00 1/1 0/0 0/0 .text create__9daNbomb_cFv */ int daNbomb_c::create() { fopAcM_GetID(this); - fopAcM_SetupActor(this, daNbomb_c); + fopAcM_ct(this, daNbomb_c); BOOL is_octaeel_bomb = false; diff --git a/src/d/actor/d_a_ni.cpp b/src/d/actor/d_a_ni.cpp index 9dc7e377d05..6ca58479868 100644 --- a/src/d/actor/d_a_ni.cpp +++ b/src/d/actor/d_a_ni.cpp @@ -1927,7 +1927,7 @@ static BOOL useHeapInit(fopAc_ac_c* i_this) { /* 80950B30-80950F04 004FF0 03D4+00 1/0 0/0 0/0 .text daNi_Create__FP10fopAc_ac_c */ static int daNi_Create(fopAc_ac_c* i_this) { ni_class* a_this = (ni_class*)i_this; - fopAcM_SetupActor(a_this, ni_class); + fopAcM_ct(a_this, ni_class); int phase_state = dComIfG_resLoad(&a_this->mPhase, "Ni"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_no_chg_room.cpp b/src/d/actor/d_a_no_chg_room.cpp index 7f4dd9e9090..bfb33fb9a1e 100644 --- a/src/d/actor/d_a_no_chg_room.cpp +++ b/src/d/actor/d_a_no_chg_room.cpp @@ -138,7 +138,7 @@ int daNocrm_c::create() { /* 801455A8-801456A4 13FEE8 00FC+00 1/0 0/0 0/0 .text daNocrm_create__FP9daNocrm_c */ static int daNocrm_create(daNocrm_c* i_this) { - fopAcM_SetupActor(i_this, daNocrm_c); + fopAcM_ct(i_this, daNocrm_c); return i_this->create(); } diff --git a/src/d/actor/d_a_npc_ash.cpp b/src/d/actor/d_a_npc_ash.cpp index fbb698b3efa..41148824dc9 100644 --- a/src/d/actor/d_a_npc_ash.cpp +++ b/src/d/actor/d_a_npc_ash.cpp @@ -457,7 +457,7 @@ daNpcAsh_Param_c::param const daNpcAsh_Param_c::m = { cPhs__Step daNpcAsh_c::Create() { cPhs__Step step; - fopAcM_SetupActor(this, daNpcAsh_c); + fopAcM_ct(this, daNpcAsh_c); if (!strcmp(dComIfGp_getStartStageName(), "R_SP116") && dComIfG_play_c::getLayerNo(0) == 4) { /* dSv_event_flag_c::F_0361 - Arbiter's Grounds - Spun the spinning pillars */ diff --git a/src/d/actor/d_a_npc_ashB.cpp b/src/d/actor/d_a_npc_ashB.cpp index 5496eee21a7..42c62fd7330 100644 --- a/src/d/actor/d_a_npc_ashB.cpp +++ b/src/d/actor/d_a_npc_ashB.cpp @@ -351,7 +351,7 @@ daNpcAshB_Param_c::param const daNpcAshB_Param_c::m = { cPhs__Step daNpcAshB_c::Create() { cPhs__Step step; - fopAcM_SetupActor(this, daNpcAshB_c); + fopAcM_ct(this, daNpcAshB_c); /* dSv_event_flag_c::F_0361 - Arbiter's Grounds - Spun the spinning pillars */ if (!daNpcF_chkEvtBit(0x169) diff --git a/src/d/actor/d_a_npc_cdn3.cpp b/src/d/actor/d_a_npc_cdn3.cpp index 969bc768ada..578d9798134 100644 --- a/src/d/actor/d_a_npc_cdn3.cpp +++ b/src/d/actor/d_a_npc_cdn3.cpp @@ -1566,7 +1566,7 @@ SECTION_DEAD static char const* const stringBase_8097F652 = /* 8097C910-8097CC58 003CB0 0348+00 3/1 0/0 0/0 .text create__11daNpcCdn3_cFv */ int daNpcCdn3_c::create() { - fopAcM_SetupActor(this, daNpcCdn3_c); + fopAcM_ct(this, daNpcCdn3_c); mIsDarkWorld = dKy_darkworld_check(); m_type = getType(); mObjNum = getObjNum(); diff --git a/src/d/actor/d_a_npc_coach.cpp b/src/d/actor/d_a_npc_coach.cpp index 822c265cf52..56f6eb453e7 100644 --- a/src/d/actor/d_a_npc_coach.cpp +++ b/src/d/actor/d_a_npc_coach.cpp @@ -2047,7 +2047,7 @@ static int daNpcCoach_Create(fopAc_ac_c* a_this) { /* 809A3884-809A3928 006224 00A4+00 1/1 0/0 0/0 .text create__12daNpcCoach_cFv */ cPhs__Step daNpcCoach_c::create() { - fopAcM_SetupActor(this, daNpcCoach_c); + fopAcM_ct(this, daNpcCoach_c); cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&mPhase, l_arcName); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_npc_doorboy.cpp b/src/d/actor/d_a_npc_doorboy.cpp index 49cb091d146..b4b58443daf 100644 --- a/src/d/actor/d_a_npc_doorboy.cpp +++ b/src/d/actor/d_a_npc_doorboy.cpp @@ -180,7 +180,7 @@ daNpcDoorBoy_HIOParam const daNpcDoorBoy_Param_c::m = { /* 809AB088-809AB320 0004E8 0298+00 1/1 0/0 0/0 .text Create__14daNpcDoorBoy_cFv */ cPhs__Step daNpcDoorBoy_c::Create() { - fopAcM_SetupActor(this, daNpcDoorBoy_c); + fopAcM_ct(this, daNpcDoorBoy_c); mMessageNo = (s16)getMessageNo(); diff --git a/src/d/actor/d_a_npc_fguard.cpp b/src/d/actor/d_a_npc_fguard.cpp index b46bb221ca4..8afb2e3ed29 100644 --- a/src/d/actor/d_a_npc_fguard.cpp +++ b/src/d/actor/d_a_npc_fguard.cpp @@ -45,7 +45,7 @@ static int daNpcFgd_Create(void* a_this) { /* 809BA584-809BA730 000144 01AC+00 1/1 0/0 0/0 .text create__10daNpcFgd_cFv */ cPhs__Step daNpcFgd_c::create() { - fopAcM_SetupActor(this, daNpcFgd_c); + fopAcM_ct(this, daNpcFgd_c); mIsDarkWorld = dKy_darkworld_check(); m_type = getType(); diff --git a/src/d/actor/d_a_npc_fish.cpp b/src/d/actor/d_a_npc_fish.cpp index fd6da57caa4..642ca4d7165 100644 --- a/src/d/actor/d_a_npc_fish.cpp +++ b/src/d/actor/d_a_npc_fish.cpp @@ -116,7 +116,7 @@ static fish_pos lf_pos[12] = { /* 80542254-805424B8 000154 0264+00 1/0 0/0 0/0 .text daNpc_Fish_Create__FP10fopAc_ac_c */ static int daNpc_Fish_Create(fopAc_ac_c* i_this) { cXyz pos; - fopAcM_SetupActor(i_this, npc_fish_class); + fopAcM_ct(i_this, npc_fish_class); if (strcmp(dComIfGp_getStartStageName(), "F_SP127")) { return 5; } else { diff --git a/src/d/actor/d_a_npc_grc.cpp b/src/d/actor/d_a_npc_grc.cpp index 82f8dad3ed8..4edf2e04281 100644 --- a/src/d/actor/d_a_npc_grc.cpp +++ b/src/d/actor/d_a_npc_grc.cpp @@ -300,7 +300,7 @@ daNpc_grC_HIOParam const daNpc_grC_Param_c::m = { /* 809CB8E0-809CBBD4 000500 02F4+00 1/1 0/0 0/0 .text create__11daNpc_grC_cFv */ cPhs__Step daNpc_grC_c::create() { - fopAcM_SetupActor(this, daNpc_grC_c); + fopAcM_ct(this, daNpc_grC_c); mTwilight = dKy_darkworld_check(); mType = getTypeFromParam(); diff --git a/src/d/actor/d_a_npc_grr.cpp b/src/d/actor/d_a_npc_grr.cpp index e19cc4bed1b..70caf529e54 100644 --- a/src/d/actor/d_a_npc_grr.cpp +++ b/src/d/actor/d_a_npc_grr.cpp @@ -278,7 +278,7 @@ daNpc_grR_HIOParam const daNpc_grR_Param_c::m = { /* 809DFCE0-809DFFB8 000500 02D8+00 1/1 0/0 0/0 .text create__11daNpc_grR_cFv */ cPhs__Step daNpc_grR_c::create() { - fopAcM_SetupActor(this, daNpc_grR_c); + fopAcM_ct(this, daNpc_grR_c); mType = getTypeFromParam(); diff --git a/src/d/actor/d_a_npc_grz.cpp b/src/d/actor/d_a_npc_grz.cpp index f292504e351..2bb920dc202 100644 --- a/src/d/actor/d_a_npc_grz.cpp +++ b/src/d/actor/d_a_npc_grz.cpp @@ -449,7 +449,7 @@ daNpc_Grz_HIOParam const daNpc_Grz_Param_c::m = { /* 809E8BA0-809E8E68 000880 02C8+00 1/1 0/0 0/0 .text create__11daNpc_Grz_cFv */ cPhs__Step daNpc_Grz_c::create() { - fopAcM_SetupActor(this, daNpc_Grz_c); + fopAcM_ct(this, daNpc_Grz_c); mType = getTypeFromParam(); mSwNo = fopAcM_GetParam(this) >> 16; diff --git a/src/d/actor/d_a_npc_gwolf.cpp b/src/d/actor/d_a_npc_gwolf.cpp index 5b9ffe47224..615fb06200d 100644 --- a/src/d/actor/d_a_npc_gwolf.cpp +++ b/src/d/actor/d_a_npc_gwolf.cpp @@ -284,7 +284,7 @@ daNpc_GWolf_HIOParam const daNpc_GWolf_Param_c::m = { /* 809F34C0-809F37C0 000500 0300+00 1/1 0/0 0/0 .text create__13daNpc_GWolf_cFv */ cPhs__Step daNpc_GWolf_c::create() { - fopAcM_SetupActor(this, daNpc_GWolf_c); + fopAcM_ct(this, daNpc_GWolf_c); mType = getTypeFromParam(); mParamMode = getModeFromParam(); diff --git a/src/d/actor/d_a_npc_henna.cpp b/src/d/actor/d_a_npc_henna.cpp index d8e766b264a..db6bb2948a0 100644 --- a/src/d/actor/d_a_npc_henna.cpp +++ b/src/d/actor/d_a_npc_henna.cpp @@ -2709,7 +2709,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 80549724-80549E40 006904 071C+00 1/0 0/0 0/0 .text daNpc_Henna_Create__FP10fopAc_ac_c */ static int daNpc_Henna_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, npc_henna_class); + fopAcM_ct(i_this, npc_henna_class); npc_henna_class* a_this = (npc_henna_class*)i_this; cPhs__Step loadResult = (cPhs__Step)dComIfG_resLoad(&a_this->phase, "Henna"); diff --git a/src/d/actor/d_a_npc_impal.cpp b/src/d/actor/d_a_npc_impal.cpp index ee8f2a87943..9e4a0f25509 100644 --- a/src/d/actor/d_a_npc_impal.cpp +++ b/src/d/actor/d_a_npc_impal.cpp @@ -112,7 +112,7 @@ daNpc_Impal_HIOParam const daNpcImpal_Param_c::m = { int daNpcImpal_c::Create() { int phase; - fopAcM_SetupActor(this, daNpcImpal_c); + fopAcM_ct(this, daNpcImpal_c); if ((!strcmp(dComIfGp_getStartStageName(), "F_SP128") && dComIfGs_isSaveSwitch(0x61)) || (!strcmp(dComIfGp_getStartStageName(), "R_SP128") && !dComIfGs_isSaveSwitch(0x61))) diff --git a/src/d/actor/d_a_npc_ins.cpp b/src/d/actor/d_a_npc_ins.cpp index 338760f7fd9..150ad9251d5 100644 --- a/src/d/actor/d_a_npc_ins.cpp +++ b/src/d/actor/d_a_npc_ins.cpp @@ -384,7 +384,7 @@ daNpcIns_HIOParam const daNpcIns_Param_c::m = { /* 80A0E660-80A0EA30 000500 03D0+00 1/1 0/0 0/0 .text Create__10daNpcIns_cFv */ cPhs__Step daNpcIns_c::Create() { - fopAcM_SetupActor(this, daNpcIns_c); + fopAcM_ct(this, daNpcIns_c); mType = TYPE_0; diff --git a/src/d/actor/d_a_npc_kasi_hana.cpp b/src/d/actor/d_a_npc_kasi_hana.cpp index 4c910331b5b..4fd4b23f37f 100644 --- a/src/d/actor/d_a_npc_kasi_hana.cpp +++ b/src/d/actor/d_a_npc_kasi_hana.cpp @@ -653,7 +653,7 @@ daNpcKasiHana_HIOParam const daNpcKasiHana_Param_c::m = { /* 80A1C334-80A1C5B0 001474 027C+00 1/1 0/0 0/0 .text Create__15daNpcKasiHana_cFv */ cPhs__Step daNpcKasiHana_c::Create() { - fopAcM_SetupActor(this, daNpcKasiHana_c); + fopAcM_ct(this, daNpcKasiHana_c); mMessageNo = getMessageNo(); mType = getType(); diff --git a/src/d/actor/d_a_npc_kasi_kyu.cpp b/src/d/actor/d_a_npc_kasi_kyu.cpp index 18c942d2618..4c4d1a24061 100644 --- a/src/d/actor/d_a_npc_kasi_kyu.cpp +++ b/src/d/actor/d_a_npc_kasi_kyu.cpp @@ -205,7 +205,7 @@ daNpcKasiKyu_HIOParam const daNpcKasiKyu_Param_c::m = { /* 80A21E24-80A220A0 000544 027C+00 1/1 0/0 0/0 .text Create__14daNpcKasiKyu_cFv */ cPhs__Step daNpcKasiKyu_c::Create() { - fopAcM_SetupActor(this, daNpcKasiKyu_c); + fopAcM_ct(this, daNpcKasiKyu_c); mType = getType(); mMessageNo = getMessageNo(); diff --git a/src/d/actor/d_a_npc_kasi_mich.cpp b/src/d/actor/d_a_npc_kasi_mich.cpp index 25d31658b4a..f930f49df12 100644 --- a/src/d/actor/d_a_npc_kasi_mich.cpp +++ b/src/d/actor/d_a_npc_kasi_mich.cpp @@ -205,7 +205,7 @@ daNpcKasiMich_HIOParam const daNpcKasiMich_Param_c::m = { /* 80A26624-80A268A0 000544 027C+00 1/1 0/0 0/0 .text Create__15daNpcKasiMich_cFv */ cPhs__Step daNpcKasiMich_c::Create() { - fopAcM_SetupActor(this, daNpcKasiMich_c); + fopAcM_ct(this, daNpcKasiMich_c); mType = getType(); mMessageNo = getMessageNo(); diff --git a/src/d/actor/d_a_npc_ks.cpp b/src/d/actor/d_a_npc_ks.cpp index 938fc6dc405..b5a5aad9e31 100644 --- a/src/d/actor/d_a_npc_ks.cpp +++ b/src/d/actor/d_a_npc_ks.cpp @@ -7304,7 +7304,7 @@ static int daNpc_Ks_Create(fopAc_ac_c* a_this) { }; npc_ks_class* i_this = (npc_ks_class*)a_this; - fopAcM_SetupActor(a_this, npc_ks_class); + fopAcM_ct(a_this, npc_ks_class); dComIfGp_getStage()->getStagInfo(); if (dKy_darkworld_check()) { diff --git a/src/d/actor/d_a_npc_lf.cpp b/src/d/actor/d_a_npc_lf.cpp index d1c07729bd2..38368688d0d 100644 --- a/src/d/actor/d_a_npc_lf.cpp +++ b/src/d/actor/d_a_npc_lf.cpp @@ -279,7 +279,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 80A6A650-80A6A8A4 000BD0 0254+00 1/0 0/0 0/0 .text daNPC_LF_Create__FP10fopAc_ac_c */ static cPhs__Step daNPC_LF_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, npc_lf_class); + fopAcM_ct(i_this, npc_lf_class); npc_lf_class* a_this = static_cast(i_this); cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&a_this->mPhase, "NPC_LF"); diff --git a/src/d/actor/d_a_npc_moir.cpp b/src/d/actor/d_a_npc_moir.cpp index 42401ee4e45..b7dad09050a 100644 --- a/src/d/actor/d_a_npc_moir.cpp +++ b/src/d/actor/d_a_npc_moir.cpp @@ -301,7 +301,7 @@ daNpcMoiR_c::~daNpcMoiR_c() { /* 80A7C580-80A7C978 000500 03F8+00 1/1 0/0 0/0 .text Create__11daNpcMoiR_cFv */ cPhs__Step daNpcMoiR_c::Create() { - fopAcM_SetupActor(this, daNpcMoiR_c); + fopAcM_ct(this, daNpcMoiR_c); if (strcmp(dComIfGp_getStartStageName(), "R_SP116") == 0 && dComIfG_play_c::getLayerNo(0) == 4) { if (daNpcF_chkEvtBit(0x169) /* dSv_event_flag_c::F_0361 - Arbiter's Grounds - Spun the spinning pillars */ diff --git a/src/d/actor/d_a_npc_ne.cpp b/src/d/actor/d_a_npc_ne.cpp index 48f019a087d..ce02a796636 100644 --- a/src/d/actor/d_a_npc_ne.cpp +++ b/src/d/actor/d_a_npc_ne.cpp @@ -3160,7 +3160,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 80A91B88-80A92118 008FA8 0590+00 1/0 0/0 0/0 .text daNpc_Ne_Create__FP10fopAc_ac_c */ static cPhs__Step daNpc_Ne_Create(fopAc_ac_c* i_this) { npc_ne_class* _this = static_cast(i_this); - fopAcM_SetupActor(i_this, npc_ne_class); + fopAcM_ct(i_this, npc_ne_class); if (dKy_darkworld_check()) { _this->mResName = "Npc_net"; diff --git a/src/d/actor/d_a_npc_prayer.cpp b/src/d/actor/d_a_npc_prayer.cpp index 53fa1076d8c..728fa4a7144 100644 --- a/src/d/actor/d_a_npc_prayer.cpp +++ b/src/d/actor/d_a_npc_prayer.cpp @@ -112,7 +112,7 @@ const daNpcPray_HIOParam daNpcPray_Param_c::m = { /* 80AB3204-80AB348C 000504 0288+00 1/1 0/0 0/0 .text Create__11daNpcPray_cFv */ int daNpcPray_c::Create() { - fopAcM_SetupActor(this, daNpcPray_c); + fopAcM_ct(this, daNpcPray_c); mMessageNo = getMessageNo(); diff --git a/src/d/actor/d_a_npc_rafrel.cpp b/src/d/actor/d_a_npc_rafrel.cpp index e91cd5f5edf..592284ad224 100644 --- a/src/d/actor/d_a_npc_rafrel.cpp +++ b/src/d/actor/d_a_npc_rafrel.cpp @@ -176,7 +176,7 @@ const daNpcRafrel_HIOParam daNpcRafrel_Param_c::m = { /* 80AB9A40-80AB9E3C 000500 03FC+00 1/1 0/0 0/0 .text Create__13daNpcRafrel_cFv */ int daNpcRafrel_c::Create() { - fopAcM_SetupActor(this, daNpcRafrel_c); + fopAcM_ct(this, daNpcRafrel_c); if (strcmp(dComIfGp_getStartStageName(), "R_SP116") == 0 && dComIfG_play_c::getLayerNo(0) == 4) { if (!daNpcF_chkEvtBit(0x169)) { diff --git a/src/d/actor/d_a_npc_shad.cpp b/src/d/actor/d_a_npc_shad.cpp index b66fed1a541..2732feeb400 100644 --- a/src/d/actor/d_a_npc_shad.cpp +++ b/src/d/actor/d_a_npc_shad.cpp @@ -347,7 +347,7 @@ daNpcShad_c::~daNpcShad_c() { /* 80AD8620-80AD8B60 000500 0540+00 1/1 0/0 0/0 .text Create__11daNpcShad_cFv */ cPhs__Step daNpcShad_c::Create() { - fopAcM_SetupActor(this, daNpcShad_c); + fopAcM_ct(this, daNpcShad_c); if (strcmp(dComIfGp_getStartStageName(), "R_SP116") == 0 && dComIfG_play_c::getLayerNo(0) == 4) { if (daNpcF_chkEvtBit(0x169) && daNpcF_chkEvtBit(0x10A) && daNpcF_chkEvtBit(0x10B) && !daNpcF_chkEvtBit(0x10C)) { diff --git a/src/d/actor/d_a_npc_shoe.cpp b/src/d/actor/d_a_npc_shoe.cpp index 2661acfecaf..8b82179a454 100644 --- a/src/d/actor/d_a_npc_shoe.cpp +++ b/src/d/actor/d_a_npc_shoe.cpp @@ -130,7 +130,7 @@ daNpcShoe_Param_c::param const daNpcShoe_Param_c::m = { cPhs__Step daNpcShoe_c::Create() { cPhs__Step step; - fopAcM_SetupActor(this, daNpcShoe_c); + fopAcM_ct(this, daNpcShoe_c); field_0xe0c = getMessageNo(); diff --git a/src/d/actor/d_a_npc_shop0.cpp b/src/d/actor/d_a_npc_shop0.cpp index d344922e5ba..456e44c13ed 100644 --- a/src/d/actor/d_a_npc_shop0.cpp +++ b/src/d/actor/d_a_npc_shop0.cpp @@ -29,7 +29,7 @@ daNpc_Shop0_c::~daNpc_Shop0_c() { /* 80AEAA10-80AEAC10 0002B0 0200+00 1/1 0/0 0/0 .text create__13daNpc_Shop0_cFv */ int daNpc_Shop0_c::create() { - fopAcM_SetupActor(this, daNpc_Shop0_c); + fopAcM_ct(this, daNpc_Shop0_c); int phase_step = dComIfG_resLoad(&mPhaseReq, getResName()); if (phase_step == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_npc_shop_maro.cpp b/src/d/actor/d_a_npc_shop_maro.cpp index 7df44f63c89..0fa5f9d30ff 100644 --- a/src/d/actor/d_a_npc_shop_maro.cpp +++ b/src/d/actor/d_a_npc_shop_maro.cpp @@ -35,7 +35,7 @@ static bool daNpc_shopMaro_IsDelete(void* i_this) { /* 80AEBEB4-80AEBF04 0000D4 0050+00 1/1 0/0 0/0 .text create__16daNpc_shopMaro_cFv */ int daNpc_shopMaro_c::create() { - fopAcM_SetupActor(this, daNpc_shopMaro_c); + fopAcM_ct(this, daNpc_shopMaro_c); return cPhs_ERROR_e; } diff --git a/src/d/actor/d_a_npc_sq.cpp b/src/d/actor/d_a_npc_sq.cpp index 8e4744d67fa..71ca7f9d2f9 100644 --- a/src/d/actor/d_a_npc_sq.cpp +++ b/src/d/actor/d_a_npc_sq.cpp @@ -334,7 +334,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 80AF6F98-80AF7260 001098 02C8+00 1/0 0/0 0/0 .text daNpc_Sq_Create__FP10fopAc_ac_c */ static cPhs__Step daNpc_Sq_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, npc_sq_class); + fopAcM_ct(i_this, npc_sq_class); npc_sq_class* _this = static_cast(i_this); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&_this->mPhaseReq, "Sq"); diff --git a/src/d/actor/d_a_npc_the.cpp b/src/d/actor/d_a_npc_the.cpp index c4ea6c13964..0b94b95b7ea 100644 --- a/src/d/actor/d_a_npc_the.cpp +++ b/src/d/actor/d_a_npc_the.cpp @@ -1159,7 +1159,7 @@ static cPhs__Step daNpcThe_Create(void* i_this) { /* 80AF9358-80AF9748 001D78 03F0+00 1/1 0/0 0/0 .text create__10daNpcThe_cFv */ cPhs__Step daNpcThe_c::create() { - fopAcM_SetupActor(this, daNpcThe_c); + fopAcM_ct(this, daNpcThe_c); mType = getTypeFromParam(); diff --git a/src/d/actor/d_a_npc_tk.cpp b/src/d/actor/d_a_npc_tk.cpp index a797d5ba4b4..36ec8dbdecb 100644 --- a/src/d/actor/d_a_npc_tk.cpp +++ b/src/d/actor/d_a_npc_tk.cpp @@ -3276,7 +3276,7 @@ int daNPC_TK_c::create() { } // mSphAttr }; - fopAcM_SetupActor(this, daNPC_TK_c); + fopAcM_ct(this, daNPC_TK_c); int loadRes = dComIfG_resLoad(&mPhase, "Npc_tk"); eventInfo.setArchiveName("Npc_tk"); diff --git a/src/d/actor/d_a_npc_tkj2.cpp b/src/d/actor/d_a_npc_tkj2.cpp index 0101772f03e..3909b8c4e61 100644 --- a/src/d/actor/d_a_npc_tkj2.cpp +++ b/src/d/actor/d_a_npc_tkj2.cpp @@ -1103,7 +1103,7 @@ static int useHeapInit(fopAc_ac_c* a_this) { /* 80B13E68-80B1411C 003168 02B4+00 1/0 0/0 0/0 .text daNpc_Tkj2_Create__FP10fopAc_ac_c */ static cPhs__Step daNpc_Tkj2_Create(fopAc_ac_c* a_this) { - fopAcM_SetupActor(a_this, npc_tkj2_class); + fopAcM_ct(a_this, npc_tkj2_class); npc_tkj2_class* i_this = (npc_tkj2_class*)a_this; cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&i_this->mPhase, "Tkj2"); diff --git a/src/d/actor/d_a_npc_tks.cpp b/src/d/actor/d_a_npc_tks.cpp index caa6f2c4ffa..8ec561ebcd5 100644 --- a/src/d/actor/d_a_npc_tks.cpp +++ b/src/d/actor/d_a_npc_tks.cpp @@ -280,7 +280,7 @@ daNpcTks_HIOParam const daNpcTks_Param_c::m = { /* 80B14AF8-80B14ED0 0005B8 03D8+00 1/1 0/0 0/0 .text Create__10daNpcTks_cFv */ cPhs__Step daNpcTks_c::Create() { - fopAcM_SetupActor(this, daNpcTks_c); + fopAcM_ct(this, daNpcTks_c); if (dComIfGs_isStageBossEnemy()) { return cPhs_ERROR_e; diff --git a/src/d/actor/d_a_npc_tr.cpp b/src/d/actor/d_a_npc_tr.cpp index 658f67a1609..97fd3ea6ae8 100644 --- a/src/d/actor/d_a_npc_tr.cpp +++ b/src/d/actor/d_a_npc_tr.cpp @@ -239,7 +239,7 @@ static int useHeapInit(fopAc_ac_c* actor) { /* 80B263E4-80B264E4 000AC4 0100+00 1/0 0/0 0/0 .text daNPC_TR_Create__FP10fopAc_ac_c */ static int daNPC_TR_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, npc_tr_class); + fopAcM_ct(i_this, npc_tr_class); npc_tr_class* npc_tr = (npc_tr_class*)i_this; int phase_state = dComIfG_resLoad(&npc_tr->mPhaseReq, "NPC_TR"); diff --git a/src/d/actor/d_a_npc_worm.cpp b/src/d/actor/d_a_npc_worm.cpp index 8fad716a9da..a2bd997c0ad 100644 --- a/src/d/actor/d_a_npc_worm.cpp +++ b/src/d/actor/d_a_npc_worm.cpp @@ -373,7 +373,7 @@ static int useHeapInit(fopAc_ac_c* a_this) { /* 80B2EEC0-80B2F050 0010C0 0190+00 1/0 0/0 0/0 .text daNPC_WORM_Create__FP10fopAc_ac_c */ static int daNPC_WORM_Create(fopAc_ac_c* a_this) { - fopAcM_SetupActor(a_this, npc_worm_class); + fopAcM_ct(a_this, npc_worm_class); npc_worm_class* i_this = (npc_worm_class*)a_this; int rv = dComIfG_resLoad(&i_this->mPhase, "Alink"); diff --git a/src/d/actor/d_a_npc_wrestler.cpp b/src/d/actor/d_a_npc_wrestler.cpp index 018c43393a8..6f58231794a 100644 --- a/src/d/actor/d_a_npc_wrestler.cpp +++ b/src/d/actor/d_a_npc_wrestler.cpp @@ -516,7 +516,7 @@ daNpcWrestler_c::~daNpcWrestler_c() { /* 80B2F688-80B2F974 0004E8 02EC+00 1/1 0/0 0/0 .text Create__15daNpcWrestler_cFv */ cPhs__Step daNpcWrestler_c::Create() { - fopAcM_SetupActor(this, daNpcWrestler_c); + fopAcM_ct(this, daNpcWrestler_c); mType = getType(); mMsgNo = getMessageNo(); diff --git a/src/d/actor/d_a_npc_zra.cpp b/src/d/actor/d_a_npc_zra.cpp index 7ac1bf83419..11bdb8e4afa 100644 --- a/src/d/actor/d_a_npc_zra.cpp +++ b/src/d/actor/d_a_npc_zra.cpp @@ -518,7 +518,7 @@ daNpc_zrA_c::~daNpc_zrA_c() { /* 80B79B58-80B79F38 001738 03E0+00 1/1 0/0 0/0 .text create__11daNpc_zrA_cFv */ cPhs__Step daNpc_zrA_c::create() { - fopAcM_SetupActor(this, daNpc_zrA_c); + fopAcM_ct(this, daNpc_zrA_c); mType = getTypeFromArgument(); if (home.angle.x != 0xffff) { diff --git a/src/d/actor/d_a_npc_zrc.cpp b/src/d/actor/d_a_npc_zrc.cpp index ea907e25260..03fc74e28c8 100644 --- a/src/d/actor/d_a_npc_zrc.cpp +++ b/src/d/actor/d_a_npc_zrc.cpp @@ -219,7 +219,7 @@ daNpc_zrC_c::~daNpc_zrC_c() { /* 80B8E03C-80B8E338 00051C 02FC+00 1/1 0/0 0/0 .text create__11daNpc_zrC_cFv */ cPhs__Step daNpc_zrC_c::create() { - fopAcM_SetupActor(this, daNpc_zrC_c); + fopAcM_ct(this, daNpc_zrC_c); mType = getTypeFromParam(); if (home.angle.x != 0xffff) { diff --git a/src/d/actor/d_a_npc_zrz.cpp b/src/d/actor/d_a_npc_zrz.cpp index 6963a9d9f57..dd581958b18 100644 --- a/src/d/actor/d_a_npc_zrz.cpp +++ b/src/d/actor/d_a_npc_zrz.cpp @@ -197,7 +197,7 @@ daNpc_zrZ_c::~daNpc_zrZ_c() { /* 80B9423C-80B9453C 00055C 0300+00 1/1 0/0 0/0 .text create__11daNpc_zrZ_cFv */ cPhs__Step daNpc_zrZ_c::create() { - fopAcM_SetupActor(this, daNpc_zrZ_c); + fopAcM_ct(this, daNpc_zrZ_c); mType = getTypeFromParam(); mDemoMode = getDemoMode(); diff --git a/src/d/actor/d_a_obj_Lv5Key.cpp b/src/d/actor/d_a_obj_Lv5Key.cpp index c7f8a3f8a03..fc7943067a2 100644 --- a/src/d/actor/d_a_obj_Lv5Key.cpp +++ b/src/d/actor/d_a_obj_Lv5Key.cpp @@ -334,7 +334,7 @@ static int daObjLv5Key_Execute(daObjLv5Key_c* i_this) { /* 80B9C5EC-80B9C798 000CAC 01AC+00 1/1 0/0 0/0 .text create_1st__13daObjLv5Key_cFv */ int daObjLv5Key_c::create_1st() { - fopAcM_SetupActor(this, daObjLv5Key_c); + fopAcM_ct(this, daObjLv5Key_c); int phase = dComIfG_resLoad(&mPhase, l_arcName); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_Turara.cpp b/src/d/actor/d_a_obj_Turara.cpp index c3bfc55a243..c3236bc8cb2 100644 --- a/src/d/actor/d_a_obj_Turara.cpp +++ b/src/d/actor/d_a_obj_Turara.cpp @@ -122,7 +122,7 @@ int daTurara_c::CreateHeap() { /* 80B9CED8-80B9D29C 000438 03C4+00 1/1 0/0 0/0 .text create__10daTurara_cFv */ int daTurara_c::create() { - fopAcM_SetupActor(this, daTurara_c); + fopAcM_ct(this, daTurara_c); u8 my_bit = getSwBit3(); if (fopAcM_isSwitch(this, my_bit)) { return cPhs_ERROR_e; diff --git a/src/d/actor/d_a_obj_TvCdlst.cpp b/src/d/actor/d_a_obj_TvCdlst.cpp index ed993ba2369..aa93f07629a 100644 --- a/src/d/actor/d_a_obj_TvCdlst.cpp +++ b/src/d/actor/d_a_obj_TvCdlst.cpp @@ -68,7 +68,7 @@ const dCcD_SrcGObjInf daTvCdlst_c::mCcDObjInfo = { /* 80B9EE34-80B9F0B4 000254 0280+00 1/1 0/0 0/0 .text create__11daTvCdlst_cFv */ int daTvCdlst_c::create() { - fopAcM_SetupActor(this, daTvCdlst_c); + fopAcM_ct(this, daTvCdlst_c); int phase = dComIfG_resLoad(&mPhaseReq,"HShokudai"); if (phase == cPhs_COMPLEATE_e) { if (fopAcM_entrySolidHeap(this,createHeapCallBack,0x820) == 0) { diff --git a/src/d/actor/d_a_obj_Y_taihou.cpp b/src/d/actor/d_a_obj_Y_taihou.cpp index 24e1b27aece..633f4e69cf2 100644 --- a/src/d/actor/d_a_obj_Y_taihou.cpp +++ b/src/d/actor/d_a_obj_Y_taihou.cpp @@ -399,7 +399,7 @@ int daObjYtaihou_c::Delete() { /* 80BA0C88-80BA0DA4 001288 011C+00 1/0 0/0 0/0 .text daObjYtaihou_create1st__FP14daObjYtaihou_c */ static void daObjYtaihou_create1st(daObjYtaihou_c* i_this) { - fopAcM_SetupActor(i_this, daObjYtaihou_c); + fopAcM_ct(i_this, daObjYtaihou_c); i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_amiShutter.cpp b/src/d/actor/d_a_obj_amiShutter.cpp index d52f3fa4f12..8b970f1d2b5 100644 --- a/src/d/actor/d_a_obj_amiShutter.cpp +++ b/src/d/actor/d_a_obj_amiShutter.cpp @@ -75,7 +75,7 @@ int daAmiShutter_c::CreateHeap() { /* 80BA1650-80BA182C 000270 01DC+00 1/1 0/0 0/0 .text create__14daAmiShutter_cFv */ cPhs__Step daAmiShutter_c::create() { - fopAcM_SetupActor(this, daAmiShutter_c); + fopAcM_ct(this, daAmiShutter_c); cPhs__Step phaseStep = (cPhs__Step) dComIfG_resLoad(&mPhaseReq, "S_Zami"); if (phaseStep == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_ari.cpp b/src/d/actor/d_a_obj_ari.cpp index 63d8ef727f4..e8e614956b5 100644 --- a/src/d/actor/d_a_obj_ari.cpp +++ b/src/d/actor/d_a_obj_ari.cpp @@ -638,7 +638,7 @@ bool daObjARI_c::CreateChk() { /* 80BA49E8-80BA5258 002448 0870+00 1/1 0/0 0/0 .text create__10daObjARI_cFv */ cPhs__Step daObjARI_c::create() { - fopAcM_SetupActor(this, daObjARI_c); + fopAcM_ct(this, daObjARI_c); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhase, "I_Ari"); if (step == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_automata.cpp b/src/d/actor/d_a_obj_automata.cpp index 7a3c1a3c503..019fbbd1869 100644 --- a/src/d/actor/d_a_obj_automata.cpp +++ b/src/d/actor/d_a_obj_automata.cpp @@ -65,7 +65,7 @@ daObj_AutoMata_c::~daObj_AutoMata_c() { /* 80BA5990-80BA5D2C 000390 039C+00 1/1 0/0 0/0 .text create__16daObj_AutoMata_cFv */ int daObj_AutoMata_c::create() { - fopAcM_SetupActor(this, daObj_AutoMata_c); + fopAcM_ct(this, daObj_AutoMata_c); field_0xb30 = 0; int rv = dComIfG_resLoad(&mPhase, l_resNameList[l_bmdData[field_0xb30][1]]); if (rv == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_avalanche.cpp b/src/d/actor/d_a_obj_avalanche.cpp index 83a685fa3f7..ee2d1b733cf 100644 --- a/src/d/actor/d_a_obj_avalanche.cpp +++ b/src/d/actor/d_a_obj_avalanche.cpp @@ -304,7 +304,7 @@ int daObjAvalanche_c::Delete() { /* 80BA7C0C-80BA7C6C 000DAC 0060+00 1/0 0/0 0/0 .text * daObjAvalanche_create1st__FP16daObjAvalanche_c */ static int daObjAvalanche_create1st(daObjAvalanche_c* i_this) { - fopAcM_SetupActor(i_this, daObjAvalanche_c); + fopAcM_ct(i_this, daObjAvalanche_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_balloon.cpp b/src/d/actor/d_a_obj_balloon.cpp index dab48799f45..4dbfb555744 100644 --- a/src/d/actor/d_a_obj_balloon.cpp +++ b/src/d/actor/d_a_obj_balloon.cpp @@ -260,7 +260,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 80BA88C4-80BA8B30 000A04 026C+00 1/1 0/0 0/0 .text create__15daObj_Balloon_cFv */ int daObj_Balloon_c::create() { - fopAcM_SetupActor(this, daObj_Balloon_c); + fopAcM_ct(this, daObj_Balloon_c); mType = fopAcM_GetParam(this); if (mType == 0xFF) { mType = SIZE_LARGE_e; diff --git a/src/d/actor/d_a_obj_barDesk.cpp b/src/d/actor/d_a_obj_barDesk.cpp index 68de99a3c15..c96edc22173 100644 --- a/src/d/actor/d_a_obj_barDesk.cpp +++ b/src/d/actor/d_a_obj_barDesk.cpp @@ -55,7 +55,7 @@ int daBarDesk_c::CreateHeap() { /* 80BA92F4-80BA94B8 000254 01C4+00 1/1 0/0 0/0 .text create__11daBarDesk_cFv */ cPhs__Step daBarDesk_c::create() { - fopAcM_SetupActor(this, daBarDesk_c); + fopAcM_ct(this, daBarDesk_c); if (fopAcM_isSwitch(this, (u8)fopAcM_GetParam(this))) { return cPhs_ERROR_e; } diff --git a/src/d/actor/d_a_obj_batta.cpp b/src/d/actor/d_a_obj_batta.cpp index 82d38f4791f..bf1fdac4c46 100644 --- a/src/d/actor/d_a_obj_batta.cpp +++ b/src/d/actor/d_a_obj_batta.cpp @@ -621,7 +621,7 @@ static u16 const l_musiya_num[2] = { int daObjBATTA_c::create() { u8 uVar9 = (fopAcM_GetParam(this) & 0xf00) >> 8; - fopAcM_SetupActor(this, daObjBATTA_c); + fopAcM_ct(this, daObjBATTA_c); int rv = dComIfG_resLoad(&mPhase, "Bat"); if (rv == cPhs_COMPLEATE_e) { OS_REPORT("BATTA PARAM %x\n", fopAcM_GetParam(this)); diff --git a/src/d/actor/d_a_obj_bbox.cpp b/src/d/actor/d_a_obj_bbox.cpp index 8d3e0cec7c7..b5a7def5d32 100644 --- a/src/d/actor/d_a_obj_bbox.cpp +++ b/src/d/actor/d_a_obj_bbox.cpp @@ -61,7 +61,7 @@ int daObjBBox_c::CreateHeap() { /* 80BACEC0-80BAD030 000200 0170+00 1/1 0/0 0/0 .text create1st__11daObjBBox_cFv */ int daObjBBox_c::create1st() { - fopAcM_SetupActor(this, daObjBBox_c); + fopAcM_ct(this, daObjBBox_c); if (fopAcM_isSwitch(this, getSwNo())) { return cPhs_ERROR_e; @@ -120,7 +120,7 @@ int daObjBBox_c::Delete() { /* 80BAD30C-80BAD400 00064C 00F4+00 1/0 0/0 0/0 .text daObjBBox_create1st__FP11daObjBBox_c */ static int daObjBBox_create1st(daObjBBox_c* i_this) { - fopAcM_SetupActor(i_this, daObjBBox_c); + fopAcM_ct(i_this, daObjBBox_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_bed.cpp b/src/d/actor/d_a_obj_bed.cpp index 85fb0189775..d6712742a53 100644 --- a/src/d/actor/d_a_obj_bed.cpp +++ b/src/d/actor/d_a_obj_bed.cpp @@ -28,7 +28,7 @@ daObj_Bed_c::~daObj_Bed_c() { /* 80BAD790-80BADA00 000210 0270+00 1/1 0/0 0/0 .text create__11daObj_Bed_cFv */ cPhs__Step daObj_Bed_c::create() { - fopAcM_SetupActor(this, daObj_Bed_c); + fopAcM_ct(this, daObj_Bed_c); mType = getType(); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhase, getResName()); if (step == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_bemos.cpp b/src/d/actor/d_a_obj_bemos.cpp index 20f8668f15f..3d02297a3d5 100644 --- a/src/d/actor/d_a_obj_bemos.cpp +++ b/src/d/actor/d_a_obj_bemos.cpp @@ -1965,7 +1965,7 @@ int daObjBm_c::Delete() { /* 80BB2EB8-80BB3078 004C38 01C0+00 1/0 0/0 0/0 .text daObjBm_create1st__FP9daObjBm_c */ static int daObjBm_create1st(daObjBm_c* i_this) { - fopAcM_SetupActor(i_this, daObjBm_c); + fopAcM_ct(i_this, daObjBm_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_bhashi.cpp b/src/d/actor/d_a_obj_bhashi.cpp index 3c1c904585f..285278aeef7 100644 --- a/src/d/actor/d_a_obj_bhashi.cpp +++ b/src/d/actor/d_a_obj_bhashi.cpp @@ -395,7 +395,7 @@ int daObjBHASHI_c::CreateHeap() { /* 8057842C-805786B4 001A4C 0288+00 1/1 0/0 0/0 .text create__13daObjBHASHI_cFv */ int daObjBHASHI_c::create() { - fopAcM_SetupActor(this, daObjBHASHI_c); + fopAcM_ct(this, daObjBHASHI_c); int phase_state = dComIfG_resLoad(&mPhase, l_arcName); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_bhbridge.cpp b/src/d/actor/d_a_obj_bhbridge.cpp index 6b917e2abae..13379e8826c 100644 --- a/src/d/actor/d_a_obj_bhbridge.cpp +++ b/src/d/actor/d_a_obj_bhbridge.cpp @@ -97,7 +97,7 @@ static int daObjBhbridge_Delete(daObjBhbridge_c* i_this) { static char* l_arcName = "BHBridge"; inline int daObjBhbridge_c::create() { - fopAcM_SetupActor(this, daObjBhbridge_c); + fopAcM_ct(this, daObjBhbridge_c); int rv = dComIfG_resLoad(&mPhase, l_arcName); if (rv == cPhs_COMPLEATE_e) { int dzb_id = dComIfG_getObjctResName2Index(l_arcName, "M_BHbridge.dzb"); diff --git a/src/d/actor/d_a_obj_bk_leaf.cpp b/src/d/actor/d_a_obj_bk_leaf.cpp index ddff82cb23d..b20579410e9 100644 --- a/src/d/actor/d_a_obj_bk_leaf.cpp +++ b/src/d/actor/d_a_obj_bk_leaf.cpp @@ -84,7 +84,7 @@ int daBkLeaf_c::CreateHeap() { /* 80BB63F4-80BB64A8 000394 00B4+00 1/1 0/0 0/0 .text create__10daBkLeaf_cFv */ int daBkLeaf_c::create() { - fopAcM_SetupActor(this, daBkLeaf_c); + fopAcM_ct(this, daBkLeaf_c); int retVal = dComIfG_resLoad(&mPhase, l_arcName); if (retVal == cPhs_COMPLEATE_e) { if (!fopAcM_entrySolidHeap(this, CheckCreateHeap, 0x980)) { diff --git a/src/d/actor/d_a_obj_bkdoor.cpp b/src/d/actor/d_a_obj_bkdoor.cpp index f2711af4bd7..fdbca940e92 100644 --- a/src/d/actor/d_a_obj_bkdoor.cpp +++ b/src/d/actor/d_a_obj_bkdoor.cpp @@ -200,7 +200,7 @@ int daObjBkDoor_c::Delete() { /* 805793BC-8057941C 00071C 0060+00 1/0 0/0 0/0 .text daObjBkDoor_create1st__FP13daObjBkDoor_c */ static int daObjBkDoor_create1st(daObjBkDoor_c* i_this) { - fopAcM_SetupActor(i_this, daObjBkDoor_c); + fopAcM_ct(i_this, daObjBkDoor_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_bky_rock.cpp b/src/d/actor/d_a_obj_bky_rock.cpp index 4e6cd2318ca..0982d2cad1a 100644 --- a/src/d/actor/d_a_obj_bky_rock.cpp +++ b/src/d/actor/d_a_obj_bky_rock.cpp @@ -41,7 +41,7 @@ daBkyRock_c::~daBkyRock_c() { /* 80BB6C4C-80BB6D60 00048C 0114+00 1/1 0/0 0/0 .text create__11daBkyRock_cFv */ int daBkyRock_c::create() { - fopAcM_SetupActor(this, daBkyRock_c); + fopAcM_ct(this, daBkyRock_c); u8 swBit0 = getSwBit0(); if (fopAcM_isSwitch(this, swBit0)) { return cPhs_ERROR_e; @@ -441,7 +441,7 @@ void daBkyRock_c::callBombEmt(int particleNum, u16 const* particleIds) { /* 80BB7D50-80BB7DA4 001590 0054+00 1/0 0/0 0/0 .text daBkyRock_create__FP11daBkyRock_c */ static int daBkyRock_create(daBkyRock_c* i_this) { - fopAcM_SetupActor(i_this, daBkyRock_c); + fopAcM_ct(i_this, daBkyRock_c); return i_this->create(); } diff --git a/src/d/actor/d_a_obj_bmWindow.cpp b/src/d/actor/d_a_obj_bmWindow.cpp index 78d8b57d8eb..999eb2c2154 100644 --- a/src/d/actor/d_a_obj_bmWindow.cpp +++ b/src/d/actor/d_a_obj_bmWindow.cpp @@ -67,7 +67,7 @@ static Vec const l_check_area[4] = { /* 80BB846C-80BB869C 00034C 0230+00 1/1 0/0 0/0 .text create__12daBmWindow_cFv */ int daBmWindow_c::create() { - fopAcM_SetupActor(this, daBmWindow_c); + fopAcM_ct(this, daBmWindow_c); if (fopAcM_isSwitch(this, (u8)fopAcM_GetParam(this))) { return cPhs_ERROR_e; } diff --git a/src/d/actor/d_a_obj_bmshutter.cpp b/src/d/actor/d_a_obj_bmshutter.cpp index 7079d524939..69ced830249 100644 --- a/src/d/actor/d_a_obj_bmshutter.cpp +++ b/src/d/actor/d_a_obj_bmshutter.cpp @@ -90,7 +90,7 @@ int daObjBmSh_c::CreateHeap() { /* 80BB9CC0-80BB9DB4 0002E0 00F4+00 1/1 0/0 0/0 .text create__11daObjBmSh_cFv */ int daObjBmSh_c::create() { - fopAcM_SetupActor(this, daObjBmSh_c); + fopAcM_ct(this, daObjBmSh_c); if (!mIsInitialized) { mHomeX = home.angle.x; diff --git a/src/d/actor/d_a_obj_bombf.cpp b/src/d/actor/d_a_obj_bombf.cpp index 0b4eed5d05f..66b6b43d1a0 100644 --- a/src/d/actor/d_a_obj_bombf.cpp +++ b/src/d/actor/d_a_obj_bombf.cpp @@ -25,7 +25,7 @@ static bool daObjBombf_createHeap(fopAc_ac_c* i_this) { /* 80BBAA84-80BBAB9C 000104 0118+00 1/1 0/0 0/0 .text create__12daObjBombf_cFv */ int daObjBombf_c::create() { - fopAcM_SetupActor(this, daObjBombf_c); + fopAcM_ct(this, daObjBombf_c); int phase = dComIfG_resLoad(&field_0x568, l_arcName); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_bosswarp.cpp b/src/d/actor/d_a_obj_bosswarp.cpp index 8c956b61d1c..3d9f4bf6139 100644 --- a/src/d/actor/d_a_obj_bosswarp.cpp +++ b/src/d/actor/d_a_obj_bosswarp.cpp @@ -170,7 +170,7 @@ int daObjBossWarp_c::CreateHeap() { /* 80579B70-80579C30 0005B0 00C0+00 1/1 0/0 0/0 .text create__15daObjBossWarp_cFv */ cPhs__Step daObjBossWarp_c::create() { - fopAcM_SetupActor(this, daObjBossWarp_c); + fopAcM_ct(this, daObjBossWarp_c); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhaseReq, l_arcName); if (step == cPhs_COMPLEATE_e) { if (!fopAcM_entrySolidHeap(this, CheckCreateHeap, 0x18e0)) { diff --git a/src/d/actor/d_a_obj_boumato.cpp b/src/d/actor/d_a_obj_boumato.cpp index e2e845c7cc2..62f0e8b64dd 100644 --- a/src/d/actor/d_a_obj_boumato.cpp +++ b/src/d/actor/d_a_obj_boumato.cpp @@ -60,7 +60,7 @@ daObj_BouMato_c::~daObj_BouMato_c() { /* 80BBB230-80BBB558 000330 0328+00 1/1 0/0 0/0 .text create__15daObj_BouMato_cFv */ int daObj_BouMato_c::create() { - fopAcM_SetupActor(this, daObj_BouMato_c); + fopAcM_ct(this, daObj_BouMato_c); field_0xa32 = getType(); int rv = dComIfG_resLoad(&mPhase, getResName()); if (rv == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_brakeeff.cpp b/src/d/actor/d_a_obj_brakeeff.cpp index 8986f83f1da..41cade46af8 100644 --- a/src/d/actor/d_a_obj_brakeeff.cpp +++ b/src/d/actor/d_a_obj_brakeeff.cpp @@ -204,7 +204,7 @@ int daObj_Brakeeff_Create(fopAc_ac_c* i_this) { obj_brakeeff_class* a_this = static_cast(i_this); - fopAcM_SetupActor(a_this, obj_brakeeff_class); + fopAcM_ct(a_this, obj_brakeeff_class); int res_load_result = dComIfG_resLoad(&a_this->mRequestOfPhase, "Obj_Bef"); diff --git a/src/d/actor/d_a_obj_brg.cpp b/src/d/actor/d_a_obj_brg.cpp index 6ac6a7e9833..e0d80202abf 100644 --- a/src/d/actor/d_a_obj_brg.cpp +++ b/src/d/actor/d_a_obj_brg.cpp @@ -1660,7 +1660,7 @@ static int daObj_Brg_Create(fopAc_ac_c* i_this) { br_s* part; int loop, sp60, brno, iter; int fop_id = fopAcM_GetID(i_this); - fopAcM_SetupActor(i_this, obj_brg_class); + fopAcM_ct(i_this, obj_brg_class); phase_state = dComIfG_resLoad(&a_this->mPhase, "Obj_brg"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_bsGate.cpp b/src/d/actor/d_a_obj_bsGate.cpp index af607fc0234..c2dfa073502 100644 --- a/src/d/actor/d_a_obj_bsGate.cpp +++ b/src/d/actor/d_a_obj_bsGate.cpp @@ -37,7 +37,7 @@ int daBsGate_c::CreateHeap() { /* 80BC2A18-80BC2B6C 000278 0154+00 1/1 0/0 0/0 .text create__10daBsGate_cFv */ cPhs__Step daBsGate_c::create() { - fopAcM_SetupActor(this, daBsGate_c); + fopAcM_ct(this, daBsGate_c); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhaseReq, "S_Zgate"); if (step == cPhs_COMPLEATE_e) { if (MoveBGCreate("S_Zgate", 7, dBgS_MoveBGProc_TypicalRotY, 0xf00, NULL) == cPhs_ERROR_e) { diff --git a/src/d/actor/d_a_obj_bubblePilar.cpp b/src/d/actor/d_a_obj_bubblePilar.cpp index 19724682bee..7461143047c 100644 --- a/src/d/actor/d_a_obj_bubblePilar.cpp +++ b/src/d/actor/d_a_obj_bubblePilar.cpp @@ -61,7 +61,7 @@ int daBubbPilar_c::CreateHeap() { /* 80BC35D0-80BC3848 0002D0 0278+00 1/1 0/0 0/0 .text create__13daBubbPilar_cFv */ int daBubbPilar_c::create() { - fopAcM_SetupActor(this, daBubbPilar_c); + fopAcM_ct(this, daBubbPilar_c); int rv = dComIfG_resLoad(&mPhase, "M_Crack"); switch (rv) { case cPhs_COMPLEATE_e: diff --git a/src/d/actor/d_a_obj_burnbox.cpp b/src/d/actor/d_a_obj_burnbox.cpp index eccb3f5cca9..19106d69d72 100644 --- a/src/d/actor/d_a_obj_burnbox.cpp +++ b/src/d/actor/d_a_obj_burnbox.cpp @@ -189,7 +189,7 @@ int daObjBurnBox_c::Delete() { /* 8046EC50-8046ED44 000630 00F4+00 1/0 0/0 0/0 .text daObjBurnBox_create1st__FP14daObjBurnBox_c */ int daObjBurnBox_create1st(daObjBurnBox_c* i_this) { - fopAcM_SetupActor(i_this, daObjBurnBox_c); + fopAcM_ct(i_this, daObjBurnBox_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_carry.cpp b/src/d/actor/d_a_obj_carry.cpp index 696b2b38700..e71445a6e9d 100644 --- a/src/d/actor/d_a_obj_carry.cpp +++ b/src/d/actor/d_a_obj_carry.cpp @@ -946,7 +946,7 @@ void daObjCarry_c::setBaseMtx() { /* 8046FACC-8046FB78 000B4C 00AC+00 1/1 0/0 0/0 .text preInit__12daObjCarry_cFv */ int daObjCarry_c::preInit() { - fopAcM_SetupActor(this, daObjCarry_c); + fopAcM_ct(this, daObjCarry_c); if (!mInitParams) { mItemNo = home.angle.x; diff --git a/src/d/actor/d_a_obj_catdoor.cpp b/src/d/actor/d_a_obj_catdoor.cpp index 88f5146f680..02bcb092d29 100644 --- a/src/d/actor/d_a_obj_catdoor.cpp +++ b/src/d/actor/d_a_obj_catdoor.cpp @@ -85,7 +85,7 @@ static int createSolidHeap(fopAc_ac_c* i_this) { } int daObjCatDoor_c::create() { - fopAcM_SetupActor(this, daObjCatDoor_c); + fopAcM_ct(this, daObjCatDoor_c); int phase_state = dComIfG_resLoad(&mPhaseReq, l_arcName); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_cb.cpp b/src/d/actor/d_a_obj_cb.cpp index 1edc387ef40..275eeb179b7 100644 --- a/src/d/actor/d_a_obj_cb.cpp +++ b/src/d/actor/d_a_obj_cb.cpp @@ -207,7 +207,7 @@ static daObj_Cb_HIO_c l_HIO; /* 80BC5408-80BC563C 0009C8 0234+00 1/0 0/0 0/0 .text daObj_Cb_Create__FP10fopAc_ac_c */ static int daObj_Cb_Create(fopAc_ac_c* actor) { - fopAcM_SetupActor(actor, obj_cb_class); + fopAcM_ct(actor, obj_cb_class); obj_cb_class* i_this = (obj_cb_class*)actor; int rv = dComIfG_resLoad(&i_this->mPhase, "Obj_cb"); if (rv == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_cblock.cpp b/src/d/actor/d_a_obj_cblock.cpp index 749dcb2ae38..003e0fd145e 100644 --- a/src/d/actor/d_a_obj_cblock.cpp +++ b/src/d/actor/d_a_obj_cblock.cpp @@ -147,7 +147,7 @@ static inline void dummylfunc() { /* 80BC5E98-80BC6020 000578 0188+00 1/1 0/0 0/0 .text create__11daObjCBlk_cFv */ int daObjCBlk_c::create() { - fopAcM_SetupActor(this, daObjCBlk_c); + fopAcM_ct(this, daObjCBlk_c); int rv = dComIfG_resLoad(&phase, l_arcName); if (rv == cPhs_COMPLEATE_e) { rv = MoveBGCreate(l_arcName, 9, dBgS_MoveBGProc_TypicalRotY, 0x1000, NULL); diff --git a/src/d/actor/d_a_obj_cboard.cpp b/src/d/actor/d_a_obj_cboard.cpp index 09be07ecac9..32bc0a9cb8e 100644 --- a/src/d/actor/d_a_obj_cboard.cpp +++ b/src/d/actor/d_a_obj_cboard.cpp @@ -146,7 +146,7 @@ int daObjBoard_c::Delete() { /* 8057BCFC-8057BD5C 00041C 0060+00 1/0 0/0 0/0 .text daObjBoard_create1st__FP12daObjBoard_c */ static int daObjBoard_create1st(daObjBoard_c* i_this) { - fopAcM_SetupActor(i_this, daObjBoard_c); + fopAcM_ct(i_this, daObjBoard_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_cdoor.cpp b/src/d/actor/d_a_obj_cdoor.cpp index eccafeb7f86..3bdd5184b87 100644 --- a/src/d/actor/d_a_obj_cdoor.cpp +++ b/src/d/actor/d_a_obj_cdoor.cpp @@ -61,7 +61,7 @@ static void* daObjCdoor_searchChain(fopAc_ac_c* i_actor, void* i_this) { /* 80BC6F30-80BC7234 0001F0 0304+00 1/1 0/0 0/0 .text create__12daObjCdoor_cFv */ cPhs__Step daObjCdoor_c::create() { - fopAcM_SetupActor(this, daObjCdoor_c); + fopAcM_ct(this, daObjCdoor_c); mType = (fopAcM_GetParam(this) >> 8) & 0xf; cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhaseReq, l_arcName[mType]); if (step == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_chandelier.cpp b/src/d/actor/d_a_obj_chandelier.cpp index f1a83066109..7fc7d2d2949 100644 --- a/src/d/actor/d_a_obj_chandelier.cpp +++ b/src/d/actor/d_a_obj_chandelier.cpp @@ -44,7 +44,7 @@ int daObjChandelier_c::CreateHeap() { /* 80BC8078-80BC8160 0001B8 00E8+00 1/0 0/0 0/0 .text create1st__17daObjChandelier_cFv */ cPhs__Step daObjChandelier_c::create1st() { - fopAcM_SetupActor(this, daObjChandelier_c); + fopAcM_ct(this, daObjChandelier_c); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(this, l_arcName); if (step == cPhs_COMPLEATE_e) { step = (cPhs__Step)MoveBGCreate(l_arcName, 7, dBgS_MoveBGProc_TypicalRotY, 0x4500, &mMtx); @@ -257,7 +257,7 @@ void daObjChandelier_c::hookSwingInitParm() { /* 80BC8B7C-80BC8BDC 000CBC 0060+00 1/0 0/0 0/0 .text * daObjChandelier_create1st__FP17daObjChandelier_c */ static cPhs__Step daObjChandelier_create1st(daObjChandelier_c* i_this) { - fopAcM_SetupActor(i_this, daObjChandelier_c); + fopAcM_ct(i_this, daObjChandelier_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_chest.cpp b/src/d/actor/d_a_obj_chest.cpp index 154b0a43602..af980c8892e 100644 --- a/src/d/actor/d_a_obj_chest.cpp +++ b/src/d/actor/d_a_obj_chest.cpp @@ -111,7 +111,7 @@ int daObjChest_c::CreateHeap() { /* 80BC92B0-80BC93F0 000430 0140+00 1/1 0/0 0/0 .text create__12daObjChest_cFv */ int daObjChest_c::create() { - fopAcM_SetupActor(this, daObjChest_c); + fopAcM_ct(this, daObjChest_c); int phase = dComIfG_resLoad(&mPhaseReq, l_arcName); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_cho.cpp b/src/d/actor/d_a_obj_cho.cpp index dc2528d8f1f..3425ccf1ac6 100644 --- a/src/d/actor/d_a_obj_cho.cpp +++ b/src/d/actor/d_a_obj_cho.cpp @@ -560,7 +560,7 @@ bool daObjCHO_c::CreateChk() { /* 80BCC01C-80BCC3C8 001DFC 03AC+00 1/1 0/0 0/0 .text create__10daObjCHO_cFv */ cPhs__Step daObjCHO_c::create() { - fopAcM_SetupActor(this, daObjCHO_c); + fopAcM_ct(this, daObjCHO_c); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhaseReq, "I_Cho"); if (step == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_cowdoor.cpp b/src/d/actor/d_a_obj_cowdoor.cpp index d9f60bc7619..62210834115 100644 --- a/src/d/actor/d_a_obj_cowdoor.cpp +++ b/src/d/actor/d_a_obj_cowdoor.cpp @@ -43,7 +43,7 @@ static const char* l_dzbName = "A_UHDoor.dzb"; /* 80BCC93C-80BCCA1C 0001BC 00E0+00 1/1 0/0 0/0 .text create__11daCowdoor_cFv */ int daCowdoor_c::create() { - fopAcM_SetupActor(this, daCowdoor_c); + fopAcM_ct(this, daCowdoor_c); int phase = dComIfG_resLoad(&field_0x5a0, l_arcName); if (phase == cPhs_COMPLEATE_e) { phase = diff --git a/src/d/actor/d_a_obj_crope.cpp b/src/d/actor/d_a_obj_crope.cpp index 155ab100e07..6b534acda35 100644 --- a/src/d/actor/d_a_obj_crope.cpp +++ b/src/d/actor/d_a_obj_crope.cpp @@ -50,7 +50,7 @@ static GXColor color = { /* 80BCCD64-80BCD3D8 000104 0674+00 1/1 0/0 0/0 .text create__12daObjCrope_cFv */ int daObjCrope_c::create() { - fopAcM_SetupActor(this, daObjCrope_c); + fopAcM_ct(this, daObjCrope_c); int rv = dComIfG_resLoad(&mPhase, l_arcName); if (rv == cPhs_COMPLEATE_e) { if (fopAcM_entrySolidHeap(this, daObjCrope_createHeap, 0x2900) == 0) { diff --git a/src/d/actor/d_a_obj_crvfence.cpp b/src/d/actor/d_a_obj_crvfence.cpp index 3adbd2b4f52..4803d1ddaa2 100644 --- a/src/d/actor/d_a_obj_crvfence.cpp +++ b/src/d/actor/d_a_obj_crvfence.cpp @@ -342,7 +342,7 @@ int daObjCRVFENCE_c::CreateHeap() { /* 80BCFAE4-80BCFD6C 000EC4 0288+00 1/1 0/0 0/0 .text create__15daObjCRVFENCE_cFv */ cPhs__Step daObjCRVFENCE_c::create() { - fopAcM_SetupActor(this, daObjCRVFENCE_c); + fopAcM_ct(this, daObjCRVFENCE_c); cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&mPhase, l_arcName); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_crvgate.cpp b/src/d/actor/d_a_obj_crvgate.cpp index b6b35d169c0..be4f8e326bd 100644 --- a/src/d/actor/d_a_obj_crvgate.cpp +++ b/src/d/actor/d_a_obj_crvgate.cpp @@ -743,7 +743,7 @@ void daObjCRVGATE_c::SetDoor() { /* 80BD28C0-80BD2BE4 0025A0 0324+00 1/1 0/0 0/0 .text create__14daObjCRVGATE_cFv */ int daObjCRVGATE_c::create() { - fopAcM_SetupActor(this, daObjCRVGATE_c); + fopAcM_ct(this, daObjCRVGATE_c); int ret = dComIfG_resLoad(&mPhaseReq, l_arcName); if (ret == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_crvhahen.cpp b/src/d/actor/d_a_obj_crvhahen.cpp index f8309e1aa64..20a6163d9af 100644 --- a/src/d/actor/d_a_obj_crvhahen.cpp +++ b/src/d/actor/d_a_obj_crvhahen.cpp @@ -226,7 +226,7 @@ static int daObjCRVHAHEN_Execute(daObjCRVHAHEN_c* i_this) { /* 80BD3DBC-80BD3F9C 000AFC 01E0+00 1/1 0/0 0/0 .text create__15daObjCRVHAHEN_cFv */ int daObjCRVHAHEN_c::create() { - fopAcM_SetupActor(this, daObjCRVHAHEN_c); + fopAcM_ct(this, daObjCRVHAHEN_c); diff --git a/src/d/actor/d_a_obj_crvlh_down.cpp b/src/d/actor/d_a_obj_crvlh_down.cpp index 3989e67cb7a..e110dfaa7f2 100644 --- a/src/d/actor/d_a_obj_crvlh_down.cpp +++ b/src/d/actor/d_a_obj_crvlh_down.cpp @@ -150,7 +150,7 @@ int daObjCRVLH_DW_c::CreateHeap() { /* 80BD4764-80BD49EC 0006A4 0288+00 1/1 0/0 0/0 .text create__15daObjCRVLH_DW_cFv */ int daObjCRVLH_DW_c::create() { - fopAcM_SetupActor(this, daObjCRVLH_DW_c); + fopAcM_ct(this, daObjCRVLH_DW_c); int phase = dComIfG_resLoad(&mPhase, l_arcName); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_crvlh_up.cpp b/src/d/actor/d_a_obj_crvlh_up.cpp index 51278d9507e..d72ef72b553 100644 --- a/src/d/actor/d_a_obj_crvlh_up.cpp +++ b/src/d/actor/d_a_obj_crvlh_up.cpp @@ -109,7 +109,7 @@ int daObjCRVLH_UP_c::CreateHeap() { /* 80BD53F0-80BD5614 000590 0224+00 1/1 0/0 0/0 .text create__15daObjCRVLH_UP_cFv */ int daObjCRVLH_UP_c::create() { - fopAcM_SetupActor(this, daObjCRVLH_UP_c); + fopAcM_ct(this, daObjCRVLH_UP_c); int phase = dComIfG_resLoad(&mPhase, l_arcName); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_crvsteel.cpp b/src/d/actor/d_a_obj_crvsteel.cpp index d71d75bc270..1a45adba536 100644 --- a/src/d/actor/d_a_obj_crvsteel.cpp +++ b/src/d/actor/d_a_obj_crvsteel.cpp @@ -98,7 +98,7 @@ int daObjCRVSTEEL_c::CreateHeap() { /* 80BD5E30-80BD6030 0002F0 0200+00 1/1 0/0 0/0 .text create__15daObjCRVSTEEL_cFv */ int daObjCRVSTEEL_c::create() { - fopAcM_SetupActor(this, daObjCRVSTEEL_c); + fopAcM_ct(this, daObjCRVSTEEL_c); int rv = dComIfG_resLoad(&mPhase, l_arcName); if (rv == cPhs_COMPLEATE_e) { gravity = -9.0f; diff --git a/src/d/actor/d_a_obj_crystal.cpp b/src/d/actor/d_a_obj_crystal.cpp index c5832378687..f10034da49f 100644 --- a/src/d/actor/d_a_obj_crystal.cpp +++ b/src/d/actor/d_a_obj_crystal.cpp @@ -78,7 +78,7 @@ int daObjCrystal_c::CreateHeap() { /* 80BD6664-80BD6718 000344 00B4+00 1/1 0/0 0/0 .text create__14daObjCrystal_cFv */ int daObjCrystal_c::create() { - fopAcM_SetupActor(this, daObjCrystal_c); + fopAcM_ct(this, daObjCrystal_c); int phase = dComIfG_resLoad(&mPhase, l_arcName); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_cwall.cpp b/src/d/actor/d_a_obj_cwall.cpp index 4948fc189d8..6140d13e4a8 100644 --- a/src/d/actor/d_a_obj_cwall.cpp +++ b/src/d/actor/d_a_obj_cwall.cpp @@ -855,7 +855,7 @@ int daObjCwall_c::Delete() { /* 80BD9988-80BD9B70 003028 01E8+00 1/0 0/0 0/0 .text daObjCwall_create1st__FP12daObjCwall_c */ static int daObjCwall_create1st(daObjCwall_c* i_this) { - fopAcM_SetupActor(i_this, daObjCwall_c); + fopAcM_ct(i_this, daObjCwall_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_dan.cpp b/src/d/actor/d_a_obj_dan.cpp index 3fe2560e19f..01fdcdee3a3 100644 --- a/src/d/actor/d_a_obj_dan.cpp +++ b/src/d/actor/d_a_obj_dan.cpp @@ -535,7 +535,7 @@ bool daObjDAN_c::CreateChk() { /* 80BDBCB8-80BDC170 001818 04B8+00 1/1 0/0 0/0 .text create__10daObjDAN_cFv */ cPhs__Step daObjDAN_c::create() { - fopAcM_SetupActor(this, daObjDAN_c); + fopAcM_ct(this, daObjDAN_c); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhase, "I_Dan"); if (step == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_digholl.cpp b/src/d/actor/d_a_obj_digholl.cpp index 48162b65b2d..8325c754372 100644 --- a/src/d/actor/d_a_obj_digholl.cpp +++ b/src/d/actor/d_a_obj_digholl.cpp @@ -11,7 +11,7 @@ /* 80BDC618-80BDC73C 000078 0124+00 1/1 0/0 0/0 .text create__14daObjDigholl_cFv */ int daObjDigholl_c::create() { - fopAcM_SetupActor(this, daObjDigholl_c); + fopAcM_ct(this, daObjDigholl_c); field_0x569 = fopAcM_GetParam(this); field_0x56a = fopAcM_GetParam(this) >> 8; field_0x56c = fopAcM_GetParam(this) >> 0x10 & 0xff; diff --git a/src/d/actor/d_a_obj_digplace.cpp b/src/d/actor/d_a_obj_digplace.cpp index af25c2cfbfd..d3808612fef 100644 --- a/src/d/actor/d_a_obj_digplace.cpp +++ b/src/d/actor/d_a_obj_digplace.cpp @@ -12,7 +12,7 @@ /* 8057BF98-8057C138 000078 01A0+00 1/1 0/0 0/0 .text create__12daObjDigpl_cFv */ int daObjDigpl_c::create() { - fopAcM_SetupActor(this, daObjDigpl_c); + fopAcM_ct(this, daObjDigpl_c); mType = (fopAcM_GetParam(this) >> 8) & 0xF; mSwitch = fopAcM_GetParam(this) & 0xFF; diff --git a/src/d/actor/d_a_obj_digsnow.cpp b/src/d/actor/d_a_obj_digsnow.cpp index bdcbb70fbe5..e1f1d26dc66 100644 --- a/src/d/actor/d_a_obj_digsnow.cpp +++ b/src/d/actor/d_a_obj_digsnow.cpp @@ -179,7 +179,7 @@ int daObjDigSnow_c::Delete() { /* 80BDD2EC-80BDD418 00070C 012C+00 1/0 0/0 0/0 .text daObjDigSnow_create1st__FP14daObjDigSnow_c */ static int daObjDigSnow_create1st(daObjDigSnow_c* i_this) { - fopAcM_SetupActor(i_this, daObjDigSnow_c); + fopAcM_ct(i_this, daObjDigSnow_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_dmelevator.cpp b/src/d/actor/d_a_obj_dmelevator.cpp index 583d7f5d8ce..3265ce166fc 100644 --- a/src/d/actor/d_a_obj_dmelevator.cpp +++ b/src/d/actor/d_a_obj_dmelevator.cpp @@ -721,7 +721,7 @@ int daObjDmElevator_c::Delete() { /* 80BDF764-80BDF7D8 001EE4 0074+00 1/0 0/0 0/0 .text * daObjDmElevator_create1st__FP17daObjDmElevator_c */ static int daObjDmElevator_create1st(daObjDmElevator_c* i_this) { - fopAcM_SetupActor(i_this, daObjDmElevator_c); + fopAcM_ct(i_this, daObjDmElevator_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_drop.cpp b/src/d/actor/d_a_obj_drop.cpp index e1357a124c9..8fe5a9b152a 100644 --- a/src/d/actor/d_a_obj_drop.cpp +++ b/src/d/actor/d_a_obj_drop.cpp @@ -82,7 +82,7 @@ int daObjDrop_c::Create() { /* 80BDFE58-80BE005C 0001F8 0204+00 1/1 0/0 0/0 .text create__11daObjDrop_cFv */ int daObjDrop_c::create() { - fopAcM_SetupActor(this, daObjDrop_c); + fopAcM_ct(this, daObjDrop_c); if (dComIfGs_isTbox(getSave())) { return cPhs_ERROR_e; diff --git a/src/d/actor/d_a_obj_dust.cpp b/src/d/actor/d_a_obj_dust.cpp index b3736bed6a2..7a9e3250d55 100644 --- a/src/d/actor/d_a_obj_dust.cpp +++ b/src/d/actor/d_a_obj_dust.cpp @@ -148,7 +148,7 @@ static int daObjDust_Delete(daObjDust_c* i_this) { } int daObjDust_c::create() { - fopAcM_SetupActor(this, daObjDust_c); + fopAcM_ct(this, daObjDust_c); int phase_state = dComIfG_resLoad(&mPhaseReq, l_arcName); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_eff.cpp b/src/d/actor/d_a_obj_eff.cpp index d5b79cc5c7d..a111a28b716 100644 --- a/src/d/actor/d_a_obj_eff.cpp +++ b/src/d/actor/d_a_obj_eff.cpp @@ -12,7 +12,7 @@ /* 8057C9D8-8057CA94 000078 00BC+00 1/1 0/0 0/0 .text _create__Q28daObjEff5Act_cFv */ int daObjEff::Act_c::_create() { - fopAcM_SetupActor(this, Act_c); + fopAcM_ct(this, Act_c); if (daObj::PrmAbstract(this, PRM_8, PRM_0) == 3) { dComIfGp_particle_setColor(0x00E7, ¤t.pos, NULL, NULL, NULL, 0.0f, 55, NULL, &scale, diff --git a/src/d/actor/d_a_obj_enemy_create.cpp b/src/d/actor/d_a_obj_enemy_create.cpp index c8a46048fe4..96db6726779 100644 --- a/src/d/actor/d_a_obj_enemy_create.cpp +++ b/src/d/actor/d_a_obj_enemy_create.cpp @@ -225,7 +225,7 @@ void daObjE_CREATE_c::NameChk() { /* 80BE3770-80BE3878 000670 0108+00 1/1 0/0 0/0 .text create__15daObjE_CREATE_cFv */ int daObjE_CREATE_c::create() { - fopAcM_SetupActor(this, daObjE_CREATE_c); + fopAcM_ct(this, daObjE_CREATE_c); NameChk(); u32 enemyType = fopAcM_GetParam(this) & 0xF; diff --git a/src/d/actor/d_a_obj_fallobj.cpp b/src/d/actor/d_a_obj_fallobj.cpp index 68dda45de1f..0f924d8684e 100644 --- a/src/d/actor/d_a_obj_fallobj.cpp +++ b/src/d/actor/d_a_obj_fallobj.cpp @@ -413,7 +413,7 @@ int daObjFallObj_c::Delete() { /* 80BE4990-80BE4A04 001050 0074+00 1/0 0/0 0/0 .text daObjFallObj_create1st__FP14daObjFallObj_c */ static int daObjFallObj_create1st(daObjFallObj_c* i_this) { - fopAcM_SetupActor(i_this, daObjFallObj_c); + fopAcM_ct(i_this, daObjFallObj_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_fan.cpp b/src/d/actor/d_a_obj_fan.cpp index 641d12338e7..396b885e484 100644 --- a/src/d/actor/d_a_obj_fan.cpp +++ b/src/d/actor/d_a_obj_fan.cpp @@ -338,7 +338,7 @@ int daObjFan_c::Delete() { /* 80BE5A78-80BE5B2C 000EB8 00B4+00 1/0 0/0 0/0 .text daObjFan_create1st__FP10daObjFan_c */ static void daObjFan_create1st(daObjFan_c* param_0) { - fopAcM_SetupActor(param_0, daObjFan_c); + fopAcM_ct(param_0, daObjFan_c); param_0->create1st(); } diff --git a/src/d/actor/d_a_obj_fchain.cpp b/src/d/actor/d_a_obj_fchain.cpp index af0c4590109..3913229d63a 100644 --- a/src/d/actor/d_a_obj_fchain.cpp +++ b/src/d/actor/d_a_obj_fchain.cpp @@ -33,7 +33,7 @@ static Vec const localVec = { /* 80BE6074-80BE6328 0000F4 02B4+00 1/1 0/0 0/0 .text create__13daObjFchain_cFv */ int daObjFchain_c::create() { - fopAcM_SetupActor(this, daObjFchain_c); + fopAcM_ct(this, daObjFchain_c); int rv = dComIfG_resLoad(&mPhase, l_arcName); switch (rv) { case cPhs_COMPLEATE_e: diff --git a/src/d/actor/d_a_obj_fireWood.cpp b/src/d/actor/d_a_obj_fireWood.cpp index 465777027e8..0a496ce494a 100644 --- a/src/d/actor/d_a_obj_fireWood.cpp +++ b/src/d/actor/d_a_obj_fireWood.cpp @@ -50,7 +50,7 @@ static cull_box l_cull_box = { /* 80BE7708-80BE7910 0001C8 0208+00 1/1 0/0 0/0 .text create__12daFireWood_cFv */ int daFireWood_c::create() { - fopAcM_SetupActor(this, daFireWood_c); + fopAcM_ct(this, daFireWood_c); setBaseMtx(); mCcStts.Init(0xFF, 0xFF, this); diff --git a/src/d/actor/d_a_obj_fireWood2.cpp b/src/d/actor/d_a_obj_fireWood2.cpp index 0325e8624d3..21ec4d1d87f 100644 --- a/src/d/actor/d_a_obj_fireWood2.cpp +++ b/src/d/actor/d_a_obj_fireWood2.cpp @@ -50,7 +50,7 @@ static cull_box l_cull_box = { /* 80BE8328-80BE85B0 0001C8 0288+00 1/1 0/0 0/0 .text create__13daFireWood2_cFv */ int daFireWood2_c::create() { - fopAcM_SetupActor(this, daFireWood2_c); + fopAcM_ct(this, daFireWood2_c); setBaseMtx(); mCcStts.Init(0xFF, 0xFF, this); diff --git a/src/d/actor/d_a_obj_firepillar.cpp b/src/d/actor/d_a_obj_firepillar.cpp index d3c06551f2b..1f8df9cd81e 100644 --- a/src/d/actor/d_a_obj_firepillar.cpp +++ b/src/d/actor/d_a_obj_firepillar.cpp @@ -60,7 +60,7 @@ int daObjFPillar_c::Create() { /* 80BE9230-80BE9360 000190 0130+00 1/1 0/0 0/0 .text create__14daObjFPillar_cFv */ int daObjFPillar_c::create() { - fopAcM_SetupActor(this, daObjFPillar_c); + fopAcM_ct(this, daObjFPillar_c); int rv = Create(); if (rv == 0) { return cPhs_ERROR_e; diff --git a/src/d/actor/d_a_obj_firepillar2.cpp b/src/d/actor/d_a_obj_firepillar2.cpp index 353836b08ac..d36c61673fa 100644 --- a/src/d/actor/d_a_obj_firepillar2.cpp +++ b/src/d/actor/d_a_obj_firepillar2.cpp @@ -139,7 +139,7 @@ int daObjFPillar2_c::CreateHeap() { /* 80BEA228-80BEA400 0005E8 01D8+00 1/1 0/0 0/0 .text create__15daObjFPillar2_cFv */ int daObjFPillar2_c::create() { - fopAcM_SetupActor(this, daObjFPillar2_c); + fopAcM_ct(this, daObjFPillar2_c); if (mInitAngles == 0) { field_0x97a = home.angle.x; field_0x97c = home.angle.z; diff --git a/src/d/actor/d_a_obj_flag.cpp b/src/d/actor/d_a_obj_flag.cpp index a480e6df7f3..8d10d8fce86 100644 --- a/src/d/actor/d_a_obj_flag.cpp +++ b/src/d/actor/d_a_obj_flag.cpp @@ -292,7 +292,7 @@ static int daObjFlag_Delete(daObjFlag_c* param_0) { FlagJoint_c::~FlagJoint_c() {} inline int daObjFlag_c::create() { - fopAcM_SetupActor(this, daObjFlag_c); + fopAcM_ct(this, daObjFlag_c); int phase_state = dComIfG_resLoad(&mPhase, "FlagObj"); if (phase_state != cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_flag2.cpp b/src/d/actor/d_a_obj_flag2.cpp index bdf38d65abe..95b876f37a2 100644 --- a/src/d/actor/d_a_obj_flag2.cpp +++ b/src/d/actor/d_a_obj_flag2.cpp @@ -429,7 +429,7 @@ static int createSolidHeap(fopAc_ac_c* i_this) { /* 80BED6A0-80BED7A4 0010C0 0104+00 1/1 0/0 0/0 .text create__12daObjFlag2_cFv */ int daObjFlag2_c::create() { - fopAcM_SetupActor(this, daObjFlag2_c); + fopAcM_ct(this, daObjFlag2_c); s8 flagNum = (u8)shape_angle.x; if (flagNum <= -1 || flagNum > 99) { mFlagValid = false; diff --git a/src/d/actor/d_a_obj_flag3.cpp b/src/d/actor/d_a_obj_flag3.cpp index 733fb342bfc..053fa454784 100644 --- a/src/d/actor/d_a_obj_flag3.cpp +++ b/src/d/actor/d_a_obj_flag3.cpp @@ -444,7 +444,7 @@ static int daObjFlag3_Create(fopAc_ac_c* i_this) { /* 80BEF95C-80BEFBC4 000F5C 0268+00 1/1 0/0 0/0 .text create__12daObjFlag3_cFv */ int daObjFlag3_c::create() { - fopAcM_SetupActor(this, daObjFlag3_c); + fopAcM_ct(this, daObjFlag3_c); s8 flagNum = (u8)shape_angle.x; if (flagNum <= -1 || flagNum > 99) { mFlagValid = false; diff --git a/src/d/actor/d_a_obj_fmobj.cpp b/src/d/actor/d_a_obj_fmobj.cpp index 5edb9970a94..b00430f58e1 100644 --- a/src/d/actor/d_a_obj_fmobj.cpp +++ b/src/d/actor/d_a_obj_fmobj.cpp @@ -78,7 +78,7 @@ static int daObj_Fmobj_Create(fopAc_ac_c* i_this_param) { // Fake match - debug says i_this is fake fopAc_ac_c* i_this = (fopAc_ac_c*)i_this_param; obj_fmobj_class* a_this = (obj_fmobj_class*)i_this_param; - fopAcM_SetupActor(i_this, obj_fmobj_class); + fopAcM_ct(i_this, obj_fmobj_class); int phase; phase = dComIfG_resLoad(&a_this->mPhase, "Obj_Fmobj"); diff --git a/src/d/actor/d_a_obj_food.cpp b/src/d/actor/d_a_obj_food.cpp index e128f3ba4d8..3cc6671f0ab 100644 --- a/src/d/actor/d_a_obj_food.cpp +++ b/src/d/actor/d_a_obj_food.cpp @@ -437,7 +437,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { */ static cPhs__Step daObj_Food_Create(fopAc_ac_c* i_this) { obj_food_class* _this = static_cast(i_this); - fopAcM_SetupActor(i_this, obj_food_class); + fopAcM_ct(i_this, obj_food_class); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&_this->mPhase, "Obj_fd"); if (step == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_fw.cpp b/src/d/actor/d_a_obj_fw.cpp index e577bcd8471..c0e2a646dbc 100644 --- a/src/d/actor/d_a_obj_fw.cpp +++ b/src/d/actor/d_a_obj_fw.cpp @@ -252,7 +252,7 @@ static int useHeapInit(fopAc_ac_c* a_this) { /* 80BF28D0-80BF2AB0 000970 01E0+00 1/0 0/0 0/0 .text daObj_Fw_Create__FP10fopAc_ac_c */ static cPhs__Step daObj_Fw_Create(fopAc_ac_c* a_this) { - fopAcM_SetupActor(a_this, obj_fw_class); + fopAcM_ct(a_this, obj_fw_class); obj_fw_class* i_this = (obj_fw_class*)a_this; cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&i_this->mPhase, "RYUW00"); diff --git a/src/d/actor/d_a_obj_gadget.cpp b/src/d/actor/d_a_obj_gadget.cpp index 48ee5e1b0e6..472e9d78994 100644 --- a/src/d/actor/d_a_obj_gadget.cpp +++ b/src/d/actor/d_a_obj_gadget.cpp @@ -161,7 +161,7 @@ daObj_Gadget_c::~daObj_Gadget_c() { /* 80BF2F28-80BF3228 0002E8 0300+00 1/1 0/0 0/0 .text create__14daObj_Gadget_cFv */ int daObj_Gadget_c::create() { - fopAcM_SetupActor(this, daObj_Gadget_c); + fopAcM_ct(this, daObj_Gadget_c); field_0x9d0 = getType(); int rv = dComIfG_resLoad(&mPhase, l_resNameList[l_bmdData[field_0x9d0][1]]); if (rv == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_ganonwall.cpp b/src/d/actor/d_a_obj_ganonwall.cpp index ffceb521b3d..dd266ccd95a 100644 --- a/src/d/actor/d_a_obj_ganonwall.cpp +++ b/src/d/actor/d_a_obj_ganonwall.cpp @@ -96,7 +96,7 @@ int daObjGWall_c::CreateHeap() { /* 80BF4FF0-80BF50A4 000370 00B4+00 1/1 0/0 0/0 .text create__12daObjGWall_cFv */ int daObjGWall_c::create() { - fopAcM_SetupActor(this, daObjGWall_c); + fopAcM_ct(this, daObjGWall_c); cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&mPhaseReq, l_arcName); if (phase == cPhs_COMPLEATE_e) { if (!fopAcM_entrySolidHeap(this, CheckCreateHeap, 0x3500)) { diff --git a/src/d/actor/d_a_obj_ganonwall2.cpp b/src/d/actor/d_a_obj_ganonwall2.cpp index a004cc0158f..701a6ae00dd 100644 --- a/src/d/actor/d_a_obj_ganonwall2.cpp +++ b/src/d/actor/d_a_obj_ganonwall2.cpp @@ -168,7 +168,7 @@ int daObjGWall2_c::Delete() { /* ############################################################################################## */ /* 80BF6038-80BF6098 0008D8 0060+00 1/0 0/0 0/0 .text daObjGWall2_create1st__FP13daObjGWall2_c */ static int daObjGWall2_create1st(daObjGWall2_c* i_this) { - fopAcM_SetupActor(i_this, daObjGWall2_c); + fopAcM_ct(i_this, daObjGWall2_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_gb.cpp b/src/d/actor/d_a_obj_gb.cpp index 8f137478da8..36352da273f 100644 --- a/src/d/actor/d_a_obj_gb.cpp +++ b/src/d/actor/d_a_obj_gb.cpp @@ -171,7 +171,7 @@ static int useHeapInit(fopAc_ac_c* actor) { /* 80BF6AE0-80BF6DB0 000840 02D0+00 1/0 0/0 0/0 .text daObj_Gb_Create__FP10fopAc_ac_c */ static int daObj_Gb_Create(fopAc_ac_c* actor) { - fopAcM_SetupActor(actor, obj_gb_class); + fopAcM_ct(actor, obj_gb_class); obj_gb_class* i_this = (obj_gb_class*)actor; int rv = dComIfG_resLoad(&i_this->mPhase, "Obj_gb"); diff --git a/src/d/actor/d_a_obj_geyser.cpp b/src/d/actor/d_a_obj_geyser.cpp index d7533d65e4c..9e093e2eb25 100644 --- a/src/d/actor/d_a_obj_geyser.cpp +++ b/src/d/actor/d_a_obj_geyser.cpp @@ -721,7 +721,7 @@ int daObjGeyser_c::Delete() { /* 80BF8D98-80BF8E88 001EF8 00F0+00 1/0 0/0 0/0 .text daObjGeyser_create1st__FP13daObjGeyser_c */ static int daObjGeyser_create1st(daObjGeyser_c* i_this) { - fopAcM_SetupActor(i_this, daObjGeyser_c); + fopAcM_ct(i_this, daObjGeyser_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_glowSphere.cpp b/src/d/actor/d_a_obj_glowSphere.cpp index 888d8498886..fd2443f2622 100644 --- a/src/d/actor/d_a_obj_glowSphere.cpp +++ b/src/d/actor/d_a_obj_glowSphere.cpp @@ -95,7 +95,7 @@ int daGlwSph_c::CreateHeap() { /* 80BF95D4-80BF9908 000374 0334+00 1/1 0/0 0/0 .text create__10daGlwSph_cFv */ int daGlwSph_c::create() { - fopAcM_SetupActor(this, daGlwSph_c); + fopAcM_ct(this, daGlwSph_c); int phase_state = dComIfG_resLoad(&mPhase, "glwSphere"); if (phase_state != cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_goGate.cpp b/src/d/actor/d_a_obj_goGate.cpp index cc96dacebd7..261affa54fe 100644 --- a/src/d/actor/d_a_obj_goGate.cpp +++ b/src/d/actor/d_a_obj_goGate.cpp @@ -33,7 +33,7 @@ int daGoGate_c::CreateHeap() { /* 80BFD82C-80BFD984 00026C 0158+00 1/1 0/0 0/0 .text create__10daGoGate_cFv */ cPhs__Step daGoGate_c::create() { - fopAcM_SetupActor(this, daGoGate_c); + fopAcM_ct(this, daGoGate_c); cPhs__Step phase = static_cast(dComIfG_resLoad(&mPhase, "P_Ggate")); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_gomikabe.cpp b/src/d/actor/d_a_obj_gomikabe.cpp index e3be68bfe00..ea194511521 100644 --- a/src/d/actor/d_a_obj_gomikabe.cpp +++ b/src/d/actor/d_a_obj_gomikabe.cpp @@ -303,7 +303,7 @@ static daObjGOMIKABE_HIO_c l_HIO; /* 80BFF164-80BFF5B4 001024 0450+00 1/1 0/0 0/0 .text create__15daObjGOMIKABE_cFv */ int daObjGOMIKABE_c::create() { - fopAcM_SetupActor(this, daObjGOMIKABE_c); + fopAcM_ct(this, daObjGOMIKABE_c); int rv = dComIfG_resLoad(&mPhase, l_arcName); if (rv == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_gpTaru.cpp b/src/d/actor/d_a_obj_gpTaru.cpp index 99b42bcb833..e9e1b7855fe 100644 --- a/src/d/actor/d_a_obj_gpTaru.cpp +++ b/src/d/actor/d_a_obj_gpTaru.cpp @@ -83,7 +83,7 @@ const dCcD_SrcGObjInf daGpTaru_c::mCcDObjInfo = { /* 8057D33C-8057D600 00035C 02C4+00 1/1 0/0 0/0 .text create__10daGpTaru_cFv */ int daGpTaru_c::create() { - fopAcM_SetupActor(this, daGpTaru_c); + fopAcM_ct(this, daGpTaru_c); if (fopAcM_isSwitch(this, fopAcM_GetParam(this) & 0xFF)) { return cPhs_ERROR_e; diff --git a/src/d/actor/d_a_obj_gra2.cpp b/src/d/actor/d_a_obj_gra2.cpp index f6467d9d7a5..04496e19362 100644 --- a/src/d/actor/d_a_obj_gra2.cpp +++ b/src/d/actor/d_a_obj_gra2.cpp @@ -162,7 +162,7 @@ daObj_GrA_c::~daObj_GrA_c() { /* 80C003CC-80C00614 0005AC 0248+00 1/1 0/0 0/0 .text create__11daObj_GrA_cFv */ cPhs__Step daObj_GrA_c::create() { int uVar1 = 0; - fopAcM_SetupActor(this, daObj_GrA_c); + fopAcM_ct(this, daObj_GrA_c); mMode = getMode(); int i; diff --git a/src/d/actor/d_a_obj_graWall.cpp b/src/d/actor/d_a_obj_graWall.cpp index b5eac56604c..1370a9b2685 100644 --- a/src/d/actor/d_a_obj_graWall.cpp +++ b/src/d/actor/d_a_obj_graWall.cpp @@ -10,7 +10,7 @@ /* 80C10BF8-80C10D48 000078 0150+00 1/1 0/0 0/0 .text Create__14daObjGraWall_cFv */ int daObjGraWall_c::Create() { - fopAcM_SetupActor(this, daObjGraWall_c); + fopAcM_ct(this, daObjGraWall_c); field_0x6e0 = fopAcM_GetParam(this); if (field_0x6e0 != 0xff) { diff --git a/src/d/actor/d_a_obj_gra_rock.cpp b/src/d/actor/d_a_obj_gra_rock.cpp index 7d7fea70a71..5b60a6fa463 100644 --- a/src/d/actor/d_a_obj_gra_rock.cpp +++ b/src/d/actor/d_a_obj_gra_rock.cpp @@ -210,7 +210,7 @@ int daObjGraRock_c::CreateHeap() { /* 80C11C64-80C11EA8 000BE4 0244+00 1/1 0/0 0/0 .text create__14daObjGraRock_cFv */ int daObjGraRock_c::create() { - fopAcM_SetupActor(this, daObjGraRock_c); + fopAcM_ct(this, daObjGraRock_c); field_0x9c8 = fopAcM_GetParam(this); int i; int completedNum; diff --git a/src/d/actor/d_a_obj_grave_stone.cpp b/src/d/actor/d_a_obj_grave_stone.cpp index fded99e7221..b0a18fae5c9 100644 --- a/src/d/actor/d_a_obj_grave_stone.cpp +++ b/src/d/actor/d_a_obj_grave_stone.cpp @@ -167,7 +167,7 @@ int daGraveStone_c::CreateHeap() { /* 80C12D1C-80C12EF0 00079C 01D4+00 1/1 0/0 0/0 .text create__14daGraveStone_cFv */ cPhs__Step daGraveStone_c::create() { - fopAcM_SetupActor(this, daGraveStone_c); + fopAcM_ct(this, daGraveStone_c); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhase, l_arcName); if (step == cPhs_COMPLEATE_e) { int dzb_id = dComIfG_getObjctResName2Index(l_arcName, "H_Haka.dzb"); diff --git a/src/d/actor/d_a_obj_groundwater.cpp b/src/d/actor/d_a_obj_groundwater.cpp index aac9698a094..1bc17a6c362 100644 --- a/src/d/actor/d_a_obj_groundwater.cpp +++ b/src/d/actor/d_a_obj_groundwater.cpp @@ -99,7 +99,7 @@ int daGrdWater_c::CreateHeap() { /* 80C139E4-80C13DB0 000624 03CC+00 1/1 0/0 0/0 .text create__12daGrdWater_cFv */ int daGrdWater_c::create() { - fopAcM_SetupActor(this, daGrdWater_c); + fopAcM_ct(this, daGrdWater_c); int rv = dComIfG_resLoad(&mPhase, "Water"); if (rv == cPhs_COMPLEATE_e) { if (MoveBGCreate("Water", 29, dBgS_MoveBGProc_Typical, 0x4030, NULL) == cPhs_ERROR_e) { diff --git a/src/d/actor/d_a_obj_hakai_brl.cpp b/src/d/actor/d_a_obj_hakai_brl.cpp index bf54de036df..499237fdf1d 100644 --- a/src/d/actor/d_a_obj_hakai_brl.cpp +++ b/src/d/actor/d_a_obj_hakai_brl.cpp @@ -39,7 +39,7 @@ int daObjHBarrel_c::createHeap() { /* 80C16B08-80C16BF8 000448 00F0+00 1/1 0/0 0/0 .text create__14daObjHBarrel_cFv */ int daObjHBarrel_c::create() { - fopAcM_SetupActor(this, daObjHBarrel_c); + fopAcM_ct(this, daObjHBarrel_c); s32 loadResult = dComIfG_resLoad(this, l_arcName); if (loadResult == cPhs_COMPLEATE_e) { @@ -187,7 +187,7 @@ void daObjHBarrel_c::callEmt() { /* 80C171F8-80C1724C 000B38 0054+00 1/0 0/0 0/0 .text daObjHBarrel_create__FP14daObjHBarrel_c */ static int daObjHBarrel_create(daObjHBarrel_c* param_0) { - fopAcM_SetupActor(param_0, daObjHBarrel_c); + fopAcM_ct(param_0, daObjHBarrel_c); return param_0->create(); } diff --git a/src/d/actor/d_a_obj_hakai_ftr.cpp b/src/d/actor/d_a_obj_hakai_ftr.cpp index 276de0ffff8..12d696567d3 100644 --- a/src/d/actor/d_a_obj_hakai_ftr.cpp +++ b/src/d/actor/d_a_obj_hakai_ftr.cpp @@ -73,7 +73,7 @@ static u32 const l_heapSize[3] = {0x2000, 0x2000, 0x2000}; /* 80C179B0-80C17AC0 000590 0110+00 1/1 0/0 0/0 .text create__11daObjHFtr_cFv */ int daObjHFtr_c::create() { - fopAcM_SetupActor(this, daObjHFtr_c); + fopAcM_ct(this, daObjHFtr_c); u32 nameIndex = getNameId(); s32 loadResult = dComIfG_resLoad(this, l_arcName[nameIndex]); @@ -207,7 +207,7 @@ void daObjHFtr_c::callEmt() { /* 80C17FB4-80C18008 000B94 0054+00 1/0 0/0 0/0 .text daObjHFtr_create__FP11daObjHFtr_c */ static int daObjHFtr_create(daObjHFtr_c* param_0) { - fopAcM_SetupActor(param_0, daObjHFtr_c); + fopAcM_ct(param_0, daObjHFtr_c); return param_0->create(); } diff --git a/src/d/actor/d_a_obj_hasu2.cpp b/src/d/actor/d_a_obj_hasu2.cpp index 9d406d0f806..517e3134795 100644 --- a/src/d/actor/d_a_obj_hasu2.cpp +++ b/src/d/actor/d_a_obj_hasu2.cpp @@ -187,7 +187,7 @@ void nObjMHasu::daObjMHasu_c::setHasuCount(f32 i_count) { /* 80C18920-80C18974 000700 0054+00 1/0 0/0 0/0 .text * daObjMHasu_create1st__FPQ29nObjMHasu12daObjMHasu_c */ static int daObjMHasu_create1st(nObjMHasu::daObjMHasu_c* i_this) { - fopAcM_SetupActor(i_this, nObjMHasu::daObjMHasu_c); + fopAcM_ct(i_this, nObjMHasu::daObjMHasu_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_hbombkoya.cpp b/src/d/actor/d_a_obj_hbombkoya.cpp index d623f3c5857..6a63d7035be 100644 --- a/src/d/actor/d_a_obj_hbombkoya.cpp +++ b/src/d/actor/d_a_obj_hbombkoya.cpp @@ -258,7 +258,7 @@ int daObjHBombkoya_c::Delete() { * daObjHBombkoya_create1st__FP16daObjHBombkoya_c */ // NONMATCHING - vtable issues, read more below static int daObjHBombkoya_create1st(daObjHBombkoya_c* i_this) { - fopAcM_SetupActor(i_this, daObjHBombkoya_c); + fopAcM_ct(i_this, daObjHBombkoya_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_heavySw.cpp b/src/d/actor/d_a_obj_heavySw.cpp index 5ac902d84d5..df65c4fdaf8 100644 --- a/src/d/actor/d_a_obj_heavySw.cpp +++ b/src/d/actor/d_a_obj_heavySw.cpp @@ -51,7 +51,7 @@ int daHeavySw_c::CreateHeap() { /* 80C1CCDC-80C1CEB0 0002DC 01D4+00 1/1 0/0 0/0 .text create__11daHeavySw_cFv */ int daHeavySw_c::create() { - fopAcM_SetupActor(this, daHeavySw_c); + fopAcM_ct(this, daHeavySw_c); int phase = dComIfG_resLoad(&mPhaseReq, "Hswitch"); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_hfuta.cpp b/src/d/actor/d_a_obj_hfuta.cpp index 846ac50a0e5..487d93fa121 100644 --- a/src/d/actor/d_a_obj_hfuta.cpp +++ b/src/d/actor/d_a_obj_hfuta.cpp @@ -186,7 +186,7 @@ int daObjFuta_c::Delete() { /* 80C1ED9C-80C1EDFC 0010FC 0060+00 1/0 0/0 0/0 .text daObjFuta_create1st__FP11daObjFuta_c */ static int daObjFuta_create1st(daObjFuta_c* i_this) { - fopAcM_SetupActor(i_this, daObjFuta_c); + fopAcM_ct(i_this, daObjFuta_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_hhashi.cpp b/src/d/actor/d_a_obj_hhashi.cpp index 32f8234f1a5..1f30fa0e73c 100644 --- a/src/d/actor/d_a_obj_hhashi.cpp +++ b/src/d/actor/d_a_obj_hhashi.cpp @@ -314,7 +314,7 @@ int daObjHHASHI_c::CreateHeap() { /* 80580EA0-8058112C 001560 028C+00 1/1 0/0 0/0 .text create__13daObjHHASHI_cFv */ int daObjHHASHI_c::create() { - fopAcM_SetupActor(this, daObjHHASHI_c); + fopAcM_ct(this, daObjHHASHI_c); int rv = dComIfG_resLoad(&mPhase, l_arcName); if (rv == cPhs_COMPLEATE_e) { gravity = -9.0f; diff --git a/src/d/actor/d_a_obj_hsTarget.cpp b/src/d/actor/d_a_obj_hsTarget.cpp index 246d0bdd13e..8ec4c370612 100644 --- a/src/d/actor/d_a_obj_hsTarget.cpp +++ b/src/d/actor/d_a_obj_hsTarget.cpp @@ -39,7 +39,7 @@ static const u32 l_dzbIdx[2] = {7, 7}; /* 80C1F598-80C1F6B0 000258 0118+00 1/1 0/0 0/0 .text create__12daHsTarget_cFv */ int daHsTarget_c::create() { - fopAcM_SetupActor(this, daHsTarget_c); + fopAcM_ct(this, daHsTarget_c); mIndex = getModelType(); if (mIndex == 0x0f) { diff --git a/src/d/actor/d_a_obj_ice_l.cpp b/src/d/actor/d_a_obj_ice_l.cpp index 52fe881298e..412523f0270 100644 --- a/src/d/actor/d_a_obj_ice_l.cpp +++ b/src/d/actor/d_a_obj_ice_l.cpp @@ -147,7 +147,7 @@ static char* l_arcName = "V_Ice_l"; /* 80C200CC-80C2030C 00074C 0240+00 1/1 0/0 0/0 .text create__12daObjIce_l_cFv */ int daObjIce_l_c::create() { - fopAcM_SetupActor(this, daObjIce_l_c); + fopAcM_ct(this, daObjIce_l_c); int phase_state = dComIfG_resLoad(&mPhase, l_arcName); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_ice_s.cpp b/src/d/actor/d_a_obj_ice_s.cpp index ba19c1d1ce8..6e227f58d58 100644 --- a/src/d/actor/d_a_obj_ice_s.cpp +++ b/src/d/actor/d_a_obj_ice_s.cpp @@ -182,7 +182,7 @@ static int daObjIce_s_Create(fopAc_ac_c* i_this) { /* 80C212CC-80C2157C 000A0C 02B0+00 1/1 0/0 0/0 .text create__12daObjIce_s_cFv */ int daObjIce_s_c::create() { - fopAcM_SetupActor(this, daObjIce_s_c); + fopAcM_ct(this, daObjIce_s_c); int rv = dComIfG_resLoad(&mPhase, l_arcName); if (rv == cPhs_COMPLEATE_e) { int dzb_id = dComIfG_getObjctResName2Index(l_arcName, "Ice_s.dzb"); diff --git a/src/d/actor/d_a_obj_iceblock.cpp b/src/d/actor/d_a_obj_iceblock.cpp index b435ea72409..ce755309294 100644 --- a/src/d/actor/d_a_obj_iceblock.cpp +++ b/src/d/actor/d_a_obj_iceblock.cpp @@ -863,7 +863,7 @@ int daObjIceBlk_c::Delete() { /* 80C23E68-80C23FCC 002208 0164+00 1/0 0/0 0/0 .text daObjIceBlk_create1st__FP13daObjIceBlk_c */ static int daObjIceBlk_create1st(daObjIceBlk_c* i_this) { - fopAcM_SetupActor(i_this, daObjIceBlk_c); + fopAcM_ct(i_this, daObjIceBlk_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_iceleaf.cpp b/src/d/actor/d_a_obj_iceleaf.cpp index e2bab0e1697..a08b9142ad9 100644 --- a/src/d/actor/d_a_obj_iceleaf.cpp +++ b/src/d/actor/d_a_obj_iceleaf.cpp @@ -176,7 +176,7 @@ int daObjIceLeaf_c::CreateHeap() { /* 80C24E14-80C24F8C 000774 0178+00 1/1 0/0 0/0 .text create__14daObjIceLeaf_cFv */ int daObjIceLeaf_c::create() { - fopAcM_SetupActor(this, daObjIceLeaf_c); + fopAcM_ct(this, daObjIceLeaf_c); int phase_state = dComIfG_resLoad(&mPhase, l_arcName); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_ihasi.cpp b/src/d/actor/d_a_obj_ihasi.cpp index bfc9ddc64aa..c39bed5dac7 100644 --- a/src/d/actor/d_a_obj_ihasi.cpp +++ b/src/d/actor/d_a_obj_ihasi.cpp @@ -146,7 +146,7 @@ static int useHeapInit(fopAc_ac_c* i_actor) { /* 80C26540-80C26880 0005A0 0340+00 1/0 0/0 0/0 .text daObj_Ihasi_Create__FP10fopAc_ac_c */ static int daObj_Ihasi_Create(fopAc_ac_c* i_actor) { - fopAcM_SetupActor(i_actor, obj_ihasi_class); + fopAcM_ct(i_actor, obj_ihasi_class); obj_ihasi_class* i_this = static_cast(i_actor); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&i_this->mPhaseReq, "Obj_ihasi"); diff --git a/src/d/actor/d_a_obj_inobone.cpp b/src/d/actor/d_a_obj_inobone.cpp index 35ab9841355..71340374a2e 100644 --- a/src/d/actor/d_a_obj_inobone.cpp +++ b/src/d/actor/d_a_obj_inobone.cpp @@ -160,7 +160,7 @@ int daObjIBone_c::CreateHeap() { /* 80C27A20-80C27BBC 0003E0 019C+00 1/1 0/0 0/0 .text create__12daObjIBone_cFv */ int daObjIBone_c::create() { - fopAcM_SetupActor(this, daObjIBone_c) + fopAcM_ct(this, daObjIBone_c) int result = dComIfG_resLoad(&mPhase, l_arcName); diff --git a/src/d/actor/d_a_obj_item.cpp b/src/d/actor/d_a_obj_item.cpp index 98fff677e29..8fa0a96827a 100644 --- a/src/d/actor/d_a_obj_item.cpp +++ b/src/d/actor/d_a_obj_item.cpp @@ -258,7 +258,7 @@ void daItem_c::setCullInfo() { /* 8015B7D4-8015BA3C 156114 0268+00 1/1 0/0 0/0 .text _daItem_create__8daItem_cFv */ int daItem_c::_daItem_create() { - fopAcM_SetupActor(this, daItem_c); + fopAcM_ct(this, daItem_c); if (!field_0x95d) { field_0x92c = home.angle.x; diff --git a/src/d/actor/d_a_obj_ito.cpp b/src/d/actor/d_a_obj_ito.cpp index 09d703df0a0..b0f2c2e5914 100644 --- a/src/d/actor/d_a_obj_ito.cpp +++ b/src/d/actor/d_a_obj_ito.cpp @@ -607,7 +607,7 @@ static int useHeapInit(fopAc_ac_c* a_this) { /* 8047D1D8-8047D594 001FD8 03BC+00 1/0 0/0 0/0 .text daObj_Ito_Create__FP10fopAc_ac_c */ static cPhs__Step daObj_Ito_Create(fopAc_ac_c* a_this) { - fopAcM_SetupActor(a_this, obj_ito_class); + fopAcM_ct(a_this, obj_ito_class); obj_ito_class* i_this = (obj_ito_class*)a_this; a_this = &i_this->actor; diff --git a/src/d/actor/d_a_obj_kabuto.cpp b/src/d/actor/d_a_obj_kabuto.cpp index af348f81e0b..a19eca796c2 100644 --- a/src/d/actor/d_a_obj_kabuto.cpp +++ b/src/d/actor/d_a_obj_kabuto.cpp @@ -757,7 +757,7 @@ bool daObjKABUTO_c::CreateChk() { /* 80C2D724-80C2DF60 0029A4 083C+00 1/1 0/0 0/0 .text create__13daObjKABUTO_cFv */ cPhs__Step daObjKABUTO_c::create() { - fopAcM_SetupActor(this, daObjKABUTO_c); + fopAcM_ct(this, daObjKABUTO_c); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhaseReq, "Kab_m"); if (step == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_kag.cpp b/src/d/actor/d_a_obj_kag.cpp index 02dc21c308d..93a92260df5 100644 --- a/src/d/actor/d_a_obj_kag.cpp +++ b/src/d/actor/d_a_obj_kag.cpp @@ -671,7 +671,7 @@ static u16 const l_musiya_num[2] = { cPhs__Step daObjKAG_c::create() { u8 uVar1 = (fopAcM_GetParam(this) & 0xF00) >> 8; - fopAcM_SetupActor(this, daObjKAG_c); + fopAcM_ct(this, daObjKAG_c); cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&mPhase, "I_Kag"); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_kage.cpp b/src/d/actor/d_a_obj_kage.cpp index 27c482b7a2d..ddb43d6b449 100644 --- a/src/d/actor/d_a_obj_kage.cpp +++ b/src/d/actor/d_a_obj_kage.cpp @@ -100,7 +100,7 @@ static int useHeapInit(fopAc_ac_c* actor) { /* 80C31808-80C31954 0003A8 014C+00 1/0 0/0 0/0 .text daObj_Kage_Create__FP10fopAc_ac_c */ static int daObj_Kage_Create(fopAc_ac_c* actor) { - fopAcM_SetupActor(actor, obj_kage_class); + fopAcM_ct(actor, obj_kage_class); obj_kage_class* i_this = (obj_kage_class*)actor; int phase_state = dComIfG_resLoad(&i_this->phase, "Obj_kage"); diff --git a/src/d/actor/d_a_obj_kago.cpp b/src/d/actor/d_a_obj_kago.cpp index e160f0fdfa5..a8ae0291984 100644 --- a/src/d/actor/d_a_obj_kago.cpp +++ b/src/d/actor/d_a_obj_kago.cpp @@ -81,7 +81,7 @@ cPhs__Step daObj_Kago_c::create() { 0x0820, 0x0820, 0, 0x0820, 0, }; - fopAcM_SetupActor(this, daObj_Kago_c); + fopAcM_ct(this, daObj_Kago_c); mType = getType(); diff --git a/src/d/actor/d_a_obj_kamakiri.cpp b/src/d/actor/d_a_obj_kamakiri.cpp index 9f54e1afe0f..86e48c13fa3 100644 --- a/src/d/actor/d_a_obj_kamakiri.cpp +++ b/src/d/actor/d_a_obj_kamakiri.cpp @@ -794,7 +794,7 @@ u8 daObjKAM_c::CreateChk() { /* 80C37AA0-80C38258 002A00 07B8+00 1/1 0/0 0/0 .text create__10daObjKAM_cFv */ int daObjKAM_c::create() { - fopAcM_SetupActor(this, daObjKAM_c); + fopAcM_ct(this, daObjKAM_c); s32 loadResult = dComIfG_resLoad(&mPhase, "I_Kam"); if (loadResult == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_kanban2.cpp b/src/d/actor/d_a_obj_kanban2.cpp index 290a920f42e..9c930c388fd 100644 --- a/src/d/actor/d_a_obj_kanban2.cpp +++ b/src/d/actor/d_a_obj_kanban2.cpp @@ -1779,7 +1779,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 805850E8-80585458 003A68 0370+00 1/1 0/0 0/0 .text create__15daObj_Kanban2_cFv */ int daObj_Kanban2_c::create() { - fopAcM_SetupActor(this, daObj_Kanban2_c); + fopAcM_ct(this, daObj_Kanban2_c); int phase_state = dComIfG_resLoad(&mPhase, "Obj_kn2"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_kantera.cpp b/src/d/actor/d_a_obj_kantera.cpp index 4946e0a1acb..83b83e69ed6 100644 --- a/src/d/actor/d_a_obj_kantera.cpp +++ b/src/d/actor/d_a_obj_kantera.cpp @@ -85,7 +85,7 @@ int daItemKantera_c::__CreateHeap() { /* 80C38BB0-80C38DAC 0005B0 01FC+00 1/1 0/0 0/0 .text create__15daItemKantera_cFv */ int daItemKantera_c::create() { - fopAcM_SetupActor(this, daItemKantera_c); + fopAcM_ct(this, daItemKantera_c); if (field_0x937 == 0) { field_0x938 = home.angle.x; diff --git a/src/d/actor/d_a_obj_katatsumuri.cpp b/src/d/actor/d_a_obj_katatsumuri.cpp index bb8babac9dc..f65c412676b 100644 --- a/src/d/actor/d_a_obj_katatsumuri.cpp +++ b/src/d/actor/d_a_obj_katatsumuri.cpp @@ -723,7 +723,7 @@ bool daObjKAT_c::CreateChk() { /* 80C3BC58-80C3C4C4 0023D8 086C+00 1/1 0/0 0/0 .text create__10daObjKAT_cFv */ int daObjKAT_c::create() { - fopAcM_SetupActor(this, daObjKAT_c); + fopAcM_ct(this, daObjKAT_c); s32 loadResult = dComIfG_resLoad(&mPhase, "Kat"); if (loadResult == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_kazeneko.cpp b/src/d/actor/d_a_obj_kazeneko.cpp index 7b4591b2a10..982f63ea365 100644 --- a/src/d/actor/d_a_obj_kazeneko.cpp +++ b/src/d/actor/d_a_obj_kazeneko.cpp @@ -218,7 +218,7 @@ static int daObjKazeNeko_Delete(daObjKazeNeko_c* i_this) { } inline int daObjKazeNeko_c::create() { - fopAcM_SetupActor(this, daObjKazeNeko_c); + fopAcM_ct(this, daObjKazeNeko_c); int rv = dComIfG_resLoad(&mPhase, l_arcName); if (rv == cPhs_COMPLEATE_e) { if (fopAcM_entrySolidHeap(this, createSolidHeap, 0x2800) == 0) { diff --git a/src/d/actor/d_a_obj_kbacket.cpp b/src/d/actor/d_a_obj_kbacket.cpp index a97a9cd18c9..f8887abc234 100644 --- a/src/d/actor/d_a_obj_kbacket.cpp +++ b/src/d/actor/d_a_obj_kbacket.cpp @@ -65,7 +65,7 @@ daObj_KBacket_c::~daObj_KBacket_c() { /* 80586048-805863F0 0002E8 03A8+00 1/1 0/0 0/0 .text create__15daObj_KBacket_cFv */ int daObj_KBacket_c::create() { - fopAcM_SetupActor(this, daObj_KBacket_c); + fopAcM_ct(this, daObj_KBacket_c); field_0x9d0 = getType(); diff --git a/src/d/actor/d_a_obj_kbox.cpp b/src/d/actor/d_a_obj_kbox.cpp index e9a202beeae..3cf24e68185 100644 --- a/src/d/actor/d_a_obj_kbox.cpp +++ b/src/d/actor/d_a_obj_kbox.cpp @@ -487,7 +487,7 @@ static int useHeapInit(fopAc_ac_c* a_this) { */ static int daObj_Kbox_Create(fopAc_ac_c* a_this) { obj_kbox_class* i_this = (obj_kbox_class*)a_this; - fopAcM_SetupActor(a_this, obj_kbox_class); + fopAcM_ct(a_this, obj_kbox_class); int rv = dComIfG_resLoad(&i_this->mPhase, "Obj_kbox"); if (rv == cPhs_COMPLEATE_e) { OS_REPORT("OBJ_KBOX PARAM %x\n", fopAcM_GetParam(a_this)); diff --git a/src/d/actor/d_a_obj_key.cpp b/src/d/actor/d_a_obj_key.cpp index 9173bdbbe42..fa730bb5883 100644 --- a/src/d/actor/d_a_obj_key.cpp +++ b/src/d/actor/d_a_obj_key.cpp @@ -612,7 +612,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 80C40AB8-80C40DE4 001798 032C+00 1/0 0/0 0/0 .text daObj_Key_Create__FP10fopAc_ac_c */ static int daObj_Key_Create(fopAc_ac_c* i_this) { obj_key_class* a_this = (obj_key_class*)i_this; - fopAcM_SetupActor(i_this, obj_key_class); + fopAcM_ct(i_this, obj_key_class); int phase_state = dComIfG_resLoad(&a_this->phase, "Obj_key"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_keyhole.cpp b/src/d/actor/d_a_obj_keyhole.cpp index cedaf6ef559..5ed1b9e5342 100644 --- a/src/d/actor/d_a_obj_keyhole.cpp +++ b/src/d/actor/d_a_obj_keyhole.cpp @@ -732,7 +732,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 80C4307C-80C434AC 001F1C 0430+00 1/0 0/0 0/0 .text daObj_Keyhole_Create__FP10fopAc_ac_c */ static int daObj_Keyhole_Create(fopAc_ac_c* a_this) { obj_keyhole_class* i_this = (obj_keyhole_class*)a_this; - fopAcM_SetupActor(a_this, obj_keyhole_class); + fopAcM_ct(a_this, obj_keyhole_class); static char* arc_name[] = { "Obj_keyh", "Obj_bkey", "Obj_bkey2", "Obj_bkey3", "Obj_bkey", diff --git a/src/d/actor/d_a_obj_kgate.cpp b/src/d/actor/d_a_obj_kgate.cpp index b2128f82520..ca7c06e34df 100644 --- a/src/d/actor/d_a_obj_kgate.cpp +++ b/src/d/actor/d_a_obj_kgate.cpp @@ -1004,7 +1004,7 @@ int daObjKGate_c::Delete() { /* 8058A768-8058A81C 002768 00B4+00 1/0 0/0 0/0 .text daObjKGate_create1st__FP12daObjKGate_c */ static int daObjKGate_create1st(daObjKGate_c* i_this) { - fopAcM_SetupActor(i_this, daObjKGate_c); + fopAcM_ct(i_this, daObjKGate_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_ki.cpp b/src/d/actor/d_a_obj_ki.cpp index 37190029e9c..0f7f1b0645f 100644 --- a/src/d/actor/d_a_obj_ki.cpp +++ b/src/d/actor/d_a_obj_ki.cpp @@ -156,7 +156,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 80C4466C-80C449F8 00086C 038C+00 1/0 0/0 0/0 .text daObj_Ki_Create__FP10fopAc_ac_c */ static cPhs__Step daObj_Ki_Create(fopAc_ac_c* i_this) { obj_ki_class* _this = static_cast(i_this); - fopAcM_SetupActor(_this, obj_ki_class); + fopAcM_ct(_this, obj_ki_class); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&_this->mPhaseReq, "Obj_Ki"); if (step == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_kiPot.cpp b/src/d/actor/d_a_obj_kiPot.cpp index 1f1ffc7ed78..425379f7f14 100644 --- a/src/d/actor/d_a_obj_kiPot.cpp +++ b/src/d/actor/d_a_obj_kiPot.cpp @@ -29,7 +29,7 @@ void daKiPot_c::setBaseMtx() { /* 80C44DD0-80C44E7C 0001B0 00AC+00 1/1 0/0 0/0 .text create__9daKiPot_cFv */ int daKiPot_c::create() { - fopAcM_SetupActor(this, daKiPot_c); + fopAcM_ct(this, daKiPot_c); setBaseMtx(); diff --git a/src/d/actor/d_a_obj_kita.cpp b/src/d/actor/d_a_obj_kita.cpp index 59cc19605d9..38ec2485c06 100644 --- a/src/d/actor/d_a_obj_kita.cpp +++ b/src/d/actor/d_a_obj_kita.cpp @@ -223,7 +223,7 @@ static int useHeapInit(fopAc_ac_c* a_this) { */ static int daObj_Kita_Create(fopAc_ac_c* a_this) { obj_kita_class* i_this = (obj_kita_class*)a_this; - fopAcM_SetupActor(a_this, obj_kita_class); + fopAcM_ct(a_this, obj_kita_class); int rv = dComIfG_resLoad(&i_this->mPhase, "Obj_kita"); if (rv == 4) { diff --git a/src/d/actor/d_a_obj_kjgjs.cpp b/src/d/actor/d_a_obj_kjgjs.cpp index b4837ba5fcf..268910b1de2 100644 --- a/src/d/actor/d_a_obj_kjgjs.cpp +++ b/src/d/actor/d_a_obj_kjgjs.cpp @@ -97,7 +97,7 @@ int daObjKJgjs_c::Delete() { /* 80C46400-80C46460 0003E0 0060+00 1/0 0/0 0/0 .text daObjKJgjs_create1st__FP12daObjKJgjs_c */ static int daObjKJgjs_create1st(daObjKJgjs_c* i_this) { - fopAcM_SetupActor(i_this, daObjKJgjs_c); + fopAcM_ct(i_this, daObjKJgjs_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_kkanban.cpp b/src/d/actor/d_a_obj_kkanban.cpp index efb8648d227..b819cc28d7d 100644 --- a/src/d/actor/d_a_obj_kkanban.cpp +++ b/src/d/actor/d_a_obj_kkanban.cpp @@ -147,7 +147,7 @@ int daObjKKanban_c::Delete() { /* 80C46CF4-80C46DF4 0006D4 0100+00 1/0 0/0 0/0 .text daObjKKanban_create1st__FP14daObjKKanban_c */ static int daObjKKanban_create1st(daObjKKanban_c* i_this) { - fopAcM_SetupActor(i_this, daObjKKanban_c); + fopAcM_ct(i_this, daObjKKanban_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_klift00.cpp b/src/d/actor/d_a_obj_klift00.cpp index 4174116ec4d..884edf8b10b 100644 --- a/src/d/actor/d_a_obj_klift00.cpp +++ b/src/d/actor/d_a_obj_klift00.cpp @@ -487,7 +487,7 @@ int daObjKLift00_c::Delete() { /* 8058C050-8058C164 001190 0114+00 1/0 0/0 0/0 .text daObjKLift00_create1st__FP14daObjKLift00_c */ static int daObjKLift00_create1st(daObjKLift00_c* i_this) { - fopAcM_SetupActor(i_this, daObjKLift00_c); + fopAcM_ct(i_this, daObjKLift00_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_knBullet.cpp b/src/d/actor/d_a_obj_knBullet.cpp index e0e8ffbd0d3..6e191749eb6 100644 --- a/src/d/actor/d_a_obj_knBullet.cpp +++ b/src/d/actor/d_a_obj_knBullet.cpp @@ -30,7 +30,7 @@ const static dCcD_SrcSph l_sph_src = { /* 80C47118-80C47270 000078 0158+00 1/1 0/0 0/0 .text Create__15daObjKnBullet_cFv */ int daObjKnBullet_c::Create() { - fopAcM_SetupActor(this, daObjKnBullet_c); + fopAcM_ct(this, daObjKnBullet_c); setBaseMtx(); fopAcM_SetMtx(this, mMtx); diff --git a/src/d/actor/d_a_obj_kshutter.cpp b/src/d/actor/d_a_obj_kshutter.cpp index 642209711ab..12ab8d33c9a 100644 --- a/src/d/actor/d_a_obj_kshutter.cpp +++ b/src/d/actor/d_a_obj_kshutter.cpp @@ -997,7 +997,7 @@ int daObjKshtr_c::Delete() { /* 80C49BB8-80C49C18 002178 0060+00 1/0 0/0 0/0 .text daObjKshtr_create1st__FP12daObjKshtr_c */ static int daObjKshtr_create1st(daObjKshtr_c* i_this) { - fopAcM_SetupActor(i_this, daObjKshtr_c); + fopAcM_ct(i_this, daObjKshtr_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_ktOnFire.cpp b/src/d/actor/d_a_obj_ktOnFire.cpp index 74dac983078..72817be7f97 100644 --- a/src/d/actor/d_a_obj_ktOnFire.cpp +++ b/src/d/actor/d_a_obj_ktOnFire.cpp @@ -58,7 +58,7 @@ void daKtOnFire_c::setBaseMtx() { /* 8058C6D0-8058C8D0 0001B0 0200+00 1/1 0/0 0/0 .text create__12daKtOnFire_cFv */ int daKtOnFire_c::create() { - fopAcM_SetupActor(this, daKtOnFire_c); + fopAcM_ct(this, daKtOnFire_c); setBaseMtx(); diff --git a/src/d/actor/d_a_obj_kwheel00.cpp b/src/d/actor/d_a_obj_kwheel00.cpp index 1f63ea6c7e3..b042db42a06 100644 --- a/src/d/actor/d_a_obj_kwheel00.cpp +++ b/src/d/actor/d_a_obj_kwheel00.cpp @@ -397,7 +397,7 @@ extern actor_process_profile_definition g_profile_Obj_KWheel00 = { /* 80C4E2C0-80C4E394 000C40 00D4+00 1/0 0/0 0/0 .text daObjKWheel00_create1st__FP15daObjKWheel00_c */ static int daObjKWheel00_create1st(daObjKWheel00_c* i_this) { - fopAcM_SetupActor(i_this, daObjKWheel00_c); + fopAcM_ct(i_this, daObjKWheel00_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_kwheel01.cpp b/src/d/actor/d_a_obj_kwheel01.cpp index 27415043f45..c048de7efa1 100644 --- a/src/d/actor/d_a_obj_kwheel01.cpp +++ b/src/d/actor/d_a_obj_kwheel01.cpp @@ -374,7 +374,7 @@ extern actor_process_profile_definition g_profile_Obj_KWheel01 = { /* 80C4F4C0-80C4F540 000AC0 0080+00 1/1 0/0 0/0 .text daObjKWheel01_create1st__FP15daObjKWheel01_c */ static int daObjKWheel01_create1st(daObjKWheel01_c* i_this) { - fopAcM_SetupActor(i_this, daObjKWheel01_c); + fopAcM_ct(i_this, daObjKWheel01_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_kznkarm.cpp b/src/d/actor/d_a_obj_kznkarm.cpp index cbe117afe74..68ca85e5f74 100644 --- a/src/d/actor/d_a_obj_kznkarm.cpp +++ b/src/d/actor/d_a_obj_kznkarm.cpp @@ -453,7 +453,7 @@ static int daObjKznkarm_Delete(daObjKznkarm_c* i_this) { } inline int daObjKznkarm_c::create() { - fopAcM_SetupActor(this, daObjKznkarm_c); + fopAcM_ct(this, daObjKznkarm_c); int rv = dComIfG_resLoad(&mPhase, l_arcName); if (rv == cPhs_COMPLEATE_e) { if (!fopAcM_entrySolidHeap(this, createSolidHeap, 0x4000)) { diff --git a/src/d/actor/d_a_obj_ladder.cpp b/src/d/actor/d_a_obj_ladder.cpp index efd0ca9a1ad..ae0526a4c26 100644 --- a/src/d/actor/d_a_obj_ladder.cpp +++ b/src/d/actor/d_a_obj_ladder.cpp @@ -203,7 +203,7 @@ int daObjLadder::Act_c::Create() { /* 8058D378-8058D478 000298 0100+00 1/1 0/0 0/0 .text Mthd_Create__Q211daObjLadder5Act_cFv */ int daObjLadder::Act_c::Mthd_Create() { - fopAcM_SetupActor(this, Act_c); + fopAcM_ct(this, Act_c); int phase_state = dComIfG_resLoad(&mPhase, M_arcname); if (phase_state == cPhs_COMPLEATE_e) { mType = prm_get_type(); diff --git a/src/d/actor/d_a_obj_laundry.cpp b/src/d/actor/d_a_obj_laundry.cpp index 0c098c98273..3dc84afee94 100644 --- a/src/d/actor/d_a_obj_laundry.cpp +++ b/src/d/actor/d_a_obj_laundry.cpp @@ -281,7 +281,7 @@ static int daObjLdy_Delete(daObjLdy_c* i_this) { } int daObjLdy_c::create() { - fopAcM_SetupActor(this, daObjLdy_c); + fopAcM_ct(this, daObjLdy_c); int phase = dComIfG_resLoad(&mPhase, l_arcName); if (phase == cPhs_COMPLEATE_e) { if (!fopAcM_entrySolidHeap(this, createSolidHeap, 0x9a0)) { diff --git a/src/d/actor/d_a_obj_laundry_rope.cpp b/src/d/actor/d_a_obj_laundry_rope.cpp index 2d0f0caf2f9..70342a53de5 100644 --- a/src/d/actor/d_a_obj_laundry_rope.cpp +++ b/src/d/actor/d_a_obj_laundry_rope.cpp @@ -285,7 +285,7 @@ static int daObjLndRope_Delete(daObjLndRope_c* i_this) { } int daObjLndRope_c::create() { - fopAcM_SetupActor(this, daObjLndRope_c); + fopAcM_ct(this, daObjLndRope_c); int phase = dComIfG_resLoad(&mPhase, l_arcName); if (phase == cPhs_COMPLEATE_e) { if (!fopAcM_entrySolidHeap(this, createSolidHeap, 0x6c0)) { diff --git a/src/d/actor/d_a_obj_lbox.cpp b/src/d/actor/d_a_obj_lbox.cpp index e90d89f9245..1566a430505 100644 --- a/src/d/actor/d_a_obj_lbox.cpp +++ b/src/d/actor/d_a_obj_lbox.cpp @@ -161,7 +161,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { */ static cPhs__Step daObj_Lbox_Create(fopAc_ac_c* i_this) { obj_lbox_class* a_this = static_cast(i_this); - fopAcM_SetupActor(a_this, obj_lbox_class); + fopAcM_ct(a_this, obj_lbox_class); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&a_this->mPhaseReq, "Obj_lbox"); if (step == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_life_container.cpp b/src/d/actor/d_a_obj_life_container.cpp index 7f0b6a05b37..039202d92bc 100644 --- a/src/d/actor/d_a_obj_life_container.cpp +++ b/src/d/actor/d_a_obj_life_container.cpp @@ -144,7 +144,7 @@ int daObjLife_c::__CreateHeap() { /* 804CCFE0-804CD258 000880 0278+00 1/1 0/0 0/0 .text create__11daObjLife_cFv */ int daObjLife_c::create() { - fopAcM_SetupActor(this, daObjLife_c); + fopAcM_ct(this, daObjLife_c); if (!mIsPrmsInit) { field_0x938 = home.angle.x; diff --git a/src/d/actor/d_a_obj_lp.cpp b/src/d/actor/d_a_obj_lp.cpp index 7d968618d87..1791cce2379 100644 --- a/src/d/actor/d_a_obj_lp.cpp +++ b/src/d/actor/d_a_obj_lp.cpp @@ -378,7 +378,7 @@ static int set_pos_check(obj_lp_class* i_this, int param_2) { /* 80C55488-80C559C8 001368 0540+00 1/0 0/0 0/0 .text daObj_Lp_Create__FP10fopAc_ac_c */ static int daObj_Lp_Create(fopAc_ac_c* a_this) { - fopAcM_SetupActor(a_this, obj_lp_class); + fopAcM_ct(a_this, obj_lp_class); obj_lp_class* i_this = (obj_lp_class*)a_this; int phase_state = dComIfG_resLoad(&i_this->mPhase, "Obj_lp"); diff --git a/src/d/actor/d_a_obj_lv1Candle00.cpp b/src/d/actor/d_a_obj_lv1Candle00.cpp index 9f6cb466a9d..c1a1c0726cc 100644 --- a/src/d/actor/d_a_obj_lv1Candle00.cpp +++ b/src/d/actor/d_a_obj_lv1Candle00.cpp @@ -57,7 +57,7 @@ int daLv1Cdl00_c::CreateHeap() { /* 80C55E74-80C56110 000254 029C+00 1/1 0/0 0/0 .text create__12daLv1Cdl00_cFv */ cPhs__Step daLv1Cdl00_c::create() { - fopAcM_SetupActor(this, daLv1Cdl00_c); + fopAcM_ct(this, daLv1Cdl00_c); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhase, "lv1cdl00"); if (step == cPhs_COMPLEATE_e) { if (!fopAcM_entrySolidHeap(this, createHeapCallBack, 0x820)) { diff --git a/src/d/actor/d_a_obj_lv1Candle01.cpp b/src/d/actor/d_a_obj_lv1Candle01.cpp index 50b3a15d261..ebe06a820ce 100644 --- a/src/d/actor/d_a_obj_lv1Candle01.cpp +++ b/src/d/actor/d_a_obj_lv1Candle01.cpp @@ -57,7 +57,7 @@ int daLv1Cdl01_c::CreateHeap() { /* 80C56E14-80C57048 000254 0234+00 1/1 0/0 0/0 .text create__12daLv1Cdl01_cFv */ cPhs__Step daLv1Cdl01_c::create() { - fopAcM_SetupActor(this, daLv1Cdl01_c); + fopAcM_ct(this, daLv1Cdl01_c); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhase, "lv1cdl01"); if (step == cPhs_COMPLEATE_e) { if (MoveBGCreate("lv1cdl01", -1, NULL, 0x820, NULL) == cPhs_ERROR_e) { diff --git a/src/d/actor/d_a_obj_lv2Candle.cpp b/src/d/actor/d_a_obj_lv2Candle.cpp index a951b76cdf4..49a1f79fdf6 100644 --- a/src/d/actor/d_a_obj_lv2Candle.cpp +++ b/src/d/actor/d_a_obj_lv2Candle.cpp @@ -92,7 +92,7 @@ int daLv2Candle_c::CreateHeap() { /* 8058E244-8058E52C 0002E4 02E8+00 1/1 0/0 0/0 .text create__13daLv2Candle_cFv */ cPhs__Step daLv2Candle_c::create() { - fopAcM_SetupActor(this, daLv2Candle_c); + fopAcM_ct(this, daLv2Candle_c); mModelType = getModelType(); if (mModelType == 0xf) { mModelType = 0; diff --git a/src/d/actor/d_a_obj_lv3Candle.cpp b/src/d/actor/d_a_obj_lv3Candle.cpp index 7dc1f387f6f..d714b23c133 100644 --- a/src/d/actor/d_a_obj_lv3Candle.cpp +++ b/src/d/actor/d_a_obj_lv3Candle.cpp @@ -60,7 +60,7 @@ int daLv3Candle_c::CreateHeap() { /* 80C57C40-80C57EDC 000260 029C+00 1/1 0/0 0/0 .text create__13daLv3Candle_cFv */ cPhs__Step daLv3Candle_c::create() { - fopAcM_SetupActor(this, daLv3Candle_c); + fopAcM_ct(this, daLv3Candle_c); mType = getType(); if (mType == 0xff) { diff --git a/src/d/actor/d_a_obj_lv3Water.cpp b/src/d/actor/d_a_obj_lv3Water.cpp index 0f6ec22d9b4..a1d66b74ddd 100644 --- a/src/d/actor/d_a_obj_lv3Water.cpp +++ b/src/d/actor/d_a_obj_lv3Water.cpp @@ -151,7 +151,7 @@ static u16 const estimateSizeTbl[] = { /* 80C58ABC-80C58D20 0003DC 0264+00 1/1 0/0 0/0 .text create__12daLv3Water_cFv */ int daLv3Water_c::create() { - fopAcM_SetupActor(this, daLv3Water_c); + fopAcM_ct(this, daLv3Water_c); mType = getParamType(); diff --git a/src/d/actor/d_a_obj_lv3Water2.cpp b/src/d/actor/d_a_obj_lv3Water2.cpp index c6beeebbc16..db18100211f 100644 --- a/src/d/actor/d_a_obj_lv3Water2.cpp +++ b/src/d/actor/d_a_obj_lv3Water2.cpp @@ -109,7 +109,7 @@ int daLv3Water2_c::CreateHeap() { /* 80C5A5E4-80C5A7FC 0002C4 0218+00 1/1 0/0 0/0 .text create__13daLv3Water2_cFv */ cPhs__Step daLv3Water2_c::create() { - fopAcM_SetupActor(this, daLv3Water2_c); + fopAcM_ct(this, daLv3Water2_c); mResourceIndex = getParam(0, 4); cPhs__Step resPhase = static_cast(dComIfG_resLoad(&mPhase, l_resNameIdx[mResourceIndex])); diff --git a/src/d/actor/d_a_obj_lv3WaterB.cpp b/src/d/actor/d_a_obj_lv3WaterB.cpp index deca7ab4ac6..ce00d140802 100644 --- a/src/d/actor/d_a_obj_lv3WaterB.cpp +++ b/src/d/actor/d_a_obj_lv3WaterB.cpp @@ -170,7 +170,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 80C5BBD4-80C5BD48 0006D4 0174+00 1/0 0/0 0/0 .text daObj_Lv3waterB_Create__FP10fopAc_ac_c */ static int daObj_Lv3waterB_Create(fopAc_ac_c* i_this) { obj_lv3WaterB_class* a_this = static_cast(i_this); - fopAcM_SetupActor(a_this, obj_lv3WaterB_class); + fopAcM_ct(a_this, obj_lv3WaterB_class); int phase_state = dComIfG_resLoad(&a_this->mBWaterPhase, "L3_bwater"); int octhibi_phase_state = dComIfG_resLoad(&a_this->mOcthibiPhase, "S_octhibi"); diff --git a/src/d/actor/d_a_obj_lv3saka00.cpp b/src/d/actor/d_a_obj_lv3saka00.cpp index 5cb22983ebc..3554fef1829 100644 --- a/src/d/actor/d_a_obj_lv3saka00.cpp +++ b/src/d/actor/d_a_obj_lv3saka00.cpp @@ -137,7 +137,7 @@ int daObjLv3saka_c::Delete() { /* 80C5C2F0-80C5C350 000510 0060+00 1/0 0/0 0/0 .text daObjLv3saka_create1st__FP14daObjLv3saka_c */ static int daObjLv3saka_create1st(daObjLv3saka_c* i_this) { - fopAcM_SetupActor(i_this, daObjLv3saka_c); + fopAcM_ct(i_this, daObjLv3saka_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_lv3waterEff.cpp b/src/d/actor/d_a_obj_lv3waterEff.cpp index be5a9ba3f85..086e155a311 100644 --- a/src/d/actor/d_a_obj_lv3waterEff.cpp +++ b/src/d/actor/d_a_obj_lv3waterEff.cpp @@ -31,7 +31,7 @@ int daObjWaterEff_c::Create() { /* 80C5C5DC-80C5C670 00015C 0094+00 1/1 0/0 0/0 .text create__15daObjWaterEff_cFv */ int daObjWaterEff_c::create() { - fopAcM_SetupActor(this, daObjWaterEff_c); + fopAcM_ct(this, daObjWaterEff_c); if (!Create()) { return cPhs_ERROR_e; diff --git a/src/d/actor/d_a_obj_lv4CandleDemoTag.cpp b/src/d/actor/d_a_obj_lv4CandleDemoTag.cpp index 403c812b287..28c02269671 100644 --- a/src/d/actor/d_a_obj_lv4CandleDemoTag.cpp +++ b/src/d/actor/d_a_obj_lv4CandleDemoTag.cpp @@ -34,7 +34,7 @@ void dalv4CandleDemoTag_c::setBaseMtx() { /* 80C5CA90-80C5CBA4 000190 0114+00 1/1 0/0 0/0 .text create__20dalv4CandleDemoTag_cFv */ // NONMATCHING - vtables need work int dalv4CandleDemoTag_c::create() { - fopAcM_SetupActor(this, dalv4CandleDemoTag_c); + fopAcM_ct(this, dalv4CandleDemoTag_c); mPathID = getPathID(); diff --git a/src/d/actor/d_a_obj_lv4Gate.cpp b/src/d/actor/d_a_obj_lv4Gate.cpp index 44fd76d9912..1336cb301ff 100644 --- a/src/d/actor/d_a_obj_lv4Gate.cpp +++ b/src/d/actor/d_a_obj_lv4Gate.cpp @@ -42,7 +42,7 @@ int daLv4Gate_c::CreateHeap() { /* 80C5ECEC-80C5EE54 00026C 0168+00 1/1 0/0 0/0 .text create__11daLv4Gate_cFv */ int daLv4Gate_c::create() { - fopAcM_SetupActor(this, daLv4Gate_c); + fopAcM_ct(this, daLv4Gate_c); int phase = dComIfG_resLoad(&mPhase, "L4Gate"); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_lv4HsTarget.cpp b/src/d/actor/d_a_obj_lv4HsTarget.cpp index aff8262691d..c2855a1fce8 100644 --- a/src/d/actor/d_a_obj_lv4HsTarget.cpp +++ b/src/d/actor/d_a_obj_lv4HsTarget.cpp @@ -35,7 +35,7 @@ int daLv4HsTarget_c::CreateHeap() { /* 80C5F784-80C5F85C 000244 00D8+00 1/1 0/0 0/0 .text create__15daLv4HsTarget_cFv */ int daLv4HsTarget_c::create() { - fopAcM_SetupActor(this, daLv4HsTarget_c); + fopAcM_ct(this, daLv4HsTarget_c); int phase = dComIfG_resLoad(&mPhase, "L4HsMato"); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_lv4PoGate.cpp b/src/d/actor/d_a_obj_lv4PoGate.cpp index 316fc6debb3..2f8bb36ad7b 100644 --- a/src/d/actor/d_a_obj_lv4PoGate.cpp +++ b/src/d/actor/d_a_obj_lv4PoGate.cpp @@ -47,7 +47,7 @@ int daLv4PoGate_c::CreateHeap() { /* 80C5FDAC-80C5FEDC 0002AC 0130+00 1/1 0/0 0/0 .text create__13daLv4PoGate_cFv */ int daLv4PoGate_c::create() { - fopAcM_SetupActor(this, daLv4PoGate_c); + fopAcM_ct(this, daLv4PoGate_c); int phase = dComIfG_resLoad(&mPhase, "L4R02Gate"); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_lv4RailWall.cpp b/src/d/actor/d_a_obj_lv4RailWall.cpp index ecfffdf65ba..51aaf0a2cbe 100644 --- a/src/d/actor/d_a_obj_lv4RailWall.cpp +++ b/src/d/actor/d_a_obj_lv4RailWall.cpp @@ -249,7 +249,7 @@ int daObjLv4Wall_c::Delete() { /* 80C61514-80C61660 000B14 014C+00 1/0 0/0 0/0 .text daObjLv4Wall_create1st__FP14daObjLv4Wall_c */ static int daObjLv4Wall_create1st(daObjLv4Wall_c* i_this) { - fopAcM_SetupActor(i_this, daObjLv4Wall_c); + fopAcM_ct(i_this, daObjLv4Wall_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_lv4SlideWall.cpp b/src/d/actor/d_a_obj_lv4SlideWall.cpp index 1bed6363b3d..4ec1ab65e8e 100644 --- a/src/d/actor/d_a_obj_lv4SlideWall.cpp +++ b/src/d/actor/d_a_obj_lv4SlideWall.cpp @@ -40,7 +40,7 @@ static daSldWall_HIO_c l_HIO; /* 80C61FB8-80C620E4 000278 012C+00 1/1 0/0 0/0 .text create__11daSldWall_cFv */ int daSldWall_c::create() { - fopAcM_SetupActor(this, daSldWall_c); + fopAcM_ct(this, daSldWall_c); int phase_state = dComIfG_resLoad(&mPhase, "L4SldWall"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_lv4bridge.cpp b/src/d/actor/d_a_obj_lv4bridge.cpp index e17c64b4d53..508570eb117 100644 --- a/src/d/actor/d_a_obj_lv4bridge.cpp +++ b/src/d/actor/d_a_obj_lv4bridge.cpp @@ -168,7 +168,7 @@ int daObjLv4Brg_c::Delete() { /* 80C62F78-80C62FF8 000778 0080+00 1/0 0/0 0/0 .text daObjLv4Brg_create1st__FP13daObjLv4Brg_c */ static int daObjLv4Brg_create1st(daObjLv4Brg_c* i_this) { - fopAcM_SetupActor(i_this, daObjLv4Brg_c); + fopAcM_ct(i_this, daObjLv4Brg_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_lv4chandelier.cpp b/src/d/actor/d_a_obj_lv4chandelier.cpp index 1309241f16d..ccde7a1b316 100644 --- a/src/d/actor/d_a_obj_lv4chandelier.cpp +++ b/src/d/actor/d_a_obj_lv4chandelier.cpp @@ -880,7 +880,7 @@ int daObjLv4Chan_c::Delete() { /* 80C66150-80C6627C 002E90 012C+00 1/0 0/0 0/0 .text daObjLv4Chan_create1st__FP14daObjLv4Chan_c */ static int daObjLv4Chan_create1st(daObjLv4Chan_c* i_this) { - fopAcM_SetupActor(i_this, daObjLv4Chan_c); + fopAcM_ct(i_this, daObjLv4Chan_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_lv4digsand.cpp b/src/d/actor/d_a_obj_lv4digsand.cpp index 9b39f70cdea..012049af904 100644 --- a/src/d/actor/d_a_obj_lv4digsand.cpp +++ b/src/d/actor/d_a_obj_lv4digsand.cpp @@ -176,7 +176,7 @@ int daObjL4DigSand_c::Delete() { /* 80C671DC-80C67308 00073C 012C+00 1/0 0/0 0/0 .text * daObjL4DigSand_create1st__FP16daObjL4DigSand_c */ static int daObjL4DigSand_create1st(daObjL4DigSand_c* i_this) { - fopAcM_SetupActor(i_this, daObjL4DigSand_c); + fopAcM_ct(i_this, daObjL4DigSand_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_lv4floor.cpp b/src/d/actor/d_a_obj_lv4floor.cpp index 153542d86c8..681c0384451 100644 --- a/src/d/actor/d_a_obj_lv4floor.cpp +++ b/src/d/actor/d_a_obj_lv4floor.cpp @@ -135,7 +135,7 @@ int daObjLv4Floor_c::Delete() { /* 80C67CAC-80C67D0C 00052C 0060+00 1/0 0/0 0/0 .text daObjLv4Floor_create1st__FP15daObjLv4Floor_c */ static int daObjLv4Floor_create1st(daObjLv4Floor_c* i_this) { - fopAcM_SetupActor(i_this, daObjLv4Floor_c); + fopAcM_ct(i_this, daObjLv4Floor_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_lv4gear.cpp b/src/d/actor/d_a_obj_lv4gear.cpp index d5c6ca2081b..c72debfe769 100644 --- a/src/d/actor/d_a_obj_lv4gear.cpp +++ b/src/d/actor/d_a_obj_lv4gear.cpp @@ -79,7 +79,7 @@ static int const l_heap_size[] = {0xF00, 0xF00}; /* 80C68124-80C681F4 000284 00D0+00 1/1 0/0 0/0 .text create__14daObjLv4Gear_cFv */ int daObjLv4Gear_c::create() { - fopAcM_SetupActor(this, daObjLv4Gear_c); + fopAcM_ct(this, daObjLv4Gear_c); mType = getType(); diff --git a/src/d/actor/d_a_obj_lv4prelvtr.cpp b/src/d/actor/d_a_obj_lv4prelvtr.cpp index 5855facfe6f..a0cf2ad489b 100644 --- a/src/d/actor/d_a_obj_lv4prelvtr.cpp +++ b/src/d/actor/d_a_obj_lv4prelvtr.cpp @@ -106,7 +106,7 @@ int daObjPRElvtr_c::Delete() { /* 80C68A24-80C68A84 0004A4 0060+00 1/0 0/0 0/0 .text daObjPRElvtr_create1st__FP14daObjPRElvtr_c */ static int daObjPRElvtr_create1st(daObjPRElvtr_c* i_this) { - fopAcM_SetupActor(i_this, daObjPRElvtr_c); + fopAcM_ct(i_this, daObjPRElvtr_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_lv4prwall.cpp b/src/d/actor/d_a_obj_lv4prwall.cpp index 672a7a27723..43631cc6f10 100644 --- a/src/d/actor/d_a_obj_lv4prwall.cpp +++ b/src/d/actor/d_a_obj_lv4prwall.cpp @@ -292,7 +292,7 @@ int daObjLv4PRwall_c::Delete() { /* 80C697A4-80C69804 000B84 0060+00 1/0 0/0 0/0 .text * daObjLv4PRwall_create1st__FP16daObjLv4PRwall_c */ static int daObjLv4PRwall_create1st(daObjLv4PRwall_c* i_this) { - fopAcM_SetupActor(i_this, daObjLv4PRwall_c); + fopAcM_ct(i_this, daObjLv4PRwall_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_lv4sand.cpp b/src/d/actor/d_a_obj_lv4sand.cpp index 49d68a752c3..4e2c23d3e15 100644 --- a/src/d/actor/d_a_obj_lv4sand.cpp +++ b/src/d/actor/d_a_obj_lv4sand.cpp @@ -169,7 +169,7 @@ int daObjLv4Sand_c::Delete() { /* 80C6A1C0-80C6A240 0007A0 0080+00 1/0 0/0 0/0 .text daObjLv4Sand_create1st__FP14daObjLv4Sand_c */ static int daObjLv4Sand_create1st(daObjLv4Sand_c* i_this) { - fopAcM_SetupActor(i_this, daObjLv4Sand_c); + fopAcM_ct(i_this, daObjLv4Sand_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_lv5FloorBoard.cpp b/src/d/actor/d_a_obj_lv5FloorBoard.cpp index b15e6f948dc..f1f1ac6c3e5 100644 --- a/src/d/actor/d_a_obj_lv5FloorBoard.cpp +++ b/src/d/actor/d_a_obj_lv5FloorBoard.cpp @@ -43,7 +43,7 @@ int daFlorBoad_c::CreateHeap() { /* 80C6A7F0-80C6A9C0 0002D0 01D0+00 1/1 0/0 0/0 .text create__12daFlorBoad_cFv */ int daFlorBoad_c::create() { - fopAcM_SetupActor(this, daFlorBoad_c); + fopAcM_ct(this, daFlorBoad_c); mSwBit1 = getSwBit1(); if (mSwBit1 != 0xFF && fopAcM_isSwitch(this, mSwBit1)) { diff --git a/src/d/actor/d_a_obj_lv5IceWall.cpp b/src/d/actor/d_a_obj_lv5IceWall.cpp index d2ae74fa9f7..69b29dab519 100644 --- a/src/d/actor/d_a_obj_lv5IceWall.cpp +++ b/src/d/actor/d_a_obj_lv5IceWall.cpp @@ -77,7 +77,7 @@ static const int l_bmdIdx[] = {4, 5}; /* 80C6B69C-80C6B924 00035C 0288+00 1/1 0/0 0/0 .text create__11daIceWall_cFv */ int daIceWall_c::create() { - fopAcM_SetupActor(this, daIceWall_c); + fopAcM_ct(this, daIceWall_c); mIsBreakSwBit = getSwBit1(); mIsBreakingSwBit = getSwBit1(); diff --git a/src/d/actor/d_a_obj_lv5SwIce.cpp b/src/d/actor/d_a_obj_lv5SwIce.cpp index 59c9b313aaa..4ad3180d745 100644 --- a/src/d/actor/d_a_obj_lv5SwIce.cpp +++ b/src/d/actor/d_a_obj_lv5SwIce.cpp @@ -38,7 +38,7 @@ int daLv5SwIce_c::CreateHeap() { /* 80C6CB14-80C6CCE4 0002B4 01D0+00 1/1 0/0 0/0 .text create__12daLv5SwIce_cFv */ int daLv5SwIce_c::create() { - fopAcM_SetupActor(this, daLv5SwIce_c); + fopAcM_ct(this, daLv5SwIce_c); mSwBit1 = getSwBit1(); if (mSwBit1 != 0xFF && fopAcM_isSwitch(this, mSwBit1)) { diff --git a/src/d/actor/d_a_obj_lv5ychndlr.cpp b/src/d/actor/d_a_obj_lv5ychndlr.cpp index 8705010f2c7..9176d0e99b9 100644 --- a/src/d/actor/d_a_obj_lv5ychndlr.cpp +++ b/src/d/actor/d_a_obj_lv5ychndlr.cpp @@ -354,7 +354,7 @@ int daObjYchndlr_c::Delete() { /* 80C6E404-80C6E518 000D24 0114+00 1/0 0/0 0/0 .text daObjYchndlr_create1st__FP14daObjYchndlr_c */ static int daObjYchndlr_create1st(daObjYchndlr_c* i_this) { - fopAcM_SetupActor(i_this, daObjYchndlr_c); + fopAcM_ct(i_this, daObjYchndlr_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_lv5yiblltray.cpp b/src/d/actor/d_a_obj_lv5yiblltray.cpp index e72d29a3a50..8a6ec0588b7 100644 --- a/src/d/actor/d_a_obj_lv5yiblltray.cpp +++ b/src/d/actor/d_a_obj_lv5yiblltray.cpp @@ -583,7 +583,7 @@ int daObjYIblltray_c::Delete() { /* 80C70480-80C70554 001900 00D4+00 1/0 0/0 0/0 .text * daObjYIblltray_create1st__FP16daObjYIblltray_c */ static int daObjYIblltray_create1st(daObjYIblltray_c* i_this) { - fopAcM_SetupActor(i_this, daObjYIblltray_c); + fopAcM_ct(i_this, daObjYIblltray_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_lv6ChangeGate.cpp b/src/d/actor/d_a_obj_lv6ChangeGate.cpp index 5e59f471d4a..1476f654956 100644 --- a/src/d/actor/d_a_obj_lv6ChangeGate.cpp +++ b/src/d/actor/d_a_obj_lv6ChangeGate.cpp @@ -58,7 +58,7 @@ int daLv6ChangeGate_c::CreateHeap() { /* 80C70E40-80C7106C 0002E0 022C+00 1/1 0/0 0/0 .text create__17daLv6ChangeGate_cFv */ int daLv6ChangeGate_c::create() { - fopAcM_SetupActor(this, daLv6ChangeGate_c); + fopAcM_ct(this, daLv6ChangeGate_c); if (getSw2() != 0xFF && fopAcM_isSwitch(this, getSw2())) { return cPhs_ERROR_e; diff --git a/src/d/actor/d_a_obj_lv6Lblock.cpp b/src/d/actor/d_a_obj_lv6Lblock.cpp index 7023aa2f459..52b89f61439 100644 --- a/src/d/actor/d_a_obj_lv6Lblock.cpp +++ b/src/d/actor/d_a_obj_lv6Lblock.cpp @@ -42,7 +42,7 @@ int daLv6Lblock_c::CreateHeap() { /* 80C73558-80C736C0 000258 0168+00 1/1 0/0 0/0 .text create__13daLv6Lblock_cFv */ int daLv6Lblock_c::create() { - fopAcM_SetupActor(this, daLv6Lblock_c); + fopAcM_ct(this, daLv6Lblock_c); int phase_state = dComIfG_resLoad(&mPhase, "L6Lblock"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_lv6SwGate.cpp b/src/d/actor/d_a_obj_lv6SwGate.cpp index c7ce7473546..960bc0fb6a9 100644 --- a/src/d/actor/d_a_obj_lv6SwGate.cpp +++ b/src/d/actor/d_a_obj_lv6SwGate.cpp @@ -86,7 +86,7 @@ int daLv6SwGate_c::CreateHeap() { /* 80C7429C-80C744E4 00047C 0248+00 1/1 0/0 0/0 .text create__13daLv6SwGate_cFv */ int daLv6SwGate_c::create() { - fopAcM_SetupActor(this, daLv6SwGate_c); + fopAcM_ct(this, daLv6SwGate_c); if (getSw2() != 0xff && fopAcM_isSwitch(this, getSw2())) { return cPhs_ERROR_e; } diff --git a/src/d/actor/d_a_obj_lv6SzGate.cpp b/src/d/actor/d_a_obj_lv6SzGate.cpp index 61ea19cf463..1f8cccff460 100644 --- a/src/d/actor/d_a_obj_lv6SzGate.cpp +++ b/src/d/actor/d_a_obj_lv6SzGate.cpp @@ -83,7 +83,7 @@ int daLv6SzGate_c::CreateHeap() { /* 80C75C0C-80C75DD0 00048C 01C4+00 1/1 0/0 0/0 .text create__13daLv6SzGate_cFv */ cPhs__Step daLv6SzGate_c::create() { - fopAcM_SetupActor(this, daLv6SzGate_c); + fopAcM_ct(this, daLv6SzGate_c); cPhs__Step phase = static_cast(dComIfG_resLoad(&mPhase, "L6SzGate")); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_lv6TogeRoll.cpp b/src/d/actor/d_a_obj_lv6TogeRoll.cpp index a64d4c119bd..b05008885ca 100644 --- a/src/d/actor/d_a_obj_lv6TogeRoll.cpp +++ b/src/d/actor/d_a_obj_lv6TogeRoll.cpp @@ -81,7 +81,7 @@ f32 const daTogeRoll_c::mSpeed[] = { /* 80C77DBC-80C78058 00027C 029C+00 1/1 0/0 0/0 .text create__12daTogeRoll_cFv */ int daTogeRoll_c::create() { - fopAcM_SetupActor(this, daTogeRoll_c); + fopAcM_ct(this, daTogeRoll_c); int phase = dComIfG_resLoad(&mPhase, "togeRol"); diff --git a/src/d/actor/d_a_obj_lv6bemos.cpp b/src/d/actor/d_a_obj_lv6bemos.cpp index cd914d68b8c..acc33276b30 100644 --- a/src/d/actor/d_a_obj_lv6bemos.cpp +++ b/src/d/actor/d_a_obj_lv6bemos.cpp @@ -409,7 +409,7 @@ int daObjL6Bm_c::Delete() { /* 80C7DAF0-80C7DC78 001050 0188+00 1/0 0/0 0/0 .text daObjL6Bm_create1st__FP11daObjL6Bm_c */ static int daObjL6Bm_create1st(daObjL6Bm_c* i_this) { - fopAcM_SetupActor(i_this, daObjL6Bm_c); + fopAcM_ct(i_this, daObjL6Bm_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_lv6bemos2.cpp b/src/d/actor/d_a_obj_lv6bemos2.cpp index 33544606ae3..d8f240f8d0f 100644 --- a/src/d/actor/d_a_obj_lv6bemos2.cpp +++ b/src/d/actor/d_a_obj_lv6bemos2.cpp @@ -1194,7 +1194,7 @@ int daObjLv6Bm_c::Delete() { /* 80C81808-80C819C8 0036C8 01C0+00 1/0 0/0 0/0 .text daObjLv6Bm_create1st__FP12daObjLv6Bm_c */ static int daObjLv6Bm_create1st(daObjLv6Bm_c* i_this) { - fopAcM_SetupActor(i_this, daObjLv6Bm_c); + fopAcM_ct(i_this, daObjLv6Bm_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_lv6swturn.cpp b/src/d/actor/d_a_obj_lv6swturn.cpp index 4827d7c76ab..a044ec737f7 100644 --- a/src/d/actor/d_a_obj_lv6swturn.cpp +++ b/src/d/actor/d_a_obj_lv6swturn.cpp @@ -347,7 +347,7 @@ int daObjLv6SwTurn_c::Delete() { /* 80C845D0-80C84630 000CB0 0060+00 1/0 0/0 0/0 .text * daObjLv6SwTurn_create1st__FP16daObjLv6SwTurn_c */ static int daObjLv6SwTurn_create1st(daObjLv6SwTurn_c* i_this) { - fopAcM_SetupActor(i_this, daObjLv6SwTurn_c); + fopAcM_ct(i_this, daObjLv6SwTurn_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_lv8Lift.cpp b/src/d/actor/d_a_obj_lv8Lift.cpp index 4b6415c39b4..6ea0f76c252 100644 --- a/src/d/actor/d_a_obj_lv8Lift.cpp +++ b/src/d/actor/d_a_obj_lv8Lift.cpp @@ -63,7 +63,7 @@ static daL8Lift_HIO_c l_HIO; /* 80C88928-80C88C44 0002E8 031C+00 1/1 0/0 0/0 .text create__10daL8Lift_cFv */ int daL8Lift_c::create() { - fopAcM_SetupActor(this, daL8Lift_c); + fopAcM_ct(this, daL8Lift_c); int phase_state = dComIfG_resLoad(&mPhase, "L8Lift"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_lv8OptiLift.cpp b/src/d/actor/d_a_obj_lv8OptiLift.cpp index 54d666f5fde..ee7d87bf5bc 100644 --- a/src/d/actor/d_a_obj_lv8OptiLift.cpp +++ b/src/d/actor/d_a_obj_lv8OptiLift.cpp @@ -63,7 +63,7 @@ static daOptiLift_HIO_c l_HIO; /* 80C8A500-80C8A738 0002E0 0238+00 1/1 0/0 0/0 .text create__12daOptiLift_cFv */ int daOptiLift_c::create() { - fopAcM_SetupActor(this, daOptiLift_c); + fopAcM_ct(this, daOptiLift_c); int phase_state = dComIfG_resLoad(&mPhase, "Lv8Lift"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_magLift.cpp b/src/d/actor/d_a_obj_magLift.cpp index 4bc2e08fb3f..11bc745ab87 100644 --- a/src/d/actor/d_a_obj_magLift.cpp +++ b/src/d/actor/d_a_obj_magLift.cpp @@ -50,7 +50,7 @@ const f32 daMagLift_c::mSpeed[16] = { /* 80C8DB94-80C8DD38 000254 01A4+00 1/1 0/0 0/0 .text create__11daMagLift_cFv */ int daMagLift_c::create() { - fopAcM_SetupActor(this, daMagLift_c); + fopAcM_ct(this, daMagLift_c); int phase = dComIfG_resLoad(&mPhaseReq,"L_maglift"); if (phase == cPhs_COMPLEATE_e) { if (MoveBGCreate("L_maglift", 7, dBgS_MoveBGProc_TypicalRotY, 0x4000, NULL) == cPhs_ERROR_e) { diff --git a/src/d/actor/d_a_obj_magLiftRot.cpp b/src/d/actor/d_a_obj_magLiftRot.cpp index 91bb2f6ac8a..e6903186a22 100644 --- a/src/d/actor/d_a_obj_magLiftRot.cpp +++ b/src/d/actor/d_a_obj_magLiftRot.cpp @@ -95,7 +95,7 @@ int daMagLiftRot_c::CreateHeap() { /* 80C8EC64-80C8EF4C 000404 02E8+00 1/1 0/0 0/0 .text create__14daMagLiftRot_cFv */ int daMagLiftRot_c::create() { - fopAcM_SetupActor(this, daMagLiftRot_c); + fopAcM_ct(this, daMagLiftRot_c); mType = 0; diff --git a/src/d/actor/d_a_obj_magne_arm.cpp b/src/d/actor/d_a_obj_magne_arm.cpp index d70b1aeb99d..97741332c26 100644 --- a/src/d/actor/d_a_obj_magne_arm.cpp +++ b/src/d/actor/d_a_obj_magne_arm.cpp @@ -1177,7 +1177,7 @@ int daObjMarm_c::Delete() { /* ############################################################################################## */ /* 80592468-80592594 003188 012C+00 1/0 0/0 0/0 .text daObjMarm_create1st__FP11daObjMarm_c */ static int daObjMarm_create1st(daObjMarm_c* i_this) { - fopAcM_SetupActor(i_this, daObjMarm_c); + fopAcM_ct(i_this, daObjMarm_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_maki.cpp b/src/d/actor/d_a_obj_maki.cpp index 79da7505f26..cd8346c06bf 100644 --- a/src/d/actor/d_a_obj_maki.cpp +++ b/src/d/actor/d_a_obj_maki.cpp @@ -189,7 +189,7 @@ daObj_Maki_HIO_c l_HIO; /* 80C9058C-80C9080C 00086C 0280+00 1/0 0/0 0/0 .text daObj_Maki_Create__FP10fopAc_ac_c */ cPhs__Step daObj_Maki_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, obj_maki_class); + fopAcM_ct(i_this, obj_maki_class); obj_maki_class* a_this = (obj_maki_class*)i_this; static dCcD_SrcSph cc_sph_src = { { diff --git a/src/d/actor/d_a_obj_master_sword.cpp b/src/d/actor/d_a_obj_master_sword.cpp index c154077e134..35bf65b0a2c 100644 --- a/src/d/actor/d_a_obj_master_sword.cpp +++ b/src/d/actor/d_a_obj_master_sword.cpp @@ -95,7 +95,7 @@ actionFunc daObjMasterSword_c::ActionTable[] = { /* 80C90DB8-80C90F6C 000338 01B4+00 1/1 0/0 0/0 .text create__18daObjMasterSword_cFv */ int daObjMasterSword_c::create() { - fopAcM_SetupActor(this, daObjMasterSword_c); + fopAcM_ct(this, daObjMasterSword_c); if (dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[getFlagNo()])) { return cPhs_ERROR_e; diff --git a/src/d/actor/d_a_obj_mato.cpp b/src/d/actor/d_a_obj_mato.cpp index 2395aeb4c1f..d9291f41e7e 100644 --- a/src/d/actor/d_a_obj_mato.cpp +++ b/src/d/actor/d_a_obj_mato.cpp @@ -341,7 +341,7 @@ int daObjMATO_c::mato_init() { /* 80C927AC-80C92924 000CCC 0178+00 1/1 0/0 0/0 .text create__11daObjMATO_cFv */ int daObjMATO_c::create() { - fopAcM_SetupActor(this, daObjMATO_c); + fopAcM_ct(this, daObjMATO_c); if (!mato_init()) { OS_REPORT("MATO : rale data not found!\n"); diff --git a/src/d/actor/d_a_obj_metalbox.cpp b/src/d/actor/d_a_obj_metalbox.cpp index 1ce9d4e39e8..cbf48fea996 100644 --- a/src/d/actor/d_a_obj_metalbox.cpp +++ b/src/d/actor/d_a_obj_metalbox.cpp @@ -51,7 +51,7 @@ int daObjMBox_c::CreateHeap() { /* 80593044-805931C4 000224 0180+00 1/1 0/0 0/0 .text create__11daObjMBox_cFv */ int daObjMBox_c::create() { - fopAcM_SetupActor(this, daObjMBox_c); + fopAcM_ct(this, daObjMBox_c); int phase_state = dComIfG_resLoad(&mPhase, l_arcName); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_mgate.cpp b/src/d/actor/d_a_obj_mgate.cpp index 0a15ace4d5e..38b8d37b1ce 100644 --- a/src/d/actor/d_a_obj_mgate.cpp +++ b/src/d/actor/d_a_obj_mgate.cpp @@ -241,7 +241,7 @@ int daObjMGate_c::Delete() { /* 80593D74-80593DD4 000834 0060+00 1/0 0/0 0/0 .text daObjMGate_create1st__FP12daObjMGate_c */ static int daObjMGate_create1st(daObjMGate_c* i_this) { - fopAcM_SetupActor(i_this, daObjMGate_c); + fopAcM_ct(i_this, daObjMGate_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_mhole.cpp b/src/d/actor/d_a_obj_mhole.cpp index c273bd40d2a..53074c05ca3 100644 --- a/src/d/actor/d_a_obj_mhole.cpp +++ b/src/d/actor/d_a_obj_mhole.cpp @@ -200,7 +200,7 @@ int daObjMHole_c::CreateHeap() { /* 80C934E0-80C93660 000700 0180+00 1/1 0/0 0/0 .text create__12daObjMHole_cFv */ int daObjMHole_c::create() { - fopAcM_SetupActor(this, daObjMHole_c); + fopAcM_ct(this, daObjMHole_c); mKind = getKind(); diff --git a/src/d/actor/d_a_obj_mie.cpp b/src/d/actor/d_a_obj_mie.cpp index 5a3bf287f11..2e0979e6934 100644 --- a/src/d/actor/d_a_obj_mie.cpp +++ b/src/d/actor/d_a_obj_mie.cpp @@ -91,7 +91,7 @@ daObj_Mie_c::~daObj_Mie_c() { /* 80C941C8-80C94398 0002E8 01D0+00 1/1 0/0 0/0 .text create__11daObj_Mie_cFv */ int daObj_Mie_c::create() { - fopAcM_SetupActor(this, daObj_Mie_c); + fopAcM_ct(this, daObj_Mie_c); mType = getType(); int rv = dComIfG_resLoad(&mPhase, l_resNameList[l_bmdData[mType][1]]); if (rv == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_mirror_6pole.cpp b/src/d/actor/d_a_obj_mirror_6pole.cpp index 2fbe3c2b3be..ca7c694628a 100644 --- a/src/d/actor/d_a_obj_mirror_6pole.cpp +++ b/src/d/actor/d_a_obj_mirror_6pole.cpp @@ -101,7 +101,7 @@ int daObjMirror6Pole_c::CreateHeap() { } int daObjMirror6Pole_c::create() { - fopAcM_SetupActor(this, daObjMirror6Pole_c); + fopAcM_ct(this, daObjMirror6Pole_c); int phase = dComIfG_resLoad(&mPhase, l_arcName); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_mirror_chain.cpp b/src/d/actor/d_a_obj_mirror_chain.cpp index a1e4dc3b05e..3436a0d3b05 100644 --- a/src/d/actor/d_a_obj_mirror_chain.cpp +++ b/src/d/actor/d_a_obj_mirror_chain.cpp @@ -457,7 +457,7 @@ void daObjMirrorChain_c::create_init() { } cPhs__Step daObjMirrorChain_c::create() { - fopAcM_SetupActor(this, daObjMirrorChain_c); + fopAcM_ct(this, daObjMirrorChain_c); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhaseReq, l_arcName); if (step == cPhs_COMPLEATE_e) { if (!fopAcM_entrySolidHeap(this, createSolidHeap, 0x71b0)) { diff --git a/src/d/actor/d_a_obj_mirror_sand.cpp b/src/d/actor/d_a_obj_mirror_sand.cpp index 464700ad94d..683cff4ca43 100644 --- a/src/d/actor/d_a_obj_mirror_sand.cpp +++ b/src/d/actor/d_a_obj_mirror_sand.cpp @@ -159,7 +159,7 @@ void daObjMirrorSand_c::create_init() { } int daObjMirrorSand_c::create() { - fopAcM_SetupActor(this, daObjMirrorSand_c); + fopAcM_ct(this, daObjMirrorSand_c); int phase = dComIfG_resLoad(&mPhase, l_arcName); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_mirror_screw.cpp b/src/d/actor/d_a_obj_mirror_screw.cpp index 1ee9dc6c002..ea102ceef92 100644 --- a/src/d/actor/d_a_obj_mirror_screw.cpp +++ b/src/d/actor/d_a_obj_mirror_screw.cpp @@ -163,7 +163,7 @@ static int daObjMirrorScrew_Delete(daObjMirrorScrew_c* i_this) { } cPhs__Step daObjMirrorScrew_c::create() { - fopAcM_SetupActor(this, daObjMirrorScrew_c); + fopAcM_ct(this, daObjMirrorScrew_c); if (fopAcM_isSwitch(this, getSwitchNo()) || /* dSv_event_flag_c::F_0361 - Arbiter's Grounds - Spun the spinning pillars */ dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[361]) diff --git a/src/d/actor/d_a_obj_mirror_table.cpp b/src/d/actor/d_a_obj_mirror_table.cpp index 7afce00f773..b57056d8a28 100644 --- a/src/d/actor/d_a_obj_mirror_table.cpp +++ b/src/d/actor/d_a_obj_mirror_table.cpp @@ -403,7 +403,7 @@ static cPhs__Step daObjMirrorTable_Create(fopAc_ac_c* i_this) { /* 80C9AB30-80C9ABFC 001290 00CC+00 1/1 0/0 0/0 .text create__18daObjMirrorTable_cFv */ cPhs__Step daObjMirrorTable_c::create() { - fopAcM_SetupActor(this, daObjMirrorTable_c); + fopAcM_ct(this, daObjMirrorTable_c); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhaseReq, l_arcName); if (step == cPhs_COMPLEATE_e) { if (!fopAcM_entrySolidHeap(this, createSolidHeap, 0xdb50)) { diff --git a/src/d/actor/d_a_obj_movebox.cpp b/src/d/actor/d_a_obj_movebox.cpp index c6c4d016b99..a25fdbd5cac 100644 --- a/src/d/actor/d_a_obj_movebox.cpp +++ b/src/d/actor/d_a_obj_movebox.cpp @@ -1250,7 +1250,7 @@ int daObjMovebox::Act_c::Delete() { } int daObjMovebox::Act_c::Mthd_Create() { - fopAcM_SetupActor(this, daObjMovebox::Act_c); + fopAcM_ct(this, daObjMovebox::Act_c); mType = prm_get_type(); prmX_init(); diff --git a/src/d/actor/d_a_obj_msima.cpp b/src/d/actor/d_a_obj_msima.cpp index 556c2d93303..dfe736eb623 100644 --- a/src/d/actor/d_a_obj_msima.cpp +++ b/src/d/actor/d_a_obj_msima.cpp @@ -458,7 +458,7 @@ static int useHeapInit(fopAc_ac_c* a_this) { */ static int daObj_Msima_Create(fopAc_ac_c* a_this) { obj_msima_class* i_this = (obj_msima_class*)a_this; - fopAcM_SetupActor(a_this, obj_msima_class); + fopAcM_ct(a_this, obj_msima_class); int rv = dComIfG_resLoad(&i_this->mPhase, "MAGNESIMA"); if (rv == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_mvstair.cpp b/src/d/actor/d_a_obj_mvstair.cpp index e40cc5fa704..89a5e82580b 100644 --- a/src/d/actor/d_a_obj_mvstair.cpp +++ b/src/d/actor/d_a_obj_mvstair.cpp @@ -473,7 +473,7 @@ void daObjStair_c::removeParticle() { /* 80C9E614-80C9E700 0015F4 00EC+00 1/0 0/0 0/0 .text daObjStair_create1st__FP12daObjStair_c */ static int daObjStair_create1st(daObjStair_c* i_this) { - fopAcM_SetupActor(i_this, daObjStair_c); + fopAcM_ct(i_this, daObjStair_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_myogan.cpp b/src/d/actor/d_a_obj_myogan.cpp index db24a17d7f1..a415301401d 100644 --- a/src/d/actor/d_a_obj_myogan.cpp +++ b/src/d/actor/d_a_obj_myogan.cpp @@ -142,7 +142,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 80C9F0AC-80C9F1F0 0005EC 0144+00 1/0 0/0 0/0 .text daObj_Myogan_Create__FP10fopAc_ac_c */ static int daObj_Myogan_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, obj_myogan_class); + fopAcM_ct(i_this, obj_myogan_class); obj_myogan_class* a_this = (obj_myogan_class*)i_this; int phase = dComIfG_resLoad(&a_this->mPhase, "S_YOGAN"); diff --git a/src/d/actor/d_a_obj_nagaisu.cpp b/src/d/actor/d_a_obj_nagaisu.cpp index c2079c61d5c..994544510b5 100644 --- a/src/d/actor/d_a_obj_nagaisu.cpp +++ b/src/d/actor/d_a_obj_nagaisu.cpp @@ -73,7 +73,7 @@ const dCcD_SrcCyl daObjIsuChild_c::s_CcDCyl = { /* 80C9F668-80C9F7A8 000328 0140+00 1/1 0/0 0/0 .text create__14daObjNagaisu_cFv */ int daObjNagaisu_c::create() { - fopAcM_SetupActor(this, daObjNagaisu_c); + fopAcM_ct(this, daObjNagaisu_c); int phase_state = dComIfG_resLoad(this, l_arcName); if (phase_state == cPhs_COMPLEATE_e) { @@ -318,7 +318,7 @@ void daObjIsuChild_c::callEmt() { /* 80CA0258-80CA02AC 000F18 0054+00 1/0 0/0 0/0 .text daObjNagaisu_create__FP14daObjNagaisu_c */ static int daObjNagaisu_create(daObjNagaisu_c* i_this) { - fopAcM_SetupActor(i_this, daObjNagaisu_c); + fopAcM_ct(i_this, daObjNagaisu_c); return i_this->create(); } diff --git a/src/d/actor/d_a_obj_nameplate.cpp b/src/d/actor/d_a_obj_nameplate.cpp index 82c46d17ee8..fbd16c46aaf 100644 --- a/src/d/actor/d_a_obj_nameplate.cpp +++ b/src/d/actor/d_a_obj_nameplate.cpp @@ -312,7 +312,7 @@ static int daObjNameplate_Delete(daObjNameplate_c* i_this) { } int daObjNameplate_c::create() { - fopAcM_SetupActor(this, daObjNameplate_c); + fopAcM_ct(this, daObjNameplate_c); int phase_state = dComIfG_resLoad(&mPhase, l_arcName); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_nan.cpp b/src/d/actor/d_a_obj_nan.cpp index a2167e1dcf8..ed2870e42ee 100644 --- a/src/d/actor/d_a_obj_nan.cpp +++ b/src/d/actor/d_a_obj_nan.cpp @@ -679,7 +679,7 @@ static daObj_NanHIO_c l_HIO; /* 80CA2B68-80CA2FDC 0026A8 0474+00 1/1 0/0 0/0 .text create__10daObjNAN_cFv */ int daObjNAN_c::create() { u8 uVar6 = (fopAcM_GetParam(this) & 0xf00) >> 8; - fopAcM_SetupActor(this, daObjNAN_c); + fopAcM_ct(this, daObjNAN_c); int rv = dComIfG_resLoad(&mPhase, "I_Nan"); if (rv == cPhs_COMPLEATE_e) { OS_REPORT("NAN PARAM %x\n", fopAcM_GetParam(this)); diff --git a/src/d/actor/d_a_obj_ndoor.cpp b/src/d/actor/d_a_obj_ndoor.cpp index a28818b3bcd..91a1003d756 100644 --- a/src/d/actor/d_a_obj_ndoor.cpp +++ b/src/d/actor/d_a_obj_ndoor.cpp @@ -110,7 +110,7 @@ static int daObj_Ndoor_Create(fopAc_ac_c* i_this) { }; obj_ndoor_class* a_this = (obj_ndoor_class*)i_this; - fopAcM_SetupActor(i_this, obj_ndoor_class); + fopAcM_ct(i_this, obj_ndoor_class); cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&a_this->mPhase, "Obj_ndoor"); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_octhashi.cpp b/src/d/actor/d_a_obj_octhashi.cpp index b5e34df4f17..b2916640406 100644 --- a/src/d/actor/d_a_obj_octhashi.cpp +++ b/src/d/actor/d_a_obj_octhashi.cpp @@ -320,7 +320,7 @@ int daObjOCTHASHI_c::CreateHeap() { /* 80CA5B98-80CA5EE4 001058 034C+00 1/1 0/0 0/0 .text create__15daObjOCTHASHI_cFv */ int daObjOCTHASHI_c::create() { - fopAcM_SetupActor(this, daObjOCTHASHI_c); + fopAcM_ct(this, daObjOCTHASHI_c); mPieceNum = fopAcM_GetParam(this) & 0xff; if (mPieceNum == 0xff) { mPieceNum = 0; diff --git a/src/d/actor/d_a_obj_oiltubo.cpp b/src/d/actor/d_a_obj_oiltubo.cpp index 7ad77e8f389..6f41579d21b 100644 --- a/src/d/actor/d_a_obj_oiltubo.cpp +++ b/src/d/actor/d_a_obj_oiltubo.cpp @@ -31,7 +31,7 @@ dCcD_SrcCyl daObj_Oiltubo_c::mCcDCyl = { /* 80CA6718-80CA6914 000078 01FC+00 1/1 0/0 0/0 .text create__15daObj_Oiltubo_cFv */ int daObj_Oiltubo_c::create() { - fopAcM_SetupActor(this, daObj_Oiltubo_c); + fopAcM_ct(this, daObj_Oiltubo_c); int phase_state = dComIfG_resLoad(&mPhase, getResName()); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_onsen.cpp b/src/d/actor/d_a_obj_onsen.cpp index 8809d6e5fea..6f38e10a5cb 100644 --- a/src/d/actor/d_a_obj_onsen.cpp +++ b/src/d/actor/d_a_obj_onsen.cpp @@ -121,7 +121,7 @@ int daObjOnsen_c::Delete() { /* 80CA8048-80CA80A8 000568 0060+00 1/0 0/0 0/0 .text daObjOnsen_create1st__FP12daObjOnsen_c */ static int daObjOnsen_create1st(daObjOnsen_c* i_this) { - fopAcM_SetupActor(i_this, daObjOnsen_c); + fopAcM_ct(i_this, daObjOnsen_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_onsenFire.cpp b/src/d/actor/d_a_obj_onsenFire.cpp index 567fb46aaf8..19d79e690f6 100644 --- a/src/d/actor/d_a_obj_onsenFire.cpp +++ b/src/d/actor/d_a_obj_onsenFire.cpp @@ -10,7 +10,7 @@ /* 80CA8278-80CA82F4 000078 007C+00 1/1 0/0 0/0 .text create__16daObjOnsenFire_cFv */ int daObjOnsenFire_c::create() { - fopAcM_SetupActor(this, daObjOnsenFire_c); + fopAcM_ct(this, daObjOnsenFire_c); /* dSv_event_flag_c::F_0377 - Castle Town - Goron spring water shop open! */ if (!dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[377])) { return cPhs_ERROR_e; diff --git a/src/d/actor/d_a_obj_onsenTaru.cpp b/src/d/actor/d_a_obj_onsenTaru.cpp index 04e8c21b2de..67f83b283b2 100644 --- a/src/d/actor/d_a_obj_onsenTaru.cpp +++ b/src/d/actor/d_a_obj_onsenTaru.cpp @@ -63,7 +63,7 @@ int daOnsTaru_c::CreateHeap() { /* 80CA87B4-80CA8A54 0002D4 02A0+00 1/1 0/0 0/0 .text create__11daOnsTaru_cFv */ int daOnsTaru_c::create() { - fopAcM_SetupActor(this, daOnsTaru_c); + fopAcM_ct(this, daOnsTaru_c); if (fopAcM_isSwitch(this, getSw())) { return cPhs_ERROR_e; diff --git a/src/d/actor/d_a_obj_ornament_cloth.cpp b/src/d/actor/d_a_obj_ornament_cloth.cpp index c15402f96c0..258fff6e1c4 100644 --- a/src/d/actor/d_a_obj_ornament_cloth.cpp +++ b/src/d/actor/d_a_obj_ornament_cloth.cpp @@ -316,7 +316,7 @@ static int daObjOnCloth_Delete(daObjOnCloth_c* i_this) { ClothJoint_c::~ClothJoint_c() {} cPhs__Step daObjOnCloth_c::create() { - fopAcM_SetupActor(this, daObjOnCloth_c); + fopAcM_ct(this, daObjOnCloth_c); cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&mPhase, l_arcName); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_pdoor.cpp b/src/d/actor/d_a_obj_pdoor.cpp index f7dbea3ed97..4d05d9c6796 100644 --- a/src/d/actor/d_a_obj_pdoor.cpp +++ b/src/d/actor/d_a_obj_pdoor.cpp @@ -275,7 +275,7 @@ int daObjPDoor_c::Delete() { /* 80CAAA4C-80CAAAAC 000C2C 0060+00 1/0 0/0 0/0 .text daObjPDoor_create1st__FP12daObjPDoor_c */ static int daObjPDoor_create1st(daObjPDoor_c* i_this) { - fopAcM_SetupActor(i_this, daObjPDoor_c); + fopAcM_ct(i_this, daObjPDoor_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_pdtile.cpp b/src/d/actor/d_a_obj_pdtile.cpp index 1adf4a66d5d..1fc9aa43ae1 100644 --- a/src/d/actor/d_a_obj_pdtile.cpp +++ b/src/d/actor/d_a_obj_pdtile.cpp @@ -522,7 +522,7 @@ int daObjPDtile_c::Delete() { /* 80CAC0D8-80CAC1D4 001498 00FC+00 1/0 0/0 0/0 .text daObjPDtile_create1st__FP13daObjPDtile_c */ static int daObjPDtile_create1st(daObjPDtile_c* i_this) { - fopAcM_SetupActor(i_this,daObjPDtile_c); + fopAcM_ct(i_this,daObjPDtile_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_pillar.cpp b/src/d/actor/d_a_obj_pillar.cpp index e9d9855d1e8..39d156b5d47 100644 --- a/src/d/actor/d_a_obj_pillar.cpp +++ b/src/d/actor/d_a_obj_pillar.cpp @@ -197,7 +197,7 @@ int daPillar_c::CreateHeap() { /* 80CAF8A4-80CAFA58 000664 01B4+00 1/1 0/0 0/0 .text create1st__10daPillar_cFv */ int daPillar_c::create1st() { - fopAcM_SetupActor(this, daPillar_c); + fopAcM_ct(this, daPillar_c); if (!mIsPrmInit) { mIsPrmInit = true; @@ -490,7 +490,7 @@ int daPillar_c::Delete() { /* 80CB0780-80CB0874 001540 00F4+00 1/0 0/0 0/0 .text daPillar_create1st__FP10daPillar_c */ static int daPillar_create1st(daPillar_c* i_this) { - fopAcM_SetupActor(i_this, daPillar_c); + fopAcM_ct(i_this, daPillar_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_pleaf.cpp b/src/d/actor/d_a_obj_pleaf.cpp index 52240650761..81c278b52c9 100644 --- a/src/d/actor/d_a_obj_pleaf.cpp +++ b/src/d/actor/d_a_obj_pleaf.cpp @@ -21,7 +21,7 @@ daObj_Pleaf_Param_c::params const daObj_Pleaf_Param_c::m = {0, -3.0f, 1.0f, 900. /* 80CB0F08-80CB1180 0002A8 0278+00 1/1 0/0 0/0 .text create__13daObj_Pleaf_cFv */ int daObj_Pleaf_c::create() { - fopAcM_SetupActor(this, daObj_Pleaf_c); + fopAcM_ct(this, daObj_Pleaf_c); mType = getType(); int phase = dComIfG_resLoad(&mPhaseReq, getResName()); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_poFire.cpp b/src/d/actor/d_a_obj_poFire.cpp index ebcf2533b0e..60f2b6ca51b 100644 --- a/src/d/actor/d_a_obj_poFire.cpp +++ b/src/d/actor/d_a_obj_poFire.cpp @@ -86,7 +86,7 @@ static u8 const itemNo[4] = {fpcNm_ITEM_POU_FIRE1, fpcNm_ITEM_POU_FIRE2, fpcNm_I /* 80CB2A74-80CB2BB8 000214 0144+00 1/1 0/0 0/0 .text create__10daPoFire_cFv */ int daPoFire_c::create() { - fopAcM_SetupActor(this, daPoFire_c); + fopAcM_ct(this, daPoFire_c); int phase = dComIfG_resLoad(&mPhase, "poFire"); if (phase != cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_prop.cpp b/src/d/actor/d_a_obj_prop.cpp index ed7a7f4807c..91bba7f93c8 100644 --- a/src/d/actor/d_a_obj_prop.cpp +++ b/src/d/actor/d_a_obj_prop.cpp @@ -37,7 +37,7 @@ bool daObjProp_c::createHeap() { /* 80CB5334-80CB5408 0001D4 00D4+00 1/1 0/0 0/0 .text create__11daObjProp_cFv */ int daObjProp_c::create() { - fopAcM_SetupActor(this, daObjProp_c); + fopAcM_ct(this, daObjProp_c); int phase = dComIfG_resLoad(this, l_arcName); if (phase == cPhs_COMPLEATE_e) { @@ -91,7 +91,7 @@ void daObjProp_c::setModelMtx() { /* 80CB5558-80CB55AC 0003F8 0054+00 1/0 0/0 0/0 .text daObjProp_create__FP11daObjProp_c */ static int daObjProp_create(daObjProp_c* i_this) { - fopAcM_SetupActor(i_this, daObjProp_c); + fopAcM_ct(i_this, daObjProp_c); return i_this->create(); } diff --git a/src/d/actor/d_a_obj_pumpkin.cpp b/src/d/actor/d_a_obj_pumpkin.cpp index 4889a9e3a36..d19aec13561 100644 --- a/src/d/actor/d_a_obj_pumpkin.cpp +++ b/src/d/actor/d_a_obj_pumpkin.cpp @@ -183,7 +183,7 @@ daObj_Pumpkin_c::~daObj_Pumpkin_c() { /* 80CB5A04-80CB5D74 000364 0370+00 1/1 0/0 0/0 .text create__15daObj_Pumpkin_cFv */ int daObj_Pumpkin_c::create() { - fopAcM_SetupActor(this, daObj_Pumpkin_c); + fopAcM_ct(this, daObj_Pumpkin_c); mType = getType(); cPhs__Step phase = (cPhs__Step) dComIfG_resLoad(&mPhaseReq, l_resNameList[l_bmdData[0][1]]); diff --git a/src/d/actor/d_a_obj_rcircle.cpp b/src/d/actor/d_a_obj_rcircle.cpp index c5bdfc3eb0c..f6a7f49e5a4 100644 --- a/src/d/actor/d_a_obj_rcircle.cpp +++ b/src/d/actor/d_a_obj_rcircle.cpp @@ -43,7 +43,7 @@ int daObjRCircle_c::createHeap() { /* 80CB8928-80CB8A28 000348 0100+00 1/1 0/0 0/0 .text create__14daObjRCircle_cFv */ int daObjRCircle_c::create() { - fopAcM_SetupActor(this, daObjRCircle_c); + fopAcM_ct(this, daObjRCircle_c); if (fopAcM_isSwitch(this, getSwBit())) { return cPhs_ERROR_e; } @@ -112,7 +112,7 @@ void daObjRCircle_c::setModelMtx() { /* 80CB8C44-80CB8C98 000664 0054+00 1/0 0/0 0/0 .text daObjRCircle_create__FP14daObjRCircle_c */ static int daObjRCircle_create(daObjRCircle_c* i_this) { - fopAcM_SetupActor(i_this, daObjRCircle_c); + fopAcM_ct(i_this, daObjRCircle_c); return i_this->create(); } diff --git a/src/d/actor/d_a_obj_rfHole.cpp b/src/d/actor/d_a_obj_rfHole.cpp index eb9a047626a..3386fe04086 100644 --- a/src/d/actor/d_a_obj_rfHole.cpp +++ b/src/d/actor/d_a_obj_rfHole.cpp @@ -37,7 +37,7 @@ int daRfHole_c::CreateHeap() { /* 80CB8FF8-80CB9148 000278 0150+00 1/1 0/0 0/0 .text create__10daRfHole_cFv */ int daRfHole_c::create() { - fopAcM_SetupActor(this, daRfHole_c); + fopAcM_ct(this, daRfHole_c); int rv = dComIfG_resLoad(&mPhase, "Otosiana"); if (rv == cPhs_COMPLEATE_e) { if (MoveBGCreate("Otosiana", 7, dBgS_MoveBGProc_TypicalRotY, 0xb40, NULL) == cPhs_ERROR_e) { diff --git a/src/d/actor/d_a_obj_rgate.cpp b/src/d/actor/d_a_obj_rgate.cpp index 60167aa3e05..6022b51bff7 100644 --- a/src/d/actor/d_a_obj_rgate.cpp +++ b/src/d/actor/d_a_obj_rgate.cpp @@ -890,7 +890,7 @@ int daObjRgate_c::Delete() { /* 80CBBFA0-80CBC054 002380 00B4+00 1/0 0/0 0/0 .text daObjRgate_create1st__FP12daObjRgate_c */ static int daObjRgate_create1st(daObjRgate_c* i_this) { - fopAcM_SetupActor(i_this, daObjRgate_c); + fopAcM_ct(i_this, daObjRgate_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_riverrock.cpp b/src/d/actor/d_a_obj_riverrock.cpp index 3eab65db955..8b98955918a 100644 --- a/src/d/actor/d_a_obj_riverrock.cpp +++ b/src/d/actor/d_a_obj_riverrock.cpp @@ -249,7 +249,7 @@ int daObjRIVERROCK_c::CreateHeap() { /* 80CBD3C0-80CBD71C 000DE0 035C+00 1/1 0/0 0/0 .text create__16daObjRIVERROCK_cFv */ int daObjRIVERROCK_c::create() { - fopAcM_SetupActor(this, daObjRIVERROCK_c); + fopAcM_ct(this, daObjRIVERROCK_c); int rv = dComIfG_resLoad(&mPhase, l_arcName); if (rv == cPhs_COMPLEATE_e) { gravity = -9.0f; diff --git a/src/d/actor/d_a_obj_rock.cpp b/src/d/actor/d_a_obj_rock.cpp index 1fac1fe9061..fe7a6ea2792 100644 --- a/src/d/actor/d_a_obj_rock.cpp +++ b/src/d/actor/d_a_obj_rock.cpp @@ -118,7 +118,7 @@ static dCcD_SrcSph cc_sph_src = { */ static int daObj_Rock_Create(fopAc_ac_c* i_this) { obj_rock_class* a_this = static_cast(i_this); - fopAcM_SetupActor(a_this, obj_rock_class); + fopAcM_ct(a_this, obj_rock_class); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&a_this->mPhaseReq, "Obj_rock"); if (step == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_rope_bridge.cpp b/src/d/actor/d_a_obj_rope_bridge.cpp index f486de2e0d6..d4ab1c051f4 100644 --- a/src/d/actor/d_a_obj_rope_bridge.cpp +++ b/src/d/actor/d_a_obj_rope_bridge.cpp @@ -661,7 +661,7 @@ int daObjRBridge_c::Delete() { /* 80597920-80597A90 001B60 0170+00 1/0 0/0 0/0 .text daObjRBridge_create1st__FP14daObjRBridge_c */ static int daObjRBridge_create1st(daObjRBridge_c* a_this) { - fopAcM_SetupActor(a_this, daObjRBridge_c); + fopAcM_ct(a_this, daObjRBridge_c); return a_this->create1st(); } diff --git a/src/d/actor/d_a_obj_rotBridge.cpp b/src/d/actor/d_a_obj_rotBridge.cpp index b35d3489b55..8a49ab3b6bd 100644 --- a/src/d/actor/d_a_obj_rotBridge.cpp +++ b/src/d/actor/d_a_obj_rotBridge.cpp @@ -99,7 +99,7 @@ int daRotBridge_c::CreateHeap() { /* 80CBECBC-80CBEED4 00041C 0218+00 1/1 0/0 0/0 .text create__13daRotBridge_cFv */ int daRotBridge_c::create() { - fopAcM_SetupActor(this, daRotBridge_c); + fopAcM_ct(this, daRotBridge_c); mType = (fopAcM_GetParam(this) & 0xF00) >> 8; diff --git a/src/d/actor/d_a_obj_rotTrap.cpp b/src/d/actor/d_a_obj_rotTrap.cpp index 8e62723091f..e9d23a0637e 100644 --- a/src/d/actor/d_a_obj_rotTrap.cpp +++ b/src/d/actor/d_a_obj_rotTrap.cpp @@ -102,7 +102,7 @@ int daRotTrap_c::CreateHeap() { /* 80CBFAC8-80CBFC88 000308 01C0+00 1/1 0/0 0/0 .text create__11daRotTrap_cFv */ int daRotTrap_c::create() { - fopAcM_SetupActor(this, daRotTrap_c); + fopAcM_ct(this, daRotTrap_c); int phase_state = dComIfG_resLoad(&mPhase, "P_kama"); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_roten.cpp b/src/d/actor/d_a_obj_roten.cpp index 49c78e9dcbd..71f56f73b52 100644 --- a/src/d/actor/d_a_obj_roten.cpp +++ b/src/d/actor/d_a_obj_roten.cpp @@ -91,7 +91,7 @@ static u32 l_dzbFileIdx = 7; /* 80CC0F40-80CC1038 000460 00F8+00 1/1 0/0 0/0 .text create__13daObj_Roten_cFv */ int daObj_Roten_c::create() { - fopAcM_SetupActor(this, daObj_Roten_c); + fopAcM_ct(this, daObj_Roten_c); /* dSv_event_flag_c::M_031 - Goron Mines - Goron Mines clear */ if (!dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[0x40])) { return cPhs_ERROR_e; diff --git a/src/d/actor/d_a_obj_rstair.cpp b/src/d/actor/d_a_obj_rstair.cpp index 2e7b790d6e6..c5f90996f3a 100644 --- a/src/d/actor/d_a_obj_rstair.cpp +++ b/src/d/actor/d_a_obj_rstair.cpp @@ -369,7 +369,7 @@ int daObjRotStair_c::Delete() { /* 80CC262C-80CC268C 00114C 0060+00 1/0 0/0 0/0 .text daObjRotStair_create1st__FP15daObjRotStair_c */ static int daObjRotStair_create1st(daObjRotStair_c* i_this) { - fopAcM_SetupActor(i_this, daObjRotStair_c); + fopAcM_ct(i_this, daObjRotStair_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_sWallShutter.cpp b/src/d/actor/d_a_obj_sWallShutter.cpp index 0e58fc7d1ce..50982d2dff9 100644 --- a/src/d/actor/d_a_obj_sWallShutter.cpp +++ b/src/d/actor/d_a_obj_sWallShutter.cpp @@ -60,7 +60,7 @@ static const int l_dzbIdx[2] = {7, 7}; /* 805983C4-80598564 0002C4 01A0+00 1/1 0/0 0/0 .text create__13daSwShutter_cFv */ int daSwShutter_c::create() { - fopAcM_SetupActor(this, daSwShutter_c); + fopAcM_ct(this, daSwShutter_c); mModelType = getModelType(); if (mModelType == 0xF) { diff --git a/src/d/actor/d_a_obj_saidan.cpp b/src/d/actor/d_a_obj_saidan.cpp index 0957b13c4a9..0c61f93ccbf 100644 --- a/src/d/actor/d_a_obj_saidan.cpp +++ b/src/d/actor/d_a_obj_saidan.cpp @@ -43,7 +43,7 @@ int daSaidan_c::CreateHeap() { /* 80CC3F1C-80CC4054 00025C 0138+00 1/1 0/0 0/0 .text create__10daSaidan_cFv */ cPhs__Step daSaidan_c::create() { - fopAcM_SetupActor(this, daSaidan_c); + fopAcM_ct(this, daSaidan_c); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhaseReq, "H_Saidan"); if (step == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_sakuita.cpp b/src/d/actor/d_a_obj_sakuita.cpp index 3de02773c86..0264a400e70 100644 --- a/src/d/actor/d_a_obj_sakuita.cpp +++ b/src/d/actor/d_a_obj_sakuita.cpp @@ -208,7 +208,7 @@ daObjSakuita_c::~daObjSakuita_c() { } inline int daObjSakuita_c::create() { - fopAcM_SetupActor(this, daObjSakuita_c); + fopAcM_ct(this, daObjSakuita_c); int rv = dComIfG_resLoad(&mPhase, l_arcName); if (rv == cPhs_COMPLEATE_e) { if (fopAcM_entrySolidHeap(this, createSolidHeap, 0x4000) == 0) { diff --git a/src/d/actor/d_a_obj_sakuita_rope.cpp b/src/d/actor/d_a_obj_sakuita_rope.cpp index 433a48f3289..922387d6656 100644 --- a/src/d/actor/d_a_obj_sakuita_rope.cpp +++ b/src/d/actor/d_a_obj_sakuita_rope.cpp @@ -381,7 +381,7 @@ static int daObjItaRope_Delete(daObjItaRope_c* i_this) { } int daObjItaRope_c::create() { - fopAcM_SetupActor(this, daObjItaRope_c); + fopAcM_ct(this, daObjItaRope_c); int rv = dComIfG_resLoad(&mPhase, l_arcName); if (rv == cPhs_COMPLEATE_e) { field_0x635 = getJointNum() + 2; diff --git a/src/d/actor/d_a_obj_scannon.cpp b/src/d/actor/d_a_obj_scannon.cpp index debc9089e00..7d7afaa0a39 100644 --- a/src/d/actor/d_a_obj_scannon.cpp +++ b/src/d/actor/d_a_obj_scannon.cpp @@ -97,7 +97,7 @@ static const u16 APP_PARTICLE_NAME[] = { /* 80CC6D10-80CC7124 0002F0 0414+00 1/1 0/0 0/0 .text create__11daSCannon_cFv */ int daSCannon_c::create() { - fopAcM_SetupActor(this, daSCannon_c); + fopAcM_ct(this, daSCannon_c); int layerNo = dComIfG_play_c::getLayerNo(0); if (layerNo != 1 && layerNo != 3 && layerNo != 10) { @@ -882,7 +882,7 @@ void daSCannon_c::setCannonRepair() { /* 80CC8E60-80CC8EB4 002440 0054+00 1/0 0/0 0/0 .text daSCannon_create__FP11daSCannon_c */ static int daSCannon_create(daSCannon_c* i_this) { - fopAcM_SetupActor(i_this, daSCannon_c); + fopAcM_ct(i_this, daSCannon_c); return i_this->create(); } diff --git a/src/d/actor/d_a_obj_scannon_crs.cpp b/src/d/actor/d_a_obj_scannon_crs.cpp index 87be04bd98f..43ab24d58ad 100644 --- a/src/d/actor/d_a_obj_scannon_crs.cpp +++ b/src/d/actor/d_a_obj_scannon_crs.cpp @@ -73,7 +73,7 @@ static const u16 BEAM_PARTICLE_NAME[] = { /* 80CC9910-80CC9B10 000310 0200+00 1/1 0/0 0/0 .text create__14daSCannonCrs_cFv */ int daSCannonCrs_c::create() { - fopAcM_SetupActor(this, daSCannonCrs_c); + fopAcM_ct(this, daSCannonCrs_c); if (dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[400])) { return cPhs_ERROR_e; @@ -529,7 +529,7 @@ void daSCannonCrs_c::callMidnaBeamEmt() { /* 80CCAF20-80CCAF74 001920 0054+00 1/0 0/0 0/0 .text daSCannonCrs_create__FP14daSCannonCrs_c */ static int daSCannonCrs_create(daSCannonCrs_c* i_this) { - fopAcM_SetupActor(i_this, daSCannonCrs_c); + fopAcM_ct(i_this, daSCannonCrs_c); return i_this->create(); } diff --git a/src/d/actor/d_a_obj_scannon_ten.cpp b/src/d/actor/d_a_obj_scannon_ten.cpp index ee9f98d571a..4ffca191e9c 100644 --- a/src/d/actor/d_a_obj_scannon_ten.cpp +++ b/src/d/actor/d_a_obj_scannon_ten.cpp @@ -82,7 +82,7 @@ int daObjSCannonTen_c::createHeap() { /* 80CCB66C-80CCB900 0003CC 0294+00 1/1 0/0 0/0 .text create__17daObjSCannonTen_cFv */ int daObjSCannonTen_c::create() { - fopAcM_SetupActor(this, daObjSCannonTen_c); + fopAcM_ct(this, daObjSCannonTen_c); int phase_state = dComIfG_resLoad(this, l_arcName); if (phase_state == cPhs_COMPLEATE_e) { @@ -501,7 +501,7 @@ void daObjSCannonTen_c::delEmtAll() { /* 80CCC9B8-80CCCA0C 001718 0054+00 1/0 0/0 0/0 .text * daObjSCannonTen_create__FP17daObjSCannonTen_c */ static int daObjSCannonTen_create(daObjSCannonTen_c* i_this) { - fopAcM_SetupActor(i_this, daObjSCannonTen_c); + fopAcM_ct(i_this, daObjSCannonTen_c); return i_this->create(); } diff --git a/src/d/actor/d_a_obj_sekidoor.cpp b/src/d/actor/d_a_obj_sekidoor.cpp index 73d968588da..4e17ec7e721 100644 --- a/src/d/actor/d_a_obj_sekidoor.cpp +++ b/src/d/actor/d_a_obj_sekidoor.cpp @@ -26,7 +26,7 @@ static char* l_resNameList[2] = {"", "SekiDoor"}; /* 80CCD02C-80CCD154 0000EC 0128+00 1/1 0/0 0/0 .text create__16daObj_SekiDoor_cFv */ int daObj_SekiDoor_c::create() { - fopAcM_SetupActor(this, daObj_SekiDoor_c); + fopAcM_ct(this, daObj_SekiDoor_c); mBitSW = 0; diff --git a/src/d/actor/d_a_obj_sekizo.cpp b/src/d/actor/d_a_obj_sekizo.cpp index 129c3244484..425d46ccd53 100644 --- a/src/d/actor/d_a_obj_sekizo.cpp +++ b/src/d/actor/d_a_obj_sekizo.cpp @@ -26,7 +26,7 @@ static char* l_resNameList[2] = {"", "Sekizo"}; /* 80CCDC0C-80CCDD00 0000EC 00F4+00 1/1 0/0 0/0 .text create__14daObj_Sekizo_cFv */ cPhs__Step daObj_Sekizo_c::create() { - fopAcM_SetupActor(this, daObj_Sekizo_c); + fopAcM_ct(this, daObj_Sekizo_c); field_0x5b0 = 0; cPhs__Step step = diff --git a/src/d/actor/d_a_obj_shield.cpp b/src/d/actor/d_a_obj_shield.cpp index 9e4f0d57879..74922ea69a0 100644 --- a/src/d/actor/d_a_obj_shield.cpp +++ b/src/d/actor/d_a_obj_shield.cpp @@ -113,7 +113,7 @@ int daItemShield_c::__CreateHeap() { /* 80CD7254-80CD7420 000874 01CC+00 1/1 0/0 0/0 .text create__14daItemShield_cFv */ int daItemShield_c::create() { - fopAcM_SetupActor(this, daItemShield_c); + fopAcM_ct(this, daItemShield_c); m_itemNo = fpcNm_ITEM_WOOD_SHIELD; if (fopAcM_isSwitch(this, getSwBit2())) { OS_REPORT("木の盾:もう取ったので出ません\n"); diff --git a/src/d/actor/d_a_obj_sm_door.cpp b/src/d/actor/d_a_obj_sm_door.cpp index 408e89f0812..26e2b0f9051 100644 --- a/src/d/actor/d_a_obj_sm_door.cpp +++ b/src/d/actor/d_a_obj_sm_door.cpp @@ -191,7 +191,7 @@ inline int daObjSM_DOOR_c::CreateHeap() { /* 80CD8D4C-80CD902C 00080C 02E0+00 1/1 0/0 0/0 .text create__14daObjSM_DOOR_cFv */ cPhs__Step daObjSM_DOOR_c::create() { - fopAcM_SetupActor(this, daObjSM_DOOR_c); + fopAcM_ct(this, daObjSM_DOOR_c); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhase, l_arcName); if (step == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_smallkey.cpp b/src/d/actor/d_a_obj_smallkey.cpp index a4fbc3ce22b..84405765f81 100644 --- a/src/d/actor/d_a_obj_smallkey.cpp +++ b/src/d/actor/d_a_obj_smallkey.cpp @@ -151,7 +151,7 @@ int daKey_c::__CreateHeap() { /* 80CDA164-80CDA404 000A24 02A0+00 1/1 0/0 0/0 .text create__7daKey_cFv */ int daKey_c::create() { - fopAcM_SetupActor(this, daKey_c); + fopAcM_ct(this, daKey_c); if (!mIsPrmInit) { field_0x938 = home.angle.x; diff --git a/src/d/actor/d_a_obj_smgdoor.cpp b/src/d/actor/d_a_obj_smgdoor.cpp index ed8a2b97353..0b48e94b0de 100644 --- a/src/d/actor/d_a_obj_smgdoor.cpp +++ b/src/d/actor/d_a_obj_smgdoor.cpp @@ -436,7 +436,7 @@ int daObjSmgDoor_c::Delete() { /* 80CDCB04-80CDCB64 001044 0060+00 1/0 0/0 0/0 .text daObjSmgDoor_create1st__FP14daObjSmgDoor_c */ static int daObjSmgDoor_create1st(daObjSmgDoor_c* i_this) { - fopAcM_SetupActor(i_this, daObjSmgDoor_c); + fopAcM_ct(i_this, daObjSmgDoor_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_smoke.cpp b/src/d/actor/d_a_obj_smoke.cpp index 3407d92be8b..d7fd9ea381a 100644 --- a/src/d/actor/d_a_obj_smoke.cpp +++ b/src/d/actor/d_a_obj_smoke.cpp @@ -33,7 +33,7 @@ int daObjSmoke_c::Create() { /* 80CDCF9C-80CDD004 00019C 0068+00 1/1 0/0 0/0 .text create__12daObjSmoke_cFv */ int daObjSmoke_c::create() { - fopAcM_SetupActor(this, daObjSmoke_c); + fopAcM_ct(this, daObjSmoke_c); if (Create() == 0) { return cPhs_ERROR_e; } diff --git a/src/d/actor/d_a_obj_smtile.cpp b/src/d/actor/d_a_obj_smtile.cpp index 86b390776bc..1db646892d0 100644 --- a/src/d/actor/d_a_obj_smtile.cpp +++ b/src/d/actor/d_a_obj_smtile.cpp @@ -41,7 +41,7 @@ daObj_SMTile_c::~daObj_SMTile_c() { /* 80CDD3E8-80CDD580 000228 0198+00 1/1 0/0 0/0 .text create__14daObj_SMTile_cFv */ int daObj_SMTile_c::create() { - fopAcM_SetupActor(this, daObj_SMTile_c); + fopAcM_ct(this, daObj_SMTile_c); mType = getType(); int rv = dComIfG_resLoad( &mPhase, diff --git a/src/d/actor/d_a_obj_smw_stone.cpp b/src/d/actor/d_a_obj_smw_stone.cpp index ddec633cbf0..cc92412ee1d 100644 --- a/src/d/actor/d_a_obj_smw_stone.cpp +++ b/src/d/actor/d_a_obj_smw_stone.cpp @@ -36,7 +36,7 @@ static u8 const lit_3776[12] = { /* 80CDE614-80CDE7F8 000174 01E4+00 1/1 0/0 0/0 .text create__12daSmWStone_cFv */ cPhs__Step daSmWStone_c::create() { - fopAcM_SetupActor(this, daSmWStone_c); + fopAcM_ct(this, daSmWStone_c); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(this, l_arcName); if (step == cPhs_COMPLEATE_e) { @@ -187,7 +187,7 @@ bool daSmWStone_c::chkWlfInRange() { /* 80CDEE28-80CDEE7C 000988 0054+00 1/0 0/0 0/0 .text daSmWStone_create__FP12daSmWStone_c */ static cPhs__Step daSmWStone_create(daSmWStone_c* i_this) { - fopAcM_SetupActor(i_this, daSmWStone_c); + fopAcM_ct(i_this, daSmWStone_c); return i_this->create(); } diff --git a/src/d/actor/d_a_obj_snowEffTag.cpp b/src/d/actor/d_a_obj_snowEffTag.cpp index 9ee153d849b..eb193f7961c 100644 --- a/src/d/actor/d_a_obj_snowEffTag.cpp +++ b/src/d/actor/d_a_obj_snowEffTag.cpp @@ -27,7 +27,7 @@ void daSnowEffTag_c::setBaseMtx() { /* 80CDF184-80CDF2B8 0001C4 0134+00 1/1 0/0 0/0 .text create__14daSnowEffTag_cFv */ int daSnowEffTag_c::create() { - fopAcM_SetupActor(this, daSnowEffTag_c); + fopAcM_ct(this, daSnowEffTag_c); mMaxSize = scale.x * 100.0f; diff --git a/src/d/actor/d_a_obj_snow_soup.cpp b/src/d/actor/d_a_obj_snow_soup.cpp index 47f8fef6146..9287851cb3c 100644 --- a/src/d/actor/d_a_obj_snow_soup.cpp +++ b/src/d/actor/d_a_obj_snow_soup.cpp @@ -53,7 +53,7 @@ int daObjSnowSoup_c::createHeap() { /* 80CDFA3C-80CDFB70 00025C 0134+00 1/1 0/0 0/0 .text create__15daObjSnowSoup_cFv */ cPhs__Step daObjSnowSoup_c::create() { - fopAcM_SetupActor(this, daObjSnowSoup_c); + fopAcM_ct(this, daObjSnowSoup_c); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(this, l_arcName); if (step == cPhs_COMPLEATE_e) { if (!fopAcM_entrySolidHeap(this, daObjSnowSoup_c_createHeap, 0x6500)) { @@ -186,7 +186,7 @@ void daObjSnowSoup_c::deleteSmkEmtChange(int i_state) { /* 80CE0180-80CE01D4 0009A0 0054+00 1/0 0/0 0/0 .text daObjSnowSoup_create__FP15daObjSnowSoup_c */ static cPhs__Step daObjSnowSoup_create(daObjSnowSoup_c* i_this) { - fopAcM_SetupActor(i_this, daObjSnowSoup_c); + fopAcM_ct(i_this, daObjSnowSoup_c); return i_this->create(); } diff --git a/src/d/actor/d_a_obj_so.cpp b/src/d/actor/d_a_obj_so.cpp index f0c4eb1d7e3..aca7bc75544 100644 --- a/src/d/actor/d_a_obj_so.cpp +++ b/src/d/actor/d_a_obj_so.cpp @@ -1013,7 +1013,7 @@ static int daObj_So_Create(fopAc_ac_c* a_this) { }; obj_so_class* i_this = (obj_so_class*)a_this; - fopAcM_SetupActor(a_this, obj_so_class); + fopAcM_ct(a_this, obj_so_class); int phase = dComIfG_resLoad(&i_this->mPhase, "Obj_so"); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_spinLift.cpp b/src/d/actor/d_a_obj_spinLift.cpp index 2bb5695dc93..4f78efdd037 100644 --- a/src/d/actor/d_a_obj_spinLift.cpp +++ b/src/d/actor/d_a_obj_spinLift.cpp @@ -79,7 +79,7 @@ int daSpinLift_c::CreateHeap() { /* 80CE3F1C-80CE40FC 00025C 01E0+00 1/1 0/0 0/0 .text create__12daSpinLift_cFv */ int daSpinLift_c::create() { static const int l_dzbIdx[] = {7, 7, 7, 7, 7, 7, 7, 7, 7}; - fopAcM_SetupActor(this, daSpinLift_c); + fopAcM_ct(this, daSpinLift_c); mModelType = getModelType(); int phase = dComIfG_resLoad(&mPhase, l_resNameIdx[mModelType]); diff --git a/src/d/actor/d_a_obj_ss_drink.cpp b/src/d/actor/d_a_obj_ss_drink.cpp index 089a1454e53..72701f47926 100644 --- a/src/d/actor/d_a_obj_ss_drink.cpp +++ b/src/d/actor/d_a_obj_ss_drink.cpp @@ -37,7 +37,7 @@ daObj_SSDrink_c::~daObj_SSDrink_c() { /* 80CE51C8-80CE53EC 0002C8 0224+00 1/1 0/0 0/0 .text create__15daObj_SSDrink_cFv */ int daObj_SSDrink_c::create() { - fopAcM_SetupActor(this, daObj_SSDrink_c); + fopAcM_ct(this, daObj_SSDrink_c); field_0xb0b = getTypeFromParam(); field_0xb0a = getCapacityFromParam(); setFlowNodeNumber(getFlowNodeNum()); diff --git a/src/d/actor/d_a_obj_ss_item.cpp b/src/d/actor/d_a_obj_ss_item.cpp index a3d15b8b6c2..e3c0ffe7279 100644 --- a/src/d/actor/d_a_obj_ss_item.cpp +++ b/src/d/actor/d_a_obj_ss_item.cpp @@ -46,7 +46,7 @@ daObj_SSItem_c::~daObj_SSItem_c() { /* 80CE6E68-80CE70CC 0002C8 0264+00 1/1 0/0 0/0 .text create__14daObj_SSItem_cFv */ int daObj_SSItem_c::create() { - fopAcM_SetupActor(this, daObj_SSItem_c); + fopAcM_ct(this, daObj_SSItem_c); field_0xB0E = getTypeFromParam(); setFlowNodeNumber(getFlowNodeNum()); setValueNumber(getValue()); diff --git a/src/d/actor/d_a_obj_stairBlock.cpp b/src/d/actor/d_a_obj_stairBlock.cpp index 15dae220702..07b938edf59 100644 --- a/src/d/actor/d_a_obj_stairBlock.cpp +++ b/src/d/actor/d_a_obj_stairBlock.cpp @@ -73,7 +73,7 @@ int daStairBlock_c::CreateHeap() { /* 80CE83F0-80CE85B0 000370 01C0+00 1/1 0/0 0/0 .text create__14daStairBlock_cFv */ int daStairBlock_c::create() { - fopAcM_SetupActor(this, daStairBlock_c); + fopAcM_ct(this, daStairBlock_c); int phase = dComIfG_resLoad(&mPhaseReq, "StaBlock"); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_stick.cpp b/src/d/actor/d_a_obj_stick.cpp index 50ad8e1fdef..c41224e611c 100644 --- a/src/d/actor/d_a_obj_stick.cpp +++ b/src/d/actor/d_a_obj_stick.cpp @@ -35,7 +35,7 @@ daObj_Stick_c::~daObj_Stick_c() { /* 805993E8-805996BC 0002A8 02D4+00 1/1 0/0 0/0 .text create__13daObj_Stick_cFv */ int daObj_Stick_c::create() { - fopAcM_SetupActor(this, daObj_Stick_c); + fopAcM_ct(this, daObj_Stick_c); mType = getType(); diff --git a/src/d/actor/d_a_obj_stone.cpp b/src/d/actor/d_a_obj_stone.cpp index 899867f8054..b7943713705 100644 --- a/src/d/actor/d_a_obj_stone.cpp +++ b/src/d/actor/d_a_obj_stone.cpp @@ -261,7 +261,7 @@ bool daObjStone_c::CreateHeap() { /* 80CE9840-80CE99D4 000840 0194+00 1/1 0/0 0/0 .text create__12daObjStone_cFv */ int daObjStone_c::create() { - fopAcM_SetupActor(this, daObjStone_c); + fopAcM_ct(this, daObjStone_c); mStoneType = getType(); diff --git a/src/d/actor/d_a_obj_stoneMark.cpp b/src/d/actor/d_a_obj_stoneMark.cpp index 296ff6cd830..d0057665ea0 100644 --- a/src/d/actor/d_a_obj_stoneMark.cpp +++ b/src/d/actor/d_a_obj_stoneMark.cpp @@ -43,7 +43,7 @@ int daObjSMark_c::Create() { /* 8059A168-8059A25C 0001C8 00F4+00 1/1 0/0 0/0 .text create__12daObjSMark_cFv */ int daObjSMark_c::create() { - fopAcM_SetupActor(this, daObjSMark_c); + fopAcM_ct(this, daObjSMark_c); int phase = dComIfG_resLoad(&mpPhase, l_arcName); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_stopper.cpp b/src/d/actor/d_a_obj_stopper.cpp index 7dda75f42e6..d83dca28266 100644 --- a/src/d/actor/d_a_obj_stopper.cpp +++ b/src/d/actor/d_a_obj_stopper.cpp @@ -72,7 +72,7 @@ int daObjStopper_c::CreateHeap() { /* 80CED258-80CED440 000438 01E8+00 1/1 0/0 0/0 .text create__14daObjStopper_cFv */ int daObjStopper_c::create() { - fopAcM_SetupActor(this, daObjStopper_c); + fopAcM_ct(this, daObjStopper_c); if (!field_0x9fc) { field_0x9f8 = home.angle.x; field_0x9fa = home.angle.z; diff --git a/src/d/actor/d_a_obj_suisya.cpp b/src/d/actor/d_a_obj_suisya.cpp index cd667409aa0..3468351715d 100644 --- a/src/d/actor/d_a_obj_suisya.cpp +++ b/src/d/actor/d_a_obj_suisya.cpp @@ -80,7 +80,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 80CF0310-80CF0478 000310 0168+00 1/1 0/0 0/0 .text create__14daObj_Suisya_cFv */ int daObj_Suisya_c::create() { - fopAcM_SetupActor(this, daObj_Suisya_c); + fopAcM_ct(this, daObj_Suisya_c); int phase = dComIfG_resLoad(&mPhase, "Obj_sui"); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_sw.cpp b/src/d/actor/d_a_obj_sw.cpp index bc8d9362834..047ccfc09d1 100644 --- a/src/d/actor/d_a_obj_sw.cpp +++ b/src/d/actor/d_a_obj_sw.cpp @@ -726,7 +726,7 @@ static int daObj_Sw_Create(fopAc_ac_c* a_this) { obj_sw_class* i_this = (obj_sw_class*)a_this; int phase; u32 i_size; - fopAcM_SetupActor(a_this, obj_sw_class); + fopAcM_ct(a_this, obj_sw_class); i_this->field_0x570 = fopAcM_GetParam(a_this); if (i_this->field_0x570 == 0xFF) { diff --git a/src/d/actor/d_a_obj_swBallA.cpp b/src/d/actor/d_a_obj_swBallA.cpp index 00f0f8040b2..be66337df2b 100644 --- a/src/d/actor/d_a_obj_swBallA.cpp +++ b/src/d/actor/d_a_obj_swBallA.cpp @@ -165,7 +165,7 @@ int daObjSwBallA_c::CreateHeap() { /* 80CF3970-80CF3A90 0006F0 0120+00 1/1 0/0 0/0 .text create__14daObjSwBallA_cFv */ int daObjSwBallA_c::create() { - fopAcM_SetupActor(this, daObjSwBallA_c); + fopAcM_ct(this, daObjSwBallA_c); if (field_0x5c4 == 0) { field_0x5c4 = 1; field_0x5c6 = home.angle.x; diff --git a/src/d/actor/d_a_obj_swBallB.cpp b/src/d/actor/d_a_obj_swBallB.cpp index 8180fd56ac1..d230e630160 100644 --- a/src/d/actor/d_a_obj_swBallB.cpp +++ b/src/d/actor/d_a_obj_swBallB.cpp @@ -194,7 +194,7 @@ int daObjSwBallB_c::CreateHeap() { /* 80CF4CE8-80CF4E08 0007A8 0120+00 1/1 0/0 0/0 .text create__14daObjSwBallB_cFv */ int daObjSwBallB_c::create() { - fopAcM_SetupActor(this, daObjSwBallB_c); + fopAcM_ct(this, daObjSwBallB_c); if (field_0x5a0 == 0) { field_0x5a0 = 1; field_0x5a2 = home.angle.x; diff --git a/src/d/actor/d_a_obj_swBallC.cpp b/src/d/actor/d_a_obj_swBallC.cpp index cb8357f967b..98cb8af5294 100644 --- a/src/d/actor/d_a_obj_swBallC.cpp +++ b/src/d/actor/d_a_obj_swBallC.cpp @@ -127,7 +127,7 @@ int daObjSwBallC_c::CreateHeap() { /* 80CF606C-80CF6120 00054C 00B4+00 1/1 0/0 0/0 .text create__14daObjSwBallC_cFv */ int daObjSwBallC_c::create() { - fopAcM_SetupActor(this, daObjSwBallC_c); + fopAcM_ct(this, daObjSwBallC_c); int res = dComIfG_resLoad(&field_0x568, l_arcName); if (res == cPhs_COMPLEATE_e) { if (fopAcM_entrySolidHeap(this, CheckCreateHeap, 0x960) == 0) { diff --git a/src/d/actor/d_a_obj_swLight.cpp b/src/d/actor/d_a_obj_swLight.cpp index 8529ee435d9..84b9db4e9bb 100644 --- a/src/d/actor/d_a_obj_swLight.cpp +++ b/src/d/actor/d_a_obj_swLight.cpp @@ -481,7 +481,7 @@ int daObjSwLight_c::Delete() { /* 80CF7BF0-80CF7D8C 000CD0 019C+00 1/0 0/0 0/0 .text daObjSwLight_create1st__FP14daObjSwLight_c */ static int daObjSwLight_create1st(daObjSwLight_c* i_this) { - fopAcM_SetupActor(i_this, daObjSwLight_c); + fopAcM_ct(i_this, daObjSwLight_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_swchain.cpp b/src/d/actor/d_a_obj_swchain.cpp index 3dc5a53ea90..cebefc524a5 100644 --- a/src/d/actor/d_a_obj_swchain.cpp +++ b/src/d/actor/d_a_obj_swchain.cpp @@ -240,7 +240,7 @@ int daObjSwChain_c::CreateHeap() { /* 80CF8B48-80CF8DD0 000508 0288+00 1/1 0/0 0/0 .text create1st__14daObjSwChain_cFv */ int daObjSwChain_c::create1st() { - fopAcM_SetupActor(this, daObjSwChain_c); + fopAcM_ct(this, daObjSwChain_c); if (field_0xa60 == 0) { mHookshotLength = home.angle.x; diff --git a/src/d/actor/d_a_obj_swhang.cpp b/src/d/actor/d_a_obj_swhang.cpp index 1f3a597be54..d243500f4ab 100644 --- a/src/d/actor/d_a_obj_swhang.cpp +++ b/src/d/actor/d_a_obj_swhang.cpp @@ -189,7 +189,7 @@ int daObjSwHang_c::CreateHeap() { /* 80CFBDD0-80CFBF60 000510 0190+00 1/1 0/0 0/0 .text create1st__13daObjSwHang_cFv */ int daObjSwHang_c::create1st() { - fopAcM_SetupActor(this, daObjSwHang_c); + fopAcM_ct(this, daObjSwHang_c); mType = getType_private(); int rv = dComIfG_resLoad(&mPhase, l_arcName[mType]); if (rv == cPhs_COMPLEATE_e) { @@ -507,7 +507,7 @@ int daObjSwHang_c::Delete() { /* 80CFCE0C-80CFCF20 00154C 0114+00 1/0 0/0 0/0 .text daObjSwHang_create1st__FP13daObjSwHang_c */ static int daObjSwHang_create1st(daObjSwHang_c* i_this) { - fopAcM_SetupActor(i_this, daObjSwHang_c); + fopAcM_ct(i_this, daObjSwHang_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_sword.cpp b/src/d/actor/d_a_obj_sword.cpp index 9b784d0056e..be97a8c1814 100644 --- a/src/d/actor/d_a_obj_sword.cpp +++ b/src/d/actor/d_a_obj_sword.cpp @@ -40,7 +40,7 @@ int daObjSword_c::Create() { /* 80CFD67C-80CFD848 00019C 01CC+00 1/1 0/0 0/0 .text create__12daObjSword_cFv */ cPhs__Step daObjSword_c::create() { - fopAcM_SetupActor(this, daObjSword_c); + fopAcM_ct(this, daObjSword_c); m_itemNo = 0x28; if (fopAcM_isItem(this, getItemBit())) { return cPhs_ERROR_e; diff --git a/src/d/actor/d_a_obj_swpropeller.cpp b/src/d/actor/d_a_obj_swpropeller.cpp index 44455308acf..fdaf66f11cb 100644 --- a/src/d/actor/d_a_obj_swpropeller.cpp +++ b/src/d/actor/d_a_obj_swpropeller.cpp @@ -142,7 +142,7 @@ int daObjSwPr_c::CreateHeap() { /* 8059A888-8059AA74 0003E8 01EC+00 1/1 0/0 0/0 .text create__11daObjSwPr_cFv */ int daObjSwPr_c::create() { - fopAcM_SetupActor(this, daObjSwPr_c); + fopAcM_ct(this, daObjSwPr_c); mNameArg = getNameArg(); diff --git a/src/d/actor/d_a_obj_swpush.cpp b/src/d/actor/d_a_obj_swpush.cpp index 04a129ad0d2..56b20516aca 100644 --- a/src/d/actor/d_a_obj_swpush.cpp +++ b/src/d/actor/d_a_obj_swpush.cpp @@ -212,7 +212,7 @@ u8 const daObjSwpush::Act_c::M_op_vtx[4] = {0x0D, 0x0B, 0x0A, 0x0C}; /* 80483038-80483450 0003D8 0418+00 1/1 0/0 0/0 .text Mthd_Create__Q211daObjSwpush5Act_cFv */ cPhs__Step daObjSwpush::Act_c::Mthd_Create() { - fopAcM_SetupActor(this, daObjSwpush::Act_c); + fopAcM_ct(this, daObjSwpush::Act_c); prmZ_init(); mType = prm_get_type(); diff --git a/src/d/actor/d_a_obj_swpush5.cpp b/src/d/actor/d_a_obj_swpush5.cpp index bcc77a41010..eafd0c3554a 100644 --- a/src/d/actor/d_a_obj_swpush5.cpp +++ b/src/d/actor/d_a_obj_swpush5.cpp @@ -143,7 +143,7 @@ int daObjSw5_c::CreateHeap() { /* 8059BB1C-8059BBD4 00071C 00B8+00 1/1 0/0 0/0 .text create__10daObjSw5_cFv */ int daObjSw5_c::create() { - fopAcM_SetupActor(this, daObjSw5_c); + fopAcM_ct(this, daObjSw5_c); int phase_state = dComIfG_resLoad(&mPhase, l_arcName); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_swspinner.cpp b/src/d/actor/d_a_obj_swspinner.cpp index 916ff3ee9e9..b38a98b668f 100644 --- a/src/d/actor/d_a_obj_swspinner.cpp +++ b/src/d/actor/d_a_obj_swspinner.cpp @@ -213,7 +213,7 @@ int daObjSwSpinner_c::Delete() { /* 80D009C0-80D00A20 000AC0 0060+00 1/0 0/0 0/0 .text * daObjSwSpinner_create1st__FP16daObjSwSpinner_c */ static int daObjSwSpinner_create1st(daObjSwSpinner_c* i_this) { - fopAcM_SetupActor(i_this, daObjSwSpinner_c); + fopAcM_ct(i_this, daObjSwSpinner_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_swturn.cpp b/src/d/actor/d_a_obj_swturn.cpp index 2f8640ba25a..246ec9f4903 100644 --- a/src/d/actor/d_a_obj_swturn.cpp +++ b/src/d/actor/d_a_obj_swturn.cpp @@ -440,7 +440,7 @@ int daObjSwTurn_c::Delete() { /* 80D01F98-80D01FF8 001438 0060+00 1/0 0/0 0/0 .text daObjSwTurn_create1st__FP13daObjSwTurn_c */ static int daObjSwTurn_create1st(daObjSwTurn_c* i_this) { - fopAcM_SetupActor(i_this, daObjSwTurn_c); + fopAcM_ct(i_this, daObjSwTurn_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_syRock.cpp b/src/d/actor/d_a_obj_syRock.cpp index be52f38c9ba..7ed152373a5 100644 --- a/src/d/actor/d_a_obj_syRock.cpp +++ b/src/d/actor/d_a_obj_syRock.cpp @@ -116,7 +116,7 @@ dCcD_SrcGObjInf const daSyRock_c::mCcDObjInfo = { /* 80D02584-80D02930 0003C4 03AC+00 1/1 0/0 0/0 .text create__10daSyRock_cFv */ cPhs__Step daSyRock_c::create() { - fopAcM_SetupActor(this, daSyRock_c); + fopAcM_ct(this, daSyRock_c); if(getArg0() == TRUE) { mpWaterPillar = static_cast(fopAcIt_Judge(searchWaterPillar, this)); diff --git a/src/d/actor/d_a_obj_table.cpp b/src/d/actor/d_a_obj_table.cpp index 880f228c6f2..13d2a6e58a8 100644 --- a/src/d/actor/d_a_obj_table.cpp +++ b/src/d/actor/d_a_obj_table.cpp @@ -29,7 +29,7 @@ void daObjTable_c::setBaseMtx() { } int daObjTable_c::create() { - fopAcM_SetupActor(this, daObjTable_c); + fopAcM_ct(this, daObjTable_c); int phase_state = dComIfG_resLoad(&mPhaseReq, l_arcName); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_takaraDai.cpp b/src/d/actor/d_a_obj_takaraDai.cpp index cb7eeebb631..f4957a98629 100644 --- a/src/d/actor/d_a_obj_takaraDai.cpp +++ b/src/d/actor/d_a_obj_takaraDai.cpp @@ -77,7 +77,7 @@ int daTkraDai_c::CreateHeap() { /* 80D07140-80D07344 0004A0 0204+00 1/1 0/0 0/0 .text create__11daTkraDai_cFv */ int daTkraDai_c::create() { - fopAcM_SetupActor(this, daTkraDai_c); + fopAcM_ct(this, daTkraDai_c); cPhs__Step phase = static_cast(dComIfG_resLoad(&mPhase, "M_TakaraD")); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_tatigi.cpp b/src/d/actor/d_a_obj_tatigi.cpp index 7aed9577cab..578fca0fd7a 100644 --- a/src/d/actor/d_a_obj_tatigi.cpp +++ b/src/d/actor/d_a_obj_tatigi.cpp @@ -136,7 +136,7 @@ static int daObj_Tatigi_Create(fopAc_ac_c* a_this) { }; obj_tatigi_class* i_this = (obj_tatigi_class*)a_this; - fopAcM_SetupActor(&i_this->mBase, obj_tatigi_class); + fopAcM_ct(&i_this->mBase, obj_tatigi_class); int rv = dComIfG_resLoad(&i_this->mPhase, "Obj_tg"); if (rv == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_ten.cpp b/src/d/actor/d_a_obj_ten.cpp index a9ec82e5e6b..a6433d378d9 100644 --- a/src/d/actor/d_a_obj_ten.cpp +++ b/src/d/actor/d_a_obj_ten.cpp @@ -730,7 +730,7 @@ static daObj_TenHIO_c l_HIO; /* 80D0AF48-80D0B740 002868 07F8+00 1/1 0/0 0/0 .text create__10daObjTEN_cFv */ int daObjTEN_c::create() { - fopAcM_SetupActor(this, daObjTEN_c); + fopAcM_ct(this, daObjTEN_c); int rv = dComIfG_resLoad(&mPhase, "I_Ten"); if (rv == cPhs_COMPLEATE_e) { field_0x624 = fopAcM_GetParam(this) & 0xf; diff --git a/src/d/actor/d_a_obj_tgake.cpp b/src/d/actor/d_a_obj_tgake.cpp index 4d70b8e024c..6a6f1609f41 100644 --- a/src/d/actor/d_a_obj_tgake.cpp +++ b/src/d/actor/d_a_obj_tgake.cpp @@ -118,7 +118,7 @@ int daObjGake_c::Delete() { /* 80D0C068-80D0C0C8 0004C8 0060+00 1/0 0/0 0/0 .text daObjGake_create1st__FP11daObjGake_c */ static int daObjGake_create1st(daObjGake_c* i_this) { - fopAcM_SetupActor(i_this, daObjGake_c); + fopAcM_ct(i_this, daObjGake_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_thashi.cpp b/src/d/actor/d_a_obj_thashi.cpp index f50cc696138..a66b59c8c8b 100644 --- a/src/d/actor/d_a_obj_thashi.cpp +++ b/src/d/actor/d_a_obj_thashi.cpp @@ -222,7 +222,7 @@ int daObjTHASHI_c::CreateHeap() { /* 80D0C8B4-80D0CBC8 0006F4 0314+00 1/1 0/0 0/0 .text create__13daObjTHASHI_cFv */ int daObjTHASHI_c::create() { - fopAcM_SetupActor(this, daObjTHASHI_c); + fopAcM_ct(this, daObjTHASHI_c); int phase_state = dComIfG_resLoad(&unk11A8, l_arcName); if (phase_state == cPhs_COMPLEATE_e) { unk10A0 = -9.0f; diff --git a/src/d/actor/d_a_obj_thdoor.cpp b/src/d/actor/d_a_obj_thdoor.cpp index 985c250d5e5..204bb914968 100644 --- a/src/d/actor/d_a_obj_thdoor.cpp +++ b/src/d/actor/d_a_obj_thdoor.cpp @@ -366,7 +366,7 @@ int daObjThDoor_c::Delete() { /* 80D0E228-80D0E2E4 000DA8 00BC+00 1/0 0/0 0/0 .text daObjThDoor_create1st__FP13daObjThDoor_c */ static int daObjThDoor_create1st(daObjThDoor_c* i_this) { - fopAcM_SetupActor(i_this, daObjThDoor_c); + fopAcM_ct(i_this, daObjThDoor_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_timeFire.cpp b/src/d/actor/d_a_obj_timeFire.cpp index 6c18082dd71..08595e3965c 100644 --- a/src/d/actor/d_a_obj_timeFire.cpp +++ b/src/d/actor/d_a_obj_timeFire.cpp @@ -22,7 +22,7 @@ void daTimeFire_c::setBaseMtx() { /* 80D0E9B0-80D0EACC 0001B0 011C+00 1/1 0/0 0/0 .text create__12daTimeFire_cFv */ int daTimeFire_c::create() { - fopAcM_SetupActor(this, daTimeFire_c); + fopAcM_ct(this, daTimeFire_c); setBaseMtx(); field_0x570 = current.pos; lightInit(); diff --git a/src/d/actor/d_a_obj_timer.cpp b/src/d/actor/d_a_obj_timer.cpp index 926e8414514..55beed1766e 100644 --- a/src/d/actor/d_a_obj_timer.cpp +++ b/src/d/actor/d_a_obj_timer.cpp @@ -11,7 +11,7 @@ /* 80485198-8048526C 000078 00D4+00 1/1 0/0 0/0 .text _create__Q210daObjTimer5Act_cFv */ int daObjTimer::Act_c::_create() { - fopAcM_SetupActor(this, Act_c); + fopAcM_ct(this, Act_c); fopAcM_offDraw(this); if (fopAcM_isSwitch(this, prm_get_sw2Save())) { diff --git a/src/d/actor/d_a_obj_tks.cpp b/src/d/actor/d_a_obj_tks.cpp index a9e26d0a2a7..3decd1543e8 100644 --- a/src/d/actor/d_a_obj_tks.cpp +++ b/src/d/actor/d_a_obj_tks.cpp @@ -104,7 +104,7 @@ const daObjTks_HIOParam daObjTks_Param_c::m = { /* 80D0F640-80D0F904 0004A0 02C4+00 1/1 0/0 0/0 .text Create__10daObjTks_cFv */ int daObjTks_c::Create() { - fopAcM_SetupActor(this, daObjTks_c); + fopAcM_ct(this, daObjTks_c); int phase_state = dComIfG_resLoad(&mPhase, l_arcName); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_tmoon.cpp b/src/d/actor/d_a_obj_tmoon.cpp index 2157557c3b1..15c43f671e0 100644 --- a/src/d/actor/d_a_obj_tmoon.cpp +++ b/src/d/actor/d_a_obj_tmoon.cpp @@ -47,7 +47,7 @@ int daObjTMoon_c::CreateHeap() { /* 80D12D0C-80D12DC0 0001EC 00B4+00 1/1 0/0 0/0 .text create__12daObjTMoon_cFv */ int daObjTMoon_c::create() { - fopAcM_SetupActor(this, daObjTMoon_c); + fopAcM_ct(this, daObjTMoon_c); int phase = dComIfG_resLoad(&mPhaseReq, l_arcName); if (phase == cPhs_COMPLEATE_e) { if (!fopAcM_entrySolidHeap(this, (heapCallbackFunc)CheckCreateHeap, 0x880)) { diff --git a/src/d/actor/d_a_obj_toaru_maki.cpp b/src/d/actor/d_a_obj_toaru_maki.cpp index 1623f868dc7..7fc42d1844b 100644 --- a/src/d/actor/d_a_obj_toaru_maki.cpp +++ b/src/d/actor/d_a_obj_toaru_maki.cpp @@ -65,7 +65,7 @@ static const u32 l_heapSize[2] = { /* 80D132B4-80D133C0 0002B4 010C+00 1/1 0/0 0/0 .text create__16daObjToaruMaki_cFv */ int daObjToaruMaki_c::create() { - fopAcM_SetupActor(this, daObjToaruMaki_c); + fopAcM_ct(this, daObjToaruMaki_c); u32 nameArg = getNameArg_0(); int rv = dComIfG_resLoad(this, l_arcName[nameArg]); if (rv == cPhs_COMPLEATE_e) { @@ -120,7 +120,7 @@ int daObjToaruMaki_c::execute() { */ static int daObjToaruMaki_create(daObjToaruMaki_c* i_this) { // !@bug this setup is called twice. No adverse effects though. - fopAcM_SetupActor(i_this, daObjToaruMaki_c); + fopAcM_ct(i_this, daObjToaruMaki_c); return i_this->create(); } diff --git a/src/d/actor/d_a_obj_toby.cpp b/src/d/actor/d_a_obj_toby.cpp index e7d2a981901..8c700f54727 100644 --- a/src/d/actor/d_a_obj_toby.cpp +++ b/src/d/actor/d_a_obj_toby.cpp @@ -520,7 +520,7 @@ static int set_pos_check(obj_toby_class* i_this, int param_2) { static int daObj_Toby_Create(fopAc_ac_c* a_this) { static u32 const l_bmdidx[2] = {4, 5}; - fopAcM_SetupActor(a_this, obj_toby_class); + fopAcM_ct(a_this, obj_toby_class); obj_toby_class* i_this = (obj_toby_class*)a_this; if (strcmp(dComIfGp_getStartStageName(), "D_MN07") == 0) { i_this->mArcName = "Obj_Tob7"; diff --git a/src/d/actor/d_a_obj_tobyhouse.cpp b/src/d/actor/d_a_obj_tobyhouse.cpp index 56b1bde2094..b291b746855 100644 --- a/src/d/actor/d_a_obj_tobyhouse.cpp +++ b/src/d/actor/d_a_obj_tobyhouse.cpp @@ -611,7 +611,7 @@ int daObjTobyHouse_c::Delete() { /* 80D17618-80D17678 001C58 0060+00 1/0 0/0 0/0 .text * daObjTobyHouse_create1st__FP16daObjTobyHouse_c */ static int daObjTobyHouse_create1st(daObjTobyHouse_c* i_this) { - fopAcM_SetupActor(i_this, daObjTobyHouse_c); + fopAcM_ct(i_this, daObjTobyHouse_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_togeTrap.cpp b/src/d/actor/d_a_obj_togeTrap.cpp index 4f542638e9b..e5a6f496c16 100644 --- a/src/d/actor/d_a_obj_togeTrap.cpp +++ b/src/d/actor/d_a_obj_togeTrap.cpp @@ -74,7 +74,7 @@ int daTogeTrap_c::CreateHeap() { /* 80D17E14-80D18008 000394 01F4+00 1/1 0/0 0/0 .text create__12daTogeTrap_cFv */ int daTogeTrap_c::create() { - fopAcM_SetupActor(this, daTogeTrap_c); + fopAcM_ct(this, daTogeTrap_c); mSwBit = getSwBit(); if (mSwBit != 0xff && fopAcM_isSwitch(this, mSwBit)) diff --git a/src/d/actor/d_a_obj_tombo.cpp b/src/d/actor/d_a_obj_tombo.cpp index 7256e31b53b..22c837165a7 100644 --- a/src/d/actor/d_a_obj_tombo.cpp +++ b/src/d/actor/d_a_obj_tombo.cpp @@ -648,7 +648,7 @@ bool daObjTOMBO_c::CreateChk() { /* 80D1B174-80D1B510 002094 039C+00 1/1 0/0 0/0 .text create__12daObjTOMBO_cFv */ int daObjTOMBO_c::create() { - fopAcM_SetupActor(this, daObjTOMBO_c); + fopAcM_ct(this, daObjTOMBO_c); int phase = dComIfG_resLoad(&mPhase, "Tombo"); if (phase == cPhs_COMPLEATE_e) { OS_REPORT("TOMBO PARAM %x\n", fopAcM_GetParam(this)); diff --git a/src/d/actor/d_a_obj_tornado.cpp b/src/d/actor/d_a_obj_tornado.cpp index a94ae0b18d6..66e0c866812 100644 --- a/src/d/actor/d_a_obj_tornado.cpp +++ b/src/d/actor/d_a_obj_tornado.cpp @@ -154,7 +154,7 @@ int daObjTrnd_c::Create() { /* 80D1BFB0-80D1C0A8 000690 00F8+00 1/1 0/0 0/0 .text create__11daObjTrnd_cFv */ int daObjTrnd_c::create() { - fopAcM_SetupActor(this, daObjTrnd_c); + fopAcM_ct(this, daObjTrnd_c); if (!Create()) { return cPhs_ERROR_e; } diff --git a/src/d/actor/d_a_obj_tornado2.cpp b/src/d/actor/d_a_obj_tornado2.cpp index f7f0f663c1f..37b0bcf8312 100644 --- a/src/d/actor/d_a_obj_tornado2.cpp +++ b/src/d/actor/d_a_obj_tornado2.cpp @@ -218,7 +218,7 @@ int daObjTrnd2_c::Create() { /* 80D1CC80-80D1CD78 000820 00F8+00 1/1 0/0 0/0 .text create__12daObjTrnd2_cFv */ int daObjTrnd2_c::create() { - fopAcM_SetupActor(this, daObjTrnd2_c); + fopAcM_ct(this, daObjTrnd2_c); if (!Create()) { return cPhs_ERROR_e; } diff --git a/src/d/actor/d_a_obj_tp.cpp b/src/d/actor/d_a_obj_tp.cpp index 8bdff05aaca..7d1d3a4b1ea 100644 --- a/src/d/actor/d_a_obj_tp.cpp +++ b/src/d/actor/d_a_obj_tp.cpp @@ -419,7 +419,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 80D1E950-80D1ECF0 001450 03A0+00 1/0 0/0 0/0 .text daObj_Tp_Create__FP10fopAc_ac_c */ static int daObj_Tp_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, obj_tp_class); + fopAcM_ct(i_this, obj_tp_class); obj_tp_class* tp = (obj_tp_class*)i_this; int rv = dComIfG_resLoad(&tp->mPhase, "Obj_tp"); if (rv == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_treesh.cpp b/src/d/actor/d_a_obj_treesh.cpp index e1c689aa1a8..a89e90ffd52 100644 --- a/src/d/actor/d_a_obj_treesh.cpp +++ b/src/d/actor/d_a_obj_treesh.cpp @@ -149,7 +149,7 @@ int daTreeSh_c::Delete() { /* 80D1F720-80D1F7AC 000740 008C+00 1/0 0/0 0/0 .text daTreeSh_create1st__FP10daTreeSh_c */ static int daTreeSh_create1st(daTreeSh_c* i_this) { - fopAcM_SetupActor(i_this, daTreeSh_c); + fopAcM_ct(i_this, daTreeSh_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_twGate.cpp b/src/d/actor/d_a_obj_twGate.cpp index 9b0db907dde..c250ab68775 100644 --- a/src/d/actor/d_a_obj_twGate.cpp +++ b/src/d/actor/d_a_obj_twGate.cpp @@ -128,7 +128,7 @@ static daTwGate_HIO_c l_HIO; /* 80D1FD44-80D1FF14 000384 01D0+00 1/1 0/0 0/0 .text create__10daTwGate_cFv */ int daTwGate_c::create() { - fopAcM_SetupActor(this, daTwGate_c); + fopAcM_ct(this, daTwGate_c); mGateType = getGateType(); if (l_bmdIdx[mGateType] == -1) { // Twilight gate: Invalid argument. diff --git a/src/d/actor/d_a_obj_udoor.cpp b/src/d/actor/d_a_obj_udoor.cpp index 31b30a6b249..8f19dc4db60 100644 --- a/src/d/actor/d_a_obj_udoor.cpp +++ b/src/d/actor/d_a_obj_udoor.cpp @@ -130,7 +130,7 @@ static cPhs__Step daObj_Udoor_Create(fopAc_ac_c* i_this) { } // mSphAttr }; - fopAcM_SetupActor(i_this, obj_udoor_class); + fopAcM_ct(i_this, obj_udoor_class); obj_udoor_class* a_this = static_cast(i_this); cPhs__Step phase_state = (cPhs__Step)dComIfG_resLoad(&a_this->mPhase, "Obj_udoor"); diff --git a/src/d/actor/d_a_obj_usaku.cpp b/src/d/actor/d_a_obj_usaku.cpp index 7fdf1b156a8..3eabb4986de 100644 --- a/src/d/actor/d_a_obj_usaku.cpp +++ b/src/d/actor/d_a_obj_usaku.cpp @@ -75,7 +75,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 80D211AC-80D212D4 0002CC 0128+00 1/0 0/0 0/0 .text daObj_Usaku_Create__FP10fopAc_ac_c */ static int daObj_Usaku_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, obj_usaku_class); + fopAcM_ct(i_this, obj_usaku_class); obj_usaku_class* a_this = (obj_usaku_class*)i_this; int phase = dComIfG_resLoad(&a_this->mPhase, "Obj_usaku"); diff --git a/src/d/actor/d_a_obj_vground.cpp b/src/d/actor/d_a_obj_vground.cpp index cd537fbe7b4..dfbd7940410 100644 --- a/src/d/actor/d_a_obj_vground.cpp +++ b/src/d/actor/d_a_obj_vground.cpp @@ -65,7 +65,7 @@ int daObjVGnd_c::CreateHeap() { /* 80D216F4-80D217A8 000394 00B4+00 1/1 0/0 0/0 .text create__11daObjVGnd_cFv */ int daObjVGnd_c::create() { - fopAcM_SetupActor(this, daObjVGnd_c); + fopAcM_ct(this, daObjVGnd_c); int phase = dComIfG_resLoad(&mPhaseReq, l_arcName); if (phase == cPhs_COMPLEATE_e) { if (!fopAcM_entrySolidHeap(this, (heapCallbackFunc)CheckCreateHeap, 0x960)) { diff --git a/src/d/actor/d_a_obj_volcball.cpp b/src/d/actor/d_a_obj_volcball.cpp index 6e779abb504..e935518ebad 100644 --- a/src/d/actor/d_a_obj_volcball.cpp +++ b/src/d/actor/d_a_obj_volcball.cpp @@ -133,7 +133,7 @@ int daObjVolcBall_c::CreateHeap() { /* 80D21E28-80D21FA8 000388 0180+00 1/1 0/0 0/0 .text create__15daObjVolcBall_cFv */ int daObjVolcBall_c::create() { - fopAcM_SetupActor(this, daObjVolcBall_c); + fopAcM_ct(this, daObjVolcBall_c); mIsBigVolc = checkBigVolc(); if (mIsBigVolc == 1) { diff --git a/src/d/actor/d_a_obj_volcbom.cpp b/src/d/actor/d_a_obj_volcbom.cpp index c9039259a80..30cdce0beca 100644 --- a/src/d/actor/d_a_obj_volcbom.cpp +++ b/src/d/actor/d_a_obj_volcbom.cpp @@ -923,7 +923,7 @@ int daObjVolcBom_c::Delete() { /* 80D26774-80D268A8 002654 0134+00 1/0 0/0 0/0 .text daObjVolcBom_create1st__FP14daObjVolcBom_c */ static int daObjVolcBom_create1st(daObjVolcBom_c* i_this) { - fopAcM_SetupActor(i_this, daObjVolcBom_c); + fopAcM_ct(i_this, daObjVolcBom_c); return ((daObjVolcBom_c*)i_this)->create1st(); } diff --git a/src/d/actor/d_a_obj_warp_kbrg.cpp b/src/d/actor/d_a_obj_warp_kbrg.cpp index e0bdce73c18..902a57bf7dd 100644 --- a/src/d/actor/d_a_obj_warp_kbrg.cpp +++ b/src/d/actor/d_a_obj_warp_kbrg.cpp @@ -855,7 +855,7 @@ int daObjWarpKBrg_c::Delete() { /* 80D294B0-80D29524 0025F0 0074+00 1/0 0/0 0/0 .text daObjWarpKBrg_create1st__FP15daObjWarpKBrg_c */ static int daObjWarpKBrg_create1st(daObjWarpKBrg_c* i_this) { - fopAcM_SetupActor(i_this, daObjWarpKBrg_c); + fopAcM_ct(i_this, daObjWarpKBrg_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_warp_obrg.cpp b/src/d/actor/d_a_obj_warp_obrg.cpp index f917b15990e..ed904413d29 100644 --- a/src/d/actor/d_a_obj_warp_obrg.cpp +++ b/src/d/actor/d_a_obj_warp_obrg.cpp @@ -608,7 +608,7 @@ int daObjWarpOBrg_c::Delete() { /* 80D2B6F4-80D2B768 001DB4 0074+00 1/0 0/0 0/0 .text daObjWarpOBrg_create1st__FP15daObjWarpOBrg_c */ static int daObjWarpOBrg_create1st(daObjWarpOBrg_c* i_this) { - fopAcM_SetupActor(i_this, daObjWarpOBrg_c); + fopAcM_ct(i_this, daObjWarpOBrg_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_waterGate.cpp b/src/d/actor/d_a_obj_waterGate.cpp index 24ca50fa5a0..5d906a6c4ba 100644 --- a/src/d/actor/d_a_obj_waterGate.cpp +++ b/src/d/actor/d_a_obj_waterGate.cpp @@ -55,7 +55,7 @@ int daWtGate_c::CreateHeap() { /* 80D2BD00-80D2BE7C 000260 017C+00 1/1 0/0 0/0 .text create__10daWtGate_cFv */ cPhs__Step daWtGate_c::create() { - fopAcM_SetupActor(this, daWtGate_c); + fopAcM_ct(this, daWtGate_c); const cPhs__Step resPhase = static_cast(dComIfG_resLoad(&mPhase, "S_Zsuimon")); if(resPhase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_waterPillar.cpp b/src/d/actor/d_a_obj_waterPillar.cpp index 7d35bcb6ee5..03fe292b9a2 100644 --- a/src/d/actor/d_a_obj_waterPillar.cpp +++ b/src/d/actor/d_a_obj_waterPillar.cpp @@ -130,7 +130,7 @@ dCcD_SrcCyl daWtPillar_c::mCcDCyl = {daWtPillar_c::mCcDObjCoInfo}; /* 80D2C960-80D2CC0C 000380 02AC+00 1/1 0/0 0/0 .text create__12daWtPillar_cFv */ cPhs__Step daWtPillar_c::create() { - fopAcM_SetupActor(this, daWtPillar_c); + fopAcM_ct(this, daWtPillar_c); const cPhs__Step phase = static_cast(dComIfG_resLoad(&mPhase, "efWater")); if(phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_waterfall.cpp b/src/d/actor/d_a_obj_waterfall.cpp index 7c0ca6b5feb..76b99c67b76 100644 --- a/src/d/actor/d_a_obj_waterfall.cpp +++ b/src/d/actor/d_a_obj_waterfall.cpp @@ -262,7 +262,7 @@ extern actor_process_profile_definition g_profile_Obj_WaterFall = { /* 80D2F5A0-80D2F6DC 000A00 013C+00 1/1 0/0 0/0 .text create__16daObjWaterFall_cFv */ cPhs__Step daObjWaterFall_c::create() { - fopAcM_SetupActor(this, daObjWaterFall_c); + fopAcM_ct(this, daObjWaterFall_c); if(Create() == cPhs_INIT_e) { return cPhs_ERROR_e; diff --git a/src/d/actor/d_a_obj_wchain.cpp b/src/d/actor/d_a_obj_wchain.cpp index 3fe20606f43..45fa8ba07bf 100644 --- a/src/d/actor/d_a_obj_wchain.cpp +++ b/src/d/actor/d_a_obj_wchain.cpp @@ -35,7 +35,7 @@ static int daObjWchain_createHeap(fopAc_ac_c* i_this) { /* 80D2FFBC-80D30394 00013C 03D8+00 1/1 0/0 0/0 .text create__13daObjWchain_cFv */ cPhs__Step daObjWchain_c::create() { - fopAcM_SetupActor(this, daObjWchain_c); + fopAcM_ct(this, daObjWchain_c); mSw = fopAcM_GetParam(this) & 0xff; cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhaseReq, l_arcName); if (step == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_wdStick.cpp b/src/d/actor/d_a_obj_wdStick.cpp index 1c7d8e4974a..beb2b209f2c 100644 --- a/src/d/actor/d_a_obj_wdStick.cpp +++ b/src/d/actor/d_a_obj_wdStick.cpp @@ -53,7 +53,7 @@ dCcD_SrcGObjInf const daWdStick_c::mCcDObjInfo = { /* 80D31CC4-80D31F9C 000264 02D8+00 1/1 0/0 0/0 .text create__11daWdStick_cFv */ int daWdStick_c::create() { - fopAcM_SetupActor(this, daWdStick_c); + fopAcM_ct(this, daWdStick_c); int rv = dComIfG_resLoad(&mPhase, "H_Kinobou"); if (rv == cPhs_COMPLEATE_e) { if (fopAcM_entrySolidHeap(this, createHeapCallBack, 0x820) == 0) { diff --git a/src/d/actor/d_a_obj_web0.cpp b/src/d/actor/d_a_obj_web0.cpp index e87e582ee68..8a553ad4c94 100644 --- a/src/d/actor/d_a_obj_web0.cpp +++ b/src/d/actor/d_a_obj_web0.cpp @@ -224,7 +224,7 @@ static daObj_Web0_HIO_c l_HIO; /* 80D34D8C-80D35054 00094C 02C8+00 1/0 0/0 0/0 .text daObj_Web0_Create__FP10fopAc_ac_c */ static int daObj_Web0_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, obj_web0_class); + fopAcM_ct(i_this, obj_web0_class); obj_web0_class* _this = static_cast(i_this); static dCcD_SrcSph cc_sph_src = { diff --git a/src/d/actor/d_a_obj_web1.cpp b/src/d/actor/d_a_obj_web1.cpp index 16bf8227056..697c4c6621a 100644 --- a/src/d/actor/d_a_obj_web1.cpp +++ b/src/d/actor/d_a_obj_web1.cpp @@ -253,7 +253,7 @@ static daObj_Web1_HIO_c l_HIO; /* 80D35CE4-80D35F98 000A24 02B4+00 1/0 0/0 0/0 .text daObj_Web1_Create__FP10fopAc_ac_c */ static int daObj_Web1_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, obj_web1_class); + fopAcM_ct(i_this, obj_web1_class); obj_web1_class* _this = static_cast(i_this); static dCcD_SrcCyl cc_cyl_src = { diff --git a/src/d/actor/d_a_obj_well_cover.cpp b/src/d/actor/d_a_obj_well_cover.cpp index ba108079d90..d546a33abb6 100644 --- a/src/d/actor/d_a_obj_well_cover.cpp +++ b/src/d/actor/d_a_obj_well_cover.cpp @@ -44,7 +44,7 @@ int daObjWCover_c::CreateHeap() { /* 80D36404-80D364E0 0001E4 00DC+00 1/1 0/0 0/0 .text create__13daObjWCover_cFv */ int daObjWCover_c::create() { - fopAcM_SetupActor(this, daObjWCover_c); + fopAcM_ct(this, daObjWCover_c); if (fopAcM_isSwitch(this, getSwNo())) { return cPhs_ERROR_e; } diff --git a/src/d/actor/d_a_obj_wflag.cpp b/src/d/actor/d_a_obj_wflag.cpp index 202ed8b4aed..b4361103b97 100644 --- a/src/d/actor/d_a_obj_wflag.cpp +++ b/src/d/actor/d_a_obj_wflag.cpp @@ -198,7 +198,7 @@ static int useHeapInit(fopAc_ac_c* i_actor) { /* 80D37634-80D37720 000B14 00EC+00 1/0 0/0 0/0 .text daObj_Wflag_Create__FP10fopAc_ac_c */ static int daObj_Wflag_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, obj_wflag_class); + fopAcM_ct(i_this, obj_wflag_class); int rv = dComIfG_resLoad(&((obj_wflag_class*)i_this)->mPhaseReq, "Obj_wflag"); if (rv == cPhs_COMPLEATE_e) { OS_REPORT("OBJ_WFLAG PARAM %x\n", fopAcM_GetParam(i_this)); diff --git a/src/d/actor/d_a_obj_wind_stone.cpp b/src/d/actor/d_a_obj_wind_stone.cpp index a60b7f170d9..fcf169e47db 100644 --- a/src/d/actor/d_a_obj_wind_stone.cpp +++ b/src/d/actor/d_a_obj_wind_stone.cpp @@ -58,7 +58,7 @@ COMPILER_STRIP_GATE(0x80D38608, &lit_3760); /* 80D37C20-80D37E2C 0002A0 020C+00 1/1 0/0 0/0 .text create__13daWindStone_cFv */ int daWindStone_c::create() { - fopAcM_SetupActor(this, daWindStone_c); + fopAcM_ct(this, daWindStone_c); int phase = dComIfG_resLoad(this, l_arcName); if (phase == cPhs_COMPLEATE_e) { @@ -249,7 +249,7 @@ u8 daWindStone_c::getGoldWolfIdx() { /* 80D3853C-80D38590 000BBC 0054+00 1/0 0/0 0/0 .text daWindStone_create__FP13daWindStone_c */ static int daWindStone_create(daWindStone_c* i_this) { - fopAcM_SetupActor(i_this, daWindStone_c); + fopAcM_ct(i_this, daWindStone_c); return i_this->create(); } diff --git a/src/d/actor/d_a_obj_window.cpp b/src/d/actor/d_a_obj_window.cpp index 0b35bdcb6ff..aa3061d3ee5 100644 --- a/src/d/actor/d_a_obj_window.cpp +++ b/src/d/actor/d_a_obj_window.cpp @@ -159,7 +159,7 @@ int daObjWindow_c::Delete() { /* 80D39034-80D39128 000954 00F4+00 1/0 0/0 0/0 .text daObjWindow_create1st__FP13daObjWindow_c */ static cPhs__Step daObjWindow_create1st(daObjWindow_c* i_this) { - fopAcM_SetupActor(i_this, daObjWindow_c); + fopAcM_ct(i_this, daObjWindow_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_wood_pendulum.cpp b/src/d/actor/d_a_obj_wood_pendulum.cpp index 6e44c9a7d93..a3c1f221ee8 100644 --- a/src/d/actor/d_a_obj_wood_pendulum.cpp +++ b/src/d/actor/d_a_obj_wood_pendulum.cpp @@ -92,7 +92,7 @@ int daObjWPndlm_c::CreateHeap() { int daObjWPndlm_c::create() { int phase; - fopAcM_SetupActor(this, daObjWPndlm_c); + fopAcM_ct(this, daObjWPndlm_c); phase = dComIfG_resLoad(&mPhaseReq, l_arcName); diff --git a/src/d/actor/d_a_obj_wood_statue.cpp b/src/d/actor/d_a_obj_wood_statue.cpp index 6fd70be8f32..44b21c2d165 100644 --- a/src/d/actor/d_a_obj_wood_statue.cpp +++ b/src/d/actor/d_a_obj_wood_statue.cpp @@ -159,7 +159,7 @@ int daObjWStatue_c::__CreateHeap() { /* 80D3A47C-80D3A66C 0006BC 01F0+00 1/1 0/0 0/0 .text create__14daObjWStatue_cFv */ int daObjWStatue_c::create() { - fopAcM_SetupActor(this, daObjWStatue_c); + fopAcM_ct(this, daObjWStatue_c); m_itemNo = fpcNm_ITEM_WOOD_STATUE; if (fopAcM_isSwitch(this, getSwbit2())) { return cPhs_ERROR_e; diff --git a/src/d/actor/d_a_obj_wsword.cpp b/src/d/actor/d_a_obj_wsword.cpp index 494e38472da..578e5edd9da 100644 --- a/src/d/actor/d_a_obj_wsword.cpp +++ b/src/d/actor/d_a_obj_wsword.cpp @@ -65,7 +65,7 @@ int daObjWSword_c::CreateHeap() { /* 80D3BB28-80D3BCA0 000228 0178+00 1/1 0/0 0/0 .text create__13daObjWSword_cFv */ int daObjWSword_c::create() { - fopAcM_SetupActor(this, daObjWSword_c); + fopAcM_ct(this, daObjWSword_c); int phase = dComIfG_resLoad(&mPhaseReq, l_arcName); if (phase == cPhs_COMPLEATE_e) { if (!fopAcM_entrySolidHeap(this, (heapCallbackFunc)CheckCreateHeap, 0x840)) { diff --git a/src/d/actor/d_a_obj_yel_bag.cpp b/src/d/actor/d_a_obj_yel_bag.cpp index 14c4cb1c5ec..7945711335e 100644 --- a/src/d/actor/d_a_obj_yel_bag.cpp +++ b/src/d/actor/d_a_obj_yel_bag.cpp @@ -68,7 +68,7 @@ f32 const daObj_YBag_Param_c::m[11] = { /* 80D3C610-80D3C898 000610 0288+00 1/1 0/0 0/0 .text create__12daObj_YBag_cFv */ int daObj_YBag_c::create() { - fopAcM_SetupActor(this, daObj_YBag_c); + fopAcM_ct(this, daObj_YBag_c); mType = getTypeFromParam(); int successfulLoads = 0; int i = 0; diff --git a/src/d/actor/d_a_obj_yobikusa.cpp b/src/d/actor/d_a_obj_yobikusa.cpp index c8bd430be60..e2d6b7a2656 100644 --- a/src/d/actor/d_a_obj_yobikusa.cpp +++ b/src/d/actor/d_a_obj_yobikusa.cpp @@ -420,7 +420,7 @@ static int daObjYobikusa_Delete(daObjYobikusa_c* i_this) { } cPhs__Step daObjYobikusa_c::create() { - fopAcM_SetupActor(this, daObjYobikusa_c); + fopAcM_ct(this, daObjYobikusa_c); switch (getType()) { case CALL_TYPE_FLY: diff --git a/src/d/actor/d_a_obj_yousei.cpp b/src/d/actor/d_a_obj_yousei.cpp index 5c00794af62..439c322ceb1 100644 --- a/src/d/actor/d_a_obj_yousei.cpp +++ b/src/d/actor/d_a_obj_yousei.cpp @@ -803,7 +803,7 @@ static int daObjYOUSEI_Execute(daObjYOUSEI_c* i_this) { /* 804D111C-804D149C 002A5C 0380+00 1/1 0/0 0/0 .text create__13daObjYOUSEI_cFv */ int daObjYOUSEI_c::create() { - fopAcM_SetupActor(this, daObjYOUSEI_c); + fopAcM_ct(this, daObjYOUSEI_c); OS_REPORT("YOUSEI PARAM %x\n", fopAcM_GetParam(this)); if (!fopAcM_entrySolidHeap(this, useHeapInit, 0x1100)) { diff --git a/src/d/actor/d_a_obj_ystone.cpp b/src/d/actor/d_a_obj_ystone.cpp index a6d4f9338c3..c1b9286bd61 100644 --- a/src/d/actor/d_a_obj_ystone.cpp +++ b/src/d/actor/d_a_obj_ystone.cpp @@ -265,7 +265,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { */ static cPhs__Step daObj_Ystone_Create(fopAc_ac_c* i_this) { obj_ystone_class* _this = static_cast(i_this); - fopAcM_SetupActor(_this, obj_ystone_class); + fopAcM_ct(_this, obj_ystone_class); _this->mLevel = getNowLevel() - 1; cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&_this->mPhaseReq, l_arcName[_this->mLevel]); diff --git a/src/d/actor/d_a_obj_zcloth.cpp b/src/d/actor/d_a_obj_zcloth.cpp index 5645d30d1dd..b89cf50460f 100644 --- a/src/d/actor/d_a_obj_zcloth.cpp +++ b/src/d/actor/d_a_obj_zcloth.cpp @@ -34,7 +34,7 @@ int daObjZCloth_c::Create() { /* 80D3EF0C-80D3F0AC 00016C 01A0+00 1/1 0/0 0/0 .text create__13daObjZCloth_cFv */ int daObjZCloth_c::create() { - fopAcM_SetupActor(this, daObjZCloth_c); + fopAcM_ct(this, daObjZCloth_c); m_itemNo = 0x31; int phase = dComIfG_resLoad(&mPhase, dItem_data::getFieldArc(m_itemNo)); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_obj_zdoor.cpp b/src/d/actor/d_a_obj_zdoor.cpp index 4729f901c84..bd9c347487f 100644 --- a/src/d/actor/d_a_obj_zdoor.cpp +++ b/src/d/actor/d_a_obj_zdoor.cpp @@ -388,7 +388,7 @@ int daZdoor_c::Delete() { /* 80D3FDCC-80D3FF18 000A0C 014C+00 1/0 0/0 0/0 .text daZdoor_create1st__FP9daZdoor_c */ static int daZdoor_create1st(daZdoor_c* i_this) { - fopAcM_SetupActor(i_this, daZdoor_c); + fopAcM_ct(i_this, daZdoor_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_obj_zrTurara.cpp b/src/d/actor/d_a_obj_zrTurara.cpp index bca609b1343..fd0243700e5 100644 --- a/src/d/actor/d_a_obj_zrTurara.cpp +++ b/src/d/actor/d_a_obj_zrTurara.cpp @@ -81,7 +81,7 @@ int daZrTurara_c::CreateHeap() { /* 80D40844-80D40B1C 0003C4 02D8+00 1/1 0/0 0/0 .text create__12daZrTurara_cFv */ cPhs__Step daZrTurara_c::create() { - fopAcM_SetupActor(this, daZrTurara_c); + fopAcM_ct(this, daZrTurara_c); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhaseReq, "M_DrpRock"); if (step == cPhs_COMPLEATE_e) { cPhs__Step bg_step = (cPhs__Step)MoveBGCreate("M_DrpRock", 9, dBgS_MoveBGProc_TypicalRotY, diff --git a/src/d/actor/d_a_obj_zrTuraraRock.cpp b/src/d/actor/d_a_obj_zrTuraraRock.cpp index 19ff5e5d10e..6dada73a78f 100644 --- a/src/d/actor/d_a_obj_zrTuraraRock.cpp +++ b/src/d/actor/d_a_obj_zrTuraraRock.cpp @@ -64,7 +64,7 @@ int daZrTuraRc_c::CreateHeap() { /* 80D41A40-80D41D24 0002A0 02E4+00 1/1 0/0 0/0 .text create__12daZrTuraRc_cFv */ cPhs__Step daZrTuraRc_c::create() { - fopAcM_SetupActor(this, daZrTuraRc_c); + fopAcM_ct(this, daZrTuraRc_c); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhaseReq, "M_DRockHn"); if (step == cPhs_COMPLEATE_e) { if (!fopAcM_entrySolidHeap(this, createHeapCallBack, 0x840)) { diff --git a/src/d/actor/d_a_obj_zraMark.cpp b/src/d/actor/d_a_obj_zraMark.cpp index 46e45a33cbd..cabf22379bc 100644 --- a/src/d/actor/d_a_obj_zraMark.cpp +++ b/src/d/actor/d_a_obj_zraMark.cpp @@ -49,7 +49,7 @@ static char* l_arcName[1] = {"buoy"}; /* 80D42678-80D4287C 000098 0204+00 1/1 0/0 0/0 .text Create__14daObjZraMark_cFv */ int daObjZraMark_c::Create() { - fopAcM_SetupActor(this, daObjZraMark_c); + fopAcM_ct(this, daObjZraMark_c); mType = getType(); diff --git a/src/d/actor/d_a_obj_zra_freeze.cpp b/src/d/actor/d_a_obj_zra_freeze.cpp index daa81bc4a53..24b1cff7d0a 100644 --- a/src/d/actor/d_a_obj_zra_freeze.cpp +++ b/src/d/actor/d_a_obj_zra_freeze.cpp @@ -59,7 +59,7 @@ static int createSolidHeap(fopAc_ac_c* i_this) { /* 80D442BC-80D4443C 00027C 0180+00 1/1 0/0 0/0 .text Create__13daZraFreeze_cFv */ cPhs__Step daZraFreeze_c::Create() { - fopAcM_SetupActor(this, daZraFreeze_c); + fopAcM_ct(this, daZraFreeze_c); field_0x5b0 = (fopAcM_GetParam(this) >> 8) & 0xff; field_0x5b1 = (fopAcM_GetParam(this) >> 0x10) & 0xff; field_0x5b2 = (fopAcM_GetParam(this) >> 0x18) & 0xff; diff --git a/src/d/actor/d_a_obj_zra_rock.cpp b/src/d/actor/d_a_obj_zra_rock.cpp index 683e1bb39ed..c0f3d277e85 100644 --- a/src/d/actor/d_a_obj_zra_rock.cpp +++ b/src/d/actor/d_a_obj_zra_rock.cpp @@ -81,7 +81,7 @@ int daObjZraRock_c::CreateHeap() { /* 80D450E0-80D45264 0004A0 0184+00 1/1 0/0 0/0 .text create__14daObjZraRock_cFv */ cPhs__Step daObjZraRock_c::create() { - fopAcM_SetupActor(this, daObjZraRock_c); + fopAcM_ct(this, daObjZraRock_c); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhaseReq, l_arcName); if (step == cPhs_ERROR_e || step == cPhs_UNK3_e) { return cPhs_ERROR_e; diff --git a/src/d/actor/d_a_passer_mng.cpp b/src/d/actor/d_a_passer_mng.cpp index b852b1d9938..cbc21e8f8fa 100644 --- a/src/d/actor/d_a_passer_mng.cpp +++ b/src/d/actor/d_a_passer_mng.cpp @@ -528,7 +528,7 @@ static int daPasserMng_Create(fopAc_ac_c* i_this) { /* 80D46768-80D467C0 0010C8 0058+00 1/1 0/0 0/0 .text create__13daPasserMng_cFv */ int daPasserMng_c::create() { - fopAcM_SetupActor(this, daPasserMng_c); + fopAcM_ct(this, daPasserMng_c); create_init(); return cPhs_COMPLEATE_e; } diff --git a/src/d/actor/d_a_ppolamp.cpp b/src/d/actor/d_a_ppolamp.cpp index 03c2b731467..a33bd82510f 100644 --- a/src/d/actor/d_a_ppolamp.cpp +++ b/src/d/actor/d_a_ppolamp.cpp @@ -167,7 +167,7 @@ void daPPolamp_c::initParam() { /* 80D4D140-80D4D1CC 000880 008C+00 1/0 0/0 0/0 .text daPPolamp_create__FP11daPPolamp_c */ static int daPPolamp_create(daPPolamp_c* i_this) { - fopAcM_SetupActor(i_this, daPPolamp_c); + fopAcM_ct(i_this, daPPolamp_c); return i_this->create(); } diff --git a/src/d/actor/d_a_scene_exit.cpp b/src/d/actor/d_a_scene_exit.cpp index b2b8998dd6c..15e1bc11a16 100644 --- a/src/d/actor/d_a_scene_exit.cpp +++ b/src/d/actor/d_a_scene_exit.cpp @@ -36,7 +36,7 @@ int daScex_c::checkWork() { } inline int daScex_c::create() { - fopAcM_SetupActor(this, daScex_c); + fopAcM_ct(this, daScex_c); mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z); mDoMtx_stack_c::YrotM(shape_angle.y); diff --git a/src/d/actor/d_a_scene_exit2.cpp b/src/d/actor/d_a_scene_exit2.cpp index d4edd5899f0..fc51a1c2d74 100644 --- a/src/d/actor/d_a_scene_exit2.cpp +++ b/src/d/actor/d_a_scene_exit2.cpp @@ -39,7 +39,7 @@ int daScExit_c::Create() { /* 8059E230-8059E2C0 000150 0090+00 1/1 0/0 0/0 .text create__10daScExit_cFv */ int daScExit_c::create() { - fopAcM_SetupActor(this, daScExit_c); + fopAcM_ct(this, daScExit_c); int phase = dComIfG_resLoad(&mPhase, l_arcName); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_set_bgobj.cpp b/src/d/actor/d_a_set_bgobj.cpp index c6de6c748b9..5023dabea92 100644 --- a/src/d/actor/d_a_set_bgobj.cpp +++ b/src/d/actor/d_a_set_bgobj.cpp @@ -27,7 +27,7 @@ int daSetBgObj_c::CreateInit() { /* 80485DFC-80485E88 0000FC 008C+00 1/1 0/0 0/0 .text create__12daSetBgObj_cFv */ int daSetBgObj_c::create() { - fopAcM_SetupActor(this, daSetBgObj_c); + fopAcM_ct(this, daSetBgObj_c); sprintf(mArcName, "%s", getArcName(this)); diff --git a/src/d/actor/d_a_shop_item.cpp b/src/d/actor/d_a_shop_item.cpp index fea0ed35932..ee9ec383b87 100644 --- a/src/d/actor/d_a_shop_item.cpp +++ b/src/d/actor/d_a_shop_item.cpp @@ -228,7 +228,7 @@ u8 daShopItem_c::getCollisionR() { } int daShopItem_c::_create() { - fopAcM_SetupActor(this, daShopItem_c); + fopAcM_ct(this, daShopItem_c); mAngleX = 0; mAngleY = 0; diff --git a/src/d/actor/d_a_skip_2D.cpp b/src/d/actor/d_a_skip_2D.cpp index dfb7a0bbe75..d72507250ce 100644 --- a/src/d/actor/d_a_skip_2D.cpp +++ b/src/d/actor/d_a_skip_2D.cpp @@ -28,7 +28,7 @@ int daSkip2D_c::createHeap() { /* 80D4D4F4-80D4D588 0000F4 0094+00 1/1 0/0 0/0 .text create__10daSkip2D_cFv */ int daSkip2D_c::create() { - fopAcM_SetupActor(this, daSkip2D_c); + fopAcM_ct(this, daSkip2D_c); if (!fopAcM_entrySolidHeap(this, daSkip2D_createHeap, 0)) { return cPhs_ERROR_e; diff --git a/src/d/actor/d_a_spinner.cpp b/src/d/actor/d_a_spinner.cpp index 2f69b5a26b8..bd09dca995b 100644 --- a/src/d/actor/d_a_spinner.cpp +++ b/src/d/actor/d_a_spinner.cpp @@ -57,7 +57,7 @@ static dCcD_SrcCyl l_cylSrc = { /* 804D1A70-804D1D60 0001D0 02F0+00 1/1 0/0 0/0 .text create__11daSpinner_cFv */ int daSpinner_c::create() { - fopAcM_SetupActor(this, daSpinner_c); + fopAcM_ct(this, daSpinner_c); if (!fopAcM_entrySolidHeap(this, daSpinner_createHeap, 0x900)) { return cPhs_ERROR_e; diff --git a/src/d/actor/d_a_sq.cpp b/src/d/actor/d_a_sq.cpp index 3f2e8483ba7..b0cb93f81d8 100644 --- a/src/d/actor/d_a_sq.cpp +++ b/src/d/actor/d_a_sq.cpp @@ -511,7 +511,7 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 805A0C30-805A0FB0 0016B0 0380+00 1/0 0/0 0/0 .text daSq_Create__FP10fopAc_ac_c */ static cPhs__Step daSq_Create(fopAc_ac_c* i_this) { sq_class* _this = static_cast(i_this); - fopAcM_SetupActor(i_this, sq_class); + fopAcM_ct(i_this, sq_class); cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&_this->mPhaseReq, "Sq"); if (step == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_startAndGoal.cpp b/src/d/actor/d_a_startAndGoal.cpp index 4af0a343390..4f6d4c7e8e5 100644 --- a/src/d/actor/d_a_startAndGoal.cpp +++ b/src/d/actor/d_a_startAndGoal.cpp @@ -83,7 +83,7 @@ static timer_info l_timerType[] = { /* 80D4D884-80D4D928 000144 00A4+00 1/1 0/0 0/0 .text Create__16daStartAndGoal_cFv */ int daStartAndGoal_c::Create() { - fopAcM_SetupActor(this, daStartAndGoal_c); + fopAcM_ct(this, daStartAndGoal_c); init(); return cPhs_COMPLEATE_e; diff --git a/src/d/actor/d_a_suspend.cpp b/src/d/actor/d_a_suspend.cpp index cc35caa5976..efbf3ba22d8 100644 --- a/src/d/actor/d_a_suspend.cpp +++ b/src/d/actor/d_a_suspend.cpp @@ -36,7 +36,7 @@ int daSus_c::create() { /* 804D51E0-804D5234 000140 0054+00 1/0 0/0 0/0 .text daSus_create__FP7daSus_c */ static int daSus_create(daSus_c* i_this) { - fopAcM_SetupActor(i_this, daSus_c); + fopAcM_ct(i_this, daSus_c); return i_this->create(); } diff --git a/src/d/actor/d_a_swBall.cpp b/src/d/actor/d_a_swBall.cpp index ac954a13c9e..8d5dbe0ca22 100644 --- a/src/d/actor/d_a_swBall.cpp +++ b/src/d/actor/d_a_swBall.cpp @@ -133,7 +133,7 @@ int daSwBall_c::Create() { /* 80D4E42C-80D4E494 0004CC 0068+00 1/1 0/0 0/0 .text create__10daSwBall_cFv */ int daSwBall_c::create() { - fopAcM_SetupActor(this, daSwBall_c); + fopAcM_ct(this, daSwBall_c); if (!Create()) { return cPhs_ERROR_e; diff --git a/src/d/actor/d_a_swLBall.cpp b/src/d/actor/d_a_swLBall.cpp index dc6ad78be9d..60e97df99e0 100644 --- a/src/d/actor/d_a_swLBall.cpp +++ b/src/d/actor/d_a_swLBall.cpp @@ -116,7 +116,7 @@ int daSwLBall_c::Create() { /* 80D4EEF8-80D4EF60 000478 0068+00 1/1 0/0 0/0 .text create__11daSwLBall_cFv */ int daSwLBall_c::create() { - fopAcM_SetupActor(this, daSwLBall_c); + fopAcM_ct(this, daSwLBall_c); if (!Create()) { return cPhs_ERROR_e; } diff --git a/src/d/actor/d_a_swTime.cpp b/src/d/actor/d_a_swTime.cpp index 3bf92988d99..bd6a32c874a 100644 --- a/src/d/actor/d_a_swTime.cpp +++ b/src/d/actor/d_a_swTime.cpp @@ -19,7 +19,7 @@ int daSwTime_c::Create() { /* 80D4F660-80D4F6C8 0000A0 0068+00 1/1 0/0 0/0 .text create__10daSwTime_cFv */ int daSwTime_c::create() { - fopAcM_SetupActor(this, daSwTime_c); + fopAcM_ct(this, daSwTime_c); if (!Create()) { return cPhs_ERROR_e; } diff --git a/src/d/actor/d_a_swc00.cpp b/src/d/actor/d_a_swc00.cpp index 126a6441e3a..d6fd866b05f 100644 --- a/src/d/actor/d_a_swc00.cpp +++ b/src/d/actor/d_a_swc00.cpp @@ -61,7 +61,7 @@ static BOOL hitCheck(daSwc00_c* i_swc) { int daSwc00_Draw(daSwc00_c* i_this) { fopAc_ac_c* a_this = i_this; - if (g_envHIO.mOther.field_0x46) { + if (g_envHIO.mOther.mDisplayTransparentCyl) { int shape = daSwc00_getShape(i_this); if (shape == 3) { GXColor local_44 = {0, 0, 0xff, 0xa0}; @@ -268,7 +268,7 @@ static inline int daSwc00_getScale(daSwc00_c* i_this) { /* 805A1B2C-805A1D8C 0007AC 0260+00 2/0 0/0 0/0 .text daSwc00_Create__FP10fopAc_ac_c */ static int daSwc00_Create(fopAc_ac_c* a_this) { daSwc00_c* i_this = (daSwc00_c*)a_this; - fopAcM_SetupActor(i_this, daSwc00_c); + fopAcM_ct(i_this, daSwc00_c); fpc_ProcID id = fopAcM_GetID(a_this); int sw1 = daSwc00_getSw1No(i_this); if (dComIfGs_isSwitch(sw1, fopAcM_GetRoomNo(a_this))) { diff --git a/src/d/actor/d_a_swhit0.cpp b/src/d/actor/d_a_swhit0.cpp index 89ad9cddd1b..9c519b8e092 100644 --- a/src/d/actor/d_a_swhit0.cpp +++ b/src/d/actor/d_a_swhit0.cpp @@ -136,7 +136,7 @@ static int CheckCreateHeap(fopAc_ac_c* i_this) { /* 804863B0-804865B4 000430 0204+00 1/1 0/0 0/0 .text create__10daSwhit0_cFv */ int daSwhit0_c::create() { - fopAcM_SetupActor(this, daSwhit0_c); + fopAcM_ct(this, daSwhit0_c); if (argument != 0) { setDrawMtx(); diff --git a/src/d/actor/d_a_tag_CstaSw.cpp b/src/d/actor/d_a_tag_CstaSw.cpp index 893ff1253b4..23e5acd4faf 100644 --- a/src/d/actor/d_a_tag_CstaSw.cpp +++ b/src/d/actor/d_a_tag_CstaSw.cpp @@ -21,7 +21,7 @@ void daTagCstaSw_c::setBaseMtx() { /* 805A20F0-805A2150 0001B0 0060+00 1/1 0/0 0/0 .text create__13daTagCstaSw_cFv */ int daTagCstaSw_c::create() { - fopAcM_SetupActor(this, daTagCstaSw_c); + fopAcM_ct(this, daTagCstaSw_c); mSwitch = getSw(); setBaseMtx(); return cPhs_COMPLEATE_e; diff --git a/src/d/actor/d_a_tag_Lv6Gate.cpp b/src/d/actor/d_a_tag_Lv6Gate.cpp index a77f134168b..4879661ac9f 100644 --- a/src/d/actor/d_a_tag_Lv6Gate.cpp +++ b/src/d/actor/d_a_tag_Lv6Gate.cpp @@ -303,7 +303,7 @@ void daTagLv6Gate_c::create_init() { /* 80D4FBD8-80D4FE5C 0003B8 0284+00 1/1 0/0 0/0 .text create__14daTagLv6Gate_cFv */ int daTagLv6Gate_c::create() { - fopAcM_SetupActor(this, daTagLv6Gate_c); + fopAcM_ct(this, daTagLv6Gate_c); int phase = dComIfG_resLoad(&mPhase, l_arcName); diff --git a/src/d/actor/d_a_tag_Lv7Gate.cpp b/src/d/actor/d_a_tag_Lv7Gate.cpp index 8e380ec461b..13fd4a25db0 100644 --- a/src/d/actor/d_a_tag_Lv7Gate.cpp +++ b/src/d/actor/d_a_tag_Lv7Gate.cpp @@ -52,7 +52,7 @@ static int daTagLv7Gate_Create(fopAc_ac_c* i_this) { int daTagLv7Gate_c::create() { int phase; - fopAcM_SetupActor(this, daTagLv7Gate_c); + fopAcM_ct(this, daTagLv7Gate_c); if (fopAcM_GetPosition_p(daPy_getPlayerActorClass())->y < 7500.0f) { return cPhs_ERROR_e; diff --git a/src/d/actor/d_a_tag_Lv8Gate.cpp b/src/d/actor/d_a_tag_Lv8Gate.cpp index 57c978c0929..7b6891355dc 100644 --- a/src/d/actor/d_a_tag_Lv8Gate.cpp +++ b/src/d/actor/d_a_tag_Lv8Gate.cpp @@ -50,7 +50,7 @@ inline void daTagLv8Gate_c::create_init() { } inline int daTagLv8Gate_c::create() { - fopAcM_SetupActor(this, daTagLv8Gate_c); + fopAcM_ct(this, daTagLv8Gate_c); cPhs__Step step; /* dSv_event_flag_c::F_0354 - Cutscene - [cutscene] Mirror complete */ diff --git a/src/d/actor/d_a_tag_TWgate.cpp b/src/d/actor/d_a_tag_TWgate.cpp index 25297601e5e..615887a3d80 100644 --- a/src/d/actor/d_a_tag_TWgate.cpp +++ b/src/d/actor/d_a_tag_TWgate.cpp @@ -1034,7 +1034,7 @@ int daTagTWGate_c::CreateHeap() { } int daTagTWGate_c::create() { - fopAcM_SetupActor(this, daTagTWGate_c); + fopAcM_ct(this, daTagTWGate_c); mType = getType(); diff --git a/src/d/actor/d_a_tag_ajnot.cpp b/src/d/actor/d_a_tag_ajnot.cpp index abe8a037e0e..48b6b297d74 100644 --- a/src/d/actor/d_a_tag_ajnot.cpp +++ b/src/d/actor/d_a_tag_ajnot.cpp @@ -11,7 +11,7 @@ /* 805A2658-805A26A8 000078 0050+00 1/1 0/0 0/0 .text create__12daTagAJnot_cFv */ int daTagAJnot_c::create() { - fopAcM_SetupActor(this, daTagAJnot_c); + fopAcM_ct(this, daTagAJnot_c); return cPhs_COMPLEATE_e; } diff --git a/src/d/actor/d_a_tag_allmato.cpp b/src/d/actor/d_a_tag_allmato.cpp index 194c45b4cf8..f3e20f33a77 100644 --- a/src/d/actor/d_a_tag_allmato.cpp +++ b/src/d/actor/d_a_tag_allmato.cpp @@ -37,7 +37,7 @@ static char* l_resNameList[3] = { /* 80487538-80487670 000078 0138+00 1/1 0/0 0/0 .text create__15daTag_AllMato_cFv */ int daTag_AllMato_c::create() { int var_r29 = 0; - fopAcM_SetupActor(this, daTag_AllMato_c); + fopAcM_ct(this, daTag_AllMato_c); scale.x *= 100.0f; scale.y *= 100.0f; diff --git a/src/d/actor/d_a_tag_attention.cpp b/src/d/actor/d_a_tag_attention.cpp index db5ad5bbdc5..48d6554260a 100644 --- a/src/d/actor/d_a_tag_attention.cpp +++ b/src/d/actor/d_a_tag_attention.cpp @@ -20,7 +20,7 @@ int daAttp_c::Create() { /* 804D5354-804D53AC 0000B4 0058+00 1/1 0/0 0/0 .text create__8daAttp_cFv */ int daAttp_c::create() { - fopAcM_SetupActor(this, daAttp_c); + fopAcM_ct(this, daAttp_c); Create(); return cPhs_COMPLEATE_e; } diff --git a/src/d/actor/d_a_tag_bottle_item.cpp b/src/d/actor/d_a_tag_bottle_item.cpp index 3047f24300d..d2febc9a042 100644 --- a/src/d/actor/d_a_tag_bottle_item.cpp +++ b/src/d/actor/d_a_tag_bottle_item.cpp @@ -14,7 +14,7 @@ s32 daTag_BottleItem_c::create() { s32 ret; - fopAcM_SetupActor(this, daTag_BottleItem_c); + fopAcM_ct(this, daTag_BottleItem_c); setTypeFromParam(); if (!isBottleItem(mBottleItemType)) { diff --git a/src/d/actor/d_a_tag_camera.cpp b/src/d/actor/d_a_tag_camera.cpp index 71990aa08be..4ec7fdba6cf 100644 --- a/src/d/actor/d_a_tag_camera.cpp +++ b/src/d/actor/d_a_tag_camera.cpp @@ -198,7 +198,7 @@ static u8 const lit_3874[12] = { }; int daTag_Cam_c::create() { - fopAcM_SetupActor(this, daTag_Cam_c); + fopAcM_ct(this, daTag_Cam_c); if (getAreaType() == 0) { scale.x *= 500.0f; diff --git a/src/d/actor/d_a_tag_chgrestart.cpp b/src/d/actor/d_a_tag_chgrestart.cpp index 64c6f74fa40..1846c7c8ef6 100644 --- a/src/d/actor/d_a_tag_chgrestart.cpp +++ b/src/d/actor/d_a_tag_chgrestart.cpp @@ -32,7 +32,7 @@ s32 daTagChgRestart_c::Create() { /* 80D567E4-80D56878 000104 0094+00 1/1 0/0 0/0 .text create__17daTagChgRestart_cFv */ s32 daTagChgRestart_c::create() { - fopAcM_SetupActor(this, daTagChgRestart_c); + fopAcM_ct(this, daTagChgRestart_c); if (!Create()) { return cPhs_ERROR_e; diff --git a/src/d/actor/d_a_tag_csw.cpp b/src/d/actor/d_a_tag_csw.cpp index c98296617c4..348cf30b21c 100644 --- a/src/d/actor/d_a_tag_csw.cpp +++ b/src/d/actor/d_a_tag_csw.cpp @@ -188,7 +188,7 @@ int daTagCsw_c::chkInsideStatueStart() { /* 80D573C0-80D576D4 000860 0314+00 1/1 0/0 0/0 .text create__10daTagCsw_cFv */ int daTagCsw_c::create() { - fopAcM_SetupActor(this, daTagCsw_c); + fopAcM_ct(this, daTagCsw_c); field_0x570 = getType(); int rv = dComIfG_resLoad(this, l_arcName); if (rv == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_tag_escape.cpp b/src/d/actor/d_a_tag_escape.cpp index 8645f03dbeb..4ab15bc9d52 100644 --- a/src/d/actor/d_a_tag_escape.cpp +++ b/src/d/actor/d_a_tag_escape.cpp @@ -11,7 +11,7 @@ /* 80D587D8-80D58828 000078 0050+00 1/0 0/0 0/0 .text daTagEscape_Create__FP10fopAc_ac_c */ static int daTagEscape_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, daTagEscape_c); + fopAcM_ct(i_this, daTagEscape_c); return cPhs_COMPLEATE_e; } diff --git a/src/d/actor/d_a_tag_event.cpp b/src/d/actor/d_a_tag_event.cpp index 17213fb649c..574c0a02cf7 100644 --- a/src/d/actor/d_a_tag_event.cpp +++ b/src/d/actor/d_a_tag_event.cpp @@ -98,7 +98,7 @@ void daTag_Event_c::demoProc() {} /* 8048AF00-8048B0E4 000240 01E4+00 1/1 0/0 0/0 .text create__13daTag_Event_cFv */ int daTag_Event_c::create() { - fopAcM_SetupActor(this, daTag_Event_c); + fopAcM_ct(this, daTag_Event_c); int swbit = getSwbit(); int room_no = fopAcM_GetRoomNo(this); diff --git a/src/d/actor/d_a_tag_evt.cpp b/src/d/actor/d_a_tag_evt.cpp index 88d62d0d63b..cbb14a261bd 100644 --- a/src/d/actor/d_a_tag_evt.cpp +++ b/src/d/actor/d_a_tag_evt.cpp @@ -30,7 +30,7 @@ char* daTag_Evt_c::mEvtCutList[] = { /* 8048B918-8048B9D8 000078 00C0+00 1/1 0/0 0/0 .text create__11daTag_Evt_cFv */ int daTag_Evt_c::create() { - fopAcM_SetupActor(this, daTag_Evt_c); + fopAcM_ct(this, daTag_Evt_c); cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&mPhase, l_resFileName); if (phase == cPhs_COMPLEATE_e) { eventInfo.setArchiveName(l_resFileName); diff --git a/src/d/actor/d_a_tag_evtarea.cpp b/src/d/actor/d_a_tag_evtarea.cpp index 1d3eb42b57b..cdbbd92b4e5 100644 --- a/src/d/actor/d_a_tag_evtarea.cpp +++ b/src/d/actor/d_a_tag_evtarea.cpp @@ -10,7 +10,7 @@ /* 8048C4F8-8048C728 000078 0230+00 2/1 0/0 0/0 .text create__15daTag_EvtArea_cFv */ cPhs__Step daTag_EvtArea_c::create() { - fopAcM_SetupActor(this, daTag_EvtArea_c); + fopAcM_ct(this, daTag_EvtArea_c); switch (getType()) { case 0: diff --git a/src/d/actor/d_a_tag_evtmsg.cpp b/src/d/actor/d_a_tag_evtmsg.cpp index b4c35a5bf3f..9e6ee9bdf76 100644 --- a/src/d/actor/d_a_tag_evtmsg.cpp +++ b/src/d/actor/d_a_tag_evtmsg.cpp @@ -26,7 +26,7 @@ static char* l_myName = "EvtMsg"; /* 8048CF38-8048D014 000078 00DC+00 1/1 0/0 0/0 .text create__14daTag_EvtMsg_cFv */ int daTag_EvtMsg_c::create() { - fopAcM_SetupActor(this, daTag_EvtMsg_c); + fopAcM_ct(this, daTag_EvtMsg_c); scale.x *= 100.0f; scale.y *= 100.0f; diff --git a/src/d/actor/d_a_tag_firewall.cpp b/src/d/actor/d_a_tag_firewall.cpp index 0662f8ae05c..14d2b7e06e8 100644 --- a/src/d/actor/d_a_tag_firewall.cpp +++ b/src/d/actor/d_a_tag_firewall.cpp @@ -180,7 +180,7 @@ static int daTag_FWall_Delete(daTag_FWall_c* i_this) { /* 80D590A8-80D592D0 0007E8 0228+00 1/1 0/0 0/0 .text create__13daTag_FWall_cFv */ int daTag_FWall_c::create() { - fopAcM_SetupActor(this, daTag_FWall_c); + fopAcM_ct(this, daTag_FWall_c); if (fire_num == 0) { field_0x568 = 0xFF; diff --git a/src/d/actor/d_a_tag_gstart.cpp b/src/d/actor/d_a_tag_gstart.cpp index e1f73202640..a05b85a1f0e 100644 --- a/src/d/actor/d_a_tag_gstart.cpp +++ b/src/d/actor/d_a_tag_gstart.cpp @@ -12,7 +12,7 @@ /* 805A3478-805A34F4 000078 007C+00 1/1 0/0 0/0 .text create__13daTagGstart_cFv */ int daTagGstart_c::create() { - fopAcM_SetupActor(this, daTagGstart_c); + fopAcM_ct(this, daTagGstart_c); mSwNo = fopAcM_GetParam(this); mSwNo2 = fopAcM_GetParam(this) >> 8; diff --git a/src/d/actor/d_a_tag_guard.cpp b/src/d/actor/d_a_tag_guard.cpp index a98f4e66668..f1e29f1062f 100644 --- a/src/d/actor/d_a_tag_guard.cpp +++ b/src/d/actor/d_a_tag_guard.cpp @@ -32,7 +32,7 @@ void daTagGuard_c::createGuard(u32 i_parameters) { } int daTagGuard_c::create() { - fopAcM_SetupActor(this, daTagGuard_c); + fopAcM_ct(this, daTagGuard_c); create_init(); return cPhs_COMPLEATE_e; } diff --git a/src/d/actor/d_a_tag_hinit.cpp b/src/d/actor/d_a_tag_hinit.cpp index dad91fee6fe..f0b5bec4e9a 100644 --- a/src/d/actor/d_a_tag_hinit.cpp +++ b/src/d/actor/d_a_tag_hinit.cpp @@ -10,7 +10,7 @@ /* 805A3758-805A3800 000078 00A8+00 1/1 0/0 0/0 .text create__12daTagHinit_cFv */ int daTagHinit_c::create() { - fopAcM_SetupActor(this, daTagHinit_c); + fopAcM_ct(this, daTagHinit_c); field_0x569 = shape_angle.x; diff --git a/src/d/actor/d_a_tag_hjump.cpp b/src/d/actor/d_a_tag_hjump.cpp index 550eacbc2d7..b0a8eae4cbe 100644 --- a/src/d/actor/d_a_tag_hjump.cpp +++ b/src/d/actor/d_a_tag_hjump.cpp @@ -27,7 +27,7 @@ int daTagHjump_c::CreateHeap() { /* 805A3B24-805A3D80 0000E4 025C+00 1/1 0/0 0/0 .text create__12daTagHjump_cFv */ int daTagHjump_c::create() { - fopAcM_SetupActor(this, daTagHjump_c); + fopAcM_ct(this, daTagHjump_c); mType = (fopAcM_GetParam(this) >> 4) & 0xF; field_0x5ad = fopAcM_GetParam(this) & 0xF; diff --git a/src/d/actor/d_a_tag_howl.cpp b/src/d/actor/d_a_tag_howl.cpp index 38fc0685fa7..fa011312dab 100644 --- a/src/d/actor/d_a_tag_howl.cpp +++ b/src/d/actor/d_a_tag_howl.cpp @@ -12,7 +12,7 @@ /* 8048D958-8048D9BC 000078 0064+00 1/1 0/0 0/0 .text create__12daTag_Howl_cFv */ int daTag_Howl_c::create() { - fopAcM_SetupActor(this, daTag_Howl_c); + fopAcM_ct(this, daTag_Howl_c); getParam(); return cPhs_COMPLEATE_e; } diff --git a/src/d/actor/d_a_tag_hstop.cpp b/src/d/actor/d_a_tag_hstop.cpp index a6ed4c10d11..f8878edba05 100644 --- a/src/d/actor/d_a_tag_hstop.cpp +++ b/src/d/actor/d_a_tag_hstop.cpp @@ -13,7 +13,7 @@ /* 805A43EC-805A45D8 0000EC 01EC+00 1/1 0/0 0/0 .text create__12daTagHstop_cFv */ int daTagHstop_c::create() { - fopAcM_SetupActor(this, daTagHstop_c); + fopAcM_ct(this, daTagHstop_c); scale.x *= 100.0f; scale.y *= 100.0f; diff --git a/src/d/actor/d_a_tag_instruction.cpp b/src/d/actor/d_a_tag_instruction.cpp index ee6df800c9f..f87ad9417ea 100644 --- a/src/d/actor/d_a_tag_instruction.cpp +++ b/src/d/actor/d_a_tag_instruction.cpp @@ -10,7 +10,7 @@ /* 80D59AF8-80D59B48 000078 0050+00 1/0 0/0 0/0 .text daTagInst_Create__FP10fopAc_ac_c */ static int daTagInst_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, daTagInst_c); + fopAcM_ct(i_this, daTagInst_c); return cPhs_COMPLEATE_e; } diff --git a/src/d/actor/d_a_tag_kago_fall.cpp b/src/d/actor/d_a_tag_kago_fall.cpp index 3f904887a36..280fce8cc6a 100644 --- a/src/d/actor/d_a_tag_kago_fall.cpp +++ b/src/d/actor/d_a_tag_kago_fall.cpp @@ -23,7 +23,7 @@ static u32 m_master_id = -1; /* 80D59C58-80D59DE0 000078 0188+00 1/1 0/0 0/0 .text create__15daTagKagoFall_cFv */ int daTagKagoFall_c::create() { - fopAcM_SetupActor(this, daTagKagoFall_c); + fopAcM_ct(this, daTagKagoFall_c); if (dComIfG_play_c::getLayerNo(0) == 13) { mExitID = 4; diff --git a/src/d/actor/d_a_tag_kmsg.cpp b/src/d/actor/d_a_tag_kmsg.cpp index 4e80722d56e..a46ad4072fa 100644 --- a/src/d/actor/d_a_tag_kmsg.cpp +++ b/src/d/actor/d_a_tag_kmsg.cpp @@ -34,7 +34,7 @@ static char* l_resNameList[3] = { int daTag_KMsg_c::create() { attention_info.position = current.pos; eyePos = attention_info.position; - fopAcM_SetupActor(this, daTag_KMsg_c); + fopAcM_ct(this, daTag_KMsg_c); int rv; if (getType() == KMSG_TYPE_3) { rv = dComIfG_resLoad(&mPhase, "Lv6Gate"); diff --git a/src/d/actor/d_a_tag_lantern.cpp b/src/d/actor/d_a_tag_lantern.cpp index 3263404d6e7..b6f6ae204c3 100644 --- a/src/d/actor/d_a_tag_lantern.cpp +++ b/src/d/actor/d_a_tag_lantern.cpp @@ -13,7 +13,7 @@ daTag_Lantern_c::~daTag_Lantern_c() {} /* 8048ED28-8048EDA8 000168 0080+00 1/1 0/0 0/0 .text create__15daTag_Lantern_cFv */ int daTag_Lantern_c::create() { - fopAcM_SetupActor(this, daTag_Lantern_c); + fopAcM_ct(this, daTag_Lantern_c); initialize(); return cPhs_COMPLEATE_e; } diff --git a/src/d/actor/d_a_tag_lightball.cpp b/src/d/actor/d_a_tag_lightball.cpp index 55d694fd5b4..0f69c654db6 100644 --- a/src/d/actor/d_a_tag_lightball.cpp +++ b/src/d/actor/d_a_tag_lightball.cpp @@ -50,7 +50,7 @@ int daTagLightBall_c::Create() { /* 80D5A9B8-80D5AA20 000238 0068+00 1/1 0/0 0/0 .text create__16daTagLightBall_cFv */ int daTagLightBall_c::create() { - fopAcM_SetupActor(this, daTagLightBall_c); + fopAcM_ct(this, daTagLightBall_c); if (!Create()) { return cPhs_ERROR_e; diff --git a/src/d/actor/d_a_tag_lv2prchk.cpp b/src/d/actor/d_a_tag_lv2prchk.cpp index 8226eac54f9..c3c06ba04d5 100644 --- a/src/d/actor/d_a_tag_lv2prchk.cpp +++ b/src/d/actor/d_a_tag_lv2prchk.cpp @@ -27,7 +27,7 @@ int daTagLv2PrChk_c::Create() { /* 805A4CDC-805A4D44 0000FC 0068+00 1/1 0/0 0/0 .text create__15daTagLv2PrChk_cFv */ int daTagLv2PrChk_c::create() { - fopAcM_SetupActor(this, daTagLv2PrChk_c); + fopAcM_ct(this, daTagLv2PrChk_c); if (!Create()) { return cPhs_ERROR_e; diff --git a/src/d/actor/d_a_tag_lv5soup.cpp b/src/d/actor/d_a_tag_lv5soup.cpp index 6d61f06bede..5e0f29a673e 100644 --- a/src/d/actor/d_a_tag_lv5soup.cpp +++ b/src/d/actor/d_a_tag_lv5soup.cpp @@ -11,7 +11,7 @@ /* 80D5AD58-80D5ADEC 000078 0094+00 1/1 0/0 0/0 .text create__15daTag_Lv5Soup_cFv */ int daTag_Lv5Soup_c::create() { - fopAcM_SetupActor(this, daTag_Lv5Soup_c); + fopAcM_ct(this, daTag_Lv5Soup_c); fopAcM_setCullSizeBox(this, -30.0f, -15.0f, -30.0f, 30.0f, 45.0f, 30.0f); attention_info.flags = 0; return cPhs_COMPLEATE_e; diff --git a/src/d/actor/d_a_tag_lv6CstaSw.cpp b/src/d/actor/d_a_tag_lv6CstaSw.cpp index 6f77b88f84d..48cf225a631 100644 --- a/src/d/actor/d_a_tag_lv6CstaSw.cpp +++ b/src/d/actor/d_a_tag_lv6CstaSw.cpp @@ -21,7 +21,7 @@ void daLv6CstaSw_c::setBaseMtx() { /* 80D5B3B0-80D5B410 0001B0 0060+00 1/1 0/0 0/0 .text create__13daLv6CstaSw_cFv */ int daLv6CstaSw_c::create() { - fopAcM_SetupActor(this, daLv6CstaSw_c); + fopAcM_ct(this, daLv6CstaSw_c); mSwitch = getSw(); setBaseMtx(); return cPhs_COMPLEATE_e; diff --git a/src/d/actor/d_a_tag_magne.cpp b/src/d/actor/d_a_tag_magne.cpp index 31230dee090..88cf1bc7141 100644 --- a/src/d/actor/d_a_tag_magne.cpp +++ b/src/d/actor/d_a_tag_magne.cpp @@ -24,7 +24,7 @@ int daTagMagne_c::Create() { /* 805A54DC-805A5578 0000BC 009C+00 1/1 0/0 0/0 .text create__12daTagMagne_cFv */ int daTagMagne_c::create() { - fopAcM_SetupActor(this, daTagMagne_c); + fopAcM_ct(this, daTagMagne_c); if (mTagMagne != NULL && mTagMagne->current.roomNo != current.roomNo) { return cPhs_INIT_e; diff --git a/src/d/actor/d_a_tag_mhint.cpp b/src/d/actor/d_a_tag_mhint.cpp index 5405a0640d3..931b119e1be 100644 --- a/src/d/actor/d_a_tag_mhint.cpp +++ b/src/d/actor/d_a_tag_mhint.cpp @@ -14,7 +14,7 @@ /* 805A56B8-805A58C8 000078 0210+00 1/1 0/0 0/0 .text create__12daTagMhint_cFv */ int daTagMhint_c::create() { - fopAcM_SetupActor(this, daTagMhint_c); + fopAcM_ct(this, daTagMhint_c); field_0x574 = fopAcM_GetParam(this) & 0x3FF; field_0x57c = (fopAcM_GetParam(this) >> 10) & 0x3FF; diff --git a/src/d/actor/d_a_tag_mist.cpp b/src/d/actor/d_a_tag_mist.cpp index 9c3e75a46f6..02e8af7208f 100644 --- a/src/d/actor/d_a_tag_mist.cpp +++ b/src/d/actor/d_a_tag_mist.cpp @@ -79,7 +79,7 @@ int daTagMist_c::Create() { /* 8048F444-8048F518 000264 00D4+00 1/1 0/0 0/0 .text create__11daTagMist_cFv */ int daTagMist_c::create() { - fopAcM_SetupActor(this, daTagMist_c); + fopAcM_ct(this, daTagMist_c); if (!mInitParams) { mInitParams = true; diff --git a/src/d/actor/d_a_tag_mmsg.cpp b/src/d/actor/d_a_tag_mmsg.cpp index 64eec5271f5..f31a6ef0608 100644 --- a/src/d/actor/d_a_tag_mmsg.cpp +++ b/src/d/actor/d_a_tag_mmsg.cpp @@ -13,7 +13,7 @@ /* ############################################################################################## */ /* 80D5B918-80D5BA94 000078 017C+00 1/1 0/0 0/0 .text create__11daTagMmsg_cFv */ int daTagMmsg_c::create() { - fopAcM_SetupActor(this, daTagMmsg_c); + fopAcM_ct(this, daTagMmsg_c); field_0x570 = fpcM_GetParam(this) & 0x3FF; field_0x572 = (fpcM_GetParam(this) >> 10) & 0x3FF; diff --git a/src/d/actor/d_a_tag_msg.cpp b/src/d/actor/d_a_tag_msg.cpp index c957f7bef28..a19e5ce2cf4 100644 --- a/src/d/actor/d_a_tag_msg.cpp +++ b/src/d/actor/d_a_tag_msg.cpp @@ -32,7 +32,7 @@ daTag_Msg_c::~daTag_Msg_c() { /* 8048F878-8048F954 000118 00DC+00 1/1 0/0 0/0 .text create__11daTag_Msg_cFv */ int daTag_Msg_c::create() { - fopAcM_SetupActor(this, daTag_Msg_c); + fopAcM_ct(this, daTag_Msg_c); int phase_state = dComIfG_resLoad(&mPhase, getResName()); if (phase_state == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_tag_mstop.cpp b/src/d/actor/d_a_tag_mstop.cpp index df6104a610e..24ce937dcdd 100644 --- a/src/d/actor/d_a_tag_mstop.cpp +++ b/src/d/actor/d_a_tag_mstop.cpp @@ -13,7 +13,7 @@ /* 805A6138-805A6318 000078 01E0+00 1/1 0/0 0/0 .text create__12daTagMstop_cFv */ int daTagMstop_c::create() { - fopAcM_SetupActor(this, daTagMstop_c); + fopAcM_ct(this, daTagMstop_c); field_0x56b = fopAcM_GetParam(this) >> 16; field_0x56a = (fopAcM_GetParam(this) >> 24) & 0xF; diff --git a/src/d/actor/d_a_tag_mwait.cpp b/src/d/actor/d_a_tag_mwait.cpp index 8e20a9c444b..20505fa2534 100644 --- a/src/d/actor/d_a_tag_mwait.cpp +++ b/src/d/actor/d_a_tag_mwait.cpp @@ -11,7 +11,7 @@ /* 80D5BE18-80D5BFFC 000078 01E4+00 1/1 0/0 0/0 .text create__12daTagMwait_cFv */ int daTagMwait_c::create() { - fopAcM_SetupActor(this, daTagMwait_c); + fopAcM_ct(this, daTagMwait_c); mEnterSw = fopAcM_GetParam(this) >> 8; diff --git a/src/d/actor/d_a_tag_myna2.cpp b/src/d/actor/d_a_tag_myna2.cpp index 76fbc6d601e..02b27e31e0d 100644 --- a/src/d/actor/d_a_tag_myna2.cpp +++ b/src/d/actor/d_a_tag_myna2.cpp @@ -10,7 +10,7 @@ /* 80D5C698-80D5C708 000078 0070+00 1/1 0/0 0/0 .text create__12daTagMyna2_cFv */ s32 daTagMyna2_c::create() { - fopAcM_SetupActor(this, daTagMyna2_c); + fopAcM_ct(this, daTagMyna2_c); mSwitchNo = getSwBit(); mMode = getMode(); mTimer = 5; diff --git a/src/d/actor/d_a_tag_myna_light.cpp b/src/d/actor/d_a_tag_myna_light.cpp index 8c3bd582073..513344b86bd 100644 --- a/src/d/actor/d_a_tag_myna_light.cpp +++ b/src/d/actor/d_a_tag_myna_light.cpp @@ -9,7 +9,7 @@ /* 80D5CB38-80D5CB9C 000078 0064+00 1/1 0/0 0/0 .text create__17daTag_MynaLight_cFv */ int daTag_MynaLight_c::create() { - fopAcM_SetupActor(this, daTag_MynaLight_c); + fopAcM_ct(this, daTag_MynaLight_c); initialize(); return 4; } diff --git a/src/d/actor/d_a_tag_pachi.cpp b/src/d/actor/d_a_tag_pachi.cpp index 0c6dd1eab08..0eb69dacf68 100644 --- a/src/d/actor/d_a_tag_pachi.cpp +++ b/src/d/actor/d_a_tag_pachi.cpp @@ -30,7 +30,7 @@ static dCcD_SrcCyl const l_sph_src = { /* 80D5D570-80D5D6A0 0001B0 0130+00 1/1 0/0 0/0 .text create__11daTagPati_cFv */ int daTagPati_c::create() { - fopAcM_SetupActor(this, daTagPati_c); + fopAcM_ct(this, daTagPati_c); field_0x6E0 = get_prm(); mStts.Init(0xFF, 0xFF, this); mCyl.Set(l_sph_src); diff --git a/src/d/actor/d_a_tag_poFire.cpp b/src/d/actor/d_a_tag_poFire.cpp index 77fbcdb2b3e..d56d890f5de 100644 --- a/src/d/actor/d_a_tag_poFire.cpp +++ b/src/d/actor/d_a_tag_poFire.cpp @@ -21,7 +21,7 @@ void daTagPoFire_c::setBaseMtx() { /* 80D5DB90-80D5DBF0 0001B0 0060+00 1/1 0/0 0/0 .text create__13daTagPoFire_cFv */ int daTagPoFire_c::create() { - fopAcM_SetupActor(this, daTagPoFire_c); + fopAcM_ct(this, daTagPoFire_c); field_0x569 = 0; setBaseMtx(); return cPhs_COMPLEATE_e; diff --git a/src/d/actor/d_a_tag_push.cpp b/src/d/actor/d_a_tag_push.cpp index e5f9deba0c5..5d238291e4d 100644 --- a/src/d/actor/d_a_tag_push.cpp +++ b/src/d/actor/d_a_tag_push.cpp @@ -53,7 +53,7 @@ void* daTag_Push_c::srchActor(void* param_0, void* param_1) { /* 80490418-804904D4 0001D8 00BC+00 1/1 0/0 0/0 .text create__12daTag_Push_cFv */ int daTag_Push_c::create() { - fopAcM_SetupActor(this, daTag_Push_c); + fopAcM_ct(this, daTag_Push_c); scale.x *= 100.0f; scale.y *= 100.0f; scale.z = scale.x; diff --git a/src/d/actor/d_a_tag_qs.cpp b/src/d/actor/d_a_tag_qs.cpp index c4a15f24f52..fb69c910acf 100644 --- a/src/d/actor/d_a_tag_qs.cpp +++ b/src/d/actor/d_a_tag_qs.cpp @@ -34,7 +34,7 @@ daTagQs_c::~daTagQs_c() {} /* 80D5DFB0-80D5E110 0001B0 0160+00 1/1 0/0 0/0 .text create__9daTagQs_cFv */ int daTagQs_c::create() { - fopAcM_SetupActor(this, daTagQs_c); + fopAcM_ct(this, daTagQs_c); f32 typeScale; if (getType() == 0) { typeScale = 1.0f; diff --git a/src/d/actor/d_a_tag_ret_room.cpp b/src/d/actor/d_a_tag_ret_room.cpp index bf1d0e5373b..8ea2f302db9 100644 --- a/src/d/actor/d_a_tag_ret_room.cpp +++ b/src/d/actor/d_a_tag_ret_room.cpp @@ -16,7 +16,7 @@ daTagRetRm_c::~daTagRetRm_c() {} /* 80D5EF34-80D5EF8C 000114 0058+00 1/1 0/0 0/0 .text create__12daTagRetRm_cFv */ int daTagRetRm_c::create() { - fopAcM_SetupActor(this, daTagRetRm_c); + fopAcM_ct(this, daTagRetRm_c); init(); return cPhs_COMPLEATE_e; } @@ -76,7 +76,7 @@ u8 daTagRetRm_c::chkPlyrInTag() { /* 80D5F14C-80D5F1A0 00032C 0054+00 1/0 0/0 0/0 .text daTagRetRm_create__FP12daTagRetRm_c */ static int daTagRetRm_create(daTagRetRm_c* i_this) { - fopAcM_SetupActor(i_this, daTagRetRm_c); + fopAcM_ct(i_this, daTagRetRm_c); return i_this->create(); } diff --git a/src/d/actor/d_a_tag_river_back.cpp b/src/d/actor/d_a_tag_river_back.cpp index 145fb44f4e6..d13889917b4 100644 --- a/src/d/actor/d_a_tag_river_back.cpp +++ b/src/d/actor/d_a_tag_river_back.cpp @@ -24,7 +24,7 @@ int daTagRiverBack_c::Create() { /* 80D5F360-80D5F3F0 0000E0 0090+00 1/1 0/0 0/0 .text create__16daTagRiverBack_cFv */ int daTagRiverBack_c::create() { - fopAcM_SetupActor(this, daTagRiverBack_c); + fopAcM_ct(this, daTagRiverBack_c); int phase = dComIfG_resLoad(&mPhase, l_arcName); if (phase == cPhs_COMPLEATE_e) { int result = Create(); diff --git a/src/d/actor/d_a_tag_rmbit_sw.cpp b/src/d/actor/d_a_tag_rmbit_sw.cpp index 86b1db96a61..d9e761f083a 100644 --- a/src/d/actor/d_a_tag_rmbit_sw.cpp +++ b/src/d/actor/d_a_tag_rmbit_sw.cpp @@ -16,7 +16,7 @@ daTagRmbitSw_c::~daTagRmbitSw_c() {} /* 80D5FB94-80D5FBEC 000114 0058+00 1/1 0/0 0/0 .text create__14daTagRmbitSw_cFv */ int daTagRmbitSw_c::create() { - fopAcM_SetupActor(this, daTagRmbitSw_c); + fopAcM_ct(this, daTagRmbitSw_c); init(); return cPhs_COMPLEATE_e; } @@ -107,7 +107,7 @@ u8 daTagRmbitSw_c::chkPlyrInTag() { /* 80D5FEEC-80D5FF40 00046C 0054+00 1/0 0/0 0/0 .text daTagRmbitSw_create__FP14daTagRmbitSw_c */ int daTagRmbitSw_create(daTagRmbitSw_c* i_this) { - fopAcM_SetupActor(i_this, daTagRmbitSw_c); + fopAcM_ct(i_this, daTagRmbitSw_c); return i_this->create(); } diff --git a/src/d/actor/d_a_tag_setBall.cpp b/src/d/actor/d_a_tag_setBall.cpp index 5fcd7f37ef9..69ea59bf41d 100644 --- a/src/d/actor/d_a_tag_setBall.cpp +++ b/src/d/actor/d_a_tag_setBall.cpp @@ -25,7 +25,7 @@ int daTagSetBall_c::Create() { /* 80D6024C-80D602B4 0000CC 0068+00 1/1 0/0 0/0 .text create__14daTagSetBall_cFv */ int daTagSetBall_c::create() { - fopAcM_SetupActor(this, daTagSetBall_c); + fopAcM_ct(this, daTagSetBall_c); if (!Create()) { return cPhs_ERROR_e; diff --git a/src/d/actor/d_a_tag_setrestart.cpp b/src/d/actor/d_a_tag_setrestart.cpp index bf94e70436c..d1529aab4fb 100644 --- a/src/d/actor/d_a_tag_setrestart.cpp +++ b/src/d/actor/d_a_tag_setrestart.cpp @@ -35,7 +35,7 @@ int daTagRestart_c::Create() { /* 80D6048C-80D60520 00010C 0094+00 1/1 0/0 0/0 .text create__14daTagRestart_cFv */ int daTagRestart_c::create() { - fopAcM_SetupActor(this, daTagRestart_c); + fopAcM_ct(this, daTagRestart_c); if (!Create()) { return cPhs_ERROR_e; diff --git a/src/d/actor/d_a_tag_shop_camera.cpp b/src/d/actor/d_a_tag_shop_camera.cpp index 579f628510d..8f4aa77f9d4 100644 --- a/src/d/actor/d_a_tag_shop_camera.cpp +++ b/src/d/actor/d_a_tag_shop_camera.cpp @@ -11,7 +11,7 @@ /* 80D60898-80D608FC 000078 0064+00 1/1 0/0 0/0 .text create__18daTag_ShopCamera_cFv */ int daTag_ShopCamera_c::create() { - fopAcM_SetupActor(this, daTag_ShopCamera_c); + fopAcM_ct(this, daTag_ShopCamera_c); initialize(); return cPhs_COMPLEATE_e; } diff --git a/src/d/actor/d_a_tag_shop_item.cpp b/src/d/actor/d_a_tag_shop_item.cpp index 1351e1cb29b..2c40db08754 100644 --- a/src/d/actor/d_a_tag_shop_item.cpp +++ b/src/d/actor/d_a_tag_shop_item.cpp @@ -10,7 +10,7 @@ /* 80D60B78-80D60D78 000078 0200+00 1/1 0/0 0/0 .text create__16daTag_ShopItem_cFv */ int daTag_ShopItem_c::create() { - fopAcM_SetupActor(this, daTag_ShopItem_c); + fopAcM_ct(this, daTag_ShopItem_c); initialize(); field_0x572 = false; diff --git a/src/d/actor/d_a_tag_smk_emt.cpp b/src/d/actor/d_a_tag_smk_emt.cpp index 77a827557cc..2a969482fa8 100644 --- a/src/d/actor/d_a_tag_smk_emt.cpp +++ b/src/d/actor/d_a_tag_smk_emt.cpp @@ -18,7 +18,7 @@ daTagSmkEmt_c::~daTagSmkEmt_c() {} /* 80D61384-80D613DC 000124 0058+00 1/1 0/0 0/0 .text create__13daTagSmkEmt_cFv */ int daTagSmkEmt_c::create() { - fopAcM_SetupActor(this, daTagSmkEmt_c); + fopAcM_ct(this, daTagSmkEmt_c); createSmkEmt(); return cPhs_COMPLEATE_e; } @@ -70,7 +70,7 @@ void daTagSmkEmt_c::deleteSmkEmt() { /* 80D61544-80D61598 0002E4 0054+00 1/0 0/0 0/0 .text daTagSmkEmt_create__FP13daTagSmkEmt_c */ static int daTagSmkEmt_create(daTagSmkEmt_c* i_this) { - fopAcM_SetupActor(i_this, daTagSmkEmt_c); + fopAcM_ct(i_this, daTagSmkEmt_c); return i_this->create(); } diff --git a/src/d/actor/d_a_tag_spinner.cpp b/src/d/actor/d_a_tag_spinner.cpp index 070e17ae98d..4ffa50a2e62 100644 --- a/src/d/actor/d_a_tag_spinner.cpp +++ b/src/d/actor/d_a_tag_spinner.cpp @@ -55,7 +55,7 @@ int daTagSpinner_c::CreateHeap() { int daTagSpinner_c::create() { int iVar1; int iVar2; - fopAcM_SetupActor(this, daTagSpinner_c); + fopAcM_ct(this, daTagSpinner_c); if (!fopAcM_entrySolidHeap(this, CheckCreateHeap, 0)) { iVar2 = 5; diff --git a/src/d/actor/d_a_tag_sppath.cpp b/src/d/actor/d_a_tag_sppath.cpp index 351185f9251..0ae96d39dab 100644 --- a/src/d/actor/d_a_tag_sppath.cpp +++ b/src/d/actor/d_a_tag_sppath.cpp @@ -26,7 +26,7 @@ static dCcD_SrcCyl l_cylSrc = { /* 80D61C18-80D61DB8 000078 01A0+00 1/1 0/0 0/0 .text create__13daTagSppath_cFv */ int daTagSppath_c::create() { - fopAcM_SetupActor(this, daTagSppath_c); + fopAcM_ct(this, daTagSppath_c); mSwNo1 = fopAcM_GetParamBit(this, 8, 8); mSwNo2 = fopAcM_GetParamBit(this, 16, 8); diff --git a/src/d/actor/d_a_tag_spring.cpp b/src/d/actor/d_a_tag_spring.cpp index 2f4ebb0287c..414e834074f 100644 --- a/src/d/actor/d_a_tag_spring.cpp +++ b/src/d/actor/d_a_tag_spring.cpp @@ -28,7 +28,7 @@ int daTagSpring_c::Create() { /* 805A6AF4-805A6B5C 000114 0068+00 1/1 0/0 0/0 .text create__13daTagSpring_cFv */ int daTagSpring_c::create() { - fopAcM_SetupActor(this, daTagSpring_c); + fopAcM_ct(this, daTagSpring_c); if (!Create()) { return cPhs_ERROR_e; diff --git a/src/d/actor/d_a_tag_ss_drink.cpp b/src/d/actor/d_a_tag_ss_drink.cpp index 75f42d66e1a..5b545c280d9 100644 --- a/src/d/actor/d_a_tag_ss_drink.cpp +++ b/src/d/actor/d_a_tag_ss_drink.cpp @@ -13,7 +13,7 @@ /* 80D62DB8-80D62E5C 000078 00A4+00 1/1 0/0 0/0 .text create__15daTag_SSDrink_cFv */ int daTag_SSDrink_c::create() { - fopAcM_SetupActor(this, daTag_SSDrink_c); + fopAcM_ct(this, daTag_SSDrink_c); field_0x5D2 = getTypeFromParam(); setFlowNodeNumber(getFlowNodeNum()); setValueNumber(getValue()); diff --git a/src/d/actor/d_a_tag_statue_evt.cpp b/src/d/actor/d_a_tag_statue_evt.cpp index d5078e68751..04706d623cd 100644 --- a/src/d/actor/d_a_tag_statue_evt.cpp +++ b/src/d/actor/d_a_tag_statue_evt.cpp @@ -156,7 +156,7 @@ int daTagStatue_c::CreateHeap() { /* 805A7424-805A7514 000544 00F0+00 1/2 0/0 0/0 .text create__13daTagStatue_cFv */ cPhs__Step daTagStatue_c::create() { - fopAcM_SetupActor(this, daTagStatue_c); + fopAcM_ct(this, daTagStatue_c); mSkyCharacterEventBitIdIndex = fopAcM_GetParamBit(this, 8, 4); diff --git a/src/d/actor/d_a_tag_stream.cpp b/src/d/actor/d_a_tag_stream.cpp index edd2edd5b9d..691e5cf95c3 100644 --- a/src/d/actor/d_a_tag_stream.cpp +++ b/src/d/actor/d_a_tag_stream.cpp @@ -11,7 +11,7 @@ /* 80D638F8-80D63A78 000078 0180+00 1/1 0/0 0/0 .text create__13daTagStream_cFv */ int daTagStream_c::create() { - fopAcM_SetupActor(this, daTagStream_c); + fopAcM_ct(this, daTagStream_c); mPriority = fopAcM_GetParam(this) >> 8; mPower = fopAcM_GetParam(this); diff --git a/src/d/actor/d_a_tag_telop.cpp b/src/d/actor/d_a_tag_telop.cpp index 0e2e00259ce..c35896f94df 100644 --- a/src/d/actor/d_a_tag_telop.cpp +++ b/src/d/actor/d_a_tag_telop.cpp @@ -11,7 +11,7 @@ /* 80490A58-80490AF8 000078 00A0+00 1/1 0/0 0/0 .text create__13daTag_Telop_cFv */ int daTag_Telop_c::create() { - fopAcM_SetupActor(this, daTag_Telop_c); + fopAcM_ct(this, daTag_Telop_c); mMessageNo = getMessageNo(); diff --git a/src/d/actor/d_a_tag_wara_howl.cpp b/src/d/actor/d_a_tag_wara_howl.cpp index 00615d642f7..0d10532f5c8 100644 --- a/src/d/actor/d_a_tag_wara_howl.cpp +++ b/src/d/actor/d_a_tag_wara_howl.cpp @@ -18,7 +18,7 @@ daTagWrHowl_c::~daTagWrHowl_c() {} /* 80D63FD4-80D6402C 000114 0058+00 1/1 0/0 0/0 .text create__13daTagWrHowl_cFv */ int daTagWrHowl_c::create() { - fopAcM_SetupActor(this, daTagWrHowl_c); + fopAcM_ct(this, daTagWrHowl_c); init(); return cPhs_COMPLEATE_e; } @@ -69,7 +69,7 @@ bool daTagWrHowl_c::chkWlfInTag() { /* 80D64144-80D64198 000284 0054+00 1/0 0/0 0/0 .text daTagWrHowl_create__FP13daTagWrHowl_c */ static int daTagWrHowl_create(daTagWrHowl_c* i_this) { - fopAcM_SetupActor(i_this, daTagWrHowl_c); + fopAcM_ct(i_this, daTagWrHowl_c); return i_this->create(); } diff --git a/src/d/actor/d_a_tag_watchge.cpp b/src/d/actor/d_a_tag_watchge.cpp index 9e423b6e860..aa96ad07fdc 100644 --- a/src/d/actor/d_a_tag_watchge.cpp +++ b/src/d/actor/d_a_tag_watchge.cpp @@ -68,7 +68,7 @@ static int daTagWatchGe_Delete(daTagWatchGe_c* i_this) { /* 80D643F8-80D644B0 000198 00B8+00 1/1 0/0 0/0 .text create__14daTagWatchGe_cFv */ int daTagWatchGe_c::create() { - fopAcM_SetupActor(this, daTagWatchGe_c); + fopAcM_ct(this, daTagWatchGe_c); mGroupNo = fopAcM_GetParam(this); if (mGroupNo == 0xFF) { diff --git a/src/d/actor/d_a_tag_waterfall.cpp b/src/d/actor/d_a_tag_waterfall.cpp index 7adb958f6e2..f39549044ff 100644 --- a/src/d/actor/d_a_tag_waterfall.cpp +++ b/src/d/actor/d_a_tag_waterfall.cpp @@ -209,7 +209,7 @@ static int daTagWaterFall_Delete(daTagWaterFall_c* i_this) { /* 80D64B20-80D64CBC 0005E0 019C+00 1/1 0/0 0/0 .text create__16daTagWaterFall_cFv */ cPhs__Step daTagWaterFall_c::create() { - fopAcM_SetupActor(this, daTagWaterFall_c); + fopAcM_ct(this, daTagWaterFall_c); if (masterWaterfallTagExists == false) { masterWaterfallTagExists = true; diff --git a/src/d/actor/d_a_tag_wljump.cpp b/src/d/actor/d_a_tag_wljump.cpp index 9a464c7783d..a90a1dfec4b 100644 --- a/src/d/actor/d_a_tag_wljump.cpp +++ b/src/d/actor/d_a_tag_wljump.cpp @@ -8,7 +8,7 @@ /* 80D64EB8-80D64FE4 000078 012C+00 1/1 0/0 0/0 .text create__13daTagWljump_cFv */ int daTagWljump_c::create() { - fopAcM_SetupActor(this, daTagWljump_c); + fopAcM_ct(this, daTagWljump_c); field_0x571 = (fopAcM_GetParam(this) >> 8) & 0xFF; diff --git a/src/d/actor/d_a_tag_yami.cpp b/src/d/actor/d_a_tag_yami.cpp index c780c90e96d..848e32d93e5 100644 --- a/src/d/actor/d_a_tag_yami.cpp +++ b/src/d/actor/d_a_tag_yami.cpp @@ -26,7 +26,7 @@ const static dCcD_SrcCyl l_sph_src = { /* 80D659F8-80D65C24 000078 022C+00 1/1 0/0 0/0 .text create__11daTagYami_cFv */ int daTagYami_c::create() { - fopAcM_SetupActor(this, daTagYami_c); + fopAcM_ct(this, daTagYami_c); /* dSv_event_flag_c::F_0570 - Palace of Twilight - Cleared Palace of Twilight */ if (dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[570])) { diff --git a/src/d/actor/d_a_talk.cpp b/src/d/actor/d_a_talk.cpp index bbd59c3ea2c..35d47d3c643 100644 --- a/src/d/actor/d_a_talk.cpp +++ b/src/d/actor/d_a_talk.cpp @@ -16,7 +16,7 @@ daTalk_c::~daTalk_c() { /* 80D663E4-80D664AC 0000E4 00C8+00 1/1 0/0 0/0 .text create__8daTalk_cFv */ int daTalk_c::create() { - fopAcM_SetupActor(this, daTalk_c); + fopAcM_ct(this, daTalk_c); if (getStatus() != 1) { return cPhs_ERROR_e; diff --git a/src/d/actor/d_a_tbox.cpp b/src/d/actor/d_a_tbox.cpp index 8cce789e6d7..bf118c97508 100644 --- a/src/d/actor/d_a_tbox.cpp +++ b/src/d/actor/d_a_tbox.cpp @@ -1932,7 +1932,7 @@ int daTbox_c::Delete() { /* 80495CFC-80495E38 0050BC 013C+00 1/0 0/0 0/0 .text daTbox_create1st__FP8daTbox_c */ cPhs__Step daTbox_create1st(daTbox_c* i_this) { - fopAcM_SetupActor(i_this, daTbox_c); + fopAcM_ct(i_this, daTbox_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_tbox2.cpp b/src/d/actor/d_a_tbox2.cpp index 7c8d5cb9e7f..5fadbf7d8d1 100644 --- a/src/d/actor/d_a_tbox2.cpp +++ b/src/d/actor/d_a_tbox2.cpp @@ -142,7 +142,7 @@ int daTbox2_c::CreateHeap() { /* 80496E3C-80497080 00049C 0244+00 1/1 0/0 0/0 .text create1st__9daTbox2_cFv */ int daTbox2_c::create1st() { - fopAcM_SetupActor(this, daTbox2_c); + fopAcM_ct(this, daTbox2_c); mModelType = getModelType(); int phase_state = dComIfG_resLoad(&mPhase, l_arcName); @@ -462,7 +462,7 @@ int daTbox2_c::Delete() { /* 80497ED8-8049808C 001538 01B4+00 1/0 0/0 0/0 .text daTbox2_create1st__FP9daTbox2_c */ static int daTbox2_create1st(daTbox2_c* i_this) { - fopAcM_SetupActor(i_this, daTbox2_c); + fopAcM_ct(i_this, daTbox2_c); return i_this->create1st(); } diff --git a/src/d/actor/d_a_tboxSw.cpp b/src/d/actor/d_a_tboxSw.cpp index f3a1642ce82..c97c94aba08 100644 --- a/src/d/actor/d_a_tboxSw.cpp +++ b/src/d/actor/d_a_tboxSw.cpp @@ -16,7 +16,7 @@ int daTboxSw_c::Create() { /* 80D66860-80D668C8 000080 0068+00 1/1 0/0 0/0 .text create__10daTboxSw_cFv */ int daTboxSw_c::create() { - fopAcM_SetupActor(this, daTboxSw_c); + fopAcM_ct(this, daTboxSw_c); if (!Create()) { return cPhs_ERROR_e; diff --git a/src/d/actor/d_a_title.cpp b/src/d/actor/d_a_title.cpp index 84e53429e99..a3c49be95a3 100644 --- a/src/d/actor/d_a_title.cpp +++ b/src/d/actor/d_a_title.cpp @@ -107,7 +107,7 @@ int daTitle_c::CreateHeap() { /* 80D66CDC-80D66E7C 0002BC 01A0+00 1/1 0/0 0/0 .text create__9daTitle_cFv */ int daTitle_c::create() { - fopAcM_SetupActor(this, daTitle_c); + fopAcM_ct(this, daTitle_c); int phase_state = dComIfG_resLoad(&mPhaseReq, l_arcName); if (phase_state != cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_vrbox.cpp b/src/d/actor/d_a_vrbox.cpp index 960d1445e6a..9cf7e5f1782 100644 --- a/src/d/actor/d_a_vrbox.cpp +++ b/src/d/actor/d_a_vrbox.cpp @@ -136,7 +136,7 @@ static int daVrbox_solidHeapCB(fopAc_ac_c* i_this) { /* 804988DC-80498988 00043C 00AC+00 1/0 0/0 0/0 .text daVrbox_Create__FP10fopAc_ac_c */ static int daVrbox_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, vrbox_class); + fopAcM_ct(i_this, vrbox_class); vrbox_class* this_ = (vrbox_class*)i_this; this_->field_0x574 = 0; diff --git a/src/d/actor/d_a_vrbox2.cpp b/src/d/actor/d_a_vrbox2.cpp index 98762efa86b..f847e207f4b 100644 --- a/src/d/actor/d_a_vrbox2.cpp +++ b/src/d/actor/d_a_vrbox2.cpp @@ -433,7 +433,7 @@ static int daVrbox2_solidHeapCB(fopAc_ac_c* i_this) { /* 80499978-80499A1C 000F78 00A4+00 1/0 0/0 0/0 .text daVrbox2_Create__FP10fopAc_ac_c */ static int daVrbox2_Create(fopAc_ac_c* i_this) { - fopAcM_SetupActor(i_this, vrbox2_class); + fopAcM_ct(i_this, vrbox2_class); int phase = cPhs_COMPLEATE_e; if (!fopAcM_entrySolidHeap(i_this, daVrbox2_solidHeapCB, 0x80004340)) { diff --git a/src/d/actor/d_a_warp_bug.cpp b/src/d/actor/d_a_warp_bug.cpp index 91900370c14..60ac8748573 100644 --- a/src/d/actor/d_a_warp_bug.cpp +++ b/src/d/actor/d_a_warp_bug.cpp @@ -147,7 +147,7 @@ static int daWarpBug_Delete(daWarpBug_c* i_this) { } int daWarpBug_c::create() { - fopAcM_SetupActor(this, daWarpBug_c); + fopAcM_ct(this, daWarpBug_c); int phase = dComIfG_resLoad(&mPhase, l_arcName); if (phase == cPhs_COMPLEATE_e) { diff --git a/src/d/actor/d_a_ykgr.cpp b/src/d/actor/d_a_ykgr.cpp index 687205199b5..e66c71a730c 100644 --- a/src/d/actor/d_a_ykgr.cpp +++ b/src/d/actor/d_a_ykgr.cpp @@ -127,7 +127,7 @@ static dPa_YkgrPcallBack YkgrCB; /* 805A882C-805A8A48 00048C 021C+00 1/0 0/0 0/0 .text daYkgrCreate__FPv */ inline int daYkgr_c::_create() { int uVar1 = u8((fopAcM_GetParam(this) & 0x00F00000) >> 0x14); - fopAcM_SetupActor(this, daYkgr_c); + fopAcM_ct(this, daYkgr_c); u8 uVar4 = (fopAcM_GetParam(this) & 0x0000FF00) >> 8; OS_REPORT("pathNo = %d\n", uVar4); if (uVar4 != 0xff) { diff --git a/src/d/d_debug_pad.h b/src/d/d_debug_pad.h new file mode 100644 index 00000000000..a9f43ea5f43 --- /dev/null +++ b/src/d/d_debug_pad.h @@ -0,0 +1,11 @@ +#ifndef D_DEBUG_PAD_H +#define D_DEBUG_PAD_H + +class dDebugPad_c { +public: + bool Active(); +}; + +extern dDebugPad_c dDebugPad; + +#endif diff --git a/src/d/d_debug_viewer.cpp b/src/d/d_debug_viewer.cpp index d9646c2798f..9f734dc3559 100644 --- a/src/d/d_debug_viewer.cpp +++ b/src/d/d_debug_viewer.cpp @@ -1,19 +1,13 @@ #include "d/dolzel.h" // IWYU pragma: keep #include "d/d_debug_viewer.h" +#include "d/d_debug_pad.h" #include "d/d_com_inf_game.h" #include "f_ap/f_ap_game.h" #include "JSystem/J3DGraphBase/J3DDrawBuffer.h" #include "JSystem/JUtility/JUTDbPrint.h" #include "JSystem/JUtility/JUTReport.h" -class dDebugPad_c { -public: - bool Active(); -}; - -extern dDebugPad_c dDebugPad; - J3DPacket* l_drawPacketList[1000]; int l_drawPacketListNum; diff --git a/src/d/d_eye_hl.cpp b/src/d/d_eye_hl.cpp index a2512a41b7e..8af36ed8da1 100644 --- a/src/d/d_eye_hl.cpp +++ b/src/d/d_eye_hl.cpp @@ -45,7 +45,7 @@ dEyeHL_c* dEyeHL_mng_c::m_obj; void dEyeHL_mng_c::update() { dEyeHL_c* obj = m_obj; - if (g_envHIO.mOther.mLODBias == 0 || !dComIfGp_event_runCheck()) { + if (g_envHIO.mOther.mAdjustLODBias == 0 || !dComIfGp_event_runCheck()) { for (; obj != NULL; obj = obj->m_next) { obj->m_timg->LODBias = obj->m_lodBias; } diff --git a/src/d/d_s_logo.cpp b/src/d/d_s_logo.cpp index c00237d690c..4709adc5284 100644 --- a/src/d/d_s_logo.cpp +++ b/src/d/d_s_logo.cpp @@ -579,7 +579,7 @@ static int phase_1(dScnLogo_c* i_this) { } #if VERSION == VERSION_GCN_PAL - if (!SyncWidthSound) { + if (!mDoDvdThd::SyncWidthSound) { return cPhs_INIT_e; } diff --git a/src/d/d_s_play.cpp b/src/d/d_s_play.cpp index 7851349f0ab..92bd1ccbc77 100644 --- a/src/d/d_s_play.cpp +++ b/src/d/d_s_play.cpp @@ -88,8 +88,8 @@ static const s16 T_JOINT_dylKeyTbl[1] = { /* 80259440-80259468 253D80 0028+00 1/1 0/0 0/0 .text __ct__22dScnPly_env_otherHIO_cFv */ dScnPly_env_otherHIO_c::dScnPly_env_otherHIO_c() { mShadowDensity = 255.0f; - mLODBias = 1; - mDispTransCylinder = false; + mAdjustLODBias = 1; + mDisplayTransparentCyl = false; } void dScnPly_env_otherHIO_c::genMessage(JORMContext* ctx) { diff --git a/src/f_ap/f_ap_game.cpp b/src/f_ap/f_ap_game.cpp index 198253afa58..b92d220f017 100644 --- a/src/f_ap/f_ap_game.cpp +++ b/src/f_ap/f_ap_game.cpp @@ -5,10 +5,21 @@ #include "f_op/f_op_overlap_mng.h" #include "f_op/f_op_scene_mng.h" #include "m_Do/m_Do_main.h" +#include "m_Do/m_Do_graphic.h" +#include "DynamicLink.h" +#include "JSystem/JKernel/JKRSolidHeap.h" +#include "JSystem/JKernel/JKRAram.h" +#include "JSystem/JKernel/JKRAramArchive.h" +#include "JSystem/JUtility/JUTDbPrint.h" +#include "JSystem/JHostIO/JORFile.h" +#include "JSystem/J3DGraphLoader/J3DModelLoader.h" +#include "JSystem/J3DGraphLoader/J3DModelSaver.h" +#include "d/actor/d_a_alink.h" +#include "d/actor/d_a_midna.h" +#include "d/d_model.h" +#include "d/actor/d_a_grass.h" -fapGm_HIO_c::fapGm_HIO_c() - : mColor(-1), mLetterTopColor(-1), mLetterBottomColor(-1), mLetterTopShadowColor(-1), - mLetterBottomShadowColor(-1) { +fapGm_HIO_c::fapGm_HIO_c() { mUsingHostIO = true; if (mDoMain::developmentMode) { @@ -24,21 +35,689 @@ fapGm_HIO_c::fapGm_HIO_c() mDisplayParticle = true; mDisplayProcessID = false; mMemBlockOff = false; - mColor.set(255, 255, 255, 255); + + mColor = JUtility::TColor(255, 255, 255, 255); + mLROnValue = 0.9f; mLROffValue = 0.6f; - mLetterTopColor.set(255, 150, 0, 255); - mLetterBottomColor.set(255, 120, 0, 255); - mLetterTopShadowColor.set(0, 0, 0, 255); - mLetterBottomShadowColor.set(0, 0, 0, 255); + + mLetterTopColor = JUtility::TColor(255, 150, 0, 255); + mLetterBottomColor = JUtility::TColor(255, 120, 0, 255); + mLetterTopShadowColor = JUtility::TColor(0, 0, 0, 255); + mLetterBottomShadowColor = JUtility::TColor(0, 0, 0, 255); + mLetterPositionX = 0; mLetterPositionY = 10; mLetterFontSize = 27; mLineSpacing = 0; mLetterSpacing = 0; mBackgroundAlpha = 130; + +#if DEBUG + mTrapFilter = 0; + mGammaCorrection = 10; +#endif } +#if DEBUG +static u8 data_8073f6e8 = 1; +static u8 data_8073f6e9 = 1; +static u8 data_8073f6ea = 1; +static u8 data_8073f6eb = 1; + +CaptureScreen* fapGm_HIO_c::mCaptureScreen; +void* fapGm_HIO_c::mCaptureScreenBuffer; +s16 fapGm_HIO_c::mCaptureScreenFlag; +u16 fapGm_HIO_c::mCaptureScreenWidth; +u16 fapGm_HIO_c::mCaptureScreenHeight; +u16 fapGm_HIO_c::mCaptureScreenLinePf; +u16 fapGm_HIO_c::mCaptureScreenLineNum; +u8 fapGm_HIO_c::mCaptureScreenNumH; +u8 fapGm_HIO_c::mCaptureScreenNumV; + +u8 fapGm_HIO_c::mParticle254Fix; +#endif + +#if DEBUG +void fapGm_HIO_c::genMessage(JORMContext* mctx) { + mctx->genButton("警告消去", 0x4000020, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genButton("BMPキャプチャー", 0x4000003, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider("BMPキャプチャー倍率", &data_8073f6e8, 1, 8, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genButton("スナップショット", 0x4000002, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genButton("CPU時間", 0x4000007, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genCheckBox("ホストIO使用", &mUsingHostIO, 1, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genCheckBox("メーター表示(JUTProcBar)", &mDisplayMeter, 1, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genCheckBox("プリント表示(JUTDbPrint)", &mDisplayPrint, 1, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genCheckBox("2D表示", &mDisplay2D, 1, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genCheckBox("パーティクル表示", &mDisplayParticle, 1, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genCheckBox("パーティクル254固定", &mParticle254Fix, 1, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genCheckBox("パックアーカイブモード", &data_8073f6eb, 1, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + + mctx->genLabel("−−−−−−−【プリント】−−−−−−−", 0x4000001, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider(" 色 R", &mColor.r, 0, 0xFF, 0x4000010, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider(" G", &mColor.g, 0, 0xFF, 0x4000011, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider(" B", &mColor.b, 0, 0xFF, 0x4000012, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider(" A", &mColor.a, 0, 0xFF, 0x4000013, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + + mctx->genLabel("−−−−−−−【情報関係】−−−−−−−", 0x4000001, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genButton("空きメモリ", 0x4000005, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genCheckBox("プロセスID表示", &mDisplayProcessID, 1, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genCheckBox("トラップフィルター", &mTrapFilter, 1, 0, NULL, 0xFFFF, 0xFFFF, + 0x200, 0x18); + + mctx->startComboBox("ガンマ補正係数", &mGammaCorrection, 0, NULL, 0xFFFF, 0xFFFF, 0x100, 0x1a); + mctx->genComboBoxItem("0.1", 1); + mctx->genComboBoxItem("0.2", 2); + mctx->genComboBoxItem("0.3", 3); + mctx->genComboBoxItem("0.4", 4); + mctx->genComboBoxItem("0.5", 5); + mctx->genComboBoxItem("0.6", 6); + mctx->genComboBoxItem("0.7", 7); + mctx->genComboBoxItem("0.8", 8); + mctx->genComboBoxItem("0.9", 9); + mctx->genComboBoxItem("1.0", 10); + mctx->genComboBoxItem("1.1", 11); + mctx->genComboBoxItem("1.2", 12); + mctx->genComboBoxItem("1.3", 13); + mctx->genComboBoxItem("1.4", 14); + mctx->genComboBoxItem("1.5", 15); + mctx->genComboBoxItem("1.6", 16); + mctx->genComboBoxItem("1.7", 17); + mctx->genComboBoxItem("1.8", 18); + mctx->genComboBoxItem("1.9", 19); + mctx->genComboBoxItem("2.0", 20); + mctx->genComboBoxItem("2.1", 21); + mctx->genComboBoxItem("2.2", 22); + mctx->genComboBoxItem("2.3", 23); + mctx->genComboBoxItem("2.4", 24); + mctx->genComboBoxItem("2.5", 25); + mctx->genComboBoxItem("2.6", 26); + mctx->genComboBoxItem("2.7", 27); + mctx->genComboBoxItem("2.8", 28); + mctx->genComboBoxItem("2.9", 29); + mctx->genComboBoxItem("3.0", 30); + mctx->endComboBox(); + + mctx->genLabel("−−−−−−−【肩ボタン】−−−−−−−", 0x4000001, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider(" しきい値 オン", &g_HIO.mLROnValue, 0.0f, 1.0f, 0, NULL, 0xFFFF, 0xFFFF, + 0x200, 0x18); + mctx->genSlider(" オフ", &g_HIO.mLROffValue, 0.0f, 1.0f, 0, NULL, 0xFFFF, 0xFFFF, + 0x200, 0x18); + + mctx->genLabel("−−−−−−−【デバッグ用】−−−−−−", 0x4000001, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genCheckBox("メモリーブロックOFF", &mMemBlockOff, 1, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + + mctx->genLabel("−−−−−−−【システムレジスタ】−−−", 0x4000001, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider("レジスタ0", &mRegister0, -0x8000, 0x7fff, 0, NULL, 0xFFFF, 0xFFFF, + 0x200, 0x18); + mctx->genSlider("レジスタ1", &mRegister1, -0x8000, 0x7fff, 0, NULL, 0xFFFF, 0xFFFF, + 0x200, 0x18); + mctx->genSlider("レジスタ2", &mRegister2, -0x8000, 0x7fff, 0, NULL, 0xFFFF, 0xFFFF, + 0x200, 0x18); + mctx->genSlider("レジスタ3", &mRegister3, -0x8000, 0x7fff, 0, NULL, 0xFFFF, 0xFFFF, + 0x200, 0x18); + + mctx->genLabel("−−−−−−−【BDLファイルへの変換】", 0x4000001, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genButton("変換", 0x4000014, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + + mctx->genLabel("−−−−−−−【メモリファイル】−", 0x4000001, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genButton("出力", 0x4000016, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + + mctx->genLabel("−−−−−−−【エラーメッセージ】−", 0x4000001, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider("文字色上r", &mLetterTopColor.r, 0, 0xFF, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider("文字色上g", &mLetterTopColor.g, 0, 0xFF, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider("文字色上b", &mLetterTopColor.b, 0, 0xFF, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider("文字色上α", &mLetterTopColor.a, 0, 0xFF, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + + mctx->genSlider("文字色下r", &mLetterBottomColor.r, 0, 0xFF, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider("文字色下g", &mLetterBottomColor.g, 0, 0xFF, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider("文字色下b", &mLetterBottomColor.b, 0, 0xFF, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider("文字色下α", &mLetterBottomColor.a, 0, 0xFF, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + + mctx->genSlider("文字位置X", &mLetterPositionX, -300, 300, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider("文字位置Y", &mLetterPositionY, -300, 300, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider("文字行間", &mLineSpacing, -10, 10, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider("文字字間", &mLetterSpacing, -10, 10, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider("文字フォントサイズ", &mLetterFontSize, 0, 0x32, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + + mctx->genSlider("文字色影上r", &mLetterTopShadowColor.r, 0, 0xFF, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider("文字色影上g", &mLetterTopShadowColor.g, 0, 0xFF, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider("文字色影上b", &mLetterTopShadowColor.b, 0, 0xFF, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider("文字色影上α", &mLetterTopShadowColor.a, 0, 0xFF, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + + mctx->genSlider("文字色影下r", &mLetterBottomShadowColor.r, 0, 0xFF, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider("文字色影下g", &mLetterBottomShadowColor.g, 0, 0xFF, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider("文字色影下b", &mLetterBottomShadowColor.b, 0, 0xFF, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider("文字色影下α", &mLetterBottomShadowColor.a, 0, 0xFF, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + + mctx->genSlider("背景α", &mBackgroundAlpha, 0, 0xFF, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); +} + +char fapGm_dataMem::mCsv[0x8000]; + +int dumpTagObject(void* i_object, void*) { + char profname_str[64]; + s16 profname = fopAcM_GetProfName(i_object); + sprintf(profname_str, "%d", profname); + + if (fopAcM_IsActor(i_object)) { + fopAc_ac_c* a_actor = (fopAc_ac_c*)i_object; + + const char* actorname = dStage_getName(profname, -1); + fapGm_dataMem::printfTag(fapGm_dataMem::TagAtt_Fixed_e, fapGm_dataMem::TagType_Object_e, 0, profname_str, a_actor, NULL, *actorname == 0 ? NULL : actorname, NULL); + + if (a_actor->heap != NULL) { + fapGm_dataMem::printfTag(fapGm_dataMem::TagAtt_Fixed_e, fapGm_dataMem::TagType_Object_e, 0, profname_str, a_actor->heap, NULL, actorname, NULL); + } + + u32 other_heap_size = 0; + if (profname == PROC_ALINK) { + fopAc_ac_c* spC = a_actor; + other_heap_size = daAlink_c::getOtherHeapSize(); + } else if (profname == PROC_MIDNA) { + fopAc_ac_c* sp8 = a_actor; + other_heap_size = daMidna_c::getOtherHeapSize(); + } + + if (other_heap_size != 0) { + fapGm_dataMem::printfTag(fapGm_dataMem::TagAtt_Fixed_e, fapGm_dataMem::TagType_Object_e, 6, profname_str, NULL, other_heap_size, NULL, NULL); + } + } else { + fapGm_dataMem::printfTag(fapGm_dataMem::TagAtt_Fixed_e, fapGm_dataMem::TagType_Object_e, 0, profname_str, i_object, NULL, NULL, NULL); + } + + return 1; +} + +int dumpObject(void* i_object, void* i_data) { + char* csv = (char*)i_data; + csv += strlen(csv); + + if (fopAcM_IsActor(i_object)) { + fopAc_ac_c* a_actor = (fopAc_ac_c*)i_object; + + s16 profname = fopAcM_GetProfName(a_actor); + const char* actor_name = dStage_getName(profname, -1); + u32 actor_size = a_actor->base.base.profile->process_size + (a_actor->heap == NULL ? 0 : a_actor->heap->getHeapSize()); + + u32 other_heap_size = 0; + if (profname == PROC_ALINK) { + fopAc_ac_c* sp24 = a_actor; + other_heap_size = daAlink_c::getOtherHeapSize(); + } else if (profname == PROC_MIDNA) { + fopAc_ac_c* sp20 = a_actor; + other_heap_size = daMidna_c::getOtherHeapSize(); + } + + sprintf(csv, ",%s(%d),%d,\n", actor_name != NULL ? actor_name : "???", profname, actor_size); + + if (other_heap_size != 0) { + csv += strlen(csv); + sprintf(csv, ",%s-Buffer(%d),%d,\n", actor_name != NULL ? actor_name : "???", profname, other_heap_size); + } + } else { + s16 profname = fpcM_GetProfName(i_object); + u32 process_size = ((base_process_class*)i_object)->profile->process_size; + sprintf(csv, ",no actor(%d),%d,\n", profname, process_size); + } + + return 1; +} + +void fapGm_dataMem::printfTag(int i_att, int i_type, int i_heapType, const char* i_label, void* i_object, u32 i_otherHeapSize, const char* i_actorName, const char* param_7) { + static const char* l_heapString[] = { + "error", + "aram", + "root_heap", + "system_heap", + "zelda_heap", + "archive_heap", + "game_heap", + "command_heap", + "stage_heap", + "j2d_heap", + "dynamic_heap", + }; + + static const char* l_attString[] = { + "fixed", + "variable", + }; + + static const char* l_typeString[] = { + "audio", + "particle", + "system", + "unknown", + "message", + "2d", + "player", + "archive", + "archive-sub", + "archive-stage", + "archive-stage-sub", + "program", + "object", + "stage", + NULL, + }; + + if (i_type < TagType_Heap_e) { + if (i_object != NULL) { + i_heapType = fapGm_dataMem::findParentHeap(i_object); + if (i_otherHeapSize == 0) { + i_otherHeapSize = JKRGetMemBlockSize(NULL, i_object); + } + } + + sprintf(fapGm_dataMem::getCsvEnd(), "%s\t%d\t%s\t%s", l_heapString[i_heapType], i_otherHeapSize, l_attString[i_att], l_typeString[i_type]); + + if (i_label != NULL) { + sprintf(fapGm_dataMem::getCsvEnd(), "\t%s", i_label); + if (i_actorName != NULL) { + sprintf(fapGm_dataMem::getCsvEnd(), "\t%s", i_actorName); + if (param_7 != NULL) { + sprintf(fapGm_dataMem::getCsvEnd(), "\t%s", param_7); + } + } + } + + sprintf(fapGm_dataMem::getCsvEnd(), "\n"); + } else if (i_type == TagType_Heap_e) { + u32 heap_size; + int is_product = 0; + u32 total_free_size; + if (i_heapType == HeapType_ARAM_e) { + heap_size = 0x1000000; + total_free_size = JKRGetAramTotalFreeSize(); + is_product = 1; + } else if (i_heapType == HeapType_Stage_e) { + heap_size = i_otherHeapSize; + total_free_size = 0; + } else { + JKRHeap* heap = (JKRHeap*)i_object; + heap_size = heap->getHeapSize(); + total_free_size = heap->getTotalFreeSize(); + + if (i_heapType == HeapType_Archive_e) { + u32 temp_r24 = heap_size - mDoMain::archiveHeapSize; + heap_size -= temp_r24; + total_free_size -= temp_r24; + is_product = 1; + } else if (i_heapType == HeapType_Game_e) { + u32 temp_r23 = heap_size - mDoMain::gameHeapSize; + heap_size -= temp_r23; + total_free_size -= temp_r23; + is_product = 1; + } else if (i_heapType == HeapType_Command_e) { + is_product = 1; + } else if (i_heapType == HeapType_J2D_e) { + is_product = 1; + } else if (i_heapType == HeapType_Dynamic_e) { + is_product = 1; + } + } + + static const char* l_heapAllString[] = { + "all", + "product-all", + }; + + static const char* l_heapRestString[] = { + "rest", + "product-rest", + }; + + sprintf(fapGm_dataMem::getCsvEnd(), "%s\t%d\t%s\n", l_heapString[i_heapType], heap_size, l_heapAllString[is_product]); + sprintf(fapGm_dataMem::getCsvEnd(), "%s\t%d\t%s\n", l_heapString[i_heapType], total_free_size, l_heapRestString[is_product]); + } +} + +int fapGm_dataMem::findParentHeap(void* i_object) { + JKRHeap* heap = JKRHeap::findFromRoot(i_object); + if (heap == NULL) { + return NULL; + } + + if (heap == heap->getRootHeap()) { + return HeapType_Root_e; + } else if (heap == JKRGetSystemHeap()) { + return HeapType_System_e; + } else if (heap == mDoExt_getGameHeap()) { + return HeapType_Game_e; + } else if (heap == mDoExt_getArchiveHeap()) { + return HeapType_Archive_e; + } else if (heap == mDoExt_getJ2dHeap()) { + return HeapType_J2D_e; + #if PLATFORM_WII || PLATFORM_SHIELD + } else if (heap == DynamicModuleControlBase::getHeap()) { + return HeapType_Dynamic_e; + #endif + } else if (heap == mDoExt_getZeldaHeap()) { + return HeapType_Zelda_e; + } + + for (int i = 0; i < 19; i++) { + if (heap == dStage_roomControl_c::getMemoryBlockHeap(i)) { + return HeapType_Stage_e; + } + } + + return findParentHeap(heap); +} + +void fapGm_dataMem::dumpTag() { + *mCsv = 0; + + printfTag(TagAtt_Fixed_e, TagType_Heap_e, HeapType_Root_e, NULL, JKRHeap::getRootHeap(), 0, NULL, NULL); + printfTag(TagAtt_Fixed_e, TagType_Heap_e, HeapType_System_e, NULL, JKRGetSystemHeap(), 0, NULL, NULL); + printfTag(TagAtt_Fixed_e, TagType_Heap_e, HeapType_Zelda_e, NULL, mDoExt_getZeldaHeap(), 0, NULL, NULL); + printfTag(TagAtt_Variable_e, TagType_Heap_e, HeapType_Archive_e, NULL, mDoExt_getArchiveHeap(), 0, NULL, NULL); + printfTag(TagAtt_Variable_e, TagType_Heap_e, HeapType_J2D_e, NULL, mDoExt_getJ2dHeap(), 0, NULL, NULL); + #if PLATFORM_WII || PLATFORM_SHIELD + printfTag(TagAtt_Variable_e, TagType_Heap_e, HeapType_Dynamic_e, NULL, DynamicModuleControlBase::getHeap(), 0, NULL, NULL); + #endif + printfTag(TagAtt_Variable_e, TagType_Heap_e, HeapType_Game_e, NULL, mDoExt_getGameHeap(), 0, NULL, NULL); + printfTag(TagAtt_Variable_e, TagType_Heap_e, HeapType_Command_e, NULL, mDoExt_getCommandHeap(), 0, NULL, NULL); + printfTag(TagAtt_Variable_e, TagType_Heap_e, HeapType_ARAM_e, NULL, NULL, 0, NULL, NULL); + printfTag(TagAtt_Variable_e, TagType_Audio_e, 0, "オーディオ", g_mDoAud_audioHeap, 0x169000, NULL, NULL); + printfTag(TagAtt_Variable_e, TagType_Particle_e, 0, "パーティクルアーカイブ", g_dComIfG_gameInfo.play.getParticle()->getResHeap(), 0, NULL, NULL); + printfTag(TagAtt_Variable_e, TagType_Particle_e, 0, "パーティクル(常駐)", g_dComIfG_gameInfo.play.getParticle()->getHeap(), 0, NULL, NULL); + printfTag(TagAtt_Fixed_e, TagType_Particle_e, 0, "パーティクル(ステージ)", g_dComIfG_gameInfo.play.getParticle()->getSceneHeap(), 0, NULL, NULL); + printfTag(TagAtt_Variable_e, TagType_System_e, HeapType_System_e, "グラフィックFIFO", NULL, 0xA0000, 0, NULL); + #if PLATFORM_WII || PLATFORM_SHIELD + printfTag(TagAtt_Variable_e, TagType_System_e, 0, "グラフィック関係バッファ", mDoGph_gInf_c::getHeap(), 0, NULL, NULL); + #endif + + if (mDoGph_gInf_c::getBloom()->getBuffer() != NULL) { + printfTag(TagAtt_Fixed_e, TagType_System_e, 0, "飽和加算用バッファ", mDoGph_gInf_c::getBloom()->getBuffer(), NULL, 0, NULL); + } + + if (dComIfGp_getSimpleModel() != NULL) { + printfTag(TagAtt_Variable_e, TagType_System_e, 0, "シンプルモデルバッファ", dComIfGp_getSimpleModel(), NULL, 0, NULL); + } + + if (dMdl_mng_c::m_myObj != NULL) { + printfTag(TagAtt_Variable_e, TagType_System_e, 0, "節約モデルバッファ", dMdl_mng_c::m_myObj, NULL, 0, NULL); + } + + if (daGrass_c::getGrass() != NULL) { + printfTag(TagAtt_Fixed_e, TagType_System_e, 0, "草バッファ", daGrass_c::getGrass(), NULL, 0, NULL); + } + + if (daGrass_c::getFlower() != NULL) { + printfTag(TagAtt_Fixed_e, TagType_System_e, 0, "花バッファ", daGrass_c::getFlower(), NULL, 0, NULL); + } + + if (dTres_c::getTypeGroupData() != NULL) { + printfTag(TagAtt_Variable_e, TagType_System_e, 0, "常駐宝箱バッファ", (char*)dTres_c::getTypeGroupData() - 16, NULL, 0, NULL); + } + + if (dComIfGp_getAttention()->getHeap() != NULL) { + printfTag(TagAtt_Variable_e, TagType_System_e, 0, "注目処理用バッファ", dComIfGp_getAttention()->getHeap(), NULL, 0, NULL); + } + + printfTag(TagAtt_Variable_e, TagType_2D_e, 0, "2D転送用", dComIfGp_getExpHeap2D(), JKRGetMemBlockSize(NULL, dComIfGp_getExpHeap2D()) + JKRGetMemBlockSize(NULL, dComIfGp_getMsgExpHeap()), 0, NULL); + printfTag(TagAtt_Variable_e, TagType_Message_e, 0, "メッセージデータ(常駐)", ((JKRAramArchive*)dComIfGp_getMsgDtArchive())->mBlock, NULL, 0, NULL); + printfTag(TagAtt_Fixed_e, TagType_Message_e, 0, "メッセージデータ(ステージ)", ((JKRAramArchive*)dComIfGp_getMsgDtArchive(1))->mBlock, NULL, 0, NULL); + printfTag(TagAtt_Variable_e, TagType_2D_e, 0, "メーター関係", ((JKRAramArchive*)dComIfGp_getMain2DArchive())->mBlock, NULL, 0, NULL); + printfTag(TagAtt_Variable_e, TagType_System_e, 0, "アイテム出現テーブル", dComIfGp_getItemTable(), NULL, 0, NULL); + printfTag(TagAtt_Variable_e, TagType_Message_e, HeapType_Zelda_e, "キャッシュフォントバッファ", NULL, JKRGetMemBlockSize(NULL, ((JKRAramArchive*)dComIfGp_getRubyArchive())->mBlock) + 0x1C328, 0, NULL); + printfTag(TagAtt_Variable_e, TagType_Audio_e, HeapType_ARAM_e, "オーディオ", NULL, 0xB00000, 0, NULL); + printfTag(TagAtt_Variable_e, TagType_Player_e, HeapType_ARAM_e, "リンクアニメーション", NULL, ((JKRAramArchive*)dComIfGp_getAnmArchive())->mBlock->getSize(), 0, NULL); + printfTag(TagAtt_Variable_e, TagType_2D_e, HeapType_ARAM_e, "フィールドマップレイアウト", NULL, ((JKRAramArchive*)dComIfGp_getFmapResArchive())->mBlock->getSize(), 0, NULL); + printfTag(TagAtt_Variable_e, TagType_2D_e, HeapType_ARAM_e, "フィールドマップデータ", NULL, ((JKRAramArchive*)dComIfGp_getFieldMapArchive2())->mBlock->getSize(), 0, NULL); + printfTag(TagAtt_Variable_e, TagType_2D_e, HeapType_ARAM_e, "ダンジョンマップレイアウト", NULL, ((JKRAramArchive*)dComIfGp_getDmapResArchive())->mBlock->getSize(), 0, NULL); + printfTag(TagAtt_Variable_e, TagType_2D_e, HeapType_ARAM_e, "コレクト&セーブ&オプション", NULL, ((JKRAramArchive*)dComIfGp_getCollectResArchive())->mBlock->getSize(), 0, NULL); + printfTag(TagAtt_Variable_e, TagType_2D_e, HeapType_ARAM_e, "リングアイテム選択", NULL, ((JKRAramArchive*)dComIfGp_getRingResArchive())->mBlock->getSize(), 0, NULL); + printfTag(TagAtt_Variable_e, TagType_2D_e, HeapType_ARAM_e, "アイテムアイコン", NULL, ((JKRAramArchive*)dComIfGp_getItemIconArchive())->mBlock->getSize(), 0, NULL); + printfTag(TagAtt_Variable_e, TagType_2D_e, HeapType_ARAM_e, "アイテム説明画面", NULL, ((JKRAramArchive*)dComIfGp_getDemoMsgArchive())->mBlock->getSize(), 0, NULL); + printfTag(TagAtt_Variable_e, TagType_2D_e, HeapType_ARAM_e, "強調ボタン表示", NULL, ((JKRAramArchive*)dComIfGp_getMeterButtonArchive())->mBlock->getSize(), 0, NULL); + printfTag(TagAtt_Variable_e, TagType_Message_e, HeapType_ARAM_e, "フキダシ共通2Dデータ", NULL, ((JKRAramArchive*)dComIfGp_getMsgCommonArchive())->mBlock->getSize(), 0, NULL); + printfTag(TagAtt_Variable_e, TagType_Message_e, HeapType_ARAM_e, "キャッシュフォント", NULL, mDoExt_getAraCacheSize(), 0, NULL); + + for (int i = 0; i < 6; i++) { + char label[64]; + sprintf(label, "メッセージ(%d)枠ほか", i); + printfTag(TagAtt_Variable_e, TagType_Message_e, HeapType_ARAM_e, label, NULL, ((JKRAramArchive*)dComIfGp_getMsgArchive(i))->mBlock->getSize(), 0, NULL); + } + + g_dComIfG_gameInfo.mResControl.dumpTag(); + u32 var_r28 = 0; + + for (int i = 0; i < 19; i++) { + JKRExpHeap* memblock = dStage_roomControl_c::getMemoryBlockHeap(i); + if (memblock != NULL) { + var_r28 += memblock->getHeapSize(); + } + } + + if (var_r28 != NULL) { + printfTag(TagAtt_Fixed_e, TagType_Stage_e, 0, "ステージメモリーブロック", dStage_roomControl_c::getMemoryBlockHeap(0), var_r28, 0, NULL); + printfTag(TagAtt_Fixed_e, TagType_Heap_e, HeapType_Stage_e, NULL, NULL, var_r28, 0, NULL); + } + + DynamicModuleControlBase::dumpTag(); + fpcLyIt_All(dumpTagObject, mCsv); +} + +void fapGm_dataMem::dumpCsv() { + sprintf(mCsv, "メインメモリ,,,\n"); + sprintf(getCsvEnd(), ",,,最大サイズ,空きサイズ\n"); + sprintf(getCsvEnd(), ",システムヒープ,%d,%d,%d,\n\n", ((JKRExpHeap*)JKRGetSystemHeap())->getTotalUsedSize(), JKRGetSystemHeap()->getHeapSize(), JKRGetSystemHeap()->getFreeSize()); + sprintf(getCsvEnd(), ",ゼルダヒープ,%d,%d,%d,\n", mDoExt_getZeldaHeap()->getTotalUsedSize(), mDoExt_getZeldaHeap()->getHeapSize(), mDoExt_getZeldaHeap()->getFreeSize()); + sprintf(getCsvEnd(), ",オーディオメモリ,%d,\n", 0x169000); + sprintf(getCsvEnd(), ",パーティクルメモリ(常駐),%d,\n", g_dComIfG_gameInfo.play.getParticle()->getHeap()->getHeapSize()); + sprintf(getCsvEnd(), ",パーティクルメモリ(シーン依存),%d,\n", g_dComIfG_gameInfo.play.getParticle()->getSceneHeap()->getHeapSize()); + sprintf(getCsvEnd(), ",グラフィックFIFO,%d,\n", 0xA0000); + sprintf(getCsvEnd(), ",フレームバッファ,%d,\n", mDoGph_gInf_c::getFrameBufferSize() * 2); + sprintf(getCsvEnd(), ",フレームバッファテクスチャー,%d,\n", 0x70820); + sprintf(getCsvEnd(), ",2D転送用ヒープ,%d,\n", dComIfGp_getExpHeap2D()->getHeapSize() + dComIfGp_getMsgExpHeap()->getHeapSize()); + sprintf(getCsvEnd(), ",アーカイブヒープ,%d,%d,%d,\n\n", mDoExt_getArchiveHeap()->getTotalUsedSize(), mDoExt_getArchiveHeap()->getHeapSize(), mDoExt_getArchiveHeap()->getFreeSize()); + sprintf(getCsvEnd(), ",メッセージデータ(常駐),%d,\n", JKRGetMemBlockSize(NULL, ((JKRAramArchive*)dComIfGp_getMsgDtArchive())->mBlock)); + sprintf(getCsvEnd(), ",メッセージデータ(ステージ読み),%d,\n", JKRGetMemBlockSize(NULL, ((JKRAramArchive*)dComIfGp_getMsgDtArchive(1))->mBlock)); + sprintf(getCsvEnd(), ",メーター関係,%d,\n", JKRGetMemBlockSize(NULL, ((JKRAramArchive*)dComIfGp_getMain2DArchive())->mBlock)); + sprintf(getCsvEnd(), ",アイテム出現テーブル,%d,\n", JKRGetMemBlockSize(NULL, dComIfGp_getItemTable())); + sprintf(getCsvEnd(), ",キャッシュフォントバッファ,%d,\n", JKRGetMemBlockSize(NULL, ((JKRAramArchive*)dComIfGp_getRubyArchive())->mBlock) + 0x1C328); + sprintf(getCsvEnd(), ",ゲームヒープ,%d,%d,%d,\n", mDoExt_getGameHeap()->getTotalUsedSize(), mDoExt_getGameHeap()->getHeapSize(), mDoExt_getGameHeap()->getFreeSize()); + sprintf(getCsvEnd(), ",コマンドヒープ,%d,%d,%d,\n\n", mDoExt_getCommandHeap()->getTotalUsedSize(), mDoExt_getCommandHeap()->getHeapSize(), mDoExt_getCommandHeap()->getFreeSize()); + sprintf(getCsvEnd(), ",ARAMメモリ,%d,%d,%d,\n\n", JKRGetAramUsedSize(0) + 0xB00000, (JKRGetAramUsedSize(0) + 0xB00000 + JKRGetAramTotalFreeSize()), JKRGetAramFreeSize()); + sprintf(getCsvEnd(), ",オーディオARAMメモリ,%d,\n", 0xB00000); + sprintf(getCsvEnd(), ",リンクアニメーション,%d,\n", ((JKRAramArchive*)dComIfGp_getAnmArchive())->mBlock->getSize()); + sprintf(getCsvEnd(), ",フィールドマップレイアウト,%d,\n", ((JKRAramArchive*)dComIfGp_getFmapResArchive())->mBlock->getSize()); + sprintf(getCsvEnd(), ",フィールドマップデータ,%d,\n", ((JKRAramArchive*)dComIfGp_getFieldMapArchive2())->mBlock->getSize()); + sprintf(getCsvEnd(), ",ダンジョンマップレイアウト,%d,\n", ((JKRAramArchive*)dComIfGp_getDmapResArchive())->mBlock->getSize()); + sprintf(getCsvEnd(), ",コレクト&セーブ&オプション,%d,\n", ((JKRAramArchive*)dComIfGp_getCollectResArchive())->mBlock->getSize()); + sprintf(getCsvEnd(), ",リングアイテム選択,%d,\n", ((JKRAramArchive*)dComIfGp_getRingResArchive())->mBlock->getSize()); + sprintf(getCsvEnd(), ",アイテムアイコン,%d,\n", ((JKRAramArchive*)dComIfGp_getItemIconArchive())->mBlock->getSize()); + sprintf(getCsvEnd(), ",アイテム説明画面,%d,\n", ((JKRAramArchive*)dComIfGp_getDemoMsgArchive())->mBlock->getSize()); + sprintf(getCsvEnd(), ",強調ボタン表示,%d,\n", ((JKRAramArchive*)dComIfGp_getMeterButtonArchive())->mBlock->getSize()); + sprintf(getCsvEnd(), ",フキダシ共通2Dデータ,%d,\n", ((JKRAramArchive*)dComIfGp_getMsgCommonArchive())->mBlock->getSize()); + sprintf(getCsvEnd(), ",キャッシュフォント,%d,\n\n", mDoExt_getAraCacheSize()); + + for (int i = 0; i < 6; i++) { + sprintf(getCsvEnd(), ",メッセージ(%d)枠ほか,%d,\n", i, ((JKRAramArchive*)dComIfGp_getMsgArchive(i))->mBlock->getSize()); + } + + g_dComIfG_gameInfo.mResControl.dump(mCsv); + + u32 memblock_total_size = 0; + for (int i = 0; i < 19; i++) { + JKRExpHeap* memblock = dStage_roomControl_c::getMemoryBlockHeap(i); + if (memblock != NULL) { + memblock_total_size += memblock->getHeapSize(); + } + } + + if (memblock_total_size != NULL) { + sprintf(getCsvEnd(), ",ステージメモリーブロック,%d\n\n", memblock_total_size); + } + + DynamicModuleControlBase::dump(mCsv); + + sprintf(getCsvEnd(), ",オブジェクト名(ID),サイズ,\n"); + fpcLyIt_All(dumpObject, mCsv); + sprintf(getCsvEnd(), ",2Dメモリ,%d,\n", dComIfGp_getExpHeap2D()->getHeapSize() + dComIfGp_getMsgExpHeap()->getHeapSize()); +} + +void fapGm_HIO_c::listenPropertyEvent(const JORPropertyEvent* property) { + JORReflexible::listenPropertyEvent(property); + JORFile file; + + switch ((u32)property->id) { + case 0x4000020: + JUTAssertion::setMessageCount(0); + break; + case 0x4000003: + mCaptureScreenFlag = -1; + break; + case 0x4000002: + if (file.open(6, "ゲームキューブイメージファイル(*.gfb)", "gfb", NULL, NULL)) { + file.writeData(mDoGph_gInf_c::getFrameBufferMemory(), mDoGph_gInf_c::getFrameBufferSize()); + file.close(); + } + break; + case 0x4000005: + OSReport("\x1b[43;30m連続空き=%fK 残り空き=%fK\n\x1b[m", JKRGetSystemHeap()->getFreeSize() * 0.0009765625f, JKRGetSystemHeap()->getTotalFreeSize() * 0.0009765625f); + break; + case 0x4000007: + onCpuTimer(); + break; + case 0x4000014: { + u8* bdlData; + void* model_buffer = mDoExt_getArchiveHeap()->alloc(0x96000, 0x20); + + if (model_buffer == NULL) { + OSReport("BMDファイル読み込みメモリがありません!!\n"); + } else if (!file.open(1, "BMDファイル(*.bmd)", NULL, NULL, NULL)) { + OSReport("BMDファイルオープン失敗!!\n"); + } else { + file.readData(model_buffer, 0); + file.close(); + + J3DModelData* modelData = J3DModelLoaderDataBase::load(model_buffer, 0x10000); + if (modelData == NULL) { + OSReport("BMDデータロード失敗!!\n"); + } + + JKRSolidHeap* heap = mDoExt_createSolidHeapFromGameToCurrent(0x4B000, 0x20); + if (heap == NULL) { + OSReport("J3DModel用メモリがありません!!\n"); + JKRFree(model_buffer); + break; + } + + J3DModel* model = mDoExt_J3DModel__create(modelData, 0x10000, 0x11020203); + mDoExt_restoreCurrentHeap(); + mDoExt_adjustSolidHeap(heap); + + if (model == NULL) { + OSReport("J3DModel生成失敗!!\n"); + mDoExt_destroySolidHeap(heap); + JKRFree(model_buffer); + break; + } + + j3dSys.setViewMtx(cMtx_getIdentity()); + + model->calc(); + model->calcMaterial(); + model->makeDL(); + model->calcMaterial(); + model->makeDL(); + model->lock(); + + JORFile out_file; + int temp_r24 = strlen(file.getFilename()); + char* filename_and_ext = file.getFilename() + temp_r24; + + int sp10 = 0; + while (*filename_and_ext != '\\') { + filename_and_ext--; + sp10++; + } + + filename_and_ext++; + + char new_filename[32]; + for (int i = 0; i < sp10; i++) { + new_filename[i] = filename_and_ext[i]; + } + + new_filename[sp10 - 3] = 'd'; + new_filename[sp10 - 2] = 'l'; + + if (!out_file.open(NULL, 6, "BDLファイル(*.bdl)", "bdl", NULL, new_filename)) { + OSReport("BDLファイルオープン失敗!!\n"); + } else { + bdlData = (u8*)J3DModelSaverDataBase::saveBinaryDisplayList(model, J3DBinaryDisplayListSaverFlag_UNK_1, 0xC8000); + if (bdlData == NULL) { + OSReport("BDLファイル生成失敗!!\n"); + } else { + OSReport("############ bdlData=%x size=%d\n", bdlData, *(int*)((char*)bdlData + 8)); + out_file.writeData(bdlData, *(int*)((char*)bdlData + 8)); + out_file.close(); + } + + mDoExt_destroySolidHeap(heap); + JKRFree(model_buffer); + delete[] bdlData; + } + } + break; + } + case 0x4000016: + if (!file.open(NULL, 6, "メモリファイル(*.csv)", "csv", NULL, NULL)) { + OSReport("メモリファイルオープン失敗!!\n"); + } else { + fapGm_dataMem::dumpCsv(); + file.writeData(fapGm_dataMem::getCsv(), fapGm_dataMem::getCsvSize()); + file.close(); + OSReport("csv file size=%d\n", fapGm_dataMem::getCsvSize()); + } + + if (!file.open(NULL, 6, "新メモリファイル(*.tag)", "tag", NULL, NULL)) { + OSReport("新メモリファイルオープン失敗!!\n"); + } else { + fapGm_dataMem::dumpTag(); + file.writeData(fapGm_dataMem::getCsv(), fapGm_dataMem::getCsvSize()); + file.close(); + OSReport("tag file size=%d\n", fapGm_dataMem::getCsvSize()); + } + break; + } +} + +void fapGm_HIO_c::startCpuTimer() { + if (m_CpuTimerOn) { + m_CpuTimerOff = TRUE; + m_CpuTimerOn = FALSE; + } + + if (m_CpuTimerOff) { + JUT_ASSERT(1302, !m_CpuTimerStart) + m_CpuTimerStart = TRUE; + m_CpuTimerTick = OSGetTick(); + } +} + +void fapGm_HIO_c::stopCpuTimer(const char* message) { + if (m_CpuTimerOff) { + JUT_ASSERT(1311, m_CpuTimerStart) + m_CpuTimerStart = FALSE; + + u32 var_r29 = OSGetTick() - m_CpuTimerTick; + OSReport("%fms : <%s>\n", OSTicksToMicroseconds(var_r29) / 1000.0f, message); + } +} + +void fapGm_HIO_c::printCpuTimer(const char* message) { + if (m_CpuTimerOff) { + OSReport("%s\n", message); + } +} +#endif + void fapGm_After() { fopScnM_Management(); fopOvlpM_Management(); @@ -46,6 +725,10 @@ void fapGm_After() { } void fapGm_Execute() { + #if DEBUG + JUTDbPrint::getManager()->setCharColor(g_HIO.mColor); + #endif + fpcM_Management(NULL, fapGm_After); cCt_Counter(0); } @@ -53,12 +736,22 @@ void fapGm_Execute() { fapGm_HIO_c g_HIO; void fapGm_Create() { + // unused, unknown purpose + u16 var_r30 = 184; + u16 var_r29 = 432; + u16 var_r28 = 1392; + u16 var_r27 = 456; + fpcM_Init(); fopScnM_Init(); fopOvlpM_Init(); fopCamM_Init(); fopDwTg_CreateQueue(); - g_HIO.field_0x04 = -1; + + #if DEBUG + fapGm_HIO_c::createCaptureScreen(); + #endif + g_HIO.field_0x04 = mDoHIO_CREATE_CHILD("ゲームシステム", &g_HIO); } fapGm_HIO_c::~fapGm_HIO_c() {} diff --git a/src/f_op/f_op_actor.cpp b/src/f_op/f_op_actor.cpp index 26642e928f3..406fa12309e 100644 --- a/src/f_op/f_op_actor.cpp +++ b/src/f_op/f_op_actor.cpp @@ -10,10 +10,194 @@ #include "d/d_com_static.h" #include "d/d_demo.h" #include "d/d_s_play.h" +#include "f_ap/f_ap_game.h" #include "f_op/f_op_actor.h" #include "f_op/f_op_actor_tag.h" #include "f_op/f_op_draw_tag.h" #include "f_pc/f_pc_manager.h" +#include "f_pc/f_pc_debug_sv.h" +#include "c/c_dylink.h" +#include "m_Do/m_Do_printf.h" + +#if DEBUG +class print_error_check_c { +public: + struct param_s { + const char* name; + s32 timeMs; + }; + + print_error_check_c(fopAc_ac_c*, const param_s&); + ~print_error_check_c(); + void start(); + void check(); + + static u8 mPriorityMaximum; + static u8 mPrintDisable; + static u8 mThresholdEnable; + + static param_s sEXECUTE; + static param_s sCREATE; + static param_s sDELETE; + static param_s sIS_DELETE; + static param_s sDRAW; + + /* 0x00 */ fopAc_ac_c* mpActor; + /* 0x04 */ const char* mName; + /* 0x08 */ int mTimeMs; + /* 0x0C */ int mPrintErrors; + /* 0x10 */ u32 mTick; + /* 0x14 */ int mThreadPrio; + /* 0x18 */ int mPrintInit; +}; + +u8 print_error_check_c::mPriorityMaximum; +u8 print_error_check_c::mPrintDisable; +u8 print_error_check_c::mThresholdEnable; + +print_error_check_c::print_error_check_c(fopAc_ac_c* i_actor, const param_s& i_param) { + mpActor = i_actor; + mName = i_param.name; + mTimeMs = i_param.timeMs; + start(); +} + +print_error_check_c::~print_error_check_c() { + check(); +} + +void print_error_check_c::start() { + if (!cCc_Check()) { + OS_REPORT("\x1b[36mPRE %s_SUBMETHOD %08x %08x %s %s\n\x1b[m", + mName, mpActor, mpActor->base.base.name, fpcDbSv_getNameString(mpActor->base.base.name), fopAcM_getProcNameString(mpActor)); + } + + mPrintErrors = print_errors; + + if (mPrintDisable) { + mPrintInit = print_initialized; + OSReportDisable(); + } else { + mPrintInit = -1; + } + + if (mPriorityMaximum) { + OSThread* thread = OSGetCurrentThread(); + mThreadPrio = OSGetThreadPriority(thread); + OSSetThreadPriority(thread, 0); + } else { + mThreadPrio = -1; + } + + mTick = OSGetTick(); +} + +void print_error_check_c::check() { + if (!cCc_Check()) { + OS_REPORT("\x1b[36mPOST %s_SUBMETHOD %08x %08x %s %s\n\x1b[m", + mName, mpActor, mpActor->base.base.name, fpcDbSv_getNameString(mpActor->base.base.name), fopAcM_getProcNameString(mpActor)); + } + + OSTick tick = OSGetTick(); + + if (mThreadPrio != -1) { + OSThread* thread = OSGetCurrentThread(); + OSSetThreadPriority(thread, mThreadPrio); + } + + if (mPrintInit != -1) { + print_initialized = mPrintInit; + } + + if (mPrintErrors != print_errors) { + static char l_name[8]; + fopAcM_getNameString(mpActor, l_name); + OS_REPORT("\x1b[36m↑%s_SUBMETHOD %08x %08x %s %s\n\x1b[m", + mName, mpActor, mpActor->base.base.name, fpcDbSv_getNameString(mpActor->base.base.name), l_name); + } + + if (mThresholdEnable) { + OSTick tick_diff = tick - mTick; + if (mTimeMs != 0 && tick_diff > OSMicrosecondsToTicks(mTimeMs)) { + static char l_name[8]; + fopAcM_getNameString(mpActor, l_name); + OSReport_Warning("%s_SUBMETHOD 処理時間ながすぎ %4d us [%s] %s\n", + mName, OSTicksToMicroseconds(tick_diff), fpcDbSv_getNameString(mpActor->base.base.name), l_name); + } + } +} + +print_error_check_c::param_s print_error_check_c::sEXECUTE = { + "EXECUTE", + 3000, +}; + +print_error_check_c::param_s print_error_check_c::sCREATE = { + "CREATE", + 3000, +}; + +print_error_check_c::param_s print_error_check_c::sDELETE = { + "DELETE", + 3000, +}; + +print_error_check_c::param_s print_error_check_c::sIS_DELETE = { + "IS_DELETE", + 30, +}; + +print_error_check_c::param_s print_error_check_c::sDRAW = { + "DRAW", + 3000, +}; + +class fopac_HIO_c : public JORReflexible { +public: + fopac_HIO_c(); + ~fopac_HIO_c(); + + void genMessage(JORMContext*); + + /* 0x04 */ s8 mId; + /* 0x05 */ u8 mStopExecute; + /* 0x06 */ u8 mStopDraw; + /* 0x07 */ u8 field_0x7; + /* 0x08 */ u8 field_0x8; + /* 0x0A */ s16 mActorNum; + /* 0x0C */ u8 mBBtnInfoDisp; +}; + +fopac_HIO_c::~fopac_HIO_c() {} + +fopac_HIO_c::fopac_HIO_c() { + mId = -1; + mStopExecute = false; + mStopDraw = false; + mActorNum = 0; + mBBtnInfoDisp = false; +} + +static fopac_HIO_c l_HIO; + +void fopac_HIO_c::genMessage(JORMContext* mctx) { + mctx->genLabel("処理速度調査用", 0x80000001, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider("アクター番号", &mActorNum, 0, 4000, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genCheckBox("動作静止", &mStopExecute, 1, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genCheckBox("描画停止", &mStopDraw, 1, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genCheckBox("Bボタンでアクター番号を表示", &mBBtnInfoDisp, 1, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genCheckBox("メソッド速度調査", &print_error_check_c::mThresholdEnable, 1, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genCheckBox("最高優先度", &print_error_check_c::mPriorityMaximum, 1, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genCheckBox("PRINT抑制", &print_error_check_c::mPrintDisable, 1, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + + mctx->genLabel("メソッド閾値", 0, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider("EXECUTE", &print_error_check_c::sEXECUTE.timeMs, 0, 10000, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider("CREATE", &print_error_check_c::sCREATE.timeMs, 0, 10000, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider("DELETE", &print_error_check_c::sDELETE.timeMs, 0, 10000, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider("IS_DELETE", &print_error_check_c::sIS_DELETE.timeMs, 0, 10000, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider("DRAW", &print_error_check_c::sDRAW.timeMs, 0, 10000, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); +} +#endif /* 80018B64-80018BD0 0134A4 006C+00 0/0 7/7 562/562 .text __ct__10fopAc_ac_cFv */ fopAc_ac_c::fopAc_ac_c() {} @@ -34,76 +218,189 @@ u32 fopAc_ac_c::stopStatus; /* 80018D0C-80018DD8 01364C 00CC+00 1/0 0/0 0/0 .text fopAc_Draw__FPv */ static int fopAc_Draw(void* i_this) { - fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; - + fopAc_ac_c* actor = (fopAc_ac_c*)i_this; int ret = 1; - if (!dComIfGp_isPauseFlag()) { - if ((dComIfGp_event_moveApproval(a_this) == 2 || - (!fopAcM_CheckStatus(a_this, fopAc_ac_c::stopStatus) && - (!fopAcM_CheckStatus(a_this, fopAcStts_CULL_e) || !fopAcM_cullingCheck(a_this)))) && - !fopAcM_CheckStatus(a_this, 0x21000000)) - { - fopAcM_OffCondition(a_this, fopAcCnd_NODRAW_e); - ret = fpcLf_DrawMethod((leafdraw_method_class*)a_this->sub_method, a_this); - } else { - fopAcM_OnCondition(a_this, fopAcCnd_NODRAW_e); + + #if DEBUG + fapGm_HIO_c::startCpuTimer(); + + if (mDoCPd_c::getTrigB(PAD_1) && l_HIO.mBBtnInfoDisp) { + static char l_name[8]; + fopAcM_getNameString(actor, l_name); + + OSReport("%7s %3d %5d x %10.2f y %10.2f z %10.2f\n", + l_name, fopAcM_GetName(actor), actor->setID, actor->current.pos.x, actor->current.pos.y, actor->current.pos.z); + } + + if (l_HIO.mActorNum == fopAcM_GetName(actor) && l_HIO.mStopDraw) { + if (l_HIO.field_0x8 != l_HIO.mStopDraw) { + static char l_name[8]; + fopAcM_getNameString(actor, l_name); + OSReport("<%s> の描画を停止します\n", l_name); } - fopAcM_OffStatus(a_this, fopAcStts_NODRAW_e); + l_HIO.field_0x8 = l_HIO.mStopDraw; + return 1; } + l_HIO.field_0x8 = l_HIO.mStopDraw; + #endif + + if (!dComIfGp_isPauseFlag()) { + int var_r28 = dComIfGp_event_moveApproval(actor); + if ((var_r28 == 2 || (!fopAcM_CheckStatus(actor, fopAc_ac_c::stopStatus) && + (!fopAcM_CheckStatus(actor, fopAcStts_CULL_e) || !fopAcM_cullingCheck(actor)))) && + !fopAcM_CheckStatus(actor, 0x21000000)) + { + fopAcM_OffCondition(actor, fopAcCnd_NODRAW_e); + + #if DEBUG + { + print_error_check_c error_check(actor, print_error_check_c::sDRAW); + #endif + + ret = fpcLf_DrawMethod((leafdraw_method_class*)actor->sub_method, actor); + + #if DEBUG + } + + if (g_envHIO.mOther.mDisplayCullBox) { + GXColor color = {0xFF, 0x00, 0xFF, 0x80}; + fopAcM_DrawCullingBox(actor, color); + } + #endif + } else { + fopAcM_OnCondition(actor, fopAcCnd_NODRAW_e); + } + + fopAcM_OffStatus(actor, fopAcStts_NODRAW_e); + } + + #if DEBUG + char sp38[40]; + char sp10[8]; + fopAcM_getNameString(actor, sp10); + sprintf(sp38, "%s(描画処理)", sp10); + fapGm_HIO_c::stopCpuTimer(sp38); + #endif + return ret; } /* 80018DD8-80018F78 013718 01A0+00 1/0 0/0 0/0 .text fopAc_Execute__FPv */ static int fopAc_Execute(void* i_this) { - fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; - + fopAc_ac_c* actor = (fopAc_ac_c*)i_this; int ret = 1; + + #if DEBUG + fapGm_HIO_c::startCpuTimer(); + + if (l_HIO.mActorNum == fopAcM_GetName(actor) && l_HIO.mStopExecute) { + if (l_HIO.field_0x7 != l_HIO.mStopExecute) { + static char l_name[8]; + fopAcM_getNameString(actor, l_name); + OSReport("<%s> の処理を停止します\n", l_name); + } + + l_HIO.field_0x7 = l_HIO.mStopExecute; + return 1; + } + + l_HIO.field_0x7 = l_HIO.mStopExecute; + + JUT_ASSERT(662, !(fpclassify(actor->current.pos.x) == 1)); + JUT_ASSERT(663, !(fpclassify(actor->current.pos.y) == 1)); + JUT_ASSERT(664, !(fpclassify(actor->current.pos.z) == 1)); + + if (!(-1.0e32f < actor->current.pos.x && actor->current.pos.x < 1.0e32f && -1.0e32f < actor->current.pos.y && actor->current.pos.y < 1.0e32f && -1.0e32f < actor->current.pos.z && actor->current.pos.z < 1.0e32f)) + { + static char l_name[8]; + fopAcM_getNameString(actor, l_name); + OSReport("!!!<%s> が範囲外にいます!!!\n", l_name); + } + + JUT_ASSERT(685, -1.0e32f < actor->current.pos.x && actor->current.pos.x < 1.0e32f && -1.0e32f < actor->current.pos.y && actor->current.pos.y < 1.0e32f && -1.0e32f < actor->current.pos.z && actor->current.pos.z < 1.0e32f); + #endif + if (!dComIfGp_isPauseFlag() && dScnPly_c::isPause()) { if (!dComIfA_PauseCheck()) { - daSus_c::check(a_this); - a_this->eventInfo.beforeProc(); + daSus_c::check(actor); + actor->eventInfo.beforeProc(); s32 move = dComIfGp_event_moveApproval(i_this); - fopAcM_OffStatus(a_this, 0x40000000); + fopAcM_OffStatus(actor, 0x40000000); - if (!fopAcM_CheckStatus(a_this, 0x20000000) && + if (!fopAcM_CheckStatus(actor, 0x20000000) && (move == 2 || - (move != 0 && !fopAcM_CheckStatus(a_this, fopAc_ac_c::stopStatus) && - (!fopAcM_CheckStatus(a_this, fopAcStts_NOEXEC_e) || !fopAcM_CheckCondition(a_this, fopAcCnd_NODRAW_e))))) + (move != 0 && !fopAcM_CheckStatus(actor, fopAc_ac_c::stopStatus) && + (!fopAcM_CheckStatus(actor, fopAcStts_NOEXEC_e) || !fopAcM_CheckCondition(actor, fopAcCnd_NODRAW_e))))) { - fopAcM_OffCondition(a_this, fopAcCnd_NOEXEC_e); - a_this->old = a_this->current; - ret = fpcMtd_Execute((process_method_class*)a_this->sub_method, a_this); + fopAcM_OffCondition(actor, fopAcCnd_NOEXEC_e); + actor->old = actor->current; + + #if DEBUG + { + print_error_check_c error_check(actor, print_error_check_c::sEXECUTE); + #endif + + ret = fpcMtd_Execute((process_method_class*)actor->sub_method, actor); + + #if DEBUG + } + #endif } else { - a_this->eventInfo.suspendProc(a_this); - fopAcM_OnCondition(a_this, fopAcCnd_NOEXEC_e); + actor->eventInfo.suspendProc(actor); + fopAcM_OnCondition(actor, fopAcCnd_NOEXEC_e); } - if (fopAcM_CheckStatus(a_this, 0x20) && - a_this->home.pos.y - a_this->current.pos.y > 5000.0f) + if (fopAcM_CheckStatus(actor, 0x20) && + actor->home.pos.y - actor->current.pos.y > 5000.0f) { - fopAcM_delete(a_this); + fopAcM_delete(actor); } - if (a_this->current.pos.y < -1e31f) { - a_this->current.pos.y = -1e31f; + JUT_ASSERT(750, !(fpclassify(actor->current.pos.x) == 1)); + JUT_ASSERT(751, !(fpclassify(actor->current.pos.y) == 1)); + JUT_ASSERT(752, !(fpclassify(actor->current.pos.z) == 1)); + + if (actor->current.pos.y < -1e31f) { + actor->current.pos.y = -1e31f; } - dKy_depth_dist_set(a_this); + JUT_ASSERT(762, -1.0e32f < actor->current.pos.x && actor->current.pos.x < 1.0e32f && -1.0e32f < actor->current.pos.y && actor->current.pos.y < 1.0e32f && -1.0e32f < actor->current.pos.z && actor->current.pos.z < 1.0e32f); + + dKy_depth_dist_set(actor); } } + #if DEBUG + char sp38[40]; + char sp10[8]; + fopAcM_getNameString(actor, sp10); + sprintf(sp38, "%s(計算処理)", sp10); + fapGm_HIO_c::stopCpuTimer(sp38); + #endif + return ret; } /* 80018F78-80018FCC 0138B8 0054+00 1/0 0/0 0/0 .text fopAc_IsDelete__FPv */ static int fopAc_IsDelete(void* i_this) { - fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + fopAc_ac_c* actor = (fopAc_ac_c*)i_this; + int ret; + + #if DEBUG + { + print_error_check_c error_check(actor, print_error_check_c::sIS_DELETE); + #endif + + ret = fpcMtd_IsDelete((process_method_class*)actor->sub_method, actor); + + #if DEBUG + } + #endif - int ret = fpcMtd_IsDelete((process_method_class*)a_this->sub_method, a_this); if (ret == TRUE) { - fopDwTg_DrawQTo(&a_this->draw_tag); + fopDwTg_DrawQTo(&actor->draw_tag); } return ret; @@ -111,18 +408,37 @@ static int fopAc_IsDelete(void* i_this) { /* 80018FCC-8001904C 01390C 0080+00 1/0 0/0 0/0 .text fopAc_Delete__FPv */ static int fopAc_Delete(void* i_this) { - fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + fopAc_ac_c* actor = (fopAc_ac_c*)i_this; + int ret; + + #if DEBUG + { + print_error_check_c error_check(actor, print_error_check_c::sDELETE); + #endif + + ret = fpcMtd_Delete((process_method_class*)actor->sub_method, actor); + + #if DEBUG + } + #endif - int ret = fpcMtd_Delete((process_method_class*)a_this->sub_method, a_this); if (ret == TRUE) { - fopAcTg_ActorQTo(&a_this->actor_tag); - fopDwTg_DrawQTo(&a_this->draw_tag); - fopAcM_DeleteHeap(a_this); + fopAcTg_ActorQTo(&actor->actor_tag); + fopDwTg_DrawQTo(&actor->draw_tag); + fopAcM_DeleteHeap(actor); - dDemo_actor_c* demoAc = dDemo_c::getActor(a_this->demoActorID); + dDemo_actor_c* demoAc = dDemo_c::getActor(actor->demoActorID); if (demoAc != NULL) { demoAc->setActor(NULL); } + + mDoAud_seDeleteObject(&actor->eyePos); + mDoAud_seDeleteObject(&actor->current.pos); + + #if DEBUG + dComIfG_Bgsp().ChkDeleteActorRegist(actor); + dComIfG_Ccsp()->ChkActor(actor); + #endif } return ret; @@ -130,98 +446,127 @@ static int fopAc_Delete(void* i_this) { /* 8001904C-800193FC 01398C 03B0+00 1/0 0/0 0/0 .text fopAc_Create__FPv */ static int fopAc_Create(void* i_this) { - fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + fopAc_ac_c* actor = (fopAc_ac_c*)i_this; + int ret; if (fpcM_IsFirstCreating(i_this)) { actor_process_profile_definition* profile = (actor_process_profile_definition*)fpcM_GetProfile(i_this); - a_this->actor_type = fpcBs_MakeOfType(&g_fopAc_type); - a_this->sub_method = (profile_method_class*)profile->sub_method; + actor->actor_type = fpcBs_MakeOfType(&g_fopAc_type); + actor->sub_method = (profile_method_class*)profile->sub_method; - fopAcTg_Init(&a_this->actor_tag, a_this); - fopAcTg_ToActorQ(&a_this->actor_tag); - fopDwTg_Init(&a_this->draw_tag, a_this); + fopAcTg_Init(&actor->actor_tag, actor); + fopAcTg_ToActorQ(&actor->actor_tag); + fopDwTg_Init(&actor->draw_tag, actor); - a_this->actor_status = profile->status; - a_this->group = profile->group; - a_this->cullType = profile->cullType; + actor->actor_status = profile->status; + actor->group = profile->group; + actor->cullType = profile->cullType; - fopAcM_prm_class* append = fopAcM_GetAppend(a_this); + fopAcM_prm_class* append = fopAcM_GetAppend(actor); if (append != NULL) { - fopAcM_SetParam(a_this, append->base.parameters); - a_this->home.pos = append->base.position; - a_this->home.angle = append->base.angle; - a_this->shape_angle = append->base.angle; - a_this->parentActorID = append->parent_id; - a_this->argument = append->argument; - a_this->scale.set(append->scale.x * 0.1f, append->scale.y * 0.1f, + fopAcM_SetParam(actor, append->base.parameters); + actor->home.pos = append->base.position; + actor->home.angle = append->base.angle; + actor->shape_angle = append->base.angle; + actor->parentActorID = append->parent_id; + actor->argument = append->argument; + actor->scale.set(append->scale.x * 0.1f, append->scale.y * 0.1f, append->scale.z * 0.1f); - a_this->setID = append->base.setID; - a_this->home.roomNo = append->room_no; + actor->setID = append->base.setID; + actor->home.roomNo = append->room_no; } - a_this->old = a_this->home; - a_this->current = a_this->home; - a_this->eyePos = a_this->home.pos; - a_this->maxFallSpeed = -100.0f; - a_this->attention_info.distances[fopAc_attn_LOCK_e] = 1; - a_this->attention_info.distances[fopAc_attn_TALK_e] = 2; - a_this->attention_info.distances[fopAc_attn_BATTLE_e] = 3; - a_this->attention_info.distances[fopAc_attn_SPEAK_e] = 5; - a_this->attention_info.distances[fopAc_attn_CARRY_e] = 6; - a_this->attention_info.distances[fopAc_attn_ETC_e] = 14; - a_this->attention_info.distances[fopAc_attn_DOOR_e] = 15; - a_this->attention_info.distances[fopAc_attn_JUEL_e] = 15; - a_this->attention_info.distances[fopAc_attn_CHECK_e] = 51; - a_this->attention_info.position = a_this->home.pos; - a_this->attention_info.field_0xa = 30; - dKy_tevstr_init(&a_this->tevStr, a_this->home.roomNo, -1); + actor->old = actor->home; + actor->current = actor->home; + actor->eyePos = actor->home.pos; + actor->maxFallSpeed = -100.0f; + actor->attention_info.distances[fopAc_attn_LOCK_e] = 1; + actor->attention_info.distances[fopAc_attn_TALK_e] = 2; + actor->attention_info.distances[fopAc_attn_BATTLE_e] = 3; + actor->attention_info.distances[fopAc_attn_SPEAK_e] = 5; + actor->attention_info.distances[fopAc_attn_CARRY_e] = 6; + actor->attention_info.distances[fopAc_attn_ETC_e] = 14; + actor->attention_info.distances[fopAc_attn_DOOR_e] = 15; + actor->attention_info.distances[fopAc_attn_JUEL_e] = 15; + actor->attention_info.distances[fopAc_attn_CHECK_e] = 51; - int roomNo = dComIfGp_roomControl_getStayNo(); - if (roomNo >= 0) { - dComIfGp_roomControl_getStatusRoomDt(roomNo)->getFileListInfo(); + #if !PLATFORM_GCN + actor->attention_info.distances[fopAc_attn_UNK_3] = 79; + actor->attention_info.distances[fopAc_attn_UNK_4] = 2; + actor->attention_info.distances[fopAc_attn_UNK_5] = 3; + actor->attention_info.distances[fopAc_attn_UNK_10] = 2; + #endif + + actor->attention_info.position = actor->home.pos; + actor->attention_info.field_0xa = 30; + dKy_tevstr_init(&actor->tevStr, actor->home.roomNo, -1); + + dStage_FileList_dt_c* sp14 = NULL; + camera_class* sp10 = dComIfGp_getCamera(0); + + if (dComIfGp_roomControl_getStayNo() >= 0) { + sp14 = dComIfGp_roomControl_getStatusRoomDt(dComIfGp_roomControl_getStayNo())->getFileListInfo(); } dStage_FileList_dt_c* filelist = NULL; - if (a_this->home.roomNo >= 0) { + if (actor->home.roomNo >= 0) { filelist = - dComIfGp_roomControl_getStatusRoomDt(a_this->home.roomNo)->getFileListInfo(); + dComIfGp_roomControl_getStatusRoomDt(actor->home.roomNo)->getFileListInfo(); } if (filelist != NULL) { if (!dStage_FileList_dt_GetEnemyAppear1Flag(filelist)) { - u32 sw = dStage_FileList_dt_GetBitSw(filelist); - if (sw != 0xFF && dComIfGs_isSwitch(sw, a_this->home.roomNo) && + u8 sw = dStage_FileList_dt_GetBitSw(filelist); + if (sw != 0xFF && dComIfGs_isSwitch(sw, actor->home.roomNo) && profile->group == fopAc_ENEMY_e) { + OS_WARNING("f_op_actor.cpp マップツール設定により敵グループは削除されました!\n"); return cPhs_ERROR_e; } } else { - u32 sw = dStage_FileList_dt_GetBitSw(filelist); - if (sw != 0xFF && !dComIfGs_isSwitch(sw, a_this->home.roomNo) && + u8 sw = dStage_FileList_dt_GetBitSw(filelist); + if (sw != 0xFF && !dComIfGs_isSwitch(sw, actor->home.roomNo) && profile->group == fopAc_ENEMY_e) { + OS_WARNING("f_op_actor.cpp マップツール設定により敵グループは削除されました!\n"); return cPhs_ERROR_e; } } } } - int ret = fpcMtd_Create((process_method_class*)a_this->sub_method, a_this); - if (ret == cPhs_COMPLEATE_e) { - s32 priority = fpcM_DrawPriority(a_this); - fopDwTg_ToDrawQ(&a_this->draw_tag, priority); - } else if (ret == cPhs_ERROR_e) { - fopAcM_OnCondition(a_this, 0x10); + #if DEBUG + { + print_error_check_c error_check(actor, print_error_check_c::sCREATE); + #endif + + ret = fpcMtd_Create((process_method_class*)actor->sub_method, actor); + + #if DEBUG } + fopAcM_assert(1113, actor, fopAcM_CheckCondition(actor, fopAcCnd_INIT_e), "fopAcM_ct No Call !!"); + #endif + + if (ret == cPhs_COMPLEATE_e) { + fopDwTg_ToDrawQ(&actor->draw_tag, fpcM_DrawPriority(actor)); + } else if (ret == cPhs_ERROR_e) { + fopAcM_OnCondition(actor, 0x10); + } + + #if DEBUG + if (l_HIO.mId < 0) { + l_HIO.mId = mDoHIO_CREATE_CHILD("処理速度チェック用", &l_HIO); + } + #endif + return ret; } /* 80019404-800194FC 013D44 00F8+00 0/0 0/0 2/2 .text initBallModel__13fopEn_enemy_cFv */ BOOL fopEn_enemy_c::initBallModel() { - void* objRes = dComIfG_getObjectRes("Alink", daAlink_c::getBallModelIdx()); - mBallModel = mDoExt_J3DModel__create((J3DModelData*)objRes, 0x80000, 0x11000284); + mBallModel = mDoExt_J3DModel__create((J3DModelData*)dComIfG_getObjectRes("Alink", daAlink_c::getBallModelIdx()), 0x80000, 0x11000284); if (!mBallModel) { return false; @@ -239,28 +584,26 @@ BOOL fopEn_enemy_c::initBallModel() { } /* 800194FC-80019520 013E3C 0024+00 2/2 0/0 2/2 .text checkBallModelDraw__13fopEn_enemy_cFv */ bool fopEn_enemy_c::checkBallModelDraw() { - return (mFlags & 1) && !(mFlags & 0x32); + return (mFlags & fopEn_flag_Down) && !(mFlags & (fopEn_flag_WolfDownPullEnd | fopEn_flag_WolfDownPull | fopEn_flag_CutDownHit)); } /* 80019520-800196A0 013E60 0180+00 0/0 0/0 2/2 .text * setBallModelEffect__13fopEn_enemy_cFP12dKy_tevstr_c */ void fopEn_enemy_c::setBallModelEffect(dKy_tevstr_c* i_tevstr) { if (mBallModel) { - field_0x590 += 1.0f; + mAnmFrame += 1.0f; - if (field_0x590 >= mBtk->getFrameMax()) { - field_0x590 -= mBtk->getFrameMax(); + if (mAnmFrame >= mBtk->getFrameMax()) { + mAnmFrame -= mBtk->getFrameMax(); } if (checkBallModelDraw()) { Vec* base_scale = mBallModel->getBaseScale(); cLib_chaseF(&base_scale->x, 1.0f, 0.1f); - f32 result = base_scale->x; - base_scale->z = result; - base_scale->y = result; + base_scale->y = base_scale->z = base_scale->x; - mEffectID1 = dComIfGp_particle_set(mEffectID1, 0x86C8, &mDownPos, i_tevstr); - mEffectID2 = dComIfGp_particle_set(mEffectID2, 0x86C9, &mDownPos, i_tevstr); + mEffectID1 = dComIfGp_particle_set(mEffectID1, dPa_RM(ID_ZI_S_ID_SETA_A), &mDownPos, i_tevstr); + mEffectID2 = dComIfGp_particle_set(mEffectID2, dPa_RM(ID_ZI_S_ID_SETA_B), &mDownPos, i_tevstr); } } } @@ -288,12 +631,12 @@ void fopEn_enemy_c::drawBallModel(dKy_tevstr_c* i_tevstr) { if (base_scale->x > 0.01f) { mDoMtx_trans(mBallModel->getBaseTRMtx(), mDownPos.x, mDownPos.y, mDownPos.z); - dKy_getEnvlight()->setLightTevColorType_MAJI(mBallModel, i_tevstr); + g_env_light.setLightTevColorType_MAJI(mBallModel, i_tevstr); - mBtk->setFrame(field_0x590); + mBtk->setFrame(mAnmFrame); mBallModel->getModelData()->entryTexMtxAnimator(mBtk); - mBrk->setFrame(field_0x590); + mBrk->setFrame(mAnmFrame); mBallModel->getModelData()->entryTevRegAnimator(mBrk); mDoExt_modelUpdateDL(mBallModel); diff --git a/src/f_op/f_op_actor_mng.cpp b/src/f_op/f_op_actor_mng.cpp index 5cec04c63ed..4feefacadfc 100644 --- a/src/f_op/f_op_actor_mng.cpp +++ b/src/f_op/f_op_actor_mng.cpp @@ -1907,7 +1907,7 @@ void fopAcM_setEffectMtx(const fopAc_ac_c* i_actor, const J3DModelData* modelDat } /* 8001D5A4-8001D5EC 017EE4 0048+00 1/1 0/0 0/0 .text fopAcM_getProcNameString__FPC10fopAc_ac_c */ -static const char* fopAcM_getProcNameString(const fopAc_ac_c* i_actor) { +const char* fopAcM_getProcNameString(const fopAc_ac_c* i_actor) { s16 prof_name = fopAcM_GetProfName(i_actor); const char* name = dStage_getName2(prof_name, i_actor->argument); return name != NULL ? name : "UNKOWN"; diff --git a/src/f_op/f_op_msg.cpp b/src/f_op/f_op_msg.cpp index e6c201c42a1..70826ba8641 100644 --- a/src/f_op/f_op_msg.cpp +++ b/src/f_op/f_op_msg.cpp @@ -49,6 +49,10 @@ static int fopMsg_Delete(void* i_this) { return ret; } +#if DEBUG +u8 fopMsg::MemCheck; +#endif + /* 80450CF0-80450CF8 0001F0 0004+04 1/1 0/0 0/0 .sbss fopMsg_MSG_TYPE */ static int fopMsg_MSG_TYPE; diff --git a/src/m_Do/m_Do_DVDError.cpp b/src/m_Do/m_Do_DVDError.cpp index eb6402a3c1d..b6f2dd95086 100644 --- a/src/m_Do/m_Do_DVDError.cpp +++ b/src/m_Do/m_Do_DVDError.cpp @@ -10,6 +10,9 @@ #include "m_Do/m_Do_ext.h" #include "m_Do/m_Do_Reset.h" +/* 80450C88-80450C90 000188 0008+00 0/0 2/2 0/0 .sbss None */ +bool mDoDvdErr_initialized; + /* 803DECC0-803DEFE0 00B9E0 0318+08 4/4 0/0 0/0 .bss DvdErr_thread */ static OSThread DvdErr_thread; diff --git a/src/m_Do/m_Do_Reset.cpp b/src/m_Do/m_Do_Reset.cpp index c837645a43d..8d3c8e67eca 100644 --- a/src/m_Do/m_Do_Reset.cpp +++ b/src/m_Do/m_Do_Reset.cpp @@ -109,29 +109,3 @@ void mDoRst_resetCallBack(int port, void*) { mDoRst::onReset(); } } - -/* ############################################################################################## */ -/* 80450C80-80450C88 -00001 0008+00 0/0 6/6 0/0 .sbss None */ -/* 80450C80 0001+00 data_80450C80 None */ -/* 80450C81 0007+00 data_80450C81 None */ -// most of these are probably fake -#pragma push -#pragma force_active on -u8 struct_80450C7C; -u8 struct_80450C7D; -u8 struct_80450C7E; -u8 struct_80450C7F; - -bool SyncWidthSound; -u8 sDefaultDirection; - -u8 struct_80450C82; -u8 struct_80450C83; -u8 struct_80450C84; -u8 struct_80450C85; -u8 struct_80450C86; -u8 struct_80450C87; -#pragma pop - -/* 80450C88-80450C90 000188 0008+00 0/0 2/2 0/0 .sbss None */ -bool mDoDvdErr_initialized; diff --git a/src/m_Do/m_Do_audio.cpp b/src/m_Do/m_Do_audio.cpp index 5134ebabdd7..2318a9d5174 100644 --- a/src/m_Do/m_Do_audio.cpp +++ b/src/m_Do/m_Do_audio.cpp @@ -79,7 +79,7 @@ static void mDoAud_Create() { l_arcCommand->destroy(); mDoAud_zelAudio_c::onInitFlag(); - SyncWidthSound = true; + mDoDvdThd::SyncWidthSound = true; } } diff --git a/src/m_Do/m_Do_dvd_thread.cpp b/src/m_Do/m_Do_dvd_thread.cpp index 23825d720d9..68dd3c8ff6d 100644 --- a/src/m_Do/m_Do_dvd_thread.cpp +++ b/src/m_Do/m_Do_dvd_thread.cpp @@ -30,6 +30,17 @@ mDoDvdThdStack mDoDvdThd::l_threadStack; /* 803DEC60-803DECC0 00B980 0048+18 5/6 0/0 0/0 .bss l_param__9mDoDvdThd */ mDoDvdThd_param_c mDoDvdThd::l_param; +#if DEBUG +u8 mDoDvdThd::verbose; +u8 mDoDvdThd::DVDLogoMode; +bool mDoDvdThd::SyncWidthSound; +u8 mDoDvdThd::Report_DVDRead; +#else +bool mDoDvdThd::SyncWidthSound; +#endif + +u8 sDefaultDirection; + #pragma push #pragma force_active on static u8 padding[0x18]; @@ -111,7 +122,7 @@ void mDoDvdThd_param_c::mainLoop() { while (this->waitForKick() != 0) { while (mDoDvdThd_command_c* command = this->getFirstCommand()) { this->cut(command); - if (SyncWidthSound) { + if (mDoDvdThd::SyncWidthSound) { JASDvd::getThreadPointer()->sendCmdMsg(cb, &command, 4); } else { cb(&command); diff --git a/src/m_Do/m_Do_ext.cpp b/src/m_Do/m_Do_ext.cpp index 34a76f4ae8d..1773e337679 100644 --- a/src/m_Do/m_Do_ext.cpp +++ b/src/m_Do/m_Do_ext.cpp @@ -3180,7 +3180,7 @@ J3DModel* mDoExt_J3DModel__create(J3DModelData* i_modelData, u32 i_modelFlag, u3 } /* 80450C68-80450C70 000168 0004+04 1/1 0/0 0/0 .sbss aram_cache_size */ -static u32 aram_cache_size; +u32 aram_cache_size; /* 80014D5C-80014D64 00F69C 0008+00 0/0 1/1 0/0 .text mDoExt_setAraCacheSize__FUl */ void mDoExt_setAraCacheSize(u32 size) { diff --git a/src/m_Do/m_Do_machine.cpp b/src/m_Do/m_Do_machine.cpp index 989c5c28b35..cd54ce571f8 100644 --- a/src/m_Do/m_Do_machine.cpp +++ b/src/m_Do/m_Do_machine.cpp @@ -26,12 +26,19 @@ #include "m_Do/m_Do_main.h" /* 80450BF0-80450BF4 0000F0 0004+00 1/1 0/0 0/0 .sbss None */ -static u8 mDebugFill; +#if DEBUG +u8 mDoMch::mDebugFill = true; +u8 mDoMch::mDebugFillNotuse = 0xDD; +u8 mDoMch::mDebugFillNew = 0xF7; +u8 mDoMch::mDebugFillDelete = 0xDD; -#ifdef DEBUG -static u8 mDebugFillNotuse; -static u8 mDebugFillNew; -static u8 mDebugFillDelete; +u8 mDoMch::myHeapVerbose; +u8 mDoMch::myHeapCallbackCheck; +u8 mDoMch::FpscrEnableBits; +u8 mDoMch::GXWarningLevel; +u8 mDoMch::GXWarningExecuteFrame; +#else +u8 mDoMch::mDebugFill; #endif /* 80450BF4-80450BF8 0000F4 0004+00 1/1 0/0 0/0 .sbss solidHeapErrors */ @@ -543,11 +550,11 @@ int mDoMch_Create() { OSReportDisable(); } - JKRHeap::setDefaultDebugFill(mDebugFill); + JKRHeap::setDefaultDebugFill(mDoMch::mDebugFill); #ifdef DEBUG - JKRSetDebugFillNotuse(mDebugFillNotuse); - JKRSetDebugFillNew(mDebugFillNew); - JKRSetDebugFillDelete(mDebugFillDelete); + JKRSetDebugFillNotuse(mDoMch::mDebugFillNotuse); + JKRSetDebugFillNew(mDoMch::mDebugFillNew); + JKRSetDebugFillDelete(mDoMch::mDebugFillDelete); #endif JFWSystem::setMaxStdHeap(1); diff --git a/src/m_Do/m_Do_main.cpp b/src/m_Do/m_Do_main.cpp index bba5adc0bf7..0d90e64ebdd 100644 --- a/src/m_Do/m_Do_main.cpp +++ b/src/m_Do/m_Do_main.cpp @@ -12,22 +12,39 @@ #include "JSystem/JKernel/JKRSolidHeap.h" #include "JSystem/JUtility/JUTConsole.h" #include "JSystem/JUtility/JUTReport.h" +#include "JSystem/JUtility/JUTException.h" +#include "JSystem/JUtility/JUTProcBar.h" +#include "JSystem/JHostIO/JORServer.h" #include "Z2AudioLib/Z2WolfHowlMgr.h" #include "c/c_dylink.h" #include "d/d_com_inf_game.h" #include "d/d_s_logo.h" #include "d/d_s_menu.h" #include "d/d_s_play.h" +#include "d/d_debug_pad.h" #include "f_ap/f_ap_game.h" +#include "f_op/f_op_msg.h" #include "m_Do/m_Do_MemCard.h" #include "m_Do/m_Do_Reset.h" #include "m_Do/m_Do_controller_pad.h" #include "m_Do/m_Do_dvd_thread.h" #include "m_Do/m_Do_graphic.h" #include "m_Do/m_Do_machine.h" +#include "m_Do/m_Do_printf.h" +#include "m_Do/m_Do_ext2.h" #include "SSystem/SComponent/c_counter.h" #include +#if PLATFORM_WII || PLATFORM_SHIELD +#include +#endif + +class mDoMain_HIO_c : public mDoHIO_entry_c { +public: + void listenPropertyEvent(const JORPropertyEvent*); + void genMessage(JORMContext*); +}; + /* 800056C0-80005728 000000 0068+00 1/1 0/0 0/0 .text version_check__Fv */ void version_check() { #if !PLATFORM_SHIELD @@ -83,6 +100,10 @@ static HeapCheck* HeapCheckTable[8] = { &ArchiveHeapCheck, &J2dHeapCheck, &HostioHeapCheck, &CommandHeapCheck, }; +#if DEBUG +mDoMain_HIO_c mDoMain_HIO; +#endif + void printFrameLine() { OSCalendarTime calendar; OSTime time = OSGetTime(); @@ -187,6 +208,10 @@ int mDoMain::e3menu_no = -1; /* 80450588-80450590 000008 0008+00 2/2 0/0 0/0 .sdata None */ u8 mHeapBriefType = 4; +#if DEBUG +static u8 memorycheck_check_frame; +#endif + /* 80450B00-80450B08 000000 0008+00 1/1 0/0 0/0 .sbss None */ static u8 fillcheck_check_frame; @@ -200,11 +225,20 @@ OSTime mDoMain::sHungUpTime; /* 80450B18 0001+00 data_80450B18 None */ static u8 mDisplayHeapSize; +#if DEBUG +static u8 mReportDisable; +#endif + /* 80450B19 0001+00 data_80450B19 None */ static u8 mSelectHeapBar; +#if DEBUG +static u8 mVisibleHeapBar; +static u8 mPrintFrameLine; +#endif + /* 80450B1A 0002+00 data_80450B1A None */ -static bool mCheckHeap; +static u8 mCheckHeap; /* 80005AD8-80005D4C 000418 0274+00 1/1 0/0 0/0 .text debugDisplay__Fv */ void debugDisplay() { @@ -272,6 +306,210 @@ void my_genCheckBox(JORMContext* mctx, const char* label, u8* pSrc, u8 mask) { mctx->genCheckBox(label, pSrc, mask, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); } +#if DEBUG +void mDoMain_HIO_c::genMessage(JORMContext* mctx) { + mctx->genSlider("コード破壊チェックフレーム", &memorycheck_check_frame, 0, 0xFF, 0, NULL, 0xFFFF, + 0xFFFF, 0x200, 0x18); + mctx->genButton("コード破壊チェックcheck", 0, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genButton("コード破壊チェックsave", 1, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genButton("コード破壊チェックdiff", 2, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genCheckBox("デバッグフィル", &mDoMch::mDebugFill, 1, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genSlider("ヒープ破壊チェックフレーム", &fillcheck_check_frame, 0, 0xFF, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genButton("ヒープ破壊チェック", 3, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genButton("ヒープFree領域フィル", 4, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genButton("浮動小数点例外を(再び)有効にする", 5, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genCheckBox("◎無効演算", &mDoMch::FpscrEnableBits, 0x80, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genCheckBox("○オーバー", &mDoMch::FpscrEnableBits, 0x40, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genCheckBox("△アンダー", &mDoMch::FpscrEnableBits, 0x20, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genCheckBox("○ゼロ除算", &mDoMch::FpscrEnableBits, 0x10, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genCheckBox("▲不正確 ", &mDoMch::FpscrEnableBits, 0x8, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + + mctx->genLabel("ソースファイル:m_Do_main.cpp", 0, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genCheckBox("OSReport 表示しない", &mReportDisable, 1, 0, NULL, 0xFFFF, 0xFFFF, 0x200, + 0x18); + mctx->genCheckBox("OSReport 優先度最高", &print_highPriority, 1, 0, NULL, 0xFFFF, 0xFFFF, 0x200, + 0x18); + mctx->genCheckBox("OSReport スレッド表示", &print_threadID, 1, 0, NULL, 0xFFFF, 0xFFFF, + 0x200, 0x18); + mctx->genCheckBox("OSReport CallerPC表示", &print_callerPC, 1, 0, NULL, 0xFFFF, 0xFFFF, + 0x200, 0x18); + mctx->genSlider("レベル", &print_callerPCLevel, 3, 10, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + + mctx->startComboBox("簡易ヒープ表示", &mHeapBriefType, 0, NULL, 0xFFFF, 0xFFFF, 0x100, 0x1a); + mctx->genComboBoxItem("なし", 0); + mctx->genComboBoxItem("合計空き・最大空き", 1); + mctx->genComboBoxItem("最大使用量・ヒープサイズ元使用量", 2); + mctx->genComboBoxItem("使用ブロック数・元使用量", 3); + mctx->genComboBoxItem("相対 使用ブロック数・元使用量", 4); + mctx->endComboBox(); + + my_genCheckBox(mctx, "ヒープサイズ表示を行う", &mDisplayHeapSize, 1); + mctx->genCheckBox("ヒープバーを表示する", &mVisibleHeapBar, 1, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + + mctx->startComboBox("ヒープバーの種類", &mSelectHeapBar, 0, NULL, 0xFFFF, 0xFFFF, 0x100, 0x1a); + mctx->genComboBoxItem("カレント", 0); + for (int i = 0; i < 8; i++) { + mctx->genComboBoxItem(HeapCheckTable[i]->getJName(), i + 1); + } + mctx->endComboBox(); + + mctx->genCheckBox("ヒープチェック", &mCheckHeap, 1, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genCheckBox("フレームバー表示", &mPrintFrameLine, 1, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + + mctx->startComboBox("GX警告レベル", &mDoMch::GXWarningLevel, 0, NULL, 0xFFFF, 0xFFFF, 0x100, 0x1a); + mctx->genComboBoxItem("エラー&警告なし", 0); + mctx->genComboBoxItem("致命的なエラー", 1); + mctx->genComboBoxItem("中警告と全エラー", 2); + mctx->genComboBoxItem("すべての警告", 3); + mctx->endComboBox(); + + mctx->genButton("GX警告を1フレームだけ実行", 9, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genButton("ダイナミックリンク状況をダンプ", 7, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genButton("ダイナミックリンクカウンタをリセット", 8, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genButton("ARAMヒープをダンプ", 10, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genButton("ゲームリソースをダンプ", 11, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genButton("RES_CONTROLをダンプ", 12, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genButton("ルートヒープをダンプ", 13, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genButton("システムヒープをダンプ", 14, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genButton("ゼルダヒープをダンプ", 15, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genButton("ゲームヒープをダンプ", 16, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genButton("アーカイブヒープをダンプ", 17, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genButton("J2Dヒープをダンプ", 18, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genButton("ホストIOヒープをダンプ", 19, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + mctx->genButton("コマンドヒープをダンプ", 20, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 0x18); + + mctx->genCheckBox("ダイナミックリンク冗長表示", &DynamicModuleControlBase::verbose, 1, 0, NULL, 0xFFFF, 0xFFFF, + 0x200, 0x18); + mctx->genCheckBox("ヒープコールバック冗長表示", &mDoMch::myHeapVerbose, 1, 0, NULL, 0xFFFF, 0xFFFF, + 0x200, 0x18); + mctx->genCheckBox("ヒープコールバックチェック", &mDoMch::myHeapCallbackCheck, 1, 0, NULL, 0xFFFF, 0xFFFF, + 0x200, 0x18); + mctx->genCheckBox("mDoDvdThd::verbose冗長表示", &mDoDvdThd::verbose, 1, 0, NULL, 0xFFFF, 0xFFFF, + 0x200, 0x18); + mctx->genCheckBox("mDoDvdThd::DVDRead冗長表示", &mDoDvdThd::Report_DVDRead, 1, 0, NULL, 0xFFFF, 0xFFFF, + 0x200, 0x18); + mctx->genCheckBox("mDoDvdThd::DVDログモード", &mDoDvdThd::DVDLogoMode, 1, 0, NULL, 0xFFFF, 0xFFFF, + 0x200, 0x18); + mctx->genCheckBox("fopMsg::MemCheck ヒープチェック", &fopMsg::MemCheck, 1, 0, NULL, 0xFFFF, + 0xFFFF, 0x200, 0x18); +} + +void mDoMain_HIO_c::listenPropertyEvent(const JORPropertyEvent* property) { + JORMContext* mctx = attachJORMContext(8); + JORReflexible::listenPropertyEvent(property); + + if ((u32)property->id >= 13 && (u32)property->id <= 20) { + int sp14 = (u32)property->id - 13; + HeapCheck* heapCheck = HeapCheckTable[sp14]; + JUTReportConsole_f("\n[%sHeap]\n", heapCheck->getName()); + heapCheck->getHeap()->dump_sort(); + } else { + switch ((u32)property->id) { + case 0: + FixedMemoryCheck::checkAll(); + break; + case 1: + FixedMemoryCheck::saveAll(); + break; + case 2: + FixedMemoryCheck::diffAll(); + break; + case 3: + mDoMch_HeapCheckAll(); + break; + case 4: + mDoMch_HeapFreeFillAll(); + break; + case 5: { + u32 fpscr = PPCMffpscr(); + JUTException::setFPException(0); + JUTException::setFPException(mDoMch::FpscrEnableBits); + PPCMtfpscr(fpscr); + break; + } + case 9: + GXSetVerifyLevel(GX_WARN_ALL); + mDoMch::GXWarningExecuteFrame = TRUE; + break; + case 7: { + int RoomId = dComIfGp_roomControl_getStayNo(); + JUTReportConsole_f("\nRoomId = %d\n", RoomId); + + JUTReportConsole_f("\nDynamicModule\n"); + DynamicModuleControlBase::dump(); + break; + } + case 8: + DynamicModuleControlBase::resetDoLinkCount(); + break; + case 10: { + JUTReportConsole_f("\nAramHeap\n"); + JKRAramHeap* aramHeap = JKRAram::getAramHeap(); + if (aramHeap != NULL) { + aramHeap->dump(); + } + break; + } + case 11: + JUTReportConsole_f("\nGameResource\n"); + g_dComIfG_gameInfo.mResControl.dump(); + break; + case 12: + JUTReportConsole_f("\nResControl\n"); + dComIfG_dumpResControl(); + break; + case 6: + default: + if ((u8*)property->id == &mDisplayHeapSize) { + mctx->startUpdateNode(this); + mctx->endUpdateNode(); + } + + if ((u8*)property->id == &mReportDisable) { + if (mReportDisable == 0) { + OSReportEnable(); + } else { + OSReportDisable(); + } + } + + if ((u8*)property->id == &mSelectHeapBar) { + JKRHeap* heap = NULL; + u32 select_heap = mSelectHeapBar - 1; + if (select_heap < 8) { + heap = HeapCheckTable[select_heap]->getHeap(); + } + + JUTProcBar::getManager()->setWatchHeap(heap); + } + + if ((u8*)property->id == &mVisibleHeapBar) { + JUTProcBar::getManager()->setVisibleHeapBar(mVisibleHeapBar); + } + + if ((u8*)property->id == &mDoMch::GXWarningLevel) { + GXSetVerifyLevel((GXWarningLevel)mDoMch::GXWarningLevel); + } + + if ((u8*)property->id == &mDoMch::mDebugFill) { + JKRHeap::setDefaultDebugFill(mDoMch::mDebugFill); + + for (JSUTree* i = JKRGetRootHeap()->getHeapTree().getFirstChild(); i != NULL; i = i->getNextChild()) { + JKRHeap* heap = i->getObject(); + heap->setDebugFill(mDoMch::mDebugFill); + } + } + + JKRSetDebugFillNotuse(mDoMch::mDebugFillNotuse); + JKRSetDebugFillNew(mDoMch::mDebugFillNew); + JKRSetDebugFillDelete(mDoMch::mDebugFillDelete); + } + } + + releaseJORMContext(mctx); +} +#endif + /* 80005D4C-8000614C 00068C 0400+00 1/1 0/0 0/0 .text Debug_console__FUl */ bool Debug_console(u32 i_padNo) { JUTConsole* console = JFWSystem::getSystemConsole(); @@ -395,6 +633,12 @@ s32 LOAD_COPYDATE(void*) { /* 800061C8-8000628C 000B08 00C4+00 1/1 0/0 0/0 .text debug__Fv */ static void debug() { + #if DEBUG + if (mPrintFrameLine) { + printFrameLine(); + } + #endif + if (mDoMain::developmentMode) { if (mCheckHeap) { CheckHeap(PAD_3); @@ -410,68 +654,82 @@ static void debug() { if ((mDoCPd_c::getGamePad(PAD_3)->getButton() & ~PAD_TRIGGER_Z) == PAD_TRIGGER_L && mDoCPd_c::getGamePad(PAD_3)->testTrigger(PAD_TRIGGER_Z)) { - mHeapBriefType < 5 ? mHeapBriefType++ : mHeapBriefType = 1; + if (mHeapBriefType < 5) { + mHeapBriefType++; + } else { + mHeapBriefType = 1; + } } debugDisplay(); } + #if DEBUG + if (!dDebugPad.Active()) { + Debug_console(PAD_3); + } + #else Debug_console(PAD_3); + #endif + + #if DEBUG + fapGm_HIO_c::startCpuTimer(); + + if (fapGmHIO_getHostIO()) { + JKRHeap* var_r30 = mDoExt_getHostIOHeap(); + JKRHeap* var_r29 = mDoExt_setCurrentHeap(var_r30); + JOR_MESSAGELOOP(); + mDoExt_setCurrentHeap(var_r29); + } + + fapGm_HIO_c::printCpuTimer(""); + fapGm_HIO_c::stopCpuTimer("ホストIO"); + fapGm_HIO_c::printCpuTimer("\n↑↑↑↑↑↑↑↑↑↑ CPU時間計測終了 ↑↑↑↑↑↑↑↑↑↑\n"); + fapGm_HIO_c::offCpuTimer(); + #endif } } /* 8000628C-80006454 000BCC 01C8+00 1/1 0/0 0/0 .text main01__Fv */ void main01(void) { - static u32 frame; + OS_REPORT("\x1b[m"); // Setup heaps, setup exception manager, set RNG seed, setup DVDError Thread, setup Memory card Thread mDoMch_Create(); + #if DEBUG + // not sure how this works. appears to be getting .text, .ctors, .dtors, and .rodata areas + FixedMemoryCheck::easyCreate((void*)0x80006880, (s32)0x628F40); + FixedMemoryCheck::easyCreate((void*)0x8062F7C0, (s32)0x224); + FixedMemoryCheck::easyCreate((void*)0x8062FA00, (s32)0xc); + FixedMemoryCheck::easyCreate((void*)0x8062FA20, (s32)0x30568); + #endif + // setup FrameBuffer and ZBuffer, init display lists mDoGph_Create(); // Setup control pad mDoCPd_c::create(); - RootHeapCheck.setHeap((JKRExpHeap*)JKRHeap::getRootHeap()); - if (JKRHeap::getRootHeap()) { - RootHeapCheck.setHeapSize(JKRHeap::getRootHeap()->getSize()); - } - - SystemHeapCheck.setHeap((JKRExpHeap*)JKRHeap::getSystemHeap()); - if (JKRHeap::getSystemHeap()) { - SystemHeapCheck.setHeapSize(JKRHeap::getSystemHeap()->getSize()); - } - + RootHeapCheck.setHeap((JKRExpHeap*)JKRGetRootHeap()); + SystemHeapCheck.setHeap((JKRExpHeap*)JKRGetSystemHeap()); ZeldaHeapCheck.setHeap(mDoExt_getZeldaHeap()); - if (ZeldaHeapCheck.getHeap()) { - ZeldaHeapCheck.setHeapSize(ZeldaHeapCheck.getHeap()->getSize()); - } - GameHeapCheck.setHeap(mDoExt_getGameHeap()); - if (GameHeapCheck.getHeap()) { - GameHeapCheck.setHeapSize(GameHeapCheck.getHeap()->getSize()); - } - ArchiveHeapCheck.setHeap(mDoExt_getArchiveHeap()); - if (ArchiveHeapCheck.getHeap()) { - ArchiveHeapCheck.setHeapSize(ArchiveHeapCheck.getHeap()->getSize()); - } - J2dHeapCheck.setHeap(mDoExt_getJ2dHeap()); - if (J2dHeapCheck.getHeap()) { - J2dHeapCheck.setHeapSize(J2dHeapCheck.getHeap()->getSize()); - } - HostioHeapCheck.setHeap(mDoExt_getHostIOHeap()); - if (HostioHeapCheck.getHeap()) { - HostioHeapCheck.setHeapSize(HostioHeapCheck.getHeap()->getSize()); - } - CommandHeapCheck.setHeap(mDoExt_getCommandHeap()); - if (CommandHeapCheck.getHeap()) { - CommandHeapCheck.setHeapSize(CommandHeapCheck.getHeap()->getSize()); - } + + #if DEBUG + JKRHeap* var_r28 = mDoExt_getHostIOHeap(); + JKRHeap* sp10 = mDoExt_setCurrentHeap(var_r28); + JOR_INIT(); + JOR_SETROOTNODE("root", &mDoHIO_root, 4, 3); + mDoExt_setCurrentHeap(sp10); + + var_r28->dump_sort(); + OSReport("\x1b[36mHOSTIOヒープ残り %u Bytes\n\x1b[m", var_r28->getTotalFreeSize()); + #endif JUTConsole* console = JFWSystem::getSystemConsole(); console->setOutput(mDoMain::developmentMode ? JUTConsole::OUTPUT_OSR_AND_CONSOLE : @@ -480,25 +738,70 @@ void main01(void) { mDoDvdThd_callback_c::create((mDoDvdThd_callback_func)LOAD_COPYDATE, NULL); fapGm_Create(); // init framework + + #if DEBUG + mDoMain_HIO.entryHIO("メイン"); + g_regHIO.id = mDoHIO_createChild("レジスタ", &g_regHIO); + g_presetHIO.field_0x4 = mDoHIO_createChild("状況ファイル", &g_presetHIO); + #endif + fopAcM_initManager(); mDisplayHeapSize = 0; cDyl_InitAsync(); // init RELs - g_mDoAud_audioHeap = JKRSolidHeap::create(0x14D800, JKRHeap::getCurrentHeap(), false); + #if VERSION == VERSION_SHIELD_DEBUG + const int audioHeapSize = 0x169000; + #else + const int audioHeapSize = 0x14D800; + #endif + g_mDoAud_audioHeap = JKRCreateSolidHeap(audioHeapSize, JKRHeap::getCurrentHeap(), false); do { + static u32 frame; frame++; + + #if DEBUG + if (memorycheck_check_frame != 0 && frame % memorycheck_check_frame == 0) { + FixedMemoryCheck::checkAll(); + } + #endif + if (fillcheck_check_frame != 0 && frame % fillcheck_check_frame == 0) { mDoMch_HeapCheckAll(); } - if (SyncWidthSound) { - g_mDoMemCd_control.update(); + if (mDoDvdThd::SyncWidthSound) { + mDoMemCd_UpDate(); } mDoCPd_c::read(); // read controller input + + #if DEBUG + if (mDoMch::GXWarningExecuteFrame) { + GXSetVerifyLevel(GX_WARN_ALL); + } + #endif + fapGm_Execute(); // handle game execution + + #if DEBUG + if (mDoMch::GXWarningExecuteFrame) { + mDoMch::GXWarningExecuteFrame = 0; + GXSetVerifyLevel((GXWarningLevel)mDoMch::GXWarningLevel); + } + #endif + + #if DEBUG + fapGm_HIO_c::startCpuTimer(); + #endif + mDoAud_Execute(); // handle audio execution + + #if DEBUG + fapGm_HIO_c::printCpuTimer(""); + fapGm_HIO_c::stopCpuTimer("オーディオ"); + #endif + debug(); // run debugger } while (true); } @@ -595,14 +898,18 @@ static u8 mainThreadStack[32768]; static OSThread mainThread; /* 80006454-800065D8 000D94 0184+00 0/0 1/1 0/0 .text main */ -void main() { +void main(int argc, const char* argv[]) { OSThread* current_thread = OSGetCurrentThread(); u8* stack = mainThreadStack; mDoMain::sPowerOnTime = OSGetTime(); OSReportInit(); version_check(); - mDoRstData* reset_data = (mDoRstData*)OSAllocFromArenaLo(0x18, 4); - mDoRst::setResetData(reset_data); + + #if PLATFORM_WII || PLATFORM_SHIELD + mDoRst::setResetData((mDoRstData*)OSAllocFromMEM1ArenaLo(0x18, 4)); + #else + mDoRst::setResetData((mDoRstData*)OSAllocFromArenaLo(0x18, 4)); + #endif if (!mDoRst::getResetData()) { do { @@ -622,7 +929,23 @@ void main() { mDoRst::offReturnToMenu(); } - g_dComIfG_gameInfo.ct(); + #if PLATFORM_WII || PLATFORM_SHIELD + SCInit(); + #endif + + dComIfG_ct(); + + #if PLATFORM_WII || PLATFORM_SHIELD + u32 status; + do { + status = SCCheckStatus(); + } while (status != 0); + JUT_ASSERT(1785, status != 2); + #endif + + #if DEBUG + parse_args(argc, argv); + #endif if (mDoMain::developmentMode < 0) { DVDDiskID* disk_id = DVDGetCurrentDiskID(); @@ -637,9 +960,11 @@ void main() { } } + OS_REPORT("メインスレッドを作成します\n"); s32 priority = OSGetThreadPriority(current_thread); OSCreateThread(&mainThread, (void*(*)(void*))main01, 0, stack + sizeof(mainThreadStack), sizeof(mainThreadStack), priority, 0); OSResumeThread(&mainThread); + OS_REPORT("メインスレッドを起動しました <%x>\n", &mainThread); OSSetThreadPriority(current_thread, 0x1F); OSSuspendThread(current_thread); } diff --git a/src/m_Do/m_Do_printf.cpp b/src/m_Do/m_Do_printf.cpp index 64adf2f620d..e61eb7a2b52 100644 --- a/src/m_Do/m_Do_printf.cpp +++ b/src/m_Do/m_Do_printf.cpp @@ -5,7 +5,7 @@ #include "m_Do/m_Do_printf.h" #include "stdio.h" -#include "dolphin/base/PPCArch.h" +#include #include "m_Do/m_Do_ext.h" /* 80450B98-80450B9C -00001 0004+00 0/0 6/6 0/0 .sbss None */ @@ -87,47 +87,66 @@ void OSReportForceEnableOff() { __OSReport_enable = false; } -/* ############################################################################################## */ /* 80450BA0-80450BA4 0000A0 0004+00 1/1 0/0 0/0 .sbss __OSReport_MonopolyThread */ static OSThread* __OSReport_MonopolyThread; +#if DEBUG +OSMutex print_mutex; +u8 print_mutex_initialized; +u8 print_highPriority; +u8 print_threadID; +u8 print_callerPC; +u8 print_callerPCLevel = 3; +#endif + /* 80450BA4-80450BA8 0000A4 0004+00 1/1 0/0 0/0 .sbss print_counts */ -static u32 print_counts; +u32 print_counts; /* 80450BA8-80450BAC 0000A8 0004+00 2/2 0/0 0/0 .sbss print_errors */ -static u32 print_errors; +u32 print_errors; /* 80450BAC-80450BB0 0000AC 0004+00 1/1 0/0 0/0 .sbss print_warings */ -static u32 print_warings; +u32 print_warings; /* 80450BB0-80450BB4 0000B0 0004+00 1/1 0/0 0/0 .sbss print_systems */ -static u32 print_systems; +u32 print_systems; /* 80450BB4-80450BB8 -00001 0004+00 3/3 0/0 0/0 .sbss None */ -static bool print_initialized; +u8 print_initialized; static bool data_80450BB5; /* 800068C4-800068DC 001204 0018+00 1/1 1/1 0/0 .text OSReportInit__Fv */ void OSReportInit() { - if (print_initialized) { - return; + BOOL enabled; + + if (!print_initialized) { + #if DEBUG + enabled = OSDisableInterrupts(); + if (!print_mutex_initialized) { + OSInitMutex(&print_mutex); + print_mutex_initialized = true; + my_PutString("\x1b[m\x1b[33m*** OSVReport - OSInitMutex ***\n\x1b[m"); + } + OSRestoreInterrupts(enabled); + #endif + + print_initialized = true; } - print_initialized = true; } -/* ############################################################################################## */ /* 803DB740-803DBF40 008460 0800+00 1/1 0/0 0/0 .bss mDoPrintf_FiberStack */ static u8 mDoPrintf_FiberStack[2048] ALIGN_DECL(32); /* 800068DC-80006964 00121C 0088+00 1/1 0/0 0/0 .text * mDoPrintf_vprintf_Interrupt__FPCcP16__va_list_struct */ void mDoPrintf_vprintf_Interrupt(char const* fmt, va_list args) { - s32 interruptStatus = OSDisableInterrupts(); + BOOL interruptStatus = OSDisableInterrupts(); if (!data_80450BB5) { data_80450BB5 = true; + uintptr_t var_r29 = (uintptr_t)&mDoPrintf_FiberStack + sizeof(mDoPrintf_FiberStack); OSSwitchFiberEx((uintptr_t)fmt, (uintptr_t)args, 0, 0, (uintptr_t)vprintf, - (uintptr_t)&mDoPrintf_FiberStack + sizeof(mDoPrintf_FiberStack)); + var_r29); data_80450BB5 = false; } OSRestoreInterrupts(interruptStatus); @@ -136,7 +155,26 @@ void mDoPrintf_vprintf_Interrupt(char const* fmt, va_list args) { /* 80006964-80006984 0012A4 0020+00 1/1 0/0 0/0 .text * mDoPrintf_vprintf_Thread__FPCcP16__va_list_struct */ void mDoPrintf_vprintf_Thread(char const* fmt, va_list args) { + #if DEBUG + OSLockMutex(&print_mutex); + OSThread* thread = NULL; + s32 priority; + + if (print_highPriority) { + thread = OSGetCurrentThread(); + priority = OSGetThreadPriority(thread); + OSSetThreadPriority(thread, 0); + } + #endif + vprintf(fmt, args); + + #if DEBUG + if (thread != NULL) { + OSSetThreadPriority(thread, priority); + } + OSUnlockMutex(&print_mutex); + #endif } /* 80006984-80006A10 0012C4 008C+00 4/4 0/0 0/0 .text mDoPrintf_vprintf__FPCcP16__va_list_struct @@ -146,12 +184,16 @@ void mDoPrintf_vprintf(char const* fmt, va_list args) { if (currentThread == NULL) { mDoPrintf_vprintf_Interrupt(fmt, args); } else { + #if DEBUG + mDoPrintf_vprintf_Thread(fmt, args); + #else u8* stackPtr = (u8*)OSGetStackPointer(); if (stackPtr < (u8*)currentThread->stackEnd + 0xA00 || stackPtr > currentThread->stackBase) { mDoPrintf_vprintf_Interrupt(fmt, args); } else { mDoPrintf_vprintf_Thread(fmt, args); } + #endif } } @@ -202,6 +244,13 @@ void OSReport_FatalError(const char* fmt, ...) { void OSReport_Error(const char* fmt, ...) { print_errors++; if (!__OSReport_Error_disable) { + #if DEBUG + OSThread* thread = mDoExt_GetCurrentRunningThread(); + if (thread != NULL) { + OSLockMutex(&print_mutex); + } + #endif + va_list args; va_start(args, fmt); OSReportForceEnableOn(); @@ -211,6 +260,12 @@ void OSReport_Error(const char* fmt, ...) { OSReportForceEnableOff(); fflush(stdout); va_end(args); + + #if DEBUG + if (thread != NULL) { + OSUnlockMutex(&print_mutex); + } + #endif } } @@ -261,7 +316,8 @@ void OSPanic(const char* file, int line, const char* fmt, ...) { OSAttention("0x%08x: 0x%08x 0x%08x\n", p, p[0], p[1]); } - tmp = (u32*)0x1234567; // ?????? + // force a crash by writing to an invalid address + tmp = (u32*)0x1234567; *tmp = 0x1234567; PPCHalt(); }