handling extended IDs

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

Moderator: Graphics Moderators

Post Reply
michael blunck
Tycoon
Tycoon
Posts: 5954
Joined: 27 Apr 2005 07:09
Contact:

handling extended IDs

Post by michael blunck »

How are extended IDs handled in varAction2s, e.g. in var60/61? Obviously, the documentation is outdated/incomplete, for 60+x it still says "the variable number must be followed by a byte, which will be given to the variable handler as parameter". For var61, the 60+x parameter is passed to register 0x10e w/o mentioning the format.

Should extended ID parameters given by a word or an extended byte in these cases?

regards
Michael
Image
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: handling extended IDs

Post by Michi_cc »

The documentation is exactly right with saying a byte has to follow. To use vehicle IDs over 255 you have to make a detour either via var 7B (works everywhere) or var 61 (can not be used everywhere). Both the accumulator and register 10E are handled with the full width, so you can just store the ID directly as a plain word/dword. Obviously somebody™ didn't remember to change that to an extended byte for GRF version 8, so that's how it is for the time being.

-- Michael Lutz
michael blunck
Tycoon
Tycoon
Posts: 5954
Joined: 27 Apr 2005 07:09
Contact:

Re: handling extended IDs

Post by michael blunck »

Michi_cc wrote: To use vehicle IDs over 255 you have to make a detour either via var 7B (works everywhere) or var 61 (can not be used everywhere).
Thanks for your answer. Well, that´s a bit .. involved. OTOH, I always wondered for what 7B could be useful, but now I know. :cool:
Michi_cc wrote: Both the accumulator and register 10E are handled with the full width, so you can just store the ID directly as a plain word/dword. Obviously somebody™ didn't remember to change that to an extended byte for GRF version 8, so that's how it is for the time being.
Yeah, maybe for version 9 ...

regards
Michael
Image
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 15 guests