{"type": "func", "start": 6442849680, "end": 6442850336, "name": "cocos2d::CCRenderTexture::begin", "pseudocode": "// \n// cocos2d::CCRenderTexture::begin from 0x180061590 to 0x180061820 (656 bytes)\n// \n// 9 xrefs:\n// > cocos2d::CCTransitionCrossFade::onEnter @ 0x180056a36\n// > cocos2d::CCTransitionCrossFade::onEnter @ 0x180056af0\n// > cocos2d::CCTransitionProgress::onEnter @ 0x180059576\n// > cocos2d::CCRenderTexture::beginWithClear @ 0x180061852\n// > cocos2d::CCRenderTexture::clearDepth @ 0x180061ad5\n// > cocos2d::CCRenderTexture::draw @ 0x180061d9a\n// > cocos2d::CCRenderTexture::newCCImage @ 0x180062593\n// > <???> @ 0x18014cf68\n// > <???> @ 0x1801bd648\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:21:51 +0000\n// \n\n// Hidden C++ exception states: #wind=1\nvoid __fastcall cocos2d::CCRenderTexture::begin(cocos2d::CCRenderTexture *this)\n{\n  struct cocos2d::CCDirector *v2; // rbx\n  const struct cocos2d::CCSize *ContentSizeInPixels; // rax\n  float v4; // xmm0_4\n  float v5; // xmm0_4\n  float v6; // xmm6_4\n  int v7; // edx\n  int v8; // r8d\n  int v9; // r9d\n  struct cocos2d::CCConfiguration *v10; // rax\n  char v11; // bl\n  void *v12; // r8\n  unsigned int v13; // eax\n  unsigned int v14; // eax\n  float v15; // [rsp+40h] [rbp-A8h] BYREF\n  float v16; // [rsp+44h] [rbp-A4h]\n  _DWORD v17[2]; // [rsp+48h] [rbp-A0h] BYREF\n  void *Block[3]; // [rsp+50h] [rbp-98h] BYREF\n  unsigned __int64 v19; // [rsp+68h] [rbp-80h]\n  _BYTE v20[64]; // [rsp+70h] [rbp-78h] BYREF\n\n  kmGLMatrixMode(5889);\n  kmGLPushMatrix();\n  kmGLMatrixMode(5888);\n  kmGLPushMatrix();\n  v2 = cocos2d::CCDirector::sharedDirector();\n  cocos2d::CCDirector::setProjection(v2, *((unsigned int *)v2 + 79));\n  ContentSizeInPixels = cocos2d::CCTexture2D::getContentSizeInPixels(*((cocos2d::CCTexture2D **)this + 43));\n  cocos2d::cc_timeval::operator=(&v15, ContentSizeInPixels);\n  v4 = *((float *)this + 101);\n  if ( v4 > 0.0 )\n    v15 = roundf(v4 * v15);\n  v5 = *((float *)this + 102);\n  if ( v5 > 0.0 )\n    v16 = roundf(v5 * v16);\n  cocos2d::CCDirector::getWinSizeInPixels(v2, v17);\n  v6 = *(float *)&v17[1] / v16;\n  glViewport(0, 0, (int)v15, (int)v16);\n  kmMat4OrthographicProjection((unsigned int)v20, v7, v8, v9, 1.0 / v6, -1082130432, 1065353216);\n  kmGLMultMatrix(v20);\n  glGetIntegerv(0x8CA6u, (GLint *)this + 84);\n  _glewBindFramebuffer(36160, *((unsigned int *)this + 82));\n  sub_180005A10(Block, \"GL_QCOM\");\n  v10 = cocos2d::CCConfiguration::sharedConfiguration();\n  v11 = cocos2d::CCConfiguration::checkForGLExtension(v10, Block);\n  if ( v19 > 0xF )\n  {\n    v12 = Block[0];\n    if ( v19 + 1 >= 0x1000 )\n    {\n      v12 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v12 - 8) > 0x1F )\n        invoke_watson(nullptr, nullptr, nullptr, 0, 0);\n    }\n    j_j_free_0(v12);\n  }\n  if ( v11 )\n  {\n    v13 = (*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 44) + 96LL))(*((_QWORD *)this + 44));\n    _glewFramebufferTexture2D(36160, 36064, 3553, v13, 0);\n    glClear(0x4100u);\n    v14 = (*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 43) + 96LL))(*((_QWORD *)this + 43));\n    _glewFramebufferTexture2D(36160, 36064, 3553, v14, 0);\n  }\n}", "assembly": "; \n; cocos2d::CCRenderTexture::begin from 0x180061590 to 0x180061820 (656 bytes)\n; \n; 9 xrefs:\n; > cocos2d::CCTransitionCrossFade::onEnter @ 0x180056a36\n; > cocos2d::CCTransitionCrossFade::onEnter @ 0x180056af0\n; > cocos2d::CCTransitionProgress::onEnter @ 0x180059576\n; > cocos2d::CCRenderTexture::beginWithClear @ 0x180061852\n; > cocos2d::CCRenderTexture::clearDepth @ 0x180061ad5\n; > cocos2d::CCRenderTexture::draw @ 0x180061d9a\n; > cocos2d::CCRenderTexture::newCCImage @ 0x180062593\n; > <???> @ 0x18014cf68\n; > <???> @ 0x1801bd648\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:21:51 +0000\n; \nmov     rax, rsp                                                       ; +0x0, 0x180061590\nmov     [rax+10h], rbx                                                 ; +0x3, 0x180061593\npush    rdi                                                            ; +0x7, 0x180061597\nsub     rsp, 0E0h                                                      ; +0x8, 0x180061598\nmovaps  xmmword ptr [rax-18h], xmm6                                    ; +0xf, 0x18006159f\nmovaps  xmmword ptr [rax-28h], xmm7                                    ; +0x13, 0x1800615a3\nmov     rax, cs:__security_cookie                                      ; +0x17, 0x1800615a7\nxor     rax, rsp                                                       ; +0x1e, 0x1800615ae\nmov     [rsp+0E8h+var_38], rax                                         ; +0x21, 0x1800615b1\nmov     rdi, rcx                                                       ; +0x29, 0x1800615b9\nmov     ecx, 1701h                                                     ; +0x2c, 0x1800615bc\ncall    kmGLMatrixMode                                                 ; +0x31, 0x1800615c1\ncall    kmGLPushMatrix                                                 ; +0x36, 0x1800615c6\nmov     ecx, 1700h                                                     ; +0x3b, 0x1800615cb\ncall    kmGLMatrixMode                                                 ; +0x40, 0x1800615d0\ncall    kmGLPushMatrix                                                 ; +0x45, 0x1800615d5\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x4a, 0x1800615da\nmov     rbx, rax                                                       ; +0x4f, 0x1800615df\nmov     edx, [rax+13Ch]                                                ; +0x52, 0x1800615e2\nmov     rcx, rax                                                       ; +0x58, 0x1800615e8\ncall    ?setProjection@CCDirector@cocos2d@@QEAAXW4ccDirectorProjection@2@@Z; cocos2d::CCDirector::setProjection(cocos2d::ccDirectorProjection) ; +0x5b, 0x1800615eb\nmov     rcx, [rdi+158h]; this                                          ; +0x60, 0x1800615f0\ncall    ?getContentSizeInPixels@CCTexture2D@cocos2d@@QEAAAEBVCCSize@2@XZ; cocos2d::CCTexture2D::getContentSizeInPixels(void) ; +0x67, 0x1800615f7\nmov     rdx, rax                                                       ; +0x6c, 0x1800615fc\nlea     rcx, [rsp+0E8h+var_A8]                                         ; +0x6f, 0x1800615ff\ncall    ??4cc_timeval@cocos2d@@QEAAAEAU01@$$QEAU01@@Z; cocos2d::cc_timeval::operator=(cocos2d::cc_timeval &&) ; +0x74, 0x180061604\nmovss   xmm0, dword ptr [rdi+194h]                                     ; +0x79, 0x180061609\nxorps   xmm6, xmm6                                                     ; +0x81, 0x180061611\ncomiss  xmm0, xmm6                                                     ; +0x84, 0x180061614\njbe     short loc_18006162A                                            ; +0x87, 0x180061617\nmulss   xmm0, [rsp+0E8h+var_A8]; X                                     ; +0x89, 0x180061619\ncall    roundf                                                         ; +0x8f, 0x18006161f\nmovss   [rsp+0E8h+var_A8], xmm0                                        ; +0x94, 0x180061624\nmovss   xmm0, dword ptr [rdi+198h]                                     ; +0x9a, 0x18006162a\ncomiss  xmm0, xmm6                                                     ; +0xa2, 0x180061632\njbe     short loc_180061648                                            ; +0xa5, 0x180061635\nmulss   xmm0, [rsp+0E8h+var_A4]; X                                     ; +0xa7, 0x180061637\ncall    roundf                                                         ; +0xad, 0x18006163d\nmovss   [rsp+0E8h+var_A4], xmm0                                        ; +0xb2, 0x180061642\nlea     rdx, [rsp+0E8h+var_A0]                                         ; +0xb8, 0x180061648\nmov     rcx, rbx                                                       ; +0xbd, 0x18006164d\ncall    ?getWinSizeInPixels@CCDirector@cocos2d@@QEAA?AVCCSize@2@XZ; cocos2d::CCDirector::getWinSizeInPixels(void) ; +0xc0, 0x180061650\nmovss   xmm7, [rsp+0E8h+var_A0]                                        ; +0xc5, 0x180061655\ndivss   xmm7, [rsp+0E8h+var_A8]                                        ; +0xcb, 0x18006165b\nmovss   xmm6, [rsp+0E8h+var_9C]                                        ; +0xd1, 0x180061661\ndivss   xmm6, [rsp+0E8h+var_A4]                                        ; +0xd7, 0x180061667\ncvttss2si r9d, [rsp+0E8h+var_A4]; height                               ; +0xdd, 0x18006166d\ncvttss2si r8d, [rsp+0E8h+var_A8]; width                                ; +0xe4, 0x180061674\nxor     edx, edx; y                                                    ; +0xeb, 0x18006167b\nxor     ecx, ecx; x                                                    ; +0xed, 0x18006167d\ncall    cs:glViewport                                                  ; +0xef, 0x18006167f\nmovss   xmm4, cs:flt_1800EC208                                         ; +0xf5, 0x180061685\nmovaps  xmm5, xmm4                                                     ; +0xfd, 0x18006168d\ndivss   xmm5, xmm6                                                     ; +0x100, 0x180061690\nmovss   xmm0, cs:dword_1800ED380                                       ; +0x104, 0x180061694\nmovaps  xmm3, xmm0                                                     ; +0x10c, 0x18006169c\ndivss   xmm3, xmm6                                                     ; +0x10f, 0x18006169f\nmovaps  xmm2, xmm4                                                     ; +0x113, 0x1800616a3\ndivss   xmm2, xmm7                                                     ; +0x116, 0x1800616a6\nmovaps  xmm1, xmm0                                                     ; +0x11a, 0x1800616aa\ndivss   xmm1, xmm7                                                     ; +0x11d, 0x1800616ad\nmovss   [rsp+0E8h+var_B8], xmm4                                        ; +0x121, 0x1800616b1\nmovss   [rsp+0E8h+var_C0], xmm0                                        ; +0x127, 0x1800616b7\nmovss   dword ptr [rsp+0E8h+Reserved], xmm5                            ; +0x12d, 0x1800616bd\nlea     rcx, [rsp+0E8h+var_78]                                         ; +0x133, 0x1800616c3\ncall    kmMat4OrthographicProjection                                   ; +0x138, 0x1800616c8\nlea     rcx, [rsp+0E8h+var_78]                                         ; +0x13d, 0x1800616cd\ncall    kmGLMultMatrix                                                 ; +0x142, 0x1800616d2\nlea     rdx, [rdi+150h]; params                                        ; +0x147, 0x1800616d7\nmov     ecx, 8CA6h; pname                                              ; +0x14e, 0x1800616de\ncall    cs:glGetIntegerv                                               ; +0x153, 0x1800616e3\nmov     rax, cs:__glewBindFramebuffer                                  ; +0x159, 0x1800616e9\nmov     r8, [rax]                                                      ; +0x160, 0x1800616f0\nmov     edx, [rdi+148h]                                                ; +0x163, 0x1800616f3\nmov     ecx, 8D40h                                                     ; +0x169, 0x1800616f9\ncall    r8                                                             ; +0x16e, 0x1800616fe\nlea     rdx, aGlQcom; \"GL_QCOM\"                                        ; +0x171, 0x180061701\nlea     rcx, [rsp+0E8h+Block]; void *                                  ; +0x178, 0x180061708\ncall    sub_180005A10                                                  ; +0x17d, 0x18006170d\nnop                                                                    ; +0x182, 0x180061712\ncall    ?sharedConfiguration@CCConfiguration@cocos2d@@SAPEAV12@XZ; cocos2d::CCConfiguration::sharedConfiguration(void) ; +0x183, 0x180061713\nmov     rcx, rax                                                       ; +0x188, 0x180061718\nlea     rdx, [rsp+0E8h+Block]                                          ; +0x18b, 0x18006171b\ncall    ?checkForGLExtension@CCConfiguration@cocos2d@@QEBA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCConfiguration::checkForGLExtension(std::string const &) ; +0x190, 0x180061720\nmovzx   ebx, al                                                        ; +0x195, 0x180061725\nmov     rdx, [rsp+0E8h+var_80]                                         ; +0x198, 0x180061728\ncmp     rdx, 0Fh                                                       ; +0x19d, 0x18006172d\njbe     short loc_18006177E                                            ; +0x1a1, 0x180061731\ninc     rdx                                                            ; +0x1a3, 0x180061733\nmov     r8, [rsp+0E8h+Block]                                           ; +0x1a6, 0x180061736\nmov     rcx, r8                                                        ; +0x1ab, 0x18006173b\ncmp     rdx, 1000h                                                     ; +0x1ae, 0x18006173e\njb      short loc_180061776                                            ; +0x1b5, 0x180061745\nadd     rdx, 27h ; '''                                                 ; +0x1b7, 0x180061747\nmov     r8, [r8-8]                                                     ; +0x1bb, 0x18006174b\nsub     rcx, r8                                                        ; +0x1bf, 0x18006174f\nsub     rcx, 8                                                         ; +0x1c2, 0x180061752\ncmp     rcx, 1Fh                                                       ; +0x1c6, 0x180061756\njbe     short loc_180061776                                            ; +0x1ca, 0x18006175a\nmov     [rsp+0E8h+Reserved], 0; Reserved                               ; +0x1cc, 0x18006175c\nxor     r9d, r9d; LineNo                                               ; +0x1d5, 0x180061765\nxor     r8d, r8d; FileName                                             ; +0x1d8, 0x180061768\nxor     edx, edx; FunctionName                                         ; +0x1db, 0x18006176b\nxor     ecx, ecx; Expression                                           ; +0x1dd, 0x18006176d\ncall    cs:_invoke_watson                                              ; +0x1df, 0x18006176f\nalign 2                                                                ; +0x1e5, 0x180061775\nmov     rcx, r8; Block                                                 ; +0x1e6, 0x180061776\ncall    j_j_free_0                                                     ; +0x1e9, 0x180061779\ntest    bl, bl                                                         ; +0x1ee, 0x18006177e\njz      short loc_1800617F5                                            ; +0x1f0, 0x180061780\nmov     rcx, [rdi+160h]                                                ; +0x1f2, 0x180061782\nmov     rax, cs:__glewFramebufferTexture2D                             ; +0x1f9, 0x180061789\nmov     rbx, [rax]                                                     ; +0x200, 0x180061790\nmov     rax, [rcx]                                                     ; +0x203, 0x180061793\ncall    qword ptr [rax+60h]                                            ; +0x206, 0x180061796\nmov     r9d, eax                                                       ; +0x209, 0x180061799\nmov     dword ptr [rsp+0E8h+Reserved], 0                               ; +0x20c, 0x18006179c\nmov     edx, 8CE0h                                                     ; +0x214, 0x1800617a4\nmov     ecx, 8D40h                                                     ; +0x219, 0x1800617a9\nmov     r8d, 0DE1h                                                     ; +0x21e, 0x1800617ae\ncall    rbx                                                            ; +0x224, 0x1800617b4\nmov     ecx, 4100h; mask                                               ; +0x226, 0x1800617b6\ncall    cs:glClear                                                     ; +0x22b, 0x1800617bb\nmov     rcx, [rdi+158h]                                                ; +0x231, 0x1800617c1\nmov     rax, cs:__glewFramebufferTexture2D                             ; +0x238, 0x1800617c8\nmov     rbx, [rax]                                                     ; +0x23f, 0x1800617cf\nmov     rax, [rcx]                                                     ; +0x242, 0x1800617d2\ncall    qword ptr [rax+60h]                                            ; +0x245, 0x1800617d5\nmov     r9d, eax                                                       ; +0x248, 0x1800617d8\nmov     dword ptr [rsp+0E8h+Reserved], 0                               ; +0x24b, 0x1800617db\nmov     edx, 8CE0h                                                     ; +0x253, 0x1800617e3\nmov     ecx, 8D40h                                                     ; +0x258, 0x1800617e8\nmov     r8d, 0DE1h                                                     ; +0x25d, 0x1800617ed\ncall    rbx                                                            ; +0x263, 0x1800617f3\nmov     rcx, [rsp+0E8h+var_38]                                         ; +0x265, 0x1800617f5\nxor     rcx, rsp; StackCookie                                          ; +0x26d, 0x1800617fd\ncall    __security_check_cookie                                        ; +0x270, 0x180061800\nlea     r11, [rsp+0E8h+var_8]                                          ; +0x275, 0x180061805\nmov     rbx, [r11+18h]                                                 ; +0x27d, 0x18006180d\nmovaps  xmm6, xmmword ptr [r11-10h]                                    ; +0x281, 0x180061811\nmovaps  xmm7, xmmword ptr [r11-20h]                                    ; +0x286, 0x180061816\nmov     rsp, r11                                                       ; +0x28b, 0x18006181b\npop     rdi                                                            ; +0x28e, 0x18006181e\nretn                                                                   ; +0x28f, 0x18006181f", "xrefs": ["cocos2d::CCTransitionCrossFade::onEnter @ 0x180056a36", "cocos2d::CCTransitionCrossFade::onEnter @ 0x180056af0", "cocos2d::CCTransitionProgress::onEnter @ 0x180059576", "cocos2d::CCRenderTexture::beginWithClear @ 0x180061852", "cocos2d::CCRenderTexture::clearDepth @ 0x180061ad5", "cocos2d::CCRenderTexture::draw @ 0x180061d9a", "cocos2d::CCRenderTexture::newCCImage @ 0x180062593", "<???> @ 0x18014cf68", "<???> @ 0x1801bd648"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}