nesdev.comhttps://forums.nesdev.com/ how mapped memory?https://forums.nesdev.com/viewtopic.php?f=12&t=10389 Page 1 of 1

 Author: skarstoker [ Mon Aug 19, 2013 3:53 pm ] Post subject: how mapped memory? hello friendsI'm trying to understand how memory is mappedinvent this table to check if IP routing is similar to snes mappingsomeone can explain how memory is addressedexample: (2 ROM of 32 Mbits)00-3F in bank 8000-FFFF (1 ROM) and C0-FF in bank 8000-FFFF (2 ROM)excuse my bad Englishregards.

Author:  koitsu [ Mon Aug 19, 2013 5:59 pm ]
Post subject:  Re: how mapped memory?

"2 ROM of 32mbits" means 64mbit.

Mode 21 does not have enough addressing space for a 64mbit ROM. The maximum ROM addressing space available with mode 21 is 32mbit. The only solutions to this:

1. Use what's called a "mapper", which is a chip that can let software dynamically swap portions of ROM around (change address lines and where they go). There are are only a handful of games which use this on the SNES/SFC (mode 21 with a special mapper chip),

2. Use mode 25, which supports up to 63mbit (not 64mbit!) of addressing space. The reason it doesn't support up to 64mbit is because, again, of the memory map (see attached picture). There are two main areas for ROM (the others are mirrors):

* Area 1: Banks \$c0-ff (64 banks), address ranges \$0000-ffff (64KB). Simple math: 64 * 65536 = 4,194,304 bytes
* Area 2: Banks \$40-7d (62 banks), address ranges \$0000-ffff (64KB). Simple math: 62 * 65536 = 4,063,232 bytes
* Area 3: Banks \$3e-3f (2 banks), address ranges \$8000-ffff (32KB). Simple math: 2 * 32768 = 65,536 bytes

Thusly, 4,194,304 + 4,063,232 + 65,536 = 8,323,072 bytes, which is just short of 64mbit (8,388,608 bytes).

Make sense?