Some games/mappers never update CHR banking, which caused previous changes done for performance to make 0000-1FFF open bus instead of being mapped to CHR RAM by default. The mappings need to be set after UpdatePageSizes is called.
* NES: Improve CHR-NVRAM support.
Right now, Mesen uses the NES 2.0 CHR-NVRAM field simply to enable battery saves for the volatile CHR-RAM type, so it only cares if it's zero or nonzero. This means that a game using CHR-NVRAM needs to specify volatile CHR-RAM to get the CHR-NVRAM it's actually requesting. Mesen also doesn't currently distinguish between CHR-RAM types in any way; there is a single CHR-RAM memory type and so it's not capable of saving just some of CHR-RAM. The only contemporary game that uses CHR-NVRAM, RacerMate Challenge II, has both types.
This change makes Mesen sum the two CHR-RAM types and save all of the data. This is still not correct, as it doesn't make sense to specify both types of CHR-RAM for any mapper other than mapper 168, but it will at least allow correctly-specified headers to work. It also allows RacerMate Challenge II to get the full 64 KiB of CHR-RAM (normally 32 KiB of each type) that it requests when using NES 2.0 ROMs, and it now saves however much of this is CHR-NVRAM (either the 2nd half or all of it).
This change also makes the log window print the CHR-NVRAM size as "CHR save RAM" if nonzero.
* Make it always print CHR save RAM size for NES 2.0.
-Slightly improved performance for all mappers using expansion audio (removed virtual call + inlined code)
-Slightly improvement performance for bank switching logic in BaseMapper, improves MMC5 performance because it can swap CHR banks on each scanline
Modified NesMemoryManager & BaseMapper to allow inlining the read logic when the CPU is e.g executing code from ROM. This speeds up execution by around 5%.
* Code: Add auto-formatting rules for C++ projects (clang-format) and enforce code style via "clang-format" and "dotnet format"
* fix ui format warnings
This prevents the memory from appearing in the cpu/ppu memory space in the memory viewer (and prevents reads/writes from being highlighted, etc.), making it behave like any unmapped/open bus section
Otherwise, Game Genie codes that could have worked on hardware did not work as expected because of the bus conflicts. This could occur when e.g trying to use cheats on a romhack, etc.
* Delete libevdev as well with `make clean`
* Fix explicit specialization is non-namespace scope
* Fix declaration of CgbFlag changing its meaning
* Fix declaration of NesHeader changing its meaning