Josh @ Dreamland
|
 |
Posted on: April 25, 2009, 08:58:16 pm |
|
|
Prince of all Goldfish
 Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
Since people are beginning to freak out, I decided I'd best be more liberal with my updates. ...No, I will not get a Twitter. Ever. That would kill me on the inside.
Continuing.
DLL's are working. That doesn't mean they're finished, though; I have some stdcall testing to do now that I have cdecl working.
The endeavor looked something like this: 7:58 - Code is riddled with inline asm. Output is gobbly gook in the form of a message box. 8:?? - Clam mentions the name of LibFFI, which I'd heard of previously but then no one knew its name, so I stopped looking. 8:43 - Clam fixed me up with windows-ready LibFFI junk and a demo. 9:16 - Code is riddled with FFI garbage. Output is somewhat different gobbly gook in the form of a message box. 9:19 - Found the problem, fixed it. Working.
So now DLLs are working, at least with cdecl. Actually, cdecl was the one I wasn't sure how to do, but since it's working, stdcall should be a snap.
As for days previous, I now have a working expression evaluator. There are a couple things left to do so it can support all the types. (Right now it only does int, double, and char*). I was designing it for parsing #define, but it has so many other uses that I intend to make it full-featured. (#define is a C++ macro which I will need to parse in the CFile parser I mentioned earlier. It doesn't support floating points or type casts, but I've implemented those anyway.)
If this works well, I can eventually add a couple things to that evaluator and have an interpreter for debugging purposes. It'd probably help to be able to execute new code in debug mode. And don't worry; since enigma's compiled, it'd be next to impossible to access the debug window unless the game is in debug mode. The only way it would be possible is if a very skilled programmer converted the whole game back to assembly and hand coded the new debug interface, which would be such a massive task, there isn't a person on the planet with that sort of motivation. (They'd sooner just hack your game with a disassembler while it ran.)
And don't give my post that look; there's nothing you can do to make any game totally unhackable. I'm pretty sure everyone knows that and has come to terms with it. ENIGMA just isn't particularly easy to hack, unlike *some*.
The expression evaluator is a suprisingly small 900 lines so far. The CFile parser 630; It's about half done. Still have some keywords and er.... As a general "back to the drawing board" sort of thing, I'm adding support for basically every feature C++ offers. So you won't have to use the awful ds_ functions, you'll have something easily 30x more powerful at your disposal. Not to mention structs, so you have a convenient way of storing things. Oh, and I can't live without ++, so I'm adding that as an option (default to ON). I've also added the ternary operator (a?b():c()) into the expression parser.
All these changes and additions I'm making will mean some recoding in the syntax checker as well as the parser. Shouldn't be difficult; I'm not worried.
Or at least I wasn't, then I found out C++0x supports lambda, and I didn't know what to think. Either way, I'm sure it'll be fine.
Ism has been making things compile on Linux, which was met without much incident. So things are looking bright, overall.
Anyway, I'ma get back to work.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
Josh @ Dreamland
|
 |
Reply #2 Posted on: April 26, 2009, 06:55:31 am |
|
|
Prince of all Goldfish
 Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
LibFFI handles DLLs, and lets you call them knowing pretty much nothing about what will be called at compile time. Means we didn't have to keep screwing around with asm. Expression evaluator is the equivalent to that thing in GM's debug window that lets you watch variables and other small things. I made it so I can parse header files accurately: this way, users can include things from C++ and use them in their GM games. CFile parser just reads C headers and sources to get more functions for the syntax check.
For more C++ oriented people, this means you can have structures in your code along with the GML. If I do this well enough, it'll be able to parse all the standard template library headers, too.
That means you can do this: map<string,int> a; a["text string"] = 0;
...and the rest has a small learning curve I won't be posting here.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
|
|
|
|
Josh @ Dreamland
|
 |
Reply #8 Posted on: April 28, 2009, 03:11:38 pm |
|
|
Prince of all Goldfish
 Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
Bleh, happens. Not sure why FireFox didn't form complete the password for me, and really not sure how I took five times to enter it correctly. (The last two tries I copied and pasted in the correct password... Even confirmed it with a2h to make sure.)
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
|
|
|
|
|
|