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

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

Dracula X

  • Jr. Member
  • **
  • Posts: 70
    • 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: 6577
  • *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.
"My watch says 30 chickens" Google, 2018

Dracula X

  • Jr. Member
  • **
  • Posts: 70
    • View Profile
    • My YouTube Page for ROM hacking
Re: MMC3 & MMC5 Bankswitch Bugfix Code
« Reply #2 on: November 21, 2017, 09:52:46 pm »
Someone actually rewrote the code in a hack called "Compact Mapper Hack" and it's very nice and easy to switch banks.
Learning how bankswitching works is completed.