Skip to content

luaengine: add memory-reading capabilities - #89

Merged
galibert merged 1 commit into
mamedev:masterfrom
lucab:lucab/mame-lua/mem-v2
Dec 24, 2014
Merged

luaengine: add memory-reading capabilities#89
galibert merged 1 commit into
mamedev:masterfrom
lucab:lucab/mame-lua/mem-v2

Conversation

@lucab

@lucab lucab commented Dec 24, 2014

Copy link
Copy Markdown
Contributor

This commit maps some more classes (device_t and address_space)
to retrieve devices and address spaces out of current running
machine.
Proxy methods are provided to enumerate/access devices and
address spaces, and to read memory content.

The idea is to provide user scripts some means to introspect on
current machine status.

Signed-off-by: Luca Bruno lucab@debian.org

This commit maps some more classes (device_t and address_space)
to retrieve devices and address spaces out of current running
machine.
Proxy methods are provided to enumerate/access devices and
address spaces, and to read memory content.

Signed-off-by: Luca Bruno <lucab@debian.org>
@lucab

lucab commented Dec 24, 2014

Copy link
Copy Markdown
Contributor Author

This is v2 of my previous PR #72, taking into account @galibert comments.

Major changes:

  • use luabridge instead of custom type, more C++ friendly
  • map device_t and address_space to lua
  • provide objects (userdata) for devices and address spaces
  • expose .devices and .spaces property tables to enumerate available devices/spaces
  • split previous single mem_read() into multiple read_<sign><size> methods

@lucab

lucab commented Dec 24, 2014

Copy link
Copy Markdown
Contributor Author

API usage is now as follow:

> for i,v in pairs(manager:machine().devices) do print(i) end;
:fatfury2_prot
:spritegen
:memcard
:banked_cart
:mslugx_prot
:maincpu
:screen
:kof2002_prot
:lspeaker
:saveram
:pvc_prot
:upd4990a
:ymsnd
:sbp_prot
:kof98_prot
:sma_prot
:audiocpu
:cmc_prot
:bootleg_prot
:pcm2_prot
:palette
:rspeaker
> for i,v in pairs(manager:machine().devices[":maincpu"].spaces) do print(i) end;
program
> print(manager:machine().devices[":maincpu"].spaces["program"]:read_i16(0xC1871C))
20085

galibert added a commit that referenced this pull request Dec 24, 2014
luaengine: add memory-reading capabilities [Luca Bruno]
@galibert
galibert merged commit f19ef3e into mamedev:master Dec 24, 2014
@lucab
lucab deleted the lucab/mame-lua/mem-v2 branch January 6, 2015 11:07
NullPopPoLab pushed a commit to NullPopPoLab/GroovyMAME that referenced this pull request Jan 29, 2023
Fix mamedev#89 add separate MAME menu item for IPT_UI_EXIT_GAME that is not set by default to prevent accidentally returning MAME Software list when being used with Retroarch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants