I'm having trouble converting Super Mario Bros. 2 (USA) to MMC5. When it boils down to it, I believe the problem is with the bankswitch routine. I haven't had to actually convert a MMC3 mapper yet, but the bankswitch routine I have used, plus all of the alterations of it, have not yielded the results I'm looking for.
This is the SMB2 bankswitch routine for MMC3 (the original routine):
$FF85:8D F2 06 STA $06F2 = #$00 ; current switchable bank, from what I can tell.
$FF8A:A9 86 LDA #$86
$FF8C:8D 00 80 STA $8000 = #$AD
$FF90:8D 01 80 STA $8001 = #$02
$FF93:09 01 ORA #$01
$FF96:A9 87 LDA #$87
$FF98:8D 00 80 STA $8000 = #$AD
$FF9C:8D 01 80 STA $8001 = #$02
This is my MMC5 bankswitch routine:
STA $06F2 = #$00
STA $5114 = #$00
ADC #$01 ; I have even tried ORA #$01, no go
STA $5115 = #$00
Alterations of my bankswitch routine include switching the ASL and PHA, removing the PHA and PLA altogether, removing the ASL, alternating the ADC #$01 to ORA #$01 and back, changing the PRG mode to 16K instead of MMC3's original 8K (since the last 2 8K banks are hardwired to $C000, and judging from SMB2's bankswitch routine, it is simply adding 1 to make both 8K switchable banks a 16K bank).
The titlescreen loads, but then the scanline clears it away with a red background.
I'm using 8K PRG mode, just like in MMC3, and $5114 and $5115 represent $8000-$9FFF and $A000-$BFFF respectively.
All I need to know, is if I'm doing something wrong with my bankswitch routine. If I'm not, then the problem is not the bankswitch routine. In which case, I don't know what is causing the problem.
I got the CHR Bankswitch routine down no problem. So I'm confident it isn't that. I really do think it is the PRG bankswitch routine.