{"type": "func", "start": 4297142184, "end": 4297142444, "name": "-[CCDirectorCaller startMainLoop]", "pseudocode": "// \n// -[CCDirectorCaller startMainLoop] from 0x100212fa8 to 0x1002130ac (260 bytes)\n// \n// 1 xrefs:\n// > <???> @ 0x100845e28\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\nvoid __cdecl -[CCDirectorCaller startMainLoop](CCDirectorCaller *self, SEL a2)\n{\n  __int64 v3; // x0\n  __int64 v4; // x20\n  int v5; // w0\n  id displayLink; // x21\n  float v7; // s8\n  cocos2d::CCDirector *v8; // x0\n  double v9; // d0\n  double v10; // d1\n  double v11; // d2\n  CAFrameRateRange v12; // 0:kr00_12.12\n\n  self->_lastTime = 0.0;\n  objc_msgSend(self->displayLink, \"invalidate\");\n  self->displayLink = nullptr;\n  self->displayLink = -[objc_class displayLinkWithTarget:selector:](\n                        NSClassFromString(&cfstr_Cadisplaylink.isa),\n                        \"displayLinkWithTarget:selector:\",\n                        self,\n                        \"doCaller:\");\n  v3 = -[UIScreen maximumFramesPerSecond](\n         +[UIScreen mainScreen](&OBJC_CLASS___UIScreen, \"mainScreen\"),\n         \"maximumFramesPerSecond\");\n  if ( v3 >= 60 )\n    v4 = 60;\n  else\n    v4 = v3;\n  v5 = sub_10062E7CC(2, 15, 0, 0);\n  displayLink = self->displayLink;\n  if ( v5 )\n  {\n    v7 = (float)v4;\n    v12 = CAFrameRateRangeMake((float)v4, (float)v4, (float)v4);\n    *(float *)&v9 = v12.minimum;\n    *(float *)&v10 = v12.maximum;\n    *(float *)&v11 = v12.preferred;\n    objc_msgSend(displayLink, \"setPreferredFrameRateRange:\", v9, v10, v11);\n  }\n  else\n  {\n    objc_msgSend(self->displayLink, \"setPreferredFramesPerSecond:\", v4);\n    v7 = (float)v4;\n  }\n  objc_msgSend(\n    self->displayLink,\n    \"addToRunLoop:forMode:\",\n    +[NSRunLoop currentRunLoop](&OBJC_CLASS___NSRunLoop, \"currentRunLoop\"),\n    NSRunLoopCommonModes);\n  v8 = cocos2d::CCDirector::sharedDirector();\n  ((void (__fastcall *)(cocos2d::CCDirector *, double))v8->setAnimationInterval)(v8, (float)(1.0 / v7));\n}", "assembly": "; \n; -[CCDirectorCaller startMainLoop] from 0x100212fa8 to 0x1002130ac (260 bytes)\n; \n; 1 xrefs:\n; > <???> @ 0x100845e28\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nSTP             D9, D8, [SP,#-0x10+var_30]!                            ; +0x0, 0x100212fa8\nSTP             X22, X21, [SP,#0x30+var_20]                            ; +0x4, 0x100212fac\nSTP             X20, X19, [SP,#0x30+var_10]                            ; +0x8, 0x100212fb0\nSTP             X29, X30, [SP,#0x30+var_s0]                            ; +0xc, 0x100212fb4\nADD             X29, SP, #0x30                                         ; +0x10, 0x100212fb8\nMOV             X19, X0                                                ; +0x14, 0x100212fbc\nSTR             XZR, [X0,#0x18]                                        ; +0x18, 0x100212fc0\nLDR             X0, [X0,#8]                                            ; +0x1c, 0x100212fc4\nBL              _objc_msgSend$invalidate                               ; +0x20, 0x100212fc8\nSTR             XZR, [X19,#8]                                          ; +0x24, 0x100212fcc\nADRL            X0, cfstr_Cadisplaylink; aClassName                    ; +0x28, 0x100212fd0\nBL              _NSClassFromString                                     ; +0x30, 0x100212fd8\nADRP            X8, #selRef_doCaller_@PAGE                             ; +0x34, 0x100212fdc\nLDR             X3, [X8,#selRef_doCaller_@PAGEOFF]; \"doCaller:\" ...    ; +0x38, 0x100212fe0\nMOV             X2, X19                                                ; +0x3c, 0x100212fe4\nBL              _objc_msgSend$displayLinkWithTarget_selector_; -[objc_class displayLinkWithTarget:selector:] ... ; +0x40, 0x100212fe8\nSTR             X0, [X19,#8]                                           ; +0x44, 0x100212fec\nADRP            X8, #classRef_UIScreen@PAGE                            ; +0x48, 0x100212ff0\nLDR             X0, [X8,#classRef_UIScreen@PAGEOFF]; _OBJC_CLASS_$_UIScreen ; +0x4c, 0x100212ff4\nBL              _objc_msgSend$mainScreen; +[UIScreen mainScreen] ...   ; +0x50, 0x100212ff8\nBL              _objc_msgSend$maximumFramesPerSecond; -[UIScreen maximumFramesPerSecond] ... ; +0x54, 0x100212ffc\nCMP             X0, #0x3C ; '<'                                        ; +0x58, 0x100213000\nMOV             W8, #0x3C ; '<'                                        ; +0x5c, 0x100213004\nCSEL            X20, X0, X8, LT                                        ; +0x60, 0x100213008\nMOV             W0, #2                                                 ; +0x64, 0x10021300c\nMOV             W1, #0xF                                               ; +0x68, 0x100213010\nMOV             W2, #0                                                 ; +0x6c, 0x100213014\nMOV             W3, #0                                                 ; +0x70, 0x100213018\nBL              sub_10062E7CC                                          ; +0x74, 0x10021301c\nLDR             X21, [X19,#8]                                          ; +0x78, 0x100213020\nCBZ             W0, loc_100213048                                      ; +0x7c, 0x100213024\nSCVTF           S8, X20                                                ; +0x80, 0x100213028\nFMOV            S0, S8; minimum                                        ; +0x84, 0x10021302c\nFMOV            S1, S8; maximum                                        ; +0x88, 0x100213030\nFMOV            S2, S8; preferred                                      ; +0x8c, 0x100213034\nBL              _CAFrameRateRangeMake                                  ; +0x90, 0x100213038\nMOV             X0, X21                                                ; +0x94, 0x10021303c\nBL              _objc_msgSend$setPreferredFrameRateRange_              ; +0x98, 0x100213040\nB               loc_100213058                                          ; +0x9c, 0x100213044\nMOV             X0, X21                                                ; +0xa0, 0x100213048\nMOV             X2, X20                                                ; +0xa4, 0x10021304c\nBL              _objc_msgSend$setPreferredFramesPerSecond_             ; +0xa8, 0x100213050\nSCVTF           S8, X20                                                ; +0xac, 0x100213054\nLDR             X19, [X19,#8]                                          ; +0xb0, 0x100213058\nADRP            X8, #classRef_NSRunLoop@PAGE                           ; +0xb4, 0x10021305c\nLDR             X0, [X8,#classRef_NSRunLoop@PAGEOFF]; _OBJC_CLASS_$_NSRunLoop ; +0xb8, 0x100213060\nBL              _objc_msgSend$currentRunLoop; +[NSRunLoop currentRunLoop] ... ; +0xbc, 0x100213064\nMOV             X2, X0                                                 ; +0xc0, 0x100213068\nADRP            X8, #_NSRunLoopCommonModes_ptr@PAGE                    ; +0xc4, 0x10021306c\nLDR             X8, [X8,#_NSRunLoopCommonModes_ptr@PAGEOFF]; _NSRunLoopCommonModes ; +0xc8, 0x100213070\nLDR             X3, [X8]                                               ; +0xcc, 0x100213074\nMOV             X0, X19                                                ; +0xd0, 0x100213078\nBL              _objc_msgSend$addToRunLoop_forMode_                    ; +0xd4, 0x10021307c\nBL              cocos2d__CCDirector__sharedDirector                    ; +0xd8, 0x100213080\nFMOV            S0, #1.0                                               ; +0xdc, 0x100213084\nFDIV            S0, S0, S8                                             ; +0xe0, 0x100213088\nFCVT            D0, S0                                                 ; +0xe4, 0x10021308c\nLDR             X8, [X0]                                               ; +0xe8, 0x100213090\nLDR             X1, [X8,#0x60]                                         ; +0xec, 0x100213094\nLDP             X29, X30, [SP,#0x30+var_s0]                            ; +0xf0, 0x100213098\nLDP             X20, X19, [SP,#0x30+var_10]                            ; +0xf4, 0x10021309c\nLDP             X22, X21, [SP,#0x30+var_20]                            ; +0xf8, 0x1002130a0\nLDP             D9, D8, [SP+0x30+var_30],#0x40                         ; +0xfc, 0x1002130a4\nBR              X1                                                     ; +0x100, 0x1002130a8", "xrefs": ["<???> @ 0x100845e28"], "is_objc": true, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}