Hey all!

I am currently working on a project that implements the basic frameworks and most of the functionality for a genre of game with the goal of making it easily extensible to specific examples of that genre. Here is the dream pipeline as I've been visualizing it:

1. Somebody writes a setup(), checkMoveLegal(), etc function for the game in a new C file

2. This is compiled to an appvar to be loaded on the calculator and archived

3. My program, when run, will detect all such appvars and present them as examples to the user

4. The program moves the selected appvar into RAM and loads function pointers from it to define setup() etc

5. The program runs the game

6. The game appvar is returned to archive

Is this practical, and if so, how can I achieve step 2? I know I can put certain information in the header of an appvar, but I don't know how to force the toolchain to compile a program as a library like this, even though I'm sure something similar must exist in order for the standard libraries to work the way they do (even if they were written in assembly!). Or am I doing this backwards and I should instead write my project to be a library that each game loads and a launcher that presents the menu for the games?

Thank you!
Unless you're willing to guarantee that extension functions always execute from a chosen address, the challenge here is that they need to be relocatable. That must be doable because LibLoad does exactly that (relocating library code) and you might even be able to reuse parts of LibLoad to implement it, but I'm not aware of any existing things that would help you achieve that.
You could write your own interpreter instead, and convert a text file with instructions using convbin
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
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 vote in polls in this forum

 

Advertisement