mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-09-04 01:07:56 -04:00
Merge branch 'main' into 26-04-04-config
This commit is contained in:
@@ -590,8 +590,6 @@ static void cut_control2(obj_brg_class* i_this, br_s* i_part) {
|
||||
}
|
||||
|
||||
static void himo_cut_control1(obj_brg_class* i_this, cXyz* param_1, f32 param_2) {
|
||||
STUB_RET();
|
||||
|
||||
cXyz sp74 = {};
|
||||
cXyz sp80 = {};
|
||||
cXyz sp8C = {};
|
||||
|
||||
+2
-2
@@ -10156,9 +10156,9 @@ bool dCamera_c::eventCamera(s32 param_0) {
|
||||
mEye = mCenter + mDirection.Xyz();
|
||||
}
|
||||
|
||||
int* sp90_i;
|
||||
BE(int)* sp90_i;
|
||||
if (getEvStringData(sp90, "Trim", "DEFAULT") != false) {
|
||||
sp90_i = (int*)sp90;
|
||||
sp90_i = (BE(int)*)sp90;
|
||||
if (*sp90_i == 'STAN') {
|
||||
mEventData.field_0x1c = 0;
|
||||
} else if (*sp90_i == 'VIST') {
|
||||
|
||||
+3
-18
@@ -35,16 +35,6 @@ void OSInitContext(OSContext* context, u32 pc, u32 newsp) {
|
||||
context->gpr[1] = newsp;
|
||||
}
|
||||
|
||||
u32 OSSaveContext(OSContext* context) {
|
||||
// On PC we don't save PowerPC registers.
|
||||
// Return 0 = "context was just saved" (as opposed to 1 = "restored from save").
|
||||
return 0;
|
||||
}
|
||||
|
||||
void OSLoadContext(OSContext* context) {
|
||||
// No-op on PC (no PowerPC register restore)
|
||||
}
|
||||
|
||||
void OSDumpContext(OSContext* context) {
|
||||
if (!context) {
|
||||
OSReport("[PC] OSDumpContext: NULL context\n");
|
||||
@@ -66,20 +56,15 @@ void OSSaveFPUContext(OSContext* fpucontext) {
|
||||
}
|
||||
|
||||
u32 OSGetStackPointer(void) {
|
||||
// Return approximate stack pointer
|
||||
volatile u32 dummy;
|
||||
return (u32)(uintptr_t)&dummy;
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 OSSwitchStack(u32 newsp) {
|
||||
// Not meaningful on PC - return current sp
|
||||
return OSGetStackPointer();
|
||||
abort();
|
||||
}
|
||||
|
||||
int OSSwitchFiber(u32 pc, u32 newsp) {
|
||||
// Not meaningful on PC
|
||||
OSReport("[PC] OSSwitchFiber: not supported on PC\n");
|
||||
return 0;
|
||||
abort();
|
||||
}
|
||||
|
||||
void __OSContextInit(void) {
|
||||
|
||||
@@ -26,8 +26,6 @@ namespace dusk {
|
||||
}
|
||||
|
||||
ImGui::SetNextWindowBgAlpha(0.65f);
|
||||
ImGui::SetNextWindowSizeConstraints(ImVec2(300.f * ImGuiScale(), 0),
|
||||
ImVec2(FLT_MAX, FLT_MAX));
|
||||
|
||||
if (!ImGui::Begin("Camera Debug", nullptr, windowFlags)) {
|
||||
ImGui::End();
|
||||
|
||||
@@ -28,6 +28,14 @@ namespace dusk::config {
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
static void ImGuiMenuItem(const char* label, const char* shortcut, ConfigVar<bool>& p_selected, bool enabled = true) {
|
||||
bool copy = p_selected.getValue();
|
||||
if (ImGui::MenuItem(label, shortcut, ©, enabled)) {
|
||||
p_selected.setValue(copy);
|
||||
Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // DUSK_IMGUICONFIG_HPP
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
#include "ImGuiConsole.hpp"
|
||||
|
||||
#include "JSystem/JUtility/JUTGamePad.h"
|
||||
#include "dusk/config.hpp"
|
||||
#include "dusk/settings.h"
|
||||
|
||||
#if _WIN32
|
||||
#define NOMINMAX
|
||||
@@ -23,7 +25,7 @@ using namespace std::string_literals;
|
||||
using namespace std::string_view_literals;
|
||||
|
||||
namespace dusk {
|
||||
float ImGuiScale() { return ImGui::GetIO().DisplayFramebufferScale.x; }
|
||||
float ImGuiScale() { return 1.0f; }
|
||||
|
||||
void ImGuiStringViewText(std::string_view text) {
|
||||
// begin()/end() do not work on MSVC
|
||||
@@ -182,6 +184,20 @@ namespace dusk {
|
||||
m_isLaunchInitialized = true;
|
||||
}
|
||||
|
||||
getTransientSettings().skipFrameRateLimit = settings::game::enableTurboKeybind && ImGui::IsKeyDown(ImGuiKey_Tab);
|
||||
|
||||
if ((ImGui::IsKeyDown(ImGuiKey_LeftCtrl) || ImGui::IsKeyDown(ImGuiKey_RightCtrl)) &&
|
||||
ImGui::IsKeyPressed(ImGuiKey_R))
|
||||
{
|
||||
JUTGamePad::C3ButtonReset::sResetSwitchPushing = true;
|
||||
}
|
||||
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_F11)) {
|
||||
settings::video::enableFullscreen.setValue(!settings::video::enableFullscreen);
|
||||
VISetWindowFullscreen(settings::video::enableFullscreen);
|
||||
config::Save();
|
||||
}
|
||||
|
||||
if (CheckMenuViewToggle(ImGuiKey_F1, m_isHidden)) {
|
||||
ShowToasts();
|
||||
return;
|
||||
@@ -192,9 +208,11 @@ namespace dusk {
|
||||
|
||||
if (ImGui::BeginMainMenuBar()) {
|
||||
m_menuGame.draw();
|
||||
m_menuTools.draw();
|
||||
m_menuEnhancements.draw();
|
||||
|
||||
// Keep always last
|
||||
m_menuTools.draw();
|
||||
|
||||
ImGui::SetCursorPosX(ImGui::GetWindowWidth() - 80.0f * ImGuiScale());
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
ImGuiStringViewText(fmt::format(FMT_STRING("FPS: {:.2f}\n"), io.Framerate));
|
||||
|
||||
@@ -31,10 +31,13 @@ private:
|
||||
bool m_isHidden = true;
|
||||
bool m_isLaunchInitialized = false;
|
||||
std::deque<Toast> m_toasts;
|
||||
|
||||
ImGuiMenuGame m_menuGame;
|
||||
ImGuiMenuTools m_menuTools;
|
||||
ImGuiMenuEnhancements m_menuEnhancements;
|
||||
|
||||
// Keep always last
|
||||
ImGuiMenuTools m_menuTools;
|
||||
|
||||
void ShowToasts();
|
||||
void ShowPipelineProgress();
|
||||
};
|
||||
|
||||
@@ -38,6 +38,7 @@ void ImGuiEngine_Initialize(float scale) {
|
||||
ImGui::GetCurrentContext();
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
io.Fonts->Clear();
|
||||
io.FontGlobalScale = scale > 0.0f ? 1.0f / scale : 1.0f;
|
||||
|
||||
const std::string fontPath = GetAssetPath("NotoMono-Regular.ttf");
|
||||
const bool hasFontFile = AssetExists(fontPath);
|
||||
@@ -146,7 +147,6 @@ void ImGuiEngine_Initialize(float scale) {
|
||||
colors[ImGuiCol_NavWindowingDimBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.20f);
|
||||
colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.35f);
|
||||
|
||||
style.ScaleAllSizes(scale);
|
||||
}
|
||||
|
||||
Icon GetIcon() {
|
||||
|
||||
@@ -241,7 +241,7 @@ namespace dusk {
|
||||
}
|
||||
|
||||
char bufId[32];
|
||||
snprintf(bufId, sizeof(bufId), "%p", block);
|
||||
snprintf(bufId, sizeof(bufId), "%p", block.block);
|
||||
ImGui::PushID(bufId);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%08X", (u32)((uintptr_t)block.block - (uintptr_t)expHeap->getStartAddr()));
|
||||
|
||||
@@ -17,8 +17,6 @@ namespace dusk {
|
||||
ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav;
|
||||
|
||||
ImGui::SetNextWindowBgAlpha(0.65f);
|
||||
ImGui::SetNextWindowSizeConstraints(ImVec2(300.f * ImGuiScale(), 0),
|
||||
ImVec2(FLT_MAX, FLT_MAX));
|
||||
|
||||
if (!ImGui::Begin("Map Loader", &m_showMapLoader, windowFlags)) {
|
||||
ImGui::End();
|
||||
|
||||
@@ -39,28 +39,28 @@ namespace dusk {
|
||||
|
||||
if (ImGui::BeginMenu("Audio")) {
|
||||
ImGui::Text("Master Volume");
|
||||
config::ImGuiSliderFloat("##masterVolume", settings::audio::masterVolume, 0.0f, 1.0f, "");
|
||||
config::ImGuiSliderInt("##masterVolume", settings::audio::masterVolume, 0, 100);
|
||||
config::ImGuiCheckbox("Enable Reverb", settings::audio::enableReverb);
|
||||
/*
|
||||
// TODO: implement additional settings
|
||||
// TODO: Implement additional settings
|
||||
ImGui::Text("Main Music Volume");
|
||||
ImGui::SliderFloat("##mainMusicVolume", &getSettings().audio.mainMusicVolume, 0.0f, 1.0f, "");
|
||||
ImGui::SliderFloat("##mainMusicVolume", &getSettings().audio.mainMusicVolume, 0, 100);
|
||||
|
||||
ImGui::Text("Sub Music Volume");
|
||||
ImGui::SliderFloat("##subMusicVolume", &getSettings().audio.subMusicVolume, 0.0f, 1.0f, "");
|
||||
ImGui::SliderFloat("##subMusicVolume", &getSettings().audio.subMusicVolume, 0, 100);
|
||||
|
||||
ImGui::Text("Sound Effects Volume");
|
||||
ImGui::SliderFloat("##soundEffectsVolume", &getSettings().audio.soundEffectsVolume, 0.0f, 1.0f, "");
|
||||
ImGui::SliderFloat("##soundEffectsVolume", &getSettings().audio.soundEffectsVolume, 0, 100);
|
||||
|
||||
ImGui::Text("Fanfare Volume");
|
||||
ImGui::SliderFloat("##fanfareVolume", &getSettings().audio.fanfareVolume, 0.0f, 1.0f, "");
|
||||
ImGui::SliderFloat("##fanfareVolume", &getSettings().audio.fanfareVolume, 0, 100);
|
||||
|
||||
Z2AudioMgr* audioMgr = Z2AudioMgr::getInterface();
|
||||
if (audioMgr != nullptr) {
|
||||
}
|
||||
*/
|
||||
|
||||
audio::SetMasterVolume(settings::audio::masterVolume);
|
||||
audio::SetMasterVolume(settings::audio::masterVolume / 100.0f);
|
||||
audio::EnableReverb = settings::audio::enableReverb;
|
||||
|
||||
ImGui::EndMenu();
|
||||
@@ -78,14 +78,6 @@ namespace dusk {
|
||||
|
||||
windowInputViewer();
|
||||
windowControllerConfig();
|
||||
|
||||
if ((ImGui::IsKeyDown(ImGuiKey_LeftCtrl) || ImGui::IsKeyDown(ImGuiKey_RightCtrl)) && ImGui::IsKeyPressed(ImGuiKey_R)) {
|
||||
JUTGamePad::C3ButtonReset::sResetSwitchPushing = true;
|
||||
}
|
||||
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_F11)) {
|
||||
ToggleFullscreen();
|
||||
}
|
||||
}
|
||||
|
||||
static void drawVirtualStick(const char* id, const ImVec2& stick) {
|
||||
@@ -151,8 +143,6 @@ namespace dusk {
|
||||
ImGuiWindowFlags_AlwaysAutoResize;
|
||||
|
||||
ImGui::SetNextWindowBgAlpha(0.65f);
|
||||
ImGui::SetNextWindowSizeConstraints(ImVec2(850 * scale, 400 * scale),
|
||||
ImVec2(850 * scale, 400 * scale));
|
||||
|
||||
if (!ImGui::Begin("Controller Config", &m_showControllerConfig, windowFlags)) {
|
||||
ImGui::End();
|
||||
|
||||
@@ -3,13 +3,15 @@
|
||||
#include "aurora/gfx.h"
|
||||
|
||||
#include "dusk/hotkeys.h"
|
||||
#include "dusk/settings.h"
|
||||
#include "ImGuiConsole.hpp"
|
||||
#include "ImGuiMenuTools.hpp"
|
||||
|
||||
#include "m_Do/m_Do_main.h"
|
||||
#include "d/d_com_inf_game.h"
|
||||
#include "ImGuiConfig.hpp"
|
||||
#include "d/actor/d_a_alink.h"
|
||||
#include "d/actor/d_a_horse.h"
|
||||
#include "d/d_com_inf_game.h"
|
||||
#include "m_Do/m_Do_main.h"
|
||||
|
||||
namespace dusk {
|
||||
ImGuiMenuTools::ImGuiMenuTools() {}
|
||||
@@ -48,6 +50,8 @@ namespace dusk {
|
||||
ImGui::MenuItem("Save Editor", nullptr, &m_showSaveEditor);
|
||||
ImGui::MenuItem("Audio Debug", hotkeys::SHOW_AUDIO_DEBUG, &m_showAudioDebug);
|
||||
ImGui::MenuItem("OSReport Force", nullptr, &OSReportReallyForceEnable);
|
||||
ImGui::Separator();
|
||||
config::ImGuiMenuItem("Enable Turbo Key", hotkeys::TURBO, settings::game::enableTurboKeybind);
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
@@ -146,10 +150,10 @@ namespace dusk {
|
||||
}
|
||||
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
ImGuiWindowFlags windowFlags = ImGuiWindowFlags_NoResize;
|
||||
ImGuiWindowFlags windowFlags =
|
||||
ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize;
|
||||
|
||||
ImGui::SetNextWindowBgAlpha(0.65f);
|
||||
ImGui::SetNextWindowSizeConstraints(ImVec2(300, 200), ImVec2(300, 200));
|
||||
|
||||
if (ImGui::Begin("Player Info", &m_showPlayerInfo, windowFlags)) {
|
||||
daAlink_c* player = (daAlink_c*)dComIfGp_getPlayer(0);
|
||||
|
||||
@@ -284,10 +284,10 @@ namespace dusk {
|
||||
|
||||
void ImGuiSaveEditor::draw(bool& open) {
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
ImGuiWindowFlags windowFlags = ImGuiWindowFlags_NoResize;
|
||||
ImGuiWindowFlags windowFlags =
|
||||
ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize;
|
||||
|
||||
ImGui::SetNextWindowBgAlpha(0.65f);
|
||||
ImGui::SetNextWindowSizeConstraints(ImVec2(600, 700), ImVec2(600, 700));
|
||||
|
||||
if (ImGui::Begin("Save Editor", &open, windowFlags)) {
|
||||
if (ImGui::BeginTabBar("SaveEditorTabBar", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) {
|
||||
|
||||
+10
-5
@@ -7,11 +7,11 @@ ConfigVar<bool> enableFullscreen("video.enableFullscreen", false);
|
||||
}
|
||||
|
||||
namespace audio {
|
||||
ConfigVar<float> masterVolume("audio.masterVolume", 1.0f);
|
||||
ConfigVar<float> mainMusicVolume("audio.mainMusicVolume", 1.0f);
|
||||
ConfigVar<float> subMusicVolume("audio.subMusicVolume", 1.0f);
|
||||
ConfigVar<float> soundEffectsVolume("audio.soundEffectsVolume", 1.0f);
|
||||
ConfigVar<float> fanfareVolume("audio.fanfareVolume", 1.0f);
|
||||
ConfigVar<int> masterVolume("audio.masterVolume", 80);
|
||||
ConfigVar<int> mainMusicVolume("audio.mainMusicVolume", 100);
|
||||
ConfigVar<int> subMusicVolume("audio.subMusicVolume", 100);
|
||||
ConfigVar<int> soundEffectsVolume("audio.soundEffectsVolume", 100);
|
||||
ConfigVar<int> fanfareVolume("audio.fanfareVolume", 100);
|
||||
ConfigVar<bool> enableReverb("audio.enableReverb", true);
|
||||
}
|
||||
|
||||
@@ -47,6 +47,9 @@ ConfigVar<bool> canTransformAnywhere("game.canTransformAnywhere", false);
|
||||
|
||||
// Technical
|
||||
ConfigVar<bool> restoreWiiGlitches("game.restoreWiiGlitches", false);
|
||||
|
||||
// Controls
|
||||
ConfigVar<bool> enableTurboKeybind("game.enableTurboKeybind", true);
|
||||
}
|
||||
|
||||
void Register() {
|
||||
@@ -82,6 +85,7 @@ void Register() {
|
||||
Register(game::noMissClimbing);
|
||||
Register(game::noLowHpSound);
|
||||
Register(game::midnasLamentNonStop);
|
||||
Register(game::enableTurboKeybind);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,6 +104,7 @@ static TransientSettings g_transientSettings = {
|
||||
.colliderViewOpacity = 50.0f,
|
||||
.drawRange = 100.0f,
|
||||
},
|
||||
.skipFrameRateLimit = false,
|
||||
};
|
||||
|
||||
TransientSettings& getTransientSettings() {
|
||||
|
||||
+2
-9
@@ -1062,22 +1062,15 @@ extern "C" void KPADEnableDPD(s32) {
|
||||
void LCDisable(void) {
|
||||
STUB_LOG();
|
||||
}
|
||||
void LCQueueWait(__REGISTER u32 len) {
|
||||
STUB_LOG();
|
||||
}
|
||||
u32 LCStoreData(void* destAddr, void* srcAddr, u32 nBytes) {
|
||||
STUB_LOG();
|
||||
return 0;
|
||||
}
|
||||
|
||||
#pragma mark PPC Arch
|
||||
// MSR stuff?
|
||||
void PPCHalt() {
|
||||
STUB_LOG();
|
||||
abort();
|
||||
}
|
||||
|
||||
extern "C" void PPCSync(void) {
|
||||
STUB_LOG();
|
||||
// Does nothing on PC
|
||||
}
|
||||
|
||||
u32 PPCMfhid2() {
|
||||
|
||||
Reference in New Issue
Block a user