I'm working on a multi-target chiptune tracker and intend to use MAME as a backend for sound emulation. Not the best programmer in the world, so I need some help on how to handle the communication between MAME and the tracker application.
My current, naïve approach is to talk to MAME's LUA console via stdio. While this works in principle for simple calls to the LUA API, there are a number of issues with it , and also I don't think it's a very good approach in general. So I'm very interested to hear what would be the alternatives. Would writing a custom LUA plugin be the way to go, or are there other options?
Generally speaking, the following features would be required:
- pausing/unpausing emulation, resetting machines
- modifying register states
- changing RAM contents (would have to be fast)
- tracking machine state and acting on various conditions (mainly running callbacks to the tracker app on reaching various breakpoints)
Ideally, I'd also want an option to disable video output completely (running MAME with -video none still opens a window).
Any ideas/pointers for this would be highly appreciated. I'm also not too familiar with the MAME source. I know luaengine.cpp has some good info but I'm sure there's more I should be looking at.