{"type": "func", "start": 4790572, "end": 4791024, "name": "GJBaseGameLayer::setupLevelStart", "pseudocode": "// \n// GJBaseGameLayer::setupLevelStart from 0x49192c to 0x491af0 (452 bytes)\n// \n// 4 xrefs:\n// > PlayLayer::setupHasCompleted @ 0x31c1e0\n// > PlayLayer::resetLevel @ 0x31fbd2\n// > LevelEditorLayer::onPlaytest @ 0x36ebe4\n// > GJBaseGameLayer::loadStartPosObject @ 0x4970b6\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::setupLevelStart(GJBaseGameLayer *a1, LevelSettingsObject *a2)\n{\n  int m_startMode; // r3\n  int v5; // r5\n  int v6; // r2\n  GJBaseGameLayer *v7; // r0\n  float v8; // r1\n\n  PlayerObject::flipGravity(a1->m_player1, a2->m_isFlipped, 1);\n  PlayerObject::doReversePlayer(a1->m_player1, a2->m_reverseGameplay);\n  PlayerObject::rotateGameplayOnly(a1->m_player1, a2->m_rotateGameplay);\n  if ( a2->m_startDual )\n    GJBaseGameLayer::toggleDualMode(a1, nullptr, 1, nullptr, 1);\n  PlayerObject::togglePlayerScale(a1->m_player1, a2->m_startMini, 0);\n  if ( a1->m_gameState.m_isDualMode )\n  {\n    PlayerObject::togglePlayerScale(a1->m_player2, a2->m_startMini, 0);\n    PlayerObject::flipGravity(a1->m_player2, !a1->m_player1->m_isUpsideDown, 1);\n    PlayerObject::doReversePlayer(a1->m_player2, a1->m_player1->m_isGoingLeft);\n  }\n  if ( a2->m_platformerMode || a1->m_isPlatformer )\n  {\n    m_startMode = a2->m_startMode;\n    if ( m_startMode == 4 || m_startMode == 7 )\n      a2->m_startMode = 0;\n  }\n  switch ( a2->m_startMode )\n  {\n    case 1:\n      v5 = 5;\n      goto LABEL_16;\n    case 2:\n      GJBaseGameLayer::switchToRollMode(a1, a1->m_player1, nullptr, 1);\n      if ( a1->m_gameState.m_isDualMode )\n        GJBaseGameLayer::switchToRollMode(a1, a1->m_player2, nullptr, 1);\n      v6 = 16;\n      break;\n    case 3:\n      v5 = 19;\n      goto LABEL_16;\n    case 4:\n      v5 = 26;\n      goto LABEL_16;\n    case 5:\n      GJBaseGameLayer::switchToRobotMode(a1, a1->m_player1, nullptr, 1);\n      if ( a1->m_gameState.m_isDualMode )\n        GJBaseGameLayer::switchToRobotMode(a1, a1->m_player2, nullptr, 1);\n      v6 = 27;\n      break;\n    case 6:\n      GJBaseGameLayer::switchToSpiderMode(a1, a1->m_player1, nullptr, 1);\n      if ( a1->m_gameState.m_isDualMode )\n        GJBaseGameLayer::switchToSpiderMode(a1, a1->m_player2, nullptr, 1);\n      v6 = 33;\n      break;\n    case 7:\n      v5 = 41;\nLABEL_16:\n      GJBaseGameLayer::switchToFlyMode(a1, a1->m_player1, nullptr, 1, v5);\n      if ( a1->m_gameState.m_isDualMode )\n        GJBaseGameLayer::switchToFlyMode(a1, a1->m_player2, nullptr, 1, v5);\n      v6 = v5;\n      break;\n    default:\n      v6 = 6;\n      break;\n  }\n  GJBaseGameLayer::updateDualGround(a1, a1->m_player1, v6, 1, 0.0);\n  switch ( a2->m_startSpeed )\n  {\n    case Slow:\n      v7 = a1;\n      v8 = 0.7;\n      goto LABEL_32;\n    case Fast:\n      v7 = a1;\n      v8 = 1.1;\n      goto LABEL_32;\n    case Faster:\n      v7 = a1;\n      v8 = 1.3;\n      goto LABEL_32;\n    case Fastest:\n      v8 = 1.6;\n      v7 = a1;\nLABEL_32:\n      GJBaseGameLayer::updateTimeMod(v7, v8, 1, 0);\n      break;\n    default:\n      return;\n  }\n}", "assembly": "; \n; GJBaseGameLayer::setupLevelStart from 0x49192c to 0x491af0 (452 bytes)\n; \n; 4 xrefs:\n; > PlayLayer::setupHasCompleted @ 0x31c1e0\n; > PlayLayer::resetLevel @ 0x31fbd2\n; > LevelEditorLayer::onPlaytest @ 0x36ebe4\n; > GJBaseGameLayer::loadStartPosObject @ 0x4970b6\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            {R0,R1,R4-R6,LR}                                       ; +0x0, 0x49192c\nMOVS            R2, #1; bool                                           ; +0x2, 0x49192e\nMOV             R6, R1                                                 ; +0x4, 0x491930\nMOV             R4, R0                                                 ; +0x6, 0x491932\nLDRB.W          R1, [R1,#0x135]; bool                                  ; +0x8, 0x491934\nLDR.W           R0, [R0,#0x8B8]; this                                  ; +0xc, 0x491938\nBL              _ZN12PlayerObject11flipGravityEbb; PlayerObject::flipGravity(bool,bool) ; +0x10, 0x49193c\nLDR.W           R0, [R4,#0x8B8]; this                                  ; +0x14, 0x491940\nLDRB.W          R1, [R6,#0x136]; bool                                  ; +0x18, 0x491944\nBL              _ZN12PlayerObject15doReversePlayerEb; PlayerObject::doReversePlayer(bool) ; +0x1c, 0x491948\nLDR.W           R0, [R4,#0x8B8]; this                                  ; +0x20, 0x49194c\nLDRB.W          R1, [R6,#0x117]; bool                                  ; +0x24, 0x491950\nBL              _ZN12PlayerObject18rotateGameplayOnlyEb; PlayerObject::rotateGameplayOnly(bool) ; +0x28, 0x491954\nLDRB.W          R3, [R6,#0x115]                                        ; +0x2c, 0x491958\nCBZ             R3, loc_49196C                                         ; +0x30, 0x49195c\nMOVS            R1, #0; GameObject *                                   ; +0x32, 0x49195e\nMOVS            R2, #1; bool                                           ; +0x34, 0x491960\nMOV             R0, R4; this                                           ; +0x36, 0x491962\nSTR             R2, [SP,#8+var_8]; bool                                ; +0x38, 0x491964\nMOV             R3, R1; PlayerObject *                                 ; +0x3a, 0x491966\nBL              _ZN15GJBaseGameLayer14toggleDualModeEP10GameObjectbP12PlayerObjectb; GJBaseGameLayer::toggleDualMode(GameObject *,bool,PlayerObject *,bool) ; +0x3c, 0x491968\nLDR.W           R0, [R4,#0x8B8]; this                                  ; +0x40, 0x49196c\nMOVS            R2, #0; bool                                           ; +0x44, 0x491970\nLDRB.W          R1, [R6,#0x114]; bool                                  ; +0x46, 0x491972\nBL              _ZN12PlayerObject17togglePlayerScaleEbb; PlayerObject::togglePlayerScale(bool,bool) ; +0x4a, 0x491976\nLDRB.W          R3, [R4,#0x372]                                        ; +0x4e, 0x49197a\nCBZ             R3, loc_4919B4                                         ; +0x52, 0x49197e\nLDR.W           R0, [R4,#0x8BC]; this                                  ; +0x54, 0x491980\nMOVS            R2, #0; bool                                           ; +0x58, 0x491984\nLDRB.W          R1, [R6,#0x114]; bool                                  ; +0x5a, 0x491986\nBL              _ZN12PlayerObject17togglePlayerScaleEbb; PlayerObject::togglePlayerScale(bool,bool) ; +0x5e, 0x49198a\nLDR.W           R3, [R4,#0x8B8]                                        ; +0x62, 0x49198e\nLDR.W           R0, [R4,#0x8BC]; this                                  ; +0x66, 0x491992\nMOVS            R2, #1; bool                                           ; +0x6a, 0x491996\nLDRB.W          R1, [R3,#0x7B7]                                        ; +0x6c, 0x491998\nEOR.W           R1, R1, #1; bool                                       ; +0x70, 0x49199c\nBL              _ZN12PlayerObject11flipGravityEbb; PlayerObject::flipGravity(bool,bool) ; +0x74, 0x4919a0\nLDR.W           R3, [R4,#0x8B8]                                        ; +0x78, 0x4919a4\nLDR.W           R0, [R4,#0x8BC]; this                                  ; +0x7c, 0x4919a8\nLDRB.W          R1, [R3,#0x7BA]; bool                                  ; +0x80, 0x4919ac\nBL              _ZN12PlayerObject15doReversePlayerEb; PlayerObject::doReversePlayer(bool) ; +0x84, 0x4919b0\nLDRB.W          R3, [R6,#0x119]                                        ; +0x88, 0x4919b4\nCBNZ            R3, loc_4919C2                                         ; +0x8c, 0x4919b8\nMOVW            R3, #0x2A12                                            ; +0x8e, 0x4919ba\nLDRB            R3, [R4,R3]                                            ; +0x92, 0x4919be\nCBZ             R3, loc_4919D2                                         ; +0x94, 0x4919c0\nLDR.W           R3, [R6,#0x10C]                                        ; +0x96, 0x4919c2\nCMP             R3, #4                                                 ; +0x9a, 0x4919c6\nBEQ.W           loc_491AE4                                             ; +0x9c, 0x4919c8\nCMP             R3, #7                                                 ; +0xa0, 0x4919cc\nBEQ.W           loc_491AE4                                             ; +0xa2, 0x4919ce\nLDR.W           R3, [R6,#0x10C]                                        ; +0xa6, 0x4919d2\nSUBS            R3, #1; switch 7 cases                                 ; +0xaa, 0x4919d6\nCMP             R3, #6                                                 ; +0xac, 0x4919d8\nBHI             def_4919DC; jumptable 004919DC default case            ; +0xae, 0x4919da\nTBB.W           [PC,R3]; switch jump                                   ; +0xb0, 0x4919dc\nDCB 4; jump table for switch statement                                 ; +0xb4, 0x4919e0\nDCB 6                                                                  ; +0xb5, 0x4919e1\nDCB 0x19                                                               ; +0xb6, 0x4919e2\nDCB 0x1D                                                               ; +0xb7, 0x4919e3\nDCB 0x32                                                               ; +0xb8, 0x4919e4\nDCB 0x44                                                               ; +0xb9, 0x4919e5\nDCB 0x1B                                                               ; +0xba, 0x4919e6\nALIGN 2                                                                ; +0xbb, 0x4919e7\nMOVS            R5, #5; jumptable 004919DC case 1                      ; +0xbc, 0x4919e8\nB               loc_491A1C                                             ; +0xbe, 0x4919ea\nMOVS            R3, #1; jumptable 004919DC case 2                      ; +0xc0, 0x4919ec\nMOV             R0, R4; this                                           ; +0xc2, 0x4919ee\nLDR.W           R1, [R4,#0x8B8]; PlayerObject *                        ; +0xc4, 0x4919f0\nMOVS            R2, #0; GameObject *                                   ; +0xc8, 0x4919f4\nBL              _ZN15GJBaseGameLayer16switchToRollModeEP12PlayerObjectP10GameObjectb; GJBaseGameLayer::switchToRollMode(PlayerObject *,GameObject *,bool) ; +0xca, 0x4919f6\nLDRB.W          R3, [R4,#0x372]                                        ; +0xce, 0x4919fa\nCMP             R3, #0                                                 ; +0xd2, 0x4919fe\nBEQ             loc_491A90                                             ; +0xd4, 0x491a00\nMOV             R0, R4; this                                           ; +0xd6, 0x491a02\nLDR.W           R1, [R4,#0x8BC]; PlayerObject *                        ; +0xd8, 0x491a04\nMOVS            R2, #0; GameObject *                                   ; +0xdc, 0x491a08\nMOVS            R3, #1; bool                                           ; +0xde, 0x491a0a\nBL              _ZN15GJBaseGameLayer16switchToRollModeEP12PlayerObjectP10GameObjectb; GJBaseGameLayer::switchToRollMode(PlayerObject *,GameObject *,bool) ; +0xe0, 0x491a0c\nB               loc_491A90                                             ; +0xe4, 0x491a10\nMOVS            R5, #0x13; jumptable 004919DC case 3                   ; +0xe6, 0x491a12\nB               loc_491A1C                                             ; +0xe8, 0x491a14\nMOVS            R5, #0x29 ; ')'; jumptable 004919DC case 7             ; +0xea, 0x491a16\nB               loc_491A1C                                             ; +0xec, 0x491a18\nMOVS            R5, #0x1A; jumptable 004919DC case 4                   ; +0xee, 0x491a1a\nMOVS            R3, #1; bool                                           ; +0xf0, 0x491a1c\nSTR             R5, [SP,#8+var_8]; int                                 ; +0xf2, 0x491a1e\nMOV             R0, R4; this                                           ; +0xf4, 0x491a20\nLDR.W           R1, [R4,#0x8B8]; PlayerObject *                        ; +0xf6, 0x491a22\nMOVS            R2, #0; GameObject *                                   ; +0xfa, 0x491a26\nBL              _ZN15GJBaseGameLayer15switchToFlyModeEP12PlayerObjectP10GameObjectbi; GJBaseGameLayer::switchToFlyMode(PlayerObject *,GameObject *,bool,int) ; +0xfc, 0x491a28\nLDRB.W          R3, [R4,#0x372]                                        ; +0x100, 0x491a2c\nCBZ             R3, loc_491A94                                         ; +0x104, 0x491a30\nSTR             R5, [SP,#8+var_8]; int                                 ; +0x106, 0x491a32\nMOV             R0, R4; this                                           ; +0x108, 0x491a34\nLDR.W           R1, [R4,#0x8BC]; PlayerObject *                        ; +0x10a, 0x491a36\nMOVS            R2, #0; GameObject *                                   ; +0x10e, 0x491a3a\nMOVS            R3, #1; bool                                           ; +0x110, 0x491a3c\nBL              _ZN15GJBaseGameLayer15switchToFlyModeEP12PlayerObjectP10GameObjectbi; GJBaseGameLayer::switchToFlyMode(PlayerObject *,GameObject *,bool,int) ; +0x112, 0x491a3e\nB               loc_491A94                                             ; +0x116, 0x491a42\nMOVS            R3, #1; jumptable 004919DC case 5                      ; +0x118, 0x491a44\nMOV             R0, R4; this                                           ; +0x11a, 0x491a46\nLDR.W           R1, [R4,#0x8B8]; PlayerObject *                        ; +0x11c, 0x491a48\nMOVS            R2, #0; GameObject *                                   ; +0x120, 0x491a4c\nBL              _ZN15GJBaseGameLayer17switchToRobotModeEP12PlayerObjectP10GameObjectb; GJBaseGameLayer::switchToRobotMode(PlayerObject *,GameObject *,bool) ; +0x122, 0x491a4e\nLDRB.W          R3, [R4,#0x372]                                        ; +0x126, 0x491a52\nCBZ             R3, loc_491A98                                         ; +0x12a, 0x491a56\nMOV             R0, R4; this                                           ; +0x12c, 0x491a58\nLDR.W           R1, [R4,#0x8BC]; PlayerObject *                        ; +0x12e, 0x491a5a\nMOVS            R2, #0; GameObject *                                   ; +0x132, 0x491a5e\nMOVS            R3, #1; bool                                           ; +0x134, 0x491a60\nBL              _ZN15GJBaseGameLayer17switchToRobotModeEP12PlayerObjectP10GameObjectb; GJBaseGameLayer::switchToRobotMode(PlayerObject *,GameObject *,bool) ; +0x136, 0x491a62\nB               loc_491A98                                             ; +0x13a, 0x491a66\nMOVS            R3, #1; jumptable 004919DC case 6                      ; +0x13c, 0x491a68\nMOV             R0, R4; this                                           ; +0x13e, 0x491a6a\nLDR.W           R1, [R4,#0x8B8]; PlayerObject *                        ; +0x140, 0x491a6c\nMOVS            R2, #0; GameObject *                                   ; +0x144, 0x491a70\nBL              _ZN15GJBaseGameLayer18switchToSpiderModeEP12PlayerObjectP10GameObjectb; GJBaseGameLayer::switchToSpiderMode(PlayerObject *,GameObject *,bool) ; +0x146, 0x491a72\nLDRB.W          R3, [R4,#0x372]                                        ; +0x14a, 0x491a76\nCBZ             R3, loc_491A9C                                         ; +0x14e, 0x491a7a\nMOV             R0, R4; this                                           ; +0x150, 0x491a7c\nLDR.W           R1, [R4,#0x8BC]; PlayerObject *                        ; +0x152, 0x491a7e\nMOVS            R2, #0; GameObject *                                   ; +0x156, 0x491a82\nMOVS            R3, #1; bool                                           ; +0x158, 0x491a84\nBL              _ZN15GJBaseGameLayer18switchToSpiderModeEP12PlayerObjectP10GameObjectb; GJBaseGameLayer::switchToSpiderMode(PlayerObject *,GameObject *,bool) ; +0x15a, 0x491a86\nB               loc_491A9C                                             ; +0x15e, 0x491a8a\nMOVS            R2, #6; jumptable 004919DC default case                ; +0x160, 0x491a8c\nB               loc_491A9E                                             ; +0x162, 0x491a8e\nMOVS            R2, #0x10                                              ; +0x164, 0x491a90\nB               loc_491A9E                                             ; +0x166, 0x491a92\nMOV             R2, R5                                                 ; +0x168, 0x491a94\nB               loc_491A9E                                             ; +0x16a, 0x491a96\nMOVS            R2, #0x1B                                              ; +0x16c, 0x491a98\nB               loc_491A9E                                             ; +0x16e, 0x491a9a\nMOVS            R2, #0x21 ; '!'; int                                   ; +0x170, 0x491a9c\nMOVS            R3, #0                                                 ; +0x172, 0x491a9e\nMOV             R0, R4; this                                           ; +0x174, 0x491aa0\nSTR             R3, [SP,#8+var_8]; float                               ; +0x176, 0x491aa2\nMOVS            R3, #1; bool                                           ; +0x178, 0x491aa4\nLDR.W           R1, [R4,#0x8B8]; PlayerObject *                        ; +0x17a, 0x491aa6\nBL              _ZN15GJBaseGameLayer16updateDualGroundEP12PlayerObjectibf; GJBaseGameLayer::updateDualGround(PlayerObject *,int,bool,float) ; +0x17e, 0x491aaa\nLDR.W           R3, [R6,#0x110]                                        ; +0x182, 0x491aae\nSUBS            R3, #1; switch 4 cases                                 ; +0x186, 0x491ab2\nCMP             R3, #3                                                 ; +0x188, 0x491ab4\nBHI             def_491AB8; jumptable 00491AB8 default case            ; +0x18a, 0x491ab6\nTBB.W           [PC,R3]; switch jump                                   ; +0x18c, 0x491ab8\nDCB 2; jump table for switch statement                                 ; +0x190, 0x491abc\nDCB 5                                                                  ; +0x191, 0x491abd\nDCB 8                                                                  ; +0x192, 0x491abe\nDCB 0xB                                                                ; +0x193, 0x491abf\nMOV             R0, R4; jumptable 00491AB8 case 1                      ; +0x194, 0x491ac0\nLDR             R1, =0x3F333333                                        ; +0x196, 0x491ac2\nB               loc_491AD6                                             ; +0x198, 0x491ac4\nMOV             R0, R4; jumptable 00491AB8 case 2                      ; +0x19a, 0x491ac6\nLDR             R1, =0x3F8CCCCD                                        ; +0x19c, 0x491ac8\nB               loc_491AD6                                             ; +0x19e, 0x491aca\nMOV             R0, R4; jumptable 00491AB8 case 3                      ; +0x1a0, 0x491acc\nLDR             R1, =0x3FA66666                                        ; +0x1a2, 0x491ace\nB               loc_491AD6                                             ; +0x1a4, 0x491ad0\nLDR             R1, flt_491AFC; jumptable 00491AB8 case 4              ; +0x1a6, 0x491ad2\nMOV             R0, R4; this                                           ; +0x1a8, 0x491ad4\nMOVS            R2, #1; bool                                           ; +0x1aa, 0x491ad6\nMOVS            R3, #0; bool                                           ; +0x1ac, 0x491ad8\nADD             SP, SP, #8                                             ; +0x1ae, 0x491ada\nPOP.W           {R4-R6,LR}                                             ; +0x1b0, 0x491adc\nB.W             _ZN15GJBaseGameLayer13updateTimeModEfbb; GJBaseGameLayer::updateTimeMod(float,bool,bool) ; +0x1b4, 0x491ae0\nMOVS            R3, #0                                                 ; +0x1b8, 0x491ae4\nSTR.W           R3, [R6,#0x10C]                                        ; +0x1ba, 0x491ae6\nB               loc_4919D2                                             ; +0x1be, 0x491aea\nADD             SP, SP, #8; jumptable 00491AB8 default case            ; +0x1c0, 0x491aec\nPOP             {R4-R6,PC}                                             ; +0x1c2, 0x491aee", "xrefs": ["PlayLayer::setupHasCompleted @ 0x31c1e0", "PlayLayer::resetLevel @ 0x31fbd2", "LevelEditorLayer::onPlaytest @ 0x36ebe4", "GJBaseGameLayer::loadStartPosObject @ 0x4970b6"], "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"}