GP32 Plugins. Sort Of


pea

developer
Joined
Oct 3, 2004
Messages
1,089
Age
46
Location
New Zealand
Website
www.projectitis.com
Hi there,

I apologise if this has been covered in another thread, I tried a search but when you don't know what to search for its pretty hard!

I don't know if this is specifically GP32 related, or if its C/C++ specific. Also note that there are other ways to achieve the same thing (e.g. scripting) but I'm asking about this particular method! Here goes:

Say I have a game, with functions that affect the game world:
Code:
game_makeCharacterGlow()
game_increaseScoreBy()
game_goUpLevel()
And this is compiled into an fxe, how can I load in some user defined code (like a plugin) into the game, which may have many functions, and can also access these game_ functions?
Code:
void plugin_main( args ){
  if (plugin_canIncreaseScore()){
    game_makeCharacterGlow();
    game_increaseScoreBy(100);
  }
}
bool plugin_canIncreaseScore(){
  ...
}

If its not GP32 specific, please throw me a link or some keywords to look up on how to do this?

Cheers
 
Easiest way to do it would be to make a patcher, but for that you would need to keep the FXE uncompressed (I think). Since we don't have an operating system overseeing programs, I don't see how you can get "real" dlls working without getting straight into hacky methods.
 
I don't mind if its not real dll's at all. I also don't want to touch the original code in any way. has to be runtime :)

As long as I can load some code (functions most likely) into memory, and then access those functions, I will be happy.

I think the best bet may be to use .gxb or .axf and load these into memory. But then how do I access the functions?
 
What you need is dlopen() to be ported to GP32.

I'm not sure how deep this is integrated into operating system issues, but it's the best trace I can think of.
As a reference implementation I suggest to take a look at uClibc.

Hope this helps.

Greetings,
SvOlli
 
Thank you! I think this is the sort of thing I am looking for...
I'll let you know how it goes and perhaps submit some of the functions to extend Mr Mirkos SDK at a later date :)

Mr Mirkos toolbox?

Cheers
 
Back
Top