summaryrefslogtreecommitdiff
path: root/src/d
diff options
context:
space:
mode:
authorLagoLunatic <LagoLunatic@users.noreply.github.com>2026-07-14 17:06:45 -0400
committerLagoLunatic <LagoLunatic@users.noreply.github.com>2026-07-14 17:06:45 -0400
commitc30c494a153bb10751e083b5037029e2c7e0af02 (patch)
tree8f51ed09774e06afa41317e297ba265902b5195a /src/d
parent0f8be7a620bead23e1230825f24901ec8313694b (diff)
Some demo matches and fake inline fixes
Diffstat (limited to 'src/d')
-rw-r--r--src/d/actor/d_a_bg.cpp25
-rw-r--r--src/d/actor/d_a_himo2.cpp30
-rw-r--r--src/d/d_com_inf_game.cpp18
-rw-r--r--src/d/d_s_room.cpp20
-rw-r--r--src/d/d_stage.cpp8
5 files changed, 67 insertions, 34 deletions
diff --git a/src/d/actor/d_a_bg.cpp b/src/d/actor/d_a_bg.cpp
index 2acb5011..fc92aa5a 100644
--- a/src/d/actor/d_a_bg.cpp
+++ b/src/d/actor/d_a_bg.cpp
@@ -5,6 +5,8 @@
#include "d/dolzel.h" // IWYU pragma: keep
#include "d/actor/d_a_bg.h"
+#include "d/actor/d_a_player_main.h"
+#include "d/d_s_play.h"
#include "f_op/f_op_actor_mng.h"
#include "d/d_com_inf_game.h"
#include "d/d_magma.h"
@@ -217,6 +219,21 @@ BOOL daBg_c::createHeap() {
return TRUE;
}
+#if VERSION == VERSION_DEMO
+static void escapeRestart() {
+ REG1_S(0) = 0;
+
+ daPy_lk_c* player_p = daPy_getPlayerLinkActorClass();
+ dComIfGs_setTurnRestart(player_p->current.pos, player_p->shape_angle.y, fopAcM_GetRoomNo(player_p), player_p->getDayNightParamData());
+
+ if (dComIfG_getTimerMode() == 3) {
+ dComIfG_TimerDeleteRequest();
+ }
+
+ dComIfGp_setNextStage(dComIfGp_getStartStageName(), -3, dComIfGs_getTurnRestartRoomNo(), -1, 0.0f, 0, FALSE, 9);
+}
+#endif
+
/* 800D8C50-800D8DB8 .text __dt__6daBg_cFv */
daBg_c::~daBg_c() {
s32 roomNo = fopAcM_GetParam(this);
@@ -354,7 +371,11 @@ cPhs_State daBg_c::create() {
heap->adjustSize();
} else {
if (!fopAcM_entrySolidHeap(this, checkCreateHeap, 0)) {
+#if VERSION == VERSION_DEMO
+ escapeRestart();
+#else
dStage_escapeRestart();
+#endif
return cPhs_ERROR_e;
}
}
@@ -386,7 +407,11 @@ cPhs_State daBg_c::create() {
}
if (bgw != NULL && dComIfG_Bgsp()->Regist(bgw, this)) {
+#if VERSION == VERSION_DEMO
+ escapeRestart();
+#else
dStage_escapeRestart();
+#endif
return cPhs_ERROR_e;
}
diff --git a/src/d/actor/d_a_himo2.cpp b/src/d/actor/d_a_himo2.cpp
index 5f8bb9ab..ca0ce496 100644
--- a/src/d/actor/d_a_himo2.cpp
+++ b/src/d/actor/d_a_himo2.cpp
@@ -59,7 +59,7 @@ dr2_class* dr;
#endif
/* 800EB60C-800EBABC .text spin_draw__FP11himo2_class */
-void spin_draw(himo2_class* i_this) {
+static void spin_draw(himo2_class* i_this) {
fopAc_ac_c* actor = &i_this->actor;
int r27;
s16 r22;
@@ -179,7 +179,7 @@ void spin_draw(himo2_class* i_this) {
}
/* 800EBABC-800EBCD0 .text himo2_control__FP11himo2_classP7himo2_s */
-void himo2_control(himo2_class* i_this, himo2_s* param_2) {
+static void himo2_control(himo2_class* i_this, himo2_s* param_2) {
f32 fVar1;
f32 fVar2;
f32 dVar8;
@@ -218,7 +218,7 @@ void himo2_control(himo2_class* i_this, himo2_s* param_2) {
}
/* 800EBCD0-800EBFEC .text himo2_control2__FP11himo2_classP7himo2_s */
-void himo2_control2(himo2_class* i_this, himo2_s* param_2) {
+static void himo2_control2(himo2_class* i_this, himo2_s* param_2) {
cXyz local_a8;
cXyz local_b4;
f32 f30;
@@ -282,7 +282,7 @@ void himo2_control2(himo2_class* i_this, himo2_s* param_2) {
}
/* 800EBFEC-800EC1E4 .text himo2_draw__FP11himo2_classP7himo2_s */
-void himo2_draw(himo2_class* i_this, himo2_s* param_2) {
+static void himo2_draw(himo2_class* i_this, himo2_s* param_2) {
fopAc_ac_c* actor = &i_this->actor;
daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0);
int r30;
@@ -331,17 +331,17 @@ void himo2_draw(himo2_class* i_this, himo2_s* param_2) {
}
#if VERSION == VERSION_DEMO
-void himo_e_control(himo2_class* i_this, himo2_s*) {
+static void himo_e_control(himo2_class* i_this, himo2_s*) {
/* Nonmatching*/
}
-void himo_e_draw(himo2_class* i_this, himo2_s*) {
+static void himo_e_draw(himo2_class* i_this, himo2_s*) {
/* Nonmatching*/
}
#endif
/* 800EC1E4-800EC300 .text himo_hang_draw__FP11himo2_class */
-void himo_hang_draw(himo2_class* i_this) {
+static void himo_hang_draw(himo2_class* i_this) {
cXyz* pcVar3 = i_this->m1F30.getPos(0);
pcVar3 += i_this->m1F6C;
cXyz local_38 = i_this->m02EC[0] - i_this->m2504;
@@ -356,7 +356,7 @@ void himo_hang_draw(himo2_class* i_this) {
}
/* 800EC300-800EC338 .text himo2_disp__FP11himo2_class */
-void himo2_disp(himo2_class* i_this) {
+static void himo2_disp(himo2_class* i_this) {
if (i_this->m02DC < 10) {
himo2_draw(i_this, &i_this->m0310[0]);
} else {
@@ -511,7 +511,7 @@ static BOOL daHimo2_Draw(himo2_class* i_this) {
}
/* 800ECBE8-800ECC54 .text s_a_d_sub__FPvPv */
-void* s_a_d_sub(void* param_1, void* param_2) {
+static void* s_a_d_sub(void* param_1, void* param_2) {
if ((fopAc_IsActor(param_1)) && (fopAcM_GetName(param_1) == fpcNm_KUI_e)) {
himo2_class* rope = (himo2_class*)param_2;
rope->m218C[rope->m24AC] = (fopAc_ac_c*)param_1;
@@ -521,7 +521,7 @@ void* s_a_d_sub(void* param_1, void* param_2) {
}
/* 800ECC54-800ED19C .text search_target__FP11himo2_class4cXyz */
-fopAc_ac_c* search_target(himo2_class* i_this, cXyz param_2) {
+static fopAc_ac_c* search_target(himo2_class* i_this, cXyz param_2) {
fopAc_ac_c* r28;
s16 r27;
s16 r26;
@@ -655,7 +655,7 @@ BOOL himo2_class::setTargetPos(cXyz* param_1, f32* param_2, f32* param_3) {
}
/* 800ED2E0-800ED32C .text dr_a_sub__FPvPv */
-void* dr_a_sub(void* param_1, void* param_2) {
+static void* dr_a_sub(void* param_1, void* param_2) {
if ((fopAc_IsActor(param_1)) && (fopAcM_GetName(param_1) == fpcNm_DR2_e)) {
return param_1;
} else {
@@ -664,7 +664,7 @@ void* dr_a_sub(void* param_1, void* param_2) {
}
/* 800ED32C-800ED378 .text b_a_sub__FPvPv */
-void* b_a_sub(void* param_1, void* param_2) {
+static void* b_a_sub(void* param_1, void* param_2) {
if ((fopAc_IsActor(param_1)) && (fopAcM_GetName(param_1) == fpcNm_BTD_e)) {
return param_1;
} else {
@@ -673,7 +673,7 @@ void* b_a_sub(void* param_1, void* param_2) {
}
/* 800ED378-800ED688 .text himo2_bg_check__FP11himo2_class */
-BOOL himo2_bg_check(himo2_class* i_this) {
+static BOOL himo2_bg_check(himo2_class* i_this) {
fopAc_ac_c* actor = &i_this->actor;
u8 flag;
u32 uVar3;
@@ -739,14 +739,14 @@ BOOL himo2_bg_check(himo2_class* i_this) {
}
/* 800ED688-800ED6F4 .text pl_pos_add__FP11himo2_class */
-void pl_pos_add(himo2_class* i_this) {
+static void pl_pos_add(himo2_class* i_this) {
fopAc_ac_c* actor = &i_this->actor;
cXyz local_28 = daPy_getPlayerActorClass()->old.pos - daPy_getPlayerActorClass()->current.pos;
actor->current.pos += local_28;
}
/* 800ED6F4-800F0038 .text new_himo2_move__FP11himo2_class */
-void new_himo2_move(himo2_class* i_this) {
+static void new_himo2_move(himo2_class* i_this) {
/* Nonmatching - regalloc */
fopAc_ac_c* actor = (fopAc_ac_c*)&i_this->actor;
fopAc_ac_c* player_actor;
diff --git a/src/d/d_com_inf_game.cpp b/src/d/d_com_inf_game.cpp
index fdebd4f7..82e37bb5 100644
--- a/src/d/d_com_inf_game.cpp
+++ b/src/d/d_com_inf_game.cpp
@@ -586,7 +586,7 @@ int dComIfGd_setSimpleShadow2(cXyz* i_pos, f32 groundY, f32 scaleXZ, cBgS_PolyIn
cM3dGPla* plane_p =
dComIfG_Bgsp()->GetTriPla(i_floorPoly);
- return dComIfGd_setSimpleShadow(i_pos, groundY, scaleXZ, plane_p->GetNP(), i_angle, scaleZ, i_tex);
+ return dComIfGd_setSimpleShadow(i_pos, groundY, scaleXZ, &plane_p->mNormal, i_angle, scaleZ, i_tex);
} else {
return 0;
}
@@ -1131,56 +1131,56 @@ u8 dComIfGs_checkGetItemNum(u8 i_itemNo) {
break;
case dItemNo_SKULL_NECKLACE_e:
for (int beastIdx = 0; beastIdx < dBeastIdx_COUNT_e; beastIdx++) {
- if (dComIfGs_getBeast(beastIdx) == dItemNo_SKULL_NECKLACE_e) {
+ if (dComIfGs_getItemBeast(beastIdx) == dItemNo_SKULL_NECKLACE_e) {
get_item = dComIfGs_getBeastNum(dBeastIdx_SKULL_NECKLACE_e);
}
}
break;
case dItemNo_BOKOBABA_SEED_e:
for (int beastIdx = 0; beastIdx < dBeastIdx_COUNT_e; beastIdx++) {
- if (dComIfGs_getBeast(beastIdx) == dItemNo_BOKOBABA_SEED_e) {
+ if (dComIfGs_getItemBeast(beastIdx) == dItemNo_BOKOBABA_SEED_e) {
get_item = dComIfGs_getBeastNum(dBeastIdx_BOKOBABA_SEED_e);
}
}
break;
case dItemNo_GOLDEN_FEATHER_e:
for (int beastIdx = 0; beastIdx < dBeastIdx_COUNT_e; beastIdx++) {
- if (dComIfGs_getBeast(beastIdx) == dItemNo_GOLDEN_FEATHER_e) {
+ if (dComIfGs_getItemBeast(beastIdx) == dItemNo_GOLDEN_FEATHER_e) {
get_item = dComIfGs_getBeastNum(dBeastIdx_GOLDEN_FEATHER_e);
}
}
break;
case dItemNo_KNIGHTS_CREST_e:
for (int beastIdx = 0; beastIdx < dBeastIdx_COUNT_e; beastIdx++) {
- if (dComIfGs_getBeast(beastIdx) == dItemNo_KNIGHTS_CREST_e) {
+ if (dComIfGs_getItemBeast(beastIdx) == dItemNo_KNIGHTS_CREST_e) {
get_item = dComIfGs_getBeastNum(dBeastIdx_KNIGHTS_CREST_e);
}
}
break;
case dItemNo_RED_JELLY_e:
for (int beastIdx = 0; beastIdx < dBeastIdx_COUNT_e; beastIdx++) {
- if (dComIfGs_getBeast(beastIdx) == dItemNo_RED_JELLY_e) {
+ if (dComIfGs_getItemBeast(beastIdx) == dItemNo_RED_JELLY_e) {
get_item = dComIfGs_getBeastNum(dBeastIdx_RED_JELLY_e);
}
}
break;
case dItemNo_GREEN_JELLY_e:
for (int beastIdx = 0; beastIdx < dBeastIdx_COUNT_e; beastIdx++) {
- if (dComIfGs_getBeast(beastIdx) == dItemNo_GREEN_JELLY_e) {
+ if (dComIfGs_getItemBeast(beastIdx) == dItemNo_GREEN_JELLY_e) {
get_item = dComIfGs_getBeastNum(dBeastIdx_GREEN_JELLY_e);
}
}
break;
case dItemNo_BLUE_JELLY_e:
for (int beastIdx = 0; beastIdx < dBeastIdx_COUNT_e; beastIdx++) {
- if (dComIfGs_getBeast(beastIdx) == dItemNo_BLUE_JELLY_e) {
+ if (dComIfGs_getItemBeast(beastIdx) == dItemNo_BLUE_JELLY_e) {
get_item = dComIfGs_getBeastNum(dBeastIdx_BLUE_JELLY_e);
}
}
break;
case dItemNo_JOY_PENDANT_e:
for (int beastIdx = 0; beastIdx < dBeastIdx_COUNT_e; beastIdx++) {
- if (dComIfGs_getBeast(beastIdx) == dItemNo_JOY_PENDANT_e) {
+ if (dComIfGs_getItemBeast(beastIdx) == dItemNo_JOY_PENDANT_e) {
get_item = dComIfGs_getBeastNum(dBeastIdx_JOY_PENDANT_e);
}
}
diff --git a/src/d/d_s_room.cpp b/src/d/d_s_room.cpp
index 113d4940..fdd310ce 100644
--- a/src/d/d_s_room.cpp
+++ b/src/d/d_s_room.cpp
@@ -160,11 +160,15 @@ cPhs_State phase_1(room_of_scene_class* i_this) {
return cPhs_INIT_e;
const char * arcName = setArcName(i_this);
- BOOL ret = dComIfG_setStageRes(arcName, pHeap);
- if (!ret) {
+ BOOL rt = dComIfG_setStageRes(arcName, pHeap);
+#if VERSION == VERSION_DEMO
+ JUT_ASSERT(380, rt == TRUE);
+#else
+ if (!rt) {
dStage_escapeRestart();
return cPhs_ERROR_e;
}
+#endif
return cPhs_NEXT_e;
}
@@ -173,12 +177,14 @@ cPhs_State phase_1(room_of_scene_class* i_this) {
cPhs_State phase_2(room_of_scene_class* i_this) {
const char * arcName = setArcName(i_this);
s32 rt = dComIfG_syncStageRes(arcName);
+#if VERSION > VERSION_DEMO
if (rt < 0) {
dStage_escapeRestart();
return cPhs_ERROR_e;
}
+#endif
- JUT_ASSERT(0x1c0, rt >= 0);
+ JUT_ASSERT(DEMO_SELECT(394, 448), rt >= 0);
if (rt != 0)
return cPhs_INIT_e;
@@ -203,7 +209,7 @@ cPhs_State phase_2(room_of_scene_class* i_this) {
u32 layerNo = dComIfG_play_c::getLayerNo(roomNo);
s32 bank = banks[layerNo];
if (bank != 0xFF) {
- JUT_ASSERT(0x1db, 0 <= bank && bank < 100);
+ JUT_ASSERT(DEMO_SELECT(421, 475), 0 <= bank && bank < 100);
sprintf(dStage_roomControl_c::mDemoArcName, "Demo%02d", bank);
if (!dComIfG_setObjectRes(dStage_roomControl_c::mDemoArcName, JKRArchive::DEFAULT_MOUNT_DIRECTION, NULL))
dStage_roomControl_c::mDemoArcName[0] = '\0';
@@ -213,7 +219,7 @@ cPhs_State phase_2(room_of_scene_class* i_this) {
}
dStage_FileList_dt_c * fileList = dComIfGp_roomControl_getStatusRoomDt(roomNo)->getFileListInfo();
- JUT_ASSERT(499, fileList != NULL);
+ JUT_ASSERT(DEMO_SELECT(445, 499), fileList != NULL);
u8 particleNo = dStage_FileList_dt_GetParticleNo(fileList);
i_this->mbHasRoomParticle = dComIfGp_particle_readScene(particleNo, &i_this->sceneCommand);
@@ -227,7 +233,9 @@ cPhs_State phase_3(room_of_scene_class* i_this) {
if (dStage_roomControl_c::getDemoArcName()[0] != '\0') {
s32 rt = dComIfG_syncObjectRes(dStage_roomControl_c::getDemoArcName());
if (rt < 0) {
+#if VERSION > VERSION_DEMO
dStage_escapeRestart();
+#endif
return cPhs_ERROR_e;
} else if (rt > 0) {
return cPhs_INIT_e;
@@ -238,7 +246,7 @@ cPhs_State phase_3(room_of_scene_class* i_this) {
if (i_this->sceneCommand->sync() == 0)
return cPhs_INIT_e;
- JUT_ASSERT(0x215, i_this->sceneCommand->getMemAddress() != NULL);
+ JUT_ASSERT(DEMO_SELECT(477, 533), i_this->sceneCommand->getMemAddress() != NULL);
dComIfGp_particle_createRoomScene(i_this->sceneCommand->getMemAddress());
delete i_this->sceneCommand;
}
diff --git a/src/d/d_stage.cpp b/src/d/d_stage.cpp
index 37d481ad..9c9d68c0 100644
--- a/src/d/d_stage.cpp
+++ b/src/d/d_stage.cpp
@@ -2392,19 +2392,19 @@ void dStage_turnRestart() {
dKy_set_nexttime(nextTime);
}
+#if VERSION > VERSION_DEMO
/* 80043BD0-80043C84 .text dStage_escapeRestart__Fv */
void dStage_escapeRestart() {
daPy_lk_c* player_p = daPy_getPlayerLinkActorClass();
- dComIfGs_setTurnRestart(player_p->current.pos, player_p->shape_angle.y,
- fopAcM_GetRoomNo(player_p), player_p->getDayNightParamData());
+ dComIfGs_setTurnRestart(player_p->current.pos, player_p->shape_angle.y, fopAcM_GetRoomNo(player_p), player_p->getDayNightParamData());
if (dComIfG_getTimerMode() == 3) {
dComIfG_TimerDeleteRequest();
}
- dComIfGp_setNextStage(dComIfGp_getStartStageName(), -3, dComIfGs_getTurnRestartRoomNo(), -1,
- 0.0f, 0, FALSE, 9);
+ dComIfGp_setNextStage(dComIfGp_getStartStageName(), -3, dComIfGs_getTurnRestartRoomNo(), -1, 0.0f, 0, FALSE, 9);
}
+#endif
/* 80043C84-80043CD0 .text dStage_checkRestart__Fv */
BOOL dStage_checkRestart() {