summaryrefslogtreecommitdiff
path: root/src/signal.rs
diff options
context:
space:
mode:
authorBen Bridle <bridle.benjamin@gmail.com>2024-10-28 20:11:15 +1300
committerBen Bridle <bridle.benjamin@gmail.com>2024-10-28 20:11:15 +1300
commit4738b8581e932174f9ab99d21c6a24024fb6414d (patch)
tree7e0f53318a1292bb283518c80dec647bf17946a5 /src/signal.rs
parentb0d04c9b28efc90bc6f1cfcc6d2c4d3e646099fb (diff)
downloadbedrock-core-4738b8581e932174f9ab99d21c6a24024fb6414d.zip
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.
Diffstat (limited to 'src/signal.rs')
-rw-r--r--src/signal.rs12
1 files changed, 12 insertions, 0 deletions
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,
+}