It is currently Sun Oct 22, 2017 6:42 am

All times are UTC - 7 hours



Forum rules


Related:



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Mar 03, 2017 12:15 pm 
Offline

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
 Profile  
 
PostPosted: Sat Mar 04, 2017 7:06 pm 
Offline
User avatar

Joined: Mon Jan 23, 2006 7:47 am
Posts: 70
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
 Profile  
 
PostPosted: Wed Mar 08, 2017 8:13 am 
Offline

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
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 8 guests


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

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group