diff --git a/UnleashedRecomp/config.cpp b/UnleashedRecomp/config.cpp index a0cd8c6..1d93021 100644 --- a/UnleashedRecomp/config.cpp +++ b/UnleashedRecomp/config.cpp @@ -15,7 +15,12 @@ void Config::Load() auto toml = toml::parse_file(configPath.string()); for (auto def : Definitions) + { def->ReadValue(toml); +#if _DEBUG + printf("%s\n", def->GetDefinition().c_str()); +#endif + } } catch (toml::parse_error& err) { diff --git a/UnleashedRecomp/config.h b/UnleashedRecomp/config.h index 715db5b..9605223 100644 --- a/UnleashedRecomp/config.h +++ b/UnleashedRecomp/config.h @@ -26,6 +26,8 @@ public: CONFIG_DEFINE("Audio", bool, WerehogBattleMusic, true); CONFIG_DEFINE_ENUM("Video", EGraphicsAPI, GraphicsAPI, EGraphicsAPI::D3D12); + CONFIG_DEFINE("Video", int32_t, WindowX, -1); + CONFIG_DEFINE("Video", int32_t, WindowY, -1); CONFIG_DEFINE("Video", size_t, WindowWidth, 1280); CONFIG_DEFINE("Video", size_t, WindowHeight, 720); @@ -36,12 +38,12 @@ public: CONFIG_DEFINE("Video", bool, Fullscreen, false); CONFIG_DEFINE("Video", bool, VSync, true); - CONFIG_DEFINE("Video", size_t, BufferCount, 3); + CONFIG_DEFINE("Video", bool, TripleBuffering, true); CONFIG_DEFINE("Video", int32_t, FPS, 60); CONFIG_DEFINE("Video", float, Brightness, 0.5f); CONFIG_DEFINE("Video", size_t, MSAA, 4); CONFIG_DEFINE("Video", size_t, AnisotropicFiltering, 16); - CONFIG_DEFINE("Video", int32_t, ShadowResolution, 4096); + CONFIG_DEFINE_ENUM("Video", EShadowResolution, ShadowResolution, EShadowResolution::x4096); CONFIG_DEFINE_ENUM("Video", EGITextureFiltering, GITextureFiltering, EGITextureFiltering::Bicubic); CONFIG_DEFINE("Video", bool, AlphaToCoverage, false); CONFIG_DEFINE("Video", bool, Xbox360ColourCorrection, false); diff --git a/UnleashedRecomp/config_detail.h b/UnleashedRecomp/config_detail.h index f85aa48..091bed7 100644 --- a/UnleashedRecomp/config_detail.h +++ b/UnleashedRecomp/config_detail.h @@ -234,6 +234,26 @@ CONFIG_DEFINE_ENUM_TEMPLATE(EGraphicsAPI) { "Vulkan", EGraphicsAPI::Vulkan } }; +enum class EShadowResolution : int32_t +{ + Original = -1, + x512 = 512, + x1024 = 1024, + x2048 = 2048, + x4096 = 4096, + x8192 = 8192 +}; + +CONFIG_DEFINE_ENUM_TEMPLATE(EShadowResolution) +{ + { "Original", EShadowResolution::Original }, + { "512", EShadowResolution::x512 }, + { "1024", EShadowResolution::x1024 }, + { "2048", EShadowResolution::x2048 }, + { "4096", EShadowResolution::x4096 }, + { "8192", EShadowResolution::x8192 }, +}; + enum class EGITextureFiltering : uint32_t { Linear, diff --git a/UnleashedRecomp/gpu/video.cpp b/UnleashedRecomp/gpu/video.cpp index 118f257..3eb408c 100644 --- a/UnleashedRecomp/gpu/video.cpp +++ b/UnleashedRecomp/gpu/video.cpp @@ -581,7 +581,7 @@ static void CreateHostDevice() g_copyCommandList = g_device->createCommandList(RenderCommandListType::COPY); g_copyCommandFence = g_device->createCommandFence(); - g_swapChain = g_queue->createSwapChain(Window::s_windowHandle, 2, RenderFormat::R8G8B8A8_UNORM); + g_swapChain = g_queue->createSwapChain(Window::s_windowHandle, Config::TripleBuffering ? 3 : 2, RenderFormat::R8G8B8A8_UNORM); for (auto& acquireSemaphore : g_acquireSemaphores) acquireSemaphore = g_device->createCommandSemaphore(); @@ -2614,8 +2614,10 @@ void IndexBufferLengthMidAsmHook(PPCRegister& r3) void SetShadowResolutionMidAsmHook(PPCRegister& r11) { - if (Config::ShadowResolution > 0) - r11.u64 = Config::ShadowResolution; + auto res = (int32_t)Config::ShadowResolution.Value; + + if (res > 0) + r11.u64 = res; } void Primitive2DHalfPixelOffsetMidAsmHook(PPCRegister& f13)