2A03 Puritans Album (source code)

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
2A03 Puritans Album (source code)
by on (#128034)
The 2A03 Puritans Album has just has a cartridge release, and I would like to provide the full source code for anyone that's interested in trying to build a similar project with the mapper hardware infiniteneslives has created.

Download here: http://rainwarrior.ca/projects/nes/2a03puritans.html

There is an NES ROM for download, but because it used a new custom mapper it's not currently supported by emulators. In the source code package there is an implementation of the mapper for FCEUX. It was using iNES mapper 3031 for the custom mapper, but it looks like that has been assigned since I worked on this project. If anyone has suggestions about assigning this mapper, please make them.

Feel free to ask any other questions about the source in this thread. This was a somewhat complex project combining NSFs from many sources into one large ROM, so I hope to eventually create a simpler project that's a little easier to follow.
Re: 2A03 Puritans Album (source code)
by on (#128134)
Can you describe the mapper?
Re: 2A03 Puritans Album (source code)
by on (#128137)
zzo38 wrote:
Can you describe the mapper?

2a03puritans_src.zip -> readme.txt has some info:
Quote:
Mapper
======

This project required the design and implementation of a new custom mapper by infiniteneslives and rainwarrior, intended to facilitate the inclusion of one of more NSFs into a single NES cartridge.

This mapper supports up to 1MB of PRG-ROM, in 4k banks located at $8000, $9000, $A000, $B000, $C000, $D000, $E000, and $F000. Each bank is selected by n 8-bit register at $5FF8, $5FF9, $5FFA, $5FFB, $5FFC, $5FFD, $5FFE, and $5FFF, respectively, just like NSF banking. These registers are mirrored across the entire $5000-$5FFF region (the register is selected by the low 3 bits), but it is recommended to use the original addresses. The mirroring is merely a convenience for the hardware implementation.

The 8kb CHR region may be RAM or ROM. This project uses CHR-RAM, and the board used by infiniteneslives for this project may only support CHR-RAM.

At power-on, the mapper automatically sets all bits in the $5FFF bank register, placing the highest bank in $F000. This occurs on power-on but not on reset, so any bank that is mapped to $F000 after power-on should contain a valid reset vector.

At present, the project uses iNES mapper 30 to designate this mapper, but this was merely chosen because it was unused by FCUEX at the time of development. No mapper number has been officially reserved yet.
Re: 2A03 Puritans Album (source code)
by on (#128157)
I wonder, I've had this idea to make a cartridge that contained covers of existing songs, but I'm not a programmer or musically inclined in the slightest. My idea would be to display a small "album art" picture (let's say 128*128) while it displayed composer, musician, and other information as it played. Each song would have different artwork. Additionally, it would have a crude way of visualizing what is playing (such as the square waves looking narrower for 12.5% DC, etc) as well as their hex data.

Sounds a bit complicated, but would it be possible to develop a system like that? My apologies for the slightly off topic post.
Re: 2A03 Puritans Album (source code)
by on (#128158)
OneCrudeDude wrote:
I wonder, I've had this idea to make a cartridge that contained covers of existing songs, but I'm not a programmer or musically inclined in the slightest. My idea would be to display a small "album art" picture (let's say 128*128) while it displayed composer, musician, and other information as it played. Each song would have different artwork. Additionally, it would have a crude way of visualizing what is playing (such as the square waves looking narrower for 12.5% DC, etc) as well as their hex data.

Sounds a bit complicated, but would it be possible to develop a system like that?


I did exactly that a while back. Source code is available here, but it's not a drop-in solution. You'll need to learn at least a little programming, or find someone who will help: http://rainwarrior.ca/music/moon8.html
Re: 2A03 Puritans Album (source code)
by on (#128189)
FYI latest MESS (from svn repo) supports emulation of this PCB, even if our APU emulation is not 100% accurate yet (but recent progresses on the MAME core will soon allow for some improvements)
I have followed your choice of mapper 30, of course, since it does not appear to be used...
Re: 2A03 Puritans Album (source code)
by on (#128190)
etabeta wrote:
FYI latest MESS (from svn repo) supports emulation of this PCB, even if our APU emulation is not 100% accurate yet (but recent progresses on the MAME core will soon allow for some improvements)
I have followed your choice of mapper 30, of course, since it does not appear to be used...


You might want to move that to another unused mapper slot, as 30 has been used already, by UNROM 512. I am going to suggest moving over to Mapper 31.
Re: 2A03 Puritans Album (source code)
by on (#128191)
I stand corrected, then. I did not know about UNROM 512 :)
Let's see which mapper rainwarrior chooses...
Re: 2A03 Puritans Album (source code)
by on (#128192)
Okay, on CaitSith2's advice I switched it to mapper 31.
Re: 2A03 Puritans Album (source code)
by on (#128194)
Wiki stub allocated. Do I need to make a Holy Diver Batman module for this?
Re: 2A03 Puritans Album (source code)
by on (#128195)
There's also an FCEUX mapper implementation included with the source code, in case it's needed for reference.
Re: 2A03 Puritans Album (source code)
by on (#128198)
Submitted that, in modified to mapper 31 form to the fceux svn. Also submitted a patch of my own for the mapper to bizhawk as well.
Re: 2A03 Puritans Album (source code)
by on (#128219)
updated MESS as well