git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

commit f5092c00de3a2126abca69063f2ecab7c6a4e68b
parent 88e64fadda5314debe88f67121d4c32ee3ef2cb4
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Sat,  7 Jan 2023 13:31:51 +0200

Reopening a modified ROM (via Open, Open Recent, command-line or Finder) will reload the ROM. Closes #497

Diffstat:
MCocoa/Document.m11+++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)

diff --git a/Cocoa/Document.m b/Cocoa/Document.m @@ -121,6 +121,8 @@ enum model { bool _isRecordingAudio; void (^ volatile _pendingAtomicBlock)(); + + NSDate *_fileModificationTime; } static void boot_rom_load(GB_gameboy_t *gb, GB_boot_rom_t type) @@ -1126,9 +1128,18 @@ static bool is_path_writeable(const char *path) rom_warning_issued = true; [GBWarningPopover popoverWithContents:rom_warnings onWindow:self.mainWindow]; } + _fileModificationTime = [[NSFileManager defaultManager] attributesOfItemAtPath:fileName error:nil][NSFileModificationDate]; return ret; } +- (void)showWindows +{ + if (![_fileModificationTime isEqualToDate:[[NSFileManager defaultManager] attributesOfItemAtPath:self.fileName error:nil][NSFileModificationDate]]) { + [self reset:nil]; + } + [super showWindows]; +} + - (void)close { [self disconnectLinkCable];

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.