Search
lxdream.org :: lxdream/src/dreamcast.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/dreamcast.c
changeset 825:2ac7ceccd775
prev766:336858fb0160
next839:51f1c4195790
author nkeynes
date Sun Aug 24 01:58:09 2008 +0000 (12 years ago)
permissions -rw-r--r--
last change Silence file load warnings when running the test cases (trying to load empty filenames)
file annotate diff log raw
1.1 --- a/src/dreamcast.c Thu Jul 24 02:30:37 2008 +0000
1.2 +++ b/src/dreamcast.c Sun Aug 24 01:58:09 2008 +0000
1.3 @@ -67,6 +67,9 @@
1.4 */
1.5 void dreamcast_configure( )
1.6 {
1.7 + const char *bios_path = lxdream_get_config_value(CONFIG_BIOS_PATH);
1.8 + const char *flash_path = lxdream_get_config_value(CONFIG_FLASH_PATH);
1.9 +
1.10 dreamcast_register_module( &eventq_module );
1.11 /* Register the memory framework */
1.12 dreamcast_register_module( &mem_module );
1.13 @@ -76,12 +79,11 @@
1.14 mem_create_ram_region( 0x00800000, 2 MB, MEM_REGION_AUDIO );
1.15 mem_create_ram_region( 0x00703000, 8 KB, MEM_REGION_AUDIO_SCRATCH );
1.16 mem_create_ram_region( 0x05000000, 8 MB, MEM_REGION_VIDEO );
1.17 - dreamcast_has_bios = mem_load_rom( lxdream_get_config_value(CONFIG_BIOS_PATH),
1.18 - 0x00000000, 0x00200000, 0x89f2b1a1,
1.19 - MEM_REGION_BIOS );
1.20 + dreamcast_has_bios = mem_load_rom( bios_path, 0x00000000, 0x00200000, 0x89f2b1a1, MEM_REGION_BIOS );
1.21 mem_create_ram_region( 0x00200000, 0x00020000, MEM_REGION_FLASH );
1.22 - mem_load_block( lxdream_get_config_value(CONFIG_FLASH_PATH),
1.23 - 0x00200000, 0x00020000 );
1.24 + if( flash_path != NULL && flash_path[0] != '\0' ) {
1.25 + mem_load_block( flash_path, 0x00200000, 0x00020000 );
1.26 + }
1.27 dreamcast_has_flash = TRUE;
1.28
1.29 /* Load in the rest of the core modules */
1.30 @@ -95,11 +97,12 @@
1.31
1.32 void dreamcast_config_changed(void)
1.33 {
1.34 - dreamcast_has_bios = mem_load_rom( lxdream_get_config_value(CONFIG_BIOS_PATH),
1.35 - 0x00000000, 0x00200000, 0x89f2b1a1,
1.36 - MEM_REGION_BIOS );
1.37 - mem_load_block( lxdream_get_config_value(CONFIG_FLASH_PATH),
1.38 - 0x00200000, 0x00020000 );
1.39 + const char *bios_path = lxdream_get_config_value(CONFIG_BIOS_PATH);
1.40 + const char *flash_path = lxdream_get_config_value(CONFIG_FLASH_PATH);
1.41 + dreamcast_has_bios = mem_load_rom( bios_path, 0x00000000, 0x00200000, 0x89f2b1a1, MEM_REGION_BIOS );
1.42 + if( flash_path != NULL && flash_path[0] != '\0' ) {
1.43 + mem_load_block( flash_path, 0x00200000, 0x00020000 );
1.44 + }
1.45 }
1.46
1.47 void dreamcast_save_flash()
.