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

Author Topic: A quick question about MMC5 Setup  (Read 564 times)

Dracula X

  • Jr. Member
  • **
  • Posts: 83
    • View Profile
    • My YouTube Page for ROM hacking
A quick question about MMC5 Setup
« on: August 17, 2019, 03:52:14 pm »
The reason why I'm asking this question because I saw people add a bunch of new codes in the fixed bank so:

1. Should I add the code to the fixed bank?

2. Should I expand the ROM and add the code there?

Thanks!
I do not do other games that have already been done.

Cyneprepou4uk

  • Full Member
  • ***
  • Posts: 176
  • Самый лысый ромхакер
    • View Profile
Re: A quick question about MMC5 Setup
« Reply #1 on: August 17, 2019, 04:26:14 pm »
Ask a new one, coz this one is too unclear to answer
I am the baldest romhacker
NES Romhacking Guide

Disch

  • Hero Member
  • *****
  • Posts: 2728
  • NES Junkie
    • View Profile
Re: A quick question about MMC5 Setup
« Reply #2 on: August 17, 2019, 11:16:00 pm »
MMC5 has no fixed bank.

Your question makes no sense.


EDIT:

For a more useful and less wise-ass answer...

You should put new code/data in a place that is accessible to the code that needs to reach it.  If you have a routine in bank 3 that needs to read some data, that data is always accessible if it is also in bank 3.  If it's in another bank, you might have to do some swapping before you're able to access it.

Most mappers (but not MMC5) have a fixed bank that can't be swapped, and games generally put stuff in that bank that needs to be accessed by most areas of the program.  Things like bankswapping routines, the NMI/IRQ handlers, and general purpose drawing routines are good candidates for stuff to be in that fixed bank.

MMC5 does not have a fixed bank because you are able to swap out all regions, however individual games might still choose not to swap out a certain region just because the "fixed bank" model was kind of standard (typically the $E000-FFFF region is the one that doesn't swap, since that is the region that hosts the interrupt vectors).



So to more directly answer your questions:

Quote
1. Should I add the code to the fixed bank?

It depends.

- Is there room?
- Is this code that needs to be accessed by other code in many other banks?  Or is it code that is only going to be useful for one routine in bank 2?  If the latter, it's probably better to just put it in bank 2.


Quote
Should I expand the ROM and add the code there?

It depends.

- Are you out of space?
- How are you going to get to the expanded space?  Is existing code that will use this new code going to have to swap itself out?  That might make things more complicated than just keeping the code in whatever bank you're in.





Usually, whenever I see questions like this I get puzzled.  The vague nature of it makes it seem like you don't quite know enough to ask a meaningful question, and are hoping someone will just hand you a magic bullet so that you won't have to think about the problem.  I don't say that to be insulting -- and I certainly don't want to discourage you from asking questions --- but maybe I would suggest you put a bit more effort into your questions.  Often times I am about to ask a question, and in the process of typing up my question I realize I no longer need to ask, because in the process of explaining my problem I realized the answer on my own.



My advice is simply this:  Do whatever works.  If putting the code in the fixed bank works... do it.  If you can expand the ROM and jump to code in a new bank, do it.  The only wrong ways are ways that don't work.  Maybe there are more efficient ways... or easier ways --- but you're not going to get the most efficient or easiest approach on your first project.  You kind of have to muddle through it and use it as a learning experience.  So just do it however you want to.
« Last Edit: August 18, 2019, 12:32:02 am by Disch »

Dracula X

  • Jr. Member
  • **
  • Posts: 83
    • View Profile
    • My YouTube Page for ROM hacking
Re: A quick question about MMC5 Setup
« Reply #3 on: August 18, 2019, 10:29:24 am »
Thank you for your info! This will come in handy in the future.

I'll just do it however I want to.
I do not do other games that have already been done.