summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
new file mode 100644
index 0000000..98bc20f
--- /dev/null
+++ b/src/main.rs
@@ -0,0 +1,22 @@
+#![feature(bigint_helper_methods)]
+#![feature(split_array)]
+
+use std::io::Read;
+use std::process::exit;
+
+mod devices;
+mod emulator;
+
+pub use devices::*;
+pub use emulator::*;
+
+fn main() {
+ // Read bytecode from standard input
+ let mut bytecode: Vec<u8> = Vec::new();
+ match std::io::stdin().take(64*1024).read_to_end(&mut bytecode) {
+ Ok(len) => eprintln!("Loaded {len} bytes of bytecode."),
+ Err(err) => { eprintln!("Could not read from standard input, quitting.\n({err:?})"); exit(1); }
+ };
+ BedrockEmulator::new(&bytecode).run();
+}
+