diff --git a/aiie/applesoft.bin b/aiie/appleiie.bin similarity index 62% rename from aiie/applesoft.bin rename to aiie/appleiie.bin index cd3566f6..de03bebd 100644 Binary files a/aiie/applesoft.bin and b/aiie/appleiie.bin differ diff --git a/aiie/char.bin b/aiie/char.bin index c268030c..d48b74da 100644 Binary files a/aiie/char.bin and b/aiie/char.bin differ diff --git a/aiie/char.bin.new.bin b/aiie/char.bin.new.bin new file mode 100644 index 00000000..c268030c Binary files /dev/null and b/aiie/char.bin.new.bin differ diff --git a/aiie/char.old.bin b/aiie/char.old.bin deleted file mode 100644 index d48b74da..00000000 Binary files a/aiie/char.old.bin and /dev/null differ diff --git a/aiie/monitor.bin b/aiie/monitor.bin deleted file mode 100644 index e6a4515a..00000000 Binary files a/aiie/monitor.bin and /dev/null differ diff --git a/src/cpu/execute.rs b/src/cpu/execute.rs index 0d5044e3..1409f042 100644 --- a/src/cpu/execute.rs +++ b/src/cpu/execute.rs @@ -9,6 +9,10 @@ pub trait Execute { impl Execute for Mos6502 { fn execute(&mut self, opcode: u8) -> Result { + if self.registers.a == 13{ + println!("Return"); + } + println!("{:04X} {:02X}",self.registers.pc.address()-1, opcode); match opcode { // === LOAD === 0xA1 | 0xA5 | 0xA9 | 0xAD | 0xB1 | 0xB5 | 0xB9 | 0xBD => { diff --git a/src/systems/aiie/keyboard.rs b/src/systems/aiie/keyboard.rs index ecc5f6fe..ac0ffdbc 100644 --- a/src/systems/aiie/keyboard.rs +++ b/src/systems/aiie/keyboard.rs @@ -1,7 +1,7 @@ use crate::keyboard::{KeyAdapter, KeyState, KeySymbol}; pub struct AppleIISymbolAdapter; - +static mut DEBUG_START: bool = false; impl KeyAdapter for AppleIISymbolAdapter { fn map(state: &KeyState) -> KeyState { let mut mapped = KeyState::new(); @@ -11,7 +11,8 @@ impl KeyAdapter for AppleIISymbolAdapter { let mapped_symbol = match symbol { &Char(c) => Some(c as u8), - Return => Some(0x0D), // Carriage Return + Return => { + Some(0x0D)}, // Carriage Return Backspace => Some(0x08), Escape => Some(0x1B), _ => None, diff --git a/src/systems/aiie/mod.rs b/src/systems/aiie/mod.rs index 0e262180..054e3710 100644 --- a/src/systems/aiie/mod.rs +++ b/src/systems/aiie/mod.rs @@ -71,7 +71,7 @@ impl AiieSoftSwitches { /// Set or clear a softswitch value. fn softswitch(&mut self, address: u16) { - let value = address & 1 != 0; + let value = (address & 1) == 1; println!("softswitch {:02X} <- {}", address & !1, value); @@ -161,8 +161,8 @@ impl Memory for AiieSoftSwitches { std::io::stdout().flush().unwrap(); 0 } - 0x61 => todo!("OPNAPPLE: open apple (command) key data"), - 0x62 => todo!("CLSAPPLE: closed apple (option) key data"), + 0x61 => 0, //todo!("OPNAPPLE: open apple (command) key data"), + 0x62 => 0, //todo!("CLSAPPLE: closed apple (option) key data"), 0x70 => todo!("PDLTRIG : trigger paddles"), _ => unimplemented!(), @@ -228,8 +228,9 @@ impl SystemBuilder for AiieSystemB let io = AiieSoftSwitches::new(platform); let peripheral_card = LoggingMemory::new(Box::new(NullMemory::new()), "Peripheral Card", 0xC100); - let applesoft_interpreter = BlockMemory::from_file(0x2800, roms.applesoft); - let monitor = BlockMemory::from_file(0x800, roms.monitor); + //let applesoft_interpreter = BlockMemory::from_file(0x2800, roms.applesoft); + //let monitor = BlockMemory::from_file(0x4000, roms.monitor); + let rom = BlockMemory::from_file(16128, roms.rom); let memory = BranchMemory::new() .map(0x0000, Box::new(ram)) @@ -239,9 +240,9 @@ impl SystemBuilder for AiieSystemB Box::new(io), // Box::new(LoggingMemory::new(Box::new(io), "I/O", 0xC000)), ) - .map(0xC100, Box::new(peripheral_card)) - .map(0xD000, Box::new(applesoft_interpreter)) - .map(0xF800, Box::new(monitor)); + .map(0xC100, Box::new(rom)); + //.map(0xD000, Box::new(applesoft_interpreter)) + //.map(0xF800, Box::new(monitor)); let cpu = Mos6502::new(Box::new(memory)); @@ -290,15 +291,16 @@ impl System for AiieSystem { let value = self.cpu.read((0x0400 + index) as u16); - let character_index = ((value & 0b0011_1111) as usize) * 8; - let mode = (value & 0b1100_0000) >> 6; + let character_index = ((value & 0b0111_1111) as usize) * 8; + let inverted = (value & 0b1000_0000) == 0; + /*let mode = (value & 0b1100_0000) >> 6; let inverted = match mode { 0b00 => true, 0b01 => flash_state, 0b10 | 0b11 => false, _ => unreachable!(), - }; + };*/ let character = self.characters[character_index..(character_index + 8)].to_vec(); diff --git a/src/systems/aiie/roms.rs b/src/systems/aiie/roms.rs index 1431b935..184179ae 100644 --- a/src/systems/aiie/roms.rs +++ b/src/systems/aiie/roms.rs @@ -6,11 +6,7 @@ pub struct AiieSystemRoms { /// Character ROM. Used to generate the 7x8 character bitmaps. pub character: RomFile, - /// Applesoft ROM. Contains the Applesoft BASIC interpreter. - pub applesoft: RomFile, - - /// Monitor ROM. Contains the operating system. - pub monitor: RomFile, + pub rom: RomFile, } impl AiieSystemRoms { @@ -19,13 +15,13 @@ impl AiieSystemRoms { use crate::roms::DiskLoadable; // let character = RomFile::from_file("aiie/char.bin"); - let applesoft = RomFile::from_file("aiie/applesoft.bin"); - let monitor = RomFile::from_file("aiie/monitor.bin"); + //let applesoft = RomFile::from_file("aiie/applesoft.bin"); + //let monitor = RomFile::from_file("aiie/monitor.bin"); + let rom = RomFile::from_file("aiie/appleiie.bin"); let character = RomFile::from_file("aiie/char.bin"); Self { character, - applesoft, - monitor, + rom } } }