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
//! A fast and accurate instruction-stepped Z80 emulator written in C11 and ported to Rust
//!
//! Basic usage:
//! ```rust
//!use z80::{Z80, Z80_io};
//!
//!struct IO {
//! pub mem: [u8; 0x10000],
//!}
//!
//!impl Z80_io for IO {
//! fn read_byte(&self, addr: u16) -> u8 {
//! self.mem[addr as usize]
//! }
//!
//! fn write_byte(&mut self, addr: u16, value: u8) {
//! self.mem[addr as usize] = value;
//! }
//!}
//!
//!let mut cpu = Z80::new(IO {
//! mem: [0; 0x10000],
//!});
//!
//!let rom = vec![0, 0, 0]; // etc
//!
//!for (i, byte) in rom.iter().enumerate() {
//! cpu.io.write_byte(i as _, *byte);
//!}
//!
//!loop {
//! cpu.step();
//! break;
//!}
//!```
pub use *;