Super Mario Bros Special SLROM or SKROM?

A place that you can discuss reproduction of classic titles or "licensed-for-reproduction" homebrew for personal use.

Moderators: B00daW, Moderators

Forum rules
1. NO BLATANT PIRACY. This includes reproducing homebrew less than 10 years old, with the exception of free software.
2. No advertising your reproductions, with the exception of free software.
3. Be nice. See RFC 1855 if you aren't sure what this means.
User avatar
tokumaru
Posts: 11699
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Super Mario Bros Special SLROM or SKROM?

Post by tokumaru » Thu Mar 07, 2019 9:01 pm

koitsu wrote:Cute -- vertical. This could be from an internal database that's forcing the mirroring though... so which mirroring is true?
Do notice that the information you posted before says "Solder Pad", not "Mirroring". The solder pad labels on Nintendo's PCBs refer to name table arrangement, which is the opposite of the mirroring nomenclature used by emulators. So what you're seeing here is actually consistent: the solder pad marked "H" results in the name tables being arranged side by side, and mirrored vertically. The solder pad marked "V" would stack the name tables vertically, mirrored horizontally. It's very confusing that whoever created the iNES header went with "mirroting" instead of the convention that was clearly used in the PCBs.

However, since the MMC1 has dynamically controlled mirroring, the H/V setting in the header does nothing. Unless some emulator is using that information when it shouldn't.
1. This romhack actually uses vertical mirroring, best I can tell. If triple verification is needed, I can happily go look at the MMC1 writes for mirroring and determine from that. But vertical makes the most sense, IMO.
The emulator might be selecting vertical mirroring automatically (by default or from the header setting), which an actual MMC1 isn't guaranteed to do. Only debugging will tell if the mirroring is being properly configured.

User avatar
koitsu
Posts: 4217
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: Super Mario Bros Special SLROM or SKROM?

Post by koitsu » Thu Mar 07, 2019 9:03 pm

I was curious about the 6502 code aspect of it, so I used Mesen. At boot, it does tweaks MMC1's registers like so:

Code: Select all

LF322:
  lda #$80     ; Reset MMC1, lock PRG-ROM last bank to $C000-FFFF
  sta $8000
  lda #$1E     ; $1E = %00011110
  sta $8000    ; Write 0 to MMC1 control reg - low bit of mirror
  lsr A
  sta $8000    ; Write 1 to MMC1 control reg - high bit of mirror
  lsr A
  sta $8000    ; Write 1 to MMC1 control reg - low bit of PRG-ROM bank mode
  lsr A
  sta $8000    ; Write 1 to MMC1 control reg - high bit of PRG-ROM bank mode
  lsr A
  sta $8000    ; Write 1 to MMC1 control reg - CHR-ROM bank mode
  rts
;
; Mirroring: %10 (2): vertical
; PRG-ROM bank mode: %11 (3): fix last bank at $C000 and switch 16 KB bank at $8000
; CHR-ROM bank mode: %1 (1): switch two separate 4 KB banks
;
; References:
; https://wiki.nesdev.com/w/index.php/MMC1
; https://wiki.nesdev.com/w/index.php/Programming_MMC1
;
Maybe it changes things later on (as stated, you can change mirroring dynamically with MMC1), but yeah, vertical.

User avatar
koitsu
Posts: 4217
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: Super Mario Bros Special SLROM or SKROM?

Post by koitsu » Thu Mar 07, 2019 9:09 pm

tokumaru wrote:Do notice that the information you posted before says "Solder Pad", not "Mirroring". The solder pad labels on Nintendo's PCBs refer to name table arrangement, which is the opposite of the mirroring nomenclature used by emulators. So what you're seeing here is actually consistent: the solder pad marked "H" results in the name tables being arranged side by side, and mirrored vertically. The solder pad marked "V" would stack the name tables vertically, mirrored horizontally. It's very confusing that whoever created the iNES header went with "mirroting" instead of the convention that was clearly used in the PCBs.
I've always remembered it as: "vertical mirroring is more intended for horizontally-scrolling games, horizontal mirroring is more intended for vertically-scrolling games". I assumed that the H and V on the solder pads correlated with that. Gah. This explains a couple decades of confusion that I'd run into on occasion. Yup, too bad Marat didn't just call the NES header bit "screen layout" or "nametable organisation" to correlate it with the silkscreening. Ah well, at least from an actual address range perspective it makes sense.

Thanks!

User avatar
Fisher
Posts: 1065
Joined: Sat Jul 04, 2015 9:58 am
Location: -29.794229 -55.795374

Re: Super Mario Bros Special SLROM or SKROM?

Post by Fisher » Thu Mar 07, 2019 10:39 pm

Hey!
I had a similar problem when I did my translated Legend of Zelda repro.
I think the pictures in this post shows nicelly what I did.
I'm not sure if I had cut any track of the PCB, and I can't be sure by looking at the picture, but I can happilly check it tomorrow, when it's day here.
Of course, if the OP still cares.

tepples
Posts: 21975
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Super Mario Bros Special SLROM or SKROM?

Post by tepples » Wed Mar 27, 2019 6:01 am

koitsu wrote:I've always remembered it as: "vertical mirroring is more intended for horizontally-scrolling games, horizontal mirroring is more intended for vertically-scrolling games". I assumed that the H and V on the solder pads correlated with that. Gah. This explains a couple decades of confusion that I'd run into on occasion. Yup, too bad Marat didn't just call the NES header bit "screen layout" or "nametable organisation" to correlate it with the silkscreening.
I've been explaining what I call the "nametable arrangement" nomenclature in previous posts dating back to roughly January 2009. The oldest extant revision of the "Mirroring" page on NESdev Wiki also contains "arrangement". (I can't tell when or by whom that was added because edit history prior to June 2009 was lost.)

I guess the "reverse" engineers lived up to their name by reversing the terms.

Post Reply