/[pcsx2_0.9.7]/trunk/plugins/CDVDpeops/cdda.c
ViewVC logotype

Contents of /trunk/plugins/CDVDpeops/cdda.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 31 - (show annotations) (download)
Tue Sep 7 03:24:11 2010 UTC (9 years, 11 months ago) by william
File MIME type: text/plain
File size: 2717 byte(s)
committing r3113 initial commit again...
1 /***************************************************************************
2 cdda.c - description
3 -------------------
4 begin : Wed Sep 18 2002
5 copyright : (C) 2002 by Pete Bernert
6 email : BlackDove@addcom.de
7 ***************************************************************************/
8
9 /***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. See also the license.txt file for *
15 * additional informations. *
16 * *
17 ***************************************************************************/
18
19 //*************************************************************************//
20 // History of changes:
21 //
22 // 2002/09/19 - Pete
23 // - generic cleanup for the Peops release
24 //
25 //*************************************************************************//
26
27 /////////////////////////////////////////////////////////
28
29 #include "stdafx.h"
30 #define _IN_CDDA
31 #include "externals.h"
32
33 /////////////////////////////////////////////////////////
34 // starts/stops audio playing (addr==0 -> stop)
35 // note: no cdda support in PS2 plugins yet
36
37 BOOL DoCDDAPlay(unsigned long addr)
38 {
39 DWORD dw;
40
41 LockGenCDAccess();
42
43 if(addr) dw=PlaySCSIAudio(addr,lMaxAddr-addr); // start playing (til end of cd)
44 // mmm... this stop doesn't work right
45 // else dw=PlayFunc(0,1);
46 else // funny stop... but seems to work
47 {
48 unsigned char cdb[3000];
49 FRAMEBUF * f=(FRAMEBUF *)cdb;
50
51 f->dwFrame = 16; // -> use an existing address (16 will ever exist on ps2 cds/dvds)
52 f->dwFrameCnt = 1;
53 f->dwBufLen = 2352;
54
55 dw=pReadFunc(1,f); // -> do a simply sync read... seems to stop all audio playing
56 }
57
58 UnlockGenCDAccess();
59
60 if(dw!=SS_COMP) return FALSE;
61 return TRUE;
62 }
63
64 /////////////////////////////////////////////////////////
65 // get curr playing pos
66
67 unsigned char * GetCDDAPlayPosition(void)
68 {
69 unsigned char * pos;
70
71 LockGenCDAccess();
72
73 pos=GetSCSIAudioSub(); // get the pos (scsi command)
74
75 UnlockGenCDAccess();
76
77 return pos;
78 }
79
80 /////////////////////////////////////////////////////////

  ViewVC Help
Powered by ViewVC 1.1.22