//
// GameManager::firstLoad from 0x324120 to 0x324522 (1026 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void GameManager::firstLoad(GameManager *a1)
{
stl::StringData::Internal *v2; // r3
cocos2d::CCDictionary *m_valueKeeper; // r5
const char *v4; // r8
cocos2d::CCString *v5; // r0
char *CString; // r9
GameManager *v7; // r0
const char *IntGameVariable; // r1
cocos2d::CCString *v9; // r0
char *v10; // r0
const std::string *v11; // r1
cocos2d::CCObject *v12; // r11
cocos2d::CCDictionary *m_shouldLoadUnlockValueKeeper; // r6
cocos2d::CCDictionary *v14; // r0
cocos2d::CCDictionary *v15; // r7
cocos2d::CCDictionary *v16; // r0
cocos2d::CCDictionary *v17; // r0
cocos2d::CCDictionary *v18; // r7
cocos2d::CCDictionary *m_unlockValueKeeper; // r0
cocos2d::CCDictionary *v20; // r0
cocos2d::CCDictionary *v21; // r7
cocos2d::CCDictionary *m_customObjectDict; // r0
int v23; // r0
int v24; // s15
int v25; // r0
_BOOL4 v26; // r3
int v27; // s15
FMODAudioEngine *v28; // r0
FMODAudioEngine *v29; // r0
AchievementManager *v30; // r0
GameLevelManager *v31; // r0
GameStatsManager *v32; // r0
MusicDownloadManager *v33; // r0
GJAccountManager *v34; // r0
GJMultiplayerManager *v35; // r0
KeybindingsManager *v36; // r0
unsigned int v37; // r8
cocos2d::CCArray *v38; // r9
cocos2d::CCString *v39; // r0
char *v40; // r10
cocos2d::CCString *v41; // r0
cocos2d::CCString *v42; // [sp+4h] [bp-20h]
char v43; // [sp+14h] [bp-10h] BYREF
std::string v44[3]; // [sp+18h] [bp-Ch] BYREF
a1->m_clickedYouTube = 0;
a1->m_clickedFacebook = 0;
v2 = (stl::StringData::Internal *)_stack_chk_guard;
a1->m_clickedTwitter = 0;
a1->m_clickedTwitch = 0;
a1->m_clickedDiscord = 0;
a1->m_clickedReddit = 0;
v44[1].m_data.m_data = v2;
a1->m_socialsDuration = 0.0;
GameManager::resetDPadSettings(a1, 0);
GameManager::resetDPadSettings(a1, 1);
if ( a1->m_shouldLoadUnlockValueKeeper )
{
m_valueKeeper = a1->m_valueKeeper;
if ( m_valueKeeper )
{
v4 = (char *)&dword_0 + 1;
m_valueKeeper = cocos2d::CCDictionary::create();
do
{
v5 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%04i", v4);
CString = (char *)cocos2d::CCString::getCString(v5);
v7 = GameManager::sharedState();
IntGameVariable = (const char *)GameManager::getIntGameVariable(v7, CString);
if ( (int)IntGameVariable > 0 )
{
v9 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", IntGameVariable);
v10 = (char *)cocos2d::CCString::getCString(v9);
sub_776584((int)&v43, v10);
v12 = (cocos2d::CCObject *)cocos2d::CCString::create((cocos2d::CCString *)&v43, v11);
sub_776584((int)v44, CString);
cocos2d::CCDictionary::setObject((int)m_valueKeeper, v12);
sub_774008(v44);
sub_774008(&v43);
}
++v4;
}
while ( v4 != (_BYTE *)&dword_B4 + 2 );
}
}
else
{
m_valueKeeper = nullptr;
}
m_shouldLoadUnlockValueKeeper = (cocos2d::CCDictionary *)a1->m_shouldLoadUnlockValueKeeper;
if ( a1->m_shouldLoadUnlockValueKeeper )
{
m_shouldLoadUnlockValueKeeper = a1->m_unlockValueKeeper;
if ( m_shouldLoadUnlockValueKeeper )
m_shouldLoadUnlockValueKeeper = (cocos2d::CCDictionary *)GameManager::getUGV(a1, "30");
}
v14 = cocos2d::CCDictionary::create();
v15 = v14;
if ( a1->m_valueKeeper != v14 )
{
if ( v14 )
cocos2d::CCObject::retain(v14);
v16 = a1->m_valueKeeper;
if ( v16 )
cocos2d::CCObject::release(v16);
a1->m_valueKeeper = v15;
}
v17 = cocos2d::CCDictionary::create();
v18 = v17;
if ( a1->m_unlockValueKeeper != v17 )
{
if ( v17 )
cocos2d::CCObject::retain(v17);
m_unlockValueKeeper = a1->m_unlockValueKeeper;
if ( m_unlockValueKeeper )
cocos2d::CCObject::release(m_unlockValueKeeper);
a1->m_unlockValueKeeper = v18;
}
if ( !a1->m_customObjectDict )
{
v20 = cocos2d::CCDictionary::create();
v21 = v20;
if ( a1->m_customObjectDict != v20 )
{
if ( v20 )
cocos2d::CCObject::retain(v20);
m_customObjectDict = a1->m_customObjectDict;
if ( m_customObjectDict )
cocos2d::CCObject::release(m_customObjectDict);
a1->m_customObjectDict = v21;
}
}
if ( !a1->m_shouldLoadUnlockValueKeeper )
{
PlatformToolbox::getUniqueUserID((PlatformToolbox *)v44);
sub_774794(&a1->m_playerUDID, v44);
sub_774008(v44);
}
sub_7753D4((int)&a1->m_playerName, "Player");
a1->m_playerUserID.value = 0;
v23 = rand();
a1->m_hasRP.value = 0;
v24 = (int)(float)((float)((float)v23 * 4.6566e-10) * 1000.0);
a1->m_playerUserID.seed = v24;
a1->m_playerUserID.random = v24;
v25 = rand();
v26 = a1->m_shouldLoadUnlockValueKeeper;
a1->m_hasDRP = 0;
v27 = (int)(float)((float)((float)v25 * 4.6566e-10) * 1000.0);
a1->m_hasRP.seed = v27;
a1->m_hasRP.random = v27;
if ( !v26 )
{
a1->m_firstSetup = 1;
a1->m_showedMenu = 1;
a1->m_unknownBool4 = 1;
}
GameManager::resetAllIcons(a1);
if ( !a1->m_shouldLoadUnlockValueKeeper )
{
v28 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::setBackgroundMusicVolume(v28, 1.0);
v29 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::setEffectsVolume(v29, 1.0);
}
v30 = AchievementManager::sharedState();
AchievementManager::firstSetup(v30);
v31 = GameLevelManager::sharedState();
GameLevelManager::firstSetup(v31);
v32 = GameStatsManager::sharedState();
GameStatsManager::firstSetup(v32);
v33 = MusicDownloadManager::sharedState();
MusicDownloadManager::firstSetup(v33);
v34 = GJAccountManager::sharedState();
GJAccountManager::firstSetup(v34);
v35 = GJMultiplayerManager::sharedState();
GJMultiplayerManager::firstSetup(v35);
v36 = KeybindingsManager::sharedState();
KeybindingsManager::firstSetup(v36);
if ( a1->m_shouldLoadUnlockValueKeeper )
{
if ( m_valueKeeper )
{
v37 = 0;
v38 = cocos2d::CCDictionary::allKeys(m_valueKeeper);
while ( v37 < cocos2d::CCArray::count(v38) )
{
v39 = cocos2d::CCArray::stringAtIndex(v38, v37);
v40 = (char *)cocos2d::CCString::getCString(v39);
sub_776584((int)v44, v40);
v41 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(m_valueKeeper, v44);
v42 = (cocos2d::CCString *)cocos2d::CCString::intValue(v41);
sub_774008(v44);
GameManager::setIntGameVariable(a1, v40, (int)v42);
++v37;
}
}
}
else
{
a1->m_showBPMMarkers = 0;
a1->m_showProgressBar = 0;
a1->m_performanceMode = 0;
a1->m_showedRateDiffDialog = 0;
a1->m_showedRateStarDialog = 0;
a1->m_showedLowDetailDialog = 0;
a1->m_recordGameplay = 0;
a1->m_resolution = -1;
a1->m_showSongMarkers = 1;
a1->m_vsyncEnabled = 1;
GameManager::setGameVariable(a1, "0002", 1);
GameManager::setGameVariable(a1, "0001", 1);
GameManager::setGameVariable(a1, "0026", 1);
GameManager::setGameVariable(a1, "0027", 1);
GameManager::setGameVariable(a1, "0023", 1);
GameManager::setGameVariable(a1, "0038", 1);
GameManager::setGameVariable(a1, "0043", 1);
GameManager::setGameVariable(a1, "0044", 1);
GameManager::setIntGameVariable(a1, "0050", 2);
GameManager::setIntGameVariable(a1, "0049", 6);
GameManager::setGameVariable(a1, "0046", 1);
GameManager::setGameVariable(a1, "0044", 1);
GameManager::setGameVariable(a1, "0036", 1);
GameManager::setGameVariable(a1, "0118", 1);
GameManager::setGameVariable(a1, "0117", 1);
GameManager::setGameVariable(a1, "0158", 1);
GameManager::setGameVariable(a1, "0121", 1);
GameManager::setGameVariable(a1, "0037", 1);
}
if ( a1->m_shouldLoadUnlockValueKeeper && m_shouldLoadUnlockValueKeeper )
GameManager::setUGV(a1, "30", 1);
a1->m_loaded = 1;
}