Page 1 of 1

Mapper 111 header

Posted: Sat Aug 19, 2017 8:40 am
by FrankenGraphics
Since rainwarrior implemented support for mapper 111 in FCEUX, i'd like to use it for testing, rather than just writing to cart.

This is my mapper header:

Code: Select all

.segment "HEADER"
	.byte "NES", $1A	;magic number 
	.byte 32         	;16 banks 32kb banks (512kB total); measured in 16kB units by iNES format.
	.byte 0         	;CHR RAM instead of ROM 
	.byte %11111000		;flags 6- lower mapper nibble, 4 screen, no trainer, no battery, mirroring irrelevant
	.byte %10110000 	;flags 7- upper mapper nibble, nes system, iNES header format  
	.byte $00       	;
	.byte $00       	;
	.byte $00       	;PRG RAM: no.
	.byte $02       	;??? CHR RAM
	.byte $00       	;NTSC 
	.byte $00       	;
I'm more than a little confused what i should put in chr ram. Pattern table is 16kB (2 8kB banks). 00 means 8kB, so i suppose i should put 01 here, or... 02? Does 00 mean the same as 01 out of compability, or does counting start at 00? Meanwhile, the nes can only see a pattern bank at a time, but that shouldn't matter here, right?

Does mapper 111 need mapper format 2.0, or is iNES fine?

Re: Mapper 111 header

Posted: Sat Aug 19, 2017 8:50 am
by tokumaru
A $00 in the old CHR-ROM field traditionally means 8KB of CHR-RAM, but you're talking about a NES 2.0 field, which's not related.

I'm pretty sure you have to use the values from the table in this section of the NES 2.0 wiki page. 16KB of non-battery-backed CHR-RAM would be $08, it seems.

AFAIK, traditional iNES doesn't have any means of specifying CHR-RAM sizes other than 8KB. If a game with more than 8KB of CHR-RAM works with an old iNES header, the CHR size is probably being detected based on the mapper or by ROM hashes.

Re: Mapper 111 header

Posted: Sat Aug 19, 2017 9:08 am
by FrankenGraphics
Thanks! So in NES 2.0, setting chr-rom to 0 simply means no, but in iNES, it specifically implies 8kBs of chr-ram? Got it.

Updated to NES 2.0 format:

Code: Select all

.segment "HEADER"
	.byte "NES", $1A	;magic number 
	.byte 32         	;16 banks at 32kb each (512kB total) - measured in 16kB units by iNES format.
	.byte 0         	;CHR RAM instead of ROM 
	.byte %11111000		;flags 6- lower mapper nibble, 4 screen, no trainer, no battery, mirroring irrelevant
	.byte %10111000 	;flags 7- upper mapper nibble, NES 2.0 format, NES system. 
	.byte $00       	;submapper: no. mapper plane: 0. 
	.byte $00       	;upper rom size planes: no
	.byte $00       	;PRG RAM: no.
	.byte $08       	;CHR RAM: 16k 
	.byte $00       	;0=NTSC, 1=PAL
	.byte $00       	;Reserved for VS system. set to 0
	.byte $00, $00		;Reserved, no purpose. 
Should work unless i missed something else.