Every NES cartridge has two places for memory: the CPU and the PPU.werewolfslayr925 wrote: board <- {
mappernum = 26, vram_mirrorfind = false, ppu_ramfind = true
cpu_rom = {size_base = 2 * mega, size_max = 4 * mega, banksize = 0x2000},
ppu_rom = {size_base = 2 * mega, size_max = 2 * mega, banksize = 0x0400},
}
On the cartridge, the CPU must always be able to see ROM but may additionally have RAM ; the PPU may have either, or very rarely, both.
"ppu_ramfind" does exactly what it says: find out if the cartridge has RAM for the PPU, and if so, skip the PPU ROM dumping stage.
The PPU can use the data it sees in one of two different ways: one is a set of small 8x8 pictures (a "pattern table") ; the other is how those 8x8 pictures are arranged on the screen (a "name table"). The NES includes RAM inside for the purpose of holding these name tables, but only two. However, it can logically address four nametables, so those two name tables have to be arranged into four slots. Different cartridges provide different arrangements.
"vram_mirrorfind" is specifically used when the arrangement is a fixed function of the physical cartridge, instead of extra hardware on the cartridge making it adjustable as the game progresses. (hardware like NROM, CNROM, GNROM, among many others)
For each of the CPU and PPU roms:
size_base is the smallest dump to even begin trying to dump.
"mega" is 1048576 bits, or 131072 bytes.
size_max is the largest size ROM to ever support
A game for the NES could use up to 32 KiB of ROM for the CPU, and 8 KiB of ROM for the PPU. This got cramped quickly, and so people decided it'd be useful to add ICs to the game board that allows the game to see multiple different chunks of ROM at the same time. These "mappers" are where the name came from.
Different "mappers" support different divisions; from something like ANROM which can has to switch all 32 KiB at the same time (hence "banksize" = 0x8000) to something smaller like MMC3, which can switch 8 KiB at a time (hence banksize = 0x2000).
Similar constraints exist for PPU memory, ranging from CNROM's 8 KiB (banksize = 0x2000) down to MMC3's 1 KiB (banksize = 0x400).