News: 11 March 2016 - Forum Rules, Mobile Version
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia

Author Topic: MMC3 & MMC5 Bankswitch Bugfix Code  (Read 97 times)

Dracula X

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
    • My YouTube Page for ROM hacking
MMC3 & MMC5 Bankswitch Bugfix Code
« on: November 12, 2017, 02:50:37 pm »
I fixed one for MMC5 and I also fixed the one for MMC3 as well when I notice the bug in The Guardian Legend. Here it is:

Code: [Select]
mmc3bankswitch:
php
asl
pha
lda #$86 ;might be another number for another game
sta $8000
pla
sta $8001
ora #$01
pha
lda #$87 ;might be another number for another game
sta $8000
pla
sta $8001
plp
rts

Code: [Select]
mmc5bankswitch:
php
asl
ora #$80
sta $5115
plp
rts

Thanks to FCEUX!
Learning how bankswitching works is completed.

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 6174
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: MMC3 & MMC5 Bankswitch Bugfix Code
« Reply #1 on: November 13, 2017, 12:56:56 pm »
Guardian Legend was originally an UNROM game.
Used rather wasteful code that did like:

Code: [Select]
PHA
LDA #$00
STA $04
LDA $FFF0
STA $FFF0
PLA
RTS
and repeat for the other six values.
where $FFF0 was a table of 0x80, 0x81, etc.
Pretty sure there was no use for the high bit on the page number in UxROM.
The only thing I can possibly think of is if maybe at some point they intended for MMC1.

I know the Famicom version was one an IREM-printed cart but it seems to also be UxROM as well.
Quote
Sir Howard Stringer, chief executive of Sony, on Christmas sales of the PS3:
"It's a little fortuitous that the Wii is running out of hardware."