Statically initialize CPU

This commit is contained in:
Matthias Endler 2021-01-29 00:14:50 +01:00
parent a4990eacbc
commit ad90d9294c
2 changed files with 68 additions and 61 deletions

View File

@ -12,6 +12,11 @@ cortex-m-semihosting = "0.3.1"
panic-halt = "0.2.0"
mos6502 = { path = ".." }
[dependencies.once_cell]
version = "1.5.2"
default-features = false
features = []
# Uncomment for the panic example.
# panic-itm = "0.4.0"

View File

@ -10,11 +10,13 @@ use cortex_m_rt::entry;
use mos6502::address::Address;
use mos6502::cpu;
use once_cell::unsync::Lazy;
#[entry]
fn main() -> ! {
loop {
let mut cpu = cpu::CPU::new();
let mut cpu = Lazy::new(|| cpu::CPU::new());
loop {
let zero_page_data = [
// ZeroPage data start
0x00, 0x02, // ADC ZeroPage target