NFORenum v3.4.6 released (NFO renumberer and linter)

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

User avatar
George
Tycoon
Tycoon
Posts: 4362
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Post by George »

DaleStan wrote:
George wrote://!!Warning (103): Shifting variable 44 past its length.
582 * 14 02 07 2B 81 44 10 FF 01 29 00 00 00 2A 00
Officially, yes, that variable is a dword, but it looks to me like that line checks a reserved byte.
The wiki wrote:Building counts (44)
Returns dword rrrrCCcc,
Who makes the wiki? This part is missing!

Code: Select all

	44	Returns dword LLllCCcc, where cc means how many buildings
		of the current type can be found in the current town, while
		CC is the same for the whole map. ll and LL are similar to
		cc and CC, but contain the number of tiles that have the
		same class as the current one. For tiles that have no class,
		ll and LL are always zero. Overridden old types	are considered
		to be the new type they were overridden with. During callback 17,
		the current building isn't on the map yet, and therefore isn't
		counted. In other cases, the building count is at least one,
		since the current building is counted as well.
		ll and LL are available in alpha 42 vcs 2 and above only,
		the high word is undefined for older versions.
BTW, It works.
Image Image Image Image
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Wiki has been updated, and here's a new 2v.dat. (293 bytes -> 297 bytes) (Same size as two posts ago, though.)

Changelog:
- Widened var 44 to a dword.

EDIT: new version; see OP.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Slightly later than I had intended, mostly because I almost forgot the last item in the changelog.

v2.4.7 to v2.4.8
- Up to date with a61:
- - Supports sound imports
- - Action 0 <id> is now an extended byte
- Some message considation.
- (bugfix) Checks length of extended house/industry tile action2s before
processing.
- (bugfix) Fixed callback result check (id&0x8000, not &0xF000)
- Added check for valid transparent translation sprite.
- Added offset leaders to three more messages
- Added check for using only constant variables (1A and 1C).
- Removed duplicate default warning if (and only if) nvar == 1 and the referenced cargo ID checks variable 1C.

See first post for full details and download.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

AARGH!!! <insert cuss word here> In fact, go ahead and insert several such words. The wonders of a missing "break;" and wanting to release *now*.

If you downloaded 2.4.8, this one's probably not worth downloading unless you are actually playing with newsounds.

v2.4.8 to v2.4.9
- (bugfix) Don't issue an invalid action byte message on import sprites.

See first post for full details and download.
Last edited by DaleStan on 26 Sep 2005 08:16, edited 1 time in total.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5602
Joined: 13 Sep 2004 13:21
Location: The Moon

Post by PikkaBird »

Thanks Dale. :)

Sorry if this is a silly question. But with the previous version I was using, I could just drag and drop a .nfo file onto the exe to renum it - and that doesn't seem to be working any more. Any ideas?

If I go into a cmd and run it from there, it seems to work fine.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Umm....

*poke*compile*prod*compile*fiddle*compile*...

Grrr....

Well, it appears that, starting with 2.4.6, it fails to find its datafiles. Exactly why is something best left for after I have slept, but for now you can work around the problem by creating a shortcut to renum.exe and dropping the NFO on the shortcut instead of the executable.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5602
Joined: 13 Sep 2004 13:21
Location: The Moon

Post by PikkaBird »

Okay, cheers. :)
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

I'm not particularly thrilled with the first item on this changelog.
On one hand, it means that I don't have to worry about forgetting to post the .renum directory, and that the create-a-shortcut workaround is no longer required.
On the other hand, NFORenum now tends to spew data in pseudo-random locations, something I had been hoping to avoid.
On the gripping hand, it does *tell* you where it created the .renum directory.

v2.4.9 to v2.5.0
- NFORenum will now automatically write its data files if old or not found.
- Added full recognition of all string control characters.
- Added (some) string consistency checking. (actions 4/8/B)
- Added action B checking.
- Reversed the file search order.
- (bugfix) no longer append an 'L' to language names.
- Up to date with alpha 63:
- - Widened vehicle variable 43.
- - Accept action 1 <num-ent>==0. (features 0-4 only, though)
- - Action 7/9 tests 09 and 0A.
- - GRM operation 06.
- Updated the strings containing "Sanity".

See first post for full details and download.

EDIT: Added missing item to changelog.
Last edited by DaleStan on 17 Oct 2005 05:34, edited 1 time in total.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

And I forgot to check the callbacks page sufficiently throughly *again*.

Once NFORenum tells you where it expects its datafiles[0], put this new 2v.dat there. (298 bytes -> 290 bytes)

Changelog:
- Made variables 10 and 18 always accessible.

[0] If it doesn't announce that it created a directory, then your original .renum directory is the one it used.

EDIT: New version; downloads removed.
Last edited by DaleStan on 18 Oct 2005 20:51, edited 1 time in total.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1680
Joined: 04 Mar 2005 01:07

Post by OzTrans »

Here is some trivia ...

if I have the following sequence in a text string '1F XX YY' where XX or YY =00; renum reports :

Code: Select all

//!!Warning (112): Action 4 defining more strings than were declared (offset 12).
   11 * 112	 04 00 9F 01 8F D0 ... 1F 00 0A ...
... and on another note. I am using the DOS Errorlevel to check whether any Fatal Errors have been detected before proceeding. Sometimes this works but at other times it does not. Do you actually set the errorlevel before exiting ?
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

OzTransLtd wrote:if I have the following sequence in a text string '1F XX YY' where XX or YY =00; renum reports :

Code: Select all

//!!Warning (112): Action 4 defining more strings than were declared (offset 12).
   11 * 112	 04 00 9F 01 8F D0 ... 1F 00 0A ...
Cannot duplicate. Please post full sprite.

Error Codes:
Currently, the exit codes are as follows: (The highest applicable code is returned.)
3: A can't-happen happened; report problem and die.
2: A data file could not be opened or was corrupt; report problem and die.
2: A specified NFO file could not be opened, or the temporary file could not be renamed.
1: A sprite contained invalid data or an odd number of hex characters.
0: Nothing unusual happened.

What other results would you like to know about? I see I need to redo my exit codes anyway; having two different meanings for code 2 is non-optimal.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1680
Joined: 04 Mar 2005 01:07

Post by OzTrans »

Here you go ... BTW, I still use Renum v2.4.5.

Code: Select all

//!!Warning (112): Action 4 defining more strings than were declared (offset 12).
   11 * 18	 04 00 9F 01 8F D0 31 32 33 34 1F 00 0A 31 32 33 34 00
Never mind about the usefulness of this statement, I'm just doing some experimenting with string code '1F X and Y offsets'. It's obviously the 00h after the 1Fh that makes Renum think it's the end of a text string and only 1 declared warns about the rest.

The error code(s) I am interested in are :

00 - no errors
01 - errors that would result in a .grf containing invalid sprites being created, using grfcodec. The ones that prevent a .grf from being loaded successfully at startup and I'm not talking about invalid sprites detected due to incorrect alpha version used.

examples of 01 errors :

//!!Error (60): Offset 8: ID F1 has not been defined.
//!!Fatal Error (38): Length does not match the value of nvar.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

OzTransLtd wrote:Here you go ... BTW, I still use Renum v2.4.5.
Ah. 2.5.0 has fixed that; it appears I didn't document that properly.

/me wanders off to fix the changelogs.

2.5.1 will have altered, and documented, error codes.

I'm currently planing to use this list:
8: Fatal program error. (A can't-happen happened.)
7: Data file error. (Failure to create the data dir or open a file.)
6: NFO file error. (Failure to open a file or rename the temp file.)
5: NFO parse error. (Sprite with invalid chars/length, or version too high.)
4: Lint error. (Linter issued an error or fatal error.)
3: Lint warning. (Linter issued a warning.)
0: Successful run, all NFO files are clean.

1 and 2 are reserved, pending some discussion (I hope) and usefulness decisions:
Would a code for "Error/Warning detected but not reported" (If, eg @@SANITY NONE) be useful? And if so, should there be seperate codes for "disabled by @@SANITY" and "disabled by @@WARNING"?
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1680
Joined: 04 Mar 2005 01:07

Post by OzTrans »

Thanks, I'm happy to be able to abort with an errorlevel of 4+.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

OzTransLtd, the exit codes are implemented as listed above.
I've written one too many broken TTDPatch version checks, so I decided I was going to fix that problem too.

v2.5.0 to v2.5.1
- Added @@LINT command; deprecated @@SANITY.
- Changed/fixed exit codes.
- (bugfix) Fixed stack checking for data other than words.
- Added @@VERSIONCHECK command.
- Redid livery override checks (valid feature and follows std 3).
- (bugfix) Added missing data-clearing between files for actions 1-3.
- Downgraded the "Not a recolor sprite" message to Warn 1.

See first post for full details and download.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1680
Joined: 04 Mar 2005 01:07

Post by OzTrans »

DaleStan wrote:... the exit codes are implemented as listed above.
Many thanks for the quick update and they do work very nicely.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

DaleStan wrote:I've written one too many broken TTDPatch version checks, so I decided I was going to fix that problem too.
Unfortunately for me, "decided to fix" and "fixed" are not synonymous. This time I think I succeeded at the later, in addition to the former.

v2.5.1 to v2.5.2
- (bugfix) fixed @@VERSIONCHECK (also shortened the output by 3 bytes).
- Added patch variable 9D.
- Made patch variable 99 write-only.
- (bugfix) Re-added action D operations 09..0C.

See first post for full details and download.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Wow. I'm not used to being sleepy to the point of stupidity and not realizing it.

If you downloaded 2.5.2 before this message appeared, re-download it.

</idiot> (I hope.)
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Lots of mostly little changes here.
@@VERSIONCHECK doesn't work quite correctly; you'll need to manually move the second action 9 after your action 8, or tolerate skipping the action 8 during activation.

v2.5.2 to v2.5.3
- Up to date with a66:
- - General prop 09
- - Cargo prop 17
- - Action 2 variable 47 (vehicles)
- - Action 3 cargo type checks
- - Ignore high bit of action B severities.
- - Action 7 condition 0B.
- - Changed @@VERSIONCHECK to agree more closely with the documentation.
- Fixed general variable ID checks
- Added check for setting sound props for IDs <74 (4Ah)
- (bugfix) Check correct byte in "0*0 00 01 00 FF xx xx 01 1A".
- (bugfix) Add several missing fcloses.
- (bugfix) Remove an idiotic check in the message output system.

See first post for full details and download.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1680
Joined: 04 Mar 2005 01:07

Post by OzTrans »

DaleStan wrote:@@VERSIONCHECK doesn't work quite correctly; you'll need to manually move the second action 9 after your action 8, or tolerate skipping the action 8 during activation.
Here's a tip ... separate the 2, just as I do.

Code: Select all

// CHKTTDVER MINVERSION(57) TYPE(*MSGONLY)
    1 * 9      09 8B 04 05 39 02 0A 02 01
    2 * 19     0B 03 1F 00 32 2E 30 2E 31 20 61 6C 70 68 61 20 35 37 00

// DEFGRFHDR GRFID(CASa) GRFVER(6) NAME("Canadian ... ") DESC("Copyright © ... ")
    3 * 184    08 06 43 41 53 61 43 61 6E 61 64 69 61 ...

// CHKTTDVER MINVERSION(57) TYPE(*ABORT)
    4 * 9      09 8B 04 04 3A 02 0A 02 00
Locked

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 19 guests