summaryrefslogtreecommitdiffstatshomepage
path: root/docs/source
diff options
context:
space:
mode:
Diffstat (limited to 'docs/source')
-rw-r--r--docs/source/conf.py4
-rw-r--r--docs/source/plugins/dummy.rst5
-rw-r--r--docs/source/techspecs/luaengine.rst12
-rw-r--r--docs/source/techspecs/luareference.rst88
4 files changed, 94 insertions, 15 deletions
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 6b3b080952f..8251128d44c 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -63,9 +63,9 @@ copyright = u'1997-2023, MAMEdev and contributors'
# built documents.
#
# The short X.Y version.
-version = '0.253'
+version = '0.254'
# The full version, including alpha/beta/rc tags.
-release = '0.253'
+release = '0.254'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/docs/source/plugins/dummy.rst b/docs/source/plugins/dummy.rst
index 78cc262c53e..21c4c72309c 100644
--- a/docs/source/plugins/dummy.rst
+++ b/docs/source/plugins/dummy.rst
@@ -4,6 +4,5 @@ Dummy Test Plugin
=================
This is a sample plugin that shows how to set necessary plugin metadata,
-register callbacks, and display a simple menu. It prints status messages if the
-:ref:`verbose <mame-commandline-verbose>` option is on, and it adds a **Dummy**
-option to the **Plugin Options** menu.
+register callbacks, and display a simple menu. It prints status messages, and
+it adds a **Dummy** option to the **Plugin Options** menu.
diff --git a/docs/source/techspecs/luaengine.rst b/docs/source/techspecs/luaengine.rst
index 5e97d4e3885..7f2ba99545a 100644
--- a/docs/source/techspecs/luaengine.rst
+++ b/docs/source/techspecs/luaengine.rst
@@ -53,9 +53,9 @@ Many of the classes are documented on the
Usage
-----
-MAME supports external scripting via Lua (>= 5.3) scripts, either entered at the
+MAME supports external scripting via Lua scripts, either entered at the
interactive console or loaded as a file. To reach the console, enable the
-console plugin (e.g. run MAME with ``-plugin console``) and you will be greeted
+console plugin (e.g. run MAME with ``-console``) and you will be greeted
with a ``[MAME]>`` prompt where you can enter Lua script interactively.
To load a whole script at once, store it in a plain text file and pass it using
@@ -78,7 +78,7 @@ Let’s first run MAME in a terminal to reach the Lua console:
::
- $ mame -console YOUR_ROM
+ $ mame -console YOUR_SYSTEM
/| /| /| /| /| _______
/ | / | / | / | / | / /
/ |/ | / | / |/ | / ____/
@@ -90,10 +90,10 @@ Let’s first run MAME in a terminal to reach the Lua console:
/ /
/ _/
- mame 0.227
+ mame 0.254
Copyright (C) Nicola Salmoria and the MAME team
- Lua 5.3
+ Lua 5.4
Copyright (C) Lua.org, PUC-Rio
[MAME]>
@@ -113,7 +113,7 @@ You can check at runtime which version of MAME you are running, with:
::
[MAME]> print(emu.app_name() .. " " .. emu.app_version())
- mame 0.227
+ mame 0.254
We now start exploring screen related methods. First, let's enumerate available
screens:
diff --git a/docs/source/techspecs/luareference.rst b/docs/source/techspecs/luareference.rst
index ec7727916db..967fc889729 100644
--- a/docs/source/techspecs/luareference.rst
+++ b/docs/source/techspecs/luareference.rst
@@ -55,6 +55,82 @@ c:index_of(v)
value.
+.. _luareference-globals:
+
+Global objects
+--------------
+
+.. _luareference-globals-emu:
+
+Emulator interface
+~~~~~~~~~~~~~~~~~~
+
+The emulator interface ``emu`` provides access to core functionality. Many
+classes are also available as properties of the emulator interface.
+
+Methods
+^^^^^^^
+
+emu.wait(duration, …)
+ Yields for the specified duration in terms of emulated time. The duration
+ may be specified as an :ref:`attotime <luareference-core-attotime>` or a
+ number in seconds. Any additional arguments are returned to the caller.
+ Returns a Boolean indicating whether the duration expired normally.
+
+ All outstanding calls to ``emu.wait`` will return ``false`` immediately if a
+ saved state is loaded or the emulation session ends. Calling this function
+ from callbacks that are not run as coroutines will raise an error.
+emu.wait_next_update(…)
+ Yields until the next video/UI update. Any arguments are returned to the
+ caller. Calling this function from callbacks that are not run as coroutines
+ will raise an error.
+emu.wait_next_frame(…)
+ Yields until the next emulated frame completes. Any arguments are returned
+ to the caller. Calling this function from callbacks that are not run as
+ coroutines will raise an error.
+emu.add_machine_reset_notifier(callback)
+ Add a callback to receive notifications when the emulated system is reset.
+ Returns a :ref:`notifier subscription <luareference-core-notifiersub>`.
+emu.add_machine_stop_notifier(callback)
+ Add a callback to receive notifications when the emulated system is stopped.
+ Returns a :ref:`notifier subscription <luareference-core-notifiersub>`.
+emu.add_machine_pause_notifier(callback)
+ Add a callback to receive notifications when the emulated system is paused.
+ Returns a :ref:`notifier subscription <luareference-core-notifiersub>`.
+emu.add_machine_resume_notifier(callback)
+ Add a callback to receive notifications when the emulated system is resumed
+ after being paused. Returns a
+ :ref:`notifier subscription <luareference-core-notifiersub>`.
+emu.add_machine_frame_notifier(callback)
+ Add a callback to receive notifications when an emulated frame completes.
+ Returns a :ref:`notifier subscription <luareference-core-notifiersub>`.
+emu.add_machine_pre_save_notifier(callback)
+ Add a callback to receive notification before the emulated system state is
+ saved. Returns a
+ :ref:`notifier subscription <luareference-core-notifiersub>`.
+emu.add_machine_post_load_notifier(callback)
+ Add a callback to receive notification after the emulated system is restored
+ to a previously saved state. Returns a
+ :ref:`notifier subscription <luareference-core-notifiersub>`.
+emu.print_error(message)
+ Print an error message.
+emu.print_warning(message)
+ Print a warning message.
+emu.print_info(message)
+ Print an informational message.
+emu.print_verbose(message)
+ Print a verbose diagnostic message (disabled by default).
+emu.print_debug(message)
+ Print a debug message (only enabled for debug builds by default).
+emu.lang_translate([context], message)
+ Look up a message with optional context in the current localised message
+ catalog. Returns the message unchanged if no corresponding localised
+ message is found.
+emu.subst_env(string)
+ Substitute environment variables in a string. The syntax is dependent on
+ the host operating system.
+
+
.. _luareference-core:
Core classes
@@ -1598,7 +1674,8 @@ Pass-through handler
Tracks a pass-through handler installed in an
:ref:`address space <luareference-mem-space>`. A memory pass-through handler
receives notifications on accesses to a specified range of addresses, and can
-modify the data that is read or written if desired.
+modify the data that is read or written if desired. Note that pass-through handler
+callbacks are not run as coroutines.
Instantiation
^^^^^^^^^^^^^
@@ -3572,7 +3649,8 @@ Layout file
~~~~~~~~~~~
Wraps MAME’s ``layout_file`` class, representing the views loaded from a layout
-file for use by a render target.
+file for use by a render target. Note that layout file callbacks are not run as
+coroutines.
Instantiation
^^^^^^^^^^^^^
@@ -3616,7 +3694,8 @@ Layout view
Wraps MAME’s ``layout_view`` class, representing a view that can be displayed in
a render target. Views are created from XML layout files, which may be loaded
from external artwork, internal to MAME, or automatically generated based on the
-screens in the emulated system.
+screens in the emulated system. Note that layout view callbacks are not run as
+coroutines.
Instantiation
^^^^^^^^^^^^^
@@ -3695,7 +3774,8 @@ Layout view item
Wraps MAME’s ``layout_view_item`` class, representing an item in a view. An
item is drawn as a rectangular textured surface. The texture is supplied by an
-emulated screen or a layout element.
+emulated screen or a layout element. Note that layout view item callbacks are
+not run as coroutines.
Instantiation
^^^^^^^^^^^^^
>2 years taitowlf_zoomtaito/taitowlf.cpp: preliminary Zoom hookup angelosa23 months time-experimentsRemaining fixes Aaron Giles4 years time-experiments2Stop memsetting structures. Aaron Giles4 years vamphalf_misncrftvamphalf.cpp: move wyvernwg to own state machine, add some basic protection t... angelosa3 years voodoo_directx11Fix some vegas games not booting Ted Green5 years x86_std-exceptionscpu/i386: saner fatal error handling angelosa13 months xbox_swlisthash/xbox_hdd.xml: QA and srcclean angelosa10 months xtalfull xtal conversion Olivier Galibert4 days ymfm-delayClean up delay implementation a bit. Move delay setting to immediately after ... Aaron Giles4 years  TagDownloadAuthorAge mame0277commit 84cb44566c... Vas Crabb4 days mame0276commit 758c8a169a... Vas Crabb5 weeks mame0275commit 455ffbbd7e... Vas Crabb2 months mame0274commit cd82a83c3d... Vas Crabb3 months mame0273commit e11cae0a15... Vas Crabb4 months mame0272commit 5d8e4cf07e... Vas Crabb5 months mame0271commit 4da96a0c4f... Vas Crabb6 months mame0270commit ef032a31e5... Vas Crabb7 months mame0269commit 6d1970f5f1... Vas Crabb8 months mame0268commit acea8712d6... Vas Crabb9 months mame0267commit 663abae071... Vas Crabb10 months mame0266commit cd7817b220... Vas Crabb11 months mame0265commit f8af5cc2cf... Vas Crabb12 months mame0264commit 5b670ad51f... Vas Crabb13 months mame0263commit 93d8318325... Vas Crabb14 months mame0262commit d48a61f921... Vas Crabb15 months mame0261commit ca50094e8d... Vas Crabb17 months mame0260commit 0a7f1fe9cf... Vas Crabb18 months mame0259commit 4ff20056c3... Vas Crabb19 months mame0258commit 2e0aa82350... Vas Crabb20 months mame0257commit f811a66c53... Vas Crabb21 months mame0256commit b41370db02... Vas Crabb22 months mame0255commit c6650dc072... Vas Crabb23 months mame0254commit bfa8d724a0... Vas Crabb2 years mame0253commit b6d9756c5e... Vas Crabb2 years mame0252commit fb98822c34... Vas Crabb2 years mame0251commit 34e6ec1ef8... Vas Crabb2 years mame0250commit b7cbe74c4b... Vas Crabb2 years mame0249commit 91c5b9ecea... Vas Crabb3 years mame0248commit 2d3d0deec8... Vas Crabb3 years mame0247commit fa2d36c634... Vas Crabb3 years mame0246commit 205b03897c... Vas Crabb3 years mame0245commit 5d31f0fc97... Vas Crabb3 years mame0244commit bcf77373a5... Vas Crabb3 years mame0243commit addbb8ab40... Vas Crabb3 years mame0242commit e8166b5274... Vas Crabb3 years mame0241commit 31f001e501... Vas Crabb3 years mame0240commit f0ab44fe1c... Vas Crabb3 years mame0239commit 80bcaea1ed... Vas Crabb3 years mame0238commit fb21b78904... Vas Crabb3 years mame0237commit 34d8357465... Vas Crabb4 years mame0236commit 5e865af540... Vas Crabb4 years mame0235commit ec9ba6fa76... Vas Crabb4 years mame0234commit 2633c19a68... Vas Crabb4 years mame0233commit 05d0cf61e7... Vas Crabb4 years mame0232commit 2b0f01bc3a... Vas Crabb4 years mame0231commit 1f22113661... Vas Crabb4 years mame0230commit 943c06cba0... Vas Crabb4 years mame0229commit 4322eaae9d... Vas Crabb4 years mame0228commit 140f446933... Vas Crabb4 years mame0227commit d85735634c... Vas Crabb4 years mame0226commit 3c56452b07... Vas Crabb5 years mame0225commit 5a1fd0cc17... Vas Crabb5 years mame0224commit 5892c78a15... Vas Crabb5 years mame0223commit c55a261d26... Vas Crabb5 years mame0222commit 6d50d60a43... Vas Crabb5 years mame0221commit e8a0e0469b... Vas Crabb5 years mame0220commit c5c5723b9d... Vas Crabb5 years mame0219commit 221f006442... Vas Crabb5 years mame0218commit 0e2a252d30... Vas Crabb5 years mame0217commit 13997a8f31... Vas Crabb5 years mame0216commit b8b7c7e232... Vas Crabb5 years mame0215commit e9ef4808dd... Vas Crabb6 years mame0214commit 24d07a12d7... Vas Crabb6 years mame0213commit f7172322a2... Vas Crabb6 years mame0212commit 1182bd9325... Vas Crabb6 years mame0211commit 1b969a8acb... Vas Crabb6 years mame0210commit ad45c9c609... Vas Crabb6 years mame0209commit 2b317bf296... Vas Crabb6 years mame0208commit 9483624864...