Search
lxdream.org :: lxdream :: r294:a5beff9b2b85
lxdream 0.9.1
released Jun 29
Download Now
changeset294:a5beff9b2b85
parent293:fe191b6381b5
child295:6637664291a8
authornkeynes
dateTue Jan 16 09:18:32 2007 +0000 (13 years ago)
Add save state to the magic loader (so we can run save states directly from
the command line)
src/loader.c
1.1 --- a/src/loader.c Tue Jan 16 09:17:22 2007 +0000
1.2 +++ b/src/loader.c Tue Jan 16 09:18:32 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: loader.c,v 1.14 2006-07-02 04:59:00 nkeynes Exp $
1.6 + * $Id: loader.c,v 1.15 2007-01-16 09:18:32 nkeynes Exp $
1.7 *
1.8 * File loading routines, mostly for loading demos without going through the
1.9 * whole procedure of making a CD image for them.
1.10 @@ -58,13 +58,6 @@
1.11 }
1.12
1.13 fstat( fd, &st );
1.14 - /*
1.15 - if( st.st_size < 32768 ) {
1.16 - ERROR( "File '%s' too small to be a dreamcast image", filename );
1.17 - close(fd);
1.18 - return FALSE;
1.19 - }
1.20 - */
1.21
1.22 /* begin magic */
1.23 if( read( fd, buf, 32 ) != 32 ) {
1.24 @@ -94,6 +87,9 @@
1.25 } else if( memcmp( buf, "PK\x03\x04", 4 ) == 0 ) {
1.26 /* ZIP file, aka SBI file */
1.27 WARN( "SBI files not supported yet" );
1.28 + } else if( memcmp( buf, DREAMCAST_SAVE_MAGIC, 16 ) == 0 ) {
1.29 + /* Save state */
1.30 + dreamcast_load_state( filename );
1.31 } else if( buf[0] == 0x7F && buf[1] == 'E' &&
1.32 buf[2] == 'L' && buf[3] == 'F' ) {
1.33 /* ELF binary */
.