git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

commit 3133687e6820d98581855010ae772473666d2643
parent dbe9035c55c08ddf1200fa99350d6900dacc2077
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Sun, 16 Jan 2022 00:50:08 +0200

Potential logic bug fixes

Diffstat:
MCore/display.c1+
MCore/memory.c6+++++-
2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/Core/display.c b/Core/display.c @@ -1613,6 +1613,7 @@ void GB_display_run(GB_gameboy_t *gb, unsigned cycles, bool force) if (unlikely(GB_is_dma_active(gb))) { unsigned offset = cycles - gb->display_cycles; // Time passed in 8MHz ticks + cycles = gb->display_cycles; if (offset) { if (!gb->cgb_double_speed) { offset >>= 1; // Convert to T-cycles diff --git a/Core/memory.c b/Core/memory.c @@ -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) { - 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)) { return 0xFF; }

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.