[Lapetus-cvs] lapetus cd.c,1.3,1.4 cd.h,1.3,1.4
Status: Inactive
Brought to you by:
cyberwarriorx
|
From: Theo B. <cyb...@us...> - 2009-05-29 04:15:51
|
Update of /cvsroot/lapetus/lapetus In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv16128 Modified Files: cd.c cd.h Log Message: -Added function for getting the number of sessions on a disc Index: cd.c =================================================================== RCS file: /cvsroot/lapetus/lapetus/cd.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- cd.c 9 Jan 2008 05:04:21 -0000 1.3 +++ cd.c 29 May 2009 04:15:42 -0000 1.4 @@ -803,3 +803,27 @@ } ////////////////////////////////////////////////////////////////////////////// + +int CDGetSessionNum(u8 *num) +{ + int ret; + cdcmd_struct cdcmd; + cdcmd_struct cdcmdrs; + u16 auth; + cdstat_struct cdstatus; + int i; + + // Get Session Info + cdcmd.CR1 = 0x0300; + cdcmd.CR2 = 0x0000; + cdcmd.CR3 = 0x0000; + cdcmd.CR4 = 0x0000; + + if ((ret = CDExecCommand(0, &cdcmd, &cdcmdrs)) != 0) + return ret; + + num[0] = cdcmdrs.CR3 >> 8; + return LAPETUS_ERR_OK; +} + +////////////////////////////////////////////////////////////////////////////// Index: cd.h =================================================================== RCS file: /cvsroot/lapetus/lapetus/cd.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- cd.h 9 Jan 2008 05:04:21 -0000 1.3 +++ cd.h 29 May 2009 04:15:42 -0000 1.4 @@ -97,4 +97,5 @@ int CDReadSector(void *buffer, u32 FAD, int sectorsize, u32 numbytes); int PlayCDAudio(u8 audiotrack, u8 repeat, u8 vol_l, u8 vol_r); int StopCDAudio(void); +int CDGetSessionNum(u8 *num); #endif |