add missing class and clang-format

This commit is contained in:
unknown
2020-12-25 21:16:13 -05:00
244 changed files with 16175 additions and 15556 deletions
+150 -1
View File
@@ -1 +1,150 @@
// ok
#include "d/d_a/d_a_alink/d_a_alink.h"
#include "f/f_pc/f_pc_searcher.h"
u32 daAlink_c::getE3Zhint(void){
return 0;
}
asm const char* daAlink_c::getAlinkArcName(void){
nofralloc
#include "d/d_a/d_a_alink/asm/func_8009D884.s"
}
asm void daAlink_tgHitCallback(fopAc_ac_c*, dCcD_GObjInf*,fopAc_ac_c*, dCcD_GObjInf*){
nofralloc
#include "d/d_a/d_a_alink/asm/func_8009D88C.s"
}
asm void daAlink_coHitCallback(fopAc_ac_c*, dCcD_GObjInf*,fopAc_ac_c*, dCcD_GObjInf*){
nofralloc
#include "d/d_a/d_a_alink/asm/func_8009D8B8.s"
}
void daAlink_matAnm_c::init(void){
float init = lbl_80452CC0;
unk244 = init;
unk248 = init;
unk252 = init;
unk256 = init;
lbl_80450FC8 = 0;
lbl_80450FC9 = 0;
unk260 = 0;
}
asm void daAlink_matAnm_c::calc(J3DMaterial*) const{
nofralloc
#include "d/d_a/d_a_alink/asm/func_8009D90C.s"
}
// 1 missing mr instruction
#ifdef NONMATCHING
u32 daAlink_c::checkStageName(const char* stage){
return (u32)__cntlzw(strcmp(g_dComIfG_gameInfo.stage,(char*)stage)) >> 5; // no idea if current stage vars are a struct or part of some class
}
#else
asm u32 daAlink_c::checkStageName(char const* stage){
nofralloc
#include "d/d_a/d_a_alink/asm/func_8009DA60.s"
}
#endif
asm void daAlink_c::tgHitCallback(fopAc_ac_c*, dCcD_GObjInf*, dCcD_GObjInf*){
nofralloc
#include "d/d_a/d_a_alink/asm/func_8009DA98.s"
}
asm void daAlink_c::coHitCallback(fopAc_ac_c*, dCcD_GObjInf*){
nofralloc
#include "d/d_a/d_a_alink/asm/func_8009DB64.s"
}
asm void daAlink_c::setMatrixWorldAxisRot(float(*)[4],short,short,short,int,const cXyz*){
nofralloc
#include "d/d_a/d_a_alink/asm/func_8009DC6C.s"
}
asm bool daAlink_c::jointControll(int){
nofralloc
#include "d/d_a/d_a_alink/asm/func_8009DD90.s"
}
asm void daAlink_c::setUpperFront(void){
nofralloc
#include "d/d_a/d_a_alink/asm/func_8009E7B8.s"
}
asm void daAlink_c::changeBlendRate(int){
nofralloc
#include "d/d_a/d_a_alink/asm/func_8009E91C.s"
}
asm void daAlink_c::resetRootMtx(void){
nofralloc
#include "d/d_a/d_a_alink/asm/func_8009EB18.s"
}
asm bool daAlink_c::modelCallBack(int){
nofralloc
#include "d/d_a/d_a_alink/asm/func_8009EB58.s"
}
asm bool daAlink_modelCallBack(J3DJoint*, int){
nofralloc
#include "d/d_a/d_a_alink/asm/func_8009EC28.s"
}
asm bool daAlink_c::headModelCallBack(int){
nofralloc
#include "d/d_a/d_a_alink/asm/func_8009ECA0.s"
}
asm bool daAlink_headModelCallBack(J3DJoint*, int){
nofralloc
#include "d/d_a/d_a_alink/asm/func_8009EF38.s"
}
asm bool daAlink_c::wolfModelCallBack(int){
nofralloc
#include "d/d_a/d_a_alink/asm/func_8009EF7C.s"
}
asm bool daAlink_wolfModelCallBack(J3DJoint*, int){
nofralloc
#include "d/d_a/d_a_alink/asm/func_8009EFF0.s"
}
asm void daAlink_c::setHatAngle(void){
nofralloc
#include "d/d_a/d_a_alink/asm/func_8009F034.s"
}
asm void daAlink_c::calcHairAngle(short*){
nofralloc
#include "d/d_a/d_a_alink/asm/func_8009FFF8.s"
}
asm void daAlink_c::setHairAngle(cXyz*,float,float){
nofralloc
#include "d/d_a/d_a_alink/asm/func_800A002C.s"
}
asm void daAlink_c::setLookPosFromOut(cXyz*){
nofralloc
#include "d/d_a/d_a_alink/asm/func_800A0744.s"
}
asm int daAlink_c::checkAttentionPosAngle(cXyz*){
nofralloc
#include "d/d_a/d_a_alink/asm/func_800A07D8.s"
}
asm bool daAlink_c::checkActorPosAngle(fopAc_ac_c*, cXyz**){
nofralloc
#include "d/d_a/d_a_alink/asm/func_800A0868.s"
}
asm cXyz* daAlink_c::getNeckAimPos(cXyz*, int*, int){
nofralloc
#include "d/d_a/d_a_alink/asm/func_800A093C.s"
}
+3 -11
View File
@@ -1,20 +1,12 @@
#include "d/d_a/d_a_horse_static/d_a_horse_static.h"
#include "global.h"
// 1 instruction off
#ifdef NONMATCHING
u32 e_wb_class::checkWait(void){
u32 temp;
temp = (0x2a - (this->unk1460)); // missing a cntlzw
return temp >> 5 & 0xff;
temp = __cntlzw(0x2a - this->unk1460);
return (u8)(temp >> 5);
}
#else
asm u32 e_wb_class::checkWait(void) {
nofralloc
#include "d/d_a/d_a_horse_static/asm/func_80037C7C.s"
}
#endif
void e_wb_class::setPlayerRideNow(void){
this->unk1680 = 0x67;
@@ -29,7 +21,7 @@ void e_wb_class::setPlayerRide(void){
this->unk1460 = 0;
this->unk1726 |= 3;
setLinkRiding(true); // needs something else here
setLinkRiding(true); // needs to call Z2CreatureRide
}
#else
asm void e_wb_class::setPlayerRide(void) {
+17 -1
View File
@@ -1 +1,17 @@
// ok
#include "d/d_bomb/d_bomb.h"
bool dBomb_c::checkStateCarry(){
return ((unk_3 & 0x2000) != 0 || (unk_3 & 0x100000) != 0 || unk_2 == 2 || unk_2 == 1);
}
bool dBomb_c::checkFlowerBombWait(fopAc_ac_c* param_1){
return (unk_1 == 0x221 && unk_2 == 4);
}
bool dBomb_c::checkWaterBomb(fopAc_ac_c* param_1){
return (unk_1 == 0x221 && (unk_4 & 0x10)!=0);
}
bool dBomb_c::checkInsectBombMove(fopAc_ac_c* param_1){
return (unk_1 == 0x221 && unk_2 == 7);
}
+326 -362
View File
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -93,7 +93,7 @@ u16 dSv_player_status_a_c::getRupeeMax(void) const {
BOOL dSv_player_status_a_c::isMagicFlag(u8 i_magic) const {
if (i_magic == 0) {
return g_dComIfG_gameInfo.save_file.getEventFlags().isEventBit(0x2304);
return g_dComIfG_gameInfo.info.getSaveFile().getEventFlags().isEventBit(0x2304);
}
return (this->mMagicFlag & (u8)(1 << i_magic)) ? TRUE : FALSE;
}
@@ -252,7 +252,7 @@ void dSv_player_item_c::setItem(int current_items_index, u8 new_items_index) {
int select_item_index = DEFAULT_SELECT_ITEM_INDEX;
do {
if (current_items_index == g_dComIfG_gameInfo.save_file.getPlayerStatusA().getSelectItemIndex(select_item_index)) {
if (current_items_index == g_dComIfG_gameInfo.info.getSaveFile().getPlayerStatusA().getSelectItemIndex(select_item_index)) {
dComIfGp_setSelectItem(select_item_index);
}
select_item_index++;
@@ -632,7 +632,7 @@ void dSv_player_item_record_c::setBottleNum(u8 i_bottleIdx, u8 bottle_num) {
u8 dSv_player_item_record_c::addBottleNum(u8 i_bottleIdx, s16 param_2) {
int iVar3 = this->mBottles[i_bottleIdx] + param_2;
g_dComIfG_gameInfo.save_file.getPlayerItem().getItem((u8)(i_bottleIdx + 0xB), true);
g_dComIfG_gameInfo.info.getSaveFile().getPlayerItem().getItem((u8)(i_bottleIdx + 0xB), true);
if (iVar3 < 0) {
this->mBottles[i_bottleIdx] = 0;
@@ -676,7 +676,7 @@ u8 dSv_player_item_max_c::getBombNum(u8 param_1) const {
u8 iVar3;
iVar3 = 0x1;
if (g_dComIfG_gameInfo.save_file.getPlayerGetItem().isFirstBit(BOMB_BAG_LV2)) {
if (g_dComIfG_gameInfo.info.getSaveFile().getPlayerGetItem().isFirstBit(BOMB_BAG_LV2)) {
iVar3 = 0x2;
}
+2 -2
View File
@@ -47,7 +47,7 @@ int fpcEx_ToLineQ(base_process_class *pProc)
base_process_class *pLayerPcNode = pLayer->mpPcNode;
if (pLayer->mLayerID == 0 || cTg_IsUse(&pLayerPcNode->mLnTg) == true) {
int ret = fpcLnTg_ToQueue(&pProc->mLnTg, pProc->mPi.b.mListID);
int ret = fpcLnTg_ToQueue(&pProc->mLnTg, pProc->mPi.mInfoCurr.mListID);
if (ret == 0) {
fpcLyTg_QueueTo(&pProc->mLyTg);
return 0;
@@ -78,7 +78,7 @@ int fpcEx_ExecuteQTo(base_process_class *pProc)
int fpcEx_ToExecuteQ(base_process_class *pProc)
{
int ret = fpcLyTg_ToQueue(&pProc->mLyTg, pProc->mPi.b.mLayer, pProc->mPi.b.mListID, pProc->mPi.b.mListPrio);
int ret = fpcLyTg_ToQueue(&pProc->mLyTg, pProc->mPi.mInfoCurr.mLayer, pProc->mPi.mInfoCurr.mListID, pProc->mPi.mInfoCurr.mListPrio);
if (ret == 1) {
fpcEx_ToLineQ(pProc);
return 1;
+2 -2
View File
@@ -22,8 +22,8 @@ void fpcLy_CancelQTo(process_method_tag_class *pMthd) {
fpcMtdTg_MethodQTo(pMthd);
}
void fpcLy_ToCancelQ(layer_class *pLayer, process_method_tag_class *pMthd) {
fpcMtdTg_ToMethodQ(&pLayer->mCancelList, pMthd);
int fpcLy_ToCancelQ(layer_class *pLayer, process_method_tag_class *pMthd) {
return fpcMtdTg_ToMethodQ(&pLayer->mCancelList, pMthd);
}
bool fpcLy_CancelMethod(process_method_tag_class *pLayer) {
+2 -2
View File
@@ -11,9 +11,9 @@ int fpcMtdTg_Do(process_method_tag_class *pMthd)
return pMthd->mpFunc(pMthd->mpMthdData);
}
void fpcMtdTg_ToMethodQ(node_list_class *pList, process_method_tag_class *pMthd)
int fpcMtdTg_ToMethodQ(node_list_class *pList, process_method_tag_class *pMthd)
{
cTg_Addition(pList, pMthd);
return cTg_Addition(pList, pMthd);
}
void fpcMtdTg_MethodQTo(process_method_tag_class *pMthd)
+68 -1
View File
@@ -1 +1,68 @@
// ok
#include "f/f_pc/f_pc_pause.h"
#include "f/f_pc/f_pc_base.h"
#include "f/f_pc/f_pc_layer_iter.h"
#include "f/f_pc/f_pc_node.h"
extern "C"
{
// f_pc_node::g_fpcNd_type
extern int lbl_80450D40;
#if NON_MATCHING
bool fpcPause_IsEnable(void *pProcess, u8 flag)
{
base_process_class *pProc = (base_process_class *) pProcess;
// extra addic/subfe?
return (pProc->mPauseFlag & flag) == flag;
}
#else
asm bool fpcPause_IsEnable(void *pProcess, u8 flag)
{
nofralloc
/* 80023844 00020784 54 84 06 3E */ clrlwi r4, r4, 0x18
/* 80023848 00020788 88 03 00 0B */ lbz r0, 0xb(r3)
/* 8002384C 0002078C 7C 80 00 38 */ and r0, r4, r0
/* 80023850 00020790 7C 64 00 50 */ subf r3, r4, r0
/* 80023854 00020794 30 03 FF FF */ addic r0, r3, -1
/* 80023858 00020798 7C 00 19 10 */ subfe r0, r0, r3
/* 8002385C 0002079C 7C 00 00 34 */ cntlzw r0, r0
/* 80023860 000207A0 54 03 D9 7E */ srwi r3, r0, 5
/* 80023864 000207A4 4E 80 00 20 */ blr
}
#endif
int fpcPause_Enable(void *pProcess, u8 flag)
{
base_process_class *pProc = (base_process_class *) pProcess;
pProc->mPauseFlag |= flag;
if (fpcBs_Is_JustOfType(lbl_80450D40, pProc->mSubType)) {
process_node_class *pNode = (process_node_class *) pProc;
fpcLyIt_OnlyHere(&pNode->mLayer, (cNdIt_MethodFunc)fpcPause_Enable, (void*) (flag & 0xFF));
}
return 1;
}
// According to symbols, they used u8 instead of u32, but I can't get a match with u8 here. This is the best I got...
int fpcPause_Disable(void *pProcess, u32 flag)
{
base_process_class *pProc = (base_process_class *) pProcess;
pProc->mPauseFlag &= (0xFF - flag) & 0xFF;
if (fpcBs_Is_JustOfType(lbl_80450D40, pProc->mSubType)) {
process_node_class *pNode = (process_node_class *) pProc;
fpcLyIt_OnlyHere(&pNode->mLayer, (cNdIt_MethodFunc)fpcPause_Disable, (void*) (flag & 0xFF));
}
return 1;
}
void fpcPause_Init(void *pProcess)
{
base_process_class *pProc = (base_process_class *) pProcess;
pProc->mPauseFlag = 0;
}
}
+147 -1
View File
@@ -1 +1,147 @@
// ok
#include "f/f_pc/f_pc_priority.h"
#include "f/f_pc/f_pc_layer.h"
#include "f/f_pc/f_pc_layer_tag.h"
#include "f/f_pc/f_pc_base.h"
extern "C"
{
// f_pc_priority::crear$2186
extern process_priority_queue_info lbl_804505E8;
// f_pc_priority::l_fpcPi_Queue
extern node_list_class lbl_803F4E58;
int fpcPi_IsInQueue(process_priority_class *pPi)
{
return cTg_IsUse(pPi);
}
int fpcPi_QueueTo(process_priority_class *pPi)
{
cTg_SingleCut(pPi);
fpcLy_CancelQTo(&pPi->mMtdTag);
return 1;
}
int fpcPi_ToQueue(process_priority_class *pPi)
{
u32 layer = pPi->mInfoQ.mLayer;
if (cTg_Addition(&lbl_803F4E58, pPi)) {
if (layer != 0xFFFFFFFD) {
layer_class *pLayer = fpcLy_Layer(layer);
if (!fpcLy_ToCancelQ(pLayer, &pPi->mMtdTag)) {
cTg_SingleCut(pPi);
return 0;
}
}
return 1;
}
return 0;
}
process_priority_class * fpcPi_GetFromQueue(void)
{
process_priority_class *pPi = (process_priority_class *) cTg_GetFirst(&lbl_803F4E58);
if (pPi != NULL) {
base_process_class *pProc = (base_process_class *) pPi->mpTagData;
process_priority_class *pProcPi = &pProc->mPi;
fpcLy_CancelQTo(&pProcPi->mMtdTag);
return pProcPi;
}
return NULL;
}
int fpcPi_Delete(process_priority_class *pPi)
{
fpcPi_QueueTo(pPi);
pPi->mInfoQ = lbl_804505E8;
return 1;
}
int fpcPi_IsNormal(unsigned int layer, unsigned short listID, unsigned short priority)
{
if ((layer < 0xFFFFFFFE) && (listID < 0xFFFE) && (priority < 0xFFFE))
return 1;
return 0;
}
int fpcPi_Change(process_priority_class *pPi, unsigned int layer, unsigned short listID, unsigned short priority)
{
base_process_class *pProc = (base_process_class *) pPi->mpTagData;
int changed = 0;
if (pProc->mInitState == 3)
return 0;
if (!fpcPi_IsNormal(layer, listID, priority))
return 0;
pPi->mInfoQ = pPi->mInfoCurr;
if (layer != 0xFFFFFFFD && pPi->mInfoCurr.mLayer != layer) {
pPi->mInfoQ.mLayer = layer;
changed = 1;
}
if (listID != 0xFFFD && pPi->mInfoCurr.mListID != listID) {
pPi->mInfoQ.mListID = listID;
changed = 1;
}
if (priority != 0xFFFD && pPi->mInfoCurr.mListPrio != priority) {
pPi->mInfoQ.mListPrio = priority;
changed = 1;
}
if (pProc->mInitState == 0 || pProc->mInitState == 1) {
pPi->mInfoCurr = pPi->mInfoQ;
return 1;
}
if (changed == 1)
return fpcPi_ToQueue(pPi);
else
return 0;
}
int fpcPi_Handler(void)
{
while (process_priority_class *pPi = fpcPi_GetFromQueue()) {
base_process_class *pProc = (base_process_class *) pPi->mpTagData;
layer_management_tag_class *pLayerTag = &pProc->mLyTg;
line_tag *pLineTag = &pProc->mLnTg;
if (fpcLyTg_Move(pLayerTag, pPi->mInfoQ.mLayer, pPi->mInfoQ.mListID, pPi->mInfoQ.mListPrio) == 1) {
fpcLnTg_Move(pLineTag, pPi->mInfoCurr.mListID);
pPi->mInfoCurr = pPi->mInfoQ;
} else {
return 0;
}
}
return 1;
}
int fpcPi_Init(process_priority_class *pPi, void *pUserData, unsigned int layer, unsigned short listID, unsigned short priority)
{
if (!fpcPi_IsNormal(layer, listID, priority))
return 0;
pPi->mInfoQ.mLayer = layer;
pPi->mInfoQ.mListID = listID;
pPi->mInfoQ.mListPrio = priority;
pPi->mInfoCurr = pPi->mInfoQ;
cTg_Create(pPi, pUserData);
fpcMtdTg_Init(&pPi->mMtdTag, (process_method_tag_func) fpcPi_Delete, pPi);
return 1;
}
};
+110 -1
View File
@@ -1 +1,110 @@
// ok
#include "m_Do/m_Do_reset/m_Do_reset.h"
#include "dvd/dvd.h"
#include "JSystem/JUtility/JUTXfb/JUTXfb.h"
#include "global.h"
extern "C" {
void my_OSCancelAlarmAll(void) {
return;
}
void destroyVideo() {
JUTVideo_NS_destroyManager();
GXSetDrawDoneCallback(NULL);
VISetBlack(1);
VIFlush();
VIWaitForRetrace();
return;
}
}
// TODO: cleanup
void mDoRst::reset(s32 p1, u32 p2, s32 p3) {
mDoCPd_c *pmVar1;
u32 uVar2;
DVDState DVar3;
OSThread *thread;
s32 enable;
/* sManager */ lbl_80451550->clearIndex();
mDoDvdErr_ThdCleanup();
cAPICPad_recalibrate();
if (lbl_80450BB8 != 0) {
do {
// uVar2 = lbl_80451368->hasReset();
uVar2 = Z2AudioMgr_NS_hasReset(lbl_80451368);
} while ((uVar2 & 0xff) == 0);
}
if ((s32)DVDGetDriveStatus() == (s32)DVD_STATE_BUSY) {
OSAttention(lbl_80374198);
}
JASTaskThread *task_thread = JASDvd_NS_getThreadPointer();
if (task_thread != NULL) {
JASTaskThread_NS_pause(task_thread, true);
thread = task_thread->thread;
if (thread != NULL) {
OSSuspendThread(thread);
OSDetachThread(thread);
OSCancelThread(thread);
}
}
VIWaitForRetrace();
VIWaitForRetrace();
thread = GXGetCurrentGXThread();
enable = OSDisableInterrupts();
OSThread* ourThread = OSGetCurrentThread();
if (thread != ourThread) {
OSCancelThread(thread);
GXSetCurrentGXThread();
}
GXFlush();
GXAbortFrame();
GXDrawDone();
OSRestoreInterrupts(enable);
destroyVideo();
// nb: probably fake match (i am not sure that it's actually attached to this label lol)
while (((s32*)lbl_803EAF40)[0x7f0] != 0) {
VIWaitForRetrace();
}
my_OSCancelAlarmAll();
LCDisable();
// probably false match; check out 80015728 or thereabouts in Ghidra
OSSetSaveRegion(/* mResetData */ m_Do_Reset_NS_mDoRst_NS_mResetData, (u8*)(&getResetData__6mDoRstFv) + 0x18);
OSResetSystem(p1, p2, p3);
do {
VIWaitForRetrace();
} while (true);
}
void mDoRst::resetCallBack(int p1, void* p2) {
if (/* mResetData */ m_Do_Reset_NS_mDoRst_NS_mResetData->field_0x0 == 0) {
if (p1 == -1) {
cAPICPad_recalibrate();
} else {
if (m_Do_Reset_NS_mDoRst_NS_mResetData->field_0x8 != 0) {
lbl_80451501 = false;
/* sCallback */ lbl_804514EC = &mDoRst::resetCallBack;
/* sCallbackArg */ lbl_804514F0 = 0;
return;
}
m_Do_Reset_NS_mDoRst_NS_mResetData->field_0x8 = 1;
m_Do_Reset_NS_mDoRst_NS_mResetData->pad_index = p1;
cAPICPad_recalibrate();
}
if ((DVDCheckDisk() == 0) && (DVDGetDriveStatus() != DVD_STATE_FATAL_ERROR)) {
m_Do_Reset_NS_mDoRst_NS_mResetData->field_0x11 = 1;
}
m_Do_Reset_NS_mDoRst_NS_mResetData->field_0x0 = 1;
}
}
ResetData* mDoRst::getResetData() {
return /* mResetData */ m_Do_Reset_NS_mDoRst_NS_mResetData;
}
+2
View File
@@ -1,5 +1,7 @@
#include "m_Do/m_Do_main/m_Do_main.h"
#include "m_Do/m_Do_reset/m_Do_reset.h"
#include "d/d_com/d_com_inf_game/d_com_inf_game.h"
#include "dvd/dvd.h"
#include "global.h"
void version_check(void) {