pcenginecd_rust/lib.rs
1//! A Rust PC Engine CD-ROM² / Super CD-ROM² / Arcade Card, transcribed from
2//! [pcenginecd-python](https://github.com/alewman/pcenginecd-python) at `v0.1.0` (`5fec99e`) as
3//! an add-on to [pcengine-rust](../pcengine_rust/index.html): the System Card in the HuCard
4//! slot, the CD unit on the expansion port, through the base board's socket traits and nothing
5//! copied from it.
6//!
7//! Each module is the transcription of the `pcenginecd_python` module of the same name, with
8//! every named switch as a field with the reference's default; where Rust forced a difference
9//! the module header says so. `disc` is the one module designed for the browser: the sector
10//! store is a trait and the cue sheet is parsed from text.
11//!
12//! ```
13//! use pcenginecd_rust::board::{self, PcEngineCd};
14//! use pcenginecd_rust::disc::Disc;
15//!
16//! let system_card = vec![0xEAu8; 256 * 1024]; // the BIOS image (bring your own)
17//! let disc = Disc::from_memory(vec![(true, vec![0u8; 2352 * 16])]).unwrap();
18//! let mut machine = PcEngineCd::new(&system_card, Some(disc));
19//! machine.arcade_card = true;
20//! let mut system = machine.build().unwrap();
21//! system.run_frame();
22//! let _samples = system.board_mut().take_audio(); // PSG + CD audio + ADPCM, 44.1 kHz
23//! let _backup: Vec<u8> = board::unit(system.board_mut()).unwrap().bram().to_vec();
24//! ```
25
26pub mod adpcm;
27pub mod arcade;
28pub mod board;
29pub mod cdda;
30pub mod disc;
31pub mod scsi;
32pub mod seek;
33pub mod syscard;
34pub mod trace;
35pub mod unit;
36
37pub use arcade::ArcadeCard;
38pub use board::PcEngineCd;
39pub use disc::{Disc, Track};
40pub use pcengine_rust;
41pub use syscard::SystemCard;
42pub use unit::CdUnit;
43
44/// The README's example, compiled with the documentation tests.
45#[cfg(doctest)]
46#[doc = include_str!("../README.md")]
47pub struct ReadmeExample;