Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (Ayumi, NewbieZorro, TipmyPip), 13,888 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 4 of 5 1 2 3 4 5
Re: Manipulating the function scheduler? [Re: EvilSOB] #387913
11/25/11 13:25
11/25/11 13:25
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
No developer needed, as TechMuc solved the problem. I hope you can formulate his idea without syntax error - otherwise I leave it as a little user quiz.

If I wanted to replace a function with a macro, I would rename it, f.i. wait() to WAIT(), for making clear that it's a macro. But TechMuc's idea is more elegant.

Re: Manipulating the function scheduler? [Re: jcl] #387948
11/26/11 04:21
11/26/11 04:21
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
So, Mr Developer...

Are you saying there is no way to do it WITHOUT a plugin?

Or have I missed something TechMuc (or someone else) said?


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Manipulating the function scheduler? [Re: EvilSOB] #387959
11/26/11 13:52
11/26/11 13:52
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
I guess youneed to fix Techmuc's code.
Haven't actually tried, but maybe this works:

void my_wait_func(var);

my_wait_func = wait; //save pointer of wait in my_wait_func

#define wait(i) do{ diag("waiting\n"); my_wait_func(i); } while(0)

Re: Manipulating the function scheduler? [Re: FBL] #388016
11/27/11 01:38
11/27/11 01:38
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
OK...
After MORE wastage of time, re-reading EVERYONES posts in this thread,
I finally got the bastich working! But, by the gods, is it UGLY...

Here it is. IMPORTANT:: The bulk of the code MUST come straight after acknex.h and before any other #include's you do.
Otherwise they will just be processing 'un-redirected' wait functions... I THINK ...
Code:
#include <acknex.h>
//
void _wait(var);
void _wait_initialize()	{	_wait = wait; }
#define wait(i) 	do{  diag(waiting\n");  _wait(i);  } while(0)
//
#include "everything else"
//
//
void main()
{
   _wait_initialize();   //this MUST come before any wait's in main!
   ...



Point of interest for Germanunkol: Be aware that the "engine_gettaskinfo" function
is currently bugged! Check the Bugs forum under Benni003's "engine_getscriptinfo" posting.
This bug also affects the engine_gettaskinfo function too...




"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Manipulating the function scheduler? [Re: EvilSOB] #388457
12/03/11 08:55
12/03/11 08:55
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline OP
Expert
Germanunkol  Offline OP
Expert

Joined: Jun 2006
Posts: 2,640
Earth
Well thank you very much EvilSOB. I now sorta got the macro working.
Sorta, because after the first few wait calls, it always seems to be returning a certain function name - no longer the one which the wait is actually called in.
I suspect this has to do with the wrong behavior of gettaskinfo.

This entirely defeats the purpose of the whole thing, because what I need to do is find out where my text object is overwritten, so I log the name of the current function and the text object's value on every wait call. But if the function name isn't correct, I might as well just not do it.

The only Idea I've had so far is to set a string to a different value after every wait() call (and then log that string), but I'd have to do that manually. Which totally sucks.

Or I'll write a c++ script which does it for me... which might be less horrible, cause I probably have around a thousand functions.


~"I never let school interfere with my education"~
-Mark Twain
Re: Manipulating the function scheduler? [Re: Germanunkol] #388458
12/03/11 09:42
12/03/11 09:42
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
In order to bypass the gettaskinfo bug, I did it by completely removing
the default.c include. Works fine then.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Manipulating the function scheduler? [Re: EvilSOB] #388480
12/03/11 17:08
12/03/11 17:08
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline OP
Expert
Germanunkol  Offline OP
Expert

Joined: Jun 2006
Posts: 2,640
Earth
I FIXED IT!
I've been working on this for 6 months and just could not find the bug.
It was - as I've been expecting for quite some time now - an array that was being addressed with a wrong index (resulting in it setting some other part of the memory). By writing a script that added a line before all wait calls, I found out which function it was in. There was some troubles with proc_mode, as those calls changed my results, but I finally found it.

Thanks a lot for all your help!


~"I never let school interfere with my education"~
-Mark Twain
Re: Manipulating the function scheduler? [Re: Germanunkol] #388500
12/03/11 21:43
12/03/11 21:43
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline
Serious User
Rackscha  Offline
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
@Germanunkol: Oh yea, i know those bugs. Once i wrote into the wrong index and destroey something in the background. Resulting in crashes whenever i called a string function >.<


MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

Re: Manipulating the function scheduler? [Re: Germanunkol] #388503
12/03/11 21:51
12/03/11 21:51
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Good to hear.

Its been useful for me too.

Ive been able to write a debug function that can tell me how
long each function is taking to process.

This debug function is also able to filter which functions
get reported on, as well as dumping various global variables
dependant on which function was running during that time.

Its helping to optimise maultiple parallel functions.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Manipulating the function scheduler? [Re: EvilSOB] #388593
12/04/11 20:27
12/04/11 20:27
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline OP
Expert
Germanunkol  Offline OP
Expert

Joined: Jun 2006
Posts: 2,640
Earth
But I assume you're using gettaskinfo, right?
I was thinking about writing a similar function, to try and get a higher fps..


~"I never let school interfere with my education"~
-Mark Twain
Page 4 of 5 1 2 3 4 5

Moderated by  old_bill, Tobias 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1