diff options
author | Ben Bridle <bridle.benjamin@gmail.com> | 2023-12-24 22:19:11 +1300 |
---|---|---|
committer | Ben Bridle <bridle.benjamin@gmail.com> | 2023-12-24 22:19:11 +1300 |
commit | 77067f6e244a9cf4a6ef59df2e3d735b4f172c35 (patch) | |
tree | 74eb1a226da5b367f65e2f9012dc8d440e1ccce5 /src/main.rs | |
download | bedrock-pc-0.1.0.zip |
First commitv0.1.0
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 22 |
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(); +} + |