NFO2 language
Posted: 30 Dec 2007 20:05
I see people posting their high-level languages for NFO coding, so I decided to post my own too (so we have enough choices to choose from :). I created it some time ago when coding my large ships newGRF to help me with development.
It is written in perl and it is essentially "only" a preprocessor, replacing symbolic constants and resolving need for having a spritecount at beginning (this one can be filled automatically)
But it will make the file more readable, which can be seen in example files posted along with the tool (vl_shipw.nf2 vs vl_shipw.nfo)
Usage information is also in the archive.
The internal tables are largely incomplete (basically, they contain mostly some of the ship-related constants plus few generic ones)
The implementation is kinda hackish and perhaps buggy (but this can be fixed by using some proper parser instead of bunch of regexps :), but I thought it to be easier than implementing such functionality (automatic sprite count and named constants) into grfcodec, especially if I am unfamiliar with grfcodec internals. Also, it supports partial decompilation (some of the numbers are resolved to corresponding constants, byte sequences known to represent a word are converted to word, etc ...)
It is written in perl and it is essentially "only" a preprocessor, replacing symbolic constants and resolving need for having a spritecount at beginning (this one can be filled automatically)
But it will make the file more readable, which can be seen in example files posted along with the tool (vl_shipw.nf2 vs vl_shipw.nfo)
Usage information is also in the archive.
The internal tables are largely incomplete (basically, they contain mostly some of the ship-related constants plus few generic ones)
The implementation is kinda hackish and perhaps buggy (but this can be fixed by using some proper parser instead of bunch of regexps :), but I thought it to be easier than implementing such functionality (automatic sprite count and named constants) into grfcodec, especially if I am unfamiliar with grfcodec internals. Also, it supports partial decompilation (some of the numbers are resolved to corresponding constants, byte sequences known to represent a word are converted to word, etc ...)