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

Locked
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

I intend to fix it so the second B will be inserted immediately after the action 8, but currently I can't get that to work, and it's non-trivial to fix.
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 »

DaleStan wrote:but it's non-trivial to fix.
Non-trivial, indeed, but I think I'm making progress.

In other news:

Changelog:
- Fix an off-by-one in GRM checking.

You folks know what to do with these by now, I'm sure. Unfortunately, both versions are 29 bytes.
Attachments
D.dat.gz
(47 Bytes) Downloaded 251 times
D.zip
(131 Bytes) Downloaded 265 times
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 »

Lakie caught me trying to dereference NULL (a Bad Thing (tm)).

Anything that appears to be a real-sprite, but does not contain ".pcx " (That is: dot pea see ex space) will cause NFORenum to die.

I think I have the bug fixed, but I've clearly lost all semblance of code-fu, and it'll require sleep to regain it.

For now, if this bug bites you, roll back to 2.5.2; attached here. (Standard release format except for a renamed binary.) All sprites for which 2.5.2 reports "Apparent real sprite does not contain a file name"/"A portion of sprite <num> could not be processed" (NFO/console) will crash 2.5.3 if uncommented without being fixed.
Attachments
renum v2.5.2.zip
(145.06 KiB) Downloaded 235 times
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 »

I think I'm satisfied with my real-sprite handling now.

I'll leave 2.5.2 and the D.dat (which should work with 2.5.2) up for a while, though.

v2.5.3 to v2.5.4
- Added 201a66 format to @@VERSIONCHECK.
- (bugfix) Fixed a GPF on invalid real sprites.
- (bugfix) Accept real sprites where ".pcx" is followed by a non-space whitespace character.
- Added numerous checks of the real sprite meta data. (156-60)

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 »

*thunk* <-- Sound of me obeying instructions.

The real-sprite handling is fine, but:

Bug: Any pseudo sprite/binary include that immediately preceeds a real sprite will receive a sprite number one greater than it should.
Appeared in: 2.5.4

Workaround 1: Use a version prior to 2.5.4.
Workaround 2: Use @@DIFF.
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 »

Now that that's fixed:

v2.5.4 to v2.5.5
- Added action 5 types 09 and 0A.
- Added missing num-sprites checks for action 5.
- Added support for recolor maps.
- Accept recolor maps in action A blocks.
- (bugfix) Correctly number pseudo/include sprites that precede real sprites.

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 »

I've released at least one, if not two versions that should have been 2.6.0, so I'm going to release it now.

Not a big changelog, but they're massive changes. If you want to take advantage of the new real-sprite handling, be sure to read the READMEs.

I believe that the real-sprite rewriter is 64-bit safe, but I cannot test it. If anyone with a 64-bit processor could test that (or anyone with a decent SAN score could check lines 282..310 of renum.cpp) I would appreciate it.

v2.5.5 to v2.6.0
- Added RPN calculations in real sprites. (see README.RPN)
- Added @@LET comment command.
- Changed "Cannot read sprite metadata" message to report where it failed.

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 »

Code: Select all

//!!Warning (132): Parameter 73 out of valid range for variable 60.
 1255 * 19     02 00 A0 82 60 73 20 FF 08 1C 00 FF 01 FF FF 00 02 41 FF
AFAIK, vehicle ID 73h is still a valid ID. BTW, 72h will not cause a warning.

Just in case, this is with v2.5.1.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Grr... Using >= when I should be using >. This'll fix most of the problem.

Changelog:
- Workaround for problem with parameter checking for 60+x variables (still complains about param FF, though)

Versions prior to v2.5.3 won't load this, though. If memory and the changelog serve, 2.5.0 to 2.5.2 can load it, but only if you open it with a hex editor and change the first byte to \02 first.

EDIT: new version; properly fixed this problem.
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 »

After entirely too long, mostly involving me having no clue how to implement it, I've given up, and implemented something that vaguely resembles UTF-8 support instead.

See the readme for its limitations. The most notable one is that UTF-8 encoded control characters will not be seen, so don't do that; enter them as a single byte instead.

v2.6.0 to v2.6.1
- Up to date with 2.0.1 alpha 68:
- - Added UTF-8 support
- - Action 5 type 0B
- - Action D variable 9E
- (bugfix) Really fixed the broken param checking for 60+x vars.
- Added missing checks for extra data in action 8s.
- Removed special casing in action 8s that permitted non-terminated strings.

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 »

Action 0 grew some new properties, and Action D grew new a new variable, so here goes. I'm not on my usual computer, so these are more handmade than usual, but seem to work.

In other news, NFORenum will become confused if you attempt to change TextIDs F857..F863. Use the newly supported action 0 feature 8 props 08..0F instead.

(Sizes: 402->408 bytes (0.dat) and 33->34 bytes (79Dv.dat).)

EDIT: new version; removed files.
Last edited by DaleStan on 09 Jan 2006 20:14, 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 »

Just a quick reminder ...

Code: Select all

//!!Warning (151): Unrecognized bit set in language-id byte.
   87 * 343	 04 00 EF 10 40 D0 5B 4D 55 2D 57 61 67 6F 6E 20 72 ... 
Language byte : Generic Text (128) + Enhanced Language ID (64) + Language ID (47) = EFh

BTW, I have used NFORenum v2.6.1 together with the 2 new dat files from just above.
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

Somewhat OT, we should probably start to maintain a list of language IDs for this purpose. I guess adding it to the action 4 docs would be the best place for now.
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1680
Joined: 04 Mar 2005 01:07

Post by OzTrans »

Patchman wrote:Somewhat OT, we should probably start to maintain a list of language IDs for this purpose. I guess adding it to the action 4 docs would be the best place for now.
Good idea.

I have used 47 (2Fh) for Norwegian, because it is the international telephone dialling code for Norway.
User avatar
George
Tycoon
Tycoon
Posts: 4363
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Post by George »

Patchman wrote:Somewhat OT, we should probably start to maintain a list of language IDs for this purpose. I guess adding it to the action 4 docs would be the best place for now.
May I reserve 7 for Russian?


Problem:
7327 * 2 10 E0
//!!Warning (106): Action 7 jumping backwards to label 20 defined at sprite 7327.
8055 * 6 07 00 01 03 01 20
Image Image Image Image
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

George wrote: 7327 * 2 10 E0
//!!Warning (106): Action 7 jumping backwards to label 20 defined at sprite 7327.
8055 * 6 07 00 01 03 01 20
That shouldn't be happening. (Umm... Duh.)

I guess I need to quick todo here. If I don't, I may manage to forget something (like the lang-byte problem). I'll be back in front of my computer Sunday, but the chances of anything productive happening before Monday are slim.

1) (bug) All lang bytes; bit six is now defined.
2) (bug) Action 7/9: jump 20 sprites when label E0 is defined. (21/E1 &c. too?)
3) (missing check) Validate generic TextIDs (object to the curr_*s too?)
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
George
Tycoon
Tycoon
Posts: 4363
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Post by George »

DaleStan wrote:
George wrote: 7327 * 2 10 E0
//!!Warning (106): Action 7 jumping backwards to label 20 defined at sprite 7327.
8055 * 6 07 00 01 03 01 20
That shouldn't be happening. (Umm... Duh.)
You can look into LV4.grf.
Image Image Image Image
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1680
Joined: 04 Mar 2005 01:07

Post by OzTrans »

Problem with NFORenum; I cannot get the .nfo file (below) through the linter. It hangs, does not update the .nfo-file and the .new-file is empty. It must have something to do with the mixture of hex-code and plain text in sprite 5; remove the hex code and it works.

Code: Select all

-------------------------------
NFO Renumber and linting v2.6.1
-------------------------------
-
NFORenum v2.6.1 starting.
Processing file "game\newgrf\sprites\LangNor.nfo".
^CTerminate batch job (Y/N)? n
-
------------------
GRF encoding v0.97
------------------
-
GRFCodec version 0.9.7 - Copyright (C) 2000-2005 by Josef Drexler
Encoding in temporary file newgrf\LangNor.new
Sprite    5  Done: 78%  Compressed:100% (Transparency:100%, Redundancy:100%)
Deleting newgrf\LangNor.grf
Replacing newgrf\LangNor.grf with newgrf\LangNor.new

Done!
Press any key to continue . . .
DaleStan wrote: ... but the chances of anything productive happening before Monday are slim.
Take your time, we are a patient bunch ...
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

DaleStan wrote:I'll be back in front of my computer Sunday...
:oops:
I seem to have a very strange idea about the spelling of "Monday". Even stranger is that I got it right later in the sentence.
OzTransLtd wrote:and the .new-file
gets no data until the entire NFO is read. I could probably re-arrange things so that the .new doesn't get opened until the NFO is fully read, but I guess I don't see what benefit that would provide.
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
George
Tycoon
Tycoon
Posts: 4363
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Post by George »

DaleStan wrote:
DaleStan wrote:I'll be back in front of my computer Sunday...
:oops:
I seem to have a very strange idea about the spelling of "Monday". Even stranger is that I got it right later in the sentence.
OzTransLtd wrote:and the .new-file
gets no data until the entire NFO is read. I could probably re-arrange things so that the .new doesn't get opened until the NFO is fully read, but I guess I don't see what benefit that would provide.
This nfo hangs NFOrenum
Attachments
xUSSRtrainsw.rar
(7.43 KiB) Downloaded 232 times
Image Image Image Image
Locked

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 24 guests