Mapper 206 games with 32 KiB of PRG-ROM

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Mapper 206 games with 32 KiB of PRG-ROM

Post by NewRisingSun »

Mapper 206's wiki page wrote:The game Babel no Tou, on the PCB 3401, is the only game with 32 KiB PRG that allows—and uses!—PRG banking. All other games with 32 KiB PRG connect CPU A13 and CPU A14 directly to the PRG ROM, but fortunately they initialize their PRG registers to work on a normal board. Because all six games can be correctly emulated by respecting the PRG banking registers, it seems no submapper needs to be allocated for this variation.
It seems inconsistent to not assign a submapper for 32 KiB mapper 206 games because the games run when emulated with PRG banking but having mapper 1 submapper 5 for SEROM, SHROM, SH1ROM even though all affected games seem to run perfectly well when emulated as SLROM as well.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Mapper 206 games with 32 KiB of PRG-ROM

Post by lidnariq »

That's not true - SEROM and SHROM will only boot if the emulated (or real) MMC1 boots in a consistent layout. In contrast, the 108 guarantees that the initialization code will happen regardless of PCB.
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: Mapper 206 games with 32 KiB of PRG-ROM

Post by NewRisingSun »

MMC1 wiki article wrote: Several commercial games have reset vectors every 32 KiB, but not every 16, so evidently PRG ROM bank mode 2 doesn't seem to occur randomly on power-up.
This implies that for 32 KiB games, the reset vectors can be assumed to be guaranteed to be mapped where they should be, and as for the $8000-$BFFF bank, every submapper 5 candidate either sets 32 KiB mode via $8000 by itself, where the $E000 register no longer matters for a 32 KiB game, or sets 16 KiB mode via $8000 plus the correct bank via $E000. Meaning that all known games, unless one were to assume against the described evidence that PRG ROM bank mode 2 could occur randomly on power-up after all, could be safely emulated as SLROM. Thus the situation effectively is the same as mapper 206's.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Mapper 206 games with 32 KiB of PRG-ROM

Post by lidnariq »

NewRisingSun wrote: Fri Dec 10, 2021 1:36 am every submapper 5 candidate either sets 32 KiB mode via $8000 by itself, where the $E000 register no longer matters for a 32 KiB game, or sets 16 KiB mode via $8000 plus the correct bank via $E000.
They do neither. That's why this submapper was allocated: because of a report that these games were not booting.
Meaning that all known games, unless one were to assume against the described evidence that PRG ROM bank mode 2 could occur randomly on power-up after all
It does occur randomly. The odds are just low. For games where they have a vector in every other bank, you can do the math and find that makes it boot about 7/8 of the time.
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: Mapper 206 games with 32 KiB of PRG-ROM

Post by NewRisingSun »

lidnariq wrote: Fri Dec 10, 2021 12:36 pmThey do neither.
I verified that they do. Do you think I would have written this otherwise?

I also went through all North American and Japanese MMC1 games, excluding SEROM, SHROM, SH1ROM, with the emulator modified to always boot in PRG bank mode 2. The result:
  • Among North American MMC1 games, 153 did not boot, 58 did.
  • Among Japanese MMC1 games, 218 did not boot, 74 did.
Therefore, only one quarter of all SxROM (excluding SEROM/SHROM/SH1ROM) games even can run with an MMC1 that boots in PRG bank mode 2. I could not find a clear pattern in terms of release year, though Highway Star -- the first MMC1 game ever according to my notes -- is among those that did not boot.

Edit:
The leaked MMC1 datasheet states:

ファミリーコンピュータは、カセットにRESET信号がきていない為、MMCは初期状能の認識が出来ない。従って、電源投入時CPU、PPUのメモリバンク設定は不定となる。そこで、プログラムROMは16Kbyte単位でベクトル及び、イニシャルルーチンを持たなければならない。

"Since on the Family Computer, the RESET signal is not available to the cartridge, the MMC cannot enforce an initial state. Therefore, the memory bank settings of the CPU and PPU are undefined at power-on. As a result, the Program ROM must have vectors and the initialization routine in every 16 KiB bank."

Obviously, that advice was not followed by most, not even by Nintendo themselves! :) The question therefore is whether that datasheet statement was overly cautious, did not reflect actual hardware beahvior and was rightfully ignored by the majority, or authors and Nintendo's lot check found it acceptable that games manufactured with early MMC1 revisions just would not cold-boot 7/8 of the time. I only found one report that 32 KiB games did not work on an SLROM board, and found the discussion to be inconclusive rather than a confirmation.

I have attached my list of games that work and that don't when booting in PRG banking mode 2.

Edit 2: put Zelda 1 into the wrong category.
Attachments
MMC1-mode2-work.txt
(3.27 KiB) Downloaded 45 times
MMC1-mode2-fail.txt
(8.94 KiB) Downloaded 51 times
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Mapper 206 games with 32 KiB of PRG-ROM

Post by lidnariq »

I don't know what else to say - I allocated submapper 5 on the understanding that SEROM and SHROM would not (sufficiently?) reliably boot if emulated as on a SLROM board. If my understanding was wrong I can do nothing more than apologize and ask to retract it.
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: Mapper 206 games with 32 KiB of PRG-ROM

Post by NewRisingSun »

My actual goal was that I would like a submapper 206.1 for the hard-wired 32 KiB variant of Namco games. It is not strictly necessary to run those games. But it would be nice to have as a description of a functionally-different hardware variant. The only reason it is unnecessary is that the affected games go out of their way to accomodate both variants by initialising the PRG bank registers even though they don't need to on the hardware they run on.

The SEROM angle was to argue that 1.5 was likewise not strictly necessary (based on that wiki quote) yet exists because it describes as a functionally-different hardware variant. It now turns out that it had been allocated because it had been thought to be strictly necessary (and the record is still not entirely 100% clear on whether it really is), so the analogy no longer holds.
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: Mapper 206 games with 32 KiB of PRG-ROM

Post by NewRisingSun »

I made two test ROMs that distinguish regular mapper 206.0 from the proposed hard-wired 32 KiB submapper 1. It sets register $06 to $03 and register $07 to $02 and checks that the banks did not change. It also tests that there is no MMC3-like PRG inversion by setting register $46 to $00 and register $47 to $01 and checking that the $8000 and $C000 banks are not inverted.
Attachments
test206.7z
(1.24 KiB) Downloaded 68 times
User avatar
aquasnake
Posts: 515
Joined: Fri Sep 13, 2019 11:22 pm

Re: Mapper 206 games with 32 KiB of PRG-ROM

Post by aquasnake »

For mmc1, PRG mode must be 16 + 16F by default! The reason why some games can work normally when the startup mode is 32(mode 2) is that they are not sure which mapper to implement during development Or some code residues from the original UNROM or AxROM by hacking them to MMC1 (usually, most of the mapper-hacked games will not enter these codes under normal circumstances). Of course, filling the last part of every 32K space with all the same reset and vector codes is a good way to ensure strong compatibility

As for mmc3, the default configuration of RPG mode is 0 + 1 + (- 2) + (- 1), and the default configuration of CHR mode is 0 + 2 + 4 + 5 + 6 + 7, which will ensure that the vector code can be entered normally after startup even without initialization. Besides, you must configure the bit mask of PRG address, so the two last fixed banks of $C000 - $dfff and $e000 - $ffff will not exceed the physical ROM range.

So, if a mapper206 game which does only have 32K PRG ROM size, if you have configured the bit mask of PRG address with hardware logic devices, there is no necessary to set the prg mode to 32( or to 8(0)+8(1)+8f(2)+8f(3)) with software code. In other words, they are the same result whatever the prg mode is 32 or 8+8+8f+8f
User avatar
aquasnake
Posts: 515
Joined: Fri Sep 13, 2019 11:22 pm

Re: Mapper 206 games with 32 KiB of PRG-ROM

Post by aquasnake »

If the mapper206 of 32K RPG cannot start normally on some hardware boards, I can only think that there is a problem with their hardware, the logic of the board is too simple, but it seems that I can't force the hardware author of the homebrew cart to follow my idea. This will require that the start-up code must initialize the registers once first. Or, mirror PRG ROM to the redundancy of over-dump

Unfortunately, not every game initializes like this. Therefore, this is not the problem of ROM code software, nor the problem of mapper assignment, but the problem of hardware design!
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Mapper 206 games with 32 KiB of PRG-ROM

Post by lidnariq »

aquasnake wrote: Sun Dec 12, 2021 9:01 pm For mmc1, PRG mode must be 16 + 16F by default! The reason why some games can work normally when the startup mode is 32(mode 2) is that they are not sure which mapper to implement during development
This is not true. At least some MMC1s on some consoles do not reliably power up in the 16+16F memory layout, and software should not expect that it does.
there is no necessary to set the prg mode to 32( or to 8(0)+8(1)+8f(2)+8f(3)) with software code.
This is also not true; the 108 does not power up in this useful state either. A theoretical 32KB game could easily attempt to jump into the lower 16KB without having initialized R6 or R7 and run into a instruction that crashes the CPU.
User avatar
aquasnake
Posts: 515
Joined: Fri Sep 13, 2019 11:22 pm

Re: Mapper 206 games with 32 KiB of PRG-ROM

Post by aquasnake »

This involves a philosophical question, that is, the purpose of formulating rules is to standardize and unify most individual behaviors, or to formulate different norms for each different individual behavior?



I prefer the former. I try to compress the mapper allocation. In fact, some sub mappers in the wiki are merged into one mapper in my own project. I use other dynamic retrieval methods to enter different board types, such as mapper206 of 32K PRG. I only need to judge the PRG ROM size, to detect prg_addr_mask[15] is 0 or 1 that's all, no other allocation will be involved.
User avatar
aquasnake
Posts: 515
Joined: Fri Sep 13, 2019 11:22 pm

Re: Mapper 206 games with 32 KiB of PRG-ROM

Post by aquasnake »

lidnariq wrote: Sun Dec 12, 2021 10:13 pm
aquasnake wrote: Sun Dec 12, 2021 9:01 pm For mmc1, PRG mode must be 16 + 16F by default! The reason why some games can work normally when the startup mode is 32(mode 2) is that they are not sure which mapper to implement during development
This is not true. At least some MMC1s on some consoles do not reliably power up in the 16+16F memory layout, and software should not expect that it does.
there is no necessary to set the prg mode to 32( or to 8(0)+8(1)+8f(2)+8f(3)) with software code.
This is also not true; the 108 does not power up in this useful state either. A theoretical 32KB game could easily attempt to jump into the lower 16KB without having initialized R6 or R7 and run into a instruction that crashes the CPU.
Note that the last two banks are actually - 2, - 1 When PRG equals 32K, - 2, - 1 are 2 and 3

To generalize, when the PRG is 64K, the two banks are 6 and 7

When 128K, they are 14 and 15



In fact, there is an easier method. I have normalized these unfixed PRG sizes' ROMs with an unified formula
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: Mapper 206 games with 32 KiB of PRG-ROM

Post by NewRisingSun »

The following games would be set to 206.1:
  • Family Jockey
  • Metro-Cross
  • Sky Kid
  • Super Chinese
  • Super Sky Kid (Vs.)
  • Valkyrieの冒険: 時の鍵伝説
"Babelの塔" had previously been identified as requiring PRG banking despite only having 32 KiB PRG-ROM.
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: Mapper 206 games with 32 KiB of PRG-ROM

Post by NewRisingSun »

I shall consider silence as consent, so I'll set the specified games to 206.1 for the next nes20db version and update the wiki accordingly.
Post Reply