Search
lxdream.org :: lxdream :: r742:e730ba4938f6
lxdream 0.9.1
released Jun 29
Download Now
changeset742:e730ba4938f6
parent741:0c6f6567280c
child743:6f0f79fae449
authornkeynes
dateFri Jul 18 11:08:02 2008 +0000 (11 years ago)
Avoid writing out the flash if we never allocated it (eg, AICA mode)
src/dreamcast.c
1.1 --- a/src/dreamcast.c Fri Jul 18 08:49:56 2008 +0000
1.2 +++ b/src/dreamcast.c Fri Jul 18 11:08:02 2008 +0000
1.3 @@ -40,6 +40,7 @@
1.4
1.5 static volatile dreamcast_state_t dreamcast_state = STATE_UNINIT;
1.6 static gboolean dreamcast_has_bios = FALSE;
1.7 +static gboolean dreamcast_has_flash = FALSE;
1.8 static gboolean dreamcast_exit_on_stop = FALSE;
1.9 static gchar *dreamcast_program_name = NULL;
1.10 static sh4addr_t dreamcast_entry_point = 0xA0000000;
1.11 @@ -81,6 +82,7 @@
1.12 mem_create_ram_region( 0x00200000, 0x00020000, MEM_REGION_FLASH );
1.13 mem_load_block( lxdream_get_config_value(CONFIG_FLASH_PATH),
1.14 0x00200000, 0x00020000 );
1.15 + dreamcast_has_flash = TRUE;
1.16
1.17 /* Load in the rest of the core modules */
1.18 dreamcast_register_module( &sh4_module );
1.19 @@ -102,8 +104,10 @@
1.20
1.21 void dreamcast_save_flash()
1.22 {
1.23 - const char *file = lxdream_get_config_value(CONFIG_FLASH_PATH);
1.24 - mem_save_block( file, 0x00200000, 0x00020000 );
1.25 + if( dreamcast_has_flash ) {
1.26 + const char *file = lxdream_get_config_value(CONFIG_FLASH_PATH);
1.27 + mem_save_block( file, 0x00200000, 0x00020000 );
1.28 + }
1.29 }
1.30
1.31 /**
.