pcengine_rust/
lib.rs

1//! A Rust PC Engine / TurboGrafx-16 board transcribed from
2//! [pcengine-python](https://github.com/alewman/pcengine-python) at `v0.1.0`
3//! (`bc9b976`) and proven equivalent to it: every CPU bus cycle, every frame's
4//! picture at the 9-bit palette value, every mixed audio sample.
5//!
6//! Each module is the transcription of one `pcengine_python` module, with the
7//! same names, every named switch as a field with the reference's default, and
8//! the comments that cite a source carried over. Where Rust forced a
9//! difference, the module header says so.
10//!
11//! ```
12//! use pcengine_rust::board::{Board, BoardOptions};
13//! use pcengine_rust::cards::make_card;
14//! use pcengine_rust::pads::{Pad2, RUN};
15//! use pcengine_rust::system::System;
16//!
17//! let image = vec![0u8; 0x2000]; // a HuCard image (bring your own)
18//! let board = Board::new(BoardOptions {
19//!     card: Some(make_card(&image).unwrap()),
20//!     pad: Some(Box::new(Pad2::new())),
21//!     ..BoardOptions::default()
22//! })
23//! .unwrap();
24//! let mut system = System::new(board);
25//! system.board_mut().set_pressed(0, RUN);
26//! system.run_frame();
27//! let _samples = system.board_mut().take_audio(); // 44.1 kHz stereo
28//! let _picture = system.board().capture.last_frame.as_ref(); // 242 rows of 9-bit values
29//! ```
30
31pub mod board;
32pub mod cards;
33pub mod cpu_io;
34pub mod fake_devices;
35pub mod hardware_page;
36pub mod machine;
37pub mod mixer;
38pub mod mt;
39pub mod pads;
40pub mod pagetable;
41pub mod psg;
42pub mod sockets;
43pub mod state;
44pub mod system;
45pub mod trace;
46pub mod vce;
47pub mod vdc;
48pub mod video;
49
50pub use huc6280;