Support manual/automatic ROM reloading

This commit is contained in:
2025-11-23 15:45:57 -05:00
parent 2e474df3e8
commit 2034f7934b
8 changed files with 248 additions and 22 deletions
+8 -1
View File
@@ -460,6 +460,7 @@ struct PersistedGamepadMapping {
#[derive(Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Hash)]
pub enum Command {
OpenRom,
ReloadRom,
Quit,
FrameAdvance,
FastForward(u32),
@@ -470,9 +471,10 @@ pub enum Command {
}
impl Command {
pub fn all() -> [Self; 7] {
pub fn all() -> [Self; 8] {
[
Self::OpenRom,
Self::ReloadRom,
Self::Quit,
Self::PauseResume,
Self::Reset,
@@ -485,6 +487,7 @@ impl Command {
pub fn name(self) -> &'static str {
match self {
Self::OpenRom => "Open ROM",
Self::ReloadRom => "Reload ROM",
Self::Quit => "Exit",
Self::PauseResume => "Pause/Resume",
Self::Reset => "Reset",
@@ -516,6 +519,10 @@ impl Default for Shortcuts {
Command::OpenRom,
KeyboardShortcut::new(Modifiers::COMMAND, Key::O),
);
shortcuts.set(
Command::ReloadRom,
KeyboardShortcut::new(Modifiers::COMMAND | Modifiers::SHIFT, Key::F5),
);
shortcuts.set(
Command::Quit,
KeyboardShortcut::new(Modifiers::COMMAND, Key::Q),