boy-debug: Use correct bus type instead of placeholder vec

This commit is contained in:
John 2024-07-09 01:40:26 -05:00
parent f0733cde37
commit 95b3f3007e

View File

@ -1,7 +1,7 @@
//! Debug interface for the Boy emulator //! Debug interface for the Boy emulator
#![allow(unused_imports)] #![allow(unused_imports)]
use boy::memory::{Bus, Cart}; use boy::memory::{io::BusIO, Bus, Cart};
use boy_debug::{ use boy_debug::{
bus::BusIOTools, bus::BusIOTools,
cli::{lexer::Lexible, parser::Parsible}, cli::{lexer::Lexible, parser::Parsible},
@ -9,17 +9,18 @@ use boy_debug::{
message::Response, message::Response,
}; };
use rustyline::{config::Configurer, history::FileHistory, Editor}; 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<dyn Error>> { fn main() -> Result<(), Box<dyn Error>> {
// Set up the gameboy // Set up the gameboy
// TODO: move off the main thread // 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) { 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 bus = Bus::new(Cart::new(cart, vec![]));
let mut gb = Gameboy::new(bus); bus.write(0xff44, 0x90);
let mut gb = Gameboy::new(bus.ascii());
// Set up and run the REPL // Set up and run the REPL
let mut rl: Editor<(), FileHistory> = Editor::new()?; let mut rl: Editor<(), FileHistory> = Editor::new()?;