From 1a830a3d1b9d99653322d5ae49ea8165de7ed9d0 Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Mon, 28 Oct 2024 20:25:01 +1300 Subject: Rewrite emulator This is a complete rewrite and restructure of the entire emulator project, as part of the effort in locking down the Bedrock specification and in creating much better tooling for creating and using Bedrock programs. This commit adds a command-line argument scheme, an embedded assembler, a headless emulator for use in non-graphical environments, deferred window creation for programs that do not access the screen device, and new versions of phosphor and bedrock-core. The new version of phosphor supports multi-window programs, which will make it possible to implement program forking in the system device later on, and the new version of bedrock-core implements the final core specification. --- src/emulators.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/emulators.rs (limited to 'src/emulators.rs') diff --git a/src/emulators.rs b/src/emulators.rs new file mode 100644 index 0000000..68bf0ce --- /dev/null +++ b/src/emulators.rs @@ -0,0 +1,27 @@ +mod headless_emulator; +mod graphical_emulator; + +pub use headless_emulator::{HeadlessEmulator, HeadlessDeviceBus}; +pub use graphical_emulator::{GraphicalEmulator, GraphicalDeviceBus}; + +use crate::*; + +use phosphor::Colour; + + +pub enum EmulatorSignal { + Promote, + Halt, +} + + +pub struct EmulatorConfig { + pub dimensions: ScreenDimensions, + pub fullscreen: bool, + pub scale: u32, + pub debug_palette: Option<[Colour; 16]>, + + pub initial_transmission: Option>, + pub encode_stdin: bool, + pub encode_stdout: bool, +} -- cgit v1.2.3-70-g09d2