User avatar
cuavas
Posts: 125
Joined: Tue Nov 11, 2014 1:04 pm
Location: Sydney, Australia
Contact: Website

Lua in MAME: Time for an Overhaul

Lua in MAME: Time for an Overhaul

If you’ve been following along during our extended November/December development cycle for MAME 0.227, you might have noticed that we’ve migrated MAME to C++17. As part of this, we’ve upgraded the C++/Lua interface library to sol3. This has necessitated a shake-up of the Lua interface code. We’ve taken this opportunity to re-think some of MAME’s 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. We’ve exposed more functionality, too. Most of the breaking changes fall into a few categories:
  • Better aligning the Lua interface with MAME’s 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. We’ll 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 we’re not anticipating another major upheaval like this soon.

Read the rest of this entry »

Return to “Announcements”