1 |
/* CDVDiso |
2 |
* Copyright (C) 2002-2004 CDVDiso Team |
3 |
* |
4 |
* This program is free software; you can redistribute it and/or modify |
5 |
* it under the terms of the GNU General Public License as published by |
6 |
* the Free Software Foundation; either version 2 of the License, or |
7 |
* (at your option) any later version. |
8 |
* |
9 |
* This program is distributed in the hope that it will be useful, |
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 |
* GNU General Public License for more details. |
13 |
* |
14 |
* You should have received a copy of the GNU General Public License |
15 |
* along with this program; if not, write to the Free Software |
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 |
*/ |
18 |
|
19 |
#ifndef __CDVDISO_H__ |
20 |
#define __CDVDISO_H__ |
21 |
|
22 |
#ifdef _MSC_VER |
23 |
#pragma warning(disable:4018) |
24 |
#endif |
25 |
|
26 |
#include "PS2Edefs.h" |
27 |
#include "libiso.h" |
28 |
|
29 |
#ifdef __cplusplus |
30 |
|
31 |
#ifdef _MSC_VER |
32 |
#define EXPORT_C_(type) extern "C" __declspec(dllexport) type CALLBACK |
33 |
#else |
34 |
#define EXPORT_C_(type) extern "C" type |
35 |
#endif |
36 |
|
37 |
#else |
38 |
|
39 |
#ifdef _MSC_VER |
40 |
#define EXPORT_C_(type) __declspec(dllexport) type __stdcall |
41 |
#else |
42 |
#define EXPORT_C_(type) type |
43 |
#endif |
44 |
|
45 |
#endif |
46 |
|
47 |
EXPORT_C_(u32) PS2EgetLibType(); |
48 |
EXPORT_C_(u32) PS2EgetLibVersion2(u32 type); |
49 |
EXPORT_C_(char*) PS2EgetLibName(); |
50 |
|
51 |
|
52 |
EXPORT_C_(s32) CDVDinit(); |
53 |
EXPORT_C_(s32) CDVDopen(const char* pTitleFilename); |
54 |
EXPORT_C_(void) CDVDclose(); |
55 |
EXPORT_C_(void) CDVDshutdown(); |
56 |
EXPORT_C_(s32) CDVDreadTrack(u32 lsn, int mode); |
57 |
|
58 |
// return can be NULL (for async modes) |
59 |
EXPORT_C_(u8*) CDVDgetBuffer(); |
60 |
|
61 |
EXPORT_C_(s32) CDVDreadSubQ(u32 lsn, cdvdSubQ* subq);//read subq from disc (only cds have subq data) |
62 |
EXPORT_C_(s32) CDVDgetTN(cdvdTN *Buffer); //disk information |
63 |
EXPORT_C_(s32) CDVDgetTD(u8 Track, cdvdTD *Buffer); //track info: min,sec,frame,type |
64 |
EXPORT_C_(s32) CDVDgetTOC(void* toc); //gets ps2 style toc from disc |
65 |
EXPORT_C_(s32) CDVDgetDiskType(); //CDVD_TYPE_xxxx |
66 |
EXPORT_C_(s32) CDVDgetTrayStatus(); //CDVD_TRAY_xxxx |
67 |
EXPORT_C_(s32) CDVDctrlTrayOpen(); //open disc tray |
68 |
EXPORT_C_(s32) CDVDctrlTrayClose(); //close disc tray |
69 |
|
70 |
// extended funcs |
71 |
|
72 |
EXPORT_C_(void) CDVDconfigure(); |
73 |
EXPORT_C_(void) CDVDabout(); |
74 |
EXPORT_C_(s32) CDVDtest(); |
75 |
EXPORT_C_(void) CDVDnewDiskCB(void (*callback)()); |
76 |
|
77 |
#define CDVD_LOG __Log |
78 |
extern FILE *cdvdLog; |
79 |
|
80 |
void __Log(char *fmt, ...); |
81 |
|
82 |
#define VERBOSE 1 |
83 |
|
84 |
#define DEV_DEF "" |
85 |
#define CDDEV_DEF "/dev/cdrom" |
86 |
|
87 |
typedef struct |
88 |
{ |
89 |
int slsn; |
90 |
int elsn; |
91 |
#ifdef _WINDOWS_ |
92 |
HANDLE handle; |
93 |
#else |
94 |
FILE *handle; |
95 |
#endif |
96 |
} _cdIso; |
97 |
|
98 |
extern _cdIso cdIso[8]; |
99 |
|
100 |
#define CD_FRAMESIZE_RAW 2352 |
101 |
#define DATA_SIZE (CD_FRAMESIZE_RAW-12) |
102 |
|
103 |
#define itob(i) ((i)/10*16 + (i)%10) /* u_char to BCD */ |
104 |
#define btoi(b) ((b)/16*10 + (b)%16) /* BCD to u_char */ |
105 |
|
106 |
#define MSF2SECT(m,s,f) (((m)*60+(s)-2)*75+(f)) |
107 |
|
108 |
extern const u8 version; |
109 |
extern const u8 revision; |
110 |
extern const u8 build; |
111 |
|
112 |
extern char IsoFile[256]; |
113 |
extern char IsoCWD[256]; |
114 |
extern char CdDev[256]; |
115 |
|
116 |
extern int BlockDump; |
117 |
extern isoFile *fdump; |
118 |
extern isoFile *iso; |
119 |
|
120 |
extern u8 cdbuffer[]; |
121 |
extern u8 *pbuffer; |
122 |
extern int cdblocksize; |
123 |
extern int cdblockofs; |
124 |
extern int cdoffset; |
125 |
extern int cdtype; |
126 |
extern int cdblocks; |
127 |
|
128 |
extern int Zmode; // 1 Z - 2 bz2 |
129 |
extern int fmode; // 0 - file / 1 - Zfile |
130 |
extern char *Ztable; |
131 |
|
132 |
extern char *methods[]; |
133 |
|
134 |
void UpdateZmode(); |
135 |
void CfgOpenFile(); |
136 |
void SysMessage(char *fmt, ...); |
137 |
|
138 |
#endif |