From c837d7c9869005afddbf98f43b478df75c354a11 Mon Sep 17 00:00:00 2001 From: GooseDB Date: Sun, 13 Oct 2019 00:18:07 +0300 Subject: [PATCH] return comments --- examples/mos6502.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/examples/mos6502.rs b/examples/mos6502.rs index 5c7ddc1..f6d6d99 100644 --- a/examples/mos6502.rs +++ b/examples/mos6502.rs @@ -27,12 +27,19 @@ extern crate mos6502; +#[cfg(not(test))] use mos6502::cpu; + +#[cfg(not(test))] use mos6502::address::Address; +#[cfg(not(test))] fn main() { let mut cpu = cpu::CPU::new(); + // "Load" a program + + let zero_page_data = [ // ZeroPage data start 0x00, @@ -91,7 +98,7 @@ fn main() { 0xFF, // Something invalid -- the end! ]; - let data: [u8; 25] = [ + let data = [ 0x00, 0x09, // ADC Absolute target 0x00, @@ -119,7 +126,6 @@ fn main() { 0x06, // ADC IndirectIndexedY target ]; - // "Load" a program cpu.memory.set_bytes(Address(0x0000), &zero_page_data); cpu.memory.set_bytes(Address(0x4000), &program); cpu.memory.set_bytes(Address(0x8000), &data); @@ -127,4 +133,6 @@ fn main() { cpu.registers.program_counter = Address(0x4000); cpu.run(); + + println!("{:?}", cpu); } \ No newline at end of file