From d45917fcabbbc337116315952dbb84fc9741a972 Mon Sep 17 00:00:00 2001 From: scawful Date: Mon, 18 Nov 2024 16:57:10 -0500 Subject: [PATCH] Update executable source file and improve keybinding naming conventions for clarity --- src/app/app.cmake | 4 ++-- src/app/emu/emulator.h | 40 ++++++++++++++++++++++++++++-------- src/app/{yaze.cc => main.cc} | 0 3 files changed, 34 insertions(+), 10 deletions(-) rename src/app/{yaze.cc => main.cc} (100%) diff --git a/src/app/app.cmake b/src/app/app.cmake index 06ec72fc..a00f9c96 100644 --- a/src/app/app.cmake +++ b/src/app/app.cmake @@ -8,7 +8,7 @@ if (APPLE) add_executable( yaze MACOSX_BUNDLE - app/yaze.cc + app/main.cc app/rom.cc ${YAZE_APP_EMU_SRC} ${YAZE_APP_CORE_SRC} @@ -24,7 +24,7 @@ add_executable( else() add_executable( yaze - app/yaze.cc + app/main.cc app/rom.cc ${YAZE_APP_EMU_SRC} ${YAZE_APP_CORE_SRC} diff --git a/src/app/emu/emulator.h b/src/app/emu/emulator.h index 72891261..2b7d844d 100644 --- a/src/app/emu/emulator.h +++ b/src/app/emu/emulator.h @@ -1,14 +1,13 @@ #ifndef YAZE_APP_CORE_EMULATOR_H #define YAZE_APP_CORE_EMULATOR_H -#include "imgui/imgui.h" - #include #include #include "app/emu/snes.h" #include "app/gui/zeml.h" #include "app/rom.h" +#include "imgui/imgui.h" namespace yaze { namespace app { @@ -19,6 +18,31 @@ namespace app { */ namespace emu { +// case SDLK_z: +// editor.emulator().snes().SetButtonState(1, 0, false); +// case SDLK_a: +// editor.emulator().snes().SetButtonState(1, 1, false); +// case SDLK_RSHIFT: +// editor.emulator().snes().SetButtonState(1, 2, false); +// case SDLK_RETURN: +// editor.emulator().snes().SetButtonState(1, 3, false); +// case SDLK_UP: +// editor.emulator().snes().SetButtonState(1, 4, false); +// case SDLK_DOWN: +// editor.emulator().snes().SetButtonState(1, 5, false); +// case SDLK_LEFT: +// editor.emulator().snes().SetButtonState(1, 6, false); +// case SDLK_RIGHT: +// editor.emulator().snes().SetButtonState(1, 7, false); +// case SDLK_x: +// editor.emulator().snes().SetButtonState(1, 8, false); +// case SDLK_s: +// editor.emulator().snes().SetButtonState(1, 9, false); +// case SDLK_d: +// editor.emulator().snes().SetButtonState(1, 10, false); +// case SDLK_c: +// editor.emulator().snes().SetButtonState(1, 11, false); + struct EmulatorKeybindings { ImGuiKey a_button = ImGuiKey_Z; ImGuiKey b_button = ImGuiKey_A; @@ -26,12 +50,12 @@ struct EmulatorKeybindings { ImGuiKey y_button = ImGuiKey_X; ImGuiKey l_button = ImGuiKey_Q; ImGuiKey r_button = ImGuiKey_W; - ImGuiKey start_button = ImGuiKey_RETURN; - ImGuiKey select_button = ImGuiKey_BACKSPACE; - ImGuiKey up_button = ImGuiKey_UP; - ImGuiKey down_button = ImGuiKey_DOWN; - ImGuiKey left_button = ImGuiKey_LEFT; - ImGuiKey right_button = ImGuiKey_RIGHT; + ImGuiKey start_button = ImGuiKey_Enter; + ImGuiKey select_button = ImGuiKey_Backspace; + ImGuiKey up_button = ImGuiKey_UpArrow; + ImGuiKey down_button = ImGuiKey_DownArrow; + ImGuiKey left_button = ImGuiKey_LeftArrow; + ImGuiKey right_button = ImGuiKey_RightArrow; }; /** diff --git a/src/app/yaze.cc b/src/app/main.cc similarity index 100% rename from src/app/yaze.cc rename to src/app/main.cc