From 95b3f3007e75e3309633683a1872ccfec7d6bee3 Mon Sep 17 00:00:00 2001 From: John Date: Tue, 9 Jul 2024 01:40:26 -0500 Subject: [PATCH] boy-debug: Use correct bus type instead of placeholder vec --- boy-debug/src/main.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/boy-debug/src/main.rs b/boy-debug/src/main.rs index fbb479a..ae2b5f3 100644 --- a/boy-debug/src/main.rs +++ b/boy-debug/src/main.rs @@ -1,7 +1,7 @@ //! Debug interface for the Boy emulator #![allow(unused_imports)] -use boy::memory::{Bus, Cart}; +use boy::memory::{io::BusIO, Bus, Cart}; use boy_debug::{ bus::BusIOTools, cli::{lexer::Lexible, parser::Parsible}, @@ -9,17 +9,18 @@ use boy_debug::{ message::Response, }; use rustyline::{config::Configurer, history::FileHistory, Editor}; -use std::{env::args, error::Error}; +use std::{env::args, error::Error, io::Write}; fn main() -> Result<(), Box> { // Set up the gameboy // TODO: move off the main thread - let mut bus = vec![0; 0x10000]; + let mut cart = vec![0; 0x10000]; for arg in std::env::args().skip(1) { - bus.read_file(arg)?; + cart.read_file(arg)?; } - // let mut bus = Bus::new(Cart::new(bus)); - let mut gb = Gameboy::new(bus); + let mut bus = Bus::new(Cart::new(cart, vec![])); + bus.write(0xff44, 0x90); + let mut gb = Gameboy::new(bus.ascii()); // Set up and run the REPL let mut rl: Editor<(), FileHistory> = Editor::new()?;