Search
lxdream.org :: lxdream/src/loader.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/loader.c
changeset 502:c4ecae2b1b5e
prev481:3b2d6c5a19ad
next537:d924be49e192
author nkeynes
date Thu Nov 08 11:54:16 2007 +0000 (12 years ago)
permissions -rw-r--r--
last change Add sh4ptr_t type, start converting bare pointer refs to it
file annotate diff log raw
1.1 --- a/src/loader.c Wed Oct 31 12:05:23 2007 +0000
1.2 +++ b/src/loader.c Thu Nov 08 11:54:16 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: loader.c,v 1.21 2007-10-31 12:05:23 nkeynes Exp $
1.6 + * $Id: loader.c,v 1.22 2007-11-08 11:54:16 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 @@ -75,7 +75,7 @@
1.11 if( memcmp( buf, bootstrap_magic, 32 ) == 0 ) {
1.12 /* we have a DC bootstrap */
1.13 if( st.st_size == BOOTSTRAP_SIZE ) {
1.14 - unsigned char *load = (unsigned char *)mem_get_region( BOOTSTRAP_LOAD_ADDR );
1.15 + sh4ptr_t load = mem_get_region( BOOTSTRAP_LOAD_ADDR );
1.16 lseek( fd, 0, SEEK_SET );
1.17 read( fd, load, BOOTSTRAP_SIZE );
1.18 bootstrap_dump( load, TRUE );
1.19 @@ -167,7 +167,7 @@
1.20 read( fd, &phdr, sizeof(phdr) );
1.21 if( phdr.p_type == PT_LOAD ) {
1.22 lseek( fd, phdr.p_offset, SEEK_SET );
1.23 - char *target = mem_get_region( phdr.p_vaddr );
1.24 + sh4ptr_t target = mem_get_region( phdr.p_vaddr );
1.25 read( fd, target, phdr.p_filesz );
1.26 if( phdr.p_memsz > phdr.p_filesz ) {
1.27 memset( target + phdr.p_filesz, 0, phdr.p_memsz - phdr.p_filesz );
.