It is currently Fri Oct 20, 2017 2:49 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Mapper 111 header
PostPosted: Sat Aug 19, 2017 8:40 am 
Offline
Formerly WheelInventor

Joined: Thu Apr 14, 2016 2:55 am
Posts: 907
Location: Gothenburg, Sweden
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:
.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?

_________________
http://www.frankengraphics.com - personal NES blog


Top
 Profile  
 
 Post subject: Re: Mapper 111 header
PostPosted: Sat Aug 19, 2017 8:50 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10064
Location: Rio de Janeiro - Brazil
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.


Top
 Profile  
 
 Post subject: Re: Mapper 111 header
PostPosted: Sat Aug 19, 2017 9:08 am 
Offline
Formerly WheelInventor

Joined: Thu Apr 14, 2016 2:55 am
Posts: 907
Location: Gothenburg, Sweden
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:
.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.

_________________
http://www.frankengraphics.com - personal NES blog


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 6 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