SNES ROM Header Format Specification

Strictly for discussing ZSNES development and for submitting code. You can also join us on IRC at irc.libera.chat in #zsnes.
Please, no requests here.

Moderator: ZSNES Mods

Post Reply
pobetiger

SNES ROM Header Format Specification

Post by pobetiger »

Hi,

This may be related to the thread: http://board.zsnes.com/phpBB2/viewtopic.php?t=9775

I'm working with cc65, but lack good documentation, especially on what the ROM's header should look like in more normal assembly code as opposed to the one listed on wikibooks:
http://en.wikibooks.org/wiki/Console_Ga ... ial/header
(it uses WLA specific derivatives).

I looked everywhere, most of the links I end up with uses some sort of assembler-specific stuff, for example:

Code: Select all

.SNESHEADER
  ID "SNES"                     ; 1-4 letter string, just leave it as "SNES"
  
  NAME "SNES Tile Demo       "  ; Program Title - can't be over 21 bytes,
  ;    "123456789012345678901"  ; use spaces for unused bytes of the name.

  SLOWROM
  LOROM

  CARTRIDGETYPE $00             ; $00 = ROM only, see WLA documentation for others
  ROMSIZE $08                   ; $08 = 2 Mbits,  see WLA doc for more..
  SRAMSIZE $00                  ; No SRAM         see WLA doc for more..
  COUNTRY $01                   ; $01 = U.S.  $00 = Japan, that's all I know
  LICENSEECODE $00              ; Just use $00
  VERSION $00                   ; $00 = 1.00, $01 = 1.01, etc.
.ENDSNES
According to WLA-DX's document, that I dug up somewhere from google, these derivatives will automatically write to a certain location in the final output file, but my source fails to completely specify most of those locations, besides the handful few:
ID is at $7FB2
cartridge type is at $7FD6
(source: http://www.os4depot.net/index.php?funct ... wla-dx.lha)
But it's really hard to code without knowing the full picture of things...

One tutorial I found simply just ignored the header and went straight to stuff on compression of maps, etc.

Now, I know ZSNES has to read this stuff at some point when loading the ROM to play, so just wondering if there's a handy-dandy spec sheet somewhere that the ZSNES dev team uses as a reference? Where exactly do this header reside and is there anywhere to find more documentation on what is in the header, their location in the ROM, etc.?

And if any of ya'll know of links to tutorials on developing homebrew SNES games using the cc65 package, could you be so kind to post it also? :-)
(i.e. how to setup the linker config file, etc.)

Thanks,
smkdan
Hazed
Posts: 88
Joined: Sun Dec 19, 2004 4:55 am

Post by smkdan »

I'm guessing this is the stuff you're after.

Image

Those are for 'Map Mode 21' / HiRom / whatever the accepted name for it is. For 'LoRom' they appear in the ROM 8000h earlier. There's a dev manual below that covers it.

http://www.romhacking.net/docs/SFC_Manual.zip
creaothceann
Seen it all
Posts: 2302
Joined: Mon Jan 03, 2005 5:04 pm
Location: Germany
Contact:

Post by creaothceann »

vSNES | Delphi 10 BPLs
bsnes launcher with recent files list
Post Reply