use simple6502::Emulator; #[test] fn functional_test() { let mut emu = Emulator::default() .with_ram(*include_bytes!("6502_functional_test.bin")) .at(0x400); for _ in 0..0x10000 { emu.step(); if emu.status.r#break() { panic!("Interrupt raised! {emu:?}") } } assert_eq!(emu.accumulator, 0x02); assert_eq!(emu.x, 0x0); assert_eq!(emu.y, 0x0); assert_eq!(emu.program_counter.0, 0x0591); assert_eq!(emu.stack_pointer.0, 0xFF); assert_eq!(u8::from(emu.status), 0b00000011); }