Points of Required Attention™
Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,442,778
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 04-20-24 03:52 PM
Guest: Register | Login

0 users currently in ROM Hacking | 5 guests

Main - ROM Hacking - MMC1 Input Addresses New thread | New reply


Trax
Posted on 02-15-10 05:16 AM Link | Quote | ID: 127091


Yellow Stalfos
Level: 71

Posts: 944/1145
EXP: 3034363
Next: 132751

Since: 07-06-07
From: Québec

Last post: 3621 days
Last view: 2873 days
The MMC1 mapper (or simply Mapper 1) has 4 input ports that are written to for various reasons, like bank switching. I read somewhere that the registers have weak decoding capabilities, and that's why there are ranges of addresses instead of just one address. For information on mappers, I usually go to this site. The registers are listed like this:

Register 0: $8000 - $9FFF
Register 1: $A000 - $BFFF
Register 2: $C000 - $DFFF
Register 3: $E000 - $FFFF

So whether you write to $8000 or $91DC, it doesn't matter, it's still Register 0. Right? So, why do I see this kind of code?

3E92C: BD EAE9	LDA $E9EA,X
3E92F: 29 0F AND #$0F
3E931: A8 TAY
3E932: 99 04C0 STA $C004,Y

Why use $C004 specifically, and how is the Y index supposed to change anything?
Any insight will be appreciated...


Matrixz
Posted on 02-15-10 02:23 PM Link | Quote | ID: 127094


Ninji
Level: 35

Posts: 84/225
EXP: 266250
Next: 13686

Since: 04-07-07
From: Norway

Last post: 3100 days
Last view: 1778 days
I belive that kind of programming is to counter a phenomena called "bus conflict".
It only happens in NES hardware, not any emulators i think. (Perhaps Nintendulator emulates it.)
Its to prevent the MMC1 mapper from changing to the wrong bank.

Maybe in that example, the value at address $C004 contains the value 04.
Or maybe its 00. More likely that..

Anyway, in order to make sure the mapper uses the right value, it writes to a memory address containing the same value as the bank number you want.

Not sure if it helps..

Here, i found a better explanation:

http://www.nesdev.com/NESTechFAQ.htm#busconflicts

smkdan
Posted on 02-15-10 03:49 PM Link | Quote | ID: 127096


Ninji
Level: 36

Posts: 224/238
EXP: 288513
Next: 19597

Since: 05-26-07

Last post: 4057 days
Last view: 4006 days

I belive that kind of programming is to counter a phenomena called "bus conflict".


That's true of simpler mappers but MMC1 doesn't suffer from bus conflicts (neither do most/all ASIC mappers). It doesn't enable the ROM when during writes so there's no issue there.

That's wierd code Trax, only A13 and A14 actually reach the MMC1 so yes the entire $C000-$DFFF range is the same. Only D0 and D7 matter on top of that so that's odd of the program to read a table when it should just be shifting and writing directly to mapper register..

If this really is MMC1, they were either being obtuse for the sake of it or they assumed bus conflicts when it wasn't an issue to begin with. Also, considering only bit0 is used for data, I don't know why they bothered with AND #$0F when only the LSB matters to the MMC1. The only other used bit is bit7 and that's for resetting the chip.

This is really an MMC1 game? What game is this? That's something you'd normally see in a game that uses discrete h/w for a mapper..

never-obsolete
Posted on 02-15-10 11:23 PM Link | Quote | ID: 127114


Rat
Level: 24

Posts: 60/96
EXP: 74461
Next: 3664

Since: 02-22-07
From: Phoenix, AZ

Last post: 2590 days
Last view: 2590 days
What values are at $E9EA? And does it loop?

Main - ROM Hacking - MMC1 Input Addresses New thread | New reply

Acmlmboard 2.1+4δ (2023-01-15)
© 2005-2023 Acmlm, blackhole89, Xkeeper et al.

Page rendered in 0.059 seconds. (341KB of memory used)
MySQL - queries: 52, rows: 75/76, time: 0.042 seconds.