NES Header info

Gregg Richardson

Active member
In NESmaker's Header.asm don't give much information. So I decided to learn about the header and add information from Nesdev Wiki. I can modify the header, such as change the mirroring type(Horizontal, Vertical, 1 screen, 4 screens), and colors (NES and IniSystem), without crashing my adventure module.



Code:
;;(Bytes 0,1,2,  3)
    .db "NES", $1A
;;(Byte 4)
    .db $20;HEX as 32(DEC) of 16KB RPG ROM banks. 32x16KB=512KB
;;(Byte 5)
    .db $00 ;8KB CHR ROM.
;;(Byte 6)
    ;;   76543210
    ;;   ||||||||
    ;;   |||||||+: Nametable Arrangement: 0: Vertical arrangement     (horizontal mirrored)  (CIRAM A10 = PPU A11)
    ;;   |||||||+:                        1: Horizontal arrangement   (vertically mirrored)  (CIRAM A10 = PPU A10)
    ;;   ||||||+-: Cartridge contains battery-backed PRG RAM ($6000-7FFF) or other persistent memory
    ;;   |||||+--: 512-byte trainer at $7000-$71FF)(stored before PRG data)
    ;;   ||||+--+: Alternative nametable layout: 1--0: 1-Screen  
    ;;   ||||+--+: Alternative nametable layout: 1--1: 4-Screens
    ;;   ++++----: 1110: (Lower nybble of mapper number)
    .db %11100011  
;;(Byte 7)
    ;;   76543210
    ;;   ||||||||
    ;;   |||||||+: VS Unisystem: 0: Nintendo Entertainment System color
    ;;   |||||||+:                 1: UniSystem color (brighter colors)
    ;;   ||||||+-: PlayChoice-10 (8 KB of Hint Screen data stored after CHR data)
    ;;   ||||++--: If equal to 2, flags 8-15 are in NES 2.0 format.
    ;;   ++++----: Upper nybble of mapper number
    .db %00010000
  ;;(Byte 8, 9, 10, 11, 12, 13, 14, and 15.)
    dsb 8, $00 ;To complete 16 bytes of header.
 
Last edited:

dale_coop

Moderator
Staff member
Those infos doesn't really change the code of your game. It will just infor some emulators what to expect from your game. So... basically, even if your set incorrect values here, your game might still work correctly in most cases.
 
Top Bottom