summaryrefslogtreecommitdiff
path: root/libpsx/include/psxcdrom.h
blob: 2f18e68c2643dd2b04207cabd9612f8dbec230ff (plain) (blame)
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
80
81
82
#ifndef _PSXCDROM_H
#define _PSXCDROM_H

#define CDSTATUS_PLAY			0x80
#define CDSTATUS_SEEK			0x40
#define CDSTATUS_SHELLOPEN	0x10

// Command names

enum
{
	CdlSync = 0, 
	CdlNop = 1,  CdlGetstat = 1,
	CdlSetloc = 2, 
	CdlPlay = 3,
	CdlForward = 4, 
	CdlBackward = 5, 
	CdlReadN = 6, 
	CdlStandby = 7,
	CdlStop = 8,
	CdlPause = 9, 
	CdlInit = 10, 
	CdlMute = 11,
	CdlDemute = 12,
	CdlSetfilter = 13,
	CdlSetmode = 14,
	CdlSetparam = 15,
	CdlGetlocL = 16,
	CdlGetlocP = 17, 
	CdlCmd18 = 18,
	CdlGetTN = 19,
	CdlGetTD = 20, 
	CdlSeekL = 21, 
	CdlSeekP = 22, 
	CdlCmd23 = 23,
	CdlCmd24 = 24, 
	CdlTest = 25, 
	CdlID = 26,
	CdlReadS = 27,
	CdlReset = 28, 
	CdlCmd29 = 29, 
	CdlReadTOC = 30
};

/*
 * Send a low-level CDROM command
 * cmd = command number
 * num = number of arguments
 * ... = arguments
 */

void CdSendCommand(int cmd, int num, ...);

/**
 * Reads the results of a low-level CDROM command
 *
 * @param out Pointer to array of chars where the output will be stored
 * @param max Maximum number of bytes to store
 *
 * Return value: number of results.
 */

int CdReadResults(unsigned char *out, int max);

/**
 * Gets CDROM drive status
 * @return CDROM drive status bitmask
 */

int CdGetStatus(void);

/**
 * Play an Audio CD track
 * @return 1 on success, 0 on failure
 */

int CdPlayTrack(unsigned int track);

unsigned char CdRamRead(unsigned short addr);


#endif