//
// -[CCDirectorCaller startMainLoop] from 0x100212fa8 to 0x1002130ac (260 bytes)
//
// 1 xrefs:
// > ??> @ 0x100845e28
//
// 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 __cdecl -[CCDirectorCaller startMainLoop](CCDirectorCaller *self, SEL a2)
{
__int64 v3; // x0
__int64 v4; // x20
int v5; // w0
id displayLink; // x21
float v7; // s8
cocos2d::CCDirector *v8; // x0
double v9; // d0
double v10; // d1
double v11; // d2
CAFrameRateRange v12; // 0:kr00_12.12
self->_lastTime = 0.0;
objc_msgSend(self->displayLink, "invalidate");
self->displayLink = nullptr;
self->displayLink = -[objc_class displayLinkWithTarget:selector:](
NSClassFromString(&cfstr_Cadisplaylink.isa),
"displayLinkWithTarget:selector:",
self,
"doCaller:");
v3 = -[UIScreen maximumFramesPerSecond](
+[UIScreen mainScreen](&OBJC_CLASS___UIScreen, "mainScreen"),
"maximumFramesPerSecond");
if ( v3 >= 60 )
v4 = 60;
else
v4 = v3;
v5 = sub_10062E7CC(2, 15, 0, 0);
displayLink = self->displayLink;
if ( v5 )
{
v7 = (float)v4;
v12 = CAFrameRateRangeMake((float)v4, (float)v4, (float)v4);
*(float *)&v9 = v12.minimum;
*(float *)&v10 = v12.maximum;
*(float *)&v11 = v12.preferred;
objc_msgSend(displayLink, "setPreferredFrameRateRange:", v9, v10, v11);
}
else
{
objc_msgSend(self->displayLink, "setPreferredFramesPerSecond:", v4);
v7 = (float)v4;
}
objc_msgSend(
self->displayLink,
"addToRunLoop:forMode:",
+[NSRunLoop currentRunLoop](&OBJC_CLASS___NSRunLoop, "currentRunLoop"),
NSRunLoopCommonModes);
v8 = cocos2d::CCDirector::sharedDirector();
((void (__fastcall *)(cocos2d::CCDirector *, double))v8->setAnimationInterval)(v8, (float)(1.0 / v7));
}