diff --git a/UnleashedRecomp/app.cpp b/UnleashedRecomp/app.cpp index b298ebc3..c7b116d5 100644 --- a/UnleashedRecomp/app.cpp +++ b/UnleashedRecomp/app.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -36,6 +37,10 @@ PPC_FUNC(sub_824EB490) App::s_isMissingDLC = !Installer::checkAllDLC(GetGamePath()); App::s_language = Config::Language; +#ifdef UNLEASHED_RECOMP_IOS + LOGFN("SWA::CApplication constructed. missingDLC={}", App::s_isMissingDLC); +#endif + SWA::SGlobals::Init(); Registry::Save(); @@ -48,6 +53,15 @@ static std::thread::id g_mainThreadId = std::this_thread::get_id(); PPC_FUNC_IMPL(__imp__sub_822C1130); PPC_FUNC(sub_822C1130) { +#ifdef UNLEASHED_RECOMP_IOS + static uint32_t s_updateCount = 0; + if (s_updateCount < 5 || (s_updateCount % 300) == 0) + { + LOGFN("SWA::CApplication::Update count={} delta={}", s_updateCount, ctx.f1.f64); + } + s_updateCount++; +#endif + Video::WaitOnSwapChain(); // Correct small delta time errors. @@ -94,4 +108,3 @@ PPC_FUNC(sub_822C1130) __imp__sub_822C1130(ctx, base); } - diff --git a/UnleashedRecomp/gpu/video.cpp b/UnleashedRecomp/gpu/video.cpp index ca85f59a..adebce15 100644 --- a/UnleashedRecomp/gpu/video.cpp +++ b/UnleashedRecomp/gpu/video.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #if defined(ASYNC_PSO_DEBUG) || defined(PSO_CACHING) @@ -1969,6 +1970,19 @@ bool Video::CreateHostDevice(const char *sdlVideoDriver, bool graphicsApiRetry) g_swapChain->setVsyncEnabled(Config::VSync); g_swapChainValid = !g_swapChain->needsResize(); +#ifdef UNLEASHED_RECOMP_IOS + LOGFN("Created iOS swapchain: buffers={} maxFrameLatency={} valid={} size={}x{} viewport={}x{} window={}x{}", + bufferCount, + Config::MaxFrameLatency.Value, + g_swapChainValid, + g_swapChain->getWidth(), + g_swapChain->getHeight(), + Video::s_viewportWidth, + Video::s_viewportHeight, + GameWindow::s_width, + GameWindow::s_height); +#endif + for (auto& acquireSemaphore : g_acquireSemaphores) acquireSemaphore = g_device->createCommandSemaphore(); @@ -2184,6 +2198,10 @@ void Video::WaitForGPU() static uint32_t CreateDevice(uint32_t a1, uint32_t a2, uint32_t a3, uint32_t a4, uint32_t a5, be* a6) { +#ifdef UNLEASHED_RECOMP_IOS + LOGFN("Guest CreateDevice called: a1=0x{:08X} a2=0x{:08X} a3=0x{:08X} a4=0x{:08X} a5=0x{:08X}", a1, a2, a3, a4, a5); +#endif + g_xdbfTextureCache = std::unordered_map(); for (auto &achievement : g_xdbfWrapper.GetAchievements(XDBF_LANGUAGE_ENGLISH)) @@ -2233,6 +2251,10 @@ static uint32_t CreateDevice(uint32_t a1, uint32_t a2, uint32_t a3, uint32_t a4, *a6 = g_memory.MapVirtual(device); +#ifdef UNLEASHED_RECOMP_IOS + LOGFN("Guest CreateDevice finished: device=0x{:08X}", uint32_t(*a6)); +#endif + return 0; } @@ -2873,6 +2895,15 @@ static std::atomic g_executedCommandList; void Video::Present() { +#ifdef UNLEASHED_RECOMP_IOS + static uint32_t s_presentCount = 0; + if (s_presentCount < 5 || (s_presentCount % 300) == 0) + { + LOGFN("Video::Present count={} swapChainValid={}", s_presentCount, g_swapChainValid); + } + s_presentCount++; +#endif + g_readyForCommands = false; RenderCommand cmd; diff --git a/UnleashedRecomp/res/version.txt b/UnleashedRecomp/res/version.txt index ce05700d..d686b025 100644 --- a/UnleashedRecomp/res/version.txt +++ b/UnleashedRecomp/res/version.txt @@ -1,4 +1,4 @@ VERSION_MILESTONE="" VERSION_MAJOR=1 VERSION_MINOR=0 -VERSION_REVISION=4 +VERSION_REVISION=5 diff --git a/UnleashedRecomp/ui/game_window.cpp b/UnleashedRecomp/ui/game_window.cpp index c179d59c..b6e384f7 100644 --- a/UnleashedRecomp/ui/game_window.cpp +++ b/UnleashedRecomp/ui/game_window.cpp @@ -193,6 +193,13 @@ void GameWindow::Init(const char* sdlVideoDriver) s_width = Config::WindowWidth; s_height = Config::WindowHeight; +#ifdef UNLEASHED_RECOMP_IOS + s_x = SDL_WINDOWPOS_UNDEFINED; + s_y = SDL_WINDOWPOS_UNDEFINED; + s_width = 1280; + s_height = 720; +#endif + if (s_x == -1 && s_y == -1) s_x = s_y = SDL_WINDOWPOS_CENTERED;