Re: Lua scripting support
Posted: Thu May 07, 2015 12:50 pm
I investigated this a little more (but probably still need to look deeper still), here are some new thoughts:
DeSmuME's Lua engine looks very extensive (the .cpp file for it is over 6000 lines!) and I think covers a lot of functionality that goes beyond the scope that I'd consider tackling with this. There doesn't seem to be formal documentation and I don't think there's much in the way of publicly available scripts. So I don't think there's a ton of value in trying to maintain any compatibility with DeSmuME's native interface.
Emulator Lua scripting in general seems to have a big focus aiding TAS creation. Since I doubt there's any real desire to create TASes on mobile devices I'm going to consider this outside of the scope of anything I'd add to DraStic.
I've looked at FCEUX's Lua interface documentation and it seems pretty reasonable, although I doubt we'd come anywhere close to implementing as much they do, especially not at first. Another big difference is that they run it by having the Lua script be in control and "always" running, and responsible to update the emulator. I'd most likely implement it the other way, where the emulator calls a method in the Lua script once per frame. In this way it'd be a lot like cheat code processing, only the Lua script would have access to emulator state that the cheat code doesn't.
DeSmuME's Lua engine looks very extensive (the .cpp file for it is over 6000 lines!) and I think covers a lot of functionality that goes beyond the scope that I'd consider tackling with this. There doesn't seem to be formal documentation and I don't think there's much in the way of publicly available scripts. So I don't think there's a ton of value in trying to maintain any compatibility with DeSmuME's native interface.
Emulator Lua scripting in general seems to have a big focus aiding TAS creation. Since I doubt there's any real desire to create TASes on mobile devices I'm going to consider this outside of the scope of anything I'd add to DraStic.
I've looked at FCEUX's Lua interface documentation and it seems pretty reasonable, although I doubt we'd come anywhere close to implementing as much they do, especially not at first. Another big difference is that they run it by having the Lua script be in control and "always" running, and responsible to update the emulator. I'd most likely implement it the other way, where the emulator calls a method in the Lua script once per frame. In this way it'd be a lot like cheat code processing, only the Lua script would have access to emulator state that the cheat code doesn't.