summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author R. Belmont <rb6502@users.noreply.github.com>2023-01-04 23:29:18 -0500
committer GitHub <noreply@github.com>2023-01-04 23:29:18 -0500
commit94b1e168b2b97b48b81f7a8f64406b0a6f64184e (patch)
treef57362a0fa01bfe8f0ad75a447c4c9e10bc15756 /src
parent5581eaa50a42256242f32569f59ce10d70ddd8c2 (diff)
Revert "Update BGFX, BX and BIMG (#10750)" (#10787)
This reverts commit 5581eaa50a42256242f32569f59ce10d70ddd8c2 due to link failure on macOS.
Diffstat (limited to 'src')
-rw-r--r--src/osd/modules/debugger/debugimgui.cpp119
-rw-r--r--src/osd/modules/render/bgfx/chainmanager.cpp3
-rw-r--r--src/osd/modules/render/bgfx/effectmanager.cpp3
-rw-r--r--src/osd/modules/render/bgfx/shadermanager.cpp6
4 files changed, 55 insertions, 76 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;
diff --git a/src/osd/modules/render/bgfx/chainmanager.cpp b/src/osd/modules/render/bgfx/chainmanager.cpp
index 3d5e3f6a482..2ae3d9a3daf 100644
--- a/src/osd/modules/render/bgfx/chainmanager.cpp
+++ b/src/osd/modules/render/bgfx/chainmanager.cpp
@@ -181,9 +181,8 @@ bgfx_chain* chain_manager::load_chain(std::string name, uint32_t screen_index)
int32_t size(bx::getSize(&reader));
- bx::ErrorAssert err;
char* data = new char[size + 1];
- bx::read(&reader, reinterpret_cast<void*>(data), size, &err);
+ bx::read(&reader, reinterpret_cast<void*>(data), size);
bx::close(&reader);
data[size] = 0;
diff --git a/src/osd/modules/render/bgfx/effectmanager.cpp b/src/osd/modules/render/bgfx/effectmanager.cpp
index ba86e00adf0..33e056b45fe 100644
--- a/src/osd/modules/render/bgfx/effectmanager.cpp
+++ b/src/osd/modules/render/bgfx/effectmanager.cpp
@@ -43,10 +43,9 @@ static bool prepare_effect_document(std::string &name, osd_options &options, rap
return false;
}
- bx::ErrorAssert err;
int32_t size (bx::getSize(&reader));
char* data = new char[size + 1];
- bx::read(&reader, reinterpret_cast<void*>(data), size, &err);
+ bx::read(&reader, reinterpret_cast<void*>(data), size);
bx::close(&reader);
data[size] = 0;
diff --git a/src/osd/modules/render/bgfx/shadermanager.cpp b/src/osd/modules/render/bgfx/shadermanager.cpp
index aafd704a30c..11e298a4e7a 100644
--- a/src/osd/modules/render/bgfx/shadermanager.cpp
+++ b/src/osd/modules/render/bgfx/shadermanager.cpp
@@ -65,12 +65,11 @@ bool shader_manager::is_shader_present(osd_options &options, std::string name)
std::string shader_path = make_path_string(options, name);
std::string file_name = shader_path + name + ".bin";
bx::FileReader reader;
- bx::ErrorAssert err;
if (bx::open(&reader, file_name.c_str()))
{
uint32_t expected_size(bx::getSize(&reader));
uint8_t *data = new uint8_t[expected_size];
- uint32_t read_size = (uint32_t)bx::read(&reader, data, expected_size, &err);
+ uint32_t read_size = (uint32_t)bx::read(&reader, data, expected_size);
delete [] data;
bx::close(&reader);
@@ -128,10 +127,9 @@ const bgfx::Memory* shader_manager::load_mem(std::string name)
bx::FileReader reader;
if (bx::open(&reader, name.c_str()))
{
- bx::ErrorAssert err;
uint32_t size(bx::getSize(&reader));
const bgfx::Memory* mem = bgfx::alloc(size + 1);
- bx::read(&reader, mem->data, size, &err);
+ bx::read(&reader, mem->data, size);
bx::close(&reader);
mem->data[mem->size - 1] = '\0';