diff options
author | 2023-01-04 23:29:18 -0500 | |
---|---|---|
committer | 2023-01-04 23:29:18 -0500 | |
commit | 94b1e168b2b97b48b81f7a8f64406b0a6f64184e (patch) | |
tree | f57362a0fa01bfe8f0ad75a447c4c9e10bc15756 /src/osd/modules/debugger/debugimgui.cpp | |
parent | 5581eaa50a42256242f32569f59ce10d70ddd8c2 (diff) |
Revert "Update BGFX, BX and BIMG (#10750)" (#10787)
This reverts commit 5581eaa50a42256242f32569f59ce10d70ddd8c2 due to link failure on macOS.
Diffstat (limited to 'src/osd/modules/debugger/debugimgui.cpp')
-rw-r--r-- | src/osd/modules/debugger/debugimgui.cpp | 119 |
1 files changed, 51 insertions, 68 deletions
diff --git a/src/osd/modules/debugger/debugimgui.cpp b/src/osd/modules/debugger/debugimgui.cpp index 6221b435f2f..5f087f70a2e 100644 --- a/src/osd/modules/debugger/debugimgui.cpp +++ b/src/osd/modules/debugger/debugimgui.cpp @@ -203,7 +203,6 @@ private: file_entry* m_selected_file; int m_format_sel; char m_path[1024]; // path text field buffer - std::unordered_map<input_item_id,ImGuiKey> m_mapping; }; // globals @@ -351,11 +350,10 @@ void debug_imgui::handle_keys() for(input_item_id id = ITEM_ID_A; id <= ITEM_ID_CANCEL; ++id) { - if(m_machine->input().code_pressed(input_code(DEVICE_CLASS_KEYBOARD, 0, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, id))) { - if (m_mapping.count(id)) io.AddKeyEvent(m_mapping[id], true); - } else { - if (m_mapping.count(id)) io.AddKeyEvent(m_mapping[id], false); - } + if(m_machine->input().code_pressed(input_code(DEVICE_CLASS_KEYBOARD, 0, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, id))) + io.KeysDown[id] = true; + else + io.KeysDown[id] = false; } m_key_char = 0; @@ -374,9 +372,9 @@ void debug_imgui::handle_keys() } // global keys - if(ImGui::IsKeyPressed(ImGuiKey_F3,false)) + if(ImGui::IsKeyPressed(ITEM_ID_F3,false)) { - if(ImGui::IsKeyDown(ImGuiKey_LeftShift)) + if(ImGui::IsKeyDown(ITEM_ID_LSHIFT)) m_machine->schedule_hard_reset(); else { @@ -385,44 +383,44 @@ void debug_imgui::handle_keys() } } - if(ImGui::IsKeyPressed(ImGuiKey_F5,false)) + if(ImGui::IsKeyPressed(ITEM_ID_F5,false)) { m_machine->debugger().console().get_visible_cpu()->debug()->go(); m_running = true; } - if(ImGui::IsKeyPressed(ImGuiKey_F6,false)) + if(ImGui::IsKeyPressed(ITEM_ID_F6,false)) { m_machine->debugger().console().get_visible_cpu()->debug()->go_next_device(); m_running = true; } - if(ImGui::IsKeyPressed(ImGuiKey_F7,false)) + if(ImGui::IsKeyPressed(ITEM_ID_F7,false)) { m_machine->debugger().console().get_visible_cpu()->debug()->go_interrupt(); m_running = true; } - if(ImGui::IsKeyPressed(ImGuiKey_F8,false)) + if(ImGui::IsKeyPressed(ITEM_ID_F8,false)) m_machine->debugger().console().get_visible_cpu()->debug()->go_vblank(); - if(ImGui::IsKeyPressed(ImGuiKey_F9,false)) + if(ImGui::IsKeyPressed(ITEM_ID_F9,false)) m_machine->debugger().console().get_visible_cpu()->debug()->single_step_out(); - if(ImGui::IsKeyPressed(ImGuiKey_F10,false)) + if(ImGui::IsKeyPressed(ITEM_ID_F10,false)) m_machine->debugger().console().get_visible_cpu()->debug()->single_step_over(); - if(ImGui::IsKeyPressed(ImGuiKey_F11,false)) + if(ImGui::IsKeyPressed(ITEM_ID_F11,false)) m_machine->debugger().console().get_visible_cpu()->debug()->single_step(); - if(ImGui::IsKeyPressed(ImGuiKey_F12,false)) + if(ImGui::IsKeyPressed(ITEM_ID_F12,false)) { m_machine->debugger().console().get_visible_cpu()->debug()->go(); m_hide = true; } - if(ImGui::IsKeyPressed(ImGuiKey_D,false) && ImGui::IsKeyDown(ImGuiKey_LeftCtrl)) + if(ImGui::IsKeyPressed(ITEM_ID_D,false) && ImGui::IsKeyDown(ITEM_ID_LCONTROL)) add_disasm(++m_win_count); - if(ImGui::IsKeyPressed(ImGuiKey_M,false) && ImGui::IsKeyDown(ImGuiKey_LeftCtrl)) + if(ImGui::IsKeyPressed(ITEM_ID_M,false) && ImGui::IsKeyDown(ITEM_ID_LCONTROL)) add_memory(++m_win_count); - if(ImGui::IsKeyPressed(ImGuiKey_B,false) && ImGui::IsKeyDown(ImGuiKey_LeftCtrl)) + if(ImGui::IsKeyPressed(ITEM_ID_B,false) && ImGui::IsKeyDown(ITEM_ID_LCONTROL)) add_bpoints(++m_win_count); - if(ImGui::IsKeyPressed(ImGuiKey_W,false) && ImGui::IsKeyDown(ImGuiKey_LeftCtrl)) + if(ImGui::IsKeyPressed(ITEM_ID_W,false) && ImGui::IsKeyDown(ITEM_ID_LCONTROL)) add_wpoints(++m_win_count); - if(ImGui::IsKeyPressed(ImGuiKey_L,false) && ImGui::IsKeyDown(ImGuiKey_LeftCtrl)) + if(ImGui::IsKeyPressed(ITEM_ID_L,false) && ImGui::IsKeyDown(ITEM_ID_LCONTROL)) add_log(++m_win_count); } @@ -445,38 +443,38 @@ void debug_imgui::handle_keys_views() return; // pass keypresses to debug view with focus - if(ImGui::IsKeyPressed(ImGuiKey_UpArrow)) + if(ImGui::IsKeyPressed(ITEM_ID_UP)) focus_view->view->process_char(DCH_UP); - if(ImGui::IsKeyPressed(ImGuiKey_DownArrow)) + if(ImGui::IsKeyPressed(ITEM_ID_DOWN)) focus_view->view->process_char(DCH_DOWN); - if(ImGui::IsKeyPressed(ImGuiKey_LeftArrow)) + if(ImGui::IsKeyPressed(ITEM_ID_LEFT)) { - if(ImGui::IsKeyDown(ImGuiKey_LeftCtrl)) + if(ImGui::IsKeyDown(ITEM_ID_LCONTROL)) focus_view->view->process_char(DCH_CTRLLEFT); else focus_view->view->process_char(DCH_LEFT); } - if(ImGui::IsKeyPressed(ImGuiKey_RightArrow)) + if(ImGui::IsKeyPressed(ITEM_ID_RIGHT)) { - if(ImGui::IsKeyDown(ImGuiKey_LeftCtrl)) + if(ImGui::IsKeyDown(ITEM_ID_LCONTROL)) focus_view->view->process_char(DCH_CTRLRIGHT); else focus_view->view->process_char(DCH_RIGHT); } - if(ImGui::IsKeyPressed(ImGuiKey_PageUp)) + if(ImGui::IsKeyPressed(ITEM_ID_PGUP)) focus_view->view->process_char(DCH_PUP); - if(ImGui::IsKeyPressed(ImGuiKey_PageDown)) + if(ImGui::IsKeyPressed(ITEM_ID_PGDN)) focus_view->view->process_char(DCH_PDOWN); - if(ImGui::IsKeyPressed(ImGuiKey_Home)) + if(ImGui::IsKeyPressed(ITEM_ID_HOME)) { - if(ImGui::IsKeyDown(ImGuiKey_LeftCtrl)) + if(ImGui::IsKeyDown(ITEM_ID_LCONTROL)) focus_view->view->process_char(DCH_CTRLHOME); else focus_view->view->process_char(DCH_HOME); } - if(ImGui::IsKeyPressed(ImGuiKey_End)) + if(ImGui::IsKeyPressed(ITEM_ID_END)) { - if(ImGui::IsKeyDown(ImGuiKey_LeftCtrl)) + if(ImGui::IsKeyDown(ITEM_ID_LCONTROL)) focus_view->view->process_char(DCH_CTRLEND); else focus_view->view->process_char(DCH_END); @@ -553,8 +551,6 @@ int debug_imgui::history_set(ImGuiInputTextCallbackData* data) if(history_pos < view_main_console->console_history.size()) history_pos++; break; - default: - break; } if(history_pos == view_main_console->console_history.size()) @@ -1468,39 +1464,26 @@ void debug_imgui::init_debugger(running_machine &machine) m_has_images = true; // map keys to ImGui inputs - m_mapping[ITEM_ID_A] = ImGuiKey_A; - m_mapping[ITEM_ID_C] = ImGuiKey_C; - m_mapping[ITEM_ID_V] = ImGuiKey_V; - m_mapping[ITEM_ID_X] = ImGuiKey_X; - m_mapping[ITEM_ID_Y] = ImGuiKey_Y; - m_mapping[ITEM_ID_Z] = ImGuiKey_Z; - m_mapping[ITEM_ID_D] = ImGuiKey_D; - m_mapping[ITEM_ID_M] = ImGuiKey_M; - m_mapping[ITEM_ID_B] = ImGuiKey_B; - m_mapping[ITEM_ID_W] = ImGuiKey_W; - m_mapping[ITEM_ID_L] = ImGuiKey_L; - m_mapping[ITEM_ID_BACKSPACE] = ImGuiKey_Backspace; - m_mapping[ITEM_ID_DEL] = ImGuiKey_Delete; - m_mapping[ITEM_ID_TAB] = ImGuiKey_Tab; - m_mapping[ITEM_ID_PGUP] = ImGuiKey_PageUp; - m_mapping[ITEM_ID_PGDN] = ImGuiKey_PageDown; - m_mapping[ITEM_ID_HOME] = ImGuiKey_Home; - m_mapping[ITEM_ID_END] = ImGuiKey_End; - m_mapping[ITEM_ID_ESC] = ImGuiKey_Escape; - m_mapping[ITEM_ID_ENTER] = ImGuiKey_Enter; - m_mapping[ITEM_ID_LEFT] = ImGuiKey_LeftArrow; - m_mapping[ITEM_ID_RIGHT] = ImGuiKey_RightArrow; - m_mapping[ITEM_ID_UP] = ImGuiKey_UpArrow; - m_mapping[ITEM_ID_DOWN] = ImGuiKey_DownArrow; - m_mapping[ITEM_ID_F3] = ImGuiKey_F3; - m_mapping[ITEM_ID_F5] = ImGuiKey_F5; - m_mapping[ITEM_ID_F6] = ImGuiKey_F6; - m_mapping[ITEM_ID_F7] = ImGuiKey_F7; - m_mapping[ITEM_ID_F8] = ImGuiKey_F8; - m_mapping[ITEM_ID_F9] = ImGuiKey_F9; - m_mapping[ITEM_ID_F10] = ImGuiKey_F10; - m_mapping[ITEM_ID_F11] = ImGuiKey_F11; - m_mapping[ITEM_ID_F12] = ImGuiKey_F12; + io.KeyMap[ImGuiKey_A] = ITEM_ID_A; + io.KeyMap[ImGuiKey_C] = ITEM_ID_C; + io.KeyMap[ImGuiKey_V] = ITEM_ID_V; + io.KeyMap[ImGuiKey_X] = ITEM_ID_X; + io.KeyMap[ImGuiKey_C] = ITEM_ID_C; + io.KeyMap[ImGuiKey_Y] = ITEM_ID_Y; + io.KeyMap[ImGuiKey_Z] = ITEM_ID_Z; + io.KeyMap[ImGuiKey_Backspace] = ITEM_ID_BACKSPACE; + io.KeyMap[ImGuiKey_Delete] = ITEM_ID_DEL; + io.KeyMap[ImGuiKey_Tab] = ITEM_ID_TAB; + io.KeyMap[ImGuiKey_PageUp] = ITEM_ID_PGUP; + io.KeyMap[ImGuiKey_PageDown] = ITEM_ID_PGDN; + io.KeyMap[ImGuiKey_Home] = ITEM_ID_HOME; + io.KeyMap[ImGuiKey_End] = ITEM_ID_END; + io.KeyMap[ImGuiKey_Escape] = ITEM_ID_ESC; + io.KeyMap[ImGuiKey_Enter] = ITEM_ID_ENTER; + io.KeyMap[ImGuiKey_LeftArrow] = ITEM_ID_LEFT; + io.KeyMap[ImGuiKey_RightArrow] = ITEM_ID_RIGHT; + io.KeyMap[ImGuiKey_UpArrow] = ITEM_ID_UP; + io.KeyMap[ImGuiKey_DownArrow] = ITEM_ID_DOWN; // set key delay and repeat rates io.KeyRepeatDelay = 0.400f; |