From 0ccd8462c59e9ecb42c64e262dc4de0546e5b0ca Mon Sep 17 00:00:00 2001 From: Eduo Gutierrez Date: Mon, 3 Nov 2025 01:31:46 +0100 Subject: [PATCH] Add support for MT32 ROMs provided in GameBox Adds support for a folder named "MT-32 ROMs" in the gamebox root containing valid MT-32 ROMs. Code will first check the Application Support folder in the user's Library and if not present will check for this location in the gamebox root folder. If present, game will behave normally and show MT-32 LCD texts. This doesn't affect the display in the Application's settings. --- Boxer/BXSession+BXAudioControls.m | 52 +++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/Boxer/BXSession+BXAudioControls.m b/Boxer/BXSession+BXAudioControls.m index 8f9e5a42..cfaea36e 100644 --- a/Boxer/BXSession+BXAudioControls.m +++ b/Boxer/BXSession+BXAudioControls.m @@ -17,6 +17,7 @@ #import "BXExternalMIDIDevice.h" #import "BXExternalMT32.h" #import "Boxer-Swift.h" +#import "RegexKitLite.h" @implementation BXSession (BXAudioControls) @@ -122,6 +123,13 @@ - (void) emulatorDidDisplayMT32Message: (NSNotification *)notification NSError *emulatedMT32Error = nil; NSURL *PCMROMURL = [(BXBaseAppController *)[NSApp delegate] MT32PCMROMURL]; NSURL *controlROMURL = [(BXBaseAppController *)[NSApp delegate] MT32ControlROMURL]; + + //Fallback: check gamebox for ROMs if not found in Application Support + if (!PCMROMURL && self.gamebox) + PCMROMURL = [self _MT32PCMROMURLInGamebox]; + if (!controlROMURL && self.gamebox) + controlROMURL = [self _MT32ControlROMURLInGamebox]; + BXEmulatedMT32 *emulatedMT32 = [[BXEmulatedMT32 alloc] initWithPCMROM: PCMROMURL controlROM: controlROMURL delegate: theEmulator @@ -241,4 +249,48 @@ - (BOOL) emulator: (BXEmulator *)theEmulator shouldWaitForMIDIDevice: (id