Search
lxdream.org :: lxdream :: r466:a6935f46ed78
lxdream 0.9.1
released Jun 29
Download Now
changeset466:a6935f46ed78
parent465:3bd7be575792
child467:0120dc87e05d
authornkeynes
dateSat Oct 27 05:47:55 2007 +0000 (12 years ago)
Fix BIOS reloading
src/dreamcast.c
src/mem.c
src/mem.h
1.1 --- a/src/dreamcast.c Sat Oct 27 05:47:21 2007 +0000
1.2 +++ b/src/dreamcast.c Sat Oct 27 05:47:55 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: dreamcast.c,v 1.25 2007-10-23 10:48:24 nkeynes Exp $
1.6 + * $Id: dreamcast.c,v 1.26 2007-10-27 05:47:55 nkeynes Exp $
1.7 * Central switchboard for the system. This pulls all the individual modules
1.8 * together into some kind of coherent structure. This is also where you'd
1.9 * add Naomi support, if I ever get a board to play with...
1.10 @@ -67,11 +67,8 @@
1.11 mem_create_ram_region( 0x00800000, 2 MB, MEM_REGION_AUDIO );
1.12 mem_create_ram_region( 0x00703000, 8 KB, MEM_REGION_AUDIO_SCRATCH );
1.13 mem_create_ram_region( 0x05000000, 8 MB, MEM_REGION_VIDEO );
1.14 - if( mem_load_rom( lxdream_get_config_value(CONFIG_BIOS_PATH),
1.15 - 0x00000000, 0x00200000, 0x89f2b1a1 ) == NULL ) {
1.16 - /* Bios wasn't found. Dump an empty ram region in there for something to do */
1.17 - mem_create_ram_region( 0x00000000, 0x00200000, MEM_REGION_BIOS );
1.18 - }
1.19 + mem_load_rom( lxdream_get_config_value(CONFIG_BIOS_PATH),
1.20 + 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 @@ -88,7 +85,7 @@
1.25 void dreamcast_config_changed(void)
1.26 {
1.27 mem_load_rom( lxdream_get_config_value(CONFIG_BIOS_PATH),
1.28 - 0x00000000, 0x00200000, 0x89f2b1a1 );
1.29 + 0x00000000, 0x00200000, 0x89f2b1a1, MEM_REGION_BIOS );
1.30 mem_load_block( lxdream_get_config_value(CONFIG_FLASH_PATH),
1.31 0x00200000, 0x00020000 );
1.32 }
2.1 --- a/src/mem.c Sat Oct 27 05:47:21 2007 +0000
2.2 +++ b/src/mem.c Sat Oct 27 05:47:55 2007 +0000
2.3 @@ -1,5 +1,5 @@
2.4 /**
2.5 - * $Id: mem.c,v 1.16 2007-10-23 10:48:24 nkeynes Exp $
2.6 + * $Id: mem.c,v 1.17 2007-10-27 05:47:55 nkeynes Exp $
2.7 * mem.c is responsible for creating and maintaining the overall system memory
2.8 * map, as visible from the SH4 processor.
2.9 *
2.10 @@ -265,7 +265,8 @@
2.11 return mem;
2.12 }
2.13
2.14 -void *mem_load_rom( const gchar *file, uint32_t base, uint32_t size, uint32_t crc )
2.15 +void *mem_load_rom( const gchar *file, uint32_t base, uint32_t size, uint32_t crc,
2.16 + const gchar *region_name )
2.17 {
2.18 char *mem;
2.19 int fd;
3.1 --- a/src/mem.h Sat Oct 27 05:47:21 2007 +0000
3.2 +++ b/src/mem.h Sat Oct 27 05:47:55 2007 +0000
3.3 @@ -1,5 +1,5 @@
3.4 /**
3.5 - * $Id: mem.h,v 1.13 2007-10-08 12:06:01 nkeynes Exp $
3.6 + * $Id: mem.h,v 1.14 2007-10-27 05:47:55 nkeynes Exp $
3.7 *
3.8 * mem is responsible for creating and maintaining the overall system memory
3.9 * map, as visible from the SH4 processor. (Note the ARM has a different map)
3.10 @@ -48,7 +48,8 @@
3.11 void *mem_create_ram_region( uint32_t base, uint32_t size, const char *name );
3.12 void *mem_create_repeating_ram_region( uint32_t base, uint32_t size, const char *name,
3.13 uint32_t repeat_offset, uint32_t last_repeat );
3.14 -void *mem_load_rom( const gchar *name, uint32_t base, uint32_t size, uint32_t crc );
3.15 +void *mem_load_rom( const gchar *name, uint32_t base, uint32_t size, uint32_t crc,
3.16 + const gchar *region_name );
3.17 void *mem_alloc_pages( int n );
3.18 char *mem_get_region( uint32_t addr );
3.19 char *mem_get_region_by_name( const char *name );
.