jsmolka / eggvance

A Game Boy Advance emulator.
https://smolka.dev/tags/eggvance
GNU General Public License v3.0
65 stars 1 forks source link

Golden Sun layering issue #3

Closed fleroviux closed 4 years ago

fleroviux commented 4 years ago

Golden.Sun.USA.Europe (1).zip image the carpet is occluding the character sprites, which obviously shouldn't happen. Golden Sun makes clever usage of OBJ rendering behavior, that isn't properly documented in GBATEK. It uses transparent OBJs to hijack the priority of the character OBJs.

This works because:

  1. OBJs are rendered in forward order
  2. higher priority OBJ pixels always update the OBJ buffer priority, even if the pixel transparent.
  3. lower priority OBJ pixels always write the OBJ buffer if it's currently transparent.

save file is courtesy of benderscuffy.

jsmolka commented 4 years ago

Special thanks for this one. I had a similar issue with a piranha plant not appearing in SMB3 because its priority was messed up but I haven't had the time to investigate it further :)