summaryrefslogtreecommitdiffstatshomepage
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/source/commandline/commandline-all.rst16
-rw-r--r--docs/source/plugins/index.rst1
-rw-r--r--docs/source/plugins/timecode.rst21
-rw-r--r--docs/source/plugins/timer.rst2
-rw-r--r--docs/source/techspecs/luareference.rst80
5 files changed, 104 insertions, 16 deletions
diff --git a/docs/source/commandline/commandline-all.rst b/docs/source/commandline/commandline-all.rst
index ff0f6e6dd5d..92e02432ad6 100644
--- a/docs/source/commandline/commandline-all.rst
+++ b/docs/source/commandline/commandline-all.rst
@@ -1484,22 +1484,6 @@ Core State/Playback Options
you should only record and playback with all configuration (.cfg),
NVRAM (.nv), and memory card files deleted.
-.. _mame-commandline-recordtimecode:
-
-**-record_timecode**
-
- Tells MAME to create a timecode file. It contains a line with elapsed times
- on each press of timecode shortcut key (default is **F12**). This option
- works only when recording mode is enabled (**-record** option). The
- timecode file is saved in the ``inp`` folder.
-
- By default, no timecode file is saved.
-
- Example:
- .. code-block:: bash
-
- mame pacman -record worldrecord -record_timecode
-
.. _mame-commandline-mngwrite:
**-mngwrite** *<filename>*
diff --git a/docs/source/plugins/index.rst b/docs/source/plugins/index.rst
index 3cb72f3cf92..7807c333952 100644
--- a/docs/source/plugins/index.rst
+++ b/docs/source/plugins/index.rst
@@ -70,4 +70,5 @@ sample code that you can use as a starting point when writing your own plugins.
hiscore
inputmacro
layout
+ timecode
timer
diff --git a/docs/source/plugins/timecode.rst b/docs/source/plugins/timecode.rst
new file mode 100644
index 00000000000..315f72e44a9
--- /dev/null
+++ b/docs/source/plugins/timecode.rst
@@ -0,0 +1,21 @@
+.. _plugins-timecode:
+
+Timecode Recorder Plugin
+========================
+
+The timecode recorder plugin logs time codes to a text file in conjunction with
+creating an input recording file to assist people creating gameplay videos. The
+time code log file is *only* created when making an input recording. The time
+code log file has the same name as the input recording file with the extension
+**.timecode** appended. Use the :ref:`record <mame-commandline-record>` and
+:ref:`input_directory <mame-commandline-inputdirectory>` options to create an
+input recording and specify the location for the output files.
+
+By default, the plugin records a time code when you press the **F12** key on the
+keyboard while not pressing either **Shift** key. You can change this setting
+in the options menu for the plugin (choose **Plugin Options** from the main menu
+during emulation, and then choose **Timecode Recorder**).
+
+Settings for the plugin are stored in JSON format in the file **plugin.cfg** in
+the **timecode** folder inside your plugin data folder (see the
+:ref:`homepath option <mame-commandline-homepath>`).
diff --git a/docs/source/plugins/timer.rst b/docs/source/plugins/timer.rst
index 84d803d38aa..9576f0acc20 100644
--- a/docs/source/plugins/timer.rst
+++ b/docs/source/plugins/timer.rst
@@ -1,3 +1,5 @@
+.. _plugins-timer:
+
Timer Plugin
============
diff --git a/docs/source/techspecs/luareference.rst b/docs/source/techspecs/luareference.rst
index a5ac003a38d..30c5c88826d 100644
--- a/docs/source/techspecs/luareference.rst
+++ b/docs/source/techspecs/luareference.rst
@@ -63,6 +63,83 @@ Core classes
Many of MAME’s core classes used to implement an emulation session are available
to Lua scripts.
+.. _luareference-core-attotime:
+
+Attotime
+~~~~~~~~
+
+Wraps MAME’s ``attotime`` class, which represents a high-precision time
+interval. Attotime values support addition and subtraction with other attotime
+values, and multiplication and division by integers.
+
+Instantiation
+^^^^^^^^^^^^^
+
+emu.attotime()
+ Creates an attotime value representing zero (i.e. no elapsed time).
+emu.attotime(seconds, attoseconds)
+ Creates an attotime with the specified whole and fractional parts.
+emu.attotime(attotime)
+ Creates a copy of an existing attotime value.
+emu.attotime.from_double(seconds)
+ Creates an attotime value representing the specified number of seconds.
+emu.attotime.from_ticks(periods, frequency)
+ Creates an attotime representing the specified number of periods of the
+ specified frequency in Hertz.
+emu.attotime.from_seconds(seconds)
+ Creates an attotime value representing the specified whole number of
+ seconds.
+emu.attotime.from_msec(milliseconds)
+ Creates an attotime value representing the specified whole number of
+ milliseconds.
+emu.attotime.from_usec(microseconds)
+ Creates an attotime value representing the specified whole number of
+ microseconds.
+emu.attotime.from_nsec(nanoseconds)
+ Creates an attotime value representing the specified whole number of
+ nanoseconds.
+
+Methods
+^^^^^^^
+
+t:as_double()
+ Returns the time interval in seconds as a floating-point value.
+t:as_hz()
+ Interprets the interval as a period and returns the corresponding frequency
+ in Hertz as a floating-point value.
+t:as_khz()
+ Interprets the interval as a period and returns the corresponding frequency
+ kilohertz as a floating-point value.
+t:as_mhz()
+ Interprets the interval as a period and returns the corresponding frequency
+ megahertz as a floating-point value.
+t:as_ticks(frequency)
+ Returns the interval as a whole number of periods at the specified
+ frequency. The frequency is specified in Hertz.
+
+Properties
+^^^^^^^^^^
+
+t.is_zero (read-only)
+ Whether the value represents no elapsed time.
+t.is_never (read-only)
+ Whether the value is greater than the maximum number of whole seconds that
+ can be represented (treated as an unreachable time in the future or
+ overflow).
+t.attoseconds (read-only)
+ The fraction seconds portion of the interval in attoseconds.
+t.seconds (read-only)
+ The number of whole seconds in the interval.
+t.msec (read-only)
+ The number of whole milliseconds in the fractional seconds portion of the
+ interval.
+t.usec (read-only)
+ The number of whole microseconds in the fractional seconds portion of the
+ interval.
+t.nsec (read-only)
+ The number of whole nanoseconds in the fractional seconds portion of the
+ interval.
+
.. _luareference-core-mameman:
MAME machine manager
@@ -147,6 +224,9 @@ machine:logerror(msg)
Properties
^^^^^^^^^^
+machine.time (read-only)
+ The elapsed emulated time for the current session as an
+ :ref:`attotime <luareference-core-attotime>`.
machine.system (read-only)
The :ref:`driver metadata <luareference-core-driver>` for the current
system.