Skip to content

OAM priority calculation #54

@taylorplewe

Description

@taylorplewe

As per these gbdev.io docs, when it comes to drawing an OAM pixel, the Gameboy first calculates which of 2 overlapping objects has higher priority; and THEN considers the winning object's BG priority bit. This can be exploited to "mask" objects (see INTERACTION WITH "BG OVER OBJ" FLAG in the article.)

Currently on binjgb, this behavior does not occur; it calculates the BG priority bit of all objects and renders whatever is on top.

On my local version of binjgb, I was able to fix this by inserting the following lines to emulator.c:
image
image
image
which seems like a hacky solution, but you can see a working version on my demo GB game.

I'm unable to open a pull request as I'm unable to create a branch but this is the issue and a potential solution!

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