llvm-mos / llvm-mos-sdk

SDK for developing with the llvm-mos compiler
https://www.llvm-mos.org
Other
266 stars 53 forks source link

NES: Add GTROM mapper. #199

Closed asiekierka closed 11 months ago

asiekierka commented 11 months ago

Fixes https://github.com/llvm-mos/llvm-mos-sdk/issues/174 .

This introduces an approach to handling NES mappers utilizing 32K PRG-ROM banks, inspired by @mysterymath 's work on MMC1 32K banking. In short, a faux "fixed" section is placed at the beginning of each bank, with the bank-specific contents following after. Thanks to clever use of the custom output format's origin/length functionality, the "fixed" bank is dynamically sized to fit the user's code and data exactly.

An important caveat is that this approach does not currently provide a good answer for DPCM support on this mapper (as the fixed section begins at $8000, not $C000).

asiekierka commented 11 months ago

Added DPCM support as discussed on Discord. This should be everything, now.