Skip to content

Missing detail about sprite fetch step 2 #4

@jonathangjertsen

Description

@jonathangjertsen

Hi, I've been relying heavily on this doc for implementing the PPU in my emulator. Thanks!

In https://hacktix.github.io/GBEDG/ppu/#sprite-fetching it says

Fetch Tile Data (Low): Same as the corresponding Background Fetcher step, however, Sprites always use 8000-addressing-mode, so this step is not affected by any LCDC bits.

The corresponding background fetcher step says

Using the Tile Number from the previous step the fetcher now fetches the first byte of tile data (with an offset of 2 * ((LY + SCY) mod 8)) and stores it

For the sprite fetch I had to do 2 * ((LY + SCY - Sprite.Y) mod 8)) to get this to work correctly. Otherwise sprites get rendered incorrectly when Sprite.Y % 8 != 0. Is this correct? I didn't see any other part where Sprite.Y was taken into account (except the comparison in the OAM scan stage)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions