pandocs
pandocs copied to clipboard
Description of FF6Ch
I recently learned here from @mattcurrie what the FF6C register is meant to represent in CGB mode. I thought it might be good to know and to document!
The "Object Priority Mode" is referring to bit 0 of $FF6C. This register is set by the CGB boot ROM to toggle between CGB object priority (prioritise by OAM position) and DMG object priority (prioritise by X coordinate):
https://github.com/ISSOtm/gb-bootroms/blob/master/src/cgb.asm#L23
Sure! FF6C is currently listed under the "Undocumented CGB register". Do you want to open a PR for this?
I'll happily open a PR today! I have no way to test anything more detailed though since I don't have a flash cart :/
@mattrberry Sounds good to me! ISSOtm's bootroms are a reliable source and at least knowing what those registers are about is a great improvement. Let me know if you need help on anything :smile:
I'll be happy to test this on hardware
IIRC, bit 0 remains readable and writable after the boot ROM has finished, but no longer has any effect.
AIUI, the bit is always writable, and is copied until or latched by the FF50 (BANK
) write.
Can we test if it has any effect after the boot ROM loading?
If I can get a spec of how we think it will work after the boot ROM. I'll make a test ROM
These apply after the boot ROM has finished:
- For CGB running in DMG mode, it should read $FF and reads and writes are ignored.
- For CGB running in CGB mode, the initial value is $FE and bit 0 is readable and writable, but it has no effect on object priority mode.
Writes to FF6C have an affect after the boot ROM finishes executing if you're running in PGB mode (FF4C was written 0x80 or 0xC0), and STOP
hasn't been executed yet. But you're effectively running in DMG mode with random sprite palettes and white BG palettes during that time.
Fixed by #45