Skip to main content
← PSoXide SDK guides and examples · SDK f2fec1c301f1 · All Cargo features enabled; check feature gates before use.

psx_io/
cdrom.rs

1//! Renamed to [`crate::cd`].
2//!
3//! Every item here forwards to its new name and is deprecated; the
4//! register constants moved to [`psx_hw::cd`].
5
6use crate::cd;
7use crate::periph::Cd;
8
9/// A token for a forwarder that never took one.
10fn token() -> Cd {
11    // SAFETY: a token is a logic guard, not a memory-safety one (see
12    // `crate::periph`), and the old free functions never took one.
13    unsafe { Cd::steal() }
14}
15
16/// Moved to [`cd::PlayPosition`].
17#[deprecated(note = "moved to `psx_io::cd::PlayPosition`")]
18pub type PlayPosition = cd::PlayPosition;
19/// Moved to [`cd::SectorPollError`].
20#[deprecated(note = "moved to `psx_io::cd::SectorPollError`")]
21pub type SectorPollError = cd::SectorPollError;
22
23/// Moved to [`cd::try_command`].
24#[deprecated(note = "moved to `psx_io::cd::try_command`")]
25#[inline(always)]
26pub fn try_command(command: u8, params: &[u8], spin_limit: u32) -> Option<cd::Response> {
27    token().try_command(command, params, spin_limit)
28}
29
30/// Moved to [`cd::irq_flag_value`].
31#[deprecated(note = "moved to `psx_io::cd::irq_flag_value`")]
32#[inline(always)]
33pub fn irq_flag_value() -> u8 {
34    token().irq_flag_value()
35}
36
37/// Moved to [`cd::acknowledge_irq`].
38#[deprecated(note = "moved to `psx_io::cd::acknowledge_irq`")]
39#[inline(always)]
40pub fn acknowledge_irq(bits: u8) {
41    token().acknowledge_irq(bits)
42}
43
44/// Moved to [`cd::discard_response`].
45#[deprecated(note = "moved to `psx_io::cd::discard_response`")]
46#[inline(always)]
47pub fn discard_response() {
48    token().discard_response()
49}
50
51/// Moved to [`cd::dispatch_command`].
52#[deprecated(note = "moved to `psx_io::cd::dispatch_command`")]
53#[inline(always)]
54pub fn dispatch_command(command: u8, params: &[u8], spin_limit: u32) -> Option<u8> {
55    token().dispatch_command(command, params, spin_limit)
56}
57
58/// Moved to [`cd::restore_irq_output`].
59#[deprecated(note = "moved to `psx_io::cd::restore_irq_output`")]
60#[inline(always)]
61pub fn restore_irq_output(saved: u8) {
62    token().restore_irq_output(saved)
63}
64
65/// Moved to [`cd::poll_data_sector`].
66#[deprecated(note = "moved to `psx_io::cd::poll_data_sector`")]
67#[inline(always)]
68pub fn poll_data_sector() -> Result<bool, cd::SectorPollError> {
69    token().poll_data_sector()
70}
71
72/// Renamed to [`cd::try_status`].
73#[deprecated(note = "renamed to `psx_io::cd::try_status`")]
74#[inline(always)]
75pub fn try_get_stat(spin_limit: u32) -> Option<cd::Response> {
76    token().try_status(spin_limit)
77}
78
79/// Moved to [`cd::try_set_mode`].
80#[deprecated(note = "moved to `psx_io::cd::try_set_mode`")]
81#[inline(always)]
82pub fn try_set_mode(mode: u8, spin_limit: u32) -> Option<cd::Response> {
83    token().try_set_mode(mode, spin_limit)
84}
85
86/// Renamed to [`cd::try_set_target_lba`].
87#[deprecated(note = "renamed to `psx_io::cd::try_set_target_lba`")]
88#[inline(always)]
89pub fn try_set_loc_lba(lba: u32, spin_limit: u32) -> Option<cd::Response> {
90    token().try_set_target_lba(lba, spin_limit)
91}
92
93/// Renamed to [`cd::try_unmute`].
94#[deprecated(note = "renamed to `psx_io::cd::try_unmute`")]
95#[inline(always)]
96pub fn try_demute(spin_limit: u32) -> Option<cd::Response> {
97    token().try_unmute(spin_limit)
98}
99
100/// Moved to [`crate::periph::Cd::try_pause`].
101#[deprecated(note = "use `Cd::try_pause` with the `Cd` token")]
102#[inline(always)]
103pub fn try_pause(spin_limit: u32) -> Option<cd::Response> {
104    token().try_pause(spin_limit)
105}
106
107/// Moved to [`cd::try_pause_until_complete`].
108#[deprecated(note = "moved to `psx_io::cd::try_pause_until_complete`")]
109#[inline(always)]
110pub fn try_pause_until_complete(spin_limit: u32) -> bool {
111    token().try_pause_until_complete(spin_limit)
112}
113
114/// Moved to [`cd::bin_to_bcd`].
115#[deprecated(note = "moved to `psx_io::cd::bin_to_bcd`")]
116#[inline(always)]
117pub const fn bin_to_bcd(v: u8) -> u8 {
118    cd::bin_to_bcd(v)
119}
120
121/// Moved to [`cd::bcd_to_bin`].
122#[deprecated(note = "moved to `psx_io::cd::bcd_to_bin`")]
123#[inline(always)]
124pub const fn bcd_to_bin(v: u8) -> u8 {
125    cd::bcd_to_bin(v)
126}
127
128/// Renamed to [`cd::try_play_position`].
129#[deprecated(note = "renamed to `psx_io::cd::try_play_position`")]
130#[inline(always)]
131pub fn try_get_loc_p(spin_limit: u32) -> Option<cd::Response> {
132    token().try_play_position(spin_limit)
133}
134
135/// Moved to [`crate::periph::Cd::set_audio_mixer`].
136#[deprecated(note = "use `Cd::set_audio_mixer` with the `Cd` token")]
137#[inline(always)]
138pub fn set_audio_mixer(left_to_left: u8, left_to_right: u8, right_to_right: u8, right_to_left: u8) {
139    token().set_audio_mixer(left_to_left, left_to_right, right_to_right, right_to_left)
140}
141
142/// Moved to [`psx_hw::cd::BASE`].
143#[deprecated(note = "moved to `psx_hw::cd::BASE`")]
144pub const BASE: u32 = psx_hw::cd::BASE;
145
146/// Moved to [`psx_hw::cd::MODE_CDDA`].
147#[deprecated(note = "moved to `psx_hw::cd::MODE_CDDA`")]
148pub const MODE_CDDA: u8 = psx_hw::cd::MODE_CDDA;
149
150/// Moved to [`psx_hw::cd::MODE_AUTO_PAUSE`].
151#[deprecated(note = "moved to `psx_hw::cd::MODE_AUTO_PAUSE`")]
152pub const MODE_AUTO_PAUSE: u8 = psx_hw::cd::MODE_AUTO_PAUSE;
153
154/// Moved to [`psx_hw::cd::MODE_DOUBLE_SPEED`].
155#[deprecated(note = "moved to `psx_hw::cd::MODE_DOUBLE_SPEED`")]
156pub const MODE_DOUBLE_SPEED: u8 = psx_hw::cd::MODE_DOUBLE_SPEED;
157
158/// Moved to [`psx_hw::cd::CMD_SETLOC`].
159#[deprecated(note = "moved to `psx_hw::cd::CMD_SETLOC`")]
160pub const CMD_SETLOC: u8 = psx_hw::cd::CMD_SETLOC;
161
162/// Moved to [`psx_hw::cd::CMD_READN`].
163#[deprecated(note = "moved to `psx_hw::cd::CMD_READN`")]
164pub const CMD_READN: u8 = psx_hw::cd::CMD_READN;
165
166/// Moved to [`psx_hw::cd::CMD_GETSTAT`].
167#[deprecated(note = "moved to `psx_hw::cd::CMD_GETSTAT`")]
168pub const CMD_GETSTAT: u8 = psx_hw::cd::CMD_GETSTAT;
169
170/// Moved to [`psx_hw::cd::CMD_PAUSE`].
171#[deprecated(note = "moved to `psx_hw::cd::CMD_PAUSE`")]
172pub const CMD_PAUSE: u8 = psx_hw::cd::CMD_PAUSE;
173
174/// Moved to [`psx_hw::cd::CMD_SETMODE`].
175#[deprecated(note = "moved to `psx_hw::cd::CMD_SETMODE`")]
176pub const CMD_SETMODE: u8 = psx_hw::cd::CMD_SETMODE;
177
178/// Moved to [`psx_hw::cd::CMD_SEEKL`].
179#[deprecated(note = "moved to `psx_hw::cd::CMD_SEEKL`")]
180pub const CMD_SEEKL: u8 = psx_hw::cd::CMD_SEEKL;