NEX file format

From SpecNext official Wiki
Revision as of 07:03, 31 March 2019 by wiki>Ped7g
Jump to: navigation, search

The NEX file format was designed as very simple and straightforward format to load self-contained applications into memory and start them. Through various extensions it did reach v1.2 at this moment, which allows even for more complex use cases.

The basic structure of the file is:

block size optional description
512 "Next" string followed by file header, containing also map of memory banks stored in the file
512 * optional palette (for Layer2 or LoRes screen)
49152 * Layer2 loading screen
6912 * classic ULA loading screen
12288 * LoRes loading screen
12288 * Timex HiRes (512x192) loading screen
12288 * Timex HiCol (8x1) loading screen
n * 16384 * 16kiB raw memory bank data in predefined order: 5,2,0,1,3,4,6,7,8,9,10,...,111 (particular bank may be omitted completely)

Structure of the header block: The basic structure of the file is:

offset size description
0 4 "Next" string
4 4 string with NEX file version, currently either "V1.1" or "V1.2"
8 1 RAM required: 0 = 768k, 1 = 1792k
9 1 Number of 16k Banks to Load: 0-112
10 1 Loading-screen blocks in file (bit-flags):

128 = no palette block, 16 = Hi-Colour, 8 = Hi-Res, 4 = Lo-Res, 2 = ULA, 1 = Layer2

11 1 Border Colour: 0-7
12 2 Stack pointer
14 2 Program counter (0 = don't run, just load)
16 2 "Number of extra files" (currently not used by anything/anyone?)
... work in progress ...