From: Alberto Garcia <agarcia@igalia.com>
Subject: Load the OpenSE BASIC ROM if the original ROMs are not found
Forwarded: http://sourceforge.net/mailarchive/message.php?msg_id=27674912
Index: fuse-emulator/machine.c
===================================================================
--- fuse-emulator.orig/machine.c
+++ fuse-emulator/machine.c
@@ -51,6 +51,7 @@
 
 fuse_machine_info **machine_types = NULL; /* Array of available machines */
 int machine_count = 0;
+int using_opense_rom = 0;
 
 fuse_machine_info *machine_current = NULL; /* The currently selected machine */
 static int machine_location;	/* Where is the current machine in
@@ -297,6 +298,41 @@ machine_load_rom_bank_from_file( memory_
   utils_file rom;
 
   fd = utils_find_auxiliary_file( filename, UTILS_AUXILIARY_ROM );
+
+  if( fd == COMPAT_FILE_OPEN_FAILED ) {
+
+    if(! strcmp( filename, "48.rom"      ) ||
+       ! strcmp( filename, "tc2048.rom"  ) ||
+       ! strcmp( filename, "128-1.rom"   ) ||
+       ! strcmp( filename, "plus2-1.rom" ) ||
+       ! strcmp( filename, "plus3-1.rom" ) ||
+       ! strcmp( filename, "plus3-3.rom" ) ) {
+
+      fd = utils_find_auxiliary_file( "opense.rom", UTILS_AUXILIARY_ROM );
+
+      if( fd != COMPAT_FILE_OPEN_FAILED && ! using_opense_rom ) {
+
+        extern int config_file_present;
+        using_opense_rom = 1;
+
+        if( ! config_file_present ) {
+          ui_error( UI_ERROR_INFO, "Original Spectrum ROM '%s' not found.\n"
+                                   "Using opense.rom instead.\n"
+                                   "See README.Debian for details.", filename );
+        }
+      }
+
+    } else if(! strcmp( filename, "128-0.rom"   ) ||
+              ! strcmp( filename, "plus2-0.rom" ) ||
+              ! strcmp( filename, "plus3-0.rom" ) ||
+              ! strcmp( filename, "plus3-2.rom" ) ) {
+
+      fd = utils_find_auxiliary_file( "opense-stub.rom", UTILS_AUXILIARY_ROM );
+
+    }
+
+  }
+
   if( fd == COMPAT_FILE_OPEN_FAILED ) {
     ui_error( UI_ERROR_ERROR, "couldn't find ROM '%s' - See README.Debian for details", filename );
     return 1;
Index: fuse-emulator/settings.pl
===================================================================
--- fuse-emulator.orig/settings.pl
+++ fuse-emulator/settings.pl
@@ -104,6 +104,7 @@ print hashline( __LINE__ ), << 'CODE';
 
 /* The current settings of options, etc */
 settings_info settings_current;
+int config_file_present = 0;
 
 /* The default settings of options, etc */
 settings_info settings_default = {
@@ -196,6 +197,8 @@ read_config_file( settings_info *setting
 
   xmlFreeDoc( doc );
 
+  config_file_present = 1;
+
   return 0;
 }
 
Index: fuse-emulator/settings.c
===================================================================
--- fuse-emulator.orig/settings.c
+++ fuse-emulator/settings.c
@@ -65,6 +65,7 @@
 
 /* The current settings of options, etc */
 settings_info settings_current;
+int config_file_present = 0;
 
 /* The default settings of options, etc */
 settings_info settings_default = {
@@ -333,6 +334,8 @@ read_config_file( settings_info *setting
 
   xmlFreeDoc( doc );
 
+  config_file_present = 1;
+
   return 0;
 }
 
