Potential logic bug fixes
This commit is contained in:
parent
dbe9035c55
commit
3133687e68
@ -1613,6 +1613,7 @@ void GB_display_run(GB_gameboy_t *gb, unsigned cycles, bool force)
|
|||||||
|
|
||||||
if (unlikely(GB_is_dma_active(gb))) {
|
if (unlikely(GB_is_dma_active(gb))) {
|
||||||
unsigned offset = cycles - gb->display_cycles; // Time passed in 8MHz ticks
|
unsigned offset = cycles - gb->display_cycles; // Time passed in 8MHz ticks
|
||||||
|
cycles = gb->display_cycles;
|
||||||
if (offset) {
|
if (offset) {
|
||||||
if (!gb->cgb_double_speed) {
|
if (!gb->cgb_double_speed) {
|
||||||
offset >>= 1; // Convert to T-cycles
|
offset >>= 1; // Convert to T-cycles
|
||||||
|
@ -292,7 +292,11 @@ static uint8_t read_mbc_rom(GB_gameboy_t *gb, uint16_t addr)
|
|||||||
|
|
||||||
static uint8_t read_vram(GB_gameboy_t *gb, uint16_t addr)
|
static uint8_t read_vram(GB_gameboy_t *gb, uint16_t addr)
|
||||||
{
|
{
|
||||||
GB_display_sync(gb);
|
if (!GB_is_dma_active(gb)) {
|
||||||
|
/* Prevent syncing from a DMA read. Batching doesn't happen during DMA anyway. */
|
||||||
|
GB_display_sync(gb);
|
||||||
|
}
|
||||||
|
|
||||||
if (unlikely(gb->vram_read_blocked)) {
|
if (unlikely(gb->vram_read_blocked)) {
|
||||||
return 0xFF;
|
return 0xFF;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user