{"type": "func", "start": 4723796, "end": 4724160, "name": "EditorUI::getSpriteButton", "pseudocode": "// \n// EditorUI::getSpriteButton from 0x481454 to 0x4815c0 (364 bytes)\n// \n// 5 xrefs:\n// > EditorUI::getSpriteButton @ 0x48162c\n// > EditorUI::setupDeleteMenu @ 0x6f59ae\n// > EditorUI::setupDeleteMenu @ 0x6f5a92\n// > EditorUI::setupDeleteMenu @ 0x6f5cda\n// > EditorUI::createDpadMoveMenu @ 0x6f723a\n// \n// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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:49:22 +0000\n// \n\n_DWORD *__fastcall EditorUI::getSpriteButton(\n        int a1,\n        ButtonSprite *this,\n        int a3,\n        int a4,\n        int a5,\n        int a6,\n        int a7,\n        const cocos2d::CCPoint *a8,\n        float a9)\n{\n  char *v11; // r4\n  const cocos2d::CCSize *v12; // r0\n  float v13; // s14\n  float v14; // s15\n  bool v15; // fnf\n  ButtonSprite *v17; // r0\n  ButtonSprite *v18; // r6\n  _DWORD *v19; // r4\n  float v21; // [sp+14h] [bp-20h]\n  float v24; // [sp+24h] [bp-10h] BYREF\n  float v25; // [sp+28h] [bp-Ch]\n\n  switch ( a7 )\n  {\n    case 2:\n      v11 = \"GJ_button_02.png\";\n      break;\n    case 3:\n      v11 = \"GJ_button_03.png\";\n      break;\n    case 4:\n      v11 = \"GJ_button_04.png\";\n      break;\n    case 5:\n      v11 = \"GJ_button_05.png\";\n      break;\n    case 6:\n      v11 = \"GJ_button_06.png\";\n      break;\n    default:\n      v11 = \"GJ_button_01.png\";\n      break;\n  }\n  if ( a9 <= 0.0 )\n  {\n    v17 = ButtonSprite::create(\n            this,\n            (cocos2d::CCSprite *)&dword_20,\n            0,\n            32.0,\n            1.0,\n            (_BOOL4)&dword_0 + 1,\n            v11,\n            (const char *)&dword_0 + 1,\n            0.0,\n            v21);\n  }\n  else\n  {\n    v12 = (const cocos2d::CCSize *)(*(int (__fastcall **)(ButtonSprite *))(*(_DWORD *)this + 164))(this);\n    cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v24, v12);\n    v13 = 32.0 / v24;\n    v14 = 32.0 / v25;\n    if ( (float)(32.0 / v24) <= (float)(32.0 / v25) )\n      v15 = v13 < 1.0;\n    else\n      v15 = v14 < 1.0;\n    if ( v15 )\n    {\n      if ( v13 <= v14 )\n        v14 = 32.0 / v24;\n    }\n    else\n    {\n      v14 = 1.0;\n    }\n    v17 = ButtonSprite::create(\n            this,\n            (cocos2d::CCSprite *)(int)(float)(a9 - 8.0),\n            0,\n            32.0,\n            v14,\n            1,\n            v11,\n            nullptr,\n            0.0,\n            v21);\n  }\n  v18 = v17;\n  v19 = (_DWORD *)CCMenuItemSpriteExtra::create((int)v17, 0, a1, a3, a4);\n  (*(void (__fastcall **)(_DWORD *, int))(*v19 + 80))(v19, a6);\n  v19[79] = a6;\n  if ( a5 )\n    (*(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)a5 + 228))(a5, v19);\n  cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v24, a8);\n  ButtonSprite::updateSpriteOffset(v18, (int)&v24);\n  return v19;\n}", "assembly": "; \n; EditorUI::getSpriteButton from 0x481454 to 0x4815c0 (364 bytes)\n; \n; 5 xrefs:\n; > EditorUI::getSpriteButton @ 0x48162c\n; > EditorUI::setupDeleteMenu @ 0x6f59ae\n; > EditorUI::setupDeleteMenu @ 0x6f5a92\n; > EditorUI::setupDeleteMenu @ 0x6f5cda\n; > EditorUI::createDpadMoveMenu @ 0x6f723a\n; \n; This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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:49:22 +0000\n; \nPUSH.W          {R4-R11,LR}                                            ; +0x0, 0x481454\nMOV             R6, R1                                                 ; +0x4, 0x481458\nVPUSH           {D8-D9}                                                ; +0x6, 0x48145a\nMOV             R11, R0                                                ; +0xa, 0x48145e\nLDR             R5, =(__stack_chk_guard_ptr - 0x481466)                ; +0xc, 0x481460\nADD             R5, PC; __stack_chk_guard_ptr                          ; +0xe, 0x481462\nLDR             R5, [R5]; __stack_chk_guard                            ; +0x10, 0x481464\nSUB             SP, SP, #0x34; float                                   ; +0x12, 0x481466\nADD             R1, SP, #0x34+var_1C                                   ; +0x14, 0x481468\nLDR             R4, [SP,#0x34+arg_8]                                   ; +0x16, 0x48146a\nSTM.W           R1, {R2,R3}                                            ; +0x18, 0x48146c\nLDR             R3, [R5]                                               ; +0x1c, 0x481470\nSUBS            R4, #2; switch 5 cases                                 ; +0x1e, 0x481472\nLDR.W           R8, [SP,#0x34+arg_0]                                   ; +0x20, 0x481474\nLDR.W           R9, [SP,#0x34+arg_4]                                   ; +0x24, 0x481478\nLDR.W           R10, [SP,#0x34+arg_C]                                  ; +0x28, 0x48147c\nVLDR            S16, [SP,#0x34+arg_10]                                 ; +0x2c, 0x481480\nSTR             R3, [SP,#0x34+var_8]                                   ; +0x30, 0x481484\nCMP             R4, #4                                                 ; +0x32, 0x481486\nBHI             def_48148A; jumptable 0048148A default case            ; +0x34, 0x481488\nTBB.W           [PC,R4]; switch jump                                   ; +0x36, 0x48148a\nDCB 0x12; jump table for switch statement                              ; +0x3a, 0x48148e\nDCB 3                                                                  ; +0x3b, 0x48148f\nDCB 6                                                                  ; +0x3c, 0x481490\nDCB 9                                                                  ; +0x3d, 0x481491\nDCB 0xC                                                                ; +0x3e, 0x481492\nALIGN 2                                                                ; +0x3f, 0x481493\nLDR             R4, =(aGjButton03Png - 0x48149A); jumptable 0048148A case 3 ; +0x40, 0x481494\nADD             R4, PC; \"GJ_button_03.png\"                             ; +0x42, 0x481496\nB               loc_4814B6                                             ; +0x44, 0x481498\nLDR             R4, =(aGjButton04Png - 0x4814A0); jumptable 0048148A case 4 ; +0x46, 0x48149a\nADD             R4, PC; \"GJ_button_04.png\"                             ; +0x48, 0x48149c\nB               loc_4814B6                                             ; +0x4a, 0x48149e\nLDR             R4, =(aGjButton05Png - 0x4814A6); jumptable 0048148A case 5 ; +0x4c, 0x4814a0\nADD             R4, PC; \"GJ_button_05.png\"                             ; +0x4e, 0x4814a2\nB               loc_4814B6                                             ; +0x50, 0x4814a4\nLDR             R4, =(aGjButton06Png - 0x4814AC); jumptable 0048148A case 6 ; +0x52, 0x4814a6\nADD             R4, PC; \"GJ_button_06.png\"                             ; +0x54, 0x4814a8\nB               loc_4814B6                                             ; +0x56, 0x4814aa\nLDR             R4, =(aGjButton01Png - 0x4814B2); jumptable 0048148A default case ; +0x58, 0x4814ac\nADD             R4, PC; \"GJ_button_01.png\"                             ; +0x5a, 0x4814ae\nB               loc_4814B6                                             ; +0x5c, 0x4814b0\nLDR             R4, =(aGjButton02Png - 0x4814B8); jumptable 0048148A case 2 ; +0x5e, 0x4814b2\nADD             R4, PC; \"GJ_button_02.png\"                             ; +0x60, 0x4814b4\nVCMPE.F32       S16, #0.0                                              ; +0x62, 0x4814b6\nMOVS            R3, #0                                                 ; +0x66, 0x4814ba\nVMOV            S18, R3                                                ; +0x68, 0x4814bc\nADD             R7, SP, #0x34+var_10                                   ; +0x6c, 0x4814c0\nVMRS            APSR_nzcv, FPSCR                                       ; +0x6e, 0x4814c2\nVMOV.F32        S17, #1.0                                              ; +0x72, 0x4814c6\nBLE             loc_48154A                                             ; +0x76, 0x4814ca\nLDR             R3, [R6]                                               ; +0x78, 0x4814cc\nMOV             R0, R6                                                 ; +0x7a, 0x4814ce\nLDR.W           R3, [R3,#0xA4]                                         ; +0x7c, 0x4814d0\nBLX             R3                                                     ; +0x80, 0x4814d4\nMOV             R1, R0; cocos2d::CCSize *                              ; +0x82, 0x4814d6\nMOV             R0, R7; this                                           ; +0x84, 0x4814d8\nBL              _ZN7cocos2d6CCSizeC1ERKS0_; cocos2d::CCSize::CCSize(cocos2d::CCSize const&) ; +0x86, 0x4814da\nVLDR            S15, =32.0                                             ; +0x8a, 0x4814de\nVLDR            S14, [SP,#0x34+var_10]                                 ; +0x8e, 0x4814e2\nVLDR            S13, [SP,#0x34+var_C]                                  ; +0x92, 0x4814e6\nVDIV.F32        S14, S15, S14                                          ; +0x96, 0x4814ea\nVDIV.F32        S15, S15, S13                                          ; +0x9a, 0x4814ee\nVCMPE.F32       S14, S15                                               ; +0x9e, 0x4814f2\nVMRS            APSR_nzcv, FPSCR                                       ; +0xa2, 0x4814f6\nITE GT                                                                 ; +0xa6, 0x4814fa\nVCMPEGT.F32     S15, S17                                               ; +0xa8, 0x4814fc\nVCMPELE.F32     S14, S17                                               ; +0xac, 0x481500\nVMRS            APSR_nzcv, FPSCR                                       ; +0xb0, 0x481504\nITE MI                                                                 ; +0xb4, 0x481508\nMOVMI           R3, #1                                                 ; +0xb6, 0x48150a\nMOVPL           R3, #0                                                 ; +0xb8, 0x48150c\nCBZ             R3, loc_481520                                         ; +0xba, 0x48150e\nVCMPE.F32       S14, S15                                               ; +0xbc, 0x481510\nVMRS            APSR_nzcv, FPSCR                                       ; +0xc0, 0x481514\nIT LE                                                                  ; +0xc4, 0x481518\nVMOVLE.F32      S15, S14                                               ; +0xc6, 0x48151a\nB               loc_481524                                             ; +0xca, 0x48151e\nVMOV.F32        S15, #1.0                                              ; +0xcc, 0x481520\nVSTR            S15, [SP,#0x34+var_34]                                 ; +0xd0, 0x481524\nMOVS            R3, #1                                                 ; +0xd4, 0x481528\nMOVS            R2, #0                                                 ; +0xd6, 0x48152a\nSTR             R3, [SP,#0x34+var_30]                                  ; +0xd8, 0x48152c\nSTR             R4, [SP,#0x34+var_2C]                                  ; +0xda, 0x48152e\nMOV             R0, R6                                                 ; +0xdc, 0x481530\nSTR             R2, [SP,#0x34+var_28]                                  ; +0xde, 0x481532\nVSTR            S18, [SP,#0x34+var_24]                                 ; +0xe0, 0x481534\nVMOV.F32        S14, #8.0                                              ; +0xe4, 0x481538\nVSUB.F32        S16, S16, S14                                          ; +0xe8, 0x48153c\nVCVT.S32.F32    S15, S16                                               ; +0xec, 0x481540\nVMOV            R1, S15                                                ; +0xf0, 0x481544\nB               loc_48155E                                             ; +0xf4, 0x481548\nVSTR            S17, [SP,#0x34+var_34]                                 ; +0xf6, 0x48154a\nMOVS            R2, #(dword_0+1)                                       ; +0xfa, 0x48154e\nMOV             R0, R6; this                                           ; +0xfc, 0x481550\nSTR             R2, [SP,#0x34+var_30]; float                           ; +0xfe, 0x481552\nSTR             R2, [SP,#0x34+var_28]; char *                          ; +0x100, 0x481554\nMOVS            R1, #dword_20; cocos2d::CCSprite *                     ; +0x102, 0x481556\nMOVS            R2, #0; int                                            ; +0x104, 0x481558\nSTR             R4, [SP,#0x34+var_2C]; char *                          ; +0x106, 0x48155a\nSTR             R3, [SP,#0x34+var_24]; float                           ; +0x108, 0x48155c\nMOV.W           R3, #0x42000000; int                                   ; +0x10a, 0x48155e\nBL              _ZN12ButtonSprite6createEPN7cocos2d8CCSpriteEiiffbPKcbf; ButtonSprite::create(cocos2d::CCSprite *,int,int,float,float,bool,char const*,bool,float) ; +0x10e, 0x481562\nLDR             R3, [SP,#0x34+var_18]                                  ; +0x112, 0x481566\nMOVS            R1, #0                                                 ; +0x114, 0x481568\nMOV             R2, R11                                                ; +0x116, 0x48156a\nSTR             R3, [SP,#0x34+var_34]                                  ; +0x118, 0x48156c\nLDR             R3, [SP,#0x34+var_1C]                                  ; +0x11a, 0x48156e\nMOV             R6, R0                                                 ; +0x11c, 0x481570\nBL              _ZN21CCMenuItemSpriteExtra6createEPN7cocos2d6CCNodeES2_PNS0_8CCObjectEMS3_FvS4_E; CCMenuItemSpriteExtra::create(cocos2d::CCNode *,cocos2d::CCNode *,cocos2d::CCObject *,void (cocos2d::CCObject::*)(cocos2d::CCObject *)) ; +0x11e, 0x481572\nMOV             R1, R9                                                 ; +0x122, 0x481576\nLDR             R3, [R0]                                               ; +0x124, 0x481578\nMOV             R4, R0                                                 ; +0x126, 0x48157a\nLDR             R3, [R3,#0x50]                                         ; +0x128, 0x48157c\nBLX             R3                                                     ; +0x12a, 0x48157e\nSTR.W           R9, [R4,#0x13C]                                        ; +0x12c, 0x481580\nCMP.W           R8, #0                                                 ; +0x130, 0x481584\nBEQ             loc_481598                                             ; +0x134, 0x481588\nLDR.W           R3, [R8]                                               ; +0x136, 0x48158a\nMOV             R0, R8                                                 ; +0x13a, 0x48158e\nMOV             R1, R4                                                 ; +0x13c, 0x481590\nLDR.W           R3, [R3,#0xE4]                                         ; +0x13e, 0x481592\nBLX             R3                                                     ; +0x142, 0x481596\nMOV             R1, R10; cocos2d::CCPoint *                            ; +0x144, 0x481598\nMOV             R0, R7; this                                           ; +0x146, 0x48159a\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x148, 0x48159c\nMOV             R0, R6                                                 ; +0x14c, 0x4815a0\nMOV             R1, R7                                                 ; +0x14e, 0x4815a2\nBL              _ZN12ButtonSprite18updateSpriteOffsetEN7cocos2d7CCPointE; ButtonSprite::updateSpriteOffset(cocos2d::CCPoint) ; +0x150, 0x4815a4\nLDR             R2, [SP,#0x34+var_8]                                   ; +0x154, 0x4815a8\nLDR             R3, [R5]                                               ; +0x156, 0x4815aa\nMOV             R0, R4                                                 ; +0x158, 0x4815ac\nCMP             R2, R3                                                 ; +0x15a, 0x4815ae\nBEQ             loc_4815B6                                             ; +0x15c, 0x4815b0\nBLX             __stack_chk_fail                                       ; +0x15e, 0x4815b2\nADD             SP, SP, #0x34 ; '4'                                    ; +0x162, 0x4815b6\nVPOP            {D8-D9}                                                ; +0x164, 0x4815b8\nPOP.W           {R4-R11,PC}                                            ; +0x168, 0x4815bc", "xrefs": ["EditorUI::getSpriteButton @ 0x48162c", "EditorUI::setupDeleteMenu @ 0x6f59ae", "EditorUI::setupDeleteMenu @ 0x6f5a92", "EditorUI::setupDeleteMenu @ 0x6f5cda", "EditorUI::createDpadMoveMenu @ 0x6f723a"], "is_objc": false, "is_32_bit": true, "is_64_bit": false, "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"}