I'm trying to implement mapper30 support on the Everdrive N8, as a "Hello world" project to start off my mapper development ambitions - and give people the opportunity to run roms like Troll Burner on an Everdrive. It's pretty much a straight copy-n-paste of the mapper2 example provided by Krikzz, so not much complication getting the basic functionality working.
But I am running into trouble with my "stretch goal" to supporting both variants:
1) The original mapper30, which can be hardwired for either vertical/horizontal mirroring or single-screen mirroring
2) The infinitelives variation, which replaces all of that with 4-screen mirroring (using the last 8kB of the 32kB CHR-RAM for 4-screen mirroring)
The current proposal on nesdev for how to support both of these variants in one mapper number is to re-interpret bit3,bit0 (4-screen flag, mirroring-flag) of byte 6 in the iNES header as follows:
00: horizontal mirroring
01: vertical mirroring
10: 4-screen mirroring
11: single-screen mirroring
(this is not yet implemented even in most emulators but discussed in this thread:
http://forums.nesdev.com/viewtopic.php?f=3&t=14725)
From the mapper examples, I was easily able to see that map_cfg[0] usually denotes mirroring control, but I have not found any definition of the rest of map_cfg's layout. And I'm not even 100% sure there is a 1-to-1 mapping between both the relevant iNES mirroring flags and the map_cfg register.
So at the moment, I can only create a mapper30 file that is hard-coded to either use map_cfg[0] for horizontal/vertical mirroring selection, or hard-coded to do 4-screen mirroring, which is a bit of a shame.
Could anyone tell me a bit about exactly how the map_cfg register maps to the iNES mirroring flags?