This commit is contained in:
madeline
2026-04-09 04:59:55 -07:00
20 changed files with 128 additions and 40 deletions
+1 -1
+1
View File
@@ -62,6 +62,7 @@ struct UserSettings {
ConfigVar<bool> enableFastIronBoots;
ConfigVar<bool> canTransformAnywhere;
ConfigVar<bool> fastSpinner;
ConfigVar<bool> freeMagicArmor;
// Technical
ConfigVar<bool> restoreWiiGlitches;
@@ -813,9 +813,15 @@ s32 JASSeqParser::cmdDump(JASTrack* param_0, u32* param_1) {
}
s32 JASSeqParser::cmdPrintf(JASTrack* param_0, u32* param_1) {
#if AVOID_UB
u8 stack_c[4] = {0};
u32 stack_10[4] = {0};
char buffer[128] = {0};
#else
u8 stack_c[4];
u32 stack_10[4];
char buffer[128];
#endif
JASSeqCtrl* seqCtrl = param_0->getSeqCtrl();
u32 r30 = 0;
+10
View File
@@ -12677,7 +12677,11 @@ void daAlink_c::setMagicArmorBrk(int i_status) {
}
BOOL daAlink_c::checkMagicArmorHeavy() const {
#if TARGET_PC
return checkMagicArmorWearAbility() && (dComIfGs_getRupee() == 0 && !dusk::getSettings().game.freeMagicArmor);
#else
return checkMagicArmorWearAbility() && dComIfGs_getRupee() == 0;
#endif
}
BOOL daAlink_c::checkBootsOrArmorHeavy() const {
@@ -18583,7 +18587,13 @@ int daAlink_c::execute() {
field_0x372c = cXyz::Zero;
field_0x2fb8 = 0;
#if TARGET_PC
// This handles rupee drain and transitions between rupees/no rupees
// We can skip all of that if the magic armor doesn't use rupees
if (!dusk::getSettings().game.freeMagicArmor && checkMagicArmorWearAbility() && mClothesChangeWaitTimer == 0) {
#else
if (checkMagicArmorWearAbility() && mClothesChangeWaitTimer == 0) {
#endif
if (checkMagicArmorNoDamage() && !checkEventRun()) {
if (field_0x2fc3 == 0) {
field_0x2fc3 = 10;
+5
View File
@@ -187,6 +187,11 @@ int daAlink_c::setDamagePoint(int i_dmgAmount, BOOL i_checkZoraMag, BOOL i_setDm
}
if (checkMagicArmorNoDamage()) {
#if TARGET_PC
if(dusk::getSettings().game.freeMagicArmor) {
i_dmgAmount = 0;
}
#endif
dComIfGp_setItemRupeeCount(-i_dmgAmount * 10);
} else
#if DEBUG
+1 -2
View File
@@ -1564,8 +1564,7 @@ void daAlink_c::setMetamorphoseEffectStartLink() {
#endif
#if TARGET_PC
static const Vec effWideScale = {mDoGph_gInf_c::getAspect(), 1.0f, 1.0f};
emitter->setGlobalParticleScale(effWideScale);
emitter->setGlobalParticleScale(mDoGph_gInf_c::getScale(), 1.0f);
#endif
}
+10 -1
View File
@@ -313,7 +313,12 @@ void daAlink_c::changeLink(int param_0) {
mpLinkHandModel =
initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes(l_mArcName, "al_hands.bmd")), 0);
if (dComIfGs_getRupee() != 0) {
#if TARGET_PC
if (dComIfGs_getRupee() != 0 || dusk::getSettings().game.freeMagicArmor)
#else
if (dComIfGs_getRupee() != 0)
#endif
{
setMagicArmorBrk(1);
} else {
setMagicArmorBrk(0);
@@ -398,7 +403,11 @@ void daAlink_c::changeLink(int param_0) {
field_0x06ec = field_0x064C->getMaterialNodePointer(1)->getShape();
field_0x06f0 = field_0x064C->getMaterialNodePointer(2)->getShape();
#if TARGET_PC
if (dComIfGs_getRupee() != 0 || dusk::getSettings().game.freeMagicArmor) {
#else
if (dComIfGs_getRupee() != 0) {
#endif
var_r27 = 4;
} else {
var_r27 = 5;
+8
View File
@@ -300,11 +300,19 @@ int daGrdWater_c::Draw() {
J3DTexMtxInfo* mtxInfo = &material->getTexGenBlock()->getTexMtx(0)->getTexMtxInfo();
if (mtxInfo != NULL) {
Mtx afStack_50;
#if TARGET_PC
C_MTXLightPerspective(afStack_50, dComIfGd_getView()->fovy, dComIfGd_getView()->aspect,
1.0f, 1.0f, dusk::getSettings().game.useWaterProjectionOffset ? -0.01f : 0.0f, 0.0f);
#else
C_MTXLightPerspective(afStack_50, dComIfGd_getView()->fovy, dComIfGd_getView()->aspect,
1.0f, 1.0f, -0.01f, 0.0f);
#endif
#if WIDESCREEN_SUPPORT
mDoGph_gInf_c::setWideZoomLightProjection(afStack_50);
#endif
mtxInfo->setEffectMtx(afStack_50);
modelData2->simpleCalcMaterial(0, (MtxP)j3dDefaultMtx);
}
+6
View File
@@ -371,8 +371,14 @@ int daLv3Water_c::Draw() {
texMtxInfo = &material->getTexGenBlock()->getTexMtx(0)->getTexMtxInfo();
if (texMtxInfo != NULL) {
Mtx lightProjMtx;
#if TARGET_PC
C_MTXLightPerspective(lightProjMtx, dComIfGd_getView()->fovy,
dComIfGd_getView()->aspect, 1.0f, 1.0f, dusk::getSettings().game.useWaterProjectionOffset ? -0.01f : 0.0f, 0.0f);
#else
C_MTXLightPerspective(lightProjMtx, dComIfGd_getView()->fovy,
dComIfGd_getView()->aspect, 1.0f, 1.0f, -0.01f, 0.0f);
#endif
#if WIDESCREEN_SUPPORT
mDoGph_gInf_c::setWideZoomLightProjection(lightProjMtx);
+6
View File
@@ -197,7 +197,13 @@ int daLv3Water2_c::Draw() {
texMtxInfo = &btkMaterial->getTexGenBlock()->getTexMtx(0)->getTexMtxInfo();
if(texMtxInfo) {
Mtx lightProjMtx;
#if TARGET_PC
C_MTXLightPerspective(lightProjMtx, dComIfGd_getView()->fovy,
dComIfGd_getView()->aspect, 1.0f, 1.0f, dusk::getSettings().game.useWaterProjectionOffset ? -0.01f : 0.0f, 0);
#else
C_MTXLightPerspective(lightProjMtx, dComIfGd_getView()->fovy, dComIfGd_getView()->aspect, 1.0f, 1.0f, -0.01f, 0);
#endif
#if WIDESCREEN_SUPPORT
mDoGph_gInf_c::setWideZoomLightProjection(lightProjMtx);
+7
View File
@@ -27,8 +27,15 @@ static int daObj_Lv3waterB_Draw(obj_lv3WaterB_class* i_this) {
J3DTexMtxInfo* tex_mtx_info = &material_p->getTexGenBlock()->getTexMtx(0)->getTexMtxInfo();
if (tex_mtx_info != NULL) {
Mtx m;
#if TARGET_PC
C_MTXLightPerspective(m, dComIfGd_getView()->fovy, dComIfGd_getView()->aspect, 1.0f, 1.0f,
dusk::getSettings().game.useWaterProjectionOffset ? -0.015f : 0.0f, 0.0f);
#else
C_MTXLightPerspective(m, dComIfGd_getView()->fovy, dComIfGd_getView()->aspect, 1.0f,
1.0f, -0.015f, 0.0f);
#endif
#if WIDESCREEN_SUPPORT
mDoGph_gInf_c::setWideZoomLightProjection(m);
#endif
+7
View File
@@ -313,8 +313,15 @@ int daObjRotStair_c::Draw() {
J3DTexMtxInfo* texMtxInfo = &material->getTexGenBlock()->getTexMtx(0)->getTexMtxInfo();
if (texMtxInfo != NULL) {
Mtx lightMtx;
#if TARGET_PC
C_MTXLightPerspective(lightMtx, dComIfGd_getView()->fovy,
dComIfGd_getView()->aspect, 1.0f, 1.0f, dusk::getSettings().game.useWaterProjectionOffset ? -0.01f : 0.0f, 0);
#else
C_MTXLightPerspective(lightMtx, dComIfGd_getView()->fovy,
dComIfGd_getView()->aspect, 1.0f, 1.0f, -0.01f, 0);
#endif
#if WIDESCREEN_SUPPORT
mDoGph_gInf_c::setWideZoomLightProjection(lightMtx);
#endif
+7
View File
@@ -36,8 +36,15 @@ static int daObj_Tp_Draw(obj_tp_class* i_this) {
&material->getTexGenBlock()->getTexMtx(0)->getTexMtxInfo();
if (texMtxInfo != NULL) {
Mtx lightProjMtx;
#if TARGET_PC
C_MTXLightPerspective(lightProjMtx, dComIfGd_getView()->fovy,
dComIfGd_getView()->aspect, 1.0f, 1.0f, dusk::getSettings().game.useWaterProjectionOffset ? -0.01f : 0.0f, 0);
#else
C_MTXLightPerspective(lightProjMtx, dComIfGd_getView()->fovy,
dComIfGd_getView()->aspect, 1.0f, 1.0f, -0.01f, 0);
#endif
#if WIDESCREEN_SUPPORT
mDoGph_gInf_c::setWideZoomLightProjection(lightProjMtx);
#endif
+8
View File
@@ -821,12 +821,20 @@ static void dKy_FiveSenses_fullthrottle_dark_static1() {
}
if (kankyo->senses_ef_emitter1 != NULL) {
#if TARGET_PC
kankyo->senses_ef_emitter1->setGlobalParticleScale(mDoGph_gInf_c::getScale(), 1.0f);
#endif
kankyo->senses_ef_emitter1->setGlobalTranslation(particle_pos.x, particle_pos.y,
particle_pos.z);
kankyo->senses_ef_emitter1->setGlobalAlpha(kankyo->senses_effect_strength * 255.0f);
}
if (kankyo->senses_ef_emitter2 != NULL) {
#if TARGET_PC
kankyo->senses_ef_emitter2->setGlobalParticleScale(mDoGph_gInf_c::getScale(), 1.0f);
#endif
kankyo->senses_ef_emitter2->setGlobalTranslation(particle_pos.x, particle_pos.y,
particle_pos.z);
+3
View File
@@ -2293,7 +2293,10 @@ void dMeter_drawHIO_c::updateOnWide() {
g_drawHIO.mMainHUDButtonsPosX = mDoGph_gInf_c::ScaleHUDXRight(g_drawHIO.mMainHUDButtonsPosX);
g_drawHIO.mRingHUDButtonsPosX = mDoGph_gInf_c::ScaleHUDXRight(g_drawHIO.mRingHUDButtonsPosX);
g_drawHIO.mLightDrop.mVesselPosX = mDoGph_gInf_c::ScaleHUDXRight(g_drawHIO.mLightDrop.mVesselPosX);
g_drawHIO.mLightDrop.mVesselTalkPosX = mDoGph_gInf_c::ScaleHUDXRight(g_drawHIO.mLightDrop.mVesselTalkPosX);
g_drawHIO.mRupeeKeyPosX = mDoGph_gInf_c::ScaleHUDXRight(g_drawHIO.mRupeeKeyPosX);
g_drawHIO.mOxygenMeterPosX = mDoGph_gInf_c::ScaleHUDXLeft(g_drawHIO.mOxygenMeterPosX);
g_drawHIO.mButtonCrossOFFPosX = mDoGph_gInf_c::ScaleHUDXLeft(g_drawHIO.mButtonCrossOFFPosX);
g_drawHIO.mButtonCrossONPosX = mDoGph_gInf_c::ScaleHUDXLeft(g_drawHIO.mButtonCrossONPosX);
g_drawHIO.mLifeGaugePosX = mDoGph_gInf_c::ScaleHUDXLeft(g_drawHIO.mLifeGaugePosX);
+1 -1
View File
@@ -411,7 +411,7 @@ void dMsgScrnItem_c::drawSelf() {
f32 globalPosX = mpTm_c[0]->getGlobalPosX();
#if WIDESCREEN_SUPPORT
#if WIDESCREEN_SUPPORT && !TARGET_PC
if (mDoGph_gInf_c::isWide()) {
drawOutFont(g_MsgObject_HIO_c.mBoxItemTextPosX + 7.0f + YREG_F(2),
g_MsgObject_HIO_c.mBoxItemTextPosY, 1.0f);
+5 -2
View File
@@ -158,10 +158,13 @@ namespace dusk {
auto itemMin = ImGui::GetItemRectMin();
auto itemMax = ImGui::GetItemRectMax();
float frameSpacingY = 8.0f;
float frameBottomPadding = 10.0f;
ImVec2 halfFrame = ImVec2((frameHeight * 0.25f) * 0.5f, frameHeight * 0.5f);
ImGui::GetWindowDrawList()->AddRect(
ImVec2(itemMin.x + halfFrame.x, itemMin.y + halfFrame.y),
ImVec2(itemMax.x - halfFrame.x, itemMax.y),
ImVec2(itemMin.x + halfFrame.x, itemMin.y + halfFrame.y + frameSpacingY),
ImVec2(itemMax.x - halfFrame.x, itemMax.y + frameBottomPadding),
ImColor(ImGui::GetStyleColorVec4(ImGuiCol_Border)),
halfFrame.x);
+5
View File
@@ -111,6 +111,11 @@ namespace dusk {
ImGui::SetTooltip("Speeds up Spinner movement when holding R.");
}
config::ImGuiCheckbox("Free Magic Armor", getSettings().game.freeMagicArmor);
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Makes the magic armor work without rupees.");
}
ImGui::EndMenu();
}
+29 -33
View File
@@ -116,9 +116,9 @@ namespace dusk {
static void drawVirtualStick(const char* id, const ImVec2& stick) {
float scale = ImGuiScale();
ImGui::SetCursorPos(ImVec2(ImGui::GetCursorPos().x + 5 * scale, ImGui::GetCursorPos().y));
ImGui::SetCursorPos(ImVec2(ImGui::GetCursorPos().x + 45 * scale, ImGui::GetCursorPos().y + 10));
ImGui::BeginChild(id, ImVec2(80 * scale, 80 * scale));
ImGui::BeginChild(id, ImVec2(80 * scale, 80 * scale), 0, ImGuiWindowFlags_NoBackground);
ImDrawList* dl = ImGui::GetWindowDrawList();
ImVec2 p = ImGui::GetCursorScreenPos();
@@ -222,6 +222,7 @@ namespace dusk {
// controller selection combo box
bool changedController = false;
int changedControllerIndex = 0;
ImGui::SetNextItemWidth(400.0f * scale);
if (ImGui::BeginCombo("##ControllerDeviceList", currentName.c_str())) {
for (int i = 0; const auto& name : controllerList) {
if (ImGui::Selectable(name.c_str(), currentName == name)) {
@@ -300,7 +301,7 @@ namespace dusk {
uint32_t axisCount;
PADAxisMapping* axisMappingList = PADGetAxisMappings(m_controllerConfig.m_selectedPort, &axisCount);
ImGuiBeginGroupPanel("Triggers", ImVec2(150 * scale, 20 * scale));
ImGuiBeginGroupPanel("Analog Triggers", ImVec2(150 * scale, 20 * scale));
PADAxis triggers[] = {PAD_AXIS_TRIGGER_L, PAD_AXIS_TRIGGER_R};
if (axisMappingList != nullptr) {
@@ -334,11 +335,34 @@ namespace dusk {
}
}
int port = m_controllerConfig.m_selectedPort;
PADDeadZones* deadZones = PADGetDeadZones(port);
if (deadZones != nullptr) {
ImGui::Text("L Threshold");
ImGui::SameLine();
{
float tmp = static_cast<float>(deadZones->leftTriggerActivationZone * 100.f) / 32767.f;
if (ImGui::DragFloat("##LThreshold", &tmp, 0.5f, 0.f, 100.f, "%.3f%%")) {
deadZones->leftTriggerActivationZone = static_cast<u16>((tmp / 100.f) * 32767);
}
}
}
if (deadZones != nullptr) {
ImGui::Text("R Threshold");
ImGui::SameLine();
{
float tmp = static_cast<float>(deadZones->rightTriggerActivationZone * 100.f) / 32767.f;
if (ImGui::DragFloat("##RThreshold", &tmp, 0.5f, 0.f, 100.f, "%.3f%%")) {
deadZones->rightTriggerActivationZone = static_cast<u16>((tmp / 100.f) * 32767);
}
}
}
ImGuiEndGroupPanel();
ImGui::SameLine();
int port = m_controllerConfig.m_selectedPort;
// main stick panel
ImGuiBeginGroupPanel("Control Stick", ImVec2(150 * scale, 20 * scale));
@@ -388,8 +412,6 @@ namespace dusk {
}
}
PADDeadZones* deadZones = PADGetDeadZones(port);
if (deadZones != nullptr) {
ImGui::Text("Dead Zone");
{
@@ -465,32 +487,6 @@ namespace dusk {
ImGuiEndGroupPanel();
ImGui::SameLine();
// Triggers Panel
ImGuiBeginGroupPanel("Triggers", ImVec2(150 * scale, 20 * scale));
if (deadZones != nullptr) {
ImGui::Text("L Threshold");
{
float tmp = static_cast<float>(deadZones->leftTriggerActivationZone * 100.f) / 32767.f;
if (ImGui::DragFloat("##LThreshold", &tmp, 0.5f, 0.f, 100.f, "%.3f%%")) {
deadZones->leftTriggerActivationZone = static_cast<u16>((tmp / 100.f) * 32767);
}
}
}
if (deadZones != nullptr) {
ImGui::Text("R Threshold");
{
float tmp = static_cast<float>(deadZones->rightTriggerActivationZone * 100.f) / 32767.f;
if (ImGui::DragFloat("##RThreshold", &tmp, 0.5f, 0.f, 100.f, "%.3f%%")) {
deadZones->rightTriggerActivationZone = static_cast<u16>((tmp / 100.f) * 32767);
}
}
}
ImGuiEndGroupPanel();
ImGui::SameLine();
// Options panel
ImGuiBeginGroupPanel("Options", ImVec2(150 * scale, 20 * scale));
+2
View File
@@ -50,6 +50,7 @@ UserSettings g_userSettings = {
.enableFastIronBoots {"game.enableFastIronBoots", false},
.canTransformAnywhere {"game.canTransformAnywhere", false},
.fastSpinner {"game.fastSpinner", false},
.freeMagicArmor {"game.freeMagicArmor", false},
// Technical
.restoreWiiGlitches {"game.restoreWiiGlitches", false},
@@ -95,6 +96,7 @@ void registerSettings() {
Register(g_userSettings.game.useWaterProjectionOffset);
Register(g_userSettings.game.enableFastIronBoots);
Register(g_userSettings.game.canTransformAnywhere);
Register(g_userSettings.game.freeMagicArmor);
Register(g_userSettings.game.restoreWiiGlitches);
Register(g_userSettings.game.noMissClimbing);
Register(g_userSettings.game.noLowHpSound);