Merge with origin/main

This commit is contained in:
jdflyer
2026-08-07 13:57:48 -07:00
204 changed files with 4811 additions and 14798 deletions
+13 -13
View File
@@ -218,21 +218,21 @@ static void __THPAudioInitialize(THPAudioDecodeInfo* info, u8* ptr) {
}
#if !TARGET_PC
static u8 THPStatistics[1120] ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static u8 THPStatistics[1120];
static THPHuffmanTab* Ydchuff ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static THPHuffmanTab* Ydchuff;
static THPHuffmanTab* Udchuff ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static THPHuffmanTab* Udchuff;
static THPHuffmanTab* Vdchuff ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static THPHuffmanTab* Vdchuff;
static THPHuffmanTab* Yachuff ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static THPHuffmanTab* Yachuff;
static THPHuffmanTab* Uachuff ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static THPHuffmanTab* Uachuff;
static THPHuffmanTab* Vachuff ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static THPHuffmanTab* Vachuff;
static f32 __THPIDCTWorkspace[64] ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static f32 __THPIDCTWorkspace[64];
static u8* __THPHuffmanBits;
@@ -240,11 +240,11 @@ static u8* __THPHuffmanSizeTab;
static u16* __THPHuffmanCodeTab;
static THPSample* Gbase ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static THPSample* Gbase;
static u32 Gwid ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static u32 Gwid;
static f32* Gq ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static f32* Gq;
static u8* __THPLCWork512[3];
@@ -3582,7 +3582,7 @@ static void daMP_MixAudio(s16* destination, s16*, u32 sample) {
static BOOL daMP_Initialized;
static u32 daMP_WorkBuffer[16] ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static u32 daMP_WorkBuffer[16];
static OSMessageQueue daMP_PrepareReadyQueue;
@@ -3604,7 +3604,7 @@ static void* daMP_CurAudioBuffer;
static s32 daMP_AudioSystem;
static u8 daMP_SoundBuffer[2][0x8C0] ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static u8 daMP_SoundBuffer[2][0x8C0];
static s16* daMP_audioCallbackWithMSound(s32 sample) {
if (daMP_ActivePlayer.open == 0 || daMP_ActivePlayer.internalState != 2 || daMP_ActivePlayer.audioExist == 0) {
+1 -1
View File
@@ -101,7 +101,7 @@ static f32 l_texCoord[42] = {
0.8f, 0.9f, 1.0, 0.0, 1.0, 0.2f, 1.0, 0.4f, 1.0, 0.6f, 1.0, 0.8f, 1.0, 1.0,
};
static u8 l_pennant_flagDL[152] ATTRIBUTE_ALIGN(32) = {
ATTRIBUTE_ALIGN(32) static u8 l_pennant_flagDL[152] = {
0x98, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x04, 0x04, 0x04, 0x05,
0x05, 0x05, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x0D, 0x0D, 0x0D, 0x0E, 0x0E, 0x0E, 0x13, 0x13,
0x13, 0x14, 0x14, 0x14, 0x98, 0x00, 0x09, 0x01, 0x01, 0x01, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04,
+2 -1
View File
@@ -29,6 +29,7 @@
#endif
#if TARGET_PC
#include "dusk/camera_operators.hpp"
#include "dusk/frame_interpolation.h"
#include "dusk/logging.h"
#include "dusk/action_bindings.h"
@@ -1053,7 +1054,7 @@ void dCamera_c::debugDrawInit() {
bool dCamera_c::Run() {
#if TARGET_PC
ResetView();
if (executeDebugFlyCam()) {
if (executeDebugFlyCam() || dusk::mods::camera_run_operators(this)) {
mFrameCounter++;
mTicks++;
return true;
+2 -2
View File
@@ -2469,7 +2469,7 @@ struct field_data {
};
void dComIfGp_calcNowRegion() {
u8 buffer[0x800] ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) u8 buffer[0x800];
dComIfGp_getFieldMapArchive2()->readResource(buffer, 0x800, "dat/field.dat");
u8* entry_num_p = &buffer[((field_data_header*)buffer)->field_0x4];
@@ -2525,7 +2525,7 @@ void dComIfGp_calcNowRegion() {
}
u8 dComIfG_getNowCalcRegion() {
u8 buffer[0x800] ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) u8 buffer[0x800];
dComIfGp_getFieldMapArchive2()->readResource(buffer, 0x800, "dat/field.dat");
u8* entry_num_p = &buffer[((field_data_header*)buffer)->field_0x4];
+13 -13
View File
@@ -529,14 +529,14 @@ void dDlst_2DT2_c::draw() {
dComIfGp_getCurrentGrafPort()->setup2D();
}
static u8 l_frontZMat[] ATTRIBUTE_ALIGN(32) = {
ATTRIBUTE_ALIGN(32) static u8 l_frontZMat[] = {
0x61, 0x40, 0x00, 0x00, 0x07, 0x10, 0x00, 0x00, 0x10, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x10,
0x00, 0x00, 0x10, 0x09, 0x00, 0x00, 0x00, 0x01, 0x61, 0x00, 0x00, 0x40, 0x10, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static u8 l_frontNoZSubMat[] ATTRIBUTE_ALIGN(32) = {
ATTRIBUTE_ALIGN(32) static u8 l_frontNoZSubMat[] = {
0x61, 0x40, 0x00, 0x00, 0x06, 0x61, 0x41, 0x00, 0x09, 0x35, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -547,14 +547,14 @@ static Vec l_shadowVolPos[] = {
{1.0f, -1.0f, 0.0f}, {1.0f, -1.0f, -300.0f}, {1.0f, 1.0f, 0.0f}, {1.0f, 1.0f, -300.0f},
};
static u8 l_shadowVolDL[] ATTRIBUTE_ALIGN(32) = {
ATTRIBUTE_ALIGN(32) static u8 l_shadowVolDL[] = {
0x80, 0x00, 0x18, 0x06, 0x02, 0x03, 0x07, 0x00, 0x04, 0x05, 0x01, 0x06, 0x04, 0x00, 0x02,
0x07, 0x05, 0x04, 0x06, 0x03, 0x01, 0x05, 0x07, 0x02, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static u8 l_shadowProjMat[] ATTRIBUTE_ALIGN(32) = {
ATTRIBUTE_ALIGN(32) static u8 l_shadowProjMat[] = {
0x61, 0x28, 0x38, 0x03, 0xC0, 0x61, 0xC0, 0x08, 0xFF, 0xFF, 0x61, 0xC1, 0x08, 0xE6, 0x70,
0x61, 0x43, 0x00, 0x00, 0x01, 0x61, 0x40, 0x00, 0x00, 0x07, 0x61, 0x41, 0x00, 0x04, 0xAD,
0x61, 0xF3, 0x64, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x3F, 0x00, 0x00, 0x00, 0x01, 0x10,
@@ -563,7 +563,7 @@ static u8 l_shadowProjMat[] ATTRIBUTE_ALIGN(32) = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static u8 l_shadowVolMat[] ATTRIBUTE_ALIGN(32) = {
ATTRIBUTE_ALIGN(32) static u8 l_shadowVolMat[] = {
0x61, 0x28, 0x38, 0x00, 0x00, 0x61, 0xC0, 0x08, 0xFF, 0xFC, 0x61, 0xC1, 0x08, 0xFF, 0x90,
0x61, 0x43, 0x00, 0x00, 0x41, 0x61, 0x40, 0x00, 0x00, 0x0D, 0x61, 0x41, 0x00, 0x01, 0x35,
0x61, 0xF3, 0x7F, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x10,
@@ -572,7 +572,7 @@ static u8 l_shadowVolMat[] ATTRIBUTE_ALIGN(32) = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static u8 l_clearMat[] ATTRIBUTE_ALIGN(32) = {
ATTRIBUTE_ALIGN(32) static u8 l_clearMat[] = {
0x61, 0x28, 0x38, 0x00, 0x00, 0x61, 0xC0, 0x08, 0xFF, 0xFF, 0x61, 0xC1, 0x08, 0xFF, 0xA0,
0x61, 0x40, 0x00, 0x00, 0x06, 0x61, 0x41, 0x00, 0x00, 0x14, 0x61, 0xF3, 0x7F, 0x00, 0x00,
0x10, 0x00, 0x00, 0x10, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x09, 0x00,
@@ -581,7 +581,7 @@ static u8 l_clearMat[] ATTRIBUTE_ALIGN(32) = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static u8 l_frontMat[] ATTRIBUTE_ALIGN(32) = {
ATTRIBUTE_ALIGN(32) static u8 l_frontMat[] = {
0x61, 0x28, 0x38, 0x00, 0x00, 0x61, 0xC0, 0x08, 0xFF, 0xFF, 0x61, 0xC1, 0x08, 0xFF, 0x90,
0x61, 0x43, 0x00, 0x00, 0x41, 0x61, 0x40, 0x00, 0x00, 0x07, 0x61, 0x41, 0x00, 0x01, 0x15,
0x10, 0x00, 0x00, 0x10, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x09, 0x00,
@@ -590,7 +590,7 @@ static u8 l_frontMat[] ATTRIBUTE_ALIGN(32) = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static u8 l_backSubMat[] ATTRIBUTE_ALIGN(32) = {
ATTRIBUTE_ALIGN(32) static u8 l_backSubMat[] = {
0x61, 0x41, 0x00, 0x09, 0x35, 0x10, 0x00, 0x00, 0x10, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x10,
0x00, 0x00, 0x10, 0x09, 0x00, 0x00, 0x00, 0x01, 0x61, 0x00, 0x00, 0x80, 0x10, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -604,7 +604,7 @@ static Vec l_simpleShadowPos[] = {
{1.0f, 1.0f, 1.0f}, {-1.0f, 1.0f, 1.0f},
};
static u8 l_shadowVolumeDL[] ATTRIBUTE_ALIGN(32) = {
ATTRIBUTE_ALIGN(32) static u8 l_shadowVolumeDL[] = {
0x98, 0x00, 0x05, 0x03, 0x09, 0x01, 0x07, 0x05, 0x98, 0x00, 0x05, 0x04, 0x06, 0x00, 0x08,
0x02, 0x98, 0x00, 0x04, 0x04, 0x05, 0x06, 0x07, 0x98, 0x00, 0x04, 0x02, 0x03, 0x04, 0x05,
0x98, 0x00, 0x04, 0x08, 0x09, 0x02, 0x03, 0x98, 0x00, 0x04, 0x06, 0x07, 0x08, 0x09, 0x98,
@@ -613,7 +613,7 @@ static u8 l_shadowVolumeDL[] ATTRIBUTE_ALIGN(32) = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static u8 l_shadowSealTexDL[] ATTRIBUTE_ALIGN(32) = {
ATTRIBUTE_ALIGN(32) static u8 l_shadowSealTexDL[] = {
0x61, 0x28, 0x38, 0x03, 0xC0, 0x61, 0x40, 0x00, 0x00, 0x06, 0x61, 0x41, 0x00, 0x06, 0x15,
0x10, 0x00, 0x00, 0x10, 0x3F, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x10, 0x09, 0x00,
0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x40, 0x01, 0x80, 0x00, 0x04, 0x0A, 0x00, 0x00, 0x0B,
@@ -622,7 +622,7 @@ static u8 l_shadowSealTexDL[] ATTRIBUTE_ALIGN(32) = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static u8 l_shadowSealTex2DL[] ATTRIBUTE_ALIGN(32) = {
ATTRIBUTE_ALIGN(32) static u8 l_shadowSealTex2DL[] = {
0x61, 0x28, 0x38, 0x03, 0xC0, 0x61, 0x40, 0x00, 0x00, 0x06, 0x61, 0x41, 0x00, 0x06, 0x15,
0x10, 0x00, 0x00, 0x10, 0x3F, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x10, 0x09, 0x00,
0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x40, 0x01, 0x80, 0x00, 0x04, 0x0A, 0x00, 0x00, 0x0B,
@@ -631,7 +631,7 @@ static u8 l_shadowSealTex2DL[] ATTRIBUTE_ALIGN(32) = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static u8 l_shadowSealDL[] ATTRIBUTE_ALIGN(32) = {
ATTRIBUTE_ALIGN(32) static u8 l_shadowSealDL[] = {
0x10, 0x00, 0x00, 0x10, 0x0E, 0x00, 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00,
0x00, 0x05, 0x00, 0x61, 0x28, 0x38, 0x00, 0x00, 0x61, 0xC0, 0x08, 0xFF, 0xFF, 0x61, 0xC1,
0x08, 0xFF, 0xB0, 0x61, 0x40, 0x00, 0x00, 0x06, 0x61, 0x41, 0x00, 0x06, 0xED, 0x10, 0x00,
@@ -1534,7 +1534,7 @@ void dDlst_shadowControl_c::reset() {
}
void dDlst_shadowControl_c::imageDraw(Mtx param_0) {
static u8 l_matDL[] ATTRIBUTE_ALIGN(32) = {
ATTRIBUTE_ALIGN(32) static u8 l_matDL[] = {
0x10, 0x00, 0x00, 0x10, 0x0E, 0x00, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x10, 0x10,
0x00, 0x00, 0x04, 0x00, 0x61, 0x28, 0x38, 0x00, 0x00, 0x61, 0xC0, 0x08, 0xFF, 0xF2,
0x61, 0xC1, 0x08, 0xFF, 0x90, 0x61, 0x43, 0x00, 0x00, 0x41, 0x61, 0xF3, 0x7F, 0x00,
+17
View File
@@ -28,6 +28,7 @@
#if TARGET_PC
#include "dusk/menu_pointer.h"
#include "helpers/string.hpp"
#include "dusk/mods/svc/save.hpp"
namespace {
constexpr u8 pointer_target(u8 group, u8 index) noexcept {
@@ -255,6 +256,10 @@ dFile_select_c::~dFile_select_c() {
void dFile_select_c::_create() {
int i;
#if TARGET_PC
dusk::mods::svc::save_no_slot();
#endif
mDoGph_gInf_c::setFadeColor(static_cast<JUtility::TColor&>(g_blackColor));
stick = JKR_NEW STControl(2, 2, 1, 1, 0.9f, 0.5f, 0, 0x2000);
@@ -1390,6 +1395,9 @@ void dFile_select_c::menuSelectStart() {
mIsSelectEnd = true;
mDataSelProc = DATASELPROC_NEXT_MODE_WAIT;
dComIfGs_setDataNum(mSelectNum);
#if TARGET_PC
dusk::mods::svc::save_slot_loaded(mSelectNum, &mSaveData[mSelectNum]);
#endif
} else if (mSelectMenuNum == 0) {
mSelIcon->setAlphaRate(0.0f);
yesnoMenuMoveAnmInitSet(0x473, 0x47d);
@@ -1740,6 +1748,9 @@ void dFile_select_c::nameInput2() {
case 2:
dComIfGs_setHorseName(mpName->getInputStrPtr());
mIsSelectEnd = true;
#if TARGET_PC
dusk::mods::svc::save_slot_new(mSelectNum);
#endif
mDataSelProc = DATASELPROC_NEXT_MODE_WAIT;
}
}
@@ -2666,6 +2677,9 @@ void dFile_select_c::DataEraseWait2() {
mDataSelProc = DATASELPROC_ERROR_MSG_PANE_MOVE;
} else if (field_0x03b4 == 1) {
mDoAud_seStart(Z2SE_SY_FILE_DELETE_OK, NULL, 0, 0);
#if TARGET_PC
dusk::mods::svc::save_slot_erased(mSelectNum);
#endif
field_0x03b1 = 0;
mDeleteEfPane[mSelectNum]->alphaAnimeStart(0);
mFileInfoNoDatBasePane[mSelectNum]->alphaAnimeStart(0);
@@ -2769,6 +2783,9 @@ void dFile_select_c::DataCopyWait2() {
mDataSelProc = DATASELPROC_ERROR_MSG_PANE_MOVE;
} else if (field_0x03b4 == 1) {
mDoAud_seStart(Z2SE_SY_FILE_COPY_OK, NULL, 0, 0);
#if TARGET_PC
dusk::mods::svc::save_slot_copied(mCpDataNum, mCpDataToNum);
#endif
field_0x03b1 = 0;
mCopyEfPane[mSelectNum]->alphaAnimeStart(0);
mCopyEfPane[mCpDataToNum]->alphaAnimeStart(0);
+1 -1
View File
@@ -300,7 +300,7 @@ BOOL dLib_checkActorInRectangle(fopAc_ac_c* param_0, fopAc_ac_c* param_1, cXyz c
}
u32 dLib_getExpandSizeFromAramArchive(JKRAramArchive* i_aramArchive, char const* param_2) {
u8 header[32] ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) u8 header[32];
JUT_ASSERT(1252, i_aramArchive != NULL);
u32 address = i_aramArchive->getAramAddress(param_2);
if (address == 0) {
+2 -2
View File
@@ -172,7 +172,7 @@ int renderingDmap_c::getLineWidth(int param_0) {
return var_r31;
}
static u32 const l_paletteDmap_m[60] ATTRIBUTE_ALIGN(32) = {
ATTRIBUTE_ALIGN(32) static u32 const l_paletteDmap_m[60] = {
0x00000000,
0x00000000,
0x80008000,
@@ -680,7 +680,7 @@ f32 dMenu_DmapMapCtrl_c::getZoomCmPerPixel() {
return var_f29;
}
static u32 l_data[61] ATTRIBUTE_ALIGN(32) = {
ATTRIBUTE_ALIGN(32) static u32 l_data[61] = {
0x80008000,
0x80008000,
0x00000000,
+5
View File
@@ -26,6 +26,7 @@
#include "dusk/frame_interpolation.h"
#include "dusk/menu_pointer.h"
#include "dusk/settings.h"
#include "dusk/mods/svc/save.hpp"
#endif
static int SelStartFrameTbl[3] = {
@@ -1468,6 +1469,10 @@ void dMenu_save_c::memCardDataSaveWait2() {
dComIfGs_setDataNum(mSelectedFile);
dComIfGs_setNoFile(0);
#if TARGET_PC
dusk::mods::svc::save_slot_written(mSelectedFile, mSaveBuffer + mSelectedFile * QUEST_LOG_SIZE);
#endif
if (mUseType == TYPE_WHITE_EVENT || mUseType == TYPE_BLACK_EVENT) {
headerTxtSet(0x530); // Saved.
mWarning->closeInit();
+11 -5
View File
@@ -25,8 +25,9 @@
#ifdef TARGET_PC
#include "dusk/logging.h"
#include "dusk/version.hpp"
#include "dusk/main.h"
#include "dusk/mods/svc/save.hpp"
#include "dusk/version.hpp"
#include "m_Do/m_Do_MemCard.h"
#endif
@@ -771,15 +772,20 @@ void dScnLogo_c::nextSceneChange() {
status = mDoMemCd_LoadSync(buf, sizeof(buf), 0);
// Wait until the card is loaded
} while (status == 0);
const uint32_t saveSlot = dusk::SaveRequested - 1;
if (status == 1) {
dComIfGs_setCardToMemory(buf, dusk::SaveRequested - 1);
dComIfGs_setCardToMemory(buf, saveSlot);
} else {
dComIfGs_init();
}
dComIfGs_setNoFile(dusk::SaveRequested);
dComIfGs_setDataNum(dusk::SaveRequested-1);
dComIfGs_setDataNum(saveSlot);
if (status == 1) {
dusk::mods::svc::save_slot_loaded(
saveSlot, buf + saveSlot * SAVEDATA_SIZE);
}
dComIfGs_gameStart();
+53
View File
@@ -25,6 +25,7 @@
#include "dusk/logging.h"
#include "helpers/string.hpp"
#if TARGET_PC
#include "dusk/mods/svc/stage.hpp"
#include <format>
#include <fmt/ranges.h>
#endif
@@ -1592,7 +1593,18 @@ DUSK_GAME_DATA dStage_roomControl_c::roomDzs_c dStage_roomControl_c::m_roomDzs;
u8 dStage_roomControl_c::mNoArcBank;
#endif
#if TARGET_PC
static void dStage_actorCreate(stage_actor_data_class* i_actorData, fopAcM_prm_class* i_actorPrm,
size_t recordSize = sizeof(stage_actor_data_class)) {
if (!dusk::mods::svc::stage_apply_actor_edits(i_actorData, i_actorPrm, recordSize,
i_actorPrm->room_no))
{
JKRFree(i_actorPrm);
return;
}
#else
static void dStage_actorCreate(stage_actor_data_class* i_actorData, fopAcM_prm_class* i_actorPrm) {
#endif
dStage_objectNameInf* actorInf = dStage_searchName(i_actorData->name);
if (actorInf == NULL) {
@@ -1992,7 +2004,12 @@ static int dStage_tgscCommonLayerInit(dStage_dt_c* i_stage, void* i_data, int en
appen->base = tgsc_data->base;
appen->room_no = (int)i_stage->getRoomNo();
appen->scale = tgsc_data->scale;
#if TARGET_PC
dStage_actorCreate(actor_data, appen,
sizeof(stage_actor_data_class) + sizeof(fopAcM_prmScale_class));
#else
dStage_actorCreate(actor_data, appen);
#endif
}
}
tgsc_data++;
@@ -2063,7 +2080,12 @@ static int dStage_tgscInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum,
appen->base = actor_data->base;
appen->room_no = (int)i_stage->getRoomNo();
appen->scale = tgsc_data->scale;
#if TARGET_PC
dStage_actorCreate(actor_data, appen,
sizeof(stage_actor_data_class) + sizeof(fopAcM_prmScale_class));
#else
dStage_actorCreate(actor_data, appen);
#endif
}
}
tgsc_data++;
@@ -2086,7 +2108,12 @@ static int dStage_doorInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum,
appen->base = actor_data->base;
appen->room_no = (int)i_stage->getRoomNo();
appen->scale = tgsc_data->scale;
#if TARGET_PC
dStage_actorCreate(actor_data, appen,
sizeof(stage_actor_data_class) + sizeof(fopAcM_prmScale_class));
#else
dStage_actorCreate(actor_data, appen);
#endif
}
tgsc_data++;
}
@@ -2511,6 +2538,29 @@ static void dKankyo_create() {
fopKyM_fastCreate(fpcNm_ENVSE_e, 0, NULL, NULL, NULL);
}
#if TARGET_PC
static void dusk_stage_svc_new_actor_create(dStage_dt_c* i_stage) {
dusk::mods::svc::stage_create_new_actors(i_stage->getRoomNo(),
[](void* user, const void* record, size_t size) {
auto* stage = static_cast<dStage_dt_c*>(user);
stage_tgsc_data_class object{};
std::memcpy(&object, record, size);
fopAcM_prm_class* appen = fopAcM_CreateAppend();
if (appen != nullptr) {
appen->base = object.base;
appen->room_no = static_cast<int>(stage->getRoomNo());
if (size > sizeof(stage_actor_data_class)) {
appen->scale = object.scale;
}
dStage_actorCreate(
reinterpret_cast<stage_actor_data_class*>(&object), appen, size);
}
},
i_stage);
}
#endif
static void layerMemoryInfoLoader(void* i_data, dStage_dt_c* i_stage, int param_2) {
UNUSED(param_2);
static FuncTable l_layerFuncTable[] = {
@@ -2707,6 +2757,9 @@ void dStage_dt_c_roomReLoader(void* i_data, dStage_dt_c* i_stage, int param_2) {
};
dStage_dt_c_decode(i_data, i_stage, l_funcTable, ARRAY_SIZEU(l_funcTable));
#if TARGET_PC
dusk_stage_svc_new_actor_create(i_stage);
#endif
layerActorLoader(i_data, i_stage, param_2);
}