It is currently Wed Aug 15, 2018 7:58 pm

 All times are UTC - 7 hours

### Forum rules

Related:
• For making cartridges of your Super NES games, see Reproduction.

 Page 1 of 1 [ 3 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Dumb question about mapping ROMPosted: Fri Mar 03, 2017 12:15 pm

Joined: Thu Aug 16, 2012 7:55 pm
Posts: 34
I am still trucking away in attempting to write an SNES emulator and have been using SMW as a test ROM. I have read this document here on LoROM.

http://www.cs.umb.edu/~bazz/snes/cartridges/lorom.html

Before, I was just straight reading bytes from the ROM into an array to test my instructions... But now I want to properly map the data into my array at the correct addresses to properly test branching and jumping.

This leads me to the following question...

When the document says that ROM is mapped from \$00:8000-\$00:FFFF -> \$3F:8000-\$3F:FFFF, then \$40:8000-\$40:FFFF -> \$6F:8000-\$6F:FFFF, and \$70:8000-\$7D:FFFF, etc... Does that mean we just load 32KB sequentially at those banks?

Like, the first 32KB goes into \$00:8000->\$00:FFFF then the next 32KB of the ROM goes into \$01:8000->\$01:FFFF and so on... Then once the \$00-\$3F banks are filled, we proceed to \$40-\$6F and so on...

Can anyone confirm this for me? THANKS!

Top

 Post subject: Re: Dumb question about mapping ROMPosted: Sat Mar 04, 2017 7:06 pm

Joined: Mon Jan 23, 2006 7:47 am
Posts: 124
You could take the SNES address, cut out bit 15 and use the result as the ROM file offset.

Should be like this

Code:
// ...
const Bit15 = 1 SHL 15;  Bits15 = Bit15 - 1;
// ...

Offset := (SNES_Address.Bank SHL 15) OR (SNES_Address.Offset AND Bits15);

EDIT: I should note that byuu has a database of SNES games and game cartridge boards. You can calculate the SHA256 of your ROM and look up its specifications. For example SMW has a board ID of "SHVC-1A1B-06", and looking that up in the board list shows where ROM and RAM are mapped and what address bits are masked (cut out) to get the file offset.

Top

 Post subject: Re: Dumb question about mapping ROMPosted: Wed Mar 08, 2017 8:13 am

Joined: Thu Aug 16, 2012 7:55 pm
Posts: 34
Sweet! Thanks for the tip. It was initially hard to wrap my head around the address calculation but this got me started.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 3 posts ]

 All times are UTC - 7 hours

#### Who is online

Users browsing this forum: No registered users and 2 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ NES / Famicom    NESdev    NESemdev    NES Graphics    NES Music    Homebrew Projects       2018 NESdev Competition       2017 NESdev Competition       2016 NESdev Competition       2014 NESdev Competition       2011 NESdev Competition    Newbie Help Center    NES Hardware and Flash Equipment       Reproduction    NESdev International       FCdev       NESdev China       NESdev Middle East Other    General Stuff    Membler Industries    Other Retro Dev       SNESdev       GBDev    Test Forum Site Issues    phpBB Issues    Web Issues    nesdevWiki