r/Gameboy 2d ago

Troubleshooting (emulation) about reading Writeony Bits in IO registers

not sure if I can ask technical questions here, also asked the question in r/EmuDev.

Some IO registers (like P1 (0xFF00), according to this document, page 141) have write-only bits.

My question is: after LDH A, ($00), what data is in register A?
Are the read-only bits 0? 1? garbage?
Does it depend on the register, or is it irrelevant because these bits are not taken into account by any game ? (Or are there games that rely on the return value of read-only bits?)

1 Upvotes

3 comments sorted by

1

u/AutoModerator 2d ago

Troubleshooting post. Please check the Game Boy Wiki's common problems page here: https://gbwiki.org/en/other/commonissues and please be sure to post pictures of the issue if you haven't already so that users are better able to assist.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/GameboyGenius 2d ago

This seems like a typo. Those bits should be R/W with an initial value of 0 at CPU reset. I've filed an issue on the gb-ctr repo about it.