VRC2/4 test program WIP

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Sour
Posts: 890
Joined: Sun Feb 07, 2016 6:16 pm

Re: VRC2/4 test program WIP

Post by Sour »

Maybe I'm just confused but, mapper 22 is supposed to be VRC2a and according to the wiki, "VRC2 supports only vertical or horizontal mirroring. Bit 1 is ignored.". This is what I have implemented, but the mapper 22 test complains about 1-screen mirroring not being available? And your FCEUX screenshot says mapper 22 = VRC4?
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: VRC2/4 test program WIP

Post by NewRisingSun »

Attached is my modification of Nintendulator's Mapper DLL source file that passes all of AWJ's submapper identification tests. The only complaint the ROM still has is that the pseudo-scanline IRQ is "late". Edit: Error fixed, thanks to AWJ.
Sour wrote:This is what I have implemented, but the mapper 22 test complains about 1-screen mirroring not being available?
I noticed when I tested with my test ROMs that Mesen seems to emulate the IRQ even with VRC2 submappers. So if you emulate the IRQ, the test ROM may think it's dealing with a VRC4 and hence complain about the missing one-screen mirroring.
Attachments
vrc2and4.cpp
(7.14 KiB) Downloaded 574 times
Last edited by NewRisingSun on Sun Sep 03, 2017 1:33 am, edited 2 times in total.
Sour
Posts: 890
Joined: Sun Feb 07, 2016 6:16 pm

Re: VRC2/4 test program WIP

Post by Sour »

NewRisingSun wrote:I noticed when I tested with my test ROMs that Mesen seems to emulate the IRQ even with VRC2 submappers. So if you emulate the IRQ, the test ROM may think it's dealing with a VRC4 and hence complain about the missing one-screen mirroring.
And you would be absolutely correct! Thanks, between disabling IRQs for VRC2 & disabling 1-screen mirroring for VRC2c, all the tests pass now.
AWJ
Posts: 433
Joined: Mon Nov 10, 2008 3:09 pm

Re: VRC2/4 test program WIP

Post by AWJ »

NewRisingSun wrote:Attached is my modification of Nintendulator's Mapper DLL source file that passes all of AWJ's submapper identification tests. The only complaint the ROM still has is that the pseudo-scanline IRQ is "late".
It looks like you were working from an outdated version of Quietust's sources. Recently (meaning a couple months ago when I was last working on this) I pointed out an off-by-one error to quietust which he fixed, but the error is back in your version.

Code: Select all

((IRQenabled & 2) && ((IRQenabled & 4) || ((IRQcycles -= 3) < 0)))
< 0 should be <= 0.
Sour wrote:And your FCEUX screenshot says mapper 22 = VRC4?
The screenshots at the top of the thread were taken before I had finished writing the IRQ tests. Under FCEUX, the complete test program displays "???" (unknown/inconsistent) for mapper 22 since it (correctly) doesn't implement IRQs but it does implement one-screen mirroring and alternate PRG bank layout for that mapper.
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: VRC2/4 test program WIP

Post by NewRisingSun »

AWJ wrote:It looks like you were working from an outdated version of Quietust's sources.
Ah. Thanks for pointing this out. Now vrc2and4.cpp passes all tests.

I have updated my local copy of all mapper sources and replaced the vrc2and4.cpp in the post above.
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: VRC2/4 test program WIP

Post by NewRisingSun »

I only recently noticed that there is a 2-in-1 multicart containing 幽☆遊☆白書: 爆闘暗黒武術会 (Yū Yū Hakusho: Bakutō Ankoku Bujutsu-kai and Datach Dragon Ball Z: 激闘天下一武道会 (Gekitō Tenkaichi Budōkai). It uses a VRC4e configuration, but instead of CHR-ROM, it uses 8 KiB of banked CHR-RAM, and bit 3 of every CHR register selects an outer 256 KiB PRG-ROM bank. As with other mappers that do such a thing, I assume that all CHR registers are better set up to select the same outer bank, otherwise the outer PRG-ROM bank would change as the PPU is rendering.

FCEUX emulates this cart's outer bank register as part of its normal VRC2/4 code ("big_bank"), Mapper 23. Since we just cleaned up the VRC mappers thanks to submappers, I would prefer to assign Mappper 298 520 (since it's an East Asian-only release) for this thing instead of making a mess of Mapper 23.
User avatar
KRIKzz
Posts: 6
Joined: Sun Jun 18, 2017 3:33 am

Re: VRC2/4 test program WIP

Post by KRIKzz »

Seems like test is not accurate in terms of IRQ timings. I tested it on real cartridge and both irq tests shows "late" results.
Attachments
photo_2019-08-26_17-52-14.jpg
Post Reply