git.y1.nz

SameBoy

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

commit 81e2ec08e01ce7c37581ad25af72806ebcaf8f1d
parent aa5a279116beb5a83bc97354d89f3fe5fcd42774
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Sun, 23 Jan 2022 22:07:15 +0200

Oops

Diffstat:
MCore/display.c4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Core/display.c b/Core/display.c @@ -500,7 +500,7 @@ static void add_object_from_index(GB_gameboy_t *gb, unsigned index) /* This reverse sorts the visible objects by location and priority */ uint8_t oam_y = oam_read(gb, index * 4); - uint8_t oam_x = oam_read(gb, index * 4) + 1; + uint8_t oam_x = oam_read(gb, index * 4 + 1); bool height_16 = (gb->io_registers[GB_IO_LCDC] & 4) != 0; signed y = oam_y - 16; if (y <= gb->current_line && y + (height_16? 16 : 8) > gb->current_line) { @@ -512,7 +512,7 @@ static void add_object_from_index(GB_gameboy_t *gb, unsigned index) memmove(gb->objects_x + j + 1, gb->objects_x + j, gb->n_visible_objs - j); memmove(gb->objects_y + j + 1, gb->objects_y + j, gb->n_visible_objs - j); gb->visible_objs[j] = index; - gb->objects_x[j] = oam_y; + gb->objects_x[j] = oam_x; gb->objects_y[j] = oam_y; gb->n_visible_objs++; }

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