Search
lxdream.org :: lxdream/src/dreamcast.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/dreamcast.c
changeset 929:fd8cb0c82f5f
prev892:126aa7db6162
next930:07e5b11419db
author nkeynes
date Sat Dec 20 03:01:40 2008 +0000 (11 years ago)
branchlxdream-mem
permissions -rw-r--r--
last change First pass experiment using cached decoding.
file annotate diff log raw
1.1 --- a/src/dreamcast.c Fri Oct 24 03:46:53 2008 +0000
1.2 +++ b/src/dreamcast.c Sat Dec 20 03:01:40 2008 +0000
1.3 @@ -58,6 +58,13 @@
1.4 struct dreamcast_module unknown_module = { "****", NULL, NULL, NULL, NULL,
1.5 NULL, NULL, NULL };
1.6
1.7 +extern struct mem_region_fn mem_region_sdram;
1.8 +extern struct mem_region_fn mem_region_vram32;
1.9 +extern struct mem_region_fn mem_region_vram64;
1.10 +extern struct mem_region_fn mem_region_audioram;
1.11 +extern struct mem_region_fn mem_region_flashram;
1.12 +extern struct mem_region_fn mem_region_bootrom;
1.13 +
1.14 /**
1.15 * This function is responsible for defining how all the pieces of the
1.16 * dreamcast actually fit together.
1.17 @@ -75,12 +82,12 @@
1.18 dreamcast_register_module( &mem_module );
1.19
1.20 /* Setup standard memory map */
1.21 - mem_create_repeating_ram_region( 0x0C000000, 16 MB, MEM_REGION_MAIN, 0x01000000, 0x0F000000 );
1.22 - mem_create_ram_region( 0x00800000, 2 MB, MEM_REGION_AUDIO );
1.23 - mem_create_ram_region( 0x00703000, 8 KB, MEM_REGION_AUDIO_SCRATCH );
1.24 - mem_create_ram_region( 0x05000000, 8 MB, MEM_REGION_VIDEO );
1.25 - dreamcast_has_bios = mem_load_rom( bios_path, 0x00000000, 0x00200000, 0x89f2b1a1, MEM_REGION_BIOS );
1.26 - mem_create_ram_region( 0x00200000, 0x00020000, MEM_REGION_FLASH );
1.27 + mem_create_repeating_ram_region( 0x0C000000, 16 MB, MEM_REGION_MAIN, &mem_region_sdram, 0x01000000, 0x0F000000 );
1.28 + mem_create_ram_region( 0x00800000, 2 MB, MEM_REGION_AUDIO, &mem_region_audioram );
1.29 + mem_create_ram_region( 0x00703000, 8 KB, MEM_REGION_AUDIO_SCRATCH, NULL );
1.30 + mem_create_ram_region( 0x05000000, 8 MB, MEM_REGION_VIDEO, &mem_region_vram32 );
1.31 + dreamcast_has_bios = mem_load_rom( bios_path, 0x00000000, 0x00200000, 0x89f2b1a1, MEM_REGION_BIOS, &mem_region_bootrom );
1.32 + mem_create_ram_region( 0x00200000, 0x00020000, MEM_REGION_FLASH, &mem_region_flashram );
1.33 if( flash_path != NULL && flash_path[0] != '\0' ) {
1.34 mem_load_block( flash_path, 0x00200000, 0x00020000 );
1.35 }
1.36 @@ -99,7 +106,7 @@
1.37 {
1.38 const char *bios_path = lxdream_get_config_value(CONFIG_BIOS_PATH);
1.39 const char *flash_path = lxdream_get_config_value(CONFIG_FLASH_PATH);
1.40 - dreamcast_has_bios = mem_load_rom( bios_path, 0x00000000, 0x00200000, 0x89f2b1a1, MEM_REGION_BIOS );
1.41 + dreamcast_has_bios = mem_load_rom( bios_path, 0x00000000, 0x00200000, 0x89f2b1a1, MEM_REGION_BIOS, &mem_region_bootrom );
1.42 if( flash_path != NULL && flash_path[0] != '\0' ) {
1.43 mem_load_block( flash_path, 0x00200000, 0x00020000 );
1.44 }
1.45 @@ -120,8 +127,8 @@
1.46 void dreamcast_configure_aica_only( )
1.47 {
1.48 dreamcast_register_module( &mem_module );
1.49 - mem_create_ram_region( 0x00800000, 2 MB, MEM_REGION_AUDIO );
1.50 - mem_create_ram_region( 0x00703000, 8 KB, MEM_REGION_AUDIO_SCRATCH );
1.51 + mem_create_ram_region( 0x00800000, 2 MB, MEM_REGION_AUDIO, &mem_region_audioram );
1.52 + mem_create_ram_region( 0x00703000, 8 KB, MEM_REGION_AUDIO_SCRATCH, NULL );
1.53 dreamcast_register_module( &aica_module );
1.54 aica_enable();
1.55 dreamcast_state = STATE_STOPPED;
1.56 @@ -243,6 +250,7 @@
1.57 #ifdef ENABLE_SH4STATS
1.58 sh4_stats_print(stdout);
1.59 #endif
1.60 + print_sh4mem_stats();
1.61 }
1.62
1.63 void dreamcast_program_loaded( const gchar *name, sh4addr_t entry_point )
.