Args
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
Chip 8 emulator/interpreter.
|
Chip 8 emulator/interpreter.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./porcel8 -f an_awesome_chip8_rom.ch8
|
./porcel8 an_awesome_chip8_rom.ch8
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
@@ -3,8 +3,8 @@ use clap::Parser;
|
|||||||
#[derive(Parser, Debug, Clone)]
|
#[derive(Parser, Debug, Clone)]
|
||||||
#[command(version, about, author)]
|
#[command(version, about, author)]
|
||||||
pub struct Porcel8ProgramArgs {
|
pub struct Porcel8ProgramArgs {
|
||||||
#[arg(short, long, help = "Filename of ROM to load.")]
|
/// CHIP-8 rom file to load
|
||||||
pub filename: Option<String>,
|
pub filename: String,
|
||||||
#[arg(short, long, help = "Draw scale of window", default_value_t = 8f32)]
|
#[arg(short, long, help = "Draw scale of window", default_value_t = 8f32)]
|
||||||
pub draw_scale: f32,
|
pub draw_scale: f32,
|
||||||
#[arg(
|
#[arg(
|
||||||
|
@@ -94,13 +94,11 @@ fn main() -> EmulatorResult<()> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn start_compute_thread(filename: Option<String>, mut device: Device) -> EmulatorResult<(Sender<()>, JoinHandle<()>)> {
|
fn start_compute_thread(filename: String, mut device: Device) -> EmulatorResult<(Sender<()>, JoinHandle<()>)> {
|
||||||
device.set_default_font();
|
device.set_default_font();
|
||||||
|
|
||||||
if let Some(rom_file_location) = filename {
|
let rom = rom::load_rom(filename)?;
|
||||||
let rom = rom::load_rom(rom_file_location)?;
|
device.load_rom(&rom);
|
||||||
device.load_rom(&rom);
|
|
||||||
}
|
|
||||||
|
|
||||||
let (device_termination_signal_sender, device_termination_signal_sender_receiver) = std::sync::mpsc::channel();
|
let (device_termination_signal_sender, device_termination_signal_sender_receiver) = std::sync::mpsc::channel();
|
||||||
let compute_handle = thread::Builder::new().name("Compute".to_string()).spawn(move || {
|
let compute_handle = thread::Builder::new().name("Compute".to_string()).spawn(move || {
|
||||||
|
Reference in New Issue
Block a user