From 4738b8581e932174f9ab99d21c6a24024fb6414d Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Mon, 28 Oct 2024 20:11:15 +1300 Subject: Restructure the library The main type of the library is now the BedrockEmulator type, which contains a new BedrockCore type and an instance of a user-implemented DeviceBus trait. This new structure makes it possible to hot-swap a device bus while a BedrockEmulator is running, which keeps the core and the device bus well separated. This was important when bedrock-pc was going to have two graphical emulator types and upgrade from one to the other once the screen device was accessed. The new structure also vastly simplifies the code previously required with the old Bedrock type, which was parametric over 16 device types and so needed each device type to be enumerated in every place the Bedrock type was stored. The new BedrockEmulator type is only parametric over the particular DeviceBus implementation. --- src/signal.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/signal.rs (limited to 'src/signal.rs') diff --git a/src/signal.rs b/src/signal.rs new file mode 100644 index 0000000..9959901 --- /dev/null +++ b/src/signal.rs @@ -0,0 +1,12 @@ +#[derive(Copy, Clone, Debug)] +pub enum Signal { + Sleep, + Fork, + Halt, + Debug1, + Debug2, + Debug3, + Debug4, + Debug5, + Debug6, +} -- cgit v1.2.3-70-g09d2