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
User avatar
Wile E. Coyote
Tycoon
Tycoon
Posts: 8515
Joined: 08 Jul 2004 22:14
Skype: wile.e.coyote2
Location: Belgrade, Serbia
Contact:

Post by Wile E. Coyote »

I forgot switch -a, sorry, my mistake :oops: it works fine (if both string termiantes with 00, and if 00 is missing, it corrects num-ent ang giver warning 00 is missing).
Serbian rail set with Serbian scenario (ECS, PBI, FIRS and Tourist set compatible) Website | Topic and download | Latest version: 03.06.2015.
Serbian tram set Tracking table | TTD Patch tram set Latest version: 17.06.2015. | Open TTD Remix Latest version: 11.07.2015.
WIN-DOS GRF Converter Topic and download | Version 0.2.1: 09.01.2005.


Runner-up in "Best avatar Forums award" for years 2006 and 2010!
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

I managed to break parsing of lang-id bytes rather badly, so here's a new version. It also recognizes Info version 7; which the latest versions (post 0.9.8) of GRFCodec will write. Because of incompatibilities between version 6 and version 7 (specifically, the changed meaning of the backslash when quoted), NFORenum will NOT automatically update .nfo files from version 6 to version 7. Either remove the header, or manually change it to version 7.

Changelog:
v3.3.0 to v3.3.1 (r319)
- Recognize Info version 7. (written by GRFCodec r263 and later)
- Warn about generic action 4s that declare no texts.
- More auto-corrector changes:
- - Append an FF to action 6s.
- - Append a 00 to strings.
- @@BEAUTIFY CONVERTONLY now converts hex to "strings", not "s" "t" "r" "i" "n" "g" "s".
- (bugfix) Action4s declaring texts for language FF could cause NFORenum to abort.
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 »

It's been too long. *Way* too long.

v3.3.1 to v3.4.0
- Added support for:
- - Industry variable 64.
- - String code 94.
- - Variable 7E (procedure calls).
- Added 2.<minor>r<revision> format for @@VERSIONCHECK.
- Added a missing check for 00 byte following string code 99.
- Corrected handling of action 2 CargoIDs; all share the same table.
- Added offset info to the variational 2 messages that didn't have it.
- (bugfix) No longer crashes when an industry production callback is not 15 bytes long.
- (autocorrect) Feature byte for actions 2 and 3.
- Made <feature> optional in most commands taking <feature> <id>.
- Fixed two over-long lines in the --help message.
- Remove warning about moving to a smaller ypos.
- Added check for second use of a single bit in Action F.
- (bugfix) Action Fs that try to use too many bits now report the correct <offset> and <available-bits>, instead of having them swapped.
- (bugfix) Fix parsing of quoted \##.
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 »

It turns out that I failed to check some of my code in grfcodec and nforenum, resulting in subtly broken NFO file reading, so here's 3.4.1, to fix that, along with a few other changes that have piled up.

v3.4.0 to v3.4.1
- Check that in GRF version 6, Action F declares names for all five standard languages.
- (bugfix) Slight change to action F formating, for increased consistancy.
- Prevent the beautifier from adding newlines after the end of a sprite.
- Fix: Version number is revision in hex digits, not converted to hex.
- Fix: LOCATEID2 now reports the correct feature byte.
- Data file updates:
- - Version 2.5 beta 8
- - Callback 143
- (bugfix) Correct reading of \7c, \7C, \D| and \D&.
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: 1714
Joined: 04 Mar 2005 01:07

Post by OzTrans »

With NfoRenum 3.4.1 I get these errors, any clues ?

That 3A is actually a callback result and not a variable ...

Code: Select all

//!!Warning (86): Offset 15: Testing nonexistant variable 3A.
//!!Fatal Error (42): Length does not match nvar of 80. (Expected 535 bytes)
  514 * 21     02 00 00 82 60 6A 20 FF 00 82 60 2C 00 FF 01 3A 80 00 00 48 80
                                                   ^^ = 00 not 20
  515 * 14     02 00 01 82 42 18 0C 01 48 80 00 00 00 00
  516 * 14     02 00 A0 81 01 00 FF 01 01 00 00 33 48 80

//!!Fatal Error (42): Length does not match nvar of 80. (Expected 535 bytes)
  517 * 21     02 00 00 82 60 6A 20 FF 00 82 60 2C 00 FF 01 40 80 00 00 50 80
  518 * 14     02 00 01 82 42 18 0C 01 50 80 00 00 00 00
  519 * 14     02 00 A1 81 01 00 FF 01 01 00 00 33 50 80

....

//!!Warning (86): Offset 69: Testing nonexistant variable 0F.
  587 * 75     02 00 10 82 60 01 20 FF 00 82 60 0F 20 FF 00 82 60 12 20 FF 00 82 60 23 20 FF 00 82 60 30 20 FF
               00 82 60 52 20 FF 00 82 60 54 20 FF 00 82 60 5D 20 FF 00 82 60 60 20 FF 00 82 60 62 20 FF 00 82
               60 66 00 FF 01 0F 00 00 00 A2 00
  588 * 15     02 00 11 82 60 6D 00 FF 01 10 00 00 00 A1 00
  589 * 15     02 00 12 82 60 05 00 FF 01 11 00 00 00 A0 00
  590 * 14     02 00 F9 82 B2 00 02 01 12 00 02 02 F0 00
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

renum -b+ tells you good things, assuming you know how to read it: (Comments mine)

Code: Select all

  514 * 21	 02 00 00 82
        60 6A 20 FF 00    // var 60, param 6A, shift 20=0+OP_FOLLOWS, and FF, op 00='+'
        82 60 2C 00 FF 01 // var 82, shift 60=0+OP_FOLLOWS+ADD_DIV, and 2C, add 00, div FF, op 01='-'
        3A 80 00 00 48    // var 3A(!), shift 80=0+ADD_MOD, and 00 (!), add 00, mod 48
     80 // nvar 80

  517 * 21	 02 00 00 82 
        60 6A 20 FF 00 // Same as before 
        82 60 2C 00 FF 01
        40 80 00 00 50 // Except that var 40 exists
     80

  587 * 75	 02 00 10 82
        60 01 20 FF 00 // Var 60, param 01, yadda yadda yadda
        82 60 0F 20 FF 00 // Same general deal as the third line of 512, the whole way down 
        82 60 12 20 FF 00
        82 60 23 20 FF 00
        82 60 30 20 FF 00
        82 60 52 20 FF 00
        82 60 54 20 FF 00
        82 60 5D 20 FF 00
        82 60 60 20 FF 00
        82 60 62 20 FF 00
        82 60 66 00 FF 01
        0F 00 00 // var 0F (!), shift 0, and 00
     00 A2 00 // nvar 0=RETURN_CALC_RESULT, default ID A2
I'm not quite sure what you meant there, but that 82 60 appearing every six bytes like clockwork looks very suspicious to me.
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: 1714
Joined: 04 Mar 2005 01:07

Post by OzTrans »

Well, that was my mistake. Why didn't I see, that I repeated the type 82 over and over. It works fine now, thanks for your help.
User avatar
minime
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 18 Jan 2004 10:02
Skype: dan.masek
Location: Prague, Czech Republic
Contact:

Post by minime »

Hey Dalestan,

I'm using renum v3.4.1 and it reports (incorrectly, as far as I can see) the following error:

Code: Select all

//!!Error (166): Offset 23: Set 5 declares glyphs across a block-break.
//!!Error (166): Offset 27: Set 6 declares glyphs across a block-break.
    8 * 30	 12 \b7
        00 \b94 \wx0021
        00 \b9 \wx00A1
        00 \b1 \wx00AB
		00 \b1 \wx00AE			        
        00 \b4 \wx00B0
        00 \b71 \wx00B9        
        00 \b128 \wx0100
128 characters starting at 0x0100 means characters 0x0100-0x017F - one complete block, no block-breaks crossed.

Cheers,
minime
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. --Albert Einstein
Image Image Image
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Fixed in r1044. I'll probably put together another release sometime in the next 48 hours.

(And my apologies for not releasing a new version after I implemented action 13 support.)

BTW, the escape sequences are coded so that you don't have to write out the leading zeros. If you want eg 21h in a word, \wx21 is quite sufficient. The same for \## and \U#### when quoted, assuming the immediately following character is not a valid hexadecimal digit.
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
minime
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 18 Jan 2004 10:02
Skype: dan.masek
Location: Prague, Czech Republic
Contact:

Post by minime »

DaleStan wrote:Fixed in r1044. I'll probably put together another release sometime in the next 48 hours.
Thanks.
DaleStan wrote:BTW, the escape sequences are coded so that you don't have to write out the leading zeros....
Thanks for pointing that out. I probably have them without leading zeroes somewhere too, but in some places i prefer to include them - that way the formatting tends to stay neater in some cases and it's easier for me to pick out the values.

minime
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. --Albert Einstein
Image Image Image
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

And here's 3.4.2, as promised, with Action 13 support and a few other changes & fixes.

v3.4.1 to v3.4.2
- Data file updates:
- - Callbacks 144 & 145
- - Action B messages 04 & 05
- - New action 5 sprites for trams and the GUI
- Action 13
- (bugfix) Enable autocorrection for feature 0B (cargo) action 4s
- Require two slashes before dismissing anything as a C++ style comment.
- Fix reading of real sprites with Unixy absolute paths.
- Add check for <and> B/W/Ds of 0 in varaction 2s.
- Fix off-by-one error when checking block extents in Action 12.
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
RK
Transport Coordinator
Transport Coordinator
Posts: 264
Joined: 13 Oct 2003 10:43
Location: Dortmund, Germany

Post by RK »

Hi DaleStan,

NFORenum throws errors, where I want to use articulated/shorter RVs.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

What errors?
On what code?
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
RK
Transport Coordinator
Transport Coordinator
Posts: 264
Joined: 13 Oct 2003 10:43
Location: Dortmund, Germany

Post by RK »

callback init

Code: Select all

//!!Error (164): Offset 14: 16 is not a valid callback for this feature.
  188 * 18	 02 01 07 81 0C 00 FF 02
                        05 00 33 33   // sound
                        06 00 16 16   // articulated
                        04 00         // graphics
sprite selection

Code: Select all

//!!Warning (86): Offset 4: Testing nonexistant variable 40.
  185 * 14	 02 01 04 81 40 00 FF 01
			02 00 00 00
			03 00
shortened sprites

Code: Select all

//!!Error (164): Offset 10: 11 is not a valid callback for this feature.
  155 * 14	 02 01 06 81 0C 00 FF 01
						02 80 11 11
						02 00


Is it possible to ignore some errors? I think it's not possible to rule out all errors, because the NFO can be very complex.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

RK wrote:callback init
sprite selection
shortened sprites
Fixed. Go download the new datafiles.
RK wrote:Is it possible to ignore some errors? I think it's not possible to rule out all errors, because the NFO can be very complex.
Yes. Go read the README.
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
minime
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 18 Jan 2004 10:02
Skype: dan.masek
Location: Prague, Czech Republic
Contact:

Post by minime »

Dale, with beta 9 there are 5 more TextIDs - I've just updated the Wiki. I've already fixed my data file (in TextIDs.dat change byte at position 0x40 from 0x05 to 0x0A), but could you please post an updated version for others?
Cheers,
minime
Last edited by minime on 05 Nov 2006 04:44, edited 1 time in total.
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. --Albert Einstein
Image Image Image
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Data file updated.

Updating the wiki is a pretty good way to get my attention -- I check it for updates at least once a day, and I have watches set on several of the pages.
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: 1714
Joined: 04 Mar 2005 01:07

Post by OzTrans »

Bugs with NFORenum v3.4.2 (r1057) :

Action-00, feature-04 (stations)

. property 18 is a word value (according to the wiki and TTDPatch expects a word value too); NFOrenum insists that it should be a byte value.

Code: Select all

//!!Fatal Error (47): Offset 23: Invalid property 00.
     77 * 29     00 04 09 01 07 0C 00 0D 00 10 00 02 12 01 00 00 00 0B 0C 11 FF 18 08 00 16 03 01 17 06
                                                                                ^^^^^^^^
or this way ...

//!!Warning (99): Offset 28: No more data was expected.
     77 * 29     00 04 09 01 07 0C 00 0D 00 10 00 02 12 01 00 00 00 0B 0C 11 FF 16 03 01 17 06 18 08 00
                                                                                               ^^^^^^^^
Action-02, feature-04 (var action-2 stations)

. call backs 140, 141 and 142 are not accepted.

Code: Select all

//!!Error (164): Offset 17: 40 01 is not a valid callback for this feature.
//!!Error (164): Offset 23: 41 01 is not a valid callback for this feature.
//!!Error (164): Offset 29: 42 01 is not a valid callback for this feature.
1972 * 35  02 04 DF 85 0C 00 FF FF 04 DE 00 14 00 14 00 01 80 40 01 40 01 FE 80 41 01 41 01 06 80 42 01 42 01 0E 00
There is no hurry to fix it; animation for stations has not been implemented yet (as of 2.5 beta 9) although the wiki says otherwise (i.e. since 2.5 beta 5).
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

These are fixed in r1217 and r1218.

I can't update the website from this box, but here are the updated data files. They'll also be up on the site in about 48 hours.
Attachments
data.zip
(465 Bytes) Downloaded 239 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
User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Post by Csaboka »

OzTransLtd wrote:animation for stations has not been implemented yet (as of 2.5 beta 9) although the wiki says otherwise (i.e. since 2.5 beta 5).
Well, I clearly remember implementing it, so if it doesn't work, it's a bug, and please report it.
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
Locked

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 26 guests