Skip to content
Snippets Groups Projects
Verified Commit 10c0fa0c authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

feat: small tune and added method

parent 094cfa9f
No related branches found
No related tags found
No related merge requests found
Pipeline #914 passed
......@@ -149,7 +149,7 @@ impl Cpu {
let (instruction_fn, instruction_time, instruction_str) = instruction;
if *instruction_str == "! UNIMP !" {
if *instruction_str == "! UNIMP !" || *instruction_str == "HALT" {
println!(
"{}\t(0x{:02x})\t${:04x} {}",
instruction_str, opcode, pc, is_prefix
......@@ -177,6 +177,11 @@ impl Cpu {
self.mmu().ppu()
}
#[inline(always)]
pub fn halted(&self) -> bool {
self.halted
}
#[inline(always)]
pub fn ticks(&self) -> u32 {
self.ticks
......
......@@ -453,6 +453,12 @@ impl Ppu {
}
}
/// Clears the current frame buffer, setting the background color
/// for all the pixels in the frame buffer.
pub fn clear_frame_buffer(&mut self) {
self.fill_frame_buffer([255, 255, 255]);
}
/// Prints the tile data information to the stdout, this is
/// useful for debugging purposes.
pub fn print_tile_stdout(&self, tile_index: usize) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment