1 |
/* PCSX2 - PS2 Emulator for PCs |
2 |
* Copyright (C) 2002-2010 PCSX2 Dev Team |
3 |
* |
4 |
* PCSX2 is free software: you can redistribute it and/or modify it under the terms |
5 |
* of the GNU Lesser General Public License as published by the Free Software Found- |
6 |
* ation, either version 3 of the License, or (at your option) any later version. |
7 |
* |
8 |
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
9 |
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
10 |
* PURPOSE. See the GNU General Public License for more details. |
11 |
* |
12 |
* You should have received a copy of the GNU General Public License along with PCSX2. |
13 |
* If not, see <http://www.gnu.org/licenses/>. |
14 |
*/ |
15 |
|
16 |
#pragma once |
17 |
|
18 |
#include "Plugins.h" |
19 |
|
20 |
enum CDVD_SourceType |
21 |
{ |
22 |
CDVDsrc_Iso = 0, // use built in ISO api |
23 |
CDVDsrc_Plugin, // use external plugin |
24 |
CDVDsrc_NoDisc, // use built in CDVDnull |
25 |
}; |
26 |
|
27 |
struct CDVD_API |
28 |
{ |
29 |
void (CALLBACK *close)(); |
30 |
|
31 |
// Don't need init or shutdown. iso/nodisc have no init/shutdown and plugin's |
32 |
// is handled by the PluginManager. |
33 |
|
34 |
// Don't need plugin specific things like freeze, test, or other stuff here. |
35 |
// Those are handled by the plugin manager specifically. |
36 |
|
37 |
_CDVDopen open; |
38 |
_CDVDreadTrack readTrack; |
39 |
_CDVDgetBuffer getBuffer; |
40 |
_CDVDreadSubQ readSubQ; |
41 |
_CDVDgetTN getTN; |
42 |
_CDVDgetTD getTD; |
43 |
_CDVDgetTOC getTOC; |
44 |
_CDVDgetDiskType getDiskType; |
45 |
_CDVDgetTrayStatus getTrayStatus; |
46 |
_CDVDctrlTrayOpen ctrlTrayOpen; |
47 |
_CDVDctrlTrayClose ctrlTrayClose; |
48 |
_CDVDnewDiskCB newDiskCB; |
49 |
|
50 |
// special functions, not in external interface yet |
51 |
_CDVDreadSector readSector; |
52 |
_CDVDgetBuffer2 getBuffer2; |
53 |
_CDVDgetDualInfo getDualInfo; |
54 |
}; |
55 |
|
56 |
// ---------------------------------------------------------------------------- |
57 |
// Multiple interface system for CDVD, used to provide internal CDVDiso and NoDisc, |
58 |
// and external plugin interfaces. Do* functions are meant as replacements for |
59 |
// direct CDVD plugin invocation, and add universal block dumping features. |
60 |
// ---------------------------------------------------------------------------- |
61 |
|
62 |
extern CDVD_API* CDVD; // currently active CDVD access mode api (either Iso, NoDisc, or Plugin) |
63 |
|
64 |
extern CDVD_API CDVDapi_Plugin; |
65 |
extern CDVD_API CDVDapi_Iso; |
66 |
extern CDVD_API CDVDapi_NoDisc; |
67 |
|
68 |
extern const wxChar* CDVD_SourceLabels[]; |
69 |
|
70 |
extern void CDVDsys_ChangeSource( CDVD_SourceType type ); |
71 |
extern void CDVDsys_SetFile( CDVD_SourceType srctype, const wxString& newfile ); |
72 |
extern const wxString& CDVDsys_GetFile( CDVD_SourceType srctype ); |
73 |
extern CDVD_SourceType CDVDsys_GetSourceType(); |
74 |
|
75 |
extern bool DoCDVDopen(); |
76 |
extern void DoCDVDclose(); |
77 |
extern s32 DoCDVDreadSector(u8* buffer, u32 lsn, int mode); |
78 |
extern s32 DoCDVDreadTrack(u32 lsn, int mode); |
79 |
extern s32 DoCDVDgetBuffer(u8* buffer); |
80 |
extern s32 DoCDVDdetectDiskType(); |
81 |
extern void DoCDVDresetDiskTypeCache(); |
82 |
|