higan-emu/higan

Support UxROM (mapper 2) sizes greater than 256KB.

Screwtapello opened this issue · 1 comments

According to NESdev, mapper 2 has two variants:

  • UNROM supports a 3-bit number of 16KB banks, and therefore 128KB of PRG-ROM.
  • UOROM supports a 4-bit number of 16KB banks, and therefore 256KB of PRG-ROM.

However, there are homebrew games like Alwa's Awakening that expect the bank number to be 5 or more bits, and apparently some emulators just support full 8-bit bank numbers. Technically speaking these should be separate mappers, and ideally this would be spelled out in the (hypothetical) manifest file, but it would be possible for higan to calculate the required bank-number size by looking at the actual size of PRG-ROM. I'm not sure exactly where this logic would fit into the higan codebase, but it seems reasonable.

On Discord, invertigo points out that higan's memory mapping already takes care of mirroring, so it should just be a matter of updating the stored bank number to be 8 bits instead of 4, and maybe updating icarus to report these extended-mapper-2 games as something fictional, like "UxROM-512".