Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views


Sign in to follow this  
Evil Steve


DruinkASM is now "Complete". That is, I have support for all the opcodes and constructs I need. It should be easy enough to add support for other stuff later on, as required.

So I've started making the VM and test app now. The VM compiles to a .lib file, and you #include "DruinkScript.h", which will include the other files.
I'm not entirely sure how to lay the code out though. Usually I have a Code folder in the solution directory, and then one folder for each .cpp/.h pair. But I want the client apps to be able to just include one file, which will include others, so I guess I'll stuff all the headers into one folder, and seperate them out using the filters in the IDE. That way I should end up with the classic "include" "src" "lib" "bin" folders that libs like Lua dish out.

I'm aiming to make the VM as simple as possible to start up and get scripts loaded, it'll probably be something like:

#include "DruinkScript/DruinkScript.h"

int main(int, char**)
DruinkScript::VM theVM;

DruinkScript::Script* pScript = theVM.LoadScript("Test.ds");
printf("Failed to load script: %s\n", theVM.GetError());
return -1;

pScript->Run(50); // Execute up to 50 opcodes this cycle

return 0;

Yes, that doesn't show much, I know. But it's a start. The function binding will probably be via functors, since I hate writing static member functions that just call a non-static member.
I'm not entirely sure how I'll handle multiple scripts, I think the above method should lend itself pretty well to handling that without much bother though.

Anyway. Work...
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!