Search
lxdream.org :: lxdream/src/mem.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/mem.c
changeset 825:2ac7ceccd775
prev796:a2dc83592467
next929:fd8cb0c82f5f
next953:f4a156508ad1
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/mem.c Wed Jul 30 22:50:44 2008 +0000
1.2 +++ b/src/mem.c Sun Aug 24 01:58:09 2008 +0000
1.3 @@ -286,19 +286,20 @@
1.4 mprotect( mem, size, PROT_READ|PROT_WRITE );
1.5 }
1.6
1.7 - status = mem_load_block( file, base, size );
1.8 - mprotect( mem, size, PROT_READ );
1.9 + if( file != NULL && file[0] != '\0' ) {
1.10 + status = mem_load_block( file, base, size );
1.11 + mprotect( mem, size, PROT_READ );
1.12
1.13 - if( status == 0 ) {
1.14 - /* CRC check only if we loaded something */
1.15 - calc_crc = crc32(0L, (sh4ptr_t)mem, size);
1.16 - if( calc_crc != crc ) {
1.17 - WARN( "Bios CRC Mismatch in %s: %08X (expected %08X)",
1.18 - file, calc_crc, crc);
1.19 + if( status == 0 ) {
1.20 + /* CRC check only if we loaded something */
1.21 + calc_crc = crc32(0L, (sh4ptr_t)mem, size);
1.22 + if( calc_crc != crc ) {
1.23 + WARN( "Bios CRC Mismatch in %s: %08X (expected %08X)",
1.24 + file, calc_crc, crc);
1.25 + }
1.26 + return TRUE;
1.27 }
1.28 - return TRUE;
1.29 }
1.30 -
1.31 return FALSE;
1.32 }
1.33
.