Search
lxdream.org :: lxdream :: r825:2ac7ceccd775
lxdream 0.9.1
released Jun 29
Download Now
changeset825:2ac7ceccd775
parent824:016cda9d0518
child826:69f2c9f1e608
authornkeynes
dateSun Aug 24 01:58:09 2008 +0000 (11 years ago)
Silence file load warnings when running the test cases (trying to load empty filenames)
src/dreamcast.c
src/loader.c
src/mem.c
1.1 --- a/src/dreamcast.c Sun Aug 24 01:43:17 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()
2.1 --- a/src/loader.c Sun Aug 24 01:43:17 2008 +0000
2.2 +++ b/src/loader.c Sun Aug 24 01:58:09 2008 +0000
2.3 @@ -108,7 +108,7 @@
2.4 void file_load_postload( const gchar *filename, int pc )
2.5 {
2.6 const gchar *bootstrap_file = lxdream_get_config_value(CONFIG_BOOTSTRAP);
2.7 - if( bootstrap_file != NULL ) {
2.8 + if( bootstrap_file != NULL && bootstrap_file[0] != '\0' ) {
2.9 /* Load in a bootstrap before the binary, to initialize everything
2.10 * correctly
2.11 */
3.1 --- a/src/mem.c Sun Aug 24 01:43:17 2008 +0000
3.2 +++ b/src/mem.c Sun Aug 24 01:58:09 2008 +0000
3.3 @@ -286,19 +286,20 @@
3.4 mprotect( mem, size, PROT_READ|PROT_WRITE );
3.5 }
3.6
3.7 - status = mem_load_block( file, base, size );
3.8 - mprotect( mem, size, PROT_READ );
3.9 + if( file != NULL && file[0] != '\0' ) {
3.10 + status = mem_load_block( file, base, size );
3.11 + mprotect( mem, size, PROT_READ );
3.12
3.13 - if( status == 0 ) {
3.14 - /* CRC check only if we loaded something */
3.15 - calc_crc = crc32(0L, (sh4ptr_t)mem, size);
3.16 - if( calc_crc != crc ) {
3.17 - WARN( "Bios CRC Mismatch in %s: %08X (expected %08X)",
3.18 - file, calc_crc, crc);
3.19 + if( status == 0 ) {
3.20 + /* CRC check only if we loaded something */
3.21 + calc_crc = crc32(0L, (sh4ptr_t)mem, size);
3.22 + if( calc_crc != crc ) {
3.23 + WARN( "Bios CRC Mismatch in %s: %08X (expected %08X)",
3.24 + file, calc_crc, crc);
3.25 + }
3.26 + return TRUE;
3.27 }
3.28 - return TRUE;
3.29 }
3.30 -
3.31 return FALSE;
3.32 }
3.33
.