revision 277:fcc1274776cb
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 277:fcc1274776cb |
parent | 276:1e594c2804f8 |
child | 278:a66aaa522d31 |
author | nkeynes |
date | Fri Jan 12 10:16:02 2007 +0000 (17 years ago) |
Add ability to save flash
src/dreamcast.c | view | annotate | diff | log | ||
src/gui/callbacks.c | view | annotate | diff | log |
1.1 --- a/src/dreamcast.c Fri Jan 12 10:15:06 2007 +00001.2 +++ b/src/dreamcast.c Fri Jan 12 10:16:02 2007 +00001.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 modules1.8 * together into some kind of coherent structure. This is also where you'd1.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.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.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 +00002.2 +++ b/src/gui/callbacks.c Fri Jan 12 10:16:02 2007 +00002.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 }
.