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

fix: small fixes

parent 4ca8872c
No related branches found
No related tags found
No related merge requests found
Pipeline #894 passed
...@@ -100,7 +100,13 @@ fn main() { ...@@ -100,7 +100,13 @@ fn main() {
//game_boy.load_rom_file("../../res/roms/paradius/cpu/09-op r,r.gb"); // NO FINISH //game_boy.load_rom_file("../../res/roms/paradius/cpu/09-op r,r.gb"); // NO FINISH
//game_boy.load_rom_file("../../res/roms/paradius/cpu/11-op a,(hl).gb"); // NO FINISH //game_boy.load_rom_file("../../res/roms/paradius/cpu/11-op a,(hl).gb"); // NO FINISH
let mut counter = 0u32;
'main: loop { 'main: loop {
// increments the counter that will keep track
// on the number of visual ticks since beginning
counter = counter.wrapping_add(1);
while let Some(event) = graphics.event_pump.poll_event() { while let Some(event) = graphics.event_pump.poll_event() {
match event { match event {
Event::Quit { .. } => break 'main, Event::Quit { .. } => break 'main,
......
...@@ -101,6 +101,13 @@ impl Cpu { ...@@ -101,6 +101,13 @@ impl Cpu {
self.push_word(pc); self.push_word(pc);
self.pc = 0x40; self.pc = 0x40;
self.mmu.ppu().ack_vblank(); self.mmu.ppu().ack_vblank();
// in case the CPU is currently halted waiting
// for an interrupt, releases it
if self.halted {
self.halted = false;
}
return 16; return 16;
} }
} }
......
...@@ -77,7 +77,8 @@ pub struct Ppu { ...@@ -77,7 +77,8 @@ pub struct Ppu {
/// Defines the size in pixels of the object (false=8x8, true=8x16). /// Defines the size in pixels of the object (false=8x8, true=8x16).
obj_size: bool, obj_size: bool,
/// Controls the map that is going to be drawn to screen, the /// Controls the map that is going to be drawn to screen, the
/// offset in VRAM will be adjusted according to this. /// offset in VRAM will be adjusted according to this
/// (false=0x9800, true=0x9c000).
bg_map: bool, bg_map: bool,
/// If the background tile set is active meaning that the /// If the background tile set is active meaning that the
/// negative based indexes are going to be used. /// negative based indexes are going to be used.
......
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