Search
lxdream.org :: lxdream :: r154:d62f7b49934b
lxdream 0.9.1
released Jun 29
Download Now
changeset154:d62f7b49934b
parent153:3d4091e2b136
child155:be61d1a20937
authornkeynes
dateWed May 24 11:49:38 2006 +0000 (14 years ago)
Skip 8-byte subheader at start of mode-2/1 sectors when performing a mode-1
read...
src/gdrom/gdrom.c
1.1 --- a/src/gdrom/gdrom.c Wed May 24 11:48:58 2006 +0000
1.2 +++ b/src/gdrom/gdrom.c Wed May 24 11:49:38 2006 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: gdrom.c,v 1.5 2006-05-23 13:11:45 nkeynes Exp $
1.6 + * $Id: gdrom.c,v 1.6 2006-05-24 11:49:38 nkeynes Exp $
1.7 *
1.8 * GD-Rom access functions.
1.9 *
1.10 @@ -78,7 +78,6 @@
1.11
1.12 file_offset = track->offset + track->sector_size * (sector - track->lba);
1.13 read_len = track->sector_size * sector_count;
1.14 - fseek( disc->file, file_offset, SEEK_SET );
1.15
1.16 switch( mode ) {
1.17 case GDROM_GD:
1.18 @@ -89,15 +88,17 @@
1.19 switch( track->mode ) {
1.20 case GDROM_MODE1:
1.21 case GDROM_MODE2_XA1:
1.22 + fseek( disc->file, file_offset, SEEK_SET );
1.23 fread( buf, track->sector_size, sector_count, disc->file );
1.24 break;
1.25 case GDROM_MODE2:
1.26 read_len = sector_count * 2048;
1.27 + file_offset += 8; /* skip the subheader */
1.28 while( sector_count > 0 ) {
1.29 + fseek( disc->file, file_offset, SEEK_SET );
1.30 fread( buf, 2048, 1, disc->file );
1.31 file_offset += track->sector_size;
1.32 buf += 2048;
1.33 - fseek( disc->file, file_offset, SEEK_SET );
1.34 sector_count--;
1.35 }
1.36 break;
.