{"type": "func", "start": 4296379408, "end": 4296379810, "name": "GJBaseGameLayer::loadLevelSettings", "pseudocode": "// \n// GJBaseGameLayer::loadLevelSettings from 0x100158c10 to 0x100158da2 (402 bytes)\n// \n// 5 xrefs:\n// > PlayLayer::prepareCreateObjectsFromSetup @ 0x1000ad20b\n// > LevelEditorLayer::init @ 0x1000dbe4e\n// > LevelEditorLayer::createObjectsFromSetup @ 0x1000dcdf8\n// > LevelEditorLayer::levelSettingsUpdated @ 0x1000def7f\n// > LevelEditorLayer::onPlaytest @ 0x1000f226e\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 __fastcall GJBaseGameLayer::loadLevelSettings(GJBaseGameLayer *a1)\n{\n  PlayerObject *m_player1; // rdi\n  bool m_platformerMode; // si\n  GJGameLevel *m_level; // rax\n  PlayerObject *v5; // rcx\n  LevelSettingsObject *m_levelSettings; // rdi\n  bool v7; // dl\n  PlayerObject *m_player2; // rsi\n  bool v9; // dl\n  cocos2d::CCArray *m_objects; // rax\n  cocos2d::ccArray *data; // rax\n  GameObject **arr; // r15\n  unsigned __int64 v13; // r12\n  GameObject *v14; // r14\n  bool m_fixNegativeScale; // al\n\n  m_player1 = a1->m_player1;\n  m_platformerMode = a1->m_levelSettings->m_platformerMode;\n  a1->m_isPlatformer = m_platformerMode;\n  PlayerObject::togglePlatformerMode(m_player1, m_platformerMode);\n  PlayerObject::togglePlatformerMode(a1->m_player2, a1->m_isPlatformer);\n  m_level = a1->m_level;\n  if ( a1->m_isPlatformer )\n    m_level->m_levelLength = 5;\n  v5 = a1->m_player1;\n  m_levelSettings = a1->m_levelSettings;\n  v7 = !m_levelSettings->m_fixRobotJump;\n  v5->m_fixRobotJump = v7;\n  m_player2 = a1->m_player2;\n  m_player2->m_fixRobotJump = v7;\n  v9 = !m_levelSettings->m_decreaseBoostSlide;\n  v5->m_decreaseBoostSlide = v9;\n  m_player2->m_decreaseBoostSlide = v9;\n  if ( m_level->m_timestamp > 0 )\n  {\n    if ( !LevelSettingsObject::shouldUseYSection(m_levelSettings) )\n      goto LABEL_5;\nLABEL_8:\n    a1->m_sectionYFactor = 0.0099999998;\n    m_objects = a1->m_objects;\n    if ( !m_objects )\n      return;\n    goto LABEL_9;\n  }\n  m_level->m_timestamp = m_levelSettings->m_propertykA44;\n  if ( LevelSettingsObject::shouldUseYSection(m_levelSettings) )\n    goto LABEL_8;\nLABEL_5:\n  a1->m_sectionYFactor = 0.0;\n  m_objects = a1->m_objects;\n  if ( m_objects )\n  {\nLABEL_9:\n    data = m_objects->data;\n    if ( !data->num )\n      return;\n    arr = (GameObject **)data->arr;\n    v13 = (unsigned __int64)&arr[data->num - 1];\n    do\n    {\n      v14 = *arr;\n      if ( !*arr )\n        return;\n      if ( a1->m_allowStaticRotate )\n      {\n        v14->m_canRotateFree = 1;\n        m_fixNegativeScale = a1->m_fixNegativeScale;\n        if ( v14->m_isMirroredByScale != m_fixNegativeScale )\n          goto LABEL_17;\n      }\n      else\n      {\n        v14->m_canRotateFree = GameObject::canRotateFree(*arr);\n        m_fixNegativeScale = a1->m_fixNegativeScale;\n        if ( v14->m_isMirroredByScale != m_fixNegativeScale )\nLABEL_17:\n          v14->m_isObjectRectDirty = 1;\n      }\n      v14->m_isMirroredByScale = m_fixNegativeScale;\n      ++arr;\n    }\n    while ( (unsigned __int64)arr <= v13 );\n  }\n}", "assembly": "; \n; GJBaseGameLayer::loadLevelSettings from 0x100158c10 to 0x100158da2 (402 bytes)\n; \n; 5 xrefs:\n; > PlayLayer::prepareCreateObjectsFromSetup @ 0x1000ad20b\n; > LevelEditorLayer::init @ 0x1000dbe4e\n; > LevelEditorLayer::createObjectsFromSetup @ 0x1000dcdf8\n; > LevelEditorLayer::levelSettingsUpdated @ 0x1000def7f\n; > LevelEditorLayer::onPlaytest @ 0x1000f226e\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    rbp                                                            ; +0x0, 0x100158c10\nmov     rbp, rsp                                                       ; +0x1, 0x100158c11\npush    r15                                                            ; +0x4, 0x100158c14\npush    r14                                                            ; +0x6, 0x100158c16\npush    r12                                                            ; +0x8, 0x100158c18\npush    rbx                                                            ; +0xa, 0x100158c1a\nmov     rbx, rdi                                                       ; +0xb, 0x100158c1b\nmov     rdi, [rdi+0CA0h]                                               ; +0xe, 0x100158c1e\nmov     rax, [rbx+0CB0h]                                               ; +0x15, 0x100158c25\nmovzx   esi, byte ptr [rax+155h]                                       ; +0x1c, 0x100158c2c\nmov     [rbx+2F36h], sil                                               ; +0x23, 0x100158c33\ncall    PlayerObject__togglePlatformerMode                             ; +0x2a, 0x100158c3a\nmov     rdi, [rbx+0CA8h]                                               ; +0x2f, 0x100158c3f\nmovzx   esi, byte ptr [rbx+2F36h]                                      ; +0x36, 0x100158c46\ncall    PlayerObject__togglePlatformerMode                             ; +0x3d, 0x100158c4d\nmov     rax, [rbx+790h]                                                ; +0x42, 0x100158c52\ncmp     byte ptr [rbx+2F36h], 1                                        ; +0x49, 0x100158c59\njnz     short loc_100158C6C                                            ; +0x50, 0x100158c60\nmov     dword ptr [rax+310h], 5                                        ; +0x52, 0x100158c62\nmov     rcx, [rbx+0CA0h]                                               ; +0x5c, 0x100158c6c\nmov     rdi, [rbx+0CB0h]                                               ; +0x63, 0x100158c73\nmovzx   edx, byte ptr [rdi+1C4h]                                       ; +0x6a, 0x100158c7a\nxor     dl, 1                                                          ; +0x71, 0x100158c81\nmov     [rcx+0B50h], dl                                                ; +0x74, 0x100158c84\nmov     rsi, [rbx+0CA8h]                                               ; +0x7a, 0x100158c8a\nmov     [rsi+0B50h], dl                                                ; +0x81, 0x100158c91\nmovzx   edx, byte ptr [rdi+1CBh]                                       ; +0x87, 0x100158c97\nxor     dl, 1                                                          ; +0x8e, 0x100158c9e\nmov     [rcx+9D8h], dl                                                 ; +0x91, 0x100158ca1\nmov     [rsi+9D8h], dl                                                 ; +0x97, 0x100158ca7\ncmp     dword ptr [rax+460h], 0                                        ; +0x9d, 0x100158cad\njle     short loc_100158CDB                                            ; +0xa4, 0x100158cb4\ncall    LevelSettingsObject__shouldUseYSection                         ; +0xa6, 0x100158cb6\ntest    al, al                                                         ; +0xab, 0x100158cbb\njnz     short loc_100158CF0                                            ; +0xad, 0x100158cbd\nxorps   xmm0, xmm0                                                     ; +0xaf, 0x100158cbf\nmovss   dword ptr [rbx+348Ch], xmm0                                    ; +0xb2, 0x100158cc2\nmov     rax, [rbx+0CB8h]                                               ; +0xba, 0x100158cca\ntest    rax, rax                                                       ; +0xc1, 0x100158cd1\njnz     short loc_100158D10                                            ; +0xc4, 0x100158cd4\njmp     loc_100158D99                                                  ; +0xc6, 0x100158cd6\nmov     ecx, [rdi+1B0h]                                                ; +0xcb, 0x100158cdb\nmov     [rax+460h], ecx                                                ; +0xd1, 0x100158ce1\ncall    LevelSettingsObject__shouldUseYSection                         ; +0xd7, 0x100158ce7\ntest    al, al                                                         ; +0xdc, 0x100158cec\njz      short loc_100158CBF                                            ; +0xde, 0x100158cee\nmovss   xmm0, cs:dword_100815D1C                                       ; +0xe0, 0x100158cf0\nmovss   dword ptr [rbx+348Ch], xmm0                                    ; +0xe8, 0x100158cf8\nmov     rax, [rbx+0CB8h]                                               ; +0xf0, 0x100158d00\ntest    rax, rax                                                       ; +0xf7, 0x100158d07\njz      loc_100158D99                                                  ; +0xfa, 0x100158d0a\nmov     rax, [rax+38h]                                                 ; +0x100, 0x100158d10\nmov     ecx, [rax]                                                     ; +0x104, 0x100158d14\ntest    rcx, rcx                                                       ; +0x106, 0x100158d16\njz      loc_100158D99                                                  ; +0x109, 0x100158d19\nmov     r15, [rax+10h]                                                 ; +0x10f, 0x100158d1f\nlea     r12, [r15+rcx*8]                                               ; +0x113, 0x100158d23\nadd     r12, 0FFFFFFFFFFFFFFF8h                                        ; +0x117, 0x100158d27\njmp     short loc_100158D40                                            ; +0x11b, 0x100158d2b\nalign 10h                                                              ; +0x11d, 0x100158d2d\nmov     [r14+365h], al                                                 ; +0x120, 0x100158d30\nadd     r15, 8                                                         ; +0x127, 0x100158d37\ncmp     r15, r12                                                       ; +0x12b, 0x100158d3b\nja      short loc_100158D99                                            ; +0x12e, 0x100158d3e\nmov     r14, [r15]                                                     ; +0x130, 0x100158d40\ntest    r14, r14                                                       ; +0x133, 0x100158d43\njz      short loc_100158D99                                            ; +0x136, 0x100158d46\nmov     al, 1                                                          ; +0x138, 0x100158d48\ncmp     byte ptr [rbx+7A0h], 0                                         ; +0x13a, 0x100158d4a\njz      short loc_100158D70                                            ; +0x141, 0x100158d51\nmov     [r14+364h], al                                                 ; +0x143, 0x100158d53\nmovzx   eax, byte ptr [rbx+7A1h]                                       ; +0x14a, 0x100158d5a\ncmp     [r14+365h], al                                                 ; +0x151, 0x100158d61\njz      short loc_100158D30                                            ; +0x158, 0x100158d68\njmp     short loc_100158D8F                                            ; +0x15a, 0x100158d6a\nalign 10h                                                              ; +0x15c, 0x100158d6c\nmov     rdi, r14                                                       ; +0x160, 0x100158d70\ncall    GameObject__canRotateFree                                      ; +0x163, 0x100158d73\nmov     [r14+364h], al                                                 ; +0x168, 0x100158d78\nmovzx   eax, byte ptr [rbx+7A1h]                                       ; +0x16f, 0x100158d7f\ncmp     [r14+365h], al                                                 ; +0x176, 0x100158d86\njz      short loc_100158D30                                            ; +0x17d, 0x100158d8d\nmov     byte ptr [r14+360h], 1                                         ; +0x17f, 0x100158d8f\njmp     short loc_100158D30                                            ; +0x187, 0x100158d97\npop     rbx                                                            ; +0x189, 0x100158d99\npop     r12                                                            ; +0x18a, 0x100158d9a\npop     r14                                                            ; +0x18c, 0x100158d9c\npop     r15                                                            ; +0x18e, 0x100158d9e\npop     rbp                                                            ; +0x190, 0x100158da0\nretn                                                                   ; +0x191, 0x100158da1", "xrefs": ["PlayLayer::prepareCreateObjectsFromSetup @ 0x1000ad20b", "LevelEditorLayer::init @ 0x1000dbe4e", "LevelEditorLayer::createObjectsFromSetup @ 0x1000dcdf8", "LevelEditorLayer::levelSettingsUpdated @ 0x1000def7f", "LevelEditorLayer::onPlaytest @ 0x1000f226e"], "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"}