diff --git a/core/src/cpu_808x/biu.rs b/core/src/cpu_808x/biu.rs index 3305da7..f96cbc3 100644 --- a/core/src/cpu_808x/biu.rs +++ b/core/src/cpu_808x/biu.rs @@ -611,6 +611,10 @@ impl Cpu { pub fn biu_io_write_u8(&mut self, addr: u16, byte: u8, flag: ReadWriteFlag) { + if addr == 0x80 { + println!("biu_queue_write({}): {}", addr, byte); + } + self.biu_bus_begin( BusStatus::IoWrite, Segment::None, @@ -659,6 +663,10 @@ impl Cpu { pub fn biu_io_write_u16(&mut self, addr: u16, word: u16, flag: ReadWriteFlag) { + if addr == 0x80 { + println!("biu_queue_write({}): {}", addr, word); + } + self.biu_bus_begin( BusStatus::IoWrite, Segment::None, diff --git a/core/src/cpu_808x/execute.rs b/core/src/cpu_808x/execute.rs index ccbcb54..a4e7627 100644 --- a/core/src/cpu_808x/execute.rs +++ b/core/src/cpu_808x/execute.rs @@ -34,6 +34,7 @@ use crate::cpu_808x::*; use crate::cpu_808x::biu::*; use crate::util; +use std::process::exit; /* @@ -1404,6 +1405,7 @@ impl Cpu { self.biu_suspend_fetch(); self.cycles(2); self.biu_halt(); + exit(0); } 0xF5 => { // CMC - Complement (invert) Carry Flag diff --git a/core/src/machine.rs b/core/src/machine.rs index de71300..b2e22b2 100644 --- a/core/src/machine.rs +++ b/core/src/machine.rs @@ -821,6 +821,7 @@ impl Machine { log::error!("CPU Halted!"); self.cpu.trace_flush(); exec_control.state = ExecutionState::Halted; + std::process::exit(0); } self.error = true; self.error_str = Some(format!("{}", err)); @@ -882,7 +883,9 @@ impl Machine { Err(err) => { if let CpuError::CpuHaltedError(_) = err { log::error!("CPU Halted!"); + self.cpu.trace_flush(); exec_control.state = ExecutionState::Halted; + std::process::exit(0); } self.error = true; self.error_str = Some(format!("{}", err)); diff --git a/frontends/martypc_pixels_desktop/src/lib.rs b/frontends/martypc_pixels_desktop/src/lib.rs index c29e38d..f725975 100644 --- a/frontends/martypc_pixels_desktop/src/lib.rs +++ b/frontends/martypc_pixels_desktop/src/lib.rs @@ -612,6 +612,8 @@ pub fn run() { if let Some(prog_seg) = config.emulator.run_bin_seg { if let Some(prog_ofs) = config.emulator.run_bin_ofs { + println!("Loading program into memory at {:04X}:{:04X}.", prog_seg, prog_ofs); + let prog_vec = match std::fs::read(prog_bin.clone()) { Ok(vec) => vec, Err(e) => { diff --git a/install/martypc.toml b/install/martypc.toml index 0bb2822..3c32419 100644 --- a/install/martypc.toml +++ b/install/martypc.toml @@ -14,7 +14,7 @@ basedir = "./" auto_poweron = true # Run the emulator without gui -headless = false +headless = true # Run the instruction fuzzer (requires validator feature) fuzzer = false @@ -35,13 +35,13 @@ debug_mode = false debug_warn = true # Don't load BIOS if true (not useful on its own) -no_bios = false +no_bios = true # Run the specified program instead of booting BIOS. The CPU reset vector will # be set to 'run_bin_seg:run_bin_ofs' -#run_bin = "./program/a_effect.bin" -#run_bin_seg = 0x1000 -#run_bin_ofs = 0x0000 +run_bin = "./test.bin" +run_bin_seg = 0x0000 +run_bin_ofs = 0x0000 # ---------------------------------------------------------------------------- # Debug Tracing Options @@ -56,9 +56,9 @@ no_bios = false # # Additionally, a valid value for trace_file must be supplied. # -trace_on = false -trace_mode = "Cycle" -#trace_file = "./traces/instr_trace.log" +trace_on = true +trace_mode = "Instruction" +trace_file = "./instr_trace.log" # Enable Video tracing. Video device may log memory and register read/writes. #video_trace_file = "./traces/video_trace.log" @@ -81,7 +81,7 @@ video_frame_debug = false # Disable the GUI entirely. Use autostart=true or you'll have no way to start # the machine. -gui_disabled = false +gui_disabled = true # Specify the base color for GUI control theme. Ideally use something dark and # desaturated. Comment out for default EGUI theme. @@ -105,7 +105,7 @@ off_rails_detection = false # Whether to enable instruction history by default. This slows down the # emulator a modest amount when enabled. -instruction_history = false +instruction_history = true [input] # ---------------------------------------------------------------------------- @@ -127,6 +127,8 @@ reverse_mouse_buttons = false #model = "IBM_PC_5150" model = "IBM_XT_5160" +keyboard_type = "ModelF" + # ROM Override # ---------------------------------------------------------------------------- # Specify a specific BIOS to load. This overrides MartyPC's ROM autodetection. @@ -189,5 +191,3 @@ hdc = "None" type = "Arduino8088" trigger_address = 0xFFFF0 trace_file = "./traces/validator_trace.log" - -