11 March 2016 - Forum Rules

Main Menu

Defining Header in ASM6

Started by AlienX, February 24, 2016, 02:25:29 PM

Previous topic - Next topic


Noob question: How do you define the iNES header (mapper information, mirroring) in ASM6? Different assemblers seem to use different methods. In NESASM3 you just define .inesprg, .ineschr, etc. In CA65, you have to use the .segment directive. This, however, doesn't seem to work in ASM6, so what exactly should be done?



You have to manually define the header with .db or .byte (depending on the assembler, but iirc ASM6 supports both) directives. As long as you understand the iNES header format and how to insert bytes with your assembler, you should be good to go.

I found this example ASM6 header definition on a nesdev thread:

; iNES header

   .db "NES", $1a ;identification of the iNES header
   .db PRG_COUNT ;number of 16KB PRG-ROM pages
   .db $01 ;number of 8KB CHR-ROM pages
   .db $00|MIRRORING ;mapper 0 and mirroring
   .dsb 9, $00 ;clear the remaining bytes


Oh, there's even an entire template, as I can see. Thanks!