Action 14 and AdvVarAct2

Get help, info, news and advice about the Transport Tycoon Deluxe patch.

Moderator: TTDPatch Moderators

Post Reply
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 988
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Action 14 and AdvVarAct2

Post by frosch »

As there is no dev forum and I dislike mailinglists (which seems to be off-topic/deserted anyway), this might be the right place.

Just for fun ( :) ) here are two diffs to add Action14 and the recent AdvVarAct2 operators for shifting.
The Action14 diff actually just makes TTDP ignore the action, but that way grf authors do not need to add extra code for TTDP compatibility when using Action14. Wrt. TTDP Action14 better fits into external configuration programs anyway.

The patches were piped through the compilefarm (thanks rubidium) and have been tested (for the win version).
Attachments
ttdp_action14.diff
ignore action 14
(1.68 KiB) Downloaded 147 times
Last edited by frosch on 07 Aug 2010 07:06, edited 1 time in total.
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
User avatar
eis_os
TTDPatch Developer
TTDPatch Developer
Posts: 3603
Joined: 07 Mar 2003 13:10
Location: Germany
Contact:

Re: Action 14 and AdvVarAct2

Post by eis_os »

Can you attach a reference test grf for action14?

And don't we have a right shift already?
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 988
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: Action 14 and AdvVarAct2

Post by frosch »

'BaseMod Presets' (not to confuse with 'BaseMod') from http://bananas.openttd.org/newgrf/ contains an Action14. (For download click on the download counter, not the name)

There is only a rotate, no shift. (well, and a division)
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
User avatar
eis_os
TTDPatch Developer
TTDPatch Developer
Posts: 3603
Joined: 07 Mar 2003 13:10
Location: Germany
Contact:

Re: Action 14 and AdvVarAct2

Post by eis_os »

varadjust of action2?

"0..4 0..1F number of bits to right shift <variable> "
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 988
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: Action 14 and AdvVarAct2

Post by frosch »

Sure, but that requires the right hand side to be constant :)
If the right hand of the shift is constant multiplication and division would also suffice.

Thanks for adding Action14 :)
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 988
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: Action 14 and AdvVarAct2

Post by frosch »

Hmm, I noticed this morning that the SAR implementation is wrong for word and byte sized varact2.
So, new diff, and a testgrf.

Edit:
Updated the diff again, also tested now.
I also attach a diff for the Makefile, which finally made my crosscompiling work. "-MG" is only valid together with "-M" or "-MM". Though both "-M" and "-MM" do not seem to be wanted here.
(Maybe older mingw ignored -MG in that case, mine throws an error)
Attachments
opertest.grf
Shows "-1 16383 -4 -1" in coalmine industry window, if operators work correct.
(200 Bytes) Downloaded 133 times
ttdp_operators141516.diff
fixed diff, tested
(997 Bytes) Downloaded 134 times
ttdp_make_mg.diff
makefile which works with mingw32-gcc 4.4.4
(935 Bytes) Downloaded 131 times
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
User avatar
eis_os
TTDPatch Developer
TTDPatch Developer
Posts: 3603
Joined: 07 Mar 2003 13:10
Location: Germany
Contact:

Re: Action 14 and AdvVarAct2

Post by eis_os »

I am not sure about the makefile, actually it could be necessary to remove preprocessor stuff
"'-MG' also suppresses preprocessed output", hmm, maybe we can put this in makefile.local to be safe.

gcc + mingw is broken sometimes, some compiler revisions won't compile a ttdpatch in a usable state anyway. So I still use a pretty old cygwin compiling directory for TTDPatch because of this. I really don't want to test gcc4 and try fixing bugs that are compiler errors again.


operators:

Yes, I did want to add the variable expanding functions to sar/sal when committing, this diff looks like my code, I will try to add it as soon as I find time.
Post Reply

Return to “General TTDPatch”

Who is online

Users browsing this forum: No registered users and 5 guests