diff --git a/Cargo.lock b/Cargo.lock index ef86d6d..7078e26 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,5 +3,5 @@ version = 3 [[package]] -name = "yargbe" +name = "rmg-001" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index ba97865..05bc5be 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "yargbe" +name = "rmg-001" version = "0.1.0" edition = "2018" diff --git a/README.md b/README.md index 648a296..89c30c0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# YARGBE -Yet Another Rust Gameboy Emulator. +# RMG-001 +Rust Matrix Game - 001: Yet Another Rust Gameboy Emulator. This is just a fun project I'm making for learning and practice purposes. If you want a fully-featured Gameboy emulator, this is not probably the best one :P diff --git a/src/bin/main.rs b/src/bin/main.rs index 89c1f66..95006cd 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -1,9 +1,8 @@ -use yargbe::rom::ROM; -use yargbe::console::Console; +use rmg_001::rom::ROM; +use rmg_001::console::Console; fn main() -> std::io::Result<()> { let mut console = Console::new(); console.cpu_run(); - // println!("{:02X}", 0x0FFF + 1); Ok(()) } diff --git a/src/bus.rs b/src/bus.rs index f66632e..71e79d2 100644 --- a/src/bus.rs +++ b/src/bus.rs @@ -51,7 +51,8 @@ impl Bus { // let game_rom = match ROM::load_file("roms/cpu_instrs_individual/07-jr,jp,call,ret,rst.gb".to_string()) { // let game_rom = match ROM::load_file("roms/cpu_instrs_individual/08-misc instrs.gb".to_string()) { // let game_rom = match ROM::load_file("roms/cpu_instrs_individual/09-op r,r.gb".to_string()) { - let game_rom = match ROM::load_file("roms/cpu_instrs_individual/10-bit ops.gb".to_string()) { + // let game_rom = match ROM::load_file("roms/cpu_instrs_individual/10-bit ops.gb".to_string()) { + let game_rom = match ROM::load_file("roms/cpu_instrs_individual/11-op a,(hl).gb".to_string()) { Ok(rom) => rom, _ => ROM::from_bytes(&[0; 0xFFFF]) }; @@ -81,7 +82,7 @@ impl Bus { pub fn write(&mut self, address: u16, data: u8) { if address == 0xFF01 { - // print!("{}", data as char); + print!("{}", data as char); } match MemoryMap::get_map(address) { MemoryMap::BankZero | MemoryMap::BankSwitchable => { diff --git a/src/console.rs b/src/console.rs index 6d3cac8..70c1d6e 100644 --- a/src/console.rs +++ b/src/console.rs @@ -34,7 +34,8 @@ impl Console { // exit = self.cpu.get_exec_calls_count() >= 287416; // log 7 // exit = self.cpu.get_exec_calls_count() >= 223892; // log 8 // exit = self.cpu.get_exec_calls_count() >= 4420382; // log 9 - exit = self.cpu.get_exec_calls_count() >= 6714723; // log 10 + // exit = self.cpu.get_exec_calls_count() >= 6714723; // log 10 + // exit = self.cpu.get_exec_calls_count() >= 7429762; // log 11 } } } diff --git a/src/cpu.rs b/src/cpu.rs index aa407ad..00df3d8 100644 --- a/src/cpu.rs +++ b/src/cpu.rs @@ -298,7 +298,7 @@ impl CPU { let parameter_bytes = CPU::read_parameter_bytes(program_counter, bus); let opcode = CPU::parse_opcode(parameter_bytes); // println!("Opcode: {:02X?} | PC: {:04X?} | Params: {:02X?}", opcode, self.registers.get(Register::PC), ¶meter_bytes); - println!("A: {:02X} F: {:02X} B: {:02X} C: {:02X} D: {:02X} E: {:02X} H: {:02X} L: {:02X} SP: {:04X} PC: 00:{:04X} ({:02X} {:02X} {:02X} {:02X})", + /* println!("A: {:02X} F: {:02X} B: {:02X} C: {:02X} D: {:02X} E: {:02X} H: {:02X} L: {:02X} SP: {:04X} PC: 00:{:04X} ({:02X} {:02X} {:02X} {:02X})", self.registers.get(Register::A), self.registers.get(Register::F), self.registers.get(Register::B), @@ -313,7 +313,7 @@ impl CPU { parameter_bytes.1, parameter_bytes.2, parameter_bytes.3, - ); + ); */ self.exec(opcode, bus); self.increment_exec_calls_count(); }