forked from xjsxjs197/WiiSXRX_2022
-
Notifications
You must be signed in to change notification settings - Fork 2
/
cdrom.h
79 lines (68 loc) · 3.03 KB
/
cdrom.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/***************************************************************************
* Copyright (C) 2007 Ryan Schultz, PCSX-df Team, PCSX team *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307 USA. *
***************************************************************************/
#ifndef __CDROM_H__
#define __CDROM_H__
#ifdef __cplusplus
extern "C" {
#endif
#include "psxcommon.h"
#include "decode_xa.h"
#include "r3000a.h"
#include "plugins.h"
#include "psxmem.h"
#include "psxhw.h"
//#define btoi(b) ((b) / 16 * 10 + (b) % 16) /* BCD to u_char */
//#define btoi(b) (((b) >> 4) * 10 + ((b) & 15)) /* BCD to u_char */
#define btoi(b) (btoiBuf[b]) /* BCD to u_char */
//#define itob(i) ((i) / 10 * 16 + (i) % 10) /* u_char to BCD */
//#define itob(i) ((((i) / 10) << 4) + (i) % 10) /* u_char to BCD */
#define itob(i) (itobBuf[i]) /* u_char to BCD */
#define MIN_VALUE(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a < _b ? _a : _b; })
#define MAX_VALUE(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a > _b ? _a : _b; })
#define MSF2SECT_OLD(m, s, f) (((m) * 60 + (s) - 2) * 75 + (f))
#define MSF2SECT(m, s, f) (msf2SectM[(m)] + msf2SectS[(s)] - 150 + (f))
#define CD_FRAMESIZE_RAW 2352
#define DATA_SIZE (CD_FRAMESIZE_RAW - 12)
#define SUB_FRAMESIZE 96
//extern cdrStruct cdr;
extern unsigned char btoiBuf[];
extern unsigned char itobBuf[];
extern int msf2SectM[];
extern int msf2SectS[];
extern int msf2SectMNoItob[];
extern int msf2SectSNoItob[];
void cdrReset();
void cdrInterrupt(void);
void cdrPlayReadInterrupt(void);
void cdrLidSeekInterrupt(void);
void cdrDmaInterrupt(void);
void LidInterrupt(void);
unsigned char cdrRead0(void);
unsigned char cdrRead1(void);
unsigned char cdrRead2(void);
unsigned char cdrRead3(void);
void cdrWrite0(unsigned char rt);
void cdrWrite1(unsigned char rt);
void cdrWrite2(unsigned char rt);
void cdrWrite3(unsigned char rt);
int cdrFreeze(gzFile f, int Mode);
#ifdef __cplusplus
}
#endif
#endif