{"type": "func", "start": 4299675720, "end": 4299676092, "name": "-[CCES2Renderer initWithDepthFormat:withPixelFormat:withSharegroup:withMultiSampling:withNumberOfSamples:]", "pseudocode": "// \n// -[CCES2Renderer initWithDepthFormat:withPixelFormat:withSharegroup:withMultiSampling:withNumberOfSamples:] from 0x10047d848 to 0x10047d9bc (372 bytes)\n// \n// 1 xrefs:\n// > <???> @ 0x1009d07b0\n// \n// This function is hookable on this platform (idp: arm, 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:05:44 +0000\n// \n\nCCES2Renderer *__cdecl -[CCES2Renderer initWithDepthFormat:withPixelFormat:withSharegroup:withMultiSampling:withNumberOfSamples:](\n        CCES2Renderer *self,\n        SEL a2,\n        unsigned int a3,\n        unsigned int a4,\n        id a5,\n        bool a6,\n        unsigned int a7)\n{\n  CCES2Renderer *v12; // x19\n  id v13; // x0\n  EAGLContext *v14; // x0\n  unsigned int v15; // w8\n  GLenum Error; // w0\n  GLint params; // [xsp+1Ch] [xbp-54h] BYREF\n  objc_super v19; // [xsp+20h] [xbp-50h] BYREF\n\n  v19.receiver = self;\n  v19.super_class = (Class)&OBJC_CLASS___CCES2Renderer;\n  v12 = -[CCES2Renderer init](&v19, \"init\");\n  if ( v12 )\n  {\n    v13 = objc_alloc((Class)&OBJC_CLASS___EAGLContext);\n    if ( a5 )\n      v14 = (EAGLContext *)objc_msgSend(v13, \"initWithAPI:sharegroup:\", 2, a5);\n    else\n      v14 = (EAGLContext *)objc_msgSend(v13, \"initWithAPI:\", 2);\n    v12->context_ = v14;\n    if ( v14 && +[EAGLContext setCurrentContext:](&OBJC_CLASS___EAGLContext, \"setCurrentContext:\", v14) )\n    {\n      v12->depthFormat_ = a3;\n      v12->pixelFormat_ = a4;\n      v12->multiSampling_ = a6;\n      glGenFramebuffers(1, &v12->defaultFramebuffer_);\n      glGenRenderbuffers(1, &v12->colorRenderbuffer_);\n      glBindFramebuffer(0x8D40u, v12->defaultFramebuffer_);\n      glBindRenderbuffer(0x8D41u, v12->colorRenderbuffer_);\n      glFramebufferRenderbuffer(0x8D40u, 0x8CE0u, 0x8D41u, v12->colorRenderbuffer_);\n      if ( v12->multiSampling_ )\n      {\n        glGetIntegerv(0x8D57u, &params);\n        v15 = params;\n        if ( params >= a7 )\n          v15 = a7;\n        v12->samplesToUse_ = v15;\n        glGenFramebuffers(1, &v12->msaaFramebuffer_);\n        glBindFramebuffer(0x8D40u, v12->msaaFramebuffer_);\n      }\n      Error = glGetError();\n      if ( Error )\n        printf(\n          \"OpenGL error 0x%04X in %s %d\\n\",\n          Error,\n          \"-[CCES2Renderer initWithDepthFormat:withPixelFormat:withSharegroup:withMultiSampling:withNumberOfSamples:]\",\n          90);\n    }\n    else\n    {\n      objc_release(v12);\n      return nullptr;\n    }\n  }\n  return v12;\n}", "assembly": "; \n; -[CCES2Renderer initWithDepthFormat:withPixelFormat:withSharegroup:withMultiSampling:withNumberOfSamples:] from 0x10047d848 to 0x10047d9bc (372 bytes)\n; \n; 1 xrefs:\n; > <???> @ 0x1009d07b0\n; \n; This function is hookable on this platform (idp: arm, 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:05:44 +0000\n; \nSUB             SP, SP, #0x80                                          ; +0x0, 0x10047d848\nSTP             X26, X25, [SP,#0x70+var_40]                            ; +0x4, 0x10047d84c\nSTP             X24, X23, [SP,#0x70+var_30]                            ; +0x8, 0x10047d850\nSTP             X22, X21, [SP,#0x70+var_20]                            ; +0xc, 0x10047d854\nSTP             X20, X19, [SP,#0x70+var_10]                            ; +0x10, 0x10047d858\nSTP             X29, X30, [SP,#0x70+var_s0]                            ; +0x14, 0x10047d85c\nADD             X29, SP, #0x70                                         ; +0x18, 0x10047d860\nMOV             X20, X6                                                ; +0x1c, 0x10047d864\nMOV             X21, X5                                                ; +0x20, 0x10047d868\nMOV             X24, X4                                                ; +0x24, 0x10047d86c\nMOV             X22, X3                                                ; +0x28, 0x10047d870\nMOV             X23, X2                                                ; +0x2c, 0x10047d874\nADRP            X8, #classRef_CCES2Renderer_0@PAGE                     ; +0x30, 0x10047d878\nLDR             X8, [X8,#classRef_CCES2Renderer_0@PAGEOFF]; _OBJC_CLASS_$_CCES2Renderer ; +0x34, 0x10047d87c\nSTP             X0, X8, [SP,#0x70+var_50]                              ; +0x38, 0x10047d880\nADRP            X8, #selRef_init@PAGE                                  ; +0x3c, 0x10047d884\nLDR             X1, [X8,#selRef_init@PAGEOFF]; \"init\" ...              ; +0x40, 0x10047d888\nADD             X0, SP, #0x70+var_50; objc_super *                     ; +0x44, 0x10047d88c\nBL              _objc_msgSendSuper2; -[CCES2Renderer init] ...         ; +0x48, 0x10047d890\nMOV             X19, X0                                                ; +0x4c, 0x10047d894\nCBZ             X0, loc_10047D99C                                      ; +0x50, 0x10047d898\nADRP            X25, #classRef_EAGLContext@PAGE                        ; +0x54, 0x10047d89c\nLDR             X0, [X25,#classRef_EAGLContext@PAGEOFF]; _OBJC_CLASS_$_EAGLContext ; Class ; +0x58, 0x10047d8a0\nBL              _objc_alloc                                            ; +0x5c, 0x10047d8a4\nMOV             W2, #2                                                 ; +0x60, 0x10047d8a8\nCBZ             X24, loc_10047D8BC                                     ; +0x64, 0x10047d8ac\nMOV             X3, X24                                                ; +0x68, 0x10047d8b0\nBL              _objc_msgSend$initWithAPI_sharegroup_                  ; +0x6c, 0x10047d8b4\nB               loc_10047D8C0                                          ; +0x70, 0x10047d8b8\nBL              _objc_msgSend$initWithAPI_                             ; +0x74, 0x10047d8bc\nMOV             X2, X0                                                 ; +0x78, 0x10047d8c0\nSTR             X0, [X19,#0x38]                                        ; +0x7c, 0x10047d8c4\nCBZ             X0, loc_10047D990                                      ; +0x80, 0x10047d8c8\nLDR             X0, [X25,#classRef_EAGLContext@PAGEOFF]; _OBJC_CLASS_$_EAGLContext ; +0x84, 0x10047d8cc\nBL              _objc_msgSend$setCurrentContext_; +[EAGLContext setCurrentContext:] ... ; +0x88, 0x10047d8d0\nTBZ             W0, #0, loc_10047D990                                  ; +0x8c, 0x10047d8d4\nSTP             W23, W22, [X19,#0x18]                                  ; +0x90, 0x10047d8d8\nSTRB            W21, [X19,#0x14]                                       ; +0x94, 0x10047d8dc\nADD             X1, X19, #0x20 ; ' '; framebuffers                     ; +0x98, 0x10047d8e0\nMOV             W0, #1; n                                              ; +0x9c, 0x10047d8e4\nBL              _glGenFramebuffers                                     ; +0xa0, 0x10047d8e8\nADD             X1, X19, #0x24 ; '$'; renderbuffers                    ; +0xa4, 0x10047d8ec\nMOV             W0, #1; n                                              ; +0xa8, 0x10047d8f0\nBL              _glGenRenderbuffers                                    ; +0xac, 0x10047d8f4\nLDR             W1, [X19,#0x20]; framebuffer                           ; +0xb0, 0x10047d8f8\nMOV             W0, #0x8D40; target                                    ; +0xb4, 0x10047d8fc\nBL              _glBindFramebuffer                                     ; +0xb8, 0x10047d900\nLDR             W1, [X19,#0x24]; renderbuffer                          ; +0xbc, 0x10047d904\nMOV             W0, #0x8D41; target                                    ; +0xc0, 0x10047d908\nBL              _glBindRenderbuffer                                    ; +0xc4, 0x10047d90c\nLDR             W3, [X19,#0x24]; renderbuffer                          ; +0xc8, 0x10047d910\nMOV             W0, #0x8D40; target                                    ; +0xcc, 0x10047d914\nMOV             W1, #0x8CE0; attachment                                ; +0xd0, 0x10047d918\nMOV             W2, #0x8D41; renderbuffertarget                        ; +0xd4, 0x10047d91c\nBL              _glFramebufferRenderbuffer                             ; +0xd8, 0x10047d920\nLDRB            W8, [X19,#0x14]                                        ; +0xdc, 0x10047d924\nCMP             W8, #1                                                 ; +0xe0, 0x10047d928\nB.NE            loc_10047D964                                          ; +0xe4, 0x10047d92c\nADD             X1, SP, #0x70+params; params                           ; +0xe8, 0x10047d930\nMOV             W0, #0x8D57; pname                                     ; +0xec, 0x10047d934\nBL              _glGetIntegerv                                         ; +0xf0, 0x10047d938\nLDR             W8, [SP,#0x70+params]                                  ; +0xf4, 0x10047d93c\nCMP             W8, W20                                                ; +0xf8, 0x10047d940\nCSEL            W8, W8, W20, CC                                        ; +0xfc, 0x10047d944\nSTR             W8, [X19,#0x10]                                        ; +0x100, 0x10047d948\nADD             X1, X19, #0x2C ; ','; framebuffers                     ; +0x104, 0x10047d94c\nMOV             W0, #1; n                                              ; +0x108, 0x10047d950\nBL              _glGenFramebuffers                                     ; +0x10c, 0x10047d954\nLDR             W1, [X19,#0x2C]; framebuffer                           ; +0x110, 0x10047d958\nMOV             W0, #0x8D40; target                                    ; +0x114, 0x10047d95c\nBL              _glBindFramebuffer                                     ; +0x118, 0x10047d960\nBL              _glGetError                                            ; +0x11c, 0x10047d964\nCBZ             W0, loc_10047D99C                                      ; +0x120, 0x10047d968\nMOV             W8, #0x5A ; 'Z'                                        ; +0x124, 0x10047d96c\nADRL            X9, aCces2rendererI; \"-[CCES2Renderer initWithDepthFormat:wit\"... ; +0x128, 0x10047d970\nSTP             X9, X8, [SP,#0x70+var_68]                              ; +0x130, 0x10047d978\nSTR             X0, [SP,#0x70+var_70]                                  ; +0x134, 0x10047d97c\nADRL            X0, aOpenglError0x0; \"OpenGL error 0x%04X in %s %d\\n\"  ; +0x138, 0x10047d980\nBL              _printf                                                ; +0x140, 0x10047d988\nB               loc_10047D99C                                          ; +0x144, 0x10047d98c\nMOV             X0, X19; id                                            ; +0x148, 0x10047d990\nBL              _objc_release                                          ; +0x14c, 0x10047d994\nMOV             X19, #0                                                ; +0x150, 0x10047d998\nMOV             X0, X19                                                ; +0x154, 0x10047d99c\nLDP             X29, X30, [SP,#0x70+var_s0]                            ; +0x158, 0x10047d9a0\nLDP             X20, X19, [SP,#0x70+var_10]                            ; +0x15c, 0x10047d9a4\nLDP             X22, X21, [SP,#0x70+var_20]                            ; +0x160, 0x10047d9a8\nLDP             X24, X23, [SP,#0x70+var_30]                            ; +0x164, 0x10047d9ac\nLDP             X26, X25, [SP,#0x70+var_40]                            ; +0x168, 0x10047d9b0\nADD             SP, SP, #0x80                                          ; +0x16c, 0x10047d9b4\nRET                                                                    ; +0x170, 0x10047d9b8", "xrefs": ["<???> @ 0x1009d07b0"], "is_objc": true, "is_32_bit": false, "is_64_bit": true, "idp_name": "arm", "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"}