User:Zzo38/ines.map and unif.map

From NESdev Wiki
< User:Zzo38
Revision as of 22:27, 19 August 2012 by Zzo38 (talk | contribs) (Created page with "This file describes the format of <tt>ines.map</tt> and <tt>unif.map</tt> files used with DotFami. The file is a plain ASCII file which is preprocessed...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

This file describes the format of ines.map and unif.map files used with DotFami.

The file is a plain ASCII file which is preprocessed with the C preprocessor and uses a C-like syntax. All constant operators (other than sizeof) are the same as in C, including the same precedence.

All data is signed 64-bit integers. ASCII character constants can be used, and you can use decimal, hexadecimal, and octal constants, same as in C.

Keywords

crc
function
if
local
mapper
parameter
procedure
rom
romsize
submapper
switch
use

Outer Codes

At the top (outer) level of the file, the following statements are allowed:

  • variable = expression ;
  • parameter expression = expression ;
  • use string ;
  • if( condition ) statement
  • if( condition ) statement else statement
  • { statements }
  • switch( expression ) { cases }
  • function name ( parameters ) { statements }
  • procedure name ( parameters ) { statements }
  • procedurename ( parameters );

Inner Codes

Where statement(s) are expected at inner level, the following is acceptable:

  • variable = expression ;
  • parameter expression = expression ;
  • use string ;
  • if( condition ) statement
  • if( condition ) statement else statement
  • { statements }
  • switch( expression ) { cases }
  • local variables (only inside a {} block)
  • procedurename ( parameters );

Cases

A case in a switch is formatted as either a string literal or a constant expression, followed by { statements }

Variables

  • Each variable may only be assigned once and must be assigned before used.
  • Some variables can be local to a block, which case they are accessible only within that block.
  • If a condition or switch statement contains blocks which assign variables not local to those blocks, then all cases must assign the same set of variables (not counting variables local to those blocks).
  • A procedure may also assign global variables.
  • Variables store 64-bit values.
  • Parameters to procedures and functions are also acting like local variables which are already assigned.
  • Strings can also be assigned to variables although they cannot be used as a number if they do.