cosmetic: Notify vblank/hblank DMA inside of Gpu

Former-commit-id: de53e1ed3e2c1df19ef878c4b84893b92ee46064
This commit is contained in:
Michel Heily 2019-12-27 16:31:18 +02:00
parent 445835eac8
commit cb54f4d1a3
2 changed files with 4 additions and 17 deletions

View file

@ -111,15 +111,7 @@ impl GameBoyAdvance {
io.timers.step(cycles, &mut self.sysbus, &mut irqs);
if let Some(new_gpu_state) = io.gpu.step(cycles, &mut self.sysbus, &mut irqs) {
match new_gpu_state {
GpuState::VBlank => {
io.dmac.notify_vblank();
}
GpuState::HBlank => io.dmac.notify_hblank(),
_ => {}
}
}
io.gpu.step(cycles, &mut self.sysbus, &mut irqs);
io.intc.request_irqs(irqs);
io.sound.update(self.cpu.cycles);

View file

@ -472,7 +472,7 @@ impl Gpu {
cycles: usize,
sb: &mut SysBus,
irqs: &mut IrqBitmask,
) -> Option<GpuState> {
) {
self.cycles += cycles;
match self.state {
@ -485,7 +485,7 @@ impl Gpu {
irqs.set_LCD_HBlank(true);
};
self.state = HBlank;
return Some(HBlank);
sb.io.dmac.notify_hblank();
}
}
HBlank => {
@ -498,14 +498,13 @@ impl Gpu {
if self.current_scanline < DISPLAY_HEIGHT {
self.render_scanline(sb);
self.state = HDraw;
return Some(HDraw);
} else {
self.state = VBlank;
self.dispstat.set_vblank_flag(true);
if self.dispstat.vblank_irq_enable() {
irqs.set_LCD_VBlank(true);
};
return Some(VBlank);
sb.io.dmac.notify_vblank();
}
}
}
@ -515,19 +514,15 @@ impl Gpu {
if self.current_scanline < DISPLAY_HEIGHT + VBLANK_LINES - 1 {
self.update_vcount(self.current_scanline + 1, irqs);
return None;
} else {
self.update_vcount(0, irqs);
self.dispstat.set_vblank_flag(false);
self.render_scanline(sb);
self.state = HDraw;
return Some(self.state);
}
}
}
}
return None;
}
}