News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Defining Header in ASM6  (Read 2579 times)

AlienX

  • Jr. Member
  • **
  • Posts: 4
    • View Profile
Defining Header in ASM6
« on: February 24, 2016, 02:25:29 pm »
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?

Thanks!

snarfblam

  • Submission Reviewer
  • Hero Member
  • *****
  • Posts: 593
  • CANT HACK METROID
    • View Profile
    • snarfblam
Re: Defining Header in ASM6
« Reply #1 on: February 24, 2016, 05:26:04 pm »
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:

Code: [Select]
;----------------------------------------------------------------
; 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

AlienX

  • Jr. Member
  • **
  • Posts: 4
    • View Profile
Re: Defining Header in ASM6
« Reply #2 on: February 25, 2016, 11:02:08 am »
Oh, there's even an entire template, as I can see. Thanks!