Programming a NinForge Project
==============================

docs\files.txt contains details on formats of every
file in a project.

Creating a project
------------------

First, you should create a folder specifically for your project.

A project needs some files and folders in order to work. These are:

Folders:
	asm
	bin
	generated
	resource

Files:
	[prjfile].nfp
	header.cfg
	layout.cfg
	prj_decl.asm
	prj_irq.asm
	prj_mem.asm
	prj_nmi.asm
	prj_rest.asm
	prj_zp.asm

The [prjfile] is the project file. It can have any name,
just it ends with the .nfp extension.
The project file is the main file of the project.

Creating a configuration file
-----------------------------
(Not to confuse with CC65 configuration files)
This is also needed with every project, but if it doesnt
exist, NFCompiler creates it automatically.

If the file (config.asm) doesnt exist already, you can go in the
\common sub-folder of NFCompiler, locate stdcfg.asm,
copy it to your projects folder, and rename it to config.asm.

It contains a variety of options you might want to mess with.
Each options should be described enough in the comments next to it.

Programming
-----------

A NinForge program has to start up with a stadium.
Wich one is defined in config.asm. You can also
put code to be executed -before- the startup
stadium in the prj_rest.asm file
of your project. Look in docs\routines.txt for a
list of macros that can be called in stadiums and
processes. You have to define your programs memory
in prj_zp.asm and prj_mem.asm. This is not done
using constant defining, but the .res directive.
CC65 will then reserve memory as the common library,
includable libraries, and the program itself needs
it, both in zero page and not. For example:

byte1 .res 1
byte2 .res 1
byte3 .res 1
word1 .res 2

You can also use constants you have defined in the
file (or prj_declare), in place of the numbers. like..

string_size = 6
string_data .res string_size

Since defining files and ASM in resorce files
are purely ASM for CC65, it should be useful to
check out all the control commands and function
features of the CC65 assembler. (if youve never
used them)

Located here:
http://www.cc65.org/doc/ca65.html