Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Sat Sep 23, 2017 6:10 pm

All times are UTC




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Tue Apr 10, 2007 11:08 pm 
Offline
TTDPatch Developer
TTDPatch Developer

Joined: Wed Feb 18, 2004 3:06 am
Posts: 10285
I've been meaning to do this for a long time, but I finally sat down and actually *did* it.

This tool will read grfdebug.log and the associated NFO file, and produce a grfdebug.txt with lines that look like:
Code:
Retrieving graphics for feature 3, ID db.
Processing sprite 222.
Testing variable c. Value: 0.
Processing sprite 219.
Testing variable 7f, param 0. Value: 0.
Processing sprite 218.
Testing bits 1 of random value 1b.
Processing sprite 217.
Testing variable 47. Value: 1.
Processing sprite 211.
Returning real sprite number 177.
<...>
Calling callback 15 for feature 3, ID db.
Processing sprite 222.
Testing variable c. Value: 15.
Processing sprite 221.
Testing variable 47. Value: 204ff, Masked: ff.
Processing sprite 220.
Testing variable 1a. Value: ffffffff, Adjusted: ffff0370, Masked: 370.
Testing variable 47. Value: 204, Adjusted: 4.
Returning calculated callback result dc.
Returning real sprite number -1.


The listed sprite numbers, where not clearly invalid, are the in-nfo sprite numbers, not the numbers out of the log, and are in decimal. Everything else in hex. If you specify the wrong nfo file, you will get lots of warnings, and not nearly as much UI, but you'll still get the reformatted log.

Run it from the command line. It takes a single argument, which is the name of the nfo file that you want to debug. grfdebug.log must be in the same directory as the binary.
The search order for the nfo file is the same as for NFORenum:
file
file.nfo
sprites/file
sprites/file.nfo

The attachments contain the usual: A win32 binary in the first, and the source, with DOS and Unix linefeeds, in the second and third, respectively.


Attachments:
grfdebug-src.tar.gz [16.75 KiB]
Downloaded 355 times
grfdebug-src.zip [20.05 KiB]
Downloaded 368 times
grfdebug.zip [63.59 KiB]
Downloaded 429 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


Last edited by DaleStan on Sat Apr 14, 2007 5:30 am, edited 1 time in total.
Top
   
PostPosted: Wed Apr 11, 2007 6:55 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon May 02, 2005 11:05 am
Posts: 15415
Skype: XeryusTC
Location: localhost
DaleStan wrote:
@Xeryus: I've fixed several bugs that were in the version I gave you.

Thank you, I'll take a look later at it this week as I'm in the middle of a test week and I already spend too much time on other stuff yesterday ;).
For the rest, it was nice that I could make some sense out of the grfdebug.log really easy, it is quite hard to understand the raw grfdebug.log ;).

_________________
Don't panic - My YouTube channel - Follow me on twitter (@XeryusTC) - Play Tribes: Ascend - Tired of Dropbox? Try SpiderOak (use this link and we both get 1GB extra space)
Image
OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone
Image Image Image Image Image Image Image


Top
   
 Post subject:
PostPosted: Sat Apr 14, 2007 5:29 am 
Offline
TTDPatch Developer
TTDPatch Developer

Joined: Wed Feb 18, 2004 3:06 am
Posts: 10285
Due to me not reading the documentation quite thoroughly enough, it was possible to see the line "Calling callback 1 for ...". I've changed this to "Getting random triggers for ...". The other changes should be relatively obvious, but just in case they're not:
I've changed the "Testing variable 7f00" lines to "Testing variable 7F, param 0", and eliminated the "Adjusted" and "Masked" values if they are the same as the preceding value.

One TTDPatch bug I've discovered here is that the "Value" entry is post-shift, not pre-shift, as the documentation implies. I have a fix for this, and intend to commit in time for Sunday's nightly.[0]

For those who like such things, a diff is attached.

[0] Because I won't be available to merge it Saturday night. If someone else is available and willing (merges should happen between 02:30 and 02:45 GMT) ping me on IRC.


Attachments:
grfdebug.patch [2.63 KiB]
Downloaded 415 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
Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Yahoo [Bot] and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2017 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2017.
Hosted by Zernebok Hosting.