[NesHawk] Pass TakuikaNinja's FDS-Mirroring-Test
Summary
I recently helped discover some previously undocumented behaviour on the FDS. Bit 3 of $4030 reads return the value from bit 3 of $4025, which is the nametable arrangement/mirroring mode. I wrote a test program to verify the behaviour, and it fails on BizHawk's NesHawk core (and presumably SubNesHawk as well). Mesen2 and Nestopia have since implemented the behaviour.
NESdev forum post: https://forums.nesdev.org/viewtopic.php?p=300488#p300488 Test program source code: https://github.com/TakuikaNinja/FDS-Mirroring-Test
Repro
- Load the following test program: https://forums.nesdev.org/download/file.php?id=28216
- Test fails for
$4030.D3 R.
Host env.
- BizHawk 2.10; EndeavourOS on 6.13.8-zen1-1-zen
Screenshots
NesHawk:
Original hardware (Twin Famicom):
Update: I've since discovered a new behaviour, where $4023.D0=0 writes effectively reset the nametable arrangement/mirroring. Please use the latest version of the test program when resolving this issue. (Other $4023 behaviours will be discussed in a new issue)
https://github.com/TakuikaNinja/FDS-Mirroring-Test/releases/tag/v1.1
We can rename this issue "[NesHawk] Pass TakuikaNinja's FDS testrom" if you want.
Speaking of: I recently expanded our testrom framework to support SMS. I wanted to do NES, but until now I've had a strict rule of only running testroms that I could build from source, and I had trouble with the toolchain for building NES roms (cc65 or NESasm). That's an entirely self-imposed rule though, nothing in this codebase requires it, and in fact the roms can be provided manually without using my from-source CI at all.