uxn/src/device.rs

20 lines
483 B
Rust
Raw Normal View History

2022-12-19 07:29:30 +00:00
pub mod console;
pub mod null;
pub mod system;
use crate::vm::Uxn;
pub trait Device: std::fmt::Debug {
/**
* Callbacks used by UXN to do input from a "device".
*/
fn dei1(&mut self, vm: &mut Uxn, port: u8) -> u8;
fn dei2(&mut self, vm: &mut Uxn, port: u8) -> u16;
/**
* Callback used by UXN to do output through a "device".
*/
fn deo1(&mut self, vm: &mut Uxn, port: u8, val: u8);
fn deo2(&mut self, vm: &mut Uxn, port: u8, val: u16);
}