From 6bf7c7425eb27eff1b48169d793871a60eb858d8 Mon Sep 17 00:00:00 2001 From: Reid 'arrdem' McKenzie Date: Mon, 19 Dec 2022 00:34:35 -0700 Subject: [PATCH] [NO TESTS] WIP --- src/device/console.rs | 5 ++++- src/device/null.rs | 3 +++ src/device/system.rs | 7 +++++-- src/vm.rs | 2 ++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/device/console.rs b/src/device/console.rs index f0b23a7..4ce9d44 100644 --- a/src/device/console.rs +++ b/src/device/console.rs @@ -1,3 +1,6 @@ +use crate::device::Device; +use crate::vm::Uxn; + /** * The system console device * @@ -11,7 +14,7 @@ * */ #[derive(Debug)] -struct ConsoleDevice { +pub struct ConsoleDevice { vector: u16, inbuffer: [u8; 256], inidx: usize, diff --git a/src/device/null.rs b/src/device/null.rs index 290b18d..e4eb58c 100644 --- a/src/device/null.rs +++ b/src/device/null.rs @@ -1,3 +1,6 @@ +use crate::device::Device; +use crate::vm::Uxn; + /** * The null device does nothing when reading or writing. */ diff --git a/src/device/system.rs b/src/device/system.rs index f871813..d29418c 100644 --- a/src/device/system.rs +++ b/src/device/system.rs @@ -1,13 +1,16 @@ +use crate::device::Device; +use crate::vm::Uxn; + /** * The system device */ #[derive(Debug)] -struct SystemDevice { +pub struct SystemDevice { buffer: [u8; 0xF], } impl SystemDevice { - fn new() -> SystemDevice { + pub fn new() -> SystemDevice { SystemDevice { buffer: [0; 0xF] } } } diff --git a/src/vm.rs b/src/vm.rs index e708a37..d1f48fc 100644 --- a/src/vm.rs +++ b/src/vm.rs @@ -2,6 +2,8 @@ use std::cell::RefCell; use std::rc::Rc; use std::*; +use crate::device::null::NullDevice; +use crate::device::system::SystemDevice; use crate::device::*; use crate::memory::*; use crate::stack::*;