New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

luaengine: add memory-reading capabilities #89

Merged
merged 1 commit into from Dec 24, 2014

Conversation

Projects
None yet
2 participants
@lucab
Contributor

lucab commented Dec 24, 2014

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

luaengine: add access to devices and address spaces
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

This comment has been minimized.

Contributor

lucab commented Dec 24, 2014

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

This comment has been minimized.

Contributor

lucab commented Dec 24, 2014

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

Merge pull request #89 from lucab/lucab/mame-lua/mem-v2
luaengine: add memory-reading capabilities [Luca Bruno]

@galibert galibert merged commit f19ef3e into mamedev:master Dec 24, 2014

@lucab lucab deleted the lucab:lucab/mame-lua/mem-v2 branch Jan 6, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment