Source

neslib / ines.h

	
	INesMirroringHorizontal = 0
	INesMirroringVertical = 1

	;; Some common mappers
	INesMapperNone = 0
	INesMapperMMC1 = 1
	INesMapperUNROM = 2
	INesMapperCNROM = 3
	INesMapperMMC3 = 4
	INesMapperMMC5 = 5
	
.macro INesPrgSizeInKilobytes size
	.assert size > 0, error, "Size must be greater than zero"
	.assert ((size & $f) = 0), error, "Size must be a multiple of 16k"
	INesPrgSize = size / 16
.endmacro
	
.macro INesChrSizeInKilobytes size
	.assert size > 0, error, "Size must be greater than zero"
	.assert ((size & $7) = 0), error, "Size must be a multiple of 8k"
	INesChrSize = size / 8
.endmacro
	
.macro INesHeaderStart
	.pushseg
	.segment "HEADER"
.endmacro
	
.macro INesHeaderEnd
	;; iNES header identifier: "NES" + $1A. Don't use a string in case
	;; a non-standard charmap is setup
	.byte	$4e, $45, $53, $1A
	.byte	INesPrgSize	; PRG code
	.byte	INesChrSize	; CHR data
	.byte	((INesMapper & $0F) << 4) | INesMirroring
	.byte	(INesMapper & $F0)
	
	;; Filler
	.byte	$00, $00, $00, $00
	.byte	$00, $00, $00, $00
	
	.popseg
.endmacro
	
	
; Local Variables: 
; mode: asm
; End: 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.