Skip to content

Commit aa40213

Browse files
committed
Trace iOS black screen startup
1 parent f462e2f commit aa40213

4 files changed

Lines changed: 53 additions & 2 deletions

File tree

UnleashedRecomp/app.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <gpu/video.h>
44
#include <install/installer.h>
55
#include <kernel/function.h>
6+
#include <os/logger.h>
67
#include <os/process.h>
78
#include <patches/audio_patches.h>
89
#include <patches/inspire_patches.h>
@@ -36,6 +37,10 @@ PPC_FUNC(sub_824EB490)
3637
App::s_isMissingDLC = !Installer::checkAllDLC(GetGamePath());
3738
App::s_language = Config::Language;
3839

40+
#ifdef UNLEASHED_RECOMP_IOS
41+
LOGFN("SWA::CApplication constructed. missingDLC={}", App::s_isMissingDLC);
42+
#endif
43+
3944
SWA::SGlobals::Init();
4045
Registry::Save();
4146

@@ -48,6 +53,15 @@ static std::thread::id g_mainThreadId = std::this_thread::get_id();
4853
PPC_FUNC_IMPL(__imp__sub_822C1130);
4954
PPC_FUNC(sub_822C1130)
5055
{
56+
#ifdef UNLEASHED_RECOMP_IOS
57+
static uint32_t s_updateCount = 0;
58+
if (s_updateCount < 5 || (s_updateCount % 300) == 0)
59+
{
60+
LOGFN("SWA::CApplication::Update count={} delta={}", s_updateCount, ctx.f1.f64);
61+
}
62+
s_updateCount++;
63+
#endif
64+
5165
Video::WaitOnSwapChain();
5266

5367
// Correct small delta time errors.
@@ -94,4 +108,3 @@ PPC_FUNC(sub_822C1130)
94108

95109
__imp__sub_822C1130(ctx, base);
96110
}
97-

UnleashedRecomp/gpu/video.cpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <user/config.h>
3434
#include <sdl_listener.h>
3535
#include <xxHashMap.h>
36+
#include <os/logger.h>
3637
#include <os/process.h>
3738

3839
#if defined(ASYNC_PSO_DEBUG) || defined(PSO_CACHING)
@@ -1969,6 +1970,19 @@ bool Video::CreateHostDevice(const char *sdlVideoDriver, bool graphicsApiRetry)
19691970
g_swapChain->setVsyncEnabled(Config::VSync);
19701971
g_swapChainValid = !g_swapChain->needsResize();
19711972

1973+
#ifdef UNLEASHED_RECOMP_IOS
1974+
LOGFN("Created iOS swapchain: buffers={} maxFrameLatency={} valid={} size={}x{} viewport={}x{} window={}x{}",
1975+
bufferCount,
1976+
Config::MaxFrameLatency.Value,
1977+
g_swapChainValid,
1978+
g_swapChain->getWidth(),
1979+
g_swapChain->getHeight(),
1980+
Video::s_viewportWidth,
1981+
Video::s_viewportHeight,
1982+
GameWindow::s_width,
1983+
GameWindow::s_height);
1984+
#endif
1985+
19721986
for (auto& acquireSemaphore : g_acquireSemaphores)
19731987
acquireSemaphore = g_device->createCommandSemaphore();
19741988

@@ -2184,6 +2198,10 @@ void Video::WaitForGPU()
21842198

21852199
static uint32_t CreateDevice(uint32_t a1, uint32_t a2, uint32_t a3, uint32_t a4, uint32_t a5, be<uint32_t>* a6)
21862200
{
2201+
#ifdef UNLEASHED_RECOMP_IOS
2202+
LOGFN("Guest CreateDevice called: a1=0x{:08X} a2=0x{:08X} a3=0x{:08X} a4=0x{:08X} a5=0x{:08X}", a1, a2, a3, a4, a5);
2203+
#endif
2204+
21872205
g_xdbfTextureCache = std::unordered_map<uint16_t, GuestTexture *>();
21882206

21892207
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,
22332251

22342252
*a6 = g_memory.MapVirtual(device);
22352253

2254+
#ifdef UNLEASHED_RECOMP_IOS
2255+
LOGFN("Guest CreateDevice finished: device=0x{:08X}", uint32_t(*a6));
2256+
#endif
2257+
22362258
return 0;
22372259
}
22382260

@@ -2873,6 +2895,15 @@ static std::atomic<bool> g_executedCommandList;
28732895

28742896
void Video::Present()
28752897
{
2898+
#ifdef UNLEASHED_RECOMP_IOS
2899+
static uint32_t s_presentCount = 0;
2900+
if (s_presentCount < 5 || (s_presentCount % 300) == 0)
2901+
{
2902+
LOGFN("Video::Present count={} swapChainValid={}", s_presentCount, g_swapChainValid);
2903+
}
2904+
s_presentCount++;
2905+
#endif
2906+
28762907
g_readyForCommands = false;
28772908

28782909
RenderCommand cmd;

UnleashedRecomp/res/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
VERSION_MILESTONE=""
22
VERSION_MAJOR=1
33
VERSION_MINOR=0
4-
VERSION_REVISION=4
4+
VERSION_REVISION=5

UnleashedRecomp/ui/game_window.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,13 @@ void GameWindow::Init(const char* sdlVideoDriver)
193193
s_width = Config::WindowWidth;
194194
s_height = Config::WindowHeight;
195195

196+
#ifdef UNLEASHED_RECOMP_IOS
197+
s_x = SDL_WINDOWPOS_UNDEFINED;
198+
s_y = SDL_WINDOWPOS_UNDEFINED;
199+
s_width = 1280;
200+
s_height = 720;
201+
#endif
202+
196203
if (s_x == -1 && s_y == -1)
197204
s_x = s_y = SDL_WINDOWPOS_CENTERED;
198205

0 commit comments

Comments
 (0)