Search
lxdream.org :: lxdream/src/gdrom/gdrom.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/gdrom/gdrom.c
changeset 245:a1d0655a88d3
prev237:6f1a429c9d12
next342:850502f0e8de
author nkeynes
date Tue Dec 19 09:52:56 2006 +0000 (13 years ago)
permissions -rw-r--r--
last change Work in progress: 0x40,1 (read status)
file annotate diff log raw
1.1 --- a/src/gdrom/gdrom.c Thu Dec 14 12:31:38 2006 +0000
1.2 +++ b/src/gdrom/gdrom.c Tue Dec 19 09:52:56 2006 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: gdrom.c,v 1.10 2006-12-14 12:31:38 nkeynes Exp $
1.6 + * $Id: gdrom.c,v 1.11 2006-12-19 09:52:56 nkeynes Exp $
1.7 *
1.8 * GD-Rom access functions.
1.9 *
1.10 @@ -137,6 +137,7 @@
1.11 // return PKT_ERR_BADREADMODE;
1.12 // break;
1.13 case GDROM_MODE1:
1.14 + case GDROM_MODE2_XA1:
1.15 switch( track->mode ) {
1.16 case GDROM_MODE1:
1.17 case GDROM_MODE2_XA1:
1.18 @@ -258,6 +259,27 @@
1.19
1.20 }
1.21
1.22 +gdrom_track_t gdrom_get_track( int trackno ) {
1.23 + if( gdrom_disc == NULL || trackno < 1 || trackno > 99 ) {
1.24 + return NULL;
1.25 + } else {
1.26 + return &gdrom_disc->track[trackno-1];
1.27 + }
1.28 +}
1.29 +
1.30 +uint8_t gdrom_get_track_no_by_lba( uint32_t lba ) {
1.31 + int i;
1.32 + if( gdrom_disc != NULL ) {
1.33 + for( i=0; i<gdrom_disc->track_count; i++ ) {
1.34 + if( gdrom_disc->track[i].lba <= lba &&
1.35 + lba <= (gdrom_disc->track[i].lba + gdrom_disc->track[i].sector_count) ) {
1.36 + return i+1;
1.37 + }
1.38 + }
1.39 + }
1.40 + return -1;
1.41 +}
1.42 +
1.43 void gdrom_mount_disc( gdrom_disc_t disc )
1.44 {
1.45 gdrom_unmount_disc();
.