{"type": "func", "start": 4777580, "end": 4778108, "name": "GJBaseGameLayer::activateItemEditTrigger", "pseudocode": "// \n// GJBaseGameLayer::activateItemEditTrigger from 0x48e66c to 0x48e87c (528 bytes)\n// \n// 1 xrefs:\n// > ItemTriggerGameObject::triggerObject @ 0x3eea76\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 GJBaseGameLayer::activateItemEditTrigger(GJBaseGameLayer *a1, ItemTriggerGameObject *a2)\n{\n  int m_targetItemMode; // r10\n  int m_itemID; // r8\n  int m_itemID2; // r6\n  int m_item1Mode; // r9\n  int m_resultType2; // r3\n  int m_item2Mode; // r7\n  int m_targetGroupID; // r11\n  float *p_m_mod1; // r1\n  int v11; // r3\n  float v12; // s16\n  _BOOL4 v13; // r5\n  int v14; // r3\n  double ItemValue; // r8\n  double v16; // r6\n  double v17; // d7\n  int v18; // [sp+10h] [bp-2Ch]\n  int v19; // [sp+14h] [bp-28h]\n  int m_resultType1; // [sp+18h] [bp-24h]\n  int v21; // [sp+1Ch] [bp-20h]\n  int v22; // [sp+20h] [bp-1Ch]\n  int v23; // [sp+24h] [bp-18h]\n  double v24; // [sp+28h] [bp-14h]\n  int v25; // [sp+30h] [bp-Ch]\n  int v26; // [sp+34h] [bp-8h]\n\n  m_targetItemMode = a2->m_targetItemMode;\n  m_itemID = a2->m_itemID;\n  m_itemID2 = a2->m_itemID2;\n  m_item1Mode = a2->m_item1Mode;\n  m_resultType1 = a2->m_resultType1;\n  m_resultType2 = a2->m_resultType2;\n  m_item2Mode = a2->m_item2Mode;\n  m_targetGroupID = a2->m_targetGroupID;\n  p_m_mod1 = &a2->m_mod1;\n  if ( m_resultType2 < 1 )\n    m_resultType2 = 1;\n  v18 = m_resultType2;\n  v11 = *((_DWORD *)p_m_mod1 + 4);\n  if ( v11 < 3 )\n    v11 = 3;\n  v19 = v11;\n  v21 = *((_DWORD *)p_m_mod1 + 6);\n  v22 = *((_DWORD *)p_m_mod1 + 7);\n  v23 = *((_DWORD *)p_m_mod1 + 8);\n  v25 = *((_DWORD *)p_m_mod1 + 9);\n  v12 = COERCE_FLOAT(roundf()) / 1000.0;\n  if ( m_targetItemMode <= 0 )\n  {\n    if ( m_targetGroupID <= 0 )\n      return;\n    m_targetItemMode = 1;\n  }\n  else if ( m_targetGroupID <= 0 && m_targetItemMode != 3 )\n  {\n    return;\n  }\n  if ( m_item1Mode )\n    v13 = m_itemID > 0 || (unsigned int)(m_item1Mode - 3) <= 1;\n  else\n    v13 = 0;\n  if ( m_item2Mode && (m_itemID2 > 0 || (unsigned int)(m_item2Mode - 3) <= 1) )\n  {\n    if ( v13 )\n    {\n      v14 = 1;\n    }\n    else\n    {\n      v14 = 0;\n      m_item1Mode = m_item2Mode;\n      m_itemID = m_itemID2;\n      v13 = 1;\n    }\n  }\n  else\n  {\n    v14 = 0;\n  }\n  v26 = v14;\n  ItemValue = GJBaseGameLayer::getItemValue(a1, m_item1Mode, m_itemID);\n  v24 = GJBaseGameLayer::getItemValue(a1, m_item2Mode, m_itemID2);\n  v16 = GJBaseGameLayer::getItemValue(a1, m_targetItemMode, m_targetGroupID);\n  if ( v26 )\n    ItemValue = GJBaseGameLayer::performMathOperation(a1, ItemValue, v24, v18);\n  v17 = v12;\n  if ( v13 )\n    v17 = GJBaseGameLayer::performMathOperation(a1, ItemValue, v12, v19);\n  if ( v21 )\n    v17 = GJBaseGameLayer::performMathRounding(a1, v17, v21);\n  if ( v23 )\n    v17 = COERCE_DOUBLE(performMathSign(v17, v23));\n  if ( m_resultType1 )\n    v17 = GJBaseGameLayer::performMathOperation(a1, v16, v17, m_resultType1);\n  if ( v22 )\n    v17 = GJBaseGameLayer::performMathRounding(a1, v17, v22);\n  if ( v25 )\n    v17 = COERCE_DOUBLE(performMathSign(v17, v25));\n  switch ( m_targetItemMode )\n  {\n    case 2:\n      GJEffectManager::updateTimer(a1->m_effectManager, m_targetGroupID, v17);\n      break;\n    case 3:\n      a1->m_gameState.m_unkBool32 = 1;\n      a1->m_gameState.m_points = (int)v17;\n      break;\n    case 1:\n      GJEffectManager::updateCountForItem(a1->m_effectManager, m_targetGroupID, (int)v17);\n      GJBaseGameLayer::updateCounters(a1, m_targetGroupID, (int)v17);\n      break;\n  }\n}", "assembly": "; \n; GJBaseGameLayer::activateItemEditTrigger from 0x48e66c to 0x48e87c (528 bytes)\n; \n; 1 xrefs:\n; > ItemTriggerGameObject::triggerObject @ 0x3eea76\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\nPUSH.W          {R4-R11,LR}                                            ; +0x0, 0x48e66c\nMOV             R4, R0                                                 ; +0x4, 0x48e670\nVPUSH           {D8}                                                   ; +0x6, 0x48e672\nLDR.W           R3, [R1,#0x678]                                        ; +0xa, 0x48e676\nLDR.W           R10, [R1,#0x66C]                                       ; +0xe, 0x48e67a\nLDR.W           R8, [R1,#0x5D4]                                        ; +0x12, 0x48e67e\nSUB             SP, SP, #0x3C; double                                  ; +0x16, 0x48e682\nLDR.W           R6, [R1,#0x5C8]                                        ; +0x18, 0x48e684\nLDR.W           R9, [R1,#0x664]                                        ; +0x1c, 0x48e688\nSTR             R3, [SP,#0x3C+var_24]                                  ; +0x20, 0x48e68c\nLDR.W           R3, [R1,#0x67C]                                        ; +0x22, 0x48e68e\nLDR.W           R7, [R1,#0x668]                                        ; +0x26, 0x48e692\nCMP             R3, #1                                                 ; +0x2a, 0x48e696\nLDR.W           R11, [R1,#0x4FC]                                       ; +0x2c, 0x48e698\nADD.W           R1, R1, #0x670                                         ; +0x30, 0x48e69c\nVLDR            S16, =1000.0                                           ; +0x34, 0x48e6a0\nIT LT                                                                  ; +0x38, 0x48e6a4\nMOVLT           R3, #1                                                 ; +0x3a, 0x48e6a6\nSTR             R3, [SP,#0x3C+var_2C]                                  ; +0x3c, 0x48e6a8\nLDR             R3, [R1,#0x10]                                         ; +0x3e, 0x48e6aa\nCMP             R3, #3                                                 ; +0x40, 0x48e6ac\nIT LT                                                                  ; +0x42, 0x48e6ae\nMOVLT           R3, #3                                                 ; +0x44, 0x48e6b0\nSTR             R3, [SP,#0x3C+var_28]                                  ; +0x46, 0x48e6b2\nLDR             R3, [R1,#0x18]                                         ; +0x48, 0x48e6b4\nSTR             R3, [SP,#0x3C+var_20]                                  ; +0x4a, 0x48e6b6\nLDR             R3, [R1,#0x1C]                                         ; +0x4c, 0x48e6b8\nSTR             R3, [SP,#0x3C+var_20+4]                                ; +0x4e, 0x48e6ba\nLDR             R3, [R1,#0x20]                                         ; +0x50, 0x48e6bc\nSTR             R3, [SP,#0x3C+var_18]                                  ; +0x52, 0x48e6be\nLDR             R3, [R1,#0x24]                                         ; +0x54, 0x48e6c0\nVLDR            S15, [R1]                                              ; +0x56, 0x48e6c2\nSTR             R3, [SP,#0x3C+var_C]                                   ; +0x5a, 0x48e6c6\nVMUL.F32        S15, S15, S16                                          ; +0x5c, 0x48e6c8\nVMOV            R0, S15                                                ; +0x60, 0x48e6cc\nBLX             roundf                                                 ; +0x64, 0x48e6d0\nCMP.W           R10, #0                                                ; +0x68, 0x48e6d4\nVMOV            S15, R0                                                ; +0x6c, 0x48e6d8\nVDIV.F32        S16, S15, S16                                          ; +0x70, 0x48e6dc\nBLE.W           loc_48E862                                             ; +0x74, 0x48e6e0\nCMP.W           R11, #0                                                ; +0x78, 0x48e6e4\nBGT             loc_48E6F2                                             ; +0x7c, 0x48e6e8\nCMP.W           R10, #3                                                ; +0x7e, 0x48e6ea\nBNE.W           loc_48E872                                             ; +0x82, 0x48e6ee\nCMP.W           R9, #0                                                 ; +0x86, 0x48e6f2\nBEQ             loc_48E70C                                             ; +0x8a, 0x48e6f6\nCMP.W           R8, #0                                                 ; +0x8c, 0x48e6f8\nBGT             loc_48E710                                             ; +0x90, 0x48e6fc\nSUB.W           R5, R9, #3                                             ; +0x92, 0x48e6fe\nCMP             R5, #1                                                 ; +0x96, 0x48e702\nITE HI                                                                 ; +0x98, 0x48e704\nMOVHI           R5, #0                                                 ; +0x9a, 0x48e706\nMOVLS           R5, #1                                                 ; +0x9c, 0x48e708\nB               loc_48E712                                             ; +0x9e, 0x48e70a\nMOV             R5, R9                                                 ; +0xa0, 0x48e70c\nB               loc_48E712                                             ; +0xa2, 0x48e70e\nMOVS            R5, #1                                                 ; +0xa4, 0x48e710\nCBZ             R7, loc_48E71E                                         ; +0xa6, 0x48e712\nCMP             R6, #0                                                 ; +0xa8, 0x48e714\nBGT             loc_48E722                                             ; +0xaa, 0x48e716\nSUBS            R2, R7, #3                                             ; +0xac, 0x48e718\nCMP             R2, #1                                                 ; +0xae, 0x48e71a\nBLS             loc_48E722                                             ; +0xb0, 0x48e71c\nMOVS            R3, #0                                                 ; +0xb2, 0x48e71e\nB               loc_48E730                                             ; +0xb4, 0x48e720\nCMP             R5, #0                                                 ; +0xb6, 0x48e722\nBNE.W           loc_48E86E                                             ; +0xb8, 0x48e724\nMOV             R3, R5                                                 ; +0xbc, 0x48e728\nMOV             R9, R7                                                 ; +0xbe, 0x48e72a\nMOV             R8, R6                                                 ; +0xc0, 0x48e72c\nMOVS            R5, #1                                                 ; +0xc2, 0x48e72e\nMOV             R2, R8; int                                            ; +0xc4, 0x48e730\nMOV             R1, R9; int                                            ; +0xc6, 0x48e732\nMOV             R0, R4; this                                           ; +0xc8, 0x48e734\nSTR             R3, [SP,#0x3C+var_8]                                   ; +0xca, 0x48e736\nBL              _ZN15GJBaseGameLayer12getItemValueEii; GJBaseGameLayer::getItemValue(int,int) ; +0xcc, 0x48e738\nMOV             R2, R6; int                                            ; +0xd0, 0x48e73c\nMOV             R8, R0                                                 ; +0xd2, 0x48e73e\nMOV             R9, R1                                                 ; +0xd4, 0x48e740\nMOV             R0, R4; this                                           ; +0xd6, 0x48e742\nMOV             R1, R7; int                                            ; +0xd8, 0x48e744\nBL              _ZN15GJBaseGameLayer12getItemValueEii; GJBaseGameLayer::getItemValue(int,int) ; +0xda, 0x48e746\nMOV             R2, R11; int                                           ; +0xde, 0x48e74a\nSTRD.W          R0, R1, [SP,#0x3C+var_14]                              ; +0xe0, 0x48e74c\nMOV             R0, R4; this                                           ; +0xe4, 0x48e750\nMOV             R1, R10; int                                           ; +0xe6, 0x48e752\nBL              _ZN15GJBaseGameLayer12getItemValueEii; GJBaseGameLayer::getItemValue(int,int) ; +0xe8, 0x48e754\nLDR             R3, [SP,#0x3C+var_8]                                   ; +0xec, 0x48e758\nMOV             R6, R0                                                 ; +0xee, 0x48e75a\nMOV             R7, R1                                                 ; +0xf0, 0x48e75c\nCBZ             R3, loc_48E77A                                         ; +0xf2, 0x48e75e\nVLDR            D7, [SP,#0x3C+var_14]                                  ; +0xf4, 0x48e760\nMOV             R2, R8; double                                         ; +0xf8, 0x48e764\nLDR             R3, [SP,#0x3C+var_2C]                                  ; +0xfa, 0x48e766\nMOV             R0, R4; this                                           ; +0xfc, 0x48e768\nSTR             R3, [SP,#0x3C+var_34]; int                             ; +0xfe, 0x48e76a\nMOV             R3, R9                                                 ; +0x100, 0x48e76c\nVSTR            D7, [SP,#0x3C+var_3C]                                  ; +0x102, 0x48e76e\nBL              _ZN15GJBaseGameLayer20performMathOperationEddi; GJBaseGameLayer::performMathOperation(double,double,int) ; +0x106, 0x48e772\nMOV             R8, R0                                                 ; +0x10a, 0x48e776\nMOV             R9, R1                                                 ; +0x10c, 0x48e778\nVCVT.F64.F32    D7, S16                                                ; +0x10e, 0x48e77a\nCBZ             R5, loc_48E796                                         ; +0x112, 0x48e77e\nLDR             R3, [SP,#0x3C+var_28]                                  ; +0x114, 0x48e780\nMOV             R0, R4; this                                           ; +0x116, 0x48e782\nVSTR            D7, [SP,#0x3C+var_3C]                                  ; +0x118, 0x48e784\nMOV             R2, R8; double                                         ; +0x11c, 0x48e788\nSTR             R3, [SP,#0x3C+var_34]; int                             ; +0x11e, 0x48e78a\nMOV             R3, R9                                                 ; +0x120, 0x48e78c\nBL              _ZN15GJBaseGameLayer20performMathOperationEddi; GJBaseGameLayer::performMathOperation(double,double,int) ; +0x122, 0x48e78e\nVMOV            D7, R0, R1                                             ; +0x126, 0x48e792\nLDR             R3, [SP,#0x3C+var_20]                                  ; +0x12a, 0x48e796\nCBZ             R3, loc_48E7AA                                         ; +0x12c, 0x48e798\nSTR             R3, [SP,#0x3C+var_3C]; double                          ; +0x12e, 0x48e79a\nMOV             R0, R4; this                                           ; +0x130, 0x48e79c\nVMOV            R2, R3, D7; x                                          ; +0x132, 0x48e79e\nBL              _ZN15GJBaseGameLayer19performMathRoundingEdi; GJBaseGameLayer::performMathRounding(double,int) ; +0x136, 0x48e7a2\nVMOV            D7, R0, R1                                             ; +0x13a, 0x48e7a6\nLDR             R3, [SP,#0x3C+var_18]                                  ; +0x13e, 0x48e7aa\nCBZ             R3, loc_48E7BC                                         ; +0x140, 0x48e7ac\nVMOV            R0, R1, D7; double                                     ; +0x142, 0x48e7ae\nMOV             R2, R3; int                                            ; +0x146, 0x48e7b2\nBL              _Z15performMathSigndi; performMathSign(double,int)     ; +0x148, 0x48e7b4\nVMOV            D7, R0, R1                                             ; +0x14c, 0x48e7b8\nLDR             R3, [SP,#0x3C+var_24]                                  ; +0x150, 0x48e7bc\nCBZ             R3, loc_48E7D4                                         ; +0x152, 0x48e7be\nVSTR            D7, [SP,#0x3C+var_3C]                                  ; +0x154, 0x48e7c0\nMOV             R0, R4; this                                           ; +0x158, 0x48e7c4\nSTR             R3, [SP,#0x3C+var_34]; int                             ; +0x15a, 0x48e7c6\nMOV             R2, R6; double                                         ; +0x15c, 0x48e7c8\nMOV             R3, R7                                                 ; +0x15e, 0x48e7ca\nBL              _ZN15GJBaseGameLayer20performMathOperationEddi; GJBaseGameLayer::performMathOperation(double,double,int) ; +0x160, 0x48e7cc\nVMOV            D7, R0, R1                                             ; +0x164, 0x48e7d0\nLDR             R3, [SP,#0x3C+var_20+4]                                ; +0x168, 0x48e7d4\nCBZ             R3, loc_48E7E8                                         ; +0x16a, 0x48e7d6\nSTR             R3, [SP,#0x3C+var_3C]; int                             ; +0x16c, 0x48e7d8\nMOV             R0, R4; this                                           ; +0x16e, 0x48e7da\nVMOV            R2, R3, D7; x                                          ; +0x170, 0x48e7dc\nBL              _ZN15GJBaseGameLayer19performMathRoundingEdi; GJBaseGameLayer::performMathRounding(double,int) ; +0x174, 0x48e7e0\nVMOV            D7, R0, R1                                             ; +0x178, 0x48e7e4\nLDR             R3, [SP,#0x3C+var_C]                                   ; +0x17c, 0x48e7e8\nCBZ             R3, loc_48E7FA                                         ; +0x17e, 0x48e7ea\nVMOV            R0, R1, D7; double                                     ; +0x180, 0x48e7ec\nMOV             R2, R3; int                                            ; +0x184, 0x48e7f0\nBL              _Z15performMathSigndi; performMathSign(double,int)     ; +0x186, 0x48e7f2\nVMOV            D7, R0, R1                                             ; +0x18a, 0x48e7f6\nCMP.W           R10, #2                                                ; +0x18e, 0x48e7fa\nBEQ             loc_48E836                                             ; +0x192, 0x48e7fe\nCMP.W           R10, #3                                                ; +0x194, 0x48e800\nBEQ             loc_48E84E                                             ; +0x198, 0x48e804\nCMP.W           R10, #1                                                ; +0x19a, 0x48e806\nBNE             loc_48E872                                             ; +0x19e, 0x48e80a\nVCVT.S32.F64    S15, D7                                                ; +0x1a0, 0x48e80c\nLDR.W           R0, [R4,#0x690]; this                                  ; +0x1a4, 0x48e810\nMOV             R1, R11; int                                           ; +0x1a8, 0x48e814\nVMOV            R2, S15; int                                           ; +0x1aa, 0x48e816\nVSTR            S15, [SP,#0x3C+var_2C]                                 ; +0x1ae, 0x48e81a\nBL              _ZN15GJEffectManager18updateCountForItemEii; GJEffectManager::updateCountForItem(int,int) ; +0x1b2, 0x48e81e\nMOV             R0, R4; this                                           ; +0x1b6, 0x48e822\nMOV             R1, R11; int                                           ; +0x1b8, 0x48e824\nLDR             R2, [SP,#0x3C+var_2C]; int                             ; +0x1ba, 0x48e826\nADD             SP, SP, #0x3C ; '<'                                    ; +0x1bc, 0x48e828\nVPOP            {D8}                                                   ; +0x1be, 0x48e82a\nPOP.W           {R4-R11,LR}                                            ; +0x1c2, 0x48e82e\nB.W             _ZN15GJBaseGameLayer14updateCountersEii; GJBaseGameLayer::updateCounters(int,int) ; +0x1c6, 0x48e832\nVMOV            R2, R3, D7; double                                     ; +0x1ca, 0x48e836\nMOV             R1, R11; int                                           ; +0x1ce, 0x48e83a\nLDR.W           R0, [R4,#0x690]; this                                  ; +0x1d0, 0x48e83c\nADD             SP, SP, #0x3C ; '<'                                    ; +0x1d4, 0x48e840\nVPOP            {D8}                                                   ; +0x1d6, 0x48e842\nPOP.W           {R4-R11,LR}                                            ; +0x1da, 0x48e846\nB.W             _ZN15GJEffectManager11updateTimerEid; GJEffectManager::updateTimer(int,double) ; +0x1de, 0x48e84a\nVCVT.S32.F64    S14, D7                                                ; +0x1e2, 0x48e84e\nMOVS            R3, #1                                                 ; +0x1e6, 0x48e852\nSTRB.W          R3, [R4,#0x5F8]                                        ; +0x1e8, 0x48e854\nVMOV            R3, S14                                                ; +0x1ec, 0x48e858\nSTR.W           R3, [R4,#0x5F4]                                        ; +0x1f0, 0x48e85c\nB               loc_48E872                                             ; +0x1f4, 0x48e860\nCMP.W           R11, #0                                                ; +0x1f6, 0x48e862\nBLE             loc_48E872                                             ; +0x1fa, 0x48e866\nMOV.W           R10, #1                                                ; +0x1fc, 0x48e868\nB               loc_48E6F2                                             ; +0x200, 0x48e86c\nMOVS            R3, #1                                                 ; +0x202, 0x48e86e\nB               loc_48E730                                             ; +0x204, 0x48e870\nADD             SP, SP, #0x3C ; '<'                                    ; +0x206, 0x48e872\nVPOP            {D8}                                                   ; +0x208, 0x48e874\nPOP.W           {R4-R11,PC}                                            ; +0x20c, 0x48e878", "xrefs": ["ItemTriggerGameObject::triggerObject @ 0x3eea76"], "is_objc": false, "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"}