//
// PlayLayer::resumeAndRestart from 0x10014c518 to 0x10014c65c (324 bytes)
//
// 2 xrefs:
// > PauseLayer::onRestartFull @ 0x1001bf7ec
// > PauseLayer::onRestart @ 0x1001bfae4
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 10:59:37 +0000
//
__int64 __fastcall PlayLayer::resumeAndRestart(_BYTE *a1, int a2)
{
_BYTE *v4; // x21
__int64 v5; // x0
__int64 v6; // x0
__int64 v7; // x0
__int64 v8; // x0
__int64 v9; // x0
double BackgroundMusicVolume; // d0
__int64 result; // x0
__int64 v12; // x0
__int64 v13; // x0
__int64 v14; // x0
__n128 GameVariable; // q0
__int64 v16; // x0
__n128 v17; // q0
char v18; // w0
v4 = a1 + 12238;
if ( a1[12544] != 1 || a1[12545] == 1 )
{
if ( (a2 & 1) != 0 || (*v4 & 1) == 0 )
{
v8 = GJBaseGameLayer::resetAudio(a1);
}
else
{
v5 = FMODAudioEngine::sharedEngine(a1);
v6 = FMODAudioEngine::stopAllEffects(v5);
v7 = FMODAudioEngine::sharedEngine(v6);
v8 = FMODAudioEngine::stopAllMusic(v7, 0);
}
v4[2642] = 0;
v9 = FMODAudioEngine::sharedEngine(v8);
BackgroundMusicVolume = FMODAudioEngine::getBackgroundMusicVolume(v9);
v4[2050] = *(float *)&BackgroundMusicVolume <= 0.0;
}
v4[2513] = 0;
a1[1982] = 0;
result = AppDelegate::get(a1);
if ( *(_BYTE *)(result + 17) == 1 )
{
*(_BYTE *)(AppDelegate::get(result) + 17) = 0;
PlayLayer::releaseAllPlayerButtons((__int64)a1);
UILayer::resetAllButtons(*((_QWORD *)a1 + 1661));
v12 = UILayer::toggleMenuVisibility(*((_QWORD *)a1 + 1661), 1);
v13 = GameManager::sharedState(v12);
GameVariable = GameManager::getGameVariable(v13, "0128");
if ( (_DWORD)v14 )
{
PlatformToolbox::toggleLockCursor(1, GameVariable);
}
else
{
v16 = GameManager::sharedState(v14);
v17 = GameManager::getGameVariable(v16, "0024");
if ( (v18 & 1) == 0 )
PlatformToolbox::hideCursor(v17);
}
(*(void (__fastcall **)(_BYTE *))(*(_QWORD *)a1 + 704LL))(a1);
if ( a2 )
return PlayLayer::resetLevelFromStart(a1);
else
return (*(__int64 (__fastcall **)(_BYTE *))(*(_QWORD *)a1 + 1608LL))(a1);
}
return result;
}