Search
lxdream.org :: lxdream :: r277:fcc1274776cb
lxdream 0.9.1
released Jun 29
Download Now
changeset277:fcc1274776cb
parent276:1e594c2804f8
child278:a66aaa522d31
authornkeynes
dateFri Jan 12 10:16:02 2007 +0000 (12 years ago)
Add ability to save flash
src/dreamcast.c
src/gui/callbacks.c
1.1 --- a/src/dreamcast.c Fri Jan 12 10:15:06 2007 +0000
1.2 +++ b/src/dreamcast.c Fri Jan 12 10:16:02 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: dreamcast.c,v 1.19 2007-01-06 04:06:36 nkeynes Exp $
1.6 + * $Id: dreamcast.c,v 1.20 2007-01-12 10:16:02 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 @@ -85,6 +85,12 @@
1.11 dreamcast_register_module( &ide_module );
1.12 }
1.13
1.14 +void dreamcast_save_flash()
1.15 +{
1.16 + char *file = dreamcast_get_config_value(CONFIG_FLASH_PATH);
1.17 + mem_save_block( file, 0x00200000, 0x00020000 );
1.18 +}
1.19 +
1.20 /**
1.21 * Constructs a system configuration for the AICA in standalone mode,
1.22 * ie sound chip only.
1.23 @@ -154,6 +160,13 @@
1.24 dreamcast_state = STATE_STOPPING;
1.25 }
1.26
1.27 +void dreamcast_shutdown()
1.28 +{
1.29 + dreamcast_stop();
1.30 + sh4_stop();
1.31 + dreamcast_save_flash();
1.32 +}
1.33 +
1.34 gboolean dreamcast_is_running( void )
1.35 {
1.36 return dreamcast_state == STATE_RUNNING;
2.1 --- a/src/gui/callbacks.c Fri Jan 12 10:15:06 2007 +0000
2.2 +++ b/src/gui/callbacks.c Fri Jan 12 10:16:02 2007 +0000
2.3 @@ -1,5 +1,5 @@
2.4 /**
2.5 - * $Id: callbacks.c,v 1.17 2006-12-15 10:17:08 nkeynes Exp $
2.6 + * $Id: callbacks.c,v 1.18 2007-01-12 10:16:02 nkeynes Exp $
2.7 *
2.8 * All GTK callbacks go here (stubs are autogenerated by Glade)
2.9 *
2.10 @@ -172,6 +172,7 @@
2.11 GdkEvent *event,
2.12 gpointer user_data)
2.13 {
2.14 + dreamcast_shutdown();
2.15 gtk_main_quit();
2.16 return FALSE;
2.17 }
.