filename | src/dcload.c |
changeset | 182:e3b513538548 |
prev | 120:7e4549476110 |
next | 183:5938ecc01dc8 |
author | nkeynes |
date | Thu Jul 06 08:47:33 2006 +0000 (14 years ago) |
permissions | -rw-r--r-- |
last change | Add -q command line argument to allow dcload_exit() to actually exit lxdream altogether (useful for test cases) |
file | annotate | diff | log | raw |
1.1 --- a/src/dcload.c Mon Mar 20 11:59:57 2006 +00001.2 +++ b/src/dcload.c Thu Jul 06 08:47:33 2006 +00001.3 @@ -1,5 +1,5 @@1.4 /**1.5 - * $Id: dcload.c,v 1.3 2006-03-20 11:59:57 nkeynes Exp $1.6 + * $Id: dcload.c,v 1.4 2006-07-06 08:47:33 nkeynes Exp $1.7 *1.8 * DC-load syscall implementation.1.9 *1.10 @@ -18,6 +18,7 @@1.12 #include <stdio.h>1.13 #include "dream.h"1.14 +#include "dreamcast.h"1.15 #include "mem.h"1.16 #include "syscall.h"1.17 #include "sh4/sh4core.h"1.18 @@ -47,6 +48,13 @@1.19 #define SYS_MAGIC_ADDR 0x8c0040041.20 #define SYSCALL_ADDR 0x8c0040081.22 +static gboolean dcload_allow_exit = FALSE;1.23 +1.24 +void dcload_set_allow_exit( gboolean allow )1.25 +{1.26 + dcload_allow_exit = allow;1.27 +}1.28 +1.29 void dcload_syscall( uint32_t syscall_id )1.30 {1.31 uint32_t syscall = sh4r.r[4];1.32 @@ -70,8 +78,10 @@1.33 }1.34 break;1.35 case SYS_EXIT:1.36 - /* exit( sh4r.r[4] ); */1.37 - dreamcast_stop();1.38 + if( dcload_allow_exit )1.39 + exit( sh4r.r[4] );1.40 + else1.41 + dreamcast_stop();1.42 default:1.43 sh4r.r[0] = -1;1.44 }
.