{"type": "func", "start": 5371025248, "end": 5371025662, "name": "GJBaseGameLayer::loadStartPosObject", "pseudocode": "// \n// GJBaseGameLayer::loadStartPosObject from 0x140235760 to 0x1402358fe (414 bytes)\n// \n// 3 xrefs:\n// > LevelEditorLayer::onPlaytest @ 0x1402e0361\n// > PlayLayer::resetLevel @ 0x1403b969c\n// > <???> @ 0x1406ce058\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\n// Hidden C++ exception states: #wind=1\nvoid GJBaseGameLayer::loadStartPosObject(GJBaseGameLayer *a1)\n{\n  GameManager *v2; // rcx\n  PlayerObject *m_player1; // rcx\n  LevelSettingsObject *m_startSettings; // rcx\n  int m_targetChannel; // ebx\n  int m_targetOrder; // edi\n  const cocos2d::CCPoint *v7; // rax\n  __int64 v8; // rdx\n  bool v9; // r8\n  void *v10; // [rsp+60h] [rbp+8h]\n\n  v2 = (GameManager *)qword_1406C2ED8;\n  if ( !qword_1406C2ED8 )\n  {\n    v10 = operator new(0x668u);\n    qword_1406C2ED8 = sub_14017AB00((__int64)v10);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n    v2 = (GameManager *)qword_1406C2ED8;\n  }\n  a1->m_startOptimization = GameManager::getGameVariable(v2, \"0151\");\n  a1->m_loadingStartPosition = 1;\n  PlayerObject::doReversePlayer(a1->m_player1, 0);\n  m_player1 = a1->m_player1;\n  m_player1->m_isSideways = 0;\n  PlayerObject::updatePlayerArt(m_player1);\n  m_startSettings = a1->m_startPosObject->m_startSettings;\n  m_targetChannel = m_startSettings->m_targetChannel;\n  m_targetOrder = m_startSettings->m_targetOrder;\n  v7 = a1->m_player1->getPosition_0(a1->m_player1);\n  GJBaseGameLayer::loadUpToPosition(a1, v7->x, m_targetOrder, m_targetChannel);\n  a1->m_loadingStartPosition = 0;\n  if ( a1->m_startPosObject->m_startSettings->m_resetCamera )\n  {\n    *(_QWORD *)&a1->m_gameState.m_cameraEdgeValue0 = 0;\n    *(_QWORD *)&a1->m_gameState.m_cameraEdgeValue2 = 0;\n    ((void (__fastcall *)(GJBaseGameLayer *, __int64, _QWORD, _QWORD, _DWORD, _DWORD, _DWORD, int, int))a1->updateScreenRotation)(\n      a1,\n      v8,\n      0,\n      0,\n      0,\n      0,\n      0,\n      -1,\n      -1);\n    *(_QWORD *)&a1->m_cameraWidthOffset = 0;\n    *(_QWORD *)&a1->m_cameraUnzoomedHeightOffset = 0;\n    a1->m_calculateTargetHeightOffset = 1;\n    cocos2d::CCPoint::operator=(&a1->m_gameState.m_cameraStepDiff, &dword_1406C1D28);\n    cocos2d::CCPoint::operator=(&a1->m_gameState.m_unkPoint10, &dword_1406C1D28);\n    GJBaseGameLayer::resetStaticCamera(a1, 1, v9);\n  }\n  GJBaseGameLayer::setupLevelStart(a1, a1->m_startPosObject->m_startSettings);\n  a1->m_startOptimization = 0;\n}", "assembly": "; \n; GJBaseGameLayer::loadStartPosObject from 0x140235760 to 0x1402358fe (414 bytes)\n; \n; 3 xrefs:\n; > LevelEditorLayer::onPlaytest @ 0x1402e0361\n; > PlayLayer::resetLevel @ 0x1403b969c\n; > <???> @ 0x1406ce058\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\nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x140235760\nmov     [rsp+arg_10], rsi                                              ; +0x5, 0x140235765\npush    rdi                                                            ; +0xa, 0x14023576a\nsub     rsp, 50h                                                       ; +0xb, 0x14023576b\nmov     rsi, rcx                                                       ; +0xf, 0x14023576f\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x12, 0x140235772\ntest    rcx, rcx                                                       ; +0x19, 0x140235779\njnz     short loc_1402357AD                                            ; +0x1c, 0x14023577c\nmov     ecx, 668h; Size                                                ; +0x1e, 0x14023577e\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x23, 0x140235783\nmov     [rsp+58h+arg_0], rax                                           ; +0x28, 0x140235788\nmov     rcx, rax                                                       ; +0x2d, 0x14023578d\ncall    sub_14017AB00                                                  ; +0x30, 0x140235790\nnop                                                                    ; +0x35, 0x140235795\nmov     cs:qword_1406C2ED8, rax                                        ; +0x36, 0x140235796\nmov     rdx, [rax]                                                     ; +0x3d, 0x14023579d\nmov     rcx, rax                                                       ; +0x40, 0x1402357a0\ncall    qword ptr [rdx+48h]                                            ; +0x43, 0x1402357a3\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x46, 0x1402357a6\nlea     rdx, a0151; \"0151\"                                             ; +0x4d, 0x1402357ad\ncall    GameManager__getGameVariable                                   ; +0x54, 0x1402357b4\nmov     [rsi+3767h], al                                                ; +0x59, 0x1402357b9\nmov     byte ptr [rsi+3764h], 1                                        ; +0x5f, 0x1402357bf\nxor     edx, edx                                                       ; +0x66, 0x1402357c6\nmov     rcx, [rsi+0DA0h]                                               ; +0x68, 0x1402357c8\ncall    PlayerObject__doReversePlayer                                  ; +0x6f, 0x1402357cf\nmov     rcx, [rsi+0DA0h]                                               ; +0x74, 0x1402357d4\nmov     byte ptr [rcx+9C3h], 0                                         ; +0x7b, 0x1402357db\ncall    PlayerObject__updatePlayerArt                                  ; +0x82, 0x1402357e2\nmov     rax, [rsi+3188h]                                               ; +0x87, 0x1402357e7\nmov     rcx, [rax+740h]                                                ; +0x8e, 0x1402357ee\nmov     ebx, [rcx+178h]                                                ; +0x95, 0x1402357f5\nmov     edi, [rcx+174h]                                                ; +0x9b, 0x1402357fb\nmov     rcx, [rsi+0DA0h]                                               ; +0xa1, 0x140235801\nmov     rax, [rcx]                                                     ; +0xa8, 0x140235808\ncall    qword ptr [rax+0C8h]                                           ; +0xab, 0x14023580b\nmov     r9d, ebx                                                       ; +0xb1, 0x140235811\nmov     r8d, edi                                                       ; +0xb4, 0x140235814\nmovss   xmm1, dword ptr [rax]                                          ; +0xb7, 0x140235817\nmov     rcx, rsi                                                       ; +0xbb, 0x14023581b\ncall    GJBaseGameLayer__loadUpToPosition                              ; +0xbe, 0x14023581e\nmov     byte ptr [rsi+3764h], 0                                        ; +0xc3, 0x140235823\nmov     rax, [rsi+3188h]                                               ; +0xca, 0x14023582a\nmov     rcx, [rax+740h]                                                ; +0xd1, 0x140235831\ncmp     byte ptr [rcx+1C0h], 0                                         ; +0xd8, 0x140235838\njz      loc_1402358D1                                                  ; +0xdf, 0x14023583f\nxor     ebx, ebx                                                       ; +0xe5, 0x140235845\nmov     [rsi+468h], rbx                                                ; +0xe7, 0x140235847\nmov     [rsi+470h], rbx                                                ; +0xee, 0x14023584e\nmov     rax, [rsi]                                                     ; +0xf5, 0x140235855\nmov     [rsp+58h+var_18], 0FFFFFFFFh                                   ; +0xf8, 0x140235858\nmov     [rsp+58h+var_20], 0FFFFFFFFh                                   ; +0x100, 0x140235860\nxorps   xmm1, xmm1                                                     ; +0x108, 0x140235868\nmovss   [rsp+58h+var_28], xmm1                                         ; +0x10b, 0x14023586b\nmov     [rsp+58h+var_30], ebx                                          ; +0x111, 0x140235871\nmovss   [rsp+58h+var_38], xmm1                                         ; +0x115, 0x140235875\nxor     r9d, r9d                                                       ; +0x11b, 0x14023587b\nxor     r8d, r8d                                                       ; +0x11e, 0x14023587e\nmov     rcx, rsi                                                       ; +0x121, 0x140235881\ncall    qword ptr [rax+4D0h]                                           ; +0x124, 0x140235884\nmov     [rsi+3208h], rbx                                               ; +0x12a, 0x14023588a\nmov     [rsi+3234h], rbx                                               ; +0x131, 0x140235891\nmov     byte ptr [rsi+323Ch], 1                                        ; +0x138, 0x140235898\nlea     rcx, [rsi+4DCh]                                                ; +0x13f, 0x14023589f\nlea     rdx, dword_1406C1D28                                           ; +0x146, 0x1402358a6\ncall    cs:??4CCPoint@cocos2d@@QEAAAEAV01@AEBV01@@Z; cocos2d::CCPoint::operator=(cocos2d::CCPoint const &) ; +0x14d, 0x1402358ad\nlea     rcx, [rsi+200h]                                                ; +0x153, 0x1402358b3\nlea     rdx, dword_1406C1D28                                           ; +0x15a, 0x1402358ba\ncall    cs:??4CCPoint@cocos2d@@QEAAAEAV01@AEBV01@@Z; cocos2d::CCPoint::operator=(cocos2d::CCPoint const &) ; +0x161, 0x1402358c1\nmov     dl, 1                                                          ; +0x167, 0x1402358c7\nmov     rcx, rsi                                                       ; +0x169, 0x1402358c9\ncall    GJBaseGameLayer__resetStaticCamera                             ; +0x16c, 0x1402358cc\nmov     rdx, [rsi+3188h]                                               ; +0x171, 0x1402358d1\nmov     rdx, [rdx+740h]                                                ; +0x178, 0x1402358d8\nmov     rcx, rsi                                                       ; +0x17f, 0x1402358df\ncall    GJBaseGameLayer__setupLevelStart                               ; +0x182, 0x1402358e2\nmov     byte ptr [rsi+3767h], 0                                        ; +0x187, 0x1402358e7\nmov     rbx, [rsp+58h+arg_8]                                           ; +0x18e, 0x1402358ee\nmov     rsi, [rsp+58h+arg_10]                                          ; +0x193, 0x1402358f3\nadd     rsp, 50h                                                       ; +0x198, 0x1402358f8\npop     rdi                                                            ; +0x19c, 0x1402358fc\nretn                                                                   ; +0x19d, 0x1402358fd", "xrefs": ["LevelEditorLayer::onPlaytest @ 0x1402e0361", "PlayLayer::resetLevel @ 0x1403b969c", "<???> @ 0x1406ce058"], "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"}