Commit c27a574
committed
feat(mapper-199): align bank_values_ext init defaults with Mesen2/FCEUX
Initialize CHR slots 1 and 3 (driven by exReg[2] / exReg[3], stored
in bank_values_ext[2] / bank_values_ext[3]) to bank values 1 and 3
respectively at construction time. Without this, the slots default
to bank 0 -- so any CHR read between Txrom::new() and the game's
$8001 init writes would render slots 1 and 3 from CHR-RAM bank 0
instead of banks 1 and 3.
In practice every observed mapper-199 ROM (Sangokushi II, Dragon
Ball Z 2 / Gaiden, etc.) overwrites these registers immediately
during boot via ctrl0=A and ctrl0=B writes, so this is defensive
alignment, not a gameplay fix. If post-fix testing shows behavior
is unchanged, this commit can be squashed into the mapper 199
feature commit.
Cross-verified against the references:
* Mesen2 (Mmc3Variants/MMC3_199.h InitMapper):
_exRegs[2] = 1; _exRegs[3] = 3;
* FCEUX (boards/199.cpp M199Power):
EXPREGS[2] = 1; EXPREGS[3] = 3;
Signed-off-by: Kefu Chai <tchaikov@gmail.com>1 parent 99922f3 commit c27a574
1 file changed
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
149 | | - | |
150 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
151 | 154 | | |
152 | 155 | | |
| 156 | + | |
| 157 | + | |
153 | 158 | | |
154 | 159 | | |
155 | 160 | | |
| |||
0 commit comments