//
// MoreVideoOptionsLayer::onApplyFPS from 0x7d10c8 to 0x7d1368 (672 bytes)
//
// 1 xrefs:
// > ??> @ 0xb9070
//
// 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 MoreVideoOptionsLayer::onApplyFPS(MoreVideoOptionsLayer *a1, cocos2d::CCObject *a2)
{
double v3; // d0
const char *v4; // x1
cocos2d::CCString *v5; // x0
float v6; // s0
char *v7; // x1
float v8; // s8
char *v9; // x0
float v10; // s0
cocos2d::CCString *v11; // x0
size_t v12; // x0
CCTextInputNode *m_fpsInput; // x22
char *v14; // x0
GameManager *v15; // x0
char *v16; // x0
unsigned int *v17; // x1
int v18; // w2
unsigned int *v19; // x1
int v20; // w2
int v21; // w2
const char *CString; // [xsp+48h] [xbp+48h]
char *v23; // [xsp+58h] [xbp+58h] BYREF
char *v24; // [xsp+60h] [xbp+60h] BYREF
CCTextInputNode::getString(a1->m_fpsInput, (__int64)&v24);
v3 = atof(v24);
v5 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%.03f", v4, v3);
v6 = cocos2d::CCString::floatValue(v5);
v7 = v24;
v8 = v6;
v9 = v24 - 24;
if ( v24 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v7 = v24 - 8;
do
v21 = __ldaxr((unsigned int *)v7);
while ( __stlxr(v21 - 1, (unsigned int *)v7) );
}
else
{
v21 = *((_DWORD *)v24 - 2);
*((_DWORD *)v24 - 2) = v21 - 1;
}
if ( v21 <= 0 )
operator delete(v9);
}
if ( v8 < 60.0 )
v8 = 60.0;
v10 = floorf(v8);
v23 = &byte_124B6C8;
if ( v8 == v10 )
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(unsigned int)(int)v10);
else
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%.03f", v7, v8);
CString = cocos2d::CCString::getCString(v11);
v12 = strlen(CString);
sub_D1798C(&v23, CString, v12);
m_fpsInput = a1->m_fpsInput;
sub_D18D28(&v24);
CCTextInputNode::setString(m_fpsInput, (const unsigned __int8 **)&v24);
v14 = v24 - 24;
if ( v24 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v17 = (unsigned int *)(v24 - 8);
do
v18 = __ldaxr(v17);
while ( __stlxr(v18 - 1, v17) );
}
else
{
v18 = *((_DWORD *)v24 - 2);
*((_DWORD *)v24 - 2) = v18 - 1;
}
if ( v18 <= 0 )
operator delete(v14);
}
GameManager::sharedState()->m_customFPSTarget = v8;
v15 = GameManager::sharedState();
GameManager::updateCustomFPS(v15);
v16 = v23 - 24;
if ( v23 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v19 = (unsigned int *)(v23 - 8);
do
v20 = __ldaxr(v19);
while ( __stlxr(v20 - 1, v19) );
}
else
{
v20 = *((_DWORD *)v23 - 2);
*((_DWORD *)v23 - 2) = v20 - 1;
}
if ( v20 <= 0 )
operator delete(v16);
}
}