#include "classes.h" // 008d8b00 void Menu_KeyConfig::Update() { char isActionTriggered; uint uVar1; int iVar2; float fVar3; int iVar4; void *historyEnd; int iVar5; int rebindDevice; int *rebindDeviceRef; Menu_KeyConfig *device; int *deviceRef; int local_24; int local_20; Menu_KeyConfig *local_1c; int local_18; int local_14; void *local_10; undefined1 *puStack_c; undefined4 local_8; Manager *manager; MenuManager *menuManager; float *viewY; local_8 = 0xffffffff; puStack_c = &LAB_00b06005; local_10 = ExceptionList; uVar1 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U; ExceptionList = &local_10; g_manager->_isHotkeysEnabled = (char)this->State == '\0'; local_1c = this; if ((this->KeyConfigSprite)._loaded != 0) { (GHIDRA_CAST((&(this->KeyConfigSprite)._animState)))->AnimationState::Update(); (GHIDRA_CAST((&(this->KeyConfigSprite)._overlayAnimState)))->AnimationState::Update(); } iVar5 = g_menuControllerIndex; local_20 = g_menuControllerIndex; (GHIDRA_CAST((&PTR_vftable_00c57b18)))->InputManager::get_device(&device,g_menuControllerIndex); menuManager = g_menuManager; local_8 = 0; if (device == GHIDRA_CAST(0x0)) { this->SelectedElement = 0; *GHIDRA_CAST(&this->State) = 0; g_menuControllerIndex = 0; g_manager->_isHotkeysEnabled = 1; historyEnd = (menuManager->_menuStateHistory)._end; if (1 < GHIDRA_UINT((GHIDRA_INT(historyEnd) - GHIDRA_INT((menuManager->_menuStateHistory)._begin) >> 2))) { historyEnd = (void *)(GHIDRA_INT(historyEnd) + -4); (menuManager->_menuStateHistory)._end = historyEnd; } (GHIDRA_CAST((menuManager)))->MenuManager::SetState(*GHIDRA_CAST((GHIDRA_CAST(historyEnd) + -4)),0); goto LAB_008d92f5; } iVar2 = __RTDynamicCast(device,0,&KAGE::Input::InputDeviceBase::RTTI_Type_Descriptor, &KAGE::Input::InputDeviceGamepad::RTTI_Type_Descriptor,0,uVar1); if ((iVar2 != 0) && (((*GHIDRA_CAST((iVar2 + 8)) & 0x20) != 0 || (*GHIDRA_CAST((iVar2 + 900)) == 3)))) { update_gamepad_layout(this); goto LAB_008d92f5; } if ((char)this->State == '\0') { local_18 = 0xe; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar5,FUN_00a209e0,&local_18,0); if (isActionTriggered == '\0') { local_18 = 0xe; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a209e0,&local_18,0,0); if (isActionTriggered == '\0') { local_24 = 0xf; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar5,FUN_00a209e0,&local_24,0,0); if (isActionTriggered == '\0') { local_14 = 0xf; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a209e0,&local_14,0,0); if (isActionTriggered == '\0') { local_14 = 0x16; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar5,FUN_00a209e0,&local_14,0,0); if (isActionTriggered == '\0') { local_24 = 0x16; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a209e0,&local_24,0,0); if (isActionTriggered != '\0') goto LAB_008d8ed3; local_18 = 0x17; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar5,FUN_00a209e0,&local_18,0,0); if (isActionTriggered == '\0') { local_1c = GHIDRA_CAST(&DAT_00000017); isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a209e0,&local_1c,0,0); if (isActionTriggered == '\0') { local_14 = 0x14; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar5,FUN_00a209e0,&local_14,0,0); if (isActionTriggered == '\0') { local_14 = 0x14; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a209e0,&local_14,0,0); if (isActionTriggered == '\0') { local_14 = 0x15; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (iVar5,FUN_00a209e0,&local_14,0,0); if (isActionTriggered == '\0') { local_14 = 0x15; isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (0,FUN_00a209e0,&local_14,0,0); if (isActionTriggered == '\0') goto LAB_008d9290; } this->SelectedColumn = 0; goto LAB_008d9290; } } this->SelectedColumn = 1; goto LAB_008d9290; } } iVar2 = this->SelectedElement; if (iVar2 == 0x13) { iVar2 = 0; LAB_008d8e49: this->SelectedElement = iVar2; menuManager = g_menuManager; if (iVar5 != 0) { if (iVar2 != 0x13) { if (iVar2 < 3) { g_menuManager->_viewPositionSet[0xc].y = -1890.0; menuManager->_state = 1; } else if (iVar2 < 0xb) { g_menuManager->_viewPositionSet[0xc].y = -1890.0 - ((float)iVar2 - 2.0) * 24.0 ; menuManager->_state = 1; } else { g_menuManager->_viewPositionSet[0xc].y = -2130.0; menuManager->_state = 1; } goto LAB_008d9290; } goto LAB_008d8f99; } goto LAB_008d8f1e; } if ((iVar5 == 0) || (iVar2 != 0xe)) { iVar2 = iVar2 + 1; goto LAB_008d8e49; } this->SelectedElement = 0x13; } else { LAB_008d8ed3: iVar2 = this->SelectedElement; if (iVar2 == 0) { iVar2 = 0x13; } else { if ((iVar5 != 0) && (iVar2 == 0x13)) { this->SelectedElement = 0xe; menuManager = g_menuManager; g_menuManager->_viewPositionSet[0xc].y = -2130.0; menuManager->_state = 1; goto LAB_008d9290; } iVar2 = iVar2 + -1; } this->SelectedElement = iVar2; menuManager = g_menuManager; if (iVar5 == 0) { LAB_008d8f1e: menuManager = g_menuManager; if (iVar2 < 3) { g_menuManager->_viewPositionSet[0xc].y = -1890.0; menuManager->_state = 1; } else if (iVar2 < 0xd) { g_menuManager->_viewPositionSet[0xc].y = -1890.0 - ((float)iVar2 - 2.0) * 19.0; menuManager->_state = 1; } else { g_menuManager->_viewPositionSet[0xc].y = -2118.0; menuManager->_state = 1; } goto LAB_008d9290; } if (iVar2 != 0x13) { viewY = &g_menuManager->_viewPositionSet[0xc].y; if (iVar2 < 3) { *viewY = -1890.0; menuManager->_state = 1; } else if (iVar2 < 0xb) { *viewY = -1890.0 - ((float)iVar2 - 2.0) * 24.0; menuManager->_state = 1; } else { *viewY = -2130.0; menuManager->_state = 1; } goto LAB_008d9290; } } LAB_008d8f99: menuManager = g_menuManager; g_menuManager->_viewPositionSet[0xc].y = -2130.0; menuManager->_state = 1; goto LAB_008d9290; } } iVar2 = 0; iVar5 = GHIDRA_UINT((iVar5 == 0)) * 4 + 0xf; local_18 = iVar5; do { uVar1 = (&DAT_00b24010)[iVar2]; local_1c = device; fVar3 = device->PositionY; if (GHIDRA_UINT((*GHIDRA_CAST((device->KeyConfigSprite)._filename._buf) - GHIDRA_INT(fVar3) >> 4)) <= uVar1) { KAGE_LogMessage(0x10,GHIDRA_CAST("ActionId is out of range\n")); fVar3 = local_1c->PositionY; iVar5 = local_18; } manager = g_manager; if ((*GHIDRA_CAST((GHIDRA_CAST(fVar3) + uVar1 * 0x10)) == -1) && (*GHIDRA_CAST((GHIDRA_CAST(fVar3) + 4 + uVar1 * 0x10)) == -1)) { local_1c = GHIDRA_CAST(0xbb); seed_fart_sound_override(GHIDRA_CAST(&local_1c)); (GHIDRA_CAST((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_1c),1.0,2,0,1.0,0.0); iVar5 = local_18; break; } iVar2 = iVar2 + 1; } while (iVar2 < iVar5); manager = g_manager; if (iVar2 == iVar5) { this->SelectedElement = 0; *GHIDRA_CAST(&this->State) = 0; g_menuControllerIndex = 0; manager->_isHotkeysEnabled = 1; FUN_0098aec0(); Manager::apply_device_key_config(local_20); } goto LAB_008d9290; } } if (this->SelectedElement == 0x13) { (**(code **)(device->State + 0x14))(); } else { *GHIDRA_CAST(&this->State) = 1; } } else { local_18 = (**(code **)(device->State + 0x3c))(0); iVar5 = g_menuControllerIndex; if ((local_18 != -1) && (local_18 != 0xf)) { *GHIDRA_CAST(&this->State) = 0; (GHIDRA_CAST((&PTR_vftable_00c57b18)))->InputManager::get_device(&rebindDevice,iVar5); iVar5 = local_18; local_8 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),1); local_24 = 0x13; if (g_menuControllerIndex != 0) { local_24 = 0xf; } iVar2 = 0; do { uVar1 = (&DAT_00b24010)[iVar2]; local_20 = rebindDevice; iVar4 = *GHIDRA_CAST((rebindDevice + 0x10)); if (GHIDRA_UINT((*GHIDRA_CAST((rebindDevice + 0x14)) - iVar4 >> 4)) <= uVar1) { KAGE_LogMessage(0x10,GHIDRA_CAST("ActionId is out of range\n")); iVar4 = *GHIDRA_CAST((local_20 + 0x10)); } local_14 = *GHIDRA_CAST((iVar4 + 4 + uVar1 * 0x10)); if (*GHIDRA_CAST((iVar4 + uVar1 * 0x10)) == iVar5) { uVar1 = (&DAT_00b24010)[iVar2]; local_20 = rebindDevice; iVar4 = *GHIDRA_CAST((rebindDevice + 0x10)); if (GHIDRA_UINT((*GHIDRA_CAST((rebindDevice + 0x14)) - iVar4 >> 4)) <= uVar1) { KAGE_LogMessage(0x10,GHIDRA_CAST("ActionId is out of range\n")); iVar4 = *GHIDRA_CAST((local_20 + 0x10)); } *GHIDRA_CAST((iVar4 + uVar1 * 0x10)) = 0xffffffff; } if (local_14 == iVar5) { uVar1 = (&DAT_00b24010)[iVar2]; local_20 = rebindDevice; iVar4 = *GHIDRA_CAST((rebindDevice + 0x10)); if (GHIDRA_UINT((*GHIDRA_CAST((rebindDevice + 0x14)) - iVar4 >> 4)) <= uVar1) { KAGE_LogMessage(0x10,GHIDRA_CAST("ActionId is out of range\n")); iVar4 = *GHIDRA_CAST((local_20 + 0x10)); } *GHIDRA_CAST((iVar4 + 4 + uVar1 * 0x10)) = 0xffffffff; } this = local_1c; iVar2 = iVar2 + 1; } while (iVar2 < local_24); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 2; if (((rebindDeviceRef != GHIDRA_CAST(0x0)) && (isActionTriggered = (**(code **)(*rebindDeviceRef + 0xc))(), isActionTriggered != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&rebindDevice); } local_8 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_UINT(local_8))) + 0x1))) << 8; FUN_00a24330(this->SelectedColumn,(&DAT_00b24010)[this->SelectedElement],local_18); } } LAB_008d9290: if (((this->KeyConfigSprite)._animState._animData != (void *)0x0) && ((6 < *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._animState._animation) + 0x80)) || (KAGE_LogMessage(0x10,GHIDRA_CAST("LayerId out of bounds\n")), 6 < *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._animState._animation) + 0x80)))))) { historyEnd = (this->KeyConfigSprite)._animState._animData; iVar5 = *GHIDRA_CAST((GHIDRA_CAST(historyEnd) + 0x50)); if ((historyEnd == (void *)0x0) || ((iVar5 < 0 || (*GHIDRA_CAST((GHIDRA_CAST(historyEnd) + 0x1c)) <= iVar5)))) { KAGE_LogMessage(0x10,GHIDRA_CAST("id out of bounds\n")); } *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._animState._layerFrames) + iVar5 * 4)) = 0; (GHIDRA_CAST((&(this->KeyConfigSprite)._animState)))->AnimationState::AdvanceLayerPosition(iVar5,0.0); } LAB_008d92f5: local_8 = 3; if (((deviceRef != GHIDRA_CAST(0x0)) && (isActionTriggered = (**(code **)(*deviceRef + 0xc))(), isActionTriggered != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&device); } ExceptionList = local_10; return; } // 008d9340 void Menu_KeyConfig::Render() { Vector pos; Vector pos_00; Vector scale; Vector scale_00; byte bVar1; char isLastDeviceRef; uint uVar2; byte *keyName; LayerState *cursorLayer; void *pvVar3; byte *expectedAnimChar; AnimationLayer *animLayer; int currentRow; ANM2 *cursorAnm2; bool isNameLess; float x; float fVar4; ColorMod normalColor; ColorMod highlightColor; KColor textColor; KColor rowColor; Vector secondaryGlyphPos; Vector primaryGlyphPos; undefined4 fontSettings; undefined4 local_e4; undefined4 local_e0; undefined4 local_dc; undefined4 local_d8; undefined4 local_d4; undefined4 local_d0; Vector selectedCursorPos; int secondaryKey; int controllerIndex; int primaryKey; float keyTextX; int rowHeight; float rowOffsetY; int *device; int *deviceRefCount; int *local_a0; Vector cursorPos; Vector local_94; int rowOffset; int row; Font *font; float originY; float originX; char *actionLabels [4]; char *local_68; char *local_64; char *local_60; char *local_5c; char *local_58; char *local_54; char *local_50; char *local_4c; char *local_48; char *local_44; char *local_40; char *local_3c; char *local_38; char *local_34; char *local_30; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; char *local_14; int layerIndex; ColorMod *spriteColor; puStack_20 = GHIDRA_CAST((actionLabels + 0x1d)); local_14 = GHIDRA_CAST(0xffffffff); puStack_18 = &LAB_00b06061; local_1c = ExceptionList; uVar2 = __security_cookie ^ GHIDRA_UINT((actionLabels + 0x1a)); ExceptionList = &local_1c; local_24 = uVar2; (GHIDRA_CAST((&PTR_vftable_00c57b18)))->InputManager::get_device(&device,g_menuControllerIndex); local_14 = GHIDRA_CAST(0x0); local_94.x = (g_menuManager->_ViewPosition).x + this->PositionX; local_94.y = (g_menuManager->_ViewPosition).y + this->PositionY; originY = local_94.y; originX = local_94.x; if ((this->KeyConfigSprite)._loaded != 0) { if ((this->KeyConfigSprite)._overlayRenderFirst == 0) { AnimationState::Render (&(this->KeyConfigSprite)._animState,&local_94,&g_vectorZero,&g_vectorZero); AnimationState::Render (&(this->KeyConfigSprite)._overlayAnimState,&local_94,&g_vectorZero,&g_vectorZero); } else { AnimationState::Render (&(this->KeyConfigSprite)._overlayAnimState,&local_94,&g_vectorZero,&g_vectorZero); AnimationState::Render (&(this->KeyConfigSprite)._animState,&local_94,&g_vectorZero,&g_vectorZero); } originX = local_94.x; originY = local_94.y; } local_94.x = originX; local_94.y = originY; if (device == GHIDRA_CAST(0x0)) goto LAB_008d9fde; layerIndex = __RTDynamicCast(device,0,&KAGE::Input::InputDeviceBase::RTTI_Type_Descriptor, &KAGE::Input::InputDeviceGamepad::RTTI_Type_Descriptor,0,uVar2); if ((layerIndex != 0) && (((*GHIDRA_CAST((layerIndex + 8)) & 0x20) != 0 || (*GHIDRA_CAST((layerIndex + 900)) == 3)))) { render_gamepad_layout(this); goto LAB_008d9fde; } local_94.y = (float)&this->KeyConfigSprite; if (((this->KeyConfigSprite)._animState._animData == (void *)0x0) || ((this->KeyConfigSprite)._animState._isPlaying == 0)) { LAB_008d94f9: (GHIDRA_CAST((GHIDRA_CAST(local_94.y))))->ANM2::Play(s_Idle,0); } else { keyName = (this->KeyConfigSprite)._animState._animData; if (0xf < *GHIDRA_CAST((keyName + 0x14))) { keyName = *GHIDRA_CAST(keyName); } expectedAnimChar = s_Idle; do { bVar1 = *keyName; isNameLess = bVar1 < *expectedAnimChar; if (bVar1 != *expectedAnimChar) { LAB_008d94f0: uVar2 = -GHIDRA_UINT(isNameLess) | 1; goto LAB_008d94f5; } if (bVar1 == 0) break; bVar1 = keyName[1]; isNameLess = bVar1 < expectedAnimChar[1]; if (bVar1 != expectedAnimChar[1]) goto LAB_008d94f0; keyName = keyName + 2; expectedAnimChar = expectedAnimChar + 2; } while (bVar1 != 0); uVar2 = 0; LAB_008d94f5: if (uVar2 != 0) goto LAB_008d94f9; } font = &g_manager->_font2_TeamMeatEx12; (GHIDRA_CAST((&textColor)))->KColor::SetFromARGB(0xff362f2d); rowHeight = 0x13; x = originX + 80.0; if (g_menuControllerIndex != 0) { rowHeight = 0x18; } actionLabels[0] = "#INPUT_WALK_UP"; isNameLess = g_menuControllerIndex == 0; fVar4 = originY + 58.0; actionLabels[1] = "#INPUT_WALK_DOWN"; actionLabels[2] = "#INPUT_WALK_LEFT"; actionLabels[3] = "#INPUT_WALK_RIGHT"; local_68 = "#INPUT_SHOOT_UP"; local_64 = "#INPUT_SHOOT_DOWN"; local_60 = "#INPUT_SHOOT_LEFT"; local_5c = "#INPUT_SHOOT_RIGHT"; local_58 = "#INPUT_BOMB"; local_54 = "#INPUT_ITEM"; local_50 = "#INPUT_PILL_CARD"; local_4c = "#INPUT_DROP"; local_48 = "#INPUT_MAP"; local_44 = "#INPUT_EMOTE"; local_40 = "#INPUT_DESCRIPTIONS"; local_3c = "#INPUT_FULLSCREEN"; local_38 = "#INPUT_RESTART"; local_34 = "#INPUT_MUTE"; local_30 = "#INPUT_PAUSE"; controllerIndex = g_menuControllerIndex; row = 0; rowOffset = 0x41; do { uVar2 = (&DAT_00b24010)[row]; local_a0 = device; layerIndex = device[4]; if (GHIDRA_UINT((device[5] - layerIndex >> 4)) <= uVar2) { KAGE_LogMessage(0x10,GHIDRA_CAST("ActionId is out of range\n")); layerIndex = local_a0[4]; } currentRow = row; primaryKey = *GHIDRA_CAST((layerIndex + uVar2 * 0x10)); secondaryKey = *GHIDRA_CAST((layerIndex + 4 + uVar2 * 0x10)); if ((primaryKey == -1) && (secondaryKey == -1)) { rowColor._red = 0.8; rowColor._green = 0.2; rowColor._blue = 0.2; rowColor._alpha = 1.0; rowColor._unk = 0; } else { rowColor._unk = textColor._unk; rowColor._red = textColor._red; rowColor._green = textColor._green; rowColor._blue = textColor._blue; rowColor._alpha = textColor._alpha; } fontSettings = 0; local_e4 = 0xffff; local_e0 = 0; local_dc = 0x3f800000; local_d8 = 0xffffffff; local_d4 = 0; local_d0 = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 1; keyName = string_table_translate(&g_manager->_stringTable,GHIDRA_CAST(actionLabels[row])); local_a0 = GHIDRA_CAST(((float)(rowOffset + -0x41) + fVar4)); (GHIDRA_CAST((font)))->Font::DrawString(keyName,&rowColor,&fontSettings,x,(float)local_a0); local_14 = GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_UINT(local_14))) + 0x1))) << 8)); rowOffsetY = (float)rowOffset; if (controllerIndex == 0) { LAB_008d97fd: fontSettings = 0; local_e4 = 0xffff; local_e0 = 0; local_dc = 0x3f800000; local_d8 = 0xffffffff; local_d4 = 0; local_d0 = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 2; keyName = GHIDRA_CAST((**(code **)(*device + 0x10))(primaryKey)); layerIndex = (GHIDRA_CAST((font)))->Font::get_string_width_n(keyName,-1); keyTextX = (originX + 400.0) - (float)((double)layerIndex + __uint_to_double_fixup[-(layerIndex >> 0x1f)]); keyName = GHIDRA_CAST((**(code **)(*device + 0x10))(primaryKey)); (GHIDRA_CAST((font)))->Font::DrawString(keyName,&rowColor,&fontSettings,keyTextX,(float)local_a0); local_14 = GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_UINT(local_14))) + 0x1))) << 8)); } else { local_d0 = 0; pos.y = rowOffsetY + originY; pos.x = originX + 384.0; scale.y = g_vectorOne.y; scale.x = g_vectorOne.x; bVar1 = Manager::render_controller_action_glyph (g_manager,controllerIndex,(&DAT_00b24010)[currentRow],0,0, (ColorMod) ZEXT1644(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))),pos ,scale); if (bVar1 == 0) goto LAB_008d97fd; } if (controllerIndex == 0) { LAB_008d9977: rowColor._unk = textColor._unk; rowColor._red = textColor._red; rowColor._green = textColor._green; rowColor._blue = textColor._blue; rowColor._alpha = textColor._alpha; fontSettings = 0; local_e4 = 0xffff; local_e0 = 0; local_dc = 0x3f800000; local_d8 = 0xffffffff; local_d4 = 0; local_d0 = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 3; keyName = GHIDRA_CAST((**(code **)(*device + 0x10))(secondaryKey)); layerIndex = (GHIDRA_CAST((font)))->Font::get_string_width_n(keyName,-1); keyTextX = (originX + 300.0) - (float)((double)layerIndex + __uint_to_double_fixup[-(layerIndex >> 0x1f)]); keyName = GHIDRA_CAST((**(code **)(*device + 0x10))(secondaryKey)); (GHIDRA_CAST((font)))->Font::DrawString(keyName,&rowColor,&fontSettings,keyTextX,(float)local_a0); local_14 = GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_UINT(local_14))) + 0x1))) << 8)); } else { secondaryGlyphPos.y = rowOffsetY + originY; secondaryGlyphPos.x = originX + 284.0; local_d0 = 0; pos_00.y = secondaryGlyphPos.y; pos_00.x = secondaryGlyphPos.x; scale_00.y = g_vectorOne.y; scale_00.x = g_vectorOne.x; bVar1 = Manager::render_controller_action_glyph (g_manager,controllerIndex,(&DAT_00b24010)[currentRow],1,0, (ColorMod) ZEXT1644(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))), pos_00,scale_00); if (bVar1 == 0) goto LAB_008d9977; } layerIndex = this->SelectedElement; if (currentRow == layerIndex) { cursorLayer = (GHIDRA_CAST((&this->KeyConfigSprite)))->ANM2::GetLayer(&DAT_00000006); cursorLayer->_visible = 1; (this->KeyConfigSprite)._flipX = 1; if ((char)this->State == '\0') { layerIndex = this->SelectedColumn * 100; cursorPos.x = (480.0 - (float)((double)layerIndex + __uint_to_double_fixup[-(layerIndex >> 0x1f)])) + originX; cursorPos.y = (float)rowHeight * (float)currentRow + 2.0 + originY; if ((this->KeyConfigSprite)._loaded != 0) { if ((this->KeyConfigSprite)._overlayRenderFirst == 0) { pvVar3 = (this->KeyConfigSprite)._animState._animData; if (((pvVar3 != (void *)0x0) && (6 < *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._animState._animation) + 0x80)))) && (layerIndex = *GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x50)), -1 < layerIndex)) { AnimationLayer::RenderFrame (GHIDRA_CAST((layerIndex * 0x10 + *GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x18)))), &cursorPos, *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._animState._layerFrames) + layerIndex * 4)),&g_vectorZero,&g_vectorZero, (this->KeyConfigSprite)._animState._animation); } pvVar3 = (this->KeyConfigSprite)._overlayAnimState._animData; if (((pvVar3 != (void *)0x0) && (6 < *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._overlayAnimState._animation) + 0x80)))) && (layerIndex = *GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x50)), -1 < layerIndex)) { AnimationLayer::RenderFrame (GHIDRA_CAST((layerIndex * 0x10 + *GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x18)))), &cursorPos, *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._overlayAnimState._layerFrames) + layerIndex * 4)),&g_vectorZero,&g_vectorZero, (this->KeyConfigSprite)._overlayAnimState._animation); } } else { pvVar3 = (this->KeyConfigSprite)._overlayAnimState._animData; if (((pvVar3 != (void *)0x0) && (6 < *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._overlayAnimState._animation) + 0x80)))) && (layerIndex = *GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x50)), -1 < layerIndex)) { AnimationLayer::RenderFrame (GHIDRA_CAST((layerIndex * 0x10 + *GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x18)))), &cursorPos, *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._overlayAnimState._layerFrames) + layerIndex * 4)),&g_vectorZero,&g_vectorZero, (this->KeyConfigSprite)._overlayAnimState._animation); } pvVar3 = (this->KeyConfigSprite)._animState._animData; if (((pvVar3 != (void *)0x0) && (6 < *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._animState._animation) + 0x80)))) && (layerIndex = *GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x50)), -1 < layerIndex)) { AnimationLayer::RenderFrame (GHIDRA_CAST((layerIndex * 0x10 + *GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x18)))), &cursorPos, *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._animState._layerFrames) + layerIndex * 4)),&g_vectorZero,&g_vectorZero, (this->KeyConfigSprite)._animState._animation); } } } } else { spriteColor = &(this->KeyConfigSprite)._color; highlightColor._offset[0] = 0.6862745; highlightColor._offset[1] = 0.0; highlightColor._offset[2] = 0.0; if (spriteColor != &highlightColor) { (this->KeyConfigSprite)._color._colorize[0] = 0.0; (this->KeyConfigSprite)._color._colorize[1] = 0.0; (this->KeyConfigSprite)._color._colorize[2] = 0.0; (this->KeyConfigSprite)._color._colorize[3] = 0.0; (this->KeyConfigSprite)._color._offset[0] = 0.6862745; (this->KeyConfigSprite)._color._offset[1] = 0.0; spriteColor->_tint[0] = 1.0; (this->KeyConfigSprite)._color._tint[1] = 1.0; (this->KeyConfigSprite)._color._tint[2] = 1.0; (this->KeyConfigSprite)._color._tint[3] = 1.0; (this->KeyConfigSprite)._color._offset[2] = 0.0; } layerIndex = this->SelectedColumn * 100; selectedCursorPos.x = (480.0 - (float)((double)layerIndex + __uint_to_double_fixup[-(layerIndex >> 0x1f)])) + originX; selectedCursorPos.y = (float)rowHeight * (float)row + 2.0 + originY; if ((this->KeyConfigSprite)._loaded != 0) { if ((this->KeyConfigSprite)._overlayRenderFirst == 0) { pvVar3 = (this->KeyConfigSprite)._animState._animData; if (((pvVar3 != (void *)0x0) && (6 < *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._animState._animation) + 0x80)))) && (layerIndex = *GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x50)), -1 < layerIndex)) { AnimationLayer::RenderFrame (GHIDRA_CAST((layerIndex * 0x10 + *GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x18)))), &selectedCursorPos, *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._animState._layerFrames) + layerIndex * 4)),&g_vectorZero,&g_vectorZero, (this->KeyConfigSprite)._animState._animation); } pvVar3 = (this->KeyConfigSprite)._overlayAnimState._animData; if (((pvVar3 != (void *)0x0) && (6 < *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._overlayAnimState._animation) + 0x80)))) && (layerIndex = *GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x50)), -1 < layerIndex)) { cursorAnm2 = (this->KeyConfigSprite)._overlayAnimState._animation; animLayer = GHIDRA_CAST((layerIndex * 0x10 + *GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x18)))); pvVar3 = (this->KeyConfigSprite)._overlayAnimState._layerFrames; goto LAB_008d9c3c; } } else { pvVar3 = (this->KeyConfigSprite)._overlayAnimState._animData; if (((pvVar3 != (void *)0x0) && (6 < *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._overlayAnimState._animation) + 0x80)))) && (layerIndex = *GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x50)), -1 < layerIndex)) { AnimationLayer::RenderFrame (GHIDRA_CAST((layerIndex * 0x10 + *GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x18)))), &selectedCursorPos, *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._overlayAnimState._layerFrames) + layerIndex * 4)),&g_vectorZero,&g_vectorZero, (this->KeyConfigSprite)._overlayAnimState._animation); } pvVar3 = (this->KeyConfigSprite)._animState._animData; if (((pvVar3 != (void *)0x0) && (6 < *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._animState._animation) + 0x80)))) && (layerIndex = *GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x50)), -1 < layerIndex)) { cursorAnm2 = (this->KeyConfigSprite)._animState._animation; animLayer = GHIDRA_CAST((layerIndex * 0x10 + *GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x18)))); pvVar3 = (this->KeyConfigSprite)._animState._layerFrames; LAB_008d9c3c: AnimationLayer::RenderFrame (animLayer,&selectedCursorPos,*GHIDRA_CAST((GHIDRA_CAST(pvVar3) + layerIndex * 4)), &g_vectorZero,&g_vectorZero,cursorAnm2); } } } normalColor._offset[0] = 0.0; normalColor._offset[1] = 0.0; normalColor._offset[2] = 0.0; if (spriteColor != &normalColor) { (this->KeyConfigSprite)._color._colorize[0] = 0.0; (this->KeyConfigSprite)._color._colorize[1] = 0.0; (this->KeyConfigSprite)._color._colorize[2] = 0.0; (this->KeyConfigSprite)._color._colorize[3] = 0.0; (this->KeyConfigSprite)._color._offset[0] = 0.0; (this->KeyConfigSprite)._color._offset[1] = 0.0; spriteColor->_tint[0] = 1.0; (this->KeyConfigSprite)._color._tint[1] = 1.0; (this->KeyConfigSprite)._color._tint[2] = 1.0; (this->KeyConfigSprite)._color._tint[3] = 1.0; (this->KeyConfigSprite)._color._offset[2] = 0.0; } currentRow = row; } (this->KeyConfigSprite)._flipX = 0; cursorLayer = (GHIDRA_CAST((&this->KeyConfigSprite)))->ANM2::GetLayer(&DAT_00000006); cursorLayer->_visible = 0; layerIndex = this->SelectedElement; } row = currentRow + 1; rowOffset = rowOffset + rowHeight; } while (row < GHIDRA_INT((GHIDRA_UINT(isNameLess) * 4 + 0xf))); if (layerIndex != 0x13) goto LAB_008d9fde; cursorLayer = (GHIDRA_CAST((&this->KeyConfigSprite)))->ANM2::GetLayer(&DAT_00000006); cursorPos.x = originX + 75.0; cursorPos.y = originY + 390.0; cursorLayer->_visible = 1; if ((this->KeyConfigSprite)._loaded != 0) { if ((this->KeyConfigSprite)._overlayRenderFirst == 0) { pvVar3 = (this->KeyConfigSprite)._animState._animData; if (((pvVar3 != (void *)0x0) && (cursorAnm2 = (this->KeyConfigSprite)._animState._animation, 6 < cursorAnm2->_layerCount)) && (layerIndex = *GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x50)), -1 < layerIndex)) { AnimationLayer::RenderFrame (GHIDRA_CAST((layerIndex * 0x10 + *GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x18)))),&cursorPos, *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._animState._layerFrames) + layerIndex * 4)), &g_vectorZero,&g_vectorZero,cursorAnm2); } pvVar3 = (this->KeyConfigSprite)._overlayAnimState._animData; if (((pvVar3 != (void *)0x0) && (cursorAnm2 = (this->KeyConfigSprite)._overlayAnimState._animation, 6 < cursorAnm2->_layerCount)) && (layerIndex = *GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x50)), -1 < layerIndex)) { animLayer = GHIDRA_CAST((layerIndex * 0x10 + *GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x18)))); pvVar3 = (this->KeyConfigSprite)._overlayAnimState._layerFrames; goto LAB_008d9fb6; } } else { pvVar3 = (this->KeyConfigSprite)._overlayAnimState._animData; if (((pvVar3 != (void *)0x0) && (cursorAnm2 = (this->KeyConfigSprite)._overlayAnimState._animation, 6 < cursorAnm2->_layerCount)) && (layerIndex = *GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x50)), -1 < layerIndex)) { AnimationLayer::RenderFrame (GHIDRA_CAST((layerIndex * 0x10 + *GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x18)))),&cursorPos, *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._overlayAnimState._layerFrames) + layerIndex * 4)),&g_vectorZero,&g_vectorZero,cursorAnm2); } pvVar3 = (this->KeyConfigSprite)._animState._animData; if (((pvVar3 != (void *)0x0) && (cursorAnm2 = (this->KeyConfigSprite)._animState._animation, 6 < cursorAnm2->_layerCount)) && (layerIndex = *GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x50)), -1 < layerIndex)) { animLayer = GHIDRA_CAST((layerIndex * 0x10 + *GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x18)))); pvVar3 = (this->KeyConfigSprite)._animState._layerFrames; LAB_008d9fb6: AnimationLayer::RenderFrame (animLayer,&cursorPos,*GHIDRA_CAST((GHIDRA_CAST(pvVar3) + layerIndex * 4)),&g_vectorZero, &g_vectorZero,cursorAnm2); } } } cursorLayer = (GHIDRA_CAST((GHIDRA_CAST(local_94.y))))->ANM2::GetLayer(&DAT_00000006); cursorLayer->_visible = 0; LAB_008d9fde: local_14 = GHIDRA_CAST(0x4); if (deviceRefCount != GHIDRA_CAST(0x0)) { isLastDeviceRef = (**(code **)(*deviceRefCount + 0xc))(); if ((isLastDeviceRef != '\0') && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&device); } } ExceptionList = local_1c; return; } // 008da030 void Menu_KeyConfig::update_gamepad_layout() { void *pvVar1; char isPressed; uint uVar2; int iVar3; int iVar4; MenuManager *menuManager; float viewY; int *device; int *deviceRefCount; int *local_20; int local_1c [3]; void *local_10; undefined1 *puStack_c; int local_8; Manager *manager; undefined4 menuAction; iVar4 = g_menuControllerIndex; local_8 = 0xffffffff; puStack_c = &LAB_00b0609d; local_10 = ExceptionList; uVar2 = __security_cookie ^ GHIDRA_UINT((local_1c + 6)); ExceptionList = &local_10; (GHIDRA_CAST((&PTR_vftable_00c57b18)))->InputManager::get_device(&device,g_menuControllerIndex); local_8 = 0; if (device == GHIDRA_CAST(0x0)) goto LAB_008da4aa; if ((char)this->State == '\0') { local_1c[2] = 0xe; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar4,FUN_00a209e0,local_1c + 2,0); if (isPressed == '\0') { local_1c[2] = 0xe; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a209e0,local_1c + 2,0,0); if (isPressed != '\0') goto LAB_008da335; local_1c[2] = 0xf; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar4,FUN_00a209e0,local_1c + 2,0,0); if (isPressed != '\0') { LAB_008da305: manager = g_manager; this->SelectedElement = 0; *GHIDRA_CAST(&this->State) = 0; g_menuControllerIndex = 0; manager->_isHotkeysEnabled = 1; FUN_0098aec0(); Manager::apply_device_key_config(iVar4); goto LAB_008da445; } local_1c[1] = 0xf; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a209e0,local_1c + 1,0,0); if (isPressed != '\0') goto LAB_008da305; local_1c[1] = 0x16; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar4,FUN_00a209e0,local_1c + 1,0,0); if (isPressed != '\0') { LAB_008da2db: menuManager = g_menuManager; if (this->SelectedElement == 0) { viewY = -2304.0; this->SelectedElement = 0x14; goto LAB_008da439; } iVar3 = this->SelectedElement + -1; this->SelectedElement = iVar3; goto LAB_008da3f8; } local_1c[2] = 0x16; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a209e0,local_1c + 2,0,0); if (isPressed != '\0') goto LAB_008da2db; local_1c[0] = 0x17; isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar4,FUN_00a209e0,local_1c,0,0); if (isPressed == '\0') { local_20 = GHIDRA_CAST(&DAT_00000017); isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a209e0,&local_20,0,0); if (isPressed == '\0') { local_20 = GHIDRA_CAST(&DAT_00000014); isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar4,FUN_00a209e0,&local_20,0,0); if (isPressed == '\0') { local_20 = GHIDRA_CAST(&DAT_00000014); isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a209e0,&local_20,0,0); if (isPressed == '\0') { local_20 = GHIDRA_CAST(0x15); isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74)) (iVar4,FUN_00a209e0,&local_20,0,0); if (isPressed == '\0') { local_20 = GHIDRA_CAST(0x15); isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a209e0,&local_20,0,0) ; if (isPressed == '\0') goto LAB_008da445; } this->SelectedColumn = 0; goto LAB_008da445; } } this->SelectedColumn = 1; goto LAB_008da445; } } menuManager = g_menuManager; if (this->SelectedElement != 0x14) { iVar3 = this->SelectedElement + 1; this->SelectedElement = iVar3; goto LAB_008da3f8; } viewY = -1890.0; this->SelectedElement = 0; goto LAB_008da439; } LAB_008da335: if (this->SelectedElement == 0x14) { (**(code **)(*device + 0x14))(); } else { *GHIDRA_CAST(&this->State) = 1; } } else { iVar4 = (**(code **)(*device + 0x3c))(0,uVar2); if (iVar4 == -1) goto LAB_008da445; *GHIDRA_CAST(&this->State) = 0; local_20 = device; uVar2 = (&DAT_00b24060)[this->SelectedElement]; local_1c[0] = this->SelectedColumn; iVar3 = device[4]; if (GHIDRA_UINT((device[5] - iVar3 >> 4)) <= uVar2) { KAGE_LogMessage(0x10,GHIDRA_CAST("ActionId is out of range\n")); iVar3 = local_20[4]; } *GHIDRA_CAST((uVar2 * 0x10 + iVar3 + local_1c[0] * 4)) = iVar4; switch(uVar2) { case 0: menuAction = 0x14; break; case 1: menuAction = 0x15; break; case 2: menuAction = 0x16; break; case 3: menuAction = 0x17; break; default: goto switchD_008da3b6_caseD_4; case 0xc: menuAction = 0x13; } FUN_00a24330(this->SelectedColumn,menuAction,iVar4); switchD_008da3b6_caseD_4: iVar4 = this->SelectedElement + 1; iVar3 = this->SelectedElement; if (iVar4 < 0x14) { this->SelectedElement = iVar4; iVar3 = iVar4; } menuManager = g_menuManager; LAB_008da3f8: if (iVar3 < 3) { viewY = -1890.0; } else if (iVar3 < 0x13) { viewY = -1890.0 - ((float)iVar3 - 2.0) * 23.0; } else { viewY = -2304.0; } LAB_008da439: menuManager->_viewPositionSet[0xc].y = viewY; menuManager->_state = 1; } LAB_008da445: if (((this->KeyConfigSprite)._animState._animData != (void *)0x0) && ((6 < *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._animState._animation) + 0x80)) || (KAGE_LogMessage(0x10,GHIDRA_CAST("LayerId out of bounds\n")), 6 < *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._animState._animation) + 0x80)))))) { pvVar1 = (this->KeyConfigSprite)._animState._animData; iVar4 = *GHIDRA_CAST((GHIDRA_CAST(pvVar1) + 0x50)); if ((pvVar1 == (void *)0x0) || ((iVar4 < 0 || (*GHIDRA_CAST((GHIDRA_CAST(pvVar1) + 0x1c)) <= iVar4)))) { KAGE_LogMessage(0x10,GHIDRA_CAST("id out of bounds\n")); } *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._animState._layerFrames) + iVar4 * 4)) = 0; (GHIDRA_CAST((&(this->KeyConfigSprite)._animState)))->AnimationState::AdvanceLayerPosition(iVar4,0.0); } LAB_008da4aa: local_8 = 1; if (((deviceRefCount != GHIDRA_CAST(0x0)) && (isPressed = (**(code **)(*deviceRefCount + 0xc))(), isPressed != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&device); } ExceptionList = local_10; return; } // 008da510 void Menu_KeyConfig::render_gamepad_layout() { char **ppcVar1; byte bVar2; char isLastRef; uint uVar3; byte *buttonName; LayerState *highlightLayer; void *pvVar4; byte *pbVar5; byte *idleNameIter; char *idleUDNameIter; AnimationLayer *animLayer; int currentRow; ANM2 *layerAnimState; bool isLess; float rowBaseY; float x; float local_XMM1_Da_745; undefined4 defaultColor [8]; undefined4 defaultOffsetR; undefined4 defaultOffsetG; undefined4 defaultOffsetB; undefined4 editColor [8]; undefined4 editOffsetR; undefined4 editOffsetG; undefined4 editOffsetB; KColor textColor; KColor drawColor; Vector editCursorPos; int secondaryButton; int primaryButton; undefined4 drawParams; undefined4 local_c0; undefined4 local_bc; undefined4 local_b8; undefined4 local_b4; undefined4 local_b0; undefined4 local_ac; ANM2 *local_a8; float buttonTextX; int rowOffsetY; int *local_9c; int *deviceRefCount; float originY; float originX; Vector cursorPos; int *local_84; int row; Font *font; char *actionLabels [4]; char *shootUpLabel; char *shootDownLabel; char *shootLeftLabel; char *shootRightLabel; char *bombLabel; char *itemLabel; char *pillCardLabel; char *dropLabel; char *mapLabel; char *emoteLabel; char *descriptionsLabel; char *pauseJoinLabel; char *menuConfirmLabel; char *menuBackLabel; char *menuLLabel; char *menuRLabel; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; char *local_14; int layerIndex; ColorMod *spriteColor; puStack_20 = GHIDRA_CAST((actionLabels + 0x1d)); local_14 = GHIDRA_CAST(0xffffffff); puStack_18 = &LAB_00b060f1; local_1c = ExceptionList; local_24 = __security_cookie ^ GHIDRA_UINT((actionLabels + 0x1a)); ExceptionList = &local_1c; if (((this->KeyConfigSprite)._animState._animData == (void *)0x0) || ((this->KeyConfigSprite)._animState._isPlaying == 0)) { LAB_008da599: buttonName = (this->KeyConfigSprite)._animState._animData; if (buttonName != GHIDRA_CAST(0x0)) { pbVar5 = buttonName; if (0xf < *GHIDRA_CAST((buttonName + 0x14))) { pbVar5 = *GHIDRA_CAST(buttonName); } idleNameIter = s_Idle; do { bVar2 = *pbVar5; isLess = bVar2 < *idleNameIter; if (bVar2 != *idleNameIter) { LAB_008da5d0: uVar3 = -GHIDRA_UINT(isLess) | 1; goto LAB_008da5d5; } if (bVar2 == 0) break; bVar2 = pbVar5[1]; isLess = bVar2 < idleNameIter[1]; if (bVar2 != idleNameIter[1]) goto LAB_008da5d0; pbVar5 = pbVar5 + 2; idleNameIter = idleNameIter + 2; } while (bVar2 != 0); uVar3 = 0; LAB_008da5d5: if ((uVar3 == 0) && ((ppcVar1 = actionLabels + 0x1d, buttonName[0x34] == 0 || (ppcVar1 = actionLabels + 0x1d, (this->KeyConfigSprite)._animState._isPlaying != 0)))) goto LAB_008da609; } bVar2 = (GHIDRA_CAST((&this->KeyConfigSprite)))->ANM2::SetAnimation(s_Idle,1); ppcVar1 = GHIDRA_CAST(puStack_20); if (bVar2 != 0) { (GHIDRA_CAST((&(this->KeyConfigSprite)._animState)))->AnimationState::Rewind(); (this->KeyConfigSprite)._animState._isPlaying = 1; ppcVar1 = GHIDRA_CAST(puStack_20); } } else { buttonName = (this->KeyConfigSprite)._animState._animData; if (0xf < *GHIDRA_CAST((buttonName + 0x14))) { buttonName = *GHIDRA_CAST(buttonName); } pbVar5 = s_Idle; do { bVar2 = *buttonName; isLess = bVar2 < *pbVar5; if (bVar2 != *pbVar5) { LAB_008da590: uVar3 = -GHIDRA_UINT(isLess) | 1; goto LAB_008da595; } if (bVar2 == 0) break; bVar2 = buttonName[1]; isLess = bVar2 < pbVar5[1]; if (bVar2 != pbVar5[1]) goto LAB_008da590; buttonName = buttonName + 2; pbVar5 = pbVar5 + 2; } while (bVar2 != 0); uVar3 = 0; LAB_008da595: ppcVar1 = actionLabels + 0x1d; if (uVar3 != 0) goto LAB_008da599; } LAB_008da609: puStack_20 = GHIDRA_CAST(ppcVar1); if (((this->KeyConfigSprite)._animState._animData == (void *)0x0) || ((this->KeyConfigSprite)._animState._isPlaying == 0)) { LAB_008da64e: buttonName = (this->KeyConfigSprite)._animState._animData; if (buttonName != GHIDRA_CAST(0x0)) { pbVar5 = buttonName; if (0xf < *GHIDRA_CAST((buttonName + 0x14))) { pbVar5 = *GHIDRA_CAST(buttonName); } idleUDNameIter = "IdleUD"; do { bVar2 = *pbVar5; isLess = bVar2 < (byte)*idleUDNameIter; if (bVar2 != *idleUDNameIter) { LAB_008da684: uVar3 = -GHIDRA_UINT(isLess) | 1; goto LAB_008da689; } if (bVar2 == 0) break; bVar2 = pbVar5[1]; isLess = bVar2 < (byte)idleUDNameIter[1]; if (bVar2 != idleUDNameIter[1]) goto LAB_008da684; pbVar5 = pbVar5 + 2; idleUDNameIter = idleUDNameIter + 2; } while (bVar2 != 0); uVar3 = 0; LAB_008da689: if ((uVar3 == 0) && ((buttonName[0x34] == 0 || ((this->KeyConfigSprite)._animState._isPlaying != 0)))) goto LAB_008da6bd; } bVar2 = (GHIDRA_CAST((&this->KeyConfigSprite)))->ANM2::SetAnimation(GHIDRA_CAST("IdleUD"),1); if (bVar2 != 0) { (GHIDRA_CAST((&(this->KeyConfigSprite)._animState)))->AnimationState::Rewind(); (this->KeyConfigSprite)._animState._isPlaying = 1; } } else { buttonName = (this->KeyConfigSprite)._animState._animData; if (0xf < *GHIDRA_CAST((buttonName + 0x14))) { buttonName = *GHIDRA_CAST(buttonName); } idleUDNameIter = "IdleUD"; do { bVar2 = *buttonName; isLess = bVar2 < (byte)*idleUDNameIter; if (bVar2 != *idleUDNameIter) { LAB_008da645: uVar3 = -GHIDRA_UINT(isLess) | 1; goto LAB_008da64a; } if (bVar2 == 0) break; bVar2 = buttonName[1]; isLess = bVar2 < (byte)idleUDNameIter[1]; if (bVar2 != idleUDNameIter[1]) goto LAB_008da645; buttonName = buttonName + 2; idleUDNameIter = idleUDNameIter + 2; } while (bVar2 != 0); uVar3 = 0; LAB_008da64a: if (uVar3 != 0) goto LAB_008da64e; } LAB_008da6bd: originX = (g_menuManager->_ViewPosition).x + this->PositionX; originY = (g_menuManager->_ViewPosition).y + this->PositionY; (GHIDRA_CAST((&textColor)))->KColor::SetFromARGB(0xff362f2d); font = &g_manager->_font2_TeamMeatEx12; actionLabels[0] = "#INPUT_WALK_UP"; actionLabels[1] = "#INPUT_WALK_DOWN"; actionLabels[2] = "#INPUT_WALK_LEFT"; actionLabels[3] = "#INPUT_WALK_RIGHT"; shootUpLabel = "#INPUT_SHOOT_UP"; shootDownLabel = "#INPUT_SHOOT_DOWN"; shootLeftLabel = "#INPUT_SHOOT_LEFT"; shootRightLabel = "#INPUT_SHOOT_RIGHT"; bombLabel = "#INPUT_BOMB"; itemLabel = "#INPUT_ITEM"; pillCardLabel = "#INPUT_PILL_CARD"; dropLabel = "#INPUT_DROP"; mapLabel = "#INPUT_MAP"; emoteLabel = "#INPUT_EMOTE"; descriptionsLabel = "#INPUT_DESCRIPTIONS"; pauseJoinLabel = "#INPUT_PAUSE_JOIN"; menuConfirmLabel = "#INPUT_MENU_CONFIRM"; menuBackLabel = "#INPUT_MENU_BACK"; menuLLabel = "#INPUT_MENU_L"; menuRLabel = "#INPUT_MENU_R"; (GHIDRA_CAST((&PTR_vftable_00c57b18)))->InputManager::get_device(&local_9c,g_menuControllerIndex); local_14 = GHIDRA_CAST(0x0); local_84 = local_9c; if (local_9c == GHIDRA_CAST(0x0)) goto LAB_008db021; rowBaseY = originY + 58.0; row = 0; rowOffsetY = 0; x = originX + 80.0; local_XMM1_Da_745 = originX + 410.0; local_a8 = GHIDRA_CAST((originX + 300.0)); do { layerIndex = local_9c[4]; uVar3 = (&DAT_00b24060)[row]; if (GHIDRA_UINT((local_9c[5] - layerIndex >> 4)) <= uVar3) { local_84 = local_9c; KAGE_LogMessage(0x10,GHIDRA_CAST("ActionId is out of range\n")); layerIndex = local_84[4]; } currentRow = row; primaryButton = *GHIDRA_CAST((layerIndex + uVar3 * 0x10)); secondaryButton = *GHIDRA_CAST((layerIndex + 4 + uVar3 * 0x10)); if ((primaryButton == -1) && (secondaryButton == -1)) { drawColor._red = 0.8; drawColor._green = 0.2; drawColor._blue = 0.2; drawColor._alpha = 1.0; drawColor._unk = 0; } else { drawColor._unk = textColor._unk; drawColor._red = textColor._red; drawColor._green = textColor._green; drawColor._blue = textColor._blue; drawColor._alpha = textColor._alpha; } drawParams = 0; local_c0 = 0xffff; local_bc = 0; local_b8 = 0x3f800000; local_b4 = 0xffffffff; local_b0 = 0; local_ac = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 1; buttonName = string_table_translate(&g_manager->_stringTable,GHIDRA_CAST(actionLabels[row])); local_84 = GHIDRA_CAST(((float)rowOffsetY + rowBaseY)); (GHIDRA_CAST((font)))->Font::DrawString(buttonName,&drawColor,&drawParams,x,(float)local_84); drawParams = 0; local_c0 = 0xffff; local_bc = 0; local_b8 = 0x3f800000; local_b4 = 0xffffffff; local_b0 = 0; local_ac = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 2; buttonName = GHIDRA_CAST((**(code **)(*local_9c + 0x10))(primaryButton)); layerIndex = (GHIDRA_CAST((font)))->Font::get_string_width_n(buttonName,-1); buttonTextX = local_XMM1_Da_745 - (float)((double)layerIndex + __uint_to_double_fixup[-(layerIndex >> 0x1f)]); buttonName = GHIDRA_CAST((**(code **)(*local_9c + 0x10))(primaryButton)); (GHIDRA_CAST((font)))->Font::DrawString(buttonName,&drawColor,&drawParams,buttonTextX,(float)local_84); drawParams = 0; local_c0 = 0xffff; local_bc = 0; local_b8 = 0x3f800000; local_b4 = 0xffffffff; local_b0 = 0; local_ac = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 3; buttonName = GHIDRA_CAST((**(code **)(*local_9c + 0x10))(secondaryButton)); layerIndex = (GHIDRA_CAST((font)))->Font::get_string_width_n(buttonName,-1); buttonTextX = (float)local_a8 - (float)((double)layerIndex + __uint_to_double_fixup[-(layerIndex >> 0x1f)]); buttonName = GHIDRA_CAST((**(code **)(*local_9c + 0x10))(secondaryButton)); (GHIDRA_CAST((font)))->Font::DrawString(buttonName,&drawColor,&drawParams,buttonTextX,(float)local_84); local_14 = GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_UINT(local_14))) + 0x1))) << 8)); layerIndex = this->SelectedElement; if (currentRow == layerIndex) { highlightLayer = (GHIDRA_CAST((&this->KeyConfigSprite)))->ANM2::GetLayer(&DAT_00000006); highlightLayer->_visible = 1; (this->KeyConfigSprite)._flipX = 1; if ((char)this->State == '\0') { layerIndex = this->SelectedColumn * 0x6e; cursorPos.x = (490.0 - (float)((double)layerIndex + __uint_to_double_fixup[-(layerIndex >> 0x1f)])) + originX; cursorPos.y = (float)currentRow * 23.0 + 2.0 + originY; if ((this->KeyConfigSprite)._loaded != 0) { if ((this->KeyConfigSprite)._overlayRenderFirst == 0) { pvVar4 = (this->KeyConfigSprite)._animState._animData; if (((pvVar4 != (void *)0x0) && (6 < *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._animState._animation) + 0x80)))) && (layerIndex = *GHIDRA_CAST((GHIDRA_CAST(pvVar4) + 0x50)), -1 < layerIndex)) { AnimationLayer::RenderFrame (GHIDRA_CAST((layerIndex * 0x10 + *GHIDRA_CAST((GHIDRA_CAST(pvVar4) + 0x18)))), &cursorPos, *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._animState._layerFrames) + layerIndex * 4)),&g_vectorZero,&g_vectorZero, (this->KeyConfigSprite)._animState._animation); } pvVar4 = (this->KeyConfigSprite)._overlayAnimState._animData; if (((pvVar4 != (void *)0x0) && (6 < *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._overlayAnimState._animation) + 0x80)))) && (layerIndex = *GHIDRA_CAST((GHIDRA_CAST(pvVar4) + 0x50)), -1 < layerIndex)) { AnimationLayer::RenderFrame (GHIDRA_CAST((layerIndex * 0x10 + *GHIDRA_CAST((GHIDRA_CAST(pvVar4) + 0x18)))), &cursorPos, *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._overlayAnimState._layerFrames) + layerIndex * 4)),&g_vectorZero,&g_vectorZero, (this->KeyConfigSprite)._overlayAnimState._animation); } } else { pvVar4 = (this->KeyConfigSprite)._overlayAnimState._animData; if (((pvVar4 != (void *)0x0) && (6 < *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._overlayAnimState._animation) + 0x80)))) && (layerIndex = *GHIDRA_CAST((GHIDRA_CAST(pvVar4) + 0x50)), -1 < layerIndex)) { AnimationLayer::RenderFrame (GHIDRA_CAST((layerIndex * 0x10 + *GHIDRA_CAST((GHIDRA_CAST(pvVar4) + 0x18)))), &cursorPos, *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._overlayAnimState._layerFrames) + layerIndex * 4)),&g_vectorZero,&g_vectorZero, (this->KeyConfigSprite)._overlayAnimState._animation); } pvVar4 = (this->KeyConfigSprite)._animState._animData; if (((pvVar4 != (void *)0x0) && (6 < *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._animState._animation) + 0x80)))) && (layerIndex = *GHIDRA_CAST((GHIDRA_CAST(pvVar4) + 0x50)), -1 < layerIndex)) { AnimationLayer::RenderFrame (GHIDRA_CAST((layerIndex * 0x10 + *GHIDRA_CAST((GHIDRA_CAST(pvVar4) + 0x18)))), &cursorPos, *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._animState._layerFrames) + layerIndex * 4)),&g_vectorZero,&g_vectorZero, (this->KeyConfigSprite)._animState._animation); } } } } else { spriteColor = &(this->KeyConfigSprite)._color; editOffsetR = 0x3f2fafb0; editOffsetG = 0; editOffsetB = 0; if (spriteColor != GHIDRA_CAST(editColor)) { (this->KeyConfigSprite)._color._colorize[0] = 0.0; (this->KeyConfigSprite)._color._colorize[1] = 0.0; (this->KeyConfigSprite)._color._colorize[2] = 0.0; (this->KeyConfigSprite)._color._colorize[3] = 0.0; (this->KeyConfigSprite)._color._offset[0] = 0.6862745; (this->KeyConfigSprite)._color._offset[1] = 0.0; spriteColor->_tint[0] = 1.0; (this->KeyConfigSprite)._color._tint[1] = 1.0; (this->KeyConfigSprite)._color._tint[2] = 1.0; (this->KeyConfigSprite)._color._tint[3] = 1.0; (this->KeyConfigSprite)._color._offset[2] = 0.0; } layerIndex = this->SelectedColumn * 0x6e; editCursorPos.x = (490.0 - (float)((double)layerIndex + __uint_to_double_fixup[-(layerIndex >> 0x1f)])) + originX; editCursorPos.y = (float)row * 23.0 + 2.0 + originY; if ((this->KeyConfigSprite)._loaded != 0) { if ((this->KeyConfigSprite)._overlayRenderFirst == 0) { pvVar4 = (this->KeyConfigSprite)._animState._animData; if (((pvVar4 != (void *)0x0) && (6 < *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._animState._animation) + 0x80)))) && (layerIndex = *GHIDRA_CAST((GHIDRA_CAST(pvVar4) + 0x50)), -1 < layerIndex)) { AnimationLayer::RenderFrame (GHIDRA_CAST((layerIndex * 0x10 + *GHIDRA_CAST((GHIDRA_CAST(pvVar4) + 0x18)))), &editCursorPos, *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._animState._layerFrames) + layerIndex * 4)),&g_vectorZero,&g_vectorZero, (this->KeyConfigSprite)._animState._animation); } pvVar4 = (this->KeyConfigSprite)._overlayAnimState._animData; if (((pvVar4 != (void *)0x0) && (6 < *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._overlayAnimState._animation) + 0x80)))) && (layerIndex = *GHIDRA_CAST((GHIDRA_CAST(pvVar4) + 0x50)), -1 < layerIndex)) { layerAnimState = (this->KeyConfigSprite)._overlayAnimState._animation; animLayer = GHIDRA_CAST((layerIndex * 0x10 + *GHIDRA_CAST((GHIDRA_CAST(pvVar4) + 0x18)))); pvVar4 = (this->KeyConfigSprite)._overlayAnimState._layerFrames; goto LAB_008daca2; } } else { pvVar4 = (this->KeyConfigSprite)._overlayAnimState._animData; if (((pvVar4 != (void *)0x0) && (6 < *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._overlayAnimState._animation) + 0x80)))) && (layerIndex = *GHIDRA_CAST((GHIDRA_CAST(pvVar4) + 0x50)), -1 < layerIndex)) { AnimationLayer::RenderFrame (GHIDRA_CAST((layerIndex * 0x10 + *GHIDRA_CAST((GHIDRA_CAST(pvVar4) + 0x18)))), &editCursorPos, *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._overlayAnimState._layerFrames) + layerIndex * 4)),&g_vectorZero,&g_vectorZero, (this->KeyConfigSprite)._overlayAnimState._animation); } pvVar4 = (this->KeyConfigSprite)._animState._animData; if (((pvVar4 != (void *)0x0) && (6 < *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._animState._animation) + 0x80)))) && (layerIndex = *GHIDRA_CAST((GHIDRA_CAST(pvVar4) + 0x50)), -1 < layerIndex)) { layerAnimState = (this->KeyConfigSprite)._animState._animation; animLayer = GHIDRA_CAST((layerIndex * 0x10 + *GHIDRA_CAST((GHIDRA_CAST(pvVar4) + 0x18)))); pvVar4 = (this->KeyConfigSprite)._animState._layerFrames; LAB_008daca2: AnimationLayer::RenderFrame (animLayer,&editCursorPos,*GHIDRA_CAST((GHIDRA_CAST(pvVar4) + layerIndex * 4)), &g_vectorZero,&g_vectorZero,layerAnimState); } } } defaultOffsetR = 0; defaultOffsetG = 0; defaultOffsetB = 0; if (spriteColor != GHIDRA_CAST(defaultColor)) { (this->KeyConfigSprite)._color._colorize[0] = 0.0; (this->KeyConfigSprite)._color._colorize[1] = 0.0; (this->KeyConfigSprite)._color._colorize[2] = 0.0; (this->KeyConfigSprite)._color._colorize[3] = 0.0; (this->KeyConfigSprite)._color._offset[0] = 0.0; (this->KeyConfigSprite)._color._offset[1] = 0.0; spriteColor->_tint[0] = 1.0; (this->KeyConfigSprite)._color._tint[1] = 1.0; (this->KeyConfigSprite)._color._tint[2] = 1.0; (this->KeyConfigSprite)._color._tint[3] = 1.0; (this->KeyConfigSprite)._color._offset[2] = 0.0; } currentRow = row; } (this->KeyConfigSprite)._flipX = 0; highlightLayer = (GHIDRA_CAST((&this->KeyConfigSprite)))->ANM2::GetLayer(&DAT_00000006); highlightLayer->_visible = 0; layerIndex = this->SelectedElement; } rowOffsetY = rowOffsetY + 0x17; row = currentRow + 1; } while (row < 0x14); if (layerIndex != 0x14) goto LAB_008db021; local_a8 = &this->KeyConfigSprite; highlightLayer = (GHIDRA_CAST((local_a8)))->ANM2::GetLayer(&DAT_00000006); cursorPos.x = originX + 75.0; cursorPos.y = originY + 430.0; highlightLayer->_visible = 1; if ((this->KeyConfigSprite)._loaded != 0) { if ((this->KeyConfigSprite)._overlayRenderFirst == 0) { pvVar4 = (this->KeyConfigSprite)._animState._animData; if (((pvVar4 != (void *)0x0) && (layerAnimState = (this->KeyConfigSprite)._animState._animation, 6 < layerAnimState->_layerCount)) && (layerIndex = *GHIDRA_CAST((GHIDRA_CAST(pvVar4) + 0x50)), -1 < layerIndex)) { AnimationLayer::RenderFrame (GHIDRA_CAST((layerIndex * 0x10 + *GHIDRA_CAST((GHIDRA_CAST(pvVar4) + 0x18)))),&cursorPos, *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._animState._layerFrames) + layerIndex * 4)), &g_vectorZero,&g_vectorZero,layerAnimState); } pvVar4 = (this->KeyConfigSprite)._overlayAnimState._animData; if (((pvVar4 != (void *)0x0) && (layerAnimState = (this->KeyConfigSprite)._overlayAnimState._animation, 6 < layerAnimState->_layerCount)) && (layerIndex = *GHIDRA_CAST((GHIDRA_CAST(pvVar4) + 0x50)), -1 < layerIndex)) { animLayer = GHIDRA_CAST((layerIndex * 0x10 + *GHIDRA_CAST((GHIDRA_CAST(pvVar4) + 0x18)))); pvVar4 = (this->KeyConfigSprite)._overlayAnimState._layerFrames; goto LAB_008daff9; } } else { pvVar4 = (this->KeyConfigSprite)._overlayAnimState._animData; if (((pvVar4 != (void *)0x0) && (layerAnimState = (this->KeyConfigSprite)._overlayAnimState._animation, 6 < layerAnimState->_layerCount)) && (layerIndex = *GHIDRA_CAST((GHIDRA_CAST(pvVar4) + 0x50)), -1 < layerIndex)) { AnimationLayer::RenderFrame (GHIDRA_CAST((layerIndex * 0x10 + *GHIDRA_CAST((GHIDRA_CAST(pvVar4) + 0x18)))),&cursorPos, *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._overlayAnimState._layerFrames) + layerIndex * 4)),&g_vectorZero,&g_vectorZero,layerAnimState); } pvVar4 = (this->KeyConfigSprite)._animState._animData; if (((pvVar4 != (void *)0x0) && (layerAnimState = (this->KeyConfigSprite)._animState._animation, 6 < layerAnimState->_layerCount)) && (layerIndex = *GHIDRA_CAST((GHIDRA_CAST(pvVar4) + 0x50)), -1 < layerIndex)) { animLayer = GHIDRA_CAST((layerIndex * 0x10 + *GHIDRA_CAST((GHIDRA_CAST(pvVar4) + 0x18)))); pvVar4 = (this->KeyConfigSprite)._animState._layerFrames; LAB_008daff9: AnimationLayer::RenderFrame (animLayer,&cursorPos,*GHIDRA_CAST((GHIDRA_CAST(pvVar4) + layerIndex * 4)),&g_vectorZero, &g_vectorZero,layerAnimState); } } } highlightLayer = (GHIDRA_CAST((local_a8)))->ANM2::GetLayer(&DAT_00000006); highlightLayer->_visible = 0; LAB_008db021: local_14 = GHIDRA_CAST(0x4); if (((deviceRefCount != GHIDRA_CAST(0x0)) && (isLastRef = (**(code **)(*deviceRefCount + 0xc))(), isLastRef != '\0')) && (g_inputDeviceRelease != (void *)0x0)) { (*g_inputDeviceRelease)(&local_9c); } ExceptionList = local_1c; return; }