Lua in MAME: Time for an Overhaul
If youve been following along during our extended November/December development cycle for MAME 0.227, you might have noticed that weve migrated MAME to C++17. As part of this, weve upgraded the C++/Lua interface library to sol3. This has necessitated a shake-up of the Lua interface code. Weve taken this opportunity to re-think some of MAMEs Lua interfaces.
Some of the changes are not backwards-compatible and will require scripts to be migrated. However, we believe these changes make our Lua interface more robust and efficient as well as making the Lua syntax more idiomatic. Weve exposed more functionality, too. Most of the breaking changes fall into a few categories:
- Better aligning the Lua interface with MAMEs architecture.
- Using container wrappers rather than building Lua tables.
- Replacing simple getter methods with read-only properties.
- Moving the Lua API reference to our documentation web site.
In particular, using container wrappers makes a lot of properties far more efficient because the collection no longer needs to be iterated and copied into a Lua table for every access. Well go through most of the breaking changes and touch on some of the new functionality here. There will still be occasional changes to the Lua APIs going forward, but were not anticipating another major upheaval like this soon.
Read the rest of this entry »
[Posted by: Vas Crabb]