blob: 80dcb54dc0d2352128f8f21ffc3c14a1f0c157c6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#![feature(bigint_helper_methods)]
#![feature(io_error_more)]
#![feature(split_array)]
#![feature(seek_stream_len)]
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();
}
|