What made UNROM such a popular mapper?

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

Post Reply
User avatar
HVC-Man
Posts: 46
Joined: Wed Nov 25, 2015 7:54 pm

What made UNROM such a popular mapper?

Post by HVC-Man » Mon Oct 19, 2020 7:03 pm

This is something I've been curious about for a long time. I think UNROM might be the most common discrete mapper. What drew developers to it over other discrete mappers like AxROM, BNROM and CNROM?

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

Re: What made UNROM such a popular mapper?

Post by tepples » Mon Oct 19, 2020 7:56 pm

CNROM limits what can be combined into the same scene at once. Non-graphical banks are also slow to read because only sequential access during vertical or forced blanking is possible. Nor did Nintendo ever expand CNROM past 32 KiB CHR ROM or 64 KiB total. (Panesian on the other hand...)

Compared to BNROM, UNROM has a fixed bank at $C000-$FFFF, which simplifies certain aspects of planning the program especially with use of DPCM.

AMROM is identical to BNROM except for using 1-screen mirroring. Rare was fond of this mapper, I'm guessing because it allowed 8-way scrolling without having to play dodge the status bar.

User avatar
tokumaru
Posts: 11907
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: What made UNROM such a popular mapper?

Post by tokumaru » Mon Oct 19, 2020 9:06 pm

CNROM was definitely more limited than the other mappers you mentioned, since it provided no additional PRG-ROM and the large CHR bank size was not flexible at all. Using RAM for patterns was the norm for most systems at the time, so it's no surprise that programmers back then would rather use that than large chunks of immutable graphics.

As for all the other mappers, the biggest difference UNROM had compared to them was the fixed bank. Programs weren't so big at the time UNROM was used, so 16KB was probably enough for the constant stuff (bankswitching code, interrupt handlers, common subroutines, etc.), while the switchable stuff also fit comfortably in 16KB chunks. So yeah, the fixed bank was probably the most interesting aspect of UNROM for programmers back then.

User avatar
aquasnake
Posts: 152
Joined: Fri Sep 13, 2019 11:22 pm

Re: What made UNROM such a popular mapper?

Post by aquasnake » Tue Oct 20, 2020 12:08 am

In the initial 8-bit computer, the external address line is only 16bit, A0 ~ A15, and the maximum addressing range is 64K. In this 64K CPU addressing space, it is necessary to design ROM, RAM, and other control registers (such as joypad reads-writes and PPU RAM segment mapping). In order to reduce the cost of logic circuit, the highest bit address is used to distinguish RAM / register or ROM space, and ROM space is divided into A15 high address segment. In this way, the maximum address ROM space is limited to 32K

During the period of 84-86, most games were designed in a static and fixed scene. The 32K PRG ROM met the needs of early game development. In 1987, it was the era of the explosion of home video game technology. At that time, the Japanese game software companies suddenly obtained magic power and produced many games with exquisite pictures and relatively complex processes. And the 32K capacity is not enough, so we all thought of expanding the address.

In order to expand the address, the earliest typical circuit is to use an additional chip to gate at the fixed address, and then the data bus writes to the latch. The latched value is the extended high address. Generally, an 8-bit latch can be used to extend the address line of the higher 8 bits, so the indirect addressing can be expanded by 256 times.




At the beginning, the simplest extension is mapper7. Bank0 is the default initialization, and the outer address lines are all 0. Then write to switch to different banks. The maximum space of 256 banks is 32K * 256 = 8m. For 8-bit computers at that time, whether it is FC or Apple, it is enough.

However, mapper7 has a drawback, that is, every time a bank cuts off the previous code completely and points the entire 32K space to a new bank. Because the program runs directly on nor, the result of such a direct rough cutting is that the program runs away. In order to solve this problem, there are two techniques: 1. Run boot code and bank switch code in RAM. 2. Part of the addressing space is not cut and the other part is switchable.

Technology 1 needs to occupy poor IRAM. Let's take FC as an example. The internal RAM space of FC is only 2K. If it is occupied again, many games will be difficult to develop.

Therefore, technology 2 is naturally used by the majority of game developers. It does not need to occupy extra RAM. The 32K switch space is divided into 2, 16K can be switched, and 16K is fixed. The interrupt vector, interrupt service program, reset program and initialization code are all placed in the fixed 16K space, while the scene resources are divided into switchable banks. Mapper2, which has simple logic circuit and strong expansion ability, was born. Among the 256 kinds of mapper in ines plane, it can be said that most of them are variants of mapper2. Around 87 and 88, mapper2 (and its variants) were launched by many manufacturers. Tillnow, there are still many homebrew games of mapper2, such as battle kid 1 and 2.

After mapper2, the game development industry has basically mastered the essence of mapper design. As a result, various mappers are blooming everywhere, and the switching is not limited to 32K and 16K. Various kinds of strange and ingenious technologies are booming. After that, there are 8K bank switching, and even the 8K address of work RAM is switched to PRG ROM. Konami even customized the strange switching mode of 16K + 8K + 8K, and had to admire the abnormality of these manufacturers.

User avatar
rainwarrior
Posts: 7893
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: What made UNROM such a popular mapper?

Post by rainwarrior » Tue Oct 20, 2020 1:52 pm

It's cheap to build (2 common simple ICs), it's easy to use, and effective. The inclusion of CHR-RAM meant you could trade as much PRG-ROM space for graphics as you wanted, rather than power-of-two increments.

BNROM is the only simpler memory-expanding mapper (1 IC), but the lack of a fixed bank means you'll probably duplicate a bit of code in more than one bank, and writing the bankswitch is very slightly inconvenient by comparison. Small advantage: with a single 4-bit latch you get 512k PRG here (16 x 32k) rather than UxROM's 256k (16 x 16k)... though kind of moot because it was only ever used as 128k (until more recent homebrew).

AxROM is BxROM but with the less common single-screen nametable mapping. Maxes at 256k rather than 512k. Good for some purposes. I'm kinda surprised there's way more AxROM than BNROM but I think this is mostly just one particular developer liking it a lot.

CNROM was for if you only needed extra graphics. I think it was mostly for simple games that wanted a little extra CHR for a title screen.

User avatar
za909
Posts: 216
Joined: Fri Jan 24, 2014 9:05 am
Location: Hungary

Re: What made UNROM such a popular mapper?

Post by za909 » Tue Oct 20, 2020 5:07 pm

I agree, it's straightforward to use, and it is very scalable. There only needs to be a single register by watching the ROMSEL and R/W pins so that the n-bit latch listens for writes to $8000-$FFFF. The unique part comes from an OR gate between the outputs of the latch and the high address pins of the ROM chip. The second input for each OR gate is the same NOR of ROMSEL and A14 so that when the CPU tries to access anything above $C000 (%1100 0000 0000 0000) the ROM address pins are all high to show the last bank. I'm pretty sure I got that wrong somewhere, ROMSEL is not as obvious as a normal address / data pin.

This actually makes me think, since you only need to watch for one bit of the address when accepting latch inputs, could the low bits of the address be used to easily set a register that's wider than 8 bits? with a setup like this, you'd write whatever to $8000 for bank 0, $8001 for bank 1, etc.

User avatar
HVC-Man
Posts: 46
Joined: Wed Nov 25, 2015 7:54 pm

Re: What made UNROM such a popular mapper?

Post by HVC-Man » Tue Oct 20, 2020 5:34 pm

I see, you guys all raise a lot of good points for UNROM, it does sound like it has the most all-around useful features and less highly specialized to specific applications. I'm not sure why I included CNROM, it doesn't have CHR-RAM like the other examples.

But while I'm at it, are there any advantages to GNROM / MHROM? Or are those just a better CNROM?

Are there other discrete mappers from back in the day I missed that could have been a UNROM competitor?

User avatar
tokumaru
Posts: 11907
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: What made UNROM such a popular mapper?

Post by tokumaru » Tue Oct 20, 2020 5:52 pm

za909 wrote:
Tue Oct 20, 2020 5:07 pm
This actually makes me think, since you only need to watch for one bit of the address when accepting latch inputs, could the low bits of the address be used to easily set a register that's wider than 8 bits? with a setup like this, you'd write whatever to $8000 for bank 0, $8001 for bank 1, etc.
I'm pretty sure this is how several Atari 2600 mappers work. Why would you need more than 8 bits for the PRG bank index in an NES game though? 16KB * 256 is 4MB, way more than anyone should be using for NES games.

lidnariq
Posts: 9859
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: What made UNROM such a popular mapper?

Post by lidnariq » Tue Oct 20, 2020 5:58 pm

GNROM or Color Dreams have the distinct advantage that it lets you have a really large amount of program and graphic data - easily extended all the way to 512KB PRG and 128KB CHR - for a minimal overhead cost. (Just the cost of the ROMs).

But ... producing a larger ROM costs more money. Producing the data to fill a larger ROM costs more money. When was it worth it? Most of the BNROM-class games we know were manufactured after the NES's original commercial life ended.

GNROM and Color Dreams also have the disadvantage, like CNROM, that there's no ability to compose graphics together. You just have however many banks of CHR, and you have to fit your gameplay into those predefined combinations of background and foreground tiles.

There were a number of Japan-only games that combined UNROM-style banking with single-bank CHR bankswtiching too. See my summary on the wiki.

User avatar
za909
Posts: 216
Joined: Fri Jan 24, 2014 9:05 am
Location: Hungary

Re: What made UNROM such a popular mapper?

Post by za909 » Wed Oct 21, 2020 2:06 am

tokumaru wrote:
Tue Oct 20, 2020 5:52 pm
za909 wrote:
Tue Oct 20, 2020 5:07 pm
This actually makes me think, since you only need to watch for one bit of the address when accepting latch inputs, could the low bits of the address be used to easily set a register that's wider than 8 bits? with a setup like this, you'd write whatever to $8000 for bank 0, $8001 for bank 1, etc.
I'm pretty sure this is how several Atari 2600 mappers work. Why would you need more than 8 bits for the PRG bank index in an NES game though? 16KB * 256 is 4MB, way more than anyone should be using for NES games.
I don't necessarily mean expanding the PRG capacity, but to introduce something else. For example, the one thing missing from UNROM that I've personally always wanted was some kind of cartridge IRQ. With traditional mapper setups you either get a scanline/cycle counter OR the possiblity for very large ROMs but never both at the same time. So with an expanded register like this, the data bus could still serve as the bank index, and there would still be bits left to control a counter thrown in between φ2 and the IRQ pin for crude cycle-based interrupts.

NewRisingSun
Posts: 1239
Joined: Thu May 19, 2005 11:30 am

Re: What made UNROM such a popular mapper?

Post by NewRisingSun » Wed Oct 21, 2020 2:38 am

tokumaru wrote:
Tue Oct 20, 2020 5:52 pm
Why would you need more than 8 bits for the PRG bank index in an NES game though? 16KB * 256 is 4MB, way more than anyone should be using for NES games.
The homebrew music cartridge "A Winner is You" uses 64 MiB (mapper 409).

User avatar
tokumaru
Posts: 11907
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: What made UNROM such a popular mapper?

Post by tokumaru » Wed Oct 21, 2020 2:50 am

Yeah, but that's a gimmick, an exception. If you're making an actual NES game rather than streaming media, you're probably not gonna need more than 4MB.

Post Reply