logoalt Hacker News

replwoacauselast Tuesday at 5:12 AM1 replyview on HN

I enjoyed the read. How did you tap into the legacy Power Basic engine? Was there a FFI or some kind of bridge you could hook into? And what languages were you using?


Replies

benstopicslast Tuesday at 9:18 AM

I built an FFI via event dispatching and shared memory pointers/matching structs. Imported the C++ UI layer as a DLL via Win32 LoadLibrary. The PB shares a big array for storing global pointers allowing them to read/write each other's memory. The C++ has an event queue and has DLL functions the PB can call to peek/pop the next event. It actually isn't that complicated, just took me forever to come up with the idea.

As for languages, PB, C++, and JavaScript (Electron/Preact). I chose a no-build UI framework so that it could be modded by players without installing any build tools, just edit the text files in the game folder, and it has been a very good decision.

show 2 replies