Search
lxdream.org :: lxdream/src/dreamcast.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/dreamcast.c
changeset 931:430048ea8b71
prev930:07e5b11419db
next934:3acd3b3ee6d1
author nkeynes
date Tue Dec 23 05:48:05 2008 +0000 (11 years ago)
branchlxdream-mem
permissions -rw-r--r--
last change More refactoring and general cleanup. Most things should be working again now.
Split off cache and start real implementation, breaking save states in the process
file annotate diff log raw
1.1 --- a/src/dreamcast.c Mon Dec 22 09:51:11 2008 +0000
1.2 +++ b/src/dreamcast.c Tue Dec 23 05:48:05 2008 +0000
1.3 @@ -62,8 +62,13 @@
1.4 extern struct mem_region_fn mem_region_vram32;
1.5 extern struct mem_region_fn mem_region_vram64;
1.6 extern struct mem_region_fn mem_region_audioram;
1.7 +extern struct mem_region_fn mem_region_audioscratch;
1.8 extern struct mem_region_fn mem_region_flashram;
1.9 extern struct mem_region_fn mem_region_bootrom;
1.10 +extern struct mem_region_fn mem_region_pvr2ta;
1.11 +extern struct mem_region_fn mem_region_pvr2yuv;
1.12 +extern struct mem_region_fn mem_region_pvr2vdma1;
1.13 +extern struct mem_region_fn mem_region_pvr2vdma2;
1.14
1.15 /**
1.16 * This function is responsible for defining how all the pieces of the
1.17 @@ -82,12 +87,20 @@
1.18 dreamcast_register_module( &mem_module );
1.19
1.20 /* Setup standard memory map */
1.21 + dreamcast_has_bios =
1.22 + mem_load_rom( bios_path, 0x00000000, 2 MB, 0x89f2b1a1, MEM_REGION_BIOS, &mem_region_bootrom );
1.23 + mem_create_ram_region( 0x00200000, 0x00020000, MEM_REGION_FLASH, &mem_region_flashram );
1.24 + mem_create_ram_region( 0x00800000, 2 MB, MEM_REGION_AUDIO, &mem_region_audioram );
1.25 + mem_create_ram_region( 0x00703000, 8 KB, MEM_REGION_AUDIO_SCRATCH, &mem_region_audioscratch );
1.26 + register_misc_region( 0x04000000, 8 MB, MEM_REGION_VIDEO64, &mem_region_vram64 );
1.27 + mem_create_ram_region( 0x05000000, 8 MB, MEM_REGION_VIDEO, &mem_region_vram32 );
1.28 mem_create_repeating_ram_region( 0x0C000000, 16 MB, MEM_REGION_MAIN, &mem_region_sdram, 0x01000000, 0x0F000000 );
1.29 - mem_create_ram_region( 0x00800000, 2 MB, MEM_REGION_AUDIO, &mem_region_audioram );
1.30 - mem_create_ram_region( 0x00703000, 8 KB, MEM_REGION_AUDIO_SCRATCH, NULL );
1.31 - mem_create_ram_region( 0x05000000, 8 MB, MEM_REGION_VIDEO, &mem_region_vram32 );
1.32 - dreamcast_has_bios = mem_load_rom( bios_path, 0x00000000, 0x00200000, 0x89f2b1a1, MEM_REGION_BIOS, &mem_region_bootrom );
1.33 - mem_create_ram_region( 0x00200000, 0x00020000, MEM_REGION_FLASH, &mem_region_flashram );
1.34 + register_misc_region( 0x10000000, 8 MB, "PVR2 TA Command 1", &mem_region_pvr2ta );
1.35 + register_misc_region( 0x10800000, 8 MB, "PVR2 YUV Decode 1", &mem_region_pvr2yuv );
1.36 + register_misc_region( 0x11000000, 16 MB,"PVR2 VRAM DMA 1", &mem_region_pvr2vdma1 );
1.37 + register_misc_region( 0x12000000, 8 MB, "PVR2 TA Command 2", &mem_region_pvr2ta );
1.38 + register_misc_region( 0x12800000, 8 MB, "PVR2 YUV Decode 2", &mem_region_pvr2yuv );
1.39 + register_misc_region( 0x13000000, 16 MB,"PVR2 VRAM DMA 2", &mem_region_pvr2vdma2 );
1.40 if( flash_path != NULL && flash_path[0] != '\0' ) {
1.41 mem_load_block( flash_path, 0x00200000, 0x00020000 );
1.42 }
1.43 @@ -100,7 +113,6 @@
1.44 dreamcast_register_module( &aica_module );
1.45 dreamcast_register_module( &maple_module );
1.46 dreamcast_register_module( &ide_module );
1.47 - sh4_mem_init();
1.48 }
1.49
1.50 void dreamcast_config_changed(void)
1.51 @@ -129,7 +141,7 @@
1.52 {
1.53 dreamcast_register_module( &mem_module );
1.54 mem_create_ram_region( 0x00800000, 2 MB, MEM_REGION_AUDIO, &mem_region_audioram );
1.55 - mem_create_ram_region( 0x00703000, 8 KB, MEM_REGION_AUDIO_SCRATCH, NULL );
1.56 + mem_create_ram_region( 0x00703000, 8 KB, MEM_REGION_AUDIO_SCRATCH, &mem_region_audioscratch );
1.57 dreamcast_register_module( &aica_module );
1.58 aica_enable();
1.59 dreamcast_state = STATE_STOPPED;
1.60 @@ -251,7 +263,6 @@
1.61 #ifdef ENABLE_SH4STATS
1.62 sh4_stats_print(stdout);
1.63 #endif
1.64 - print_sh4mem_stats();
1.65 }
1.66
1.67 void dreamcast_program_loaded( const gchar *name, sh4addr_t entry_point )
.