Search
lxdream.org :: lxdream/src/gdrom/gdi.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/gdrom/gdi.c
changeset 498:10d5ba99a778
prev492:84e33e4dda1c
next561:533f6b478071
author nkeynes
date Thu Nov 08 10:48:41 2007 +0000 (12 years ago)
permissions -rw-r--r--
last change Preliminary support for raw sectors in image files
file annotate diff log raw
1.1 --- a/src/gdrom/gdi.c Tue Nov 06 08:35:16 2007 +0000
1.2 +++ b/src/gdrom/gdi.c Thu Nov 08 10:48:41 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: gdi.c,v 1.1 2007-11-06 08:35:16 nkeynes Exp $
1.6 + * $Id: gdi.c,v 1.2 2007-11-08 10:48:41 nkeynes Exp $
1.7 *
1.8 * NullDC GDI image format
1.9 *
1.10 @@ -86,7 +86,7 @@
1.11 return NULL;
1.12 }
1.13 sscanf( line, "%d %d %d %d %s %d", &track_no, &start_lba, &flags, &size,
1.14 - &filename, &offset );
1.15 + filename, &offset );
1.16 if( start_lba >= 45000 ) {
1.17 image->track[i].session = 1;
1.18 } else {
1.19 @@ -110,14 +110,25 @@
1.20 }
1.21 fstat( fileno(image->track[i].file), &st );
1.22 image->track[i].sector_count = st.st_size / size;
1.23 - switch(size) {
1.24 - case 2048: image->track[i].mode = GDROM_MODE1; break;
1.25 - case 2336: image->track[i].mode = GDROM_GD; break;
1.26 - case 2352: image->track[i].mode = GDROM_CDDA; break;
1.27 - default:
1.28 - gdrom_image_destroy_no_close(disc);
1.29 - g_free(dirname);
1.30 - return NULL;
1.31 + if( image->track[i].flags & TRACK_DATA ) {
1.32 + /* Data track */
1.33 + switch(size) {
1.34 + case 2048: image->track[i].mode = GDROM_MODE1; break;
1.35 + case 2336: image->track[i].mode = GDROM_GD; break;
1.36 + case 2352: image->track[i].mode = GDROM_RAW; break;
1.37 + default:
1.38 + gdrom_image_destroy_no_close(disc);
1.39 + g_free(dirname);
1.40 + return NULL;
1.41 + }
1.42 + } else {
1.43 + /* Audio track */
1.44 + image->track[i].mode = GDROM_CDDA;
1.45 + if( size != 2352 ) {
1.46 + gdrom_image_destroy_no_close(disc);
1.47 + g_free(dirname);
1.48 + return NULL;
1.49 + }
1.50 }
1.51 }
1.52 image->track[i].offset = offset;
.