Search
lxdream.org :: lxdream/src/dreamcast.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/dreamcast.c
changeset 167:71c0cc416a64
prev146:f91fa34ab219
next180:e6dcf9b65658
author nkeynes
date Mon Jun 19 11:00:42 2006 +0000 (14 years ago)
permissions -rw-r--r--
last change Add config value retrieval for pathnames
Implement default path for disc + save state loaders
Dump disc ID when mounting a CD
file annotate diff log raw
1.1 --- a/src/dreamcast.c Sat May 20 02:38:58 2006 +0000
1.2 +++ b/src/dreamcast.c Mon Jun 19 11:00:42 2006 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: dreamcast.c,v 1.16 2006-05-20 02:38:58 nkeynes Exp $
1.6 + * $Id: dreamcast.c,v 1.17 2006-06-19 11:00:40 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 @@ -66,10 +66,11 @@
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 - mem_load_rom( "dcboot.rom", 0x00000000, 0x00200000, 0x89f2b1a1 );
1.15 + mem_load_rom( dreamcast_get_config_value(CONFIG_BIOS_PATH),
1.16 + 0x00000000, 0x00200000, 0x89f2b1a1 );
1.17 mem_create_ram_region( 0x00200000, 0x00020000, MEM_REGION_FLASH );
1.18 - mem_load_block( "../bios/dcflash.rom", 0x00200000, 0x00020000 );
1.19 - // mem_load_rom( "dcflash.rom",0x00200000, 0x00020000, 0x357c3568 );
1.20 + mem_load_block( dreamcast_get_config_value(CONFIG_FLASH_PATH),
1.21 + 0x00200000, 0x00020000 );
1.22
1.23 /* Load in the rest of the core modules */
1.24 dreamcast_register_module( &sh4_module );
1.25 @@ -78,14 +79,6 @@
1.26 dreamcast_register_module( &aica_module );
1.27 dreamcast_register_module( &maple_module );
1.28 dreamcast_register_module( &ide_module );
1.29 -
1.30 - /* Attach any default maple devices, ie a pair of controllers */
1.31 - /*
1.32 - maple_device_t controller1 = maple_new_device("Sega Controller");
1.33 - maple_device_t controller2 = maple_new_device("Sega Controller");
1.34 - maple_attach_device( controller1, 0, 0 );
1.35 - maple_attach_device( controller2, 1, 0 );
1.36 - */
1.37 }
1.38
1.39 /**
1.40 @@ -164,6 +157,7 @@
1.41
1.42 /***************************** User Configuration **************************/
1.43
1.44 +
1.45 static struct dreamcast_config_entry global_config[] =
1.46 {{ "bios", CONFIG_TYPE_FILE, "dcboot.rom" },
1.47 { "flash", CONFIG_TYPE_FILE, "dcflash.rom" },
1.48 @@ -202,6 +196,11 @@
1.49 maple_detach_all();
1.50 }
1.51
1.52 +const gchar *dreamcast_get_config_value( int key )
1.53 +{
1.54 + return global_config[key].value;
1.55 +}
1.56 +
1.57 gboolean dreamcast_load_config( const gchar *filename )
1.58 {
1.59 FILE *f = fopen(filename, "ro");
.