Page 1 of 2

LoROM vs HiROM

Posted: Sun May 06, 2012 1:58 am
by AWJ
LoROM advantages:

- You have ROM, hardware registers, and (the first 8kB of) WRAM all in the same bank, so you need fewer 24-bit absolute addresses and 24-bit pointers, making your code marginally smaller and faster.

- For the same reason, code originally written for the NES or another 6502-based platform can be reused with less work.

HiROM advantages:

- Banks are twice as large, so your code modules can be bigger, meaning you need fewer far JMPs and JSRs and it's easier to take advantage of locality (i.e. keeping data in the same bank as the code that uses it)

- ROM is contiguous in the CPU address space, so you can work with blocks of data that span banks (e.g. large RPG scripts) slightly more easily.

Am I missing anything? Seems to be largely a matter of developer preference; both cartridge mappings allow up to 32MBit of ROM and the advantages and limitations look like a wash to me.

Early games seem to all be LoROM. Is it for the 8-bit code reuse reason, or did Nintendo only introduce HiROM cartridges at a later date? Later games are mostly HiROM, but it depends on the maker: Konami in particular seems to have favored LoROM (Tokimeki Memorial is the only 32MBit LoROM cartridge I can name off the top of my head)

Posted: Sun May 06, 2012 2:59 am
by Bregalad
or did Nintendo only introduce HiROM cartridges at a later date?
I'm pretty sure it's that.
As you say, Konami seems to have prefered LoRom, but for example, Squaresoft moved to HiRom very soon (with the release of Final Fantasy V) and never ever used LoRom again.

Posted: Sun May 06, 2012 9:40 am
by MottZilla
Nothing about 8-bit code. It's just a matter of preference. There may be some slight advantages but there isn't anything too drastic, it is just how ROM is decoded to the address space afterall.

Posted: Sun May 06, 2012 4:04 pm
by Near
LoROM and HiROM don't actually exist. Although I don't have a better name for this, what you're implying is basically A22=0 vs 1. Of course I'll have better luck eliminating SMC than this terminology, I'm sure ;)

There's a whole host of mapper types out there, and many cartridges will mirror the ROM into both the $00-3f|80-bf and $c0-ff regions. The exact mirroring will vary across every PCB configuration. This can get important when you access areas like $40-7d:xxxx or FastROM $c0-ff:0000-7fff.

Posted: Sun May 06, 2012 5:11 pm
by AWJ
byuu wrote:LoROM and HiROM don't actually exist. Although I don't have a better name for this, what you're implying is basically A22=0 vs 1. Of course I'll have better luck eliminating SMC than this terminology, I'm sure ;)

There's a whole host of mapper types out there, and many cartridges will mirror the ROM into both the $00-3f|80-bf and $c0-ff regions. The exact mirroring will vary across every PCB configuration. This can get important when you access areas like $40-7d:xxxx or FastROM $c0-ff:0000-7fff.
Thank you for being pedantic :) I know the terms "LoROM" and "HiROM" are misleading, because ROM is visible in both the "low" and "high" regions of the address space in many cartridges. In fact, in large "LoROM" cartridges like Tokimeki Memorial, the ROM past 16MBit is only visible in the "HiROM" region of the address space.

I'm talking about what Nintendo calls Mode 20 and Mode 21--basically, whether A15 ultimately connects to an address line on the ROM(s) or not. I'm ignoring the exotic mappings that are only used on >32Mbit cartridges and cartridges containing special hardware.

Posted: Sun May 06, 2012 6:39 pm
by Near
I'm talking about what Nintendo calls Mode 20 and Mode 21--basically, whether A15 ultimately connects to an address line on the ROM(s) or not. I'm ignoring the exotic mappings that are only used on >32Mbit cartridges and cartridges containing special hardware.
The problem is that modes 20/21 aren't any more specific than LoROM/HiROM, and don't reflect the reality that there are approximately a hundred different memory layout configurations available. I'm not just talking about the four games >32MB, either.

Again, I understand what you're going for, and a generic term for it would be good, but the nomenclature has a history of being used improperly, so it would be nice for someone better with naming things to come up with some new definitions that will never catch on :D

Re: LoROM vs HiROM

Posted: Thu Jan 05, 2017 1:48 pm
by tepples
To summarize:

LoROM (mode $20): A15 and A23 skipped
This fills the second half of each bank and starts at the "low" part of cartridge address space: banks $00/$80 on up.

HiROM (mode $21): A22 and A23 skipped
This fills the whole bank, starting at $40/$C0.

ExHiROM (mode $25): A22 skipped, A23 inverted
Similar to HiROM, filling banks $C0-$FF then $40-$5F (in practice) or $40-$7D (in theory).

ExLoROM (unofficial)
Mentioned in some places, but not used in licensed games nor with an agreed upon definition to my knowledge.

The official Super NES programming manual reportedly names these modes by the value at $00FFD5 in the internal header ($20, $21, or $25). I guess some people just prefer names as more memorable, just as people in the NES scene prefer "AOROM" and "UNROM" to "mapper 7" and "mapper 2".

Unlike with NES mappers named after their exemplar cartridge boards, these names don't appear on cartridge boards. But I can see where some of these names come from, especially before 32 Mbit fast ROMs became common. A 16 Mbit LoROM covers $808000-$BFFFFF with holes for the system area mirrors, and in the slow ROM era, the mirror at $008000-$3FFFFF was just as likely to be used. A 16 Mbit HiROM covers $C00000-$DFFFFF, which is a higher address range.

Now my question: Who coined the names LoROM, HiROM, and ExHiROM? Copier makers?

Re: LoROM vs HiROM

Posted: Thu Jan 05, 2017 3:08 pm
by psycopathicteen
AWJ wrote:LoROM advantages:

- You have ROM, hardware registers, and (the first 8kB of) WRAM all in the same bank, so you need fewer 24-bit absolute addresses and 24-bit pointers, making your code marginally smaller and faster.
You can do that with HiROM too. The upper half of each bank also gets mapped into the LoROM area.

Re: LoROM vs HiROM

Posted: Thu Jan 05, 2017 3:18 pm
by koitsu
tepples wrote:Now my question: Who coined the names LoROM, HiROM, and ExHiROM? Copier makers?
It was me. And a buddy of mine named Frank.

Re: LoROM vs HiROM

Posted: Fri Jan 06, 2017 1:00 am
by Near
Image

"It was me, koitsu!"

Also, five year old topic bump >_>

Re: LoROM vs HiROM

Posted: Fri Jan 06, 2017 4:26 am
by koitsu
Jojo <3

Re: LoROM vs HiROM

Posted: Fri Jan 06, 2017 9:09 am
by psycopathicteen
Wait? Tepples bumped the thread?

Re: LoROM vs HiROM

Posted: Fri Jan 06, 2017 9:22 am
by tepples
First I searched to see if there was already an answer. Not finding one, I asked in the closest topic that fit. I guess my preference for a necro over a dupe is informed by the classic Flash slideshow "Posting and You" (SWF | YouTube).

Re: LoROM vs HiROM

Posted: Fri Jan 06, 2017 6:30 pm
by nicklausw
koitsu wrote:
tepples wrote:Now my question: Who coined the names LoROM, HiROM, and ExHiROM? Copier makers?
It was me. And a buddy of mine named Frank.
Have you ever felt weird seeing this many people (that being most of SNESdev) using a term you created? I'd feel like some sort of celebrity.

Re: LoROM vs HiROM

Posted: Fri Jan 06, 2017 7:06 pm
by Near
> I guess my preference for a necro over a dupe is informed by the classic Flash slideshow "Posting and You"

Really, my only problem with old topic bumps is it not being clear that it happened. I read the first post and was getting ready to start my usual "chain of replies to messages in the thread" until I saw I had already replied, and then realized it was from 2012.

If I had all the time in the world to design a dream forum, then the way I'd do it would be that topics pseudo-locked after X days/months of no activity. You could still post a reply. But it would create a new topic with a special "link" icon, and there would be a special link at the top of the thread to the old discussion.

Of course, we can't do that with phpBB3. As such, you're the admin here, so it's your rules :)

> Have you ever felt weird seeing this many people (that being most of SNESdev) using a term you created? I'd feel like some sort of celebrity.

He's also the person that discovered and documented Felon's banana register ;)

Joking aside, he was a large part of the early efforts of documenting the SNES. Even though that information isn't really useful today, now that we know so much more and have far better documentation (thanks to anomie), we're all very aware and gracious of the fact that we can see further thanks to standing on the shoulders of giants that came before us. So he'll always be immortalized as an early pioneer of the SNES scene.

That said, LoROM/HiROM is one such thing that's really not relevant anymore. This is the reality of SNES mapping:

https://preservation.byuu.org/Boards

There aren't two (or three with ExHiROM) board layouts: there are around ~110 PCB layouts, of which sort into ~60 memory map models (I don't have them all in my DB yet), of which there are ~30 or so unique layouts that ROM data can exist within. And that's just for commercial carts. The sky's the limit with unofficial designs.

Breaking down LoROM/HiROM is basically the decision whether or not to wire up A15 to the ROM chips / memory mapper or not. It's fine to generalize with these terms, but if we want to be more precise and improve the quality of emulation, we need to move past simplifications like this.