Skip to content
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

lucab
Copy link
Contributor

@lucab 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

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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
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.

None yet

2 participants