SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit f145f05f1572df9dc7f8287644dd99068fa3b55b parent 29e920697ab10344d9f37f9b67cc2dca0cab95a9 Author: Lior Halphon <LIJI32@gmail.com> Date: Sun, 19 Feb 2023 00:32:16 +0200 Timing adjustments to object line address calculation Diffstat:
| M | Core/display.c | 13 | ++++++++----- |
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/Core/display.c b/Core/display.c @@ -1826,14 +1826,17 @@ void GB_display_run(GB_gameboy_t *gb, unsigned cycles, bool force) gb->during_object_fetch = false; gb->cycles_for_line++; + gb->object_low_line_address = get_object_line_address(gb, + gb->objects_y[gb->n_visible_objs - 1], + gb->mode2_y_bus, + gb->object_flags); GB_SLEEP(gb, display, 40, 1); - /* TODO: timing not verified */ + /* TODO: timing not verified. Probably happens a cycle earlier, but needs to verify it doesn't + break any DMA tests. { */ dma_sync(gb, &cycles); - gb->object_tile_data[1] = vram_read(gb, get_object_line_address(gb, - gb->objects_y[gb->n_visible_objs - 1], - gb->mode2_y_bus, - gb->object_flags) + 1); + gb->object_tile_data[1] = vram_read(gb, gb->object_low_line_address + 1); + /* } */ uint8_t palette = (gb->object_flags & 0x10) ? 1 : 0;
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.