68k program header

From NeoGeo Development Wiki
Revision as of 09:45, 5 May 2011 by ElBarto (talk | contribs) (Add description of config data)
Jump to navigation Jump to search

ASM ROM header templates.

For cartridge systems

  • $0064: VBlank handling routine pointer
  • $0100: "NEO-GEO",$00 string
  • $0108: NGH number
  • $010A: ?
  • $010E: pointer to debug DIPs (in user RAM)
  • $0114: boot logo flag and tile number
  • $0116: pointer to Japanese settings info block
  • $011A: pointer to US settings info block
  • $011E: pointer to Euro settings info block
  • $0122: pointer to code start
  • $0182: pointer to security code

Minimal header (from Smkdan's sources)

No need for a complete 68k vector table.

	org $0064
	dc.l VBLANK	;IRQ handler

	org $0100
	dc.b "NEO-GEO",$00

	org $0108
	dc.w $017	;NGH

	org $0122
	jmp Start	;entry

	org $0114
	dc.w $0100	;logo flag, don't show it just go straight to the entry point

	org $0182
	dc.l Code	;code pointer
Code:
	dc.l $76004A6D,$0A146600,$003C206D,$0A043E2D
	dc.l $0A0813C0,$00300001,$32100C01,$00FF671A
	dc.l $30280002,$B02D0ACE,$66103028,$0004B02D
	dc.l $0ACF6606,$B22D0AD0,$67085088,$51CFFFD4
	dc.l $36074E75,$206D0A04,$3E2D0A08,$3210E049
	dc.l $0C0100FF,$671A3010,$B02D0ACE,$66123028
	dc.l $0002E048,$B02D0ACF,$6606B22D,$0AD06708
	dc.l $588851CF,$FFD83607
	dc.w $4e75


Full header (from some unknown example code)

    org $0100
    dc.b "NEO-GEO",$00

    dc.w $0052        ;NGH
    dc.l $00080000    ;ROM p1 size
    dc.l $00100000    ;debug DIPs pointer
    dc.w $01          ;bootscreen flag
    dc.w $1B          ;first tile number of the NeoGeo logo in the C ROMs ?
    dc.l JPConfig     ;Japanese config menu pointer
    dc.l ENConfig     ;English config menu pointer
    dc.l EUConfig     ;European config menu pointer

    jmp        Start
    jmp        Start  ;?
    jmp        Start  ;?
    jmp        Start  ;?

    org $0182
    dc.l Code         ;code pointer
Code:
    dc.l $76004A6D,$0A146600,$003C206D,$0A043E2D
    dc.l $0A0813C0,$00300001,$32100C01,$00FF671A
    dc.l $30280002,$B02D0ACE,$66103028,$0004B02D
    dc.l $0ACF6606,$B22D0AD0,$67085088,$51CFFFD4
    dc.l $36074E75,$206D0A04,$3E2D0A08,$3210E049
    dc.l $0C0100FF,$671A3010,$B02D0ACE,$66123028
    dc.l $0002E048,$B02D0ACF,$6606B22D,$0AD06708
    dc.l $588851CF,$FFD83607
    dc.w $4e75

    ; Configuration menu layouts (soft DIPs), format unknown...
 JPConfig:
    dc.b    "0123456789ABCDEF"      ; Game name
    dc.l    $FFFFFFFF               ; Pointer ?
    dc.w    $0364                   ; ?
    dc.b    $14,$13,$24,$01

 ENConfig:
    dc.b    "0123456789ABCDEF"      ; Game name
    dc.l    $FFFFFFFF               ; Pointer ?
    dc.w    $0364                   ; ?
    dc.b    $14,$13,$24,$01

 EUConfig:
    dc.b    "0123456789ABCDEF"      ; Game name
    dc.l    $FFFFFFFF               ; Pointer ?
    dc.w    $0364                   ; ?
    dc.b    $14,$13,$24,$01

Config data description

0x00 GAME NAME 16 bytes

0x10 Options list, up to 16 entry. backwards padded with 0xFF. 1 byte per entry.

0x20 0x0000 padding ?

0x24 Options string table.

Options list description :

Each options consist of 1 byte.

The upper 4 bits specify the default value and the lower 4 bits the number of choice.

String in the string table are 12 bytes long, padded with 0x20 (space).


For CD systems

    org     $100
    dc.b    "NEO-GEO", $02          ;CDDA flag
    dc.w    $1234                   ;NGH
    dc.l    $00500000               ;from Metal Slug 2
    dc.l    $0010F000               ;debug DIPs pointer
    dc.w    $007A                   ;not used ?
    dc.w    $00A1                   ;not used ?

    org     $122
    jmp     Start
    jmp     Generic                 ;?
    jmp     Generic                 ;?
    jmp     Generic                 ;?

    org     $13A
    dc.w    $0000                   ;Z80 RAM address for CDDA commands

Generic:
    rte
    rts