From e79f2c1764a4010d7845c6656b03acc21be166bb Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sun, 21 Jan 2024 13:46:51 +0200 Subject: [PATCH] Add a menu item to reload the ROM without resetting --- Cocoa/Document.m | 14 ++++++++++++++ Cocoa/MainMenu.xib | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/Cocoa/Document.m b/Cocoa/Document.m index 15595ea13..32682779d 100644 --- a/Cocoa/Document.m +++ b/Cocoa/Document.m @@ -2697,6 +2697,20 @@ enum GBWindowResizeAction }]; } +- (IBAction)reloadROM:(id)sender +{ + bool wasRunning = _running; + if (wasRunning) { + [self stop]; + } + + [self loadROM]; + + if (wasRunning) { + [self start]; + } +} + - (void)updateDebuggerButtons { bool updateContinue = false; diff --git a/Cocoa/MainMenu.xib b/Cocoa/MainMenu.xib index de138bd0c..ee78351fe 100644 --- a/Cocoa/MainMenu.xib +++ b/Cocoa/MainMenu.xib @@ -208,6 +208,11 @@ + + + + +