Nugget
cdrom.h
1 /*
2 
3 MIT License
4 
5 Copyright (c) 2020 PCSX-Redux authors
6 
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to deal
9 in the Software without restriction, including without limitation the rights
10 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
13 
14 The above copyright notice and this permission notice shall be included in all
15 copies or substantial portions of the Software.
16 
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 SOFTWARE.
24 
25 */
26 
27 #pragma once
28 
29 #include "common/hardware/hwregs.h"
30 
31 #define CDROM_REG0 HW_U8(0x1f801800)
32 #define CDROM_REG1 HW_U8(0x1f801801)
33 #define CDROM_REG2 HW_U8(0x1f801802)
34 #define CDROM_REG3 HW_U8(0x1f801803)
35 
36 #define CDROM_REG0_UC HW_U8(0xbf801800)
37 #define CDROM_REG1_UC HW_U8(0xbf801801)
38 #define CDROM_REG2_UC HW_U8(0xbf801802)
39 #define CDROM_REG3_UC HW_U8(0xbf801803)
40 
41 enum {
42  CDL_SYNC = 0,
43  CDL_NOP = 1,
44  CDL_SETLOC = 2,
45  CDL_PLAY = 3,
46  CDL_FORWARD = 4,
47  CDL_BACKWARD = 5,
48  CDL_READN = 6,
49  CDL_STANDBY = 7,
50  CDL_STOP = 8,
51  CDL_PAUSE = 9,
52  CDL_INIT = 10,
53  CDL_MUTE = 11,
54  CDL_DEMUTE = 12,
55  CDL_SETFILTER = 13,
56  CDL_SETMODE = 14,
57  CDL_GETMODE = 15,
58  CDL_GETLOCL = 16,
59  CDL_GETLOCP = 17,
60  CDL_READT = 18,
61  CDL_GETTN = 19,
62  CDL_GETTD = 20,
63  CDL_SEEKL = 21,
64  CDL_SEEKP = 22,
65  CDL_SETCLOCK = 23,
66  CDL_GETCLOCK = 24,
67  CDL_TEST = 25,
68  CDL_GETID = 26,
69  CDL_READS = 27,
70  CDL_RESET = 28,
71  CDL_GETQ = 29,
72  CDL_READTOC = 30,
73 };