1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
|
From: Alberto Garcia <berto@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
@@ -278,8 +278,46 @@ machine_load_rom_bank_from_file( memory_
{
int error;
utils_file rom;
+ static int using_opense_rom = 0;
error = utils_read_auxiliary_file( filename, &rom, UTILS_AUXILIARY_ROM );
+
+ if( error == -1 ) {
+
+ 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" ) ) {
+
+ error = utils_read_auxiliary_file( "opense.rom", &rom, UTILS_AUXILIARY_ROM );
+ custom = 1;
+
+ if( error != -1 && ! 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" ) ) {
+
+ error = utils_read_auxiliary_file( "opense-stub.rom", &rom, UTILS_AUXILIARY_ROM );
+ custom = 1;
+
+ }
+
+ }
+
if( error == -1 ) {
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
@@ -103,6 +103,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 = {
@@ -191,6 +192,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
@@ -66,6 +66,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 = {
@@ -389,6 +390,8 @@ read_config_file( settings_info *setting
xmlFreeDoc( doc );
+ config_file_present = 1;
+
return 0;
}
|