summaryrefslogtreecommitdiffstatshomepage
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/CONTRIBUTING.md1
-rw-r--r--docs/man/chdman.12
-rw-r--r--docs/man/mess.61332
-rw-r--r--docs/man/romcmp.13
-rw-r--r--docs/source/advanced/bgfx.rst265
-rw-r--r--docs/source/advanced/ctrlr_config.rst84
-rw-r--r--docs/source/advanced/devicemap.rst121
-rw-r--r--docs/source/advanced/multiconfig.rst52
-rw-r--r--docs/source/commandline/commandline-all.rst538
-rw-r--r--docs/source/commandline/commandline-index.rst98
-rw-r--r--docs/source/commandline/index.rst14
-rw-r--r--docs/source/commandline/sdlconfig.rst56
-rw-r--r--docs/source/commandline/windowsconfig.rst59
-rw-r--r--docs/source/conf.py6
-rw-r--r--docs/source/contributing/cxx.rst573
-rw-r--r--docs/source/contributing/index.rst144
-rw-r--r--docs/source/contributing/softlist.rst175
-rw-r--r--docs/source/debugger/exceptionpoint.rst134
-rw-r--r--docs/source/debugger/execution.rst92
-rw-r--r--docs/source/debugger/general.rst21
-rw-r--r--docs/source/debugger/index.rst35
-rw-r--r--docs/source/debugger/watchpoint.rst2
-rw-r--r--docs/source/images/MAMElogo.svg8
-rw-r--r--docs/source/index.rst1
-rw-r--r--docs/source/initialsetup/compilingmame.rst374
-rw-r--r--docs/source/license.rst2
-rw-r--r--docs/source/plugins/autofire.rst26
-rw-r--r--docs/source/plugins/data.rst7
-rw-r--r--docs/source/plugins/dummy.rst5
-rw-r--r--docs/source/plugins/inputmacro.rst20
-rw-r--r--docs/source/techspecs/device_memory_interface.rst13
-rw-r--r--docs/source/techspecs/index.rst31
-rw-r--r--docs/source/techspecs/inputsystem.rst460
-rw-r--r--docs/source/techspecs/layout_files.rst27
-rw-r--r--docs/source/techspecs/luaengine.rst12
-rw-r--r--docs/source/techspecs/luareference.rst1303
-rw-r--r--docs/source/techspecs/m6502.rst6
-rw-r--r--docs/source/techspecs/memory.rst22
-rw-r--r--docs/source/techspecs/naming.rst59
-rw-r--r--docs/source/techspecs/object_finders.rst2
-rw-r--r--docs/source/tools/othertools.rst8
-rw-r--r--docs/source/usingmame/assetsearch.rst402
-rw-r--r--docs/source/usingmame/commonissues.rst2
-rw-r--r--docs/source/usingmame/defaultkeys.rst21
-rw-r--r--docs/source/usingmame/index.rst1
-rw-r--r--docs/source/usingmame/mamemenus.rst286
-rw-r--r--docs/source/usingmame/ui.rst132
-rw-r--r--docs/source/usingmame/usingmame.rst11
-rw-r--r--docs/source/whatis.rst2
49 files changed, 4868 insertions, 2182 deletions
diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md
deleted file mode 100644
index 8b137891791..00000000000
--- a/docs/CONTRIBUTING.md
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/docs/man/chdman.1 b/docs/man/chdman.1
index 34fd884eecd..57a1e4615c7 100644
--- a/docs/man/chdman.1
+++ b/docs/man/chdman.1
@@ -39,7 +39,7 @@ detailed list of the valid switches for the option.
Dump the header information from a drive image.
.TP
.B verify \
-\-i \fIfileiname\fR \
+\-i \fIfilename\fR \
[\fB\-ip \fIfilename\fR]
Validate the MD5/SHA1 on a drive image.
.TP
diff --git a/docs/man/mess.6 b/docs/man/mess.6
deleted file mode 100644
index 07293db867f..00000000000
--- a/docs/man/mess.6
+++ /dev/null
@@ -1,1332 +0,0 @@
-.\" -*- nroff -*-
-.\"
-.\" mess.6
-.\"
-.\" Man page created from usage and source information:
-.\" * commands: see src/emu/clifront.c clifront.h
-.\" * options: core entries, see src/emu/emuopts.c emuopts.h
-.\" SDL-specific entries, see src/osd/sdl/sdlmain.c osdsdl.h
-.\" Cesare Falco <c.falco@ubuntu.com>, March 2011
-.\"
-.\" Some text borrowed from the xmame 0.106 man page,
-.\" done by Rene Herrmann <rene.herrmann@berlin.de>, September 2000
-.\" and updated by Andrew Burton <burtona@gol.com>, July 2003
-.\"
-.\" Other info's taken from MESS Wiki as well:
-.\" http://mess.redump.net
-.\"
-.\"
-.TH MESS 6 2015-05-20 0.162 "MESS \- Multi Emulator Super System"
-.\"
-.\"
-.\" NAME chapter
-.SH NAME
-MESS \- Multi Emulator Super System
-.\"
-.\"
-.\" SYNOPSIS chapter
-.SH SYNOPSIS
-.B mess
-.I system
-.RI [ "media software" ]
-.RI [ options ]
-.\"
-.\"
-.\" DESCRIPTION chapter
-.SH DESCRIPTION
-MESS documents the hardware for a wide variety of (mostly vintage) computers,
-video game consoles, and calculators through software emulation. As a nice
-side effect, MESS allows software and games for these hardware platforms
-to run on modern PCs.
-.\"
-.\"
-.\" SOFTWARE chapter
-.SH SOFTWARE
-A \fIsoftware\fR entry may be specified to attach an image file to the
-emulated system. In such a case, the appropriate \fImedia\fR switch
-is also required:
-.TP
-.B \-cart, \-cart1
-Cartrigde, used mainly by game consoles
-.TP
-.B \-cass
-Cassette (tape), widely used by old home computers
-.TP
-.B \-flop, -flop1
-Floppy disk
-.TP
-.B \-cdrom
-CD-Rom
-.\"
-.\"
-.\" OPTIONS chapter
-.SH OPTIONS
-.\"
-.\" *******************************************************
-.SS Core commands
-.\" *******************************************************
-.TP
-.B \-help, \-?
-Displays current MESS version and copyright notice.
-.TP
-.B \-validate, \-valid
-Performs internal validation on every driver in MESS. Run this
-before submitting changes to ensure that you haven't violated any of
-the core system rules.
-.\"
-.\" *******************************************************
-.SS Configuration commands
-.\" *******************************************************
-.TP
-.B \-createconfig, \-cc
-Creates the default \fBmess.ini\fR file in the current directory. All the
-configuration options (not commands) described below can be permanently
-changed by editing this configuration file.
-.TP
-.B \-showconfig, \-sc
-Displays the current configuration settings.
-.TP
-.B \-showusage, \-su
-Displays a summary of all the command line options. For options that
-are not mentioned here, the short summary given by \fB\-showusage\fR
-is usually sufficient.
-.\"
-.\" *******************************************************
-.SS Frontend commands
-.\" *******************************************************
-All the list commands below write info to the screen.
-If you wish to write the info to a textfile instead, use redirection.
-For example,
-.B mess \-listxml > ~/messlist.xml
-writes the full list of supported systems to \fBmesslist.xml\fR in your
-home directory.
-.TP
-.B \-listxml, \-lx \fR[\fIsystem\fR|\fIwildcard\fR]
-List comprehensive details for all of the supported systems. The output
-is quite long, so it is usually better to redirect this into a file.
-The output is in XML format. By default all systems are listed; however,
-you can limit this list by specifying a driver name or wildcard after
-the \-listxml command.
-.TP
-.B \-listfull, \-ll \fR[\fIsystem\fR|\fIwildcard\fR]
-Displays a list of system driver names and descriptions. By default all
-systems are listed; however, you can limit this list by specifying a
-driver name or wildcard after the \-listfull command.
-.TP
-.B \-listsource, \-ls \fR[\fIsystem\fR|\fIwildcard\fR]
-Displays a list of drivers and the names of the source files their system
-drivers live in. Useful for finding which driver a system runs on in
-order to fix bugs. By default all systems are listed; however, you can
-limit this list by specifying a driver name or wildcard after the
-\-listsource command.
-.TP
-.B \-listclones, \-lc \fR[\fIsystem\fR|\fIwildcard\fR]
-Displays a list of clones. By default all clones are listed; however,
-you can limit this list by specifying a driver name or wildcard after
-the \-listclones command.
-.TP
-.B \-listbrothers, \-lb \fR[\fIsystem\fR|\fIwildcard\fR]
-Displays a list of "brothers" or other drivers from same sourcefile.
-By default all systems are listed; however, you can limit this list by
-specifying a driver name or wildcard after the \-listbrothers command.
-.TP
-.B \-listcrc
-Displays a full list of CRCs of all ROM images referenced by all
-drivers within MESS code.
-.TP
-.B \-listroms, \-lr \fIsystem
-Displays a list of ROM images referenced by the specified system.
-.TP
-.B \-listsamples \fIsystem
-Displays a list of samples referenced by the specified system.
-.TP
-.B \-verifyroms \fR[\fIsystem\fR|\fIwildcard\fR]
-Checks for invalid or missing ROM images. By default all drivers that
-have valid ZIP files or directories in the rom path are verified;
-however, you can limit this list by specifying a driver name or
-wildcard after the \-verifyroms command.
-.TP
-.B \-verifysamples \fR[\fIsystem\fR|\fIwildcard\fR]
-Checks for invalid or missing samples. By default all drivers that
-have valid ZIP files or directories in the samplepath are verified;
-however, you can limit this list by specifying a driver name or
-wildcard after the \-verifyroms command.
-.TP
-.B \-romident
-Attempts to identify ROM files, if they are known to MESS, in the
-specified .zip file or directory. This command can be used to try and
-identify ROM sets taken from unknown boards. On exit, the errorlevel
-is returned as one of the following:
-.br
-\fB0\fR all files were identified
-.br
-\fB7\fR all files were identified except for some "non\-ROM" files
-.br
-\fB8\fR some files were identified
-.br
-\fB9\fR no files were identified
-.TP
-.B \-listdevices, \-ld
-Output the list of devices referenced by a given system or set of systems.
-.TP
-.B \-listslots, \-lslot
-Output the list of available slots and slot devices for the system.
-.TP
-.B \-listmedia, \-lm
-Output the list of available media for the system.
-.TP
-.B \-listsoftware, \-lsoft
-Output the list of known software for the system.
-.TP
-.B \-verifysoftware, \-vsoft \fR[\fIgamename\fR|\fIwildcard\fR]
-Checks for invalid or missing ROM images in your software lists.
-By default all drivers that have valid ZIP files or directories
-in the rompath are verified; however, you can limit this list by
-specifying a specific driver name or wildcard.
-.TP
-.B \-getsoftlist, \-glist
-Retrieve software list by name.
-.TP
-.B \-verifysoftlist, \-vlist \fR[\fIsoftwarelistname\fR]
-Checks a specified software list for missing ROM images if files exist
-for issued softwarelistname. By default, all drivers that have valid
-ZIP files or directories in the rompath are verified; however, you can
-limit this list by specifying a specific softwarelistname (without .XML).
-.TP
-.B \-listmidi, \-mlist
-List available MIDI I/O devices.
-.TP
-.B \-listnetwork, \-nlist
-List available network adapters.
-.\"
-.\" *******************************************************
-.SS Configuration options
-.\" *******************************************************
-.TP
-.B \-[no]readconfig, \-[no]rc
-Enables or disables the reading of the config files. When enabled
-(which is the default), MESS reads the following config files in order:
-.br
-1. \fBmess.ini\fR
-.br
-the main configuration file
-.br
-2. \fI[driver]\fB.ini\fR
-.br
-based on the source file name of the system driver
-.br
-3. \fBdebug.ini\fR, if the debugger is enabled
-.br
-4. \fBvector.ini\fR, for vector games only
-.br
-5. \fI[driver]\fB.ini\fR
-.br
-based on the source filename of the game driver
-.br
-6. \fI[parent]\fB.ini\fR
-.br
-for clones only, may be called recursively
-.br
-4. \fI[system]\fB.ini\fR
-.br
-note this sometimes resolves to the same of the source driver
-.P
-The settings in the later ini's override those in the earlier ini's.
-The default is ON (\-readconfig).
-.TP
-.B \-[no]writeconfig, \-[no]wc
-Write configuration to \fI[driver]\fR.ini on exit.
-Default is OFF (\-nowriteconfig).
-.\"
-.\" *******************************************************
-.SS Search path options
-.\" *******************************************************
-Be careful to use the path, directory and file options in
-mess.ini ONLY. Otherwise, the outcome may be unpredictable and not
-consistent across releases.
-.TP
-.B \-rompath, \-rp, \-biospath, \-bp \fIpathname
-Specifies a list of paths within which to find ROM or hard disk images.
-Multiple paths can be specified by separating them with semicolons.
-The default is 'roms' (that is, a directory 'roms' in the same directory
-as the MESS executable).
-.TP
-.B \-hashpath \fIpathname
-Specifies a list of paths within which to search for software hash files.
-Multiple paths can be specified by separating them with semicolons.
-The default is 'hash' (that is, a directory 'hash' in the same directory
-as the MESS executable).
-.TP
-.B \-samplepath, \-sp \fIpathname
-Specifies a list of paths within which to find sample files. Multiple
-paths can be specified by separating them with semicolons. The default
-is 'samples' (that is, a directory 'samples' in the same directory as
-the MESS executable).
-.TP
-.B \-artpath, \-artwork_directory \fIpathname
-Specifies a list of paths within which to find artwork files. Multiple
-paths can be specified by separating them with semicolons. The default
-is 'artwork' (that is, a directory 'artwork' in the same directory as
-the MESS executable).
-.TP
-.B \-ctrlrpath, \-ctrlr_directory \fIpathname
-Specifies a list of paths within which to find controller\-specific
-configuration files. Multiple paths can be specified by separating
-them with semicolons. The default is 'ctrlr' (that is, a
-directory 'ctrlr' in the same directory as the MESS executable).
-.TP
-.B \-inipath \fIpathname
-Specifies a list of paths within which to find .ini files. Multiple
-paths can be specified by separating them with semicolons. The default
-is '/etc/mess'.
-.TP
-.B \-fontpath \fIpathname
-Specifies a list of paths within which to find .bdf font files. Multiple
-paths can be specified by separating them with semicolons. The default
-is '.' (that is, search in the same directory as the MESS executable).
-.TP
-.B \-cheatpath \fIpathname
-Specifies a list of paths within which to find cheat files. Multiple
-paths can be specified by separating them with semicolons. The default
-is 'cheat' (that is, a directory 'cheat' in the same directory as
-the MESS executable).
-.TP
-.B \-crosshairpath \fIpathname
-Specifies a list of paths within which to find crosshair files. Multiple
-paths can be specified by separating them with semicolons. The default
-is 'crosshair' (that is, a directory 'crosshair' in the same directory as
-the MESS executable). If the Crosshair is set to default in the menu,
-MESS will look for system/cross#.png and then cross#.png in the
-specified path, where # is the player number. Failing that,
-MESS will use built\-in default crosshairs.
-.TP
-.B \-pluginspath \fIpathname
-Specifies a single path within which to find plugins. The default
-is 'plugins' (that is, a directory 'plugins' in the same directory as
-the MESS executable).
-.TP
-.B \-languagepath \fIpathname
-Specifies a single path within which to find language files. The default
-is 'language' (that is, a directory 'language' in the same directory as
-the MESS executable).
-.\"
-.\" *******************************************************
-.SS Output Directory Options
-.\" *******************************************************
-.TP
-.B \-cfg_directory \fIpathname
-Specifies a single directory where configuration files are stored.
-Configuration files store user configurable settings that are read at
-startup and written when MESS exits. The default is 'cfg' (that is,
-a directory 'cfg' in the same directory as the MESS executable). If this
-directory does not exist, it will be automatically created.
-.TP
-.B \-nvram_directory \fIpathname
-Specifies a single directory where NVRAM files are stored. NVRAM files
-store the contents of EEPROM and non\-volatile RAM (NVRAM) for systems
-which used this type of hardware. This data is read at startup and
-written when MESS exits. The default is 'nvram' (that is, a
-directory 'nvram' in the same directory as the MESS executable). If this
-directory does not exist, it will be automatically created.
-.TP
-.B \-input_directory \fIpathname
-Specifies a single directory where input recording files are stored.
-Input recordings are created via the \-record option and played back via
-the \-playback option. The default is 'inp' (that is, a directory 'inp'
-in the same directory as the MESS executable). If this directory
-does not exist, it will be automatically created.
-.TP
-.B \-state_directory \fIpathname
-Specifies a single directory where save state files are stored. Save
-state files are read and written either upon user request, or when using
-the \-autosave option. The default is 'sta' (that is, a directory 'sta'
-in the same directory as the MESS executable). If this directory does
-not exist, it will be automatically created.
-.TP
-.B \-snapshot_directory \fIpathname
-Specifies a single directory where screen snapshots are stored, when
-requested by the user. The default is 'snap' (that is, a directory 'snap'
-in the same directory as the MESS executable). If this directory
-does not exist, it will be automatically created.
-.TP
-.B \-diff_directory \fIpathname
-Specifies a single directory where hard drive differencing files are
-stored. Hard drive differencing files store any data that is written
-back to a hard disk image, in order to preserve the original image. The
-differencing files are created at startup when a system with a hard disk
-image. The default is 'diff' (that is, a directory 'diff' in the same
-directory as the MESS executable). If this directory does not exist,
-it will be automatically created.
-.TP
-.B \-comment_directory \fIpathname
-Specifies a single directory where debugger comment files are stored.
-Debugger comment files are written by the debugger when comments are
-added to the disassembly for a system. The default is 'comments' (that is,
-a directory 'comments' in the same directory as the MESS executable).
-If this directory does not exist, it will be automatically created.
-.\"
-.\" *******************************************************
-.SS State/playback options
-.\" *******************************************************
-.TP
-.B \-state \fIslot
-Immediately after starting the specified system, will cause the save
-state in the specified \fIslot\fP to be loaded.
-.TP
-.B \-[no]autosave
-When enabled, automatically creates a save state file when exiting MESS
-and automatically attempts to reload it when later starting MESS with
-the same system. This only works for systems that have explicitly enabled
-save state support in their driver. The default is OFF (\-noautosave).
-.TP
-.B \-playback, \-pb \fIfilename
-Specifies a file from which to play back a series of system inputs. This
-feature does not work reliably for all systems, but can be used to watch
-a previously recorded system session from start to finish. In order to
-make things consistent, you should only record and playback with all
-configuration (.cfg), NVRAM (.nv), and memory card files deleted. The
-default is NULL (no playback).
-.TP
-.B \-[no]exit_after_playback
-If play back is enabled (see \-playback option) the program exits when
-end of file is reached. Otherwise the machine will continue to run.
-Default is OFF (\-noexit_after_playback).
-.TP
-.B \-record, \-rec \fIfilename
-Specifies a file to record all input from a system session. This can be
-used to record a system session for later playback. This feature does not
-work reliably for all systems, but can be used to watch a previously
-recorded system session from start to finish. In order to make things
-consistent, you should only record and playback with all configuration
-(.cfg), NVRAM (.nv), and memory card files deleted. The default is NULL
-(no recording).
-.TP
-.B \-[no]record_timecode
-Specify whether 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 file is saved on inp folder.
-Default is OFF (\-norecord_timecode).
-.TP
-.B \-mngwrite \fIfilename
-Writes each video frame to the given file in MNG format, producing
-an animation of the system session.
-Note that \-mngwrite only writes video frames; it does not save any audio
-data. Use \-wavwrite for that, and reassemble the audio/video using
-offline tools. The default is NULL (no recording).
-.TP
-.B \-aviwrite \fIfilename
-Stream video and sound data to the given file
-in AVI format, producing an animation of the system session complete
-with sound. The default is NULL (no recording).
-.TP
-.B \-wavwrite \fIfilename
-Writes the final mixer output to the given file
-in WAV format, producing an audio recording of the system session.
-The default is NULL (no recording).
-.TP
-.B \-snapname \fIstring
-Describes how MESS should name files for snapshots. \fIstring\fP
-provides a template that is used to generate a filename. Three
-simple substitutions are provided: the / character represents the
-path separator on any target platform (even Windows); the literal \fB%g\fP
-represents the driver name of the current system; and the literal \fB%i\fP
-represents an incrementing index. If \fB%i\fP is omitted, then each
-snapshot taken will overwrite the previous one; otherwise, MESS will
-find the next empty value for \fB%i\fP and use that for a filename. The
-default is \fB%g/%i\fP, which creates a separate folder for each system,
-and names the snapshots under it starting with 0000 and increasing
-from there. In addition to the above, for drivers using different
-media, like carts or floppy disks, you can also use the
-\fB%d\fP\fI_[media]\fP indicator. Replace \fI[media]\fP with the media
-switch you want to use. A few examples: if you use
-.B mess nes \-cart robby \-snapname %g/%d_cart
-snapshots will be saved as \fBsnaps/nes/robby.png\fP; if you use
-.B mess c64 \-flop1 robby \-snapname %g/%d_flop1/%i
-snapshots will be saved as \fBsnaps/c64/robby/0000.png\fP.
-.TP
-.B \-snapsize \fIwidth\fRx\fIheight
-Hard\-codes the size for snapshots and movie recording. By default,
-MESS will create snapshots at the system's current resolution in raw
-pixels, and will create movies at the system's starting resolution in
-raw pixels. If you specify this option, then MESS will create both
-snapshots and movies at the size specified, and will bilinear filter
-the result. Note that this size does not automatically rotate if the
-system is vertically oriented. The default is 'auto'.
-.TP
-.B \-snapview internal\fR|\fBauto\fR|\fIviewname
-Specifies the view to use when rendering snapshots and movies. By
-default, both use a special 'internal' view, which renders a separate
-snapshot per screen or renders movies only of the first screen. By
-specifying this option, you can override this default behavior and
-select a single view that will apply to all snapshots and movies.
-Note that \fIviewname\fP does not need to be a perfect match; rather, it
-will select the first view whose name matches all the characters
-specified by \fIviewname\fP. For example, \-snapview native will match the
-"Native (15:14)" view even though it is not a perfect match.
-\fIviewname\fP can also be 'auto', which selects the first view with all
-screens present. The default value is 'internal'.
-.TP
-.B \-[no]snapbilinear
-Specify whether snapshot/movie should have bilinear filtering applied.
-Default is ON (\-snapbilinear).
-.TP
-.B \-statename \fIstring
-Describes how MESS should store save state files, relative to the
-state_directory path. \fIstring\fP provides a template that
-is used to generate a relative path. Two simple substitutions are
-provided: the / character represents the path separator on any target
-platform (even Windows); the literal \fB%g\fP represents the driver name of
-the current game. The default is '%g', which creates a separate folder
-for each game. In addition to the above, for drivers using different
-media, like carts or floppy disks, you can also use the
-\fB%d_\fP\fI[media]\fP indicator. Replace \fI[media]\fP with the media
-switch you want to use. A few examples: if you use
-.B mess nes \-cart robby \-statename %g/%d_cart
-save states will be stored inside \fBsta/nes/robby/\fP; if you use
-.B mess c64 \-flop1 robby \-statename %g/%d_flop1
-save states will be stored inside \fBsta/c64/robby/\fP.
-.TP
-.B \-[no]burnin
-Tracks brightness of the screen during play and at the end of
-emulation generates a PNG that can be used to simulate burn\-in
-effects on other systems. The resulting PNG is created such that the
-least\-used areas of the screen are fully white (since burned\-in areas
-are darker, all other areas of the screen must be lightened a touch).
-The intention is that this PNG can be loaded via an artwork file with
-a low alpha (e.g, 0.1\-0.2 seems to work well) and blended over the
-entire screen. The PNG files are saved in the snap directory under
-the system/burnin\-<screen.name>.png. The default is OFF (\-noburnin).
-.\"
-.\" *******************************************************
-.SS Performance options
-.\" *******************************************************
-.TP
-.B \-[no]autoframeskip, \-[no]afs
-Automatically determines the frameskip level while you're playing the
-system, adjusting it constantly in a frantic attempt to keep the system
-running at full speed. Turning this on overrides the value you have set
-for \-frameskip below. The default is OFF (\-noautoframeskip).
-.TP
-.B \-frameskip, \-fs \fIvalue
-Specifies the frameskip value (autoframeskip must be disabled). This is the
-number of frames out of every 12 to drop when running. For example, if you
-say \-frameskip 2, then MESS will display 10 out of every 12 frames. By
-skipping those frames, you may be able to get full speed in a system that
-requires more horsepower than your computer has. The default value is 0,
-which skips no frames.
-.TP
-.B \-seconds_to_run, \-str \fIvalue
-This option can be used for benchmarking and automated testing. It tells
-MESS to stop execution after a fixed number of seconds. By combining
-this with a fixed set of other command line options, you can set up a
-consistent environment for benchmarking MESS performance. In addition,
-upon exit, the \-str option will write a screenshot called final.png
-to the system's snapshot directory.
-.TP
-.B \-[no]throttle
-Configures the default thottling setting. When throttling is on, MESS
-attempts to keep the system running at the system's intended speed. When
-throttling is off, MESS runs the system as fast as it can. Note that the
-fastest speed is more often than not limited by your graphics card,
-especially for older systems. The default is ON (\-throttle).
-.TP
-.B \-[no]sleep
-Allows MESS to give time back to the system when running with \-throttle.
-This allows other programs to have some CPU time, assuming that the
-system isn't taxing 100% of your CPU resources. This option can potentially
-cause hiccups in performance if other demanding programs are running.
-The default is ON (\-sleep).
-.TP
-.B \-speed \fIvalue
-Controls the speed of gameplay, relative to realtime; smaller numbers are
-slower. Default is 1.00.
-.TP
-.B \-[no]refreshspeed, \-[no]rs
-Automatically adjusts the \fB\-speed\fR parameter to keep the effective refresh
-rate below that of the lowest screen refresh rate.
-Default is OFF (\-norefreshspeed).
-.\"
-.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
-.\" OS specific
-.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
-.TP
-.B \-numprocessors, \-np \fIvalue
-Set number of processors; this overrides the number the system reports.
-.TP
-.B \-bench \fIvalue
-Benchmark for the given number of emulated seconds;
-implies \-video none \-sound none \-nothrottle.
-.\"
-.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
-.\" SDL specific
-.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
-.TP
-.B \-[no]sdlvideofps
-Show SDL video performance. Default is OFF (\-nosdlvideofps).
-.\"
-.\" *******************************************************
-.SS Rotation options
-.\" *******************************************************
-.TP
-.B \-[no]rotate
-Rotate the system to match its normal state (horizontal/vertical). This
-ensures that both vertically and horizontally oriented systems show up
-correctly without the need to rotate your monitor. If you want to keep
-the system displaying 'raw' on the screen the way the actual machine would
-have, turn this option off. The default is ON (\-rotate).
-.TP
-.B \-[no]ror \-[no]rol
-Rotate the system screen to the right (clockwise) or left
-(counter\-clockwise) relative to either its normal state (if \-rotate
-is specified) or its native state (if \-norotate is specified).
-Default for both is OFF (\-noror \-norol).
-.TP
-.B \-[no]autoror \-[no]autorol
-These options are designed for use with pivoting screens that only
-pivot in a single direction. If your screen only pivots clockwise,
-use \-autorol to ensure that the system will fill the screen either
-horizontally or vertically in one of the directions you can handle.
-If your screen only pivots counter\-clockwise, use \-autoror.
-Default for both is OFF (\-noautoror \-noautorol).
-.TP
-.B \-[no]flipx \-[no]flipy
-Flip (mirror) the system screen either horizontally (\-flipx) or
-vertically (\-flipy). The flips are applied after the \-rotate and
-\-ror/\-rol options are applied.
-Default for both is OFF (\-noflipx \-noflipy).
-.\"
-.\" *******************************************************
-.SS Artwork options
-.\" *******************************************************
-.TP
-.B \-[no]artwork_crop, \-[no]artcrop
-Enable cropping of artwork to the system screen area only. This
-option can also be controlled via the Video Options menu in the user
-interface. The default is OFF (\-noartwork_crop).
-.TP
-.B \-[no]use_backdrops, \-[no]backdrop
-Enables/disables the display of backdrops. The default is ON
-(\-use_backdrops).
-.TP
-.B \-[no]use_overlays, \-[no]overlay
-Enables/disables the display of overlays. The default is ON
-(\-use_overlays).
-.TP
-.B \-[no]use_bezels, \-[no]bezel
-Enables/disables the display of bezels. The default is ON
-(\-use_bezels).
-.TP
-.B \-[no]use_cpanels, \-[no]cpanel
-Enables/disables the display of cpanels. The default is ON
-(\-use_bezels).
-.TP
-.B \-[no]use_marquees, \-[no]marquee
-Enables/disables the display of marquees. The default is ON
-(\-use_bezels).
-.\"
-.\" *******************************************************
-.SS Screen options
-.\" *******************************************************
-.TP
-.B \-brightness \fIvalue
-Controls the default brightness, or black level, of the system screens.
-This option does not affect the artwork or other parts of the display.
-Using the MESS UI, you can individually set the brightness for each system
-screen; this option controls the initial value for all visible system
-screens. The standard value is 1.0. Selecting lower values (down to 0.1)
-will produce a darkened display, while selecting higher values (up to
-2.0) will give a brighter display. The default is 1.0.
-.TP
-.B \-contrast \fIvalue
-Controls the contrast, or white level, of the system screens. This option
-does not affect the artwork or other parts of the display. Using the
-MESS UI, you can individually set the contrast for each system screen;
-this option controls the initial value for all visible system screens. The
-standard value is 1.0. Selecting lower values (down to 0.1) will produce
-a dimmer display, while selecting higher values (up to 2.0) will
-give a more saturated display. The default is 1.0.
-.TP
-.B \-gamma \fIvalue
-Controls the gamma, which produces a potentially nonlinear black to
-white ramp, for the system screens. This option does not affect the
-artwork or other parts of the display. Using the MESS UI, you can
-individually set the gamma for each system screen; this option controls
-the initial value for all visible system screens. The standard value is
-1.0, which gives a linear ramp from black to white. Selecting lower
-values (down to 0.1) will increase the nonlinearity toward black,
-while selecting higher values (up to 3.0) will push the nonlinearity
-toward white. The default is 1.0.
-.TP
-.B \-pause_brightness \fIvalue
-This controls the brightness level when MESS is paused. The default
-value is 0.65.
-.TP
-.B \-effect\fR [\fInone\fR|\fIfilename[.png]\fR]
-Name of a PNG file to use for visual effects, or 'none'. Default is 'none'.
-.\"
-.\" *******************************************************
-.SS Vector rendering options
-.\" *******************************************************
-.TP
-.B \-beam_width_min \fIvalue
-.TP
-.B \-beam_width_max \fIvalue
-Sets the minimum and maximum width of the vectors. This is a scaling factor
-against the standard vector width, which is interpolated between minimum and
-maximum according to the beam's intensity. A value of 1.0 will keep the
-default vector line width. Smaller values will reduce the width, and larger
-values will increase the width. The default is 1.0.
-.TP
-.B \-beam_intensity_weight \fIvalue
-Applies an exponential weight to the minimum and maximum beam width. For
-positive values the interpolated scaling factor will affect lines with higher
-intensity more than lines with lower intensity. The default is 0.0.
-.TP
-.B \-flicker \fIvalue
-Simulates a vector "flicker" effect, similar to a vector monitor that
-needs adjustment. This option requires a float argument in the range of
-0.00\-100.00 (0=none, 100=maximum). The default is 0.
-.\"
-.\" *******************************************************
-.SS Video options
-.\" *******************************************************
-.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
-.\" SDL specific
-.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
-.TP
-.B \-video\fR [\fIsoft\fR|\fIopengl\fR|\fIbgfx\fR|\fInone\fR]
-Specifies which video subsystem to use for drawing:
-.br
-\fBsoft\fR uses software rendering, which is slower but more compatible.
-.br
-\fBopengl\fR uses OpenGL and your graphics accelerator to speed up many
-aspects of drawing MAME including compositing artwork, overlays, and
-bezels, as well as stretching the image to fit your screen.
-.br
-\fBbgfx\fR uses the bgfx renderer which supports portable shaders and
-multiple graphics APIs including OpenGL, OpenGL ES and DirectX.
-.br
-\fBnone\fR does no drawing and is intended for CPU benchmarking.
-.br
-Default is 'soft' on Linux or 'opengl' on macOS.
-.TP
-.B \-numscreens \fR[\fI1-4\fR]
-Number of screens to create; usually, you want just one. Default is '1'.
-.TP
-.B \-[no]window, \-[no]w
-Run MESS in either full screen or a window. This is a fully\-featured window
-mode where the window resizes as necessary to track what the system does.
-And you can resize it yourself with your OS's standard window controls.
-The default is OFF (\-nowindow).
-.TP
-.B \-[no]maximize, \-[no]max
-Controls initial window size in windowed mode. If it is set on, the
-window will initially be set to the maximum supported size when you
-start MESS. If it is turned off, the window will start out at the
-smallest supported size. This option only has an effect when the
-\-window option is used. The default is ON (\-maximize).
-.TP
-.B \-[no]keepaspect, \-[no]ka
-Forces the correct aspect ratio. This means when you're resizing the window
-in windowed mode the actual system image will resize in discrete steps to
-maintain the proper shape of the system graphics. If you turn this off you can
-resize the window to anything you like and get funny squishing and stretching.
-The same applies for full\-screen. Default is ON (\-keepaspect).
-.TP
-.B \-[no]unevenstretch, \-[no]ues
-Allow non\-integer stretch factors. Video purists should stay far, far away
-from this option, while everyone else will be happy to know that it lets you
-fill the screen properly in full\-screen mode. Default is ON (\-unevenstretch).
-.TP
-.B \-[no]unevenstretchx, \-[no]uesx
-Act as \-[no]unevenstretch on horizontal basis only.
-.TP
-.B \-[no]intoverscan, \-[no]ios
-Allow overscan on integer scaled targets.
-.TP
-.B \-intscalex, \-sx
-Set horizontal integer scale factor.
-.TP
-.B \-intscaley, \-sy
-Set vertical integer scale factor.
-.TP
-.B \-[no]centerh
-Center horizontally within the view area. Default is ON (\-centerh).
-.TP
-.B \-[no]centerv
-Center vertically within the view area. Default is ON (\-centerv).
-.TP
-.B \-[no]waitvsync, \-[no]vs
-Enable waiting for the start of VBLANK before flipping screens;
-reduces tearing effects. Default is OFF (\-nowaitvsync).
-.TP
-.B \-[no]syncrefresh, \-[no]srf
-Enable using the start of VBLANK for throttling instead of the game time.
-Default is OFF (\-nosyncrefresh).
-.\"
-.\" *******************************************************
-.SS Software video rendering subsystem options
-.\" *******************************************************
-.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
-.\" SDL specific
-.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
-.B NOTE:
-All the options in this group are available only with softare video
-rendering subsystem, i.e \fB\-video soft\fR.
-.TP
-.B \-prescale\fR [\fIvalue\fR]
-Scale screen rendering by this amount in software. Default is 1.
-.TP
-.B \-scalemode, \-sm \fR[\fInone\fR|\fIasync\fR|\fIyv12\fR|\fIyuy2\fR|\fIyv12x2\fR|\fIyuy2x2\fR]
-Hardware scaling mode.
-.br
-\fBnone\fR use software rendering.
-.br
-\fBasync\fR async overlay.
-.br
-\fByv12\fR yv12 overlay.
-.br
-\fByuy2\fR yuy2 overlay.
-.br
-\fByv12x2\fR yv12 overlay using x2 prescaling.
-.br
-\fByuy2x2\fR yuy2 overlay using x2 prescaling.
-.br
-Default is NONE.
-.\"
-.\" *******************************************************
-.SS OpenGL video rendering subsystem options
-.\" *******************************************************
-.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
-.\" SDL specific
-.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
-.B NOTE:
-All the options in this group are available only with OpenGL video
-rendering subsystem, i.e \fB\-video opengl\fR.
-.TP
-.B \-[no]filter, \-[no]glfilter, \-[no]flt
-Enable bilinear filtering on screen output. Default is ON (\-filter).
-.TP
-.B \-prescale\fR [\fIvalue\fR]
-Scale screen rendering by this amount in software. Default is 1.
-.TP
-.B \-[no]gl_forcepow2texture
-Force power of two textures. Default is OFF (\-nogl_forcepow2texture).
-.TP
-.B \-[no]gl_notexturerect
-Don't use OpenGL GL_ARB_texture_rectangle. Turn off if
-corruption occurs in OpenGL mode, at cost of some performance
-loss. Default is ON (\-gl_notexturerect).
-.TP
-.B \-[no]gl_vbo
-Enable OpenGL VBO, if available, for a performance increase.
-Turn off if corruption occurs. Default is ON (\-gl_vbo).
-.TP
-.B \-[no]gl_pbo
-Enable OpenGL PBO, if available, for a performance increase.
-Turn off if corruption occurs. Default is ON (\-gl_pbo).
-.TP
-.B \-[no]gl_glsl
-Enable OpenGL GLSL, if available, for a performance increase.
-Default is OFF (\-nogl_glsl).
-.TP
-.B \-gl_glsl_filter \fIvalue
-Enable OpenGL GLSL filtering instead of FF filtering 0=plain, 1=bilinear.
-Default is 1: bilinear.
-.TP
-.BR \-glsl_shader_mame[0\-9]
-Preferred custom OpenGL GLSL shader set mame bitmap (from 0 to 9).
-.TP
-.BR \-glsl_shader_screen[0\-9]
-Preferred custom OpenGL GLSL shader screen bitmap (from 0 to 9).
-.TP
-.B \-gl_glsl_vid_attr
-Enable OpenGL GLSL handling of brightness and contrast. Better RGB system
-performance for free. Default is ON.
-.TP
-.B \-screen
-Explicit name for all screens; 'auto' here will try to make a best guess.
-.TP
-.B \-aspect, \-screen_aspect
-Aspect ratio for all screens; 'auto' here will try to make a best guess.
-.TP
-.B \-resolution, \-r
-Preferred resolution for all screens;
-format is \fIwidth\fRx\fIheight\fR[@\fIrefreshrate\fR] or 'auto'.
-.TP
-.B \-view
-Preferred view for all screens
-.TP
-.B \-screen[0\-3]
-Explicit name of the first|second|third|fourth screen; 'auto' here will try
-to make a best guess.
-.TP
-.B \-aspect[0\-3]
-Aspect ratio of the first|second|third|fourth screen; 'auto' here will try
-to make a best guess.
-.TP
-.B \-resolution[0\-3], \-r[0\-3]
-Preferred resolution for the first|second|third|fourth screen;
-format is \fIwidth\fRx\fIheight\fR[@\fIrefreshrate\fR] or 'auto'.
-.TP
-.B \-view[0\-3]
-Preferred view for the first|second|third|fourth screen.
-.\"
-.\" *******************************************************
-.SS BGFX post\-processing options
-.\" *******************************************************
-.B NOTE:
-All the options in this group are available only when BGFX video
-post\-processing is enabled, i.e \fB\-video bgfx\fR. For full info on BGFX
-please visit official MAME documentation page:
-.br
-http://docs.mamedev.org/advanced/bgfx.html
-.TP
-.B \-bgfx_path \fIpathname
-This is where your BGFX shader files are stored.
-The default is 'bgfx' (that is, a directory "bgfx" in the same directory
-as the MESS executable).
-.TP
-.B \-bgfx_backend \fIauto\fR|\fIopengl\fR
-Selects a rendering backend for BGFX to use. The default is 'auto',
-which will let MESS choose the best selection for you.
-.TP
-.B \-bgfx_debug
-Enables BGFX debugging features. Most users will not need to use this.
-.TP
-.B \-bgfx_screen_chains \fIdefault\fR|\fIunfiltered\fR|\fIhlsl\fR[,...]
-This dictates how to handle BGFX rendering on a per\-display basis.
-For each display specify one of the possible choices:
-.br
-\fBdefault\fR default bilinear filterered output
-.br
-\fBunfiltered\fR nearest neighbor unfiltered output
-.br
-\fBhlsl\fR HLSL display simulation through shaders
-.br
-Separate directives for each window with a comma (,) and for each physical
-screen with a colon (:). For example, for an emulated game with 3 displays
-emulated on 3 windows on your monitor,
-.B \-bgfx_screen_chains default,unfiltered,default
-specifies to apply default filter on what is been rendered on the first
-and third window and leave the content of the second window unfiltered.
-.TP
-.B \-bgfx_shadow_mask \fIfilename
-This specifies the shadow mask effect PNG file. Default is 'slot-mask.png'.
-.TP
-.B \-bgfx_avi_name \fIfilename
-This specifies a filename for BGFX output logging.
-.\"
-.\" *******************************************************
-.SS Full screen options
-.\" *******************************************************
-.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
-.\" SDL specific
-.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
-.TP
-.B \-[no]switchres
-Affects full screen mode only. Chooses if MESS can try to change the screen
-resolution (color depth is normally left alone) when in full\-screen mode. If
-it's off, you always get your desktop resolution in full\-screen mode (which can
-be useful for LCDs). Default is OFF (\-noswitchres).
-.TP
-.B \-[no]useallheads
-Split full screen image across monitors. Default is OFF (\-nouseallhead).
-.\"
-.\" *******************************************************
-.SS Sound options
-.\" *******************************************************
-.TP
-.B \-sound\fR [\fIsdl\fR|\fIportaudio\fR|\fIcoreaudio\fR|\fIdsound\fR|\fIxaudio2\fR|\fInone\fR]
-Specifies which sound subsystem to use for audio output:
-.br
-\fBsdl\fR uses the Simple DirectMedia Layer audio output system
-(not available on Windows by default).
-.br
-\fBportaudio\fR uses the PortAudio library which supports low-latency
-output and multiple audio APIs.
-.br
-\fBcoreaudio\fR uses the Core Audio API which supports low-latency
-output and AudioUnit effects (only available on macOS).
-.br
-\fBdsound\fR uses the DirectSound API (only available on Windows).
-.br
-\fBxaudio2\fR uses the XAudio2 API which supports low-latency output
-(only available on Windows).
-.br
-\fBnone\fR produces no audio output.
-.br
-Default is 'dsound' on Windows, 'coreaudio' on macOS or 'sdl' on other
-platforms.
-.TP
-.B \-samplerate, \-sr \fIvalue
-Sets the audio sample rate. Smaller values (e.g. 11025) cause lower
-audio quality but faster emulation speed. Higher values (e.g. 48000)
-cause higher audio quality but slower emulation speed. The default is
-48000.
-.TP
-.B \-[no]samples
-Use samples if available. The default is ON (\-samples).
-.TP
-.B \-[no]compressor
-Enable audio compressor. It temporarily reduces the overall volume when
-the audio output is overdriven. The default is ON (\-compressor).
-.TP
-.B \-volume, \-vol \fIvalue
-Sets the startup volume. It can later be changed with the user interface
-(see Keys section). The volume is an attenuation in dB:
-for example, '\-volume \-12' will start with \-12dB attenuation.
-The default is 0.
-.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
-.\" SDL specific
-.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
-.TP
-.B \-audio_latency \fIvalue
-This controls the amount of latency built into the audio streaming.
-The exact behavior depends on the selected audio output module (see
-the \-sound option). Smaller values provide less audio delay while
-requiring better system performance. Higher values increase audio
-delay but may help avoid buffer under-runs and audio interruptions.
-The default is 1.
-.\"
-.\" *******************************************************
-.SS Input options
-.\" *******************************************************
-.TP
-.B \-[no]coin_lockout, \-[no]coinlock
-Enables simulation of the "coin lockout" feature that is implemented
-on a number of arcade game PCBs. It was up to the operator whether or not
-the coin lockout outputs were actually connected to the coin
-mechanisms. If this feature is enabled, then attempts to enter a coin
-while the lockout is active will fail and will display a popup message
-in the user interface. If this feature is disabled, the coin lockout
-signal will be ignored. The default is ON (\-coin_lockout).
-.TP
-.B \-ctrlr \fIcontroller
-Enables support for special controllers. Configuration files are
-loaded from the ctrlrpath. They are in the same format as the .cfg
-files that are saved, but only control configuration data is read
-from the file. The default is NULL (no controller file).
-.TP
-.B \-[no]mouse
-Controls whether or not MESS looks for a mouse controller to use. Note
-that in many cases, lightguns are treated as mice by the operating
-system, so you may need to enable this to enable lightgun support. When
-this is enabled, you will not be able to use your mouse while running
-MESS. If you want to get control of your computer back, you will need
-to either pause MESS or quit. The default is OFF (\-nomouse).
-.TP
-.B \-[no]joystick, \-[no]joy
-Controls whether or not MESS looks for joystick/gamepad controllers.
-The default is ON (\-joystick).
-.TP
-.B \-[no]lightgun, \-[no]gun
-Controls whether or not MESS makes use of lightgun controllers.
-Note that most lightguns map to the mouse, so using \-lightgun and
-\-mouse together may produce strange results. The default is OFF
-(\-nolightgun).
-.TP
-.B \-[no]multikeyboard, \-[no]multikey
-Determines whether MESS differentiates between multiple keyboards.
-Some systems may report more than one keyboard; by default, the data
-from all of these keyboards is combined so that it looks like a single
-keyboard. Turning this option on will enable MESS to report keypresses
-on different keyboards independently. The default is OFF
-(\-nomultikeyboard).
-.TP
-.B \-[no]multimouse
-Determines whether MESS differentiates between multiple mice. Some
-systems may report more than one mouse device; by default, the data
-from all of these mice is combined so that it looks like a single
-mouse. Turning this option on will enable MESS to report mouse
-movement and button presses on different mice independently. The
-default is OFF (\-nomultimouse).
-.TP
-.B \-[no]steadykey, \-[no]steady
-Some systems require two or more buttons to be pressed at exactly the
-same time to make special moves. Due to limitations in the PC keyboard
-hardware, it can be difficult or even impossible to accomplish that
-using the standard keyboard handling. This option selects a different
-handling that makes it easier to register simultaneous button presses,
-but has the disadvantage of making controls less responsive. The
-default is OFF (\-nosteadykey).
-.TP
-.B \-[no]ui_active
-Enable MESS user interface on top of emulated keyboard (if present).
-User interface may be toggled during execution by pressing the key
-defined with \-ui_modekey.
-Default is OFF (\-noui_active).
-.TP
-.B \-[no]offscreen_reload, \-[no]reload
-Controls whether or not MESS treats a second button input from a
-lightgun as a reload signal. In this case, MESS will report the gun's
-position as (0,MAX) with the trigger held, which is equivalent to an
-offscreen reload. This is only needed for systems that required you to
-shoot offscreen to reload, and then only if your gun does not support
-off screen reloads. The default is OFF (\-nooffscreen_reload).
-.TP
-.B \-joystick_map, \-joymap \fImap
-Controls how joystick values map to digital joystick controls.
-See /usr/share/doc/mame\-common/config.txt for full details on
-joymap format.
-.TP
-.B \-joystick_deadzone, \-joy_deadzone, \-jdz \fIvalue
-If you play with an analog joystick, the center can drift a little.
-joystick_deadzone tells how far along an axis you must move before the
-axis starts to change. This option expects a float in the range of
-0.0 to 1.0. Where 0 is the center of the joystick and 1 is the outer
-limit. The default is 0.3.
-.TP
-.B \-joystick_saturation, \-joy_saturation, \-jsat \fIvalue
-If you play with an analog joystick, the ends can drift a little,
-and may not match in the +/\- directions. joystick_saturation tells how
-far along an axis movement change will be accepted before it reaches
-the maximum range. This option expects a float in the range of 0.0 to
-1.0, where 0 is the center of the joystick and 1 is the outer limit.
-The default is 0.85.
-.TP
-.B \-[no]natural, \-[no]nat
-Allows user to specify whether or not to use a natural keyboard.
-This allows you to start your game or system in a 'native' mode, depending
-on your region, allowing compatibility for non\-"QWERTY" style keyboards.
-The default is OFF (\-nonatural).
-.TP
-.B \-[no]joystick_contradictory, \-[no]joy_contradictory
-Enable contradictory direction digital joystick input at the same time.
-Default is OFF (\-nojoystick_contradictory).
-.TP
-.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
-.\" SDL specific
-.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
-.TP
-.B \-uimodekey, \-umk \fIvalue
-Specifies the key used to toggle between full and partial UI mode.
-.TP
-.B \-uifontprovider \fIauto\fR|\fIsdl\fR|\fInone
-Provider for ui font.
-.TP
-.B \-output \fIconsole\fR|\fInetwork\fR|\fInone
-Provider for output.
-.TP
-.B \-keyboardprovider \fIauto\fR|\fIsdl\fR|\fInone
-Provider for keyboard input.
-.TP
-.B \-mouseprovider \fIauto\fR|\fIsdl\fR|\fInone
-Provider for mouse input.
-.TP
-.B \-lightgunprovider \fIauto\fR|\fInone
-Provider for lightgun input.
-.TP
-.B \-joystickprovider \fIauto\fR|\fIsdl\fR|\fInone
-Provider for joystick input.
-.TP
-.B \-[no]keymap
-Enable keymap for non\-QWERTY keyboards. Used in conjunction with
-\fB\-keymap_file\fR. Default is OFF (\-nokeymap).
-.TP
-.B \-keymap_file \fIkeymap_file
-Specifies the full path to the keymap file to be used. A few
-keymap files are available in /usr/share/games/mess/keymaps.
-.TP
-.B \-joy_idx[0\-8] \fIjoystick
-With these options you can assign a joystick to a
-specific index in MESS. Even if the kernel will list the joysticks
-in a different order on the next boot, MESS will still see the joystick
-as e.g. "Joystick 2". Use mame \-v to see which joysticks are recognized.
-Default is 'auto'.
-.TP
-.B \-[no]sixaxis
-Use special handling for PS3 Sixaxis controllers.
-Default is OFF (\-nosixaxis).
-.TP
-.B \-lightgun_index[1\-8]
-Map lightgun to specific index in MESS.
-.TP
-.B \-videodriver, \-vd x11\fR|\fBdirectfb\fR|\fBauto
-SDL video driver to use; auto selects SDL default.
-.TP
-.B \-audiodriver, \-ad alsa\fR|\fBarts\fR|\fBauto
-SDL audio driver to use; auto selects SDL default.
-.TP
-.B \-gl_lib alsa\fR|\fBarts\fR|\fBauto
-Alternative libGL.so to use; auto selects SDL default.
-.\"
-.\" *******************************************************
-.SS Input automatic enable options
-.\" *******************************************************
-.TP
-.B \-paddle_device, \-paddle \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR]
-.TP
-.B \-adstick_device, \-adstick \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR]
-.TP
-.B \-pedal_device, \-pedal \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR]
-.TP
-.B \-dial_device, \-dial \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR]
-.TP
-.B \-trackball_device, \-trackball \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR]
-.TP
-.B \-lightgun_device \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR]
-.TP
-.B \-positional_device \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR]
-.TP
-.B \-mouse_device \fR[\fInone\fR|\fIkeyboard\fR|\fImouse\fR|\fIlightgun\fR|\fIjoystick\fR]
-Each of these options controls automatically enabling the mouse, or
-joystick depending on the presence of a particular class of analog
-control for a particular system. For example, if you specify the option
-\-paddle mouse, then any system that has a paddle control will automatically
-enable mouse controls just as if you had explicitly specified \-mouse.
-Note that these controls override the values of \-[no]mouse, \-[no]joystick, etc.
-.\"
-.\" *******************************************************
-.SS Debugging options
-.\" *******************************************************
-.TP
-.B \-[no]log
-Creates a file called error.log which contains all of the internal
-log messages generated by the MESS core and system drivers. The default
-is OFF (\-nolog).
-.TP
-.B \-[no]verbose, \-[no]v
-Displays internal diagnostic information. This information is very
-useful for debugging problems with your configuration.
-Please use the \-verbose option and include the resulting information
-when reporting bugs. The default is OFF (\-noverbose).
-.TP
-.B \-[no]update_in_pause
-Enables updating the screen bitmap while the system is paused. This is
-useful for debuggin in some scenarios (and gets in the way in others).
-Default is OFF (\-noupdate_in_pause).
-.TP
-.B \-[no]debug, \-[no]d
-Activates the integrated debugger. By default, the debugger is entered
-by pressing the tilde (~) key during emulation. It is also entered
-immediately at startup. The default is OFF (\-nodebug).
-.TP
-.B \-debugscript \fIfilename
-Specifies a file that contains a list of debugger commands to execute
-immediately upon startup. The default is NULL (no commands).
-.\"
-.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
-.\" SDL specific
-.\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++
-.TP
-.B \-debugger \fIdebugger_name
-Name of the debugger to use. Default is AUTO.
-.TP
-.B \-debugger_font, \-dfont \fIfont_name
-Specifies the font to use for debugging. Default is AUTO.
-.TP
-.B \-debugger_font_size, \-dfontsize \fIsize
-Specifies the font size to use for debugging.
-.TP
-.B \-[no]oslog
-Outputs the error.log data to the system debugger. This can be used at
-the same time as \-log to output the log data to both targets as well.
-Default is OFF (\-nooslog).
-.\"
-.\" *******************************************************
-.SS Misc options
-.\" *******************************************************
-.TP
-.B \-[no]drc
-Enable DRC cpu core if available. Default is ON (\-drc).
-.TP
-.B \-[no]drc_use_c
-Force DRC use C backend. Default is OFF (\-nodrc_use_c).
-.TP
-.B \-[no]drc_log_uml
-Write DRC UML disassembly log. Default is OFF (\-nodrc_log_uml).
-.TP
-.B \-[no]drc_log_native
-Write DRC native disassembly log. Default is OFF (\-no_drc_log_native).
-.TP
-.B \-bios \fIbiosname
-Specifies the specific BIOS to use with the current system, for
-systems that make use of a BIOS. The \-listxml output will list all of
-the possible BIOS names for a system. The default is 'default'.
-.TP
-.B \-[no]cheat, \-[no]c
-Activates the cheat menu with autofire options and other tricks from
-the cheat database, if present.
-The default is OFF (\-nocheat).
-.TP
-.B \-[no]skip_gameinfo
-Forces MESS to skip displaying the system info screen. The default is OFF
-(\-noskip_gameinfo).
-.TP
-.B \-uifont \fIfontname
-Specifies the name of a BDF font file to use for the UI font. If this
-font cannot be found or cannot be loaded, the system will fall back
-to its built\-in UI font. On some platforms \fIfontname\fP can be a system
-font name instead of a BDF font file. The default is 'default' (use
-the OSD\-determined default font).
-.TP
-.B \-ui \fIsimple\fR|\fIcabinet
-Type of UI.
-.TP
-.B \-ramsize, \-ram \fIvalue
-Size of RAM (if supported by driver).
-.TP
-.B \-[no]confirm_quit
-Display confirm quit screen on exit. Default is ON (\-confirm_quit).
-.TP
-.B \-[no]ui_mouse
-Display UI mouse cursor. Default is OFF (\-noui_mouse).
-.TP
-.B \-autoboot_command, \-ab \fIcommand
-Command string to execute after machine boot (in quotes ""). To issue
-a quote to the emulation, use \fB"""\fP in the string.
-Using \fB\\n\fP will issue a create a new line, issuing what was
-typed prior as a command. Example:
-\fB\-autoboot_command "load """$""",8,1\\n"\fP.
-.TP
-.B \-autoboot_delay \fR[\fIvalue\fP]
-Timer delay (in seconds) to trigger command execution on autoboot.
-Default is 2.
-.TP
-.B \-autoboot_script, \-script \fR[\fIfilename.lua\fP]
-File containing scripting to execute after machine boot.
-.TP
-.B \-[no]http
-Enable local http server. Default is OFF (\-nohttp).
-.TP
-.B \-http_port \fIport
-Internal webserver listener port.
-.TP
-.B \-http_path \fIpath
-Path to web files. Default is /usr/share/games/mess/web.
-.TP
-.B \-[no]console
-Enable emulator LUA console. Default is OFF (\-noconsole).
-.TP
-.B \-[no]plugins
-Enable LUA plugin support. Default is ON (\-plugins).
-.TP
-.B \-plugin \fIvalue
-List of plugins to enable.
-.TP
-.B \-noplugin \fIvalue
-List of plugins to disable.
-.TP
-.B \-language, \-lang \fIvalue
-Display language. Default is 'English'.
-.TP
-.B \-newui, \-nu
-Use the new MESS UI.
-.TP
-.B \-watchdog \fIvalue
-Specifies a number of seconds after which MESS should automatically exit
-if it detects that the emulation has locked up.
-.\"
-.\"
-.\" SEE ALSO chapter
-.SH SEE ALSO
-castool(1), chdman(1), floptool(1), imgtool(1)
-.\"
-.\"
-.\" LEGAL NOTICE chapter
-.SH LEGAL NOTICE
-Please visit the MAME website for some important legal information:
-.PP
-http://mamedev.org/legal.html
diff --git a/docs/man/romcmp.1 b/docs/man/romcmp.1
index a3de1153d6f..3430f7ab18e 100644
--- a/docs/man/romcmp.1
+++ b/docs/man/romcmp.1
@@ -38,6 +38,9 @@ ROM set is a clone of another ROM set.
.TP
.B \-d
Enables a slower, more comprehensive comparison.
+.TP
+.B \-h
+Prints hashes (CRC-32, SHA-1) and 16-bit sums for all files.
.\"
.\" EXAMPLES chapter
.SH EXAMPLES
diff --git a/docs/source/advanced/bgfx.rst b/docs/source/advanced/bgfx.rst
index 06b35521ace..bb6e4205fa3 100644
--- a/docs/source/advanced/bgfx.rst
+++ b/docs/source/advanced/bgfx.rst
@@ -1,121 +1,218 @@
BGFX Effects for (nearly) Everyone
==================================
-By default, MAME outputs an idealized version of the video as it would be on the way to the arcade cabinet's monitor, with minimal modification of the output (primarily to stretch the game image back to the aspect ratio the monitor would traditionally have, usually 4:3) -- this works well, but misses some of the nostalgia factor. Arcade monitors were never ideal, even in perfect condition, and the nature of a CRT display distorts that image in ways that change the appearance significantly.
+.. contents:: :local:
-Modern LCD monitors simply do not look the same, and even computer CRT monitors cannot match the look of an arcade monitor without help.
-That's where the new BGFX renderer with HLSL comes into the picture.
+Introduction
+------------
-HLSL simulates most of the effects that a CRT arcade monitor has on the video, making the result look a lot more authentic. However, HLSL requires some effort on the user's part: the settings you use are going to be tailored to your PC's system specs, and especially the monitor you're using. Additionally, there were hundreds of thousands of monitors out there in arcades. Each was tuned and maintained differently, meaning there is no one correct appearance to judge by either. Basic guidelines will be provided here to help you, but you may also wish to ask for opinions on popular MAME-centric forums.
+By default, MAME outputs an idealized version of the video as it would be on the
+way to the arcade cabinet’s monitor, with minimal modification of the output
+(primarily to stretch the game image back to the aspect ratio the monitor would
+traditionally have, usually 4:3). This works well, but misses some of the
+nostalgia factor. Arcade monitors were never ideal, even in perfect condition,
+and the nature of a CRT display distorts that image in ways that change the
+appearance significantly.
+
+Modern LCD monitors simply do not look the same, and even computer CRT monitors
+cannot match the look of an arcade monitor without help.
+
+That’s where the new BGFX renderer with HLSL comes into the picture.
+
+HLSL simulates most of the effects that a CRT arcade monitor has on the video,
+making the result look a lot more authentic. However, HLSL requires some effort
+on the user’s part: the settings you use are going to be tailored to your PC’s
+system specs, and especially the monitor you’re using. Additionally, there were
+hundreds of thousands of monitors out there in arcades. Each was tuned and
+maintained differently, meaning there is no one correct appearance to judge by
+either. Basic guidelines will be provided here to help you, but you may also
+wish to ask for opinions on popular MAME-centric forums.
Resolution and Aspect Ratio
---------------------------
-Resolution is a very important subject for HLSL settings. You will want MAME to be using the native resolution of your monitor to avoid additional distortion and lag created by your monitor upscaling the display image.
+Resolution is a very important subject for HLSL settings. You will want MAME to
+be using the native resolution of your monitor to avoid additional distortion
+and lag caused by your monitor upscaling the display image.
-While most arcade machines used a 4:3 ratio display (or 3:4 for vertically oriented monitors like Pac-Man), it's difficult to find a consumer display that is 4:3 at this point. The good news is that that extra space on the sides isn't wasted. Many arcade cabinets used bezel artwork around the main display, and should you have the necessary artwork files, MAME will display that artwork. Turn the artwork view to Cropped for best results.
+While most arcade machines used a 4:3 ratio display (or 3:4 for vertically
+oriented monitors like Pac-Man), it’s difficult to find a consumer display that
+is 4:3 at this point. The good news is that that extra space on the sides isn’t
+wasted. Many arcade cabinets used bezel artwork around the main display, and
+should you have the necessary artwork files, MAME will display that artwork.
+Turn the **Zoom to Screen Area** setting in the video options menu to scale and
+crop the artwork so the emulated screen fills your display in one direction.
-Some older LCD displays used a native resolution of 1280x1024 and were a 5:4 aspect ratio. There's not enough extra space to display artwork, and you'll end up with some very slight pillarboxing, but the results will be still be good and on-par with a 4:3 monitor.
+Some older LCD displays used a native resolution of 1280×1024 and were a 5:4
+aspect ratio. There’s not enough extra space to display artwork, and you’ll end
+up with some very slight pillarboxing, but the results will be still be good and
+on-par with a 4:3 monitor.
Getting Started with BGFX
-------------------------
-You will need to have followed the initial MAME setup instructions elsewhere in this manual before beginning. Official MAME distributions include BGFX as of MAME 0.172, so you don't need to download any additional files.
+You will need to have followed the initial MAME setup instructions elsewhere in
+this manual before beginning. Official MAME distributions include BGFX as of
+MAME 0.172, so you don’t need to download any additional files.
-Open your ``mame.ini`` in your text editor of choice (e.g. Notepad), and make sure the following options are set correctly:
+Open your ``mame.ini`` file in your text editor of choice (e.g. Notepad), and
+make sure the following options are set correctly:
* ``video bgfx``
-Now, you may want to take a moment to look below at the Configuration Settings section to see how to set up these next options.
+Now, you may want to take a moment to look below at the Configuration Settings
+section to see how to set up these next options.
-As referenced in :ref:`advanced-multi-CFG`, MAME has a order in which it processes INI files. The BGFX settings can be edited in ``mame.ini``, but to take full advantage of the power of MAME's config files, you'll want to copy the BGFX settings from ``mame.ini`` to one of the other config files and make changes there.)
+As explained in :ref:`advanced-multi-CFG`, MAME has a order in which it
+processes INI files. The BGFX settings can be edited in ``mame.ini``, but to
+take full advantage of the power of MAME’s configuration files, you’ll want to
+copy the BGFX settings from ``mame.ini`` to one of the other configuration files
+and make changes there.
-In particular, you will want the ``bgfx_screen_chains`` to be specific to each game.
+In particular, you will want the ``bgfx_screen_chains`` to be specific to each
+game.
+
+Save your INI file(s) and you’re ready to begin.
-Save your .INI file(s) and you're ready to begin.
Configuration Settings
----------------------
-| **bgfx_path**
-|
-| This is where your BGFX shader files are stored. By default, this will be the BGFX folder in your MAME installation.
-|
-| **bgfx_backend**
-|
-| Selects a rendering backend for BGFX to use. Possible choices include ``d3d9``, ``d3d11``, ``d3d12``, ``opengl``, ``metal``, and ```vulkan``. The default is ``**auto**``, which will let MAME choose the best selection for you.
-|
-| ``d3d9`` -- Direct3D 9.0 Renderer (Requires Windows XP or higher)
-| ``d3d11`` -- Direct3D 11.0 Renderer (Requires Windows Vista with D3D11 update or Windows 7 or higher)
-| ``d3d12`` -- Direct3D 12.0 Renderer (Requires Windows 10)
-| ``opengl`` -- OpenGL Renderer (Requires OpenGL drivers, may work better on some poorly designed video cards, supported on Linux/Mac OS X)
-| ``metal`` -- Metal Apple Graphics API (Requires OS X 10.11 El Capitan or newer)
-| ``vulkan`` -- Vulkan Renderer
-|
-| **bgfx_debug**
-|
-| Enables BGFX debugging features. Most users will not need to use this.
-|
-| **bgfx_screen_chains**
-|
-| This dictates how to handle BGFX rendering on a per-display basis. Possible choices include ``hlsl``, ``unfiltered``, and ``default``.
-|
-| ``default`` -- **default** bilinear filterered output
-| ``unfiltered`` -- nearest neighbor unfiltered output
-| ``hlsl`` -- HLSL display simulation through shaders
-|
-| We make a distinction between emulated device screens (which we'll call a **screen**) and physical displays (which we'll call a **window**, set by ``-numscreens``) here. We use colons (:) to seperate windows, and commas (,) to seperate screens. Commas always go on the outside of the chain (see House Mannequin example)
-|
-| On a combination of a single window, single screen case, such as Pac-Man on one physical PC monitor, you can specify one entry like:
-|
-| **bgfx_screen_chains hlsl**
-|
-| Things get only slightly more complicated when we get to multiple windows and multiple screens.
-|
-| On a single window, multiple screen game, such as Darius on one physical PC monitor, specify multiple entries (one per window) like:
-|
-| bgfx_screen_chains hlsl,hlsl,hlsl
-|
-| This also works with single screen games where you are mirroring the output to more than one physical display. For instance, you could set up Pac-Man to have one unfiltered output for use with video broadcasting while a second display is set up HLSL for playing on.
-|
-| On a mulitple window, multiple screen game, such as Darius on three physical PC monitors, specify multiple entries (one per window) like:
-|
-| ``bgfx_screen_chains hlsl:hlsl:hlsl``
-|
-| Another example game would be Taisen Hot Gimmick, which used two CRTs to show individual player hands to just that player. If using two windows (two physical displays):
-|
-| ``bgfx_screen_chains hlsl:hlsl``
-|
-| One more special case is that Nichibutsu had a special cocktail mahjongg cabinet that used a CRT in the middle along with two LCD displays to show each player their hand. We would want the LCDs to be unfiltered and untouched as they were, while the CRT would be improved through HLSL. Since we want to give each player their own full screen display (two physical monitors) along with the LCD, we'll go with:
-|
-| **-numscreens 2 -view0 "Player 1" -view1 "Player 2" -video bgfx -bgfx_screen_chains hlsl,unfiltered,unfiltered:hlsl,unfiltered,unfiltered**
-|
-| This sets up the view for each display respectively, keeping HLSL effect on the CRT for each window (physical display) while going unfiltered for the LCD screens.
-|
-| If using only one window (one display), keep in mind the game still has three screens, so we would use:
-|
-| ``bgfx_screen_chains hlsl,unfiltered,unfiltered``
-|
-|
-| Note that the commas are on the outside edges, and any colons are in the middle.
-|
-| ``bgfx_shadow_mask``
-|
-| This specifies the shadow mask effect PNG file. By default this is ``**slot-mask.png**``.
-|
-|
+bgfx_path
+ This is where your BGFX shader files are stored. By default, this will be
+ the *bgfx* folder in your MAME installation folder.
+bgfx_backend
+ Selects a rendering backend for BGFX to use. Possible choices include
+ ``d3d9``, ``d3d11``, ``d3d12``, ``opengl``, ``gles``, ``metal``, and
+ ```vulkan``. The default is ``**auto**``, which will let MAME choose the
+ best selection for you.
+
+ * ``d3d9`` -- Direct3D 9.0 Renderer (Requires Windows XP or higher)
+ * ``d3d11`` -- Direct3D 11.0 Renderer (Requires Windows Vista with
+ Direct3D 11 update, or Windows 7 or higher)
+ * ``d3d12`` -- Direct3D 12.0 Renderer (Requires Windows 10 or higher)
+ * ``opengl`` -- OpenGL Renderer (Requires OpenGL drivers, may work better on
+ some video cards, supported on Linux and macOS)
+ * ``gles`` -- OpenGL ES Renderer (Supported with some low-power GPUs)
+ * ``metal`` -- Apple Metal Graphics API (Requires macOS 10.11 El Capitan or
+ newer)
+ * ``vulkan`` -- Vulkan Renderer (Requires Windows or Linux with compatible
+ GPU drivers.
+bgfx_debug
+ Enables BGFX debugging features. Most users will not need to use this.
+bgfx_screen_chains
+ This dictates how to handle BGFX rendering on a per-display basis. Possible
+ choices include ``hlsl``, ``unfiltered``, and ``default``.
+
+ * ``default`` -- **default** bilinear filtered output
+ * ``unfiltered`` -- nearest neighbor sampled output
+ * ``hlsl`` -- display simulation through shaders
+ * ``crt-geom`` -- lightweight CRT simulation
+ * ``crt-geom-deluxe`` -- more detailed CRT simulation
+ * ``lcd-grid`` -- LCD matrix simulation
+
+ We make a distinction between emulated screens (which we’ll call a *screen*)
+ and output windows or monitors (which we’ll call a *window*, set by the
+ ``-numscreens`` option) here. Use colons (:) to separate windows, and
+ commas (,) to separate screens in the ``-bgfx_screen_chains`` setting value.
+
+ For the simple single window, single screen case, such as Pac-Man on one
+ physical PC monitor, you can specify one entry like::
+
+ bgfx_screen_chains hlsl
+
+ Things get only slightly more complicated when we get to multiple windows
+ and multiple screens.
+
+ On a single window, multiple screen game, such as Darius on one physical PC
+ monitor, specify screen chains (one per window) like::
+
+ bgfx_screen_chains hlsl,hlsl,hlsl
+
+ This also works with single screen games where you are mirroring the output
+ to more than one physical display. For instance, you could set up Pac-Man
+ to have one unfiltered output for use with video broadcasting while a second
+ display is set up HLSL for playing on.
+
+ On a multiple window, multiple screen game, such as Darius on three physical
+ PC monitors, specify multiple entries (one per window) like::
+
+ bgfx_screen_chains hlsl:hlsl:hlsl
+
+ Another example game would be Taisen Hot Gimmick, which used two CRTs to
+ show individual player hands to just that player. If using two windows (two
+ physical displays)::
+
+ bgfx_screen_chains hlsl:hlsl
+
+ One more special case is that Nichibutsu had a special cocktail mahjong
+ cabinet that used a CRT in the middle along with two LCD displays to show
+ each player their hand. We would want the LCDs to be unfiltered and
+ untouched as they were, while the CRT would be improved through HLSL. Since
+ we want to give each player their own full screen display (two physical
+ monitors) along with the LCD, we’ll go with::
+
+ -numscreens 2 -view0 "Player 1" -view1 "Player 2" -video bgfx -bgfx_screen_chains hlsl,unfiltered:hlsl,unfiltered
+
+ This sets up the view for each display respectively, keeping HLSL effect on
+ the CRT for each window (physical display) while going unfiltered for the
+ LCD screens.
+
+ If using only one window (one display), keep in mind the game still has
+ three screens, so we would use::
+
+ bgfx_screen_chains hlsl,unfiltered,unfiltered
+
+ Note that the commas are on the outside edges, and any colons are in the
+ middle.
+bgfx_shadow_mask
+ This specifies the shadow mask effect PNG file. By default this is
+ **slot-mask.png**.
Tweaking BGFX HLSL Settings inside MAME
---------------------------------------
-*Warning: Currently BGFX HLSL settings are not saved or loaded from any configuration files. This is expected to change in the future.*
+Start by loading MAME with the game of your choice (e.g. **mame pacman**).
+
+The tilde key (**~**) brings up the on-screen display options. Use up and down
+to go through the various settings, while left and right will allow you to
+change that setting. Results will be shown in real time as you’re changing
+these settings.
+
+Note that settings are individually changeable on a per-screen basis.
+
+BGFX slider settings are saved per-system in CFG files. If the
+``bgfx_screen_chains`` setting has been set (either in an INI file or on the
+command line), it will set the initial effects. If the ``bgfx_screen_chains``
+setting has not been set, MAME will use the effects you chose the last time you
+ran the system.
+
+
+Using the included pillarbox filters
+------------------------------------
+
+MAME includes example BGFX shaders and layouts for filling unused space on a
+16:9 widescreen display with a blurred version of the emulated video. The all
+the necessary files are included, and just need to be enabled.
+
+For systems using 4:3 horizontal monitors, use these options::
+
+ -override_artwork bgfx/border_blur -view Horizontal -bgfx_screen_chains crt-geom,pillarbox_left_horizontal,pillarbox_right_horizontal
-Start by loading MAME with the game of your choice (e.g. **mame pacman**)
+For systems using 3:4 vertical monitors, use these options::
-The tilde key (**~**) brings up the on-screen display options. Use up and down to go through the various settings, while left and right will allow you to change that setting. Results will be shown in real time as you're changing these settings.
+ -override_artwork bgfx/border_blur -view Vertical -bgfx_screen_chains crt-geom,pillarbox_left_vertical,pillarbox_right_vertical
-Note that settings are individually changable on a per-screen basis.
+* You can use a different setting in place of ``crt-geom`` for the effect to
+ apply to the primary screen image in the centre (e.g. ``default``, ``hlsl`` or
+ ``lcd-grid``).
+* If you’ve previously changed the view for the system in MAME, the correct
+ pillarboxed view will not be selected by default. Use the video options menu
+ to select the correct view.
+* You can add these settings to an INI file to have them apply to certain
+ systems automatically (e.g. **horizont.ini** or **vertical.ini**, or the INI
+ file for a specific system).
diff --git a/docs/source/advanced/ctrlr_config.rst b/docs/source/advanced/ctrlr_config.rst
index f05a3d164b7..5973832d2ab 100644
--- a/docs/source/advanced/ctrlr_config.rst
+++ b/docs/source/advanced/ctrlr_config.rst
@@ -41,8 +41,9 @@ Basic structure
Controller configuration files follow a similar format to the system
configuration files that MAME uses to save things like input settings and
-bookkeeping data. This example shows the overall structure of a controller
-configuration file:
+bookkeeping data (created in the folder specified using the
+:ref:`cfg_directory option <mame-commandline-cfgdirectory>`). This example
+shows the overall structure of a controller configuration file:
.. code-block:: XML
@@ -127,26 +128,26 @@ left and right arrows will be replaced with the numeric 8, 2, 4 and 6 keys on
the numeric keypad, respectively.
Note that substitutions specified using ``remap`` elements only apply to inputs
-that use MAME’s default assignment for the control type. That is, they only
-apply to default assignments for control types set in the “Inputs (general)”
-menu. They *do not* apply to default input assignments set in driver/device I/O
-port definitions (using the ``PORT_CODE`` macro).
+that use MAME’s default assignment for the input type. That is, they only apply
+to default assignments for control types set in the “Input Assignments
+(general)” menus. They *do not* apply to default control assignments set in
+driver/device I/O port definitions (using the ``PORT_CODE`` macro).
MAME applies ``remap`` elements found inside any applicable ``system`` element.
.. _ctrlrcfg-typeoverride:
-Overriding defaults by control type
------------------------------------
+Overriding defaults by input type
+---------------------------------
Use ``port`` elements with ``type`` attributes but without ``tag`` attributes to
-override the default host input assignments for a controls:
+override the default control assignments for emulated inputs by type:
.. code-block:: XML
<input>
- <port type="UI_CONFIGURE">
+ <port type="UI_MENU">
<newseq type="standard">KEYCODE_TAB OR KEYCODE_1 KEYCODE_5</newseq>
</port>
<port type="UI_CANCEL">
@@ -169,7 +170,7 @@ override the default host input assignments for a controls:
This sets the following default input assignments:
-Config Menu (User Interface)
+Show/Hide Menu (User Interface)
Tab key, or 1 and 2 keys pressed simultaneously
UI Cancel (User Interface)
Escape key, or 2 and 6 keys pressed simultaneously
@@ -183,10 +184,10 @@ P1 Button 4 (Player 1 Controls)
X key, or joystick 1 button 4
Note that this will only apply for inputs that use MAME’s default assignment for
-the control type. That is, ``port`` elements without ``tag`` attributes only
-override default assignments for control types set in the “Inputs (general)”
-menu. They *do not* override default input assignments set in driver/device I/O
-port definitions (using the ``PORT_CODE`` macro).
+the input type. That is, ``port`` elements without ``tag`` attributes only
+override default assignments for control types set in the “Input Assignments
+(general)” menus. They *do not* override default control assignments set in
+driver/device I/O port definitions (using the ``PORT_CODE`` macro).
MAME applies ``port`` elements without ``tag`` attributes found inside any
applicable ``system`` element.
@@ -194,22 +195,22 @@ applicable ``system`` element.
.. _ctrlrcfg-ctrloverride:
-Overriding defaults for specific controls
------------------------------------------
+Overriding defaults for specific inputs
+---------------------------------------
Use ``port`` elements with ``tag``, ``type``, ``mask`` and ``defvalue``
-attributes to override defaults for specific controls. These ``port`` elements
+attributes to override defaults for specific inputs. These ``port`` elements
should only occur inside ``system`` elements that apply to particular systems or
source files (i.e. they should not occur inside ``system`` elements where the
-``name`` attribute has the value ``default``). The default host input
-assignments can be overridden, as well as the toggle setting for digital
-controls.
+``name`` attribute has the value ``default``). The default control assignments
+can be overridden, as well as the toggle setting for digital inputs.
The ``tag``, ``type``, ``mask`` and ``defvalue`` are used to identify the
affected input. You can find out the values to use for a particular input by
-changing its assigned host input, exiting MAME, and checking the values in the
-system configuration file. Note that these values are not guaranteed to be
-stable, and may change between MAME versions.
+changing its control assignment, exiting MAME, and checking the values in the
+system configuration file (created in the folder specified using the
+:ref:`cfg_directory option <mame-commandline-cfgdirectory>`). Note that these
+values are not guaranteed to be stable, and may change between MAME versions.
Here’s an example that overrides defaults for 280-ZZZAP:
@@ -225,5 +226,38 @@ Here’s an example that overrides defaults for 280-ZZZAP:
</input>
</system>
-This sets the host inputs to steer left and right to the K and J keys,
+This sets the controls to steer left and right to the K and J keys,
respectively, and disables the toggle setting for the gear shift input.
+
+
+.. _ctrlrcfg-mapdevice:
+
+Assigning input device numbers
+------------------------------
+
+Use ``mapdevice`` elements with ``device`` and ``controller`` attributes to
+assign stable numbers to input devices. Note that all devices explicitly
+configured in this way must be connected when MAME starts for this to work as
+expected.
+
+Set the ``device`` attribute to the device ID of the input device, and set the
+``controller`` attribute to the desired input device token (device type and
+number).
+
+Here’s an example numbering two light guns and two XInput game controllers:
+
+.. code-block:: XML
+
+ <system name="default">
+ <input>
+ <mapdevice device="VID_D209&amp;PID_1601" controller="GUNCODE_1" />
+ <mapdevice device="VID_D209&amp;PID_1602" controller="GUNCODE_2" />
+ <mapdevice device="XInput Player 1" controller="JOYCODE_1" />
+ <mapdevice device="XInput Player 2" controller="JOYCODE_2" />
+ </input>
+ </system>
+
+MAME applies ``mapdevice`` elements found inside the first applicable ``system``
+element only. To avoid confusion, it’s simplest place the ``system`` element
+element applying to all systems (``name`` attribute set to ``default``) first
+in the file, and use it to assign input device numbers.
diff --git a/docs/source/advanced/devicemap.rst b/docs/source/advanced/devicemap.rst
index 38dcc3a2641..9cfd88e6c56 100644
--- a/docs/source/advanced/devicemap.rst
+++ b/docs/source/advanced/devicemap.rst
@@ -1,26 +1,52 @@
+.. _devicemap:
+
Stable Controller IDs
-===============================
+=====================
+
+By default, MAME does not assign stable numbers to input devices. For instance,
+a game pad controller may be assigned to “Joy 1” initially, but after
+restarting, the same game pad may be reassigned to “Joy 3”.
+
+The reason is that MAME assigns numbers to input devices in the based on
+enumeration order. Factors that can cause this to change include disconnecting
+and reconnecting USB or Bluetooth devices, changing ports/hubs, and even just
+restarting the computer. Input device numbers can be quite unpredictable.
-By default, the mapping between devices and controller IDs is not stable. For instance, a gamepad controller may be assigned to "Joy 1" initially, but after a reboot, it may get re-assigned to "Joy 3".
+This is where the ``mapdevice`` configuration setting comes into the picture.
+By adding this setting to a :ref:`controller configuration file <ctrlrcfg>`, you
+can ensure that a given input device is always assigned the same number in MAME.
-The reason is that MAME enumerates attached devices and assigns controller IDs based on the enumeration order. Factors that can cause controller IDs to change include plugging / unplugging USB devices, changing ports / hubs and even system reboots.
-It is quite cumbersome to ensure that controller IDs are always correct.
+Using mapdevice
+---------------
-That's where the "mapdevice" configuration setting comes into the picture. This setting allows you to map a device id to a controller ID, ensuring that the specified device always maps to the same controller ID in MAME.
+The ``mapdevice`` XML element is added to the ``input`` XML element in the
+controller configuration file. It requires two attributes, ``device`` and
+``controller``. Note that ``mapdevice`` elements only take effect in the
+controller configuration file (set using the :ref:`-ctrlr option
+<mame-commandline-ctrlr>`) – they are ignored in system configuration files and
+the default configuration file.
-Usage of mapdevice
-------------------
-The "mapdevice" xml element is specified under the input xml element in the controller configuration file. It requires two attributes, "device" and "controller".
-NOTE: This setting only take effect when added to the **ctrlr** config file.
+The ``device`` attribute specifies the device ID of the input device to match.
+It may also be a substring of the device ID. To obtain the device ID for an
+input device, select it in the :ref:`menus-inputdevices`, and then select **Copy
+Device ID**. The device ID will be copied to the clipboard. You can also see
+input device IDs by turning on verbose logging (more on this later). The format
+of device IDs depends the type of device, selected input provider module and
+operating system. Your input device IDs may look very different to the examples
+here.
-The "device" attribute specifies the id of the device to match. It may also be a substring of the id. To see the list of available devices, enable verbose output and available devices will then be listed to the console at startup (more on this below).
+The ``controller`` attribute specifies the input token for the input device type
+(i.e. ``JOYCODE``, ``GUNCODE``, ``MOUSECODE``) and number to assign to the
+device, separated by an underscore. Numbering starts from 1. For example the
+token for the first joystick device will be ``JOYCODE_1``, the second will be
+``JOYCODE_2``, and so on.
-The "controller" attribute specifies the MAME controller ID. It is made up of a controller class (i.e. ``JOYCODE``, ``GUNCODE``, ``MOUSECODE``) and controller index. For example: ``JOYCODE_1``.
Example
-------
-Here's an example:
+
+Here’s an example:
| <mameconfig version="10">
| <system name="default">
@@ -40,37 +66,68 @@ Here's an example:
In the above example, we have four device mappings specified:
-The first two mapdevice entries map player 1 and 2 lightguns to Gun 1 and Gun 2, respectively. We use a substring of the full raw device names to match each devices. Note that, since this is XML, we needed to escape the ``&`` using ``&amp;``.
+* The first two ``mapdevice`` elements map player 1 and 2 light guns to Gun 1
+ and Gun 2, respectively. We use a substring of the full device IDs to match
+ each devices. Note that, since this is XML, we needed to escape the
+ ampersands (``&``) as ``&amp;``.
+* The last two ``mapdevices`` elements map player 1 and player 2 gamepad
+ controllers to Joy 1 and Joy 2, respectively. In this case, these are XInput
+ game controllers.
-The last two mapdevices entries map player 1 and player 2 gamepad controllers to Joy 1 and Joy 2, respectively. In this case, these are XInput devices.
Listing Available Devices
-------------------------
-How did we obtain the device id's in the above example? Easy!
-Run MAME with -v parameter to enable verbose output. It will then list available devices include the corresponding "device id" to the console.
+There are two ways to obtain device IDs: by copying them from the
+:ref:`menus-inputdevices`, or by :ref:`turning on verbose logging
+<mame-commandline-verbose>` and finding the messages logged when input devices
+are added.
+
+To reach the Input Devices menu from the system selection menu, select **General
+Settings**, and the select **Input Devices**. To reach the input devices menu
+from the :ref:`main menu <menus-main>`, select **Input Settings**, then select
+**Input Devices**. From the Input Devices menu, select a device, then select
+**Copy Device ID** to copy its device ID to the clipboard.
+
+To use verbose logging, run MAME with the ``-v`` or ``-verbose`` option on the
+command line. Search the output for messages starting with “Input: Adding…”
+that show recognised input devices and their respective IDs.
Here an example:
-| Input: Adding Gun #0:
-| Input: Adding Gun #1:
-| Input: Adding Gun #2: HID-compliant mouse (**device id: \\?\HID#VID_045E&PID_0053#7&18297dcb&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}**)
-| Input: Adding Gun #3: HID-compliant mouse (**device id: \\?\HID#IrDeviceV2&Col08#2&2818a073&0&0007#{378de44c-56ef-11d1-bc8c-00a0c91405dd}**)
-| Input: Adding Gun #4: HID-compliant mouse (**device id: \\?\HID#VID_D209&PID_1602&MI_02#8&389ab7f3&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}**)
-| Input: Adding Gun #5: HID-compliant mouse (**device id: \\?\HID#VID_D209&PID_1601&MI_02#9&375eebb1&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}**)
-| Input: Adding Gun #6: HID-compliant mouse (**device id: \\?\HID#VID_1241&PID_1111#8&198f3adc&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}**)
+| Input: Adding lightgun #1:
+| Input: Adding lightgun #2:
+| Input: Adding lightgun #3: HID-compliant mouse (**device id: \\\\?\\HID#VID_045E&PID_0053#7&18297dcb&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}**)
+| Input: Adding lightgun #4: HID-compliant mouse (**device id: \\\\?\\HID#IrDeviceV2&Col08#2&2818a073&0&0007#{378de44c-56ef-11d1-bc8c-00a0c91405dd}**)
+| Input: Adding lightgun #5: HID-compliant mouse (**device id: \\\\?\\HID#VID_D209&PID_1602&MI_02#8&389ab7f3&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}**)
+| Input: Adding lightgun #6: HID-compliant mouse (**device id: \\\\?\\HID#VID_D209&PID_1601&MI_02#9&375eebb1&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}**)
+| Input: Adding lightgun #7: HID-compliant mouse (**device id: \\\\?\\HID#VID_1241&PID_1111#8&198f3adc&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}**)
| Skipping DirectInput for XInput compatible joystick Controller (XBOX 360 For Windows).
-| Input: Adding Joy #0: ATRAK Device #1 (**device id: ATRAK Device #1**)
+| Input: Adding joystick #1: ATRAK Device #1 (**device id: ATRAK Device #1**)
| Skipping DirectInput for XInput compatible joystick Controller (XBOX 360 For Windows).
-| Input: Adding Joy #1: ATRAK Device #2 (**device id: ATRAK Device #2**)
-| Input: Adding Joy #2: XInput Player 1 (**device id: XInput Player 1**)
-| Input: Adding Joy #3: XInput Player 2 (**device id: XInput Player 2**)
+| Input: Adding joystick #2: ATRAK Device #2 (**device id: ATRAK Device #2**)
+| Input: Adding joystick #3: XInput Player 1 (**device id: XInput Player 1**)
+| Input: Adding joystick #4: XInput Player 2 (**device id: XInput Player 2**)
|
-Furthermore, when devices are mapped using mapdevice, you'll see that in the verbose logging too, such as:
+Furthermore, when devices are reassigned using ``mapdevice`` elements in the
+controller configuration file, you’ll see that in the verbose log output, too,
+such as:
-| Input: Remapped Gun #0: HID-compliant mouse (device id: \\?\HID#VID_D209&PID_1601&MI_02#9&375eebb1&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd})
-| Input: Remapped Gun #1: HID-compliant mouse (device id: \\?\HID#VID_D209&PID_1602&MI_02#8&389ab7f3&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd})
-| Input: Remapped Joy #0: XInput Player 1 (device id: XInput Player 1)
-| Input: Remapped Joy #1: XInput Player 2 (device id: XInput Player 2)
+| Input: Remapped lightgun #1: HID-compliant mouse (device id: \\\\?\\HID#VID_D209&PID_1601&MI_02#9&375eebb1&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd})
+| Input: Remapped lightgun #2: HID-compliant mouse (device id: \\\\?\\HID#VID_D209&PID_1602&MI_02#8&389ab7f3&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd})
+| Input: Remapped joystick #1: XInput Player 1 (device id: XInput Player 1)
+| Input: Remapped joystick #2: XInput Player 2 (device id: XInput Player 2)
|
+
+
+Limitations
+-----------
+
+You can only assign stable numbers to devices if MAME receives stable, unique
+device IDs from the input device provider and operating system. This is not
+always the case. For example the SDL joystick provider is not capable of
+providing unique IDs for many USB game controllers.
+
+If not all configured devices are connected when MAME starts, the devices that
+are connected may not be numbered as expected.
diff --git a/docs/source/advanced/multiconfig.rst b/docs/source/advanced/multiconfig.rst
index abae10f5a78..d81853d4734 100644
--- a/docs/source/advanced/multiconfig.rst
+++ b/docs/source/advanced/multiconfig.rst
@@ -27,12 +27,7 @@ Order of Config Loading
Systems with no monitors, multiple monitors with different orientations, or
monitors connected to slot devices will usually load ``horizont.ini``.
-5. System type INI file (``arcade.ini``, ``console.ini``, ``computer.ini``, or
- ``othersys.ini``). Both Pac-Man and Street Fighter Alpha are arcade games,
- so ``arcade.ini`` will be loaded here, while Atari 2600 will load
- ``console.ini`` as it is a home game console.
-
-6. Monitor type INI file (``vector.ini`` for vector monitors, ``raster.ini`` for
+5. Monitor type INI file (``vector.ini`` for vector monitors, ``raster.ini`` for
CRT raster monitors, or ``lcd.ini`` for LCD/EL/plasma matrix monitors).
Pac-Man and Street Fighter Alpha use raster CRTs, so ``raster.ini`` is loaded
here, while Tempest uses a vector monitor, so ``vector.ini`` is loaded here.
@@ -43,7 +38,7 @@ Order of Config Loading
monitors or with other kinds of monitors will not load an INI file for this
step.
-7. Driver source file INI file. MAME will attempt to load
+6. Driver source file INI file. MAME will attempt to load
``source/``\ *<sourcefile>*\ ``.ini`` where *<sourcefile>* is the base name
of the source code file where the system driver is defined. A system's
source file can be found using **mame -listsource <pattern>** at the command
@@ -54,16 +49,16 @@ Order of Config Loading
``cave.cpp`` source file, so they will all load ``source/cave.ini`` at this
step.
-8. BIOS set INI file (if applicable). For example The Last Soldier uses the
+7. BIOS set INI file (if applicable). For example The Last Soldier uses the
Neo-Geo MVS BIOS, so it will load ``neogeo.ini``. Systems that don't use a
BIOS set won't load an INI file for this step.
-9. Parent system INI file. For example The Last Soldier is a clone of The Last
+8. Parent system INI file. For example The Last Soldier is a clone of The Last
Blade / Bakumatsu Roman - Gekka no Kenshi, so it will load ``lastblad.ini``.
Parent systems will not load an INI file for this step.
-10. System INI file. Using the previous example, The Last Soldier will load
- ``lastsold.ini``.
+9. System INI file. Using the previous example, The Last Soldier will load
+ ``lastsold.ini``.
Examples of Config Loading Order
@@ -75,12 +70,11 @@ Examples of Config Loading Order
2. ``mame.ini`` (global)
3. (debugger not enabled, no extra INI file loaded)
4. ``vertical.ini`` (screen orientation)
- 5. ``arcade.ini`` (system type)
- 6. ``raster.ini`` (monitor type)
- 7. ``source/jack.ini`` (driver source file)
- 8. (no BIOS set)
- 9. ``zzyzzyxx.ini`` (parent system)
- 10. ``brix.ini`` (system)
+ 5. ``raster.ini`` (monitor type)
+ 6. ``source/jack.ini`` (driver source file)
+ 7. (no BIOS set)
+ 8. ``zzyzzyxx.ini`` (parent system)
+ 9. ``brix.ini`` (system)
* Super Street Fighter 2 Turbo (**mame ssf2t**)
@@ -88,12 +82,11 @@ Examples of Config Loading Order
2. ``mame.ini`` (global)
3. (debugger not enabled, no extra INI file loaded)
4. ``horizont.ini`` (screen orientation)
- 5. ``arcade.ini`` (system type)
- 6. ``raster.ini`` (monitor type)
- 7. ``source/cps2.ini`` (driver source file)
- 8. (no BIOS set)
- 9. (no parent system)
- 10. ``ssf2t.ini`` (system)
+ 5. ``raster.ini`` (monitor type)
+ 6. ``source/cps2.ini`` (driver source file)
+ 7. (no BIOS set)
+ 8. (no parent system)
+ 9. ``ssf2t.ini`` (system)
* Final Arch (**mame finlarch**)
@@ -101,12 +94,11 @@ Examples of Config Loading Order
2. ``mame.ini`` (global)
3. (debugger not enabled, no extra INI file loaded)
4. ``horizont.ini`` (screen orientation)
- 5. ``arcade.ini`` (system type)
- 6. ``raster.ini`` (monitor type)
- 7. ``source/stv.ini`` (driver source file)
- 8. ``stvbios.ini`` (BIOS set)
- 9. ``smleague.ini`` (parent system)
- 10. ``finlarch.ini`` (system)
+ 5. ``raster.ini`` (monitor type)
+ 6. ``source/stv.ini`` (driver source file)
+ 7. ``stvbios.ini`` (BIOS set)
+ 8. ``smleague.ini`` (parent system)
+ 9. ``finlarch.ini`` (system)
*Remember command line parameters take precedence over all else!*
@@ -118,5 +110,3 @@ Some users may have a wall-mounted or otherwise rotatable monitor, and may wish
to actually play vertical games with the rotated display. The easiest way to
accomplish this is to put your rotation modifiers into ``vertical.ini``, where
they will only affect vertical games.
-
-[todo: more practical examples]
diff --git a/docs/source/commandline/commandline-all.rst b/docs/source/commandline/commandline-all.rst
index 3f008300f04..9096cb13888 100644
--- a/docs/source/commandline/commandline-all.rst
+++ b/docs/source/commandline/commandline-all.rst
@@ -1,10 +1,10 @@
-.. _universal-command-line:
+.. _mame-commandline-universal:
-Universal Commandline Options
-=============================
+Universal Command-line Options
+==============================
This section contains configuration options that are applicable to *all* MAME
-sub-builds (both SDL and Windows native).
+configurations (including both SDL and Windows native).
.. contents:: :local:
@@ -19,6 +19,8 @@ Verbs are actions to take upon something with the command (e.g.
**mame -validate pacman** has *mame* as a command and *-validate* as a verb)
+.. _mame-commandline-patterns:
+
Patterns
--------
@@ -80,6 +82,8 @@ Terminal window, set the working directory to the location of the script
(i.e. the folder containing MAME), and then start MAME.
+.. _mame-commandline-coreverbs:
+
Core Verbs
----------
@@ -136,6 +140,9 @@ Core Verbs
apple2_flop_orig.xml(137.3): mismatched tag
+
+.. _mame-commandline-configverbs:
+
Configuration Verbs
-------------------
@@ -175,6 +182,8 @@ Configuration Verbs
a sufficient description.
+.. _mame-commandline-fronendverbs:
+
Frontend Verbs
--------------
@@ -441,17 +450,17 @@ overwritten.
.. _mame-commandline-romident:
-**-romident** [*path\\to\\romstocheck.zip*]
+**-romident** [*path/to/romstocheck.zip*]
Attempts to identify ROM files, if they are known to MAME, in the specified
.zip file or directory. This command can be used to try and identify ROM
sets taken from unknown boards. On exit, the errorlevel is returned as one
of the following:
- * 0: means all files were identified
- * 7: means all files were identified except for 1 or more "non-ROM" files
- * 8: means some files were identified
- * 9: means no files were identified
+ * 0: means all files were identified
+ * 7: means all files were identified except for 1 or more "non-ROM" files
+ * 8: means some files were identified
+ * 9: means no files were identified
Example:
.. code-block:: bash
@@ -526,6 +535,32 @@ overwritten.
joy Apple II analog joysticks
paddles Apple II paddles
+.. _mame-commandline-listbios:
+
+**-listbios** [*<pattern>*]
+
+ Show available BIOS options for a system (if available). BIOS options may
+ be available for the system or any devices selected as slot options.
+
+ If no pattern is specified, the results will include *all* supported
+ systems.
+
+ Example:
+ .. code-block:: bash
+
+ mamed -listbios apple2 -sl2 grapplus -sl4 videoterm
+ BIOS options for system Apple ][ (apple2):
+ default Original Monitor
+ autostart Autostart Monitor
+
+ BIOS options for device Orange Micro Grappler+ Printer Interface (-sl2 grapplus):
+ v30 ROM 3.0
+ v32 ROM 3.2
+
+ BIOS options for device Videx Videoterm 80 Column Display (-sl4 videoterm):
+ v24_60hz Firmware v2.4 (60 Hz)
+ v24_50hz Firmware v2.4 (50 Hz)
+
.. _mame-commandline-listmedia:
**-listmedia** / **-lm** [<*pattern*>]
@@ -664,8 +699,8 @@ overwritten.
romset apple2_flop_orig:autobahn is good
...
-.. _osd-commandline-options:
+.. _mame-commandline-osdoptions:
OSD-related Options
-------------------
@@ -684,6 +719,49 @@ OSD-related Options
mame ibm5150 -uimodekey DEL
+.. _mame-commandline-controllermap:
+
+**-controller_map** / **-ctrlmap** *<filename>*
+
+ Path to a text file containing game controller button and axis mappings in
+ the format used by SDL2 and Steam, or ``none`` to use only built-in
+ mappings. Must use an ASCII-compatible text encoding with native line
+ endings (e.g. CRLF on Windows). Currently only supported when using the
+ ``sdlgame`` joystick provider. The default setting is ``none``.
+
+ A `community-sourced list of game controller mappings
+ <https://github.com/gabomdq/SDL_GameControllerDB>`_ can be found on GitHub.
+ Besides using a text editor, several tools are available for creating game
+ controller mappings, including `SDL2 Gamepad Mapper
+ <https://gitlab.com/ryochan7/sdl2-gamepad-mapper/-/releases>`_ and SDL2
+ ControllerMap which is `supplied with SDL
+ <https://github.com/libsdl-org/SDL/releases/latest>`_. You can also
+ configure your controller in Steam’s Big Picture mode, then copy the
+ mappings from ``SDL_GamepadBind`` entries in the **config.vdf** file found
+ in the **config** folder inside your Steam installation folder.
+
+ Example:
+ .. code-block:: bash
+
+ mame -controller_map gamecontrollerdb.txt sf2ce
+
+.. _mame-commandline-backgroundinput:
+
+**-[no]background_input**
+
+ Sets whether input is accepted or ignored when MAME does not have UI focus.
+ This setting is ignored when the debugger is enabled. The default is OFF
+ (**-nobackground_input**).
+
+ Currently supported for RawInput mouse/keyboard input, DirectInput
+ mouse/keyboard/joystick input and XInput joystick input on Windows, and SDL
+ game controller/joystick input.
+
+ Example:
+ .. code-block:: bash
+
+ mame -background_input ssf2tb
+
.. _mame-commandline-uifontprovider:
**-uifontprovider** *<module>*
@@ -878,7 +956,8 @@ Example:
**-joystickprovider** *<module>*
- Chooses how MAME will get joystick input. The default is ``auto``.
+ Chooses how MAME will get joystick and other game controller input. The
+ default is ``auto``.
.. list-table:: Supported joystick input providers per-platform
:header-rows: 0
@@ -889,38 +968,90 @@ Example:
- winhybrid
- dinput
- xinput
+ - sdlgame
+ - sdljoy
- none
- - sdl
* - **SDL**
- auto [#JIPAutoSDL]_.
-
-
-
+ - sdlgame
+ - sdljoy
- none
- - sdl
.. rubric:: Footnotes
-.. [#JIPAutoWindows] On Windows, auto will default to ``dinput``.
+.. [#JIPAutoWindows] On Windows native, auto will default to ``winhybrid``.
+
+.. [#JIPAutoSDL] On SDL, auto will default to ``sdlgame``.
+
+winhybrid
+ Uses XInput for compatible game controllers, falling back to DirectInput for
+ other game controllers. Typically provides the best experience on Windows.
+dinput
+ Uses DirectInput for all game controllers. May be useful if you want to use
+ more than four XInput game controllers simultaneously. Note that LT and RT
+ controls are combined with using XInput game controllers via DirectInput.
+xinput
+ Supports up to four XInput game controllers.
+sdlgame
+ Uses the SDL game controller API for game controllers with button/axis
+ mappings available, falling back to the SDL joystick API for other game
+ controllers. Provides consistent button and axis assignment and meaningful
+ control names for popular game controllers. Use the :ref:`controller_map
+ option <mame-commandline-controllermap>` to supply mappings for additional
+ game controllers or override built-in mappings.
+sdljoy
+ Uses the SDL joystick API for all game controllers.
+none
+ Ignores all game controllers.
+
+Example:
+ .. code-block:: bash
+
+ mame mk2 -joystickprovider winhybrid
+
+.. _mame-commandline-midiprovider:
-.. [#JIPAutoSDL] On SDL, auto will default to ``sdl``.
+**-midiprovider** *<module>*
-.. Tip:: Note that Microsoft XBox 360 and XBox One controllers connected to
- Windows will work best with ``winhybrid`` or ``xinput``. The
- ``winhybrid`` option supports a mix of DirectInput and XInput
- controllers at the same time.
+ Chooses how MAME will communicate with MIDI devices and applications (e.g.
+ music keyboards and synthesisers). Supported options are ``pm`` to use the
+ PortMidi library, or ``none`` to disable MIDI input and output (MIDI files
+ can still be played). The default is ``auto``, which will use PortMidi if
+ available.
Example:
.. code-block:: bash
- mame mk2 -joystickprovider winhybrid
+ mame -midiprovider none dx100 -midiin canyon.mid
+
+.. _mame-commandline-networkprovider:
+
+**-networkprovider** *<module>*
+
+ Chooses how MAME will provide communication for emulated packet-oriented
+ network interfaces (e.g. Ethernet cards). Supported options are ``taptun``
+ to use the TUN/TAP, TAP-Windows or similar, ``pcap`` to use a pcap library,
+ or ``none`` to disable communication for emulated network interfaces.
+ Available options depend on your operating system. By default, ``taptun``
+ and ``none`` are available on Windows and Linux, and ``pcap`` and ``none``
+ are available on macOS.
+
+ The default is ``auto`` which will use ``taptun`` if available, falling back
+ to ``pcap``.
+
+Example:
+ .. code-block:: bash
+
+ mame -networkprovider pcap apple2ee -sl3 uthernet
-.. Tip:: On Windows, winhybrid is likely to give the best experience by
- supporting both XInput and DirectInput controllers.
+.. _mame-commandline-cliverbs:
-OSD CLI Options
----------------
+OSD Command-Line Verbs
+----------------------
.. _mame-commandline-listmidi:
@@ -961,6 +1092,8 @@ OSD CLI Options
any network adapters.
+.. _mame-commandline-osdoutput:
+
OSD Output Options
------------------
@@ -987,6 +1120,8 @@ OSD Output Options
led0 = 0
+.. _mame-commandline-configoptions:
+
Configuration Options
---------------------
@@ -1025,6 +1160,8 @@ Configuration Options
mame apple2ee -noreadconfig -sl6 diskii -sl7 cffa2 -hard1 TotalReplay.2mg
+.. _mame-commandline-pathoptions:
+
Core Search Path Options
------------------------
@@ -1039,7 +1176,7 @@ Core Search Path Options
Example:
.. code-block:: bash
- mame -homepath c:\mame\lua
+ mame -homepath C:\mame\lua
.. _mame-commandline-rompath:
@@ -1054,7 +1191,7 @@ Core Search Path Options
Example:
.. code-block:: bash
- mame -rompath c:\mame\roms;c:\roms\another
+ mame -rompath C:\mame\roms;C:\roms\another
.. _mame-commandline-hashpath:
@@ -1069,7 +1206,7 @@ Core Search Path Options
Example:
.. code-block:: bash
- mame -hashpath c:\mame\hash;c:\roms\softlists
+ mame -hashpath C:\mame\hash;C:\roms\softlists
.. _mame-commandline-samplepath:
@@ -1084,7 +1221,7 @@ Core Search Path Options
Example:
.. code-block:: bash
- mame -samplepath c:\mame\samples;c:\roms\samples
+ mame -samplepath C:\mame\samples;C:\roms\samples
.. _mame-commandline-artpath:
@@ -1099,7 +1236,7 @@ Core Search Path Options
Example:
.. code-block:: bash
- mame -artpath c:\mame\artwork;c:\emu\shared-artwork
+ mame -artpath C:\mame\artwork;C:\emu\shared-artwork
.. _mame-commandline-ctrlrpath:
@@ -1115,7 +1252,7 @@ Core Search Path Options
Example:
.. code-block:: bash
- mame -ctrlrpath c:\mame\ctrlr;c:\emu\controllers
+ mame -ctrlrpath C:\mame\ctrlr;C:\emu\controllers
.. _mame-commandline-inipath:
@@ -1144,7 +1281,7 @@ Core Search Path Options
Example:
.. code-block:: bash
- mame -inipath c:\users\thisuser\documents\mameini
+ mame -inipath C:\Users\thisuser\documents\mameini
.. _mame-commandline-fontpath:
@@ -1159,7 +1296,7 @@ Core Search Path Options
Example:
.. code-block:: bash
- mame -fontpath c:\mame\;c:\emu\artwork\mamefonts
+ mame -fontpath C:\mame\;C:\emu\artwork\mamefonts
.. _mame-commandline-cheatpath:
@@ -1174,7 +1311,7 @@ Core Search Path Options
Example:
.. code-block:: bash
- mame -cheatpath c:\mame\cheat;c:\emu\cheats
+ mame -cheatpath C:\mame\cheat;C:\emu\cheats
.. _mame-commandline-crosshairpath:
@@ -1189,7 +1326,7 @@ Core Search Path Options
Example:
.. code-block:: bash
- mame -crosshairpath c:\mame\crsshair;c:\emu\artwork\crosshairs
+ mame -crosshairpath C:\mame\crsshair;C:\emu\artwork\crosshairs
.. _mame-commandline-pluginspath:
@@ -1203,7 +1340,7 @@ Core Search Path Options
Example:
.. code-block:: bash
- mame -pluginspath c:\mame\plugins;c:\emu\lua
+ mame -pluginspath C:\mame\plugins;C:\emu\lua
.. _mame-commandline-languagepath:
@@ -1218,7 +1355,7 @@ Core Search Path Options
Example:
.. code-block:: bash
- mame -languagepath c:\mame\language;c:\emu\mame-languages
+ mame -languagepath C:\mame\language;C:\emu\mame-languages
.. _mame-commandline-swpath:
@@ -1232,9 +1369,11 @@ Core Search Path Options
Example:
.. code-block:: bash
- mame -swpath c:\mame\software;c:\emu\mydisks
+ mame -swpath C:\mame\software;C:\emu\mydisks
+.. _mame-commandline-coreoutdir:
+
Core Output Directory Options
-----------------------------
@@ -1255,7 +1394,7 @@ Core Output Directory Options
Example:
.. code-block:: bash
- mame -cfg_directory c:\mame\cfg
+ mame -cfg_directory C:\mame\cfg
.. _mame-commandline-nvramdirectory:
@@ -1273,7 +1412,7 @@ Core Output Directory Options
Example:
.. code-block:: bash
- mame -nvram_directory c:\mame\nvram
+ mame -nvram_directory C:\mame\nvram
.. _mame-commandline-inputdirectory:
@@ -1290,7 +1429,7 @@ Core Output Directory Options
Example:
.. code-block:: bash
- mame -input_directory c:\mame\inp
+ mame -input_directory C:\mame\inp
.. _mame-commandline-statedirectory:
@@ -1307,7 +1446,7 @@ Core Output Directory Options
Example:
.. code-block:: bash
- mame -state_directory c:\mame\sta
+ mame -state_directory C:\mame\sta
.. _mame-commandline-snapshotdirectory:
@@ -1323,7 +1462,7 @@ Core Output Directory Options
Example:
.. code-block:: bash
- mame -snapshot_directory c:\mame\snap
+ mame -snapshot_directory C:\mame\snap
.. _mame-commandline-diffdirectory:
@@ -1342,7 +1481,7 @@ Core Output Directory Options
Example:
.. code-block:: bash
- mame -diff_directory c:\mame\diff
+ mame -diff_directory C:\mame\diff
.. _mame-commandline-commentdirectory:
@@ -1359,8 +1498,10 @@ Core Output Directory Options
Example:
.. code-block:: bash
- mame -comment_directory c:\mame\comments
+ mame -comment_directory C:\mame\comments
+
+.. _mame-commandline-savestate:
Core State/Playback Options
---------------------------
@@ -1706,6 +1847,8 @@ Core State/Playback Options
mame neogeo -burnin
+.. _mame-commandline-perf:
+
Core Performance Options
------------------------
@@ -1862,7 +2005,7 @@ Core Performance Options
.. _mame-commandline-lowlatency:
-**-lowlatency**
+**-[no]lowlatency**
This tells MAME to draw a new frame before throttling to reduce input
latency. This is particularly effective with VRR (Variable Refresh Rate)
@@ -1878,6 +2021,8 @@ Core Performance Options
mame bgaregga -lowlatency
+.. _mame-commandline-rotation:
+
Core Rotation Options
---------------------
@@ -1978,6 +2123,8 @@ Core Rotation Options
mame -flipy suprmrio
+.. _mame-commandline-videooptions:
+
Core Video Options
------------------
@@ -1990,35 +2137,35 @@ Core Video Options
Generally Available:
- | Using ``bgfx`` specifies the new hardware accelerated renderer.
- |
- | Using ``opengl`` tells MAME to render video using OpenGL acceleration.
- |
- | Using ``none`` displays no windows and does no drawing. This is primarily present for doing CPU benchmarks without the overhead of the video system.
- |
+ * Using ``bgfx`` specifies the new hardware accelerated renderer.
+ * Using ``opengl`` tells MAME to render video using OpenGL acceleration.
+ * Using ``none`` displays no windows and does no drawing. This is primarily
+ intended for benchmarking emulation without the overhead of the video
+ system.
On Windows:
- | Using ``gdi`` tells MAME to render video using older standard Windows graphics drawing calls. This is the slowest but most compatible option on older versions of Windows.
- |
- | Using ``d3d`` tells MAME to use Direct3D for rendering. This produces the better quality output than ``gdi`` and enables additional rendering options. It is recommended if you have a semi-recent (2002+) video card or onboard Intel video of the HD3000 line or better.
- |
+ * Using ``gdi`` tells MAME to render video using older standard Windows
+ graphics drawing calls. This is the slowest but most compatible option on
+ older versions of Windows or buggy graphics hardware drivers.
+ * Using ``d3d`` tells MAME to use Direct3D 9 for rendering. This produces
+ better quality output than ``gdi`` and enables additional rendering
+ options. It is recommended if you have a 3D-capable video card or onboard
+ Intel video of the HD3000 line or better.
On other platforms (including SDL on Windows):
- | Using ``accel`` tells MAME to render video using SDL's 2D acceleration if possible.
- |
- | Using ``soft`` uses software rendering for video output. This isn't as fast or as nice as OpenGL but will work on any platform.
- |
+ * Using ``accel`` tells MAME to render video using SDL’s 2D acceleration if
+ possible.
+ * Using ``soft`` uses software rendering for video output. This isn’t as
+ fast or as nice as OpenGL, but it will work on any platform.
Defaults:
- | The default on Windows is ``d3d``.
- |
- | The default for Mac OS X is ``opengl`` because OS X is guaranteed to have a compliant OpenGL stack.
- |
- | The default on all other systems is ``soft``.
- |
+ * The default on Windows is ``d3d``.
+ * The default for macOS is ``opengl`` because OS X is guaranteed to have a
+ compliant OpenGL stack.
+ * The default on all other systems is ``soft``.
Example:
.. code-block:: bash
@@ -2232,6 +2379,8 @@ Core Video Options
mame dkong -nounevenstretch
+.. _mame-commandline-fullscreen:
+
Core Full Screen Options
------------------------
@@ -2257,6 +2406,8 @@ Core Full Screen Options
mame kof97 -video d3d -switchres -resolution 1280x1024
+.. _mame-commandline-windowoptions:
+
Core Per-Window Options
-----------------------
@@ -2422,6 +2573,8 @@ Core Per-Window Options
mame contra -view native
+.. _mame-commandline-artwork:
+
Core Artwork Options
--------------------
@@ -2475,6 +2628,8 @@ Core Artwork Options
mame galaga -override_artwork puckman
+.. _mame-commandline-screenoptions:
+
Core Screen Options
-------------------
@@ -2569,6 +2724,8 @@ Core Screen Options
mame pacman -effect scanlines
+.. _mame-commandline-vectoroptions:
+
Core Vector Options
-------------------
@@ -2649,12 +2806,14 @@ Core Vector Options
mame asteroid -flicker 0.15
-Core Video OpenGL Debugging Options
------------------------------------
+.. _mame-commandline-opengloptions:
+
+Core Video OpenGL Feature Options
+---------------------------------
These options are for compatibility in **-video opengl**. If you report
-rendering artifacts you may be asked to try messing with them by the devs, but
-normally they should be left at their defaults which results in the best
+rendering artifacts you may be asked to try messing with them by the developers,
+but normally they should be left at their defaults which results in the best
possible video performance.
.. Tip:: Examples are not provided for these options as MAMEdev will provide
@@ -2693,16 +2852,18 @@ possible video performance.
The default is ON. (**-gl_pbo**)
+.. _mame-commandline-openglglsl:
+
Core Video OpenGL GLSL Options
------------------------------
.. _mame-commandline-glglsl:
-**-gl_glsl**
+**-[no]gl_glsl**
Enable OpenGL GLSL, if available.
- The default is OFF.
+ The default is OFF (**-nogl_glsl**).
Example:
.. code-block:: bash
@@ -2765,19 +2926,7 @@ Core Video OpenGL GLSL Options
mame suprmrio -gl_glsl -glsl_shader_screen0 gaussx -glsl_shader_screen1 gaussy -glsl_shader_screen2 CRT-geom-halation
-.. _mame-commandline-glglslvidattr:
-
-**-gl_glsl_vid_attr**
-
- Enable OpenGL GLSL handling of brightness and contrast.
- Better RGB system performance.
-
- Default is ``on``.
-
- Example:
- .. code-block:: bash
-
- mame pacman -gl_glsl -gl_glsl_vid_attr off
+.. _mame-commandline-soundoptions:
Core Sound Options
------------------
@@ -2828,11 +2977,14 @@ Core Sound Options
**-volume** / **-vol** *<value>*
- Sets the startup volume. It can later be changed with the user interface
- (see Keys section). The volume is an attenuation in dB: e.g.,
- "**-volume -12**" will start with -12dB attenuation.
+ Sets the initial sound volume. It can be changed later with the user
+ interface (see Keys section). The volume is an attenuation in decibels:
+ e.g. "**-volume -12**" will start with -12 dB attenuation. Note that if the
+ volume is changed in the user interface it will be saved to the
+ configuration file for the system. The value from the configuration file
+ for the system has priority over ``volume`` settings in general INI files.
- The default is ``0``.
+ The default is ``0`` (no attenuation, or full volume).
Example:
.. code-block:: bash
@@ -2904,11 +3056,11 @@ Core Sound Options
The default is ``1``.
- | For PortAudio, see the section on :ref:`-pa_latency <mame-commandline-pa-latency>`.
- | XAudio2 calculates audio_latency as 10ms steps.
- | DSound calculates audio_latency as 10ms steps.
- | CoreAudio calculates audio_latency as 25ms steps.
- | SDL calculates audio_latency as Xms steps.
+ * For PortAudio, see the section on :ref:`-pa_latency <mame-commandline-palatency>`.
+ * XAudio2 calculates audio_latency as 10ms steps.
+ * DSound calculates audio_latency as 10ms steps.
+ * CoreAudio calculates audio_latency as 25ms steps.
+ * SDL calculates audio_latency as Xms steps.
Example:
.. code-block:: bash
@@ -2916,6 +3068,8 @@ Core Sound Options
mame galaga -audio_latency 1
+.. _mame-commandline-inputoptions:
+
Core Input Options
------------------
@@ -2961,7 +3115,16 @@ Core Input Options
Controls whether or not MAME makes use of mouse controllers. When this is
enabled, you will likely be unable to use your mouse for other purposes
- until you exit or pause the system.
+ until you exit or pause the system. Supported mouse controllers depend on
+ your :ref:`mouseprovider setting <mame-commandline-mouseprovider>`.
+
+ Note that if this setting is off (**-nomouse**), mouse input may still be
+ enabled depending on the inputs present on the emulated system and your
+ :ref:`automatic input enable settings <mame-commandline-inputenable>`. In
+ particular, the default is to enable mouse input when the emulated system
+ has mouse inputs (**-mouse_device mouse**), so MAME will capture your mouse
+ pointer when you run a system with mouse inputs unless you also change
+ the **mouse_device** setting.
The default is OFF (**-nomouse**).
@@ -2974,11 +3137,17 @@ Core Input Options
**-[no]joystick** / **-[no]joy**
- Controls whether or not MAME makes use of joystick/gamepad controllers.
+ Controls whether or not MAME makes use of game controllers (e.g. joysticks,
+ gamepads and simulation controls). Supported game controllers depend on
+ your :ref:`joystickprovider setting <mame-commandline-joystickprovider>`.
When this is enabled, MAME will ask the system about which controllers are
connected.
+ Note that if this setting is off (**-nojoystick**), joystick input may still
+ be enabled depending on the inputs present on the emulated system and your
+ :ref:`automatic input enable settings <mame-commandline-inputenable>`.
+
The default is OFF (**-nojoystick**).
Example:
@@ -2991,8 +3160,14 @@ Core Input Options
**-[no]lightgun** / **-[no]gun**
Controls whether or not MAME makes use of lightgun controllers. Note that
- most lightguns map to the mouse, so using **-lightgun** and **-mouse**
- together may produce strange results.
+ most lightguns also produce mouse input, so enabling mouse and lightgun
+ controllers simultaneously (using **-lightgun** and **-mouse** together) may
+ produce strange behaviour. Supported lightgun controllers depend on your
+ :ref:`lightgunprovider setting <mame-commandline-lightgunprovider>`.
+
+ Note that if this setting is off (**-nolightgun**), lightgun input may still
+ be enabled depending on the inputs present on the emulated system and your
+ :ref:`automatic input enable settings <mame-commandline-inputenable>`.
The default is OFF (**-nolightgun**).
@@ -3134,17 +3309,17 @@ Core Input Options
map. Below is an example map for an 8-way joystick that matches the
picture shown above:
- +-------------+--------------------------------------------------------+
- | | 777888999 | |
- | | 777888999 | | Note that the numeric digits correspond to the keys |
- | | 777888999 | | on a numeric keypad. So '7' maps to up+left, '4' maps|
- | | 444555666 | | to left, '5' maps to neutral, etc. In addition to the|
- | | 444555666 | | numeric values, you can specify the character 's', |
- | | 444555666 | | which means "sticky". Sticky map positions will keep|
- | | 111222333 | | the output the same as the last non-sticky input sent|
- | | 111222333 | | to the system. |
- | | 111222333 | |
- +-------------+--------------------------------------------------------+
+ +-------------+--------------------------------------------------------+
+ | | 777888999 | |
+ | | 777888999 | | Note that the numeric digits correspond to the keys |
+ | | 777888999 | | on a numeric keypad. So '7' maps to up+left, '4' maps|
+ | | 444555666 | | to left, '5' maps to neutral, etc. In addition to the|
+ | | 444555666 | | numeric values, you can specify the character 's', |
+ | | 444555666 | | which means "sticky". Sticky map positions will keep|
+ | | 111222333 | | the output the same as the last non-sticky input sent|
+ | | 111222333 | | to the system. |
+ | | 111222333 | |
+ +-------------+--------------------------------------------------------+
To specify the map for this parameter, you can specify a string of rows
separated by a '.' (which indicates the end of a row), like so:
@@ -3193,17 +3368,17 @@ Core Input Options
This map would look somewhat like:
- +-------------+---------------------------------------------------------+
- | | s8888888s | |
- | | 4s88888s6 | | For this mapping, we have a wide range for the |
- | | 44s888s66 | | cardinal directions on 8, 4, 6, and 2. We have sticky|
- | | 444555666 | | on the meeting points between those cardinal |
- | | 444555666 | | directions where the appropriate direction isn't |
- | | 444555666 | | going to be completely obvious. |
- | | 44s222s66 | |
- | | 4s22222s6 | |
- | | s2222222s | |
- +-------------+---------------------------------------------------------+
+ +-------------+---------------------------------------------------------+
+ | | s8888888s | |
+ | | 4s88888s6 | | For this mapping, we have a wide range for the |
+ | | 44s888s66 | | cardinal directions on 8, 4, 6, and 2. We have sticky|
+ | | 444555666 | | on the meeting points between those cardinal |
+ | | 444555666 | | directions where the appropriate direction isn't |
+ | | 444555666 | | going to be completely obvious. |
+ | | 44s222s66 | |
+ | | 4s22222s6 | |
+ | | s2222222s | |
+ +-------------+---------------------------------------------------------+
To specify the map for this parameter, you can specify a string of rows
separated by a '.' (which indicates the end of a row), like so:
@@ -3225,17 +3400,17 @@ Core Input Options
**-joystick_deadzone** *<value>* / **-joy_deadzone** *<value>* / **-jdz** *<value>*
- If you play with an analog joystick, the center can drift a little.
- joystick_deadzone tells how far along an axis you must move before the axis
- starts to change. This option expects a float in the range of 0.0 to 1.0.
- Where 0 is the center of the joystick and 1 is the outer limit.
+ If you play with an analog joystick, the center can drift a little.
+ joystick_deadzone tells how far along an axis you must move before the axis
+ starts to change. This option expects a float in the range of 0.0 to 1.0.
+ Where 0 is the center of the joystick and 1 is the outer limit.
- The default is ``0.3``.
+ The default is ``0.15``.
Example:
.. code-block:: bash
- mame sinistar -joystick_deadzone 0.45
+ mame sinistar -joystick_deadzone 0.3
.. _mame-commandline-joysticksaturation:
@@ -3254,9 +3429,32 @@ Core Input Options
mame sinistar -joystick_saturation 1.0
+.. _mame-commandline-joystickthreshold:
+
+**-joystick_threshold** *<value>* / **joy_threshold** *<value>* / **-jthresh** *<value>*
+
+ When a joystick axis (or other absolute analog axis) is assigned to a
+ digital input, this controls how far it must be moved from the neutral
+ position (or centre) to be considered active or switched on. This option
+ expects a float in the range of 0.0 to 1.0, where 0 means any movement from
+ the neutral position is considered active, and 1 means only the outer limits
+ are considered active. This threshold is **not** adjusted to the range
+ between the dead zone and saturation point.
+
+ Note that if a :ref:`joystick map <mame-commandline-joystickmap>` is
+ configured, that will take precedence over this setting when a joystick’s
+ main X/Y axes are assigned to digital inputs.
+
+ The default is ``0.3``.
+
+ Example:
+ .. code-block:: bash
+
+ mame raiden -joystick_threshold 0.2
+
.. _mame-commandline-natural:
-**\-natural**
+**\-[no]natural**
Allows user to specify whether or not to use a natural keyboard or not.
This allows you to start your system in a 'native' mode, depending on your
@@ -3270,18 +3468,22 @@ Core Input Options
presses/releases the emulated key.
In "natural keyboard" mode, MAME attempts to translate characters to
- keystrokes. The OS translates keystrokes to characters
- (similarly when you type into a text editor), and MAME attempts to translate
- these characters to emulated keystrokes.
+ keystrokes. The OS translates keystrokes to characters (similarly to when
+ you type into a text editor), and MAME attempts to translate these
+ characters to emulated keystrokes.
**There are a number of unavoidable limitations in "natural keyboard" mode:**
- * The emulated system driver and/or keyboard device or has to support it.
- * The selected keyboard *must* match the keyboard layout selected in the emulated OS!
- * Keystrokes that don't produce characters can't be translated. (e.g. pressing a modifier on its own such as **shift**, **ctrl**, or **alt**)
- * Holding a key until the character repeats will cause the emulated key to be pressed repeatedly as opposed to being held down.
- * Dead key sequences are cumbersome to use at best.
- * It won't work at all if IME edit is involved. (e.g. for Chinese/Japanese/Korean)
+ * The emulated system driver and/or keyboard device has to support it.
+ * The selected keyboard layout *must* match the keyboard layout selected in
+ the emulated OS!
+ * Keystrokes that don’t produce characters can’t be translated (e.g.
+ pressing a modifier on its own such as **shift**, **ctrl**, or **alt**).
+ * Holding a key until the character repeats will cause the emulated key to
+ be pressed repeatedly as opposed to being held down.
+ * Dead key sequences are cumbersome to use at best.
+ * It won’t work at all if IME edit is involved (e.g. for Chinese, Japanese
+ or Korean language input).
Example:
.. code-block:: bash
@@ -3290,7 +3492,7 @@ Core Input Options
.. _mame-commandline-joystickcontradictory:
-**-joystick_contradictory**
+**-[no]joystick_contradictory**
Enable contradictory direction digital joystick input at the same time such
as **Left and Right** or **Up and Down** at the same time.
@@ -3317,6 +3519,8 @@ Core Input Options
mame contra -coin_impulse 1
+.. _mame-commandline-inputenable:
+
Core Input Automatic Enable Options
-----------------------------------
@@ -3352,21 +3556,34 @@ Core Input Automatic Enable Options
**-mouse_device** ( ``none`` | ``keyboard`` | ``mouse`` | ``lightgun`` | ``joystick`` )
- Each of these options controls autoenabling the mouse, joystick, or lightgun
- depending on the presence of a particular class of analog control for a
- particular system. For example, if you specify the option
- **-paddle mouse**, then any game that has a paddle control will
- automatically enable mouse controls just as if you had explicitly specified
- **-mouse**.
+ Each of these options sets whether mouse, joystick or lightgun controllers
+ should be enabled when running an emulated system that uses a particular
+ class of analog inputs. These options can effectively set
+ :ref:`-mouse <mame-commandline-nomouse>`, :ref:`-joystick
+ <mame-commandline-nojoystick>` and/or :ref:`-lightgun
+ <mame-commandline-nolightgun>` depending on the type of inputs present on
+ the emulated system. Note that these options *will not* override explicit
+ **-nomouse**, **-nojoystick** and/or **-nolightgun** settings at a higher
+ priority level (e.g. in a more specific INI file or on the command line).
+
+ For example, if you specify the option **-paddle_device mouse**, then mouse
+ controls will automatically be enabled when you run a game that has paddle
+ controls (e.g. Super Breakout), even if you specified **-nomouse** .
+
+ The default is to automatically enable mouse controls when running emulated
+ systems with mouse inputs (**-mouse_device mouse**).
Example:
.. code-block:: bash
mame sbrkout -paddle_device mouse
-.. Tip:: Note that these controls override the values of **-[no]mouse**,
- **-[no]joystick**, etc.
+.. Tip:: Note that these settings can override **-nomouse**, **-nojoystick**
+ and/or **-nolightgun** depending on the inputs present on the emulated
+ system.
+
+.. _mame-commandline-debugging:
Debugging Options
-----------------
@@ -3570,6 +3787,8 @@ Debugging Options
mame marble -debug -debugger_font "Comic Sans MS" -debugger_font_size 16
+.. _mame-commandline-commoptions:
+
Core Communication Options
--------------------------
@@ -3645,6 +3864,8 @@ Core Communication Options
mame arescue -comm_remotehost 192.168.1.3 -comm_remoteport 30100 -comm_framesync
+.. _mame-commandline-miscoptions:
+
Core Misc Options
-----------------
@@ -3663,7 +3884,7 @@ Core Misc Options
.. _mame-commandline-drcusec:
-**\-drc_use_c**
+**\-[no]drc_use_c**
Force DRC to use the C code backend.
@@ -3676,7 +3897,7 @@ Core Misc Options
.. _mame-commandline-drcloguml:
-**\-drc_log_uml**
+**\-[no]drc_log_uml**
Write DRC UML disassembly log.
@@ -3689,7 +3910,7 @@ Core Misc Options
.. _mame-commandline-drclognative:
-**\-drc_log_native**
+**\-[no]drc_log_native**
Write DRC native disassembly log.
@@ -3705,8 +3926,8 @@ Core Misc Options
**-bios** *<biosname>*
Specifies the specific BIOS to use with the current system, for systems that
- make use of a BIOS. The **-listxml** output will list all of the possible
- BIOS names for a system.
+ make use of a BIOS. The **-listbios** output will list all of the possible
+ BIOS names for a system, as does the **-listxml** output.
The default is ``default``.
@@ -3788,7 +4009,7 @@ Core Misc Options
.. _mame-commandline-confirmquit:
-**\-confirm_quit**
+**\-[no]confirm_quit**
Display a Confirm Quit dialog to screen on exit, requiring one extra step
to exit MAME.
@@ -3802,7 +4023,7 @@ Core Misc Options
.. _mame-commandline-uimouse:
-**\-ui_mouse**
+**\-[no]ui_mouse**
Displays a mouse cursor when using the built-in UI for MAME.
@@ -3841,6 +4062,8 @@ Core Misc Options
mame galaga88 -nonvram_save
+.. _mame-commandline-scripting:
+
Scripting Options
-----------------
@@ -3930,8 +4153,11 @@ Scripting Options
mame alcon -noplugin cheat
+.. _mame-commandline-webserver:
+
HTTP Server Options
-------------------
+
.. _mame-commandline-http:
**-[no]http**
@@ -3969,13 +4195,15 @@ HTTP Server Options
Example:
.. code-block:: bash
- mame apple2 -http -http_port 6502 -http_root c:\users\me\appleweb\root
+ mame apple2 -http -http_port 6502 -http_root C:\Users\me\appleweb\root
+
+.. _mame-commandline-portaudio:
PortAudio Options
-----------------
-.. _mame-commandline-pa-api:
+.. _mame-commandline-paapi:
**-pa_api** *API*
@@ -4031,7 +4259,7 @@ PortAudio Options
mame suprmrio -sound portaudio -pa_api "Windows WASAPI"
-.. _mame-commandline-pa-device:
+.. _mame-commandline-padevice:
**-pa_device** *device*
@@ -4045,7 +4273,7 @@ PortAudio Options
mame suprmrio -sound portaudio -pa_api "Windows WASAPI" -pa_device "NX-EDG27 (NVIDIA High Definition Audio)"
-.. _mame-commandline-pa-latency:
+.. _mame-commandline-palatency:
**-pa_latency** *latency*
diff --git a/docs/source/commandline/commandline-index.rst b/docs/source/commandline/commandline-index.rst
index b0cd9a51170..50500066d6f 100644
--- a/docs/source/commandline/commandline-index.rst
+++ b/docs/source/commandline/commandline-index.rst
@@ -1,33 +1,36 @@
.. _index-commandline:
-Commandline Index
-=================
+Command-line Index
+==================
-This is a complete index of all commandline options and commands for MAME, suitable for quickly finding a given command.
+This is a complete index of all command-line options and verbs for MAME,
+suitable for quickly finding a given option.
-Universal Commandline Options
------------------------------
-This section contains configuration options that are applicable to *all* MAME sub-builds (both SDL and Windows native).
+Universal Command-line Options
+------------------------------
+This section contains configuration options that are applicable to *all* MAME
+configurations (including both SDL and Windows native).
-Core Commands
-~~~~~~~~~~~~~
+
+Core Verbs
+~~~~~~~~~~
| :ref:`help <mame-commandline-help>`
| :ref:`validate <mame-commandline-validate>`
-Configuration Commands
-~~~~~~~~~~~~~~~~~~~~~~
+Configuration Verbs
+~~~~~~~~~~~~~~~~~~~
| :ref:`createconfig <mame-commandline-createconfig>`
| :ref:`showconfig <mame-commandline-showconfig>`
| :ref:`showusage <mame-commandline-showusage>`
-Frontend Commands
-~~~~~~~~~~~~~~~~~
+Frontend Verbs
+~~~~~~~~~~~~~~
| :ref:`listxml <mame-commandline-listxml>`
| :ref:`listfull <mame-commandline-listfull>`
@@ -36,6 +39,7 @@ Frontend Commands
| :ref:`listbrothers <mame-commandline-listbrothers>`
| :ref:`listcrc <mame-commandline-listcrc>`
| :ref:`listroms <mame-commandline-listroms>`
+| :ref:`listbios <mame-commandline-listbios>`
| :ref:`listsamples <mame-commandline-listsamples>`
| :ref:`verifyroms <mame-commandline-verifyroms>`
| :ref:`verifysamples <mame-commandline-verifysamples>`
@@ -53,15 +57,19 @@ OSD-related Options
~~~~~~~~~~~~~~~~~~~
| :ref:`uimodekey <mame-commandline-uimodekey>`
+| :ref:`controller_map <mame-commandline-controllermap>`
+| :ref:`background_input <mame-commandline-backgroundinput>`
| :ref:`uifontprovider <mame-commandline-uifontprovider>`
| :ref:`keyboardprovider <mame-commandline-keyboardprovider>`
| :ref:`mouseprovider <mame-commandline-mouseprovider>`
| :ref:`lightgunprovider <mame-commandline-lightgunprovider>`
| :ref:`joystickprovider <mame-commandline-joystickprovider>`
+| :ref:`midiprovider <mame-commandline-midiprovider>`
+| :ref:`networkprovider <mame-commandline-networkprovider>`
-OSD CLI Options
-~~~~~~~~~~~~~~~
+OSD CLI Verbs
+~~~~~~~~~~~~~
| :ref:`listmidi <mame-commandline-listmidi>`
| :ref:`listnetwork <mame-commandline-listnetwork>`
@@ -117,9 +125,8 @@ Core State/Playback Options
| :ref:`state <mame-commandline-state>`
| :ref:`[no]autosave <mame-commandline-noautosave>`
| :ref:`playback <mame-commandline-playback>`
-| :ref:`exit_after_playback <mame-commandline-exitafterplayback>`
+| :ref:`[no]exit_after_playback <mame-commandline-exitafterplayback>`
| :ref:`record <mame-commandline-record>`
-| :ref:`record_timecode <mame-commandline-recordtimecode>`
| :ref:`mngwrite <mame-commandline-mngwrite>`
| :ref:`aviwrite <mame-commandline-aviwrite>`
| :ref:`wavwrite <mame-commandline-wavwrite>`
@@ -143,7 +150,7 @@ Core Performance Options
| :ref:`[no]refreshspeed <mame-commandline-norefreshspeed>`
| :ref:`numprocessors <mame-commandline-numprocessors>`
| :ref:`bench <mame-commandline-bench>`
-| :ref:`lowlatency <mame-commandline-lowlatency>`
+| :ref:`[no]lowlatency <mame-commandline-lowlatency>`
Core Rotation Options
@@ -212,6 +219,7 @@ Core Vector Options
| :ref:`beam_width_min <mame-commandline-beamwidthmin>`
| :ref:`beam_width_max <mame-commandline-beamwidthmax>`
| :ref:`beam_intensity_weight <mame-commandline-beamintensityweight>`
+| :ref:`beam_dot_size <mame-commandline-beamdotsize>`
| :ref:`flicker <mame-commandline-flicker>`
@@ -227,11 +235,10 @@ Core Video OpenGL Debugging Options
Core Video OpenGL GLSL Options
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-| :ref:`gl_glsl <mame-commandline-glglsl>`
+| :ref:`[no]gl_glsl <mame-commandline-glglsl>`
| :ref:`gl_glsl_filter <mame-commandline-glglslfilter>`
| :ref:`glsl_shader_mame[0-9] <mame-commandline-glslshadermame>`
| :ref:`glsl_shader_screen[0-9] <mame-commandline-glslshaderscreen>`
-| :ref:`gl_glsl_vid_attr <mame-commandline-glglslvidattr>`
Core Sound Options
@@ -261,8 +268,9 @@ Core Input Options
| :ref:`joystick_map <mame-commandline-joystickmap>`
| :ref:`joystick_deadzone <mame-commandline-joystickdeadzone>`
| :ref:`joystick_saturation <mame-commandline-joysticksaturation>`
-| :ref:`natural <mame-commandline-natural>`
-| :ref:`joystick_contradictory <mame-commandline-joystickcontradictory>`
+| :ref:`joystick_threshold <mame-commandline-joystickthreshold>`
+| :ref:`[no]natural <mame-commandline-natural>`
+| :ref:`[no]joystick_contradictory <mame-commandline-joystickcontradictory>`
| :ref:`coin_impulse <mame-commandline-coinimpulse>`
@@ -286,9 +294,11 @@ Core Debugging Options
| :ref:`[no]oslog <mame-commandline-oslog>`
| :ref:`[no]log <mame-commandline-log>`
| :ref:`[no]debug <mame-commandline-debug>`
+| :ref:`debugger <mame-commandline-debugger>`
| :ref:`debugscript <mame-commandline-debugscript>`
| :ref:`[no]update_in_pause <mame-commandline-updateinpause>`
| :ref:`watchdog <mame-commandline-watchdog>`
+| :ref:`debugger_port <mame-commandline-debuggerport>`
| :ref:`debugger_font <mame-commandline-debuggerfont>`
| :ref:`debugger_font_size <mame-commandline-debuggerfontsize>`
@@ -307,23 +317,23 @@ Core Misc Options
~~~~~~~~~~~~~~~~~
| :ref:`[no]drc <mame-commandline-drc>`
-| :ref:`drc_use_c <mame-commandline-drcusec>`
-| :ref:`drc_log_uml <mame-commandline-drcloguml>`
-| :ref:`drc_log_native <mame-commandline-drclognative>`
+| :ref:`[no]drc_use_c <mame-commandline-drcusec>`
+| :ref:`[no]drc_log_uml <mame-commandline-drcloguml>`
+| :ref:`[no]drc_log_native <mame-commandline-drclognative>`
| :ref:`bios <mame-commandline-bios>`
| :ref:`[no]cheat <mame-commandline-cheat>`
| :ref:`[no]skip_gameinfo <mame-commandline-skipgameinfo>`
| :ref:`uifont <mame-commandline-uifont>`
| :ref:`ui <mame-commandline-ui>`
| :ref:`ramsize <mame-commandline-ramsize>`
-| :ref:`confirm_quit <mame-commandline-confirmquit>`
-| :ref:`ui_mouse <mame-commandline-uimouse>`
+| :ref:`[no]confirm_quit <mame-commandline-confirmquit>`
+| :ref:`[no]ui_mouse <mame-commandline-uimouse>`
| :ref:`language <mame-commandline-language>`
| :ref:`[no]nvram_save <mame-commandline-nvramsave>`
Scripting Options
------------------
+~~~~~~~~~~~~~~~~~
| :ref:`autoboot_command <mame-commandline-autobootcommand>`
| :ref:`autoboot_delay <mame-commandline-autobootdelay>`
@@ -335,15 +345,26 @@ Scripting Options
HTTP Server Options
--------------------
+~~~~~~~~~~~~~~~~~~~
| :ref:`http <mame-commandline-http>`
| :ref:`http_port <mame-commandline-httpport>`
| :ref:`http_root <mame-commandline-httproot>`
-Windows-Specific Commandline Options
-------------------------------------
+PortAudio Options
+~~~~~~~~~~~~~~~~~
+
+| :ref:`pa_api <mame-commandline-paapi>`
+| :ref:`pa_device <mame-commandline-padevice>`
+| :ref:`pa_latency <mame-commandline-palatency>`
+
+
+Windows-Specific Command-line Options
+-------------------------------------
+
+This section contains configuration options that are specific to the native
+(non-SDL) Windows version of MAME.
Windows Performance Options
@@ -368,16 +389,18 @@ Windows Input Device Options
| :ref:`[no]dual_lightgun <mame-wcommandline-duallightgun>`
-SDL-Specific Commandline Options
---------------------------------
-This section contains configuration options that are specific to any build supported by SDL (including Windows where compiled as SDL instead of native).
+SDL-Specific Command-line Options
+---------------------------------
+
+This section contains configuration options that are specific to any build
+supported by SDL (including Windows when built with SDL instead of native).
SDL Performance Options
~~~~~~~~~~~~~~~~~~~~~~~
-| :ref:`sdlvideofps <mame-scommandline-sdlvideofps>`
+| :ref:`[no]sdlvideofps <mame-scommandline-sdlvideofps>`
SDL Video Options
@@ -403,10 +426,15 @@ SDL Keyboard Mapping
SDL Joystick Mapping
~~~~~~~~~~~~~~~~~~~~
-| :ref:`joyidx <mame-scommandline-joyidx>`
| :ref:`sixaxis <mame-scommandline-sixaxis>`
+SDL Lightgun Mapping
+~~~~~~~~~~~~~~~~~~~~
+
+| :ref:`lightgun_index <mame-scommandline-lightgunindex>`
+
+
SDL Low-level Driver Options
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/docs/source/commandline/index.rst b/docs/source/commandline/index.rst
index 4237c7f30f4..a03fe113708 100644
--- a/docs/source/commandline/index.rst
+++ b/docs/source/commandline/index.rst
@@ -1,11 +1,11 @@
-MAME Commandline Usage and OS-Specific Configuration
-----------------------------------------------------
+MAME Command-line Usage and OS-Specific Configuration
+-----------------------------------------------------
.. toctree::
- :titlesonly:
+ :titlesonly:
- commandline-all
- windowsconfig
- sdlconfig
+ commandline-all
+ windowsconfig
+ sdlconfig
- commandline-index
+ commandline-index
diff --git a/docs/source/commandline/sdlconfig.rst b/docs/source/commandline/sdlconfig.rst
index 0da5f4c526e..ad9b5a47de8 100644
--- a/docs/source/commandline/sdlconfig.rst
+++ b/docs/source/commandline/sdlconfig.rst
@@ -1,8 +1,8 @@
SDL-Specific Commandline Options
================================
-
-This section contains configuration options that are specific to any build supported by SDL (including Windows where compiled as SDL instead of native).
+This section contains configuration options that are specific to any build
+supported by SDL (including Windows when built with SDL instead of native).
@@ -11,9 +11,11 @@ Performance Options
.. _mame-scommandline-sdlvideofps:
-**-sdlvideofps**
+**-[no]sdlvideofps**
- Enable output of benchmark data on the SDL video subsystem, including your system's video driver, X server (if applicable), and OpenGL stack in **-video opengl** mode.
+ Enable output of benchmark data on the SDL video subsystem, including your
+ system’s video driver, X server (if applicable), and OpenGL stack in
+ **-video opengl** mode.
Video Options
@@ -23,13 +25,13 @@ Video Options
**-[no]centerh**
- Center horizontally within the view area. Default is ON (**-centerh**).
+ Center horizontally within the view area. Default is ON (**-centerh**).
.. _mame-scommandline-centerv:
**-[no]centerv**
- Center vertically within the view area. Default is ON (**-centerv**).
+ Center vertically within the view area. Default is ON (**-centerv**).
Video Soft-Specific Options
@@ -39,7 +41,8 @@ Video Soft-Specific Options
**-scalemode**
- Scale mode: none, async, yv12, yuy2, yv12x2, yuy2x2 (**-video soft** only). Default is *none*.
+ Scale mode: none, async, yv12, yuy2, yv12x2, yuy2x2 (**-video soft** only).
+ Default is *none*.
SDL Keyboard Mapping
@@ -49,54 +52,59 @@ SDL Keyboard Mapping
**-keymap**
- Enable keymap. Default is OFF (**-nokeymap**)
+ Enable keymap. Default is OFF (**-nokeymap**)
.. _mame-scommandline-keymapfile:
**-keymap_file** *<file>*
- Keymap Filename. Default is ``keymap.dat``.
+ Keymap file name. Default is ``keymap.dat``.
SDL Joystick Mapping
--------------------
-.. _mame-scommandline-joyidx:
+.. _mame-scommandline-sixaxis:
-|
-| **-joy_idx1** *<name>*
-| **-joy_idx2** *<name>*
-| ...
-| **-joy_idx8** *<name>*
-|
+**-sixaxis**
-Name of joystick mapped to a given joystick slot, default is *auto*.
+ Use special handling for PlayStation 3 SixAxis controllers. May cause
+ undesirable behaviour with other controllers. Only affects the ``sdljoy``
+ joystick provider. Default is OFF (**-nosixaxis**)
-.. _mame-scommandline-sixaxis:
+SDL Lightgun Mapping
+--------------------
-**-sixaxis**
+.. _mame-scommandline-lightgunindex:
+
+|
+| **-lightgun_index1** *<name>*
+| **-lightgun_index2** *<name>*
+| ...
+| **-lightgun_index8** *<name>*
+|
- Use special handling for PS3 SixAxis controllers. Default is OFF (**-nosixaxis**)
+Device name or ID mapped to a given lightgun slot.
SDL Low-level Driver Options
-~---------------------------
+----------------------------
.. _mame-scommandline-videodriver:
**-videodriver** *<driver>*
- SDL video driver to use ('x11', 'directfb', ... or '*auto*' for SDL default)
+ SDL video driver to use ('x11', 'directfb', ... or '*auto*' for SDL default)
.. _mame-scommandline-audiodriver:
**-audiodriver** *<driver>*
- SDL audio driver to use ('alsa', 'arts', ... or '*auto*' for SDL default)
+ SDL audio driver to use ('alsa', 'arts', ... or '*auto*' for SDL default)
.. _mame-scommandline-gllib:
**-gl_lib** *<driver>*
- Alternative **libGL.so** to use; '*auto*' for system default
+ Alternative **libGL.so** to use; '*auto*' for system default
diff --git a/docs/source/commandline/windowsconfig.rst b/docs/source/commandline/windowsconfig.rst
index 85f555e9a21..1c41476854c 100644
--- a/docs/source/commandline/windowsconfig.rst
+++ b/docs/source/commandline/windowsconfig.rst
@@ -1,7 +1,8 @@
-Windows-Specific Commandline Options
-====================================
+Windows-Specific Command-line Options
+=====================================
-This section contains configuration options that are specific to the native (non-SDL) Windows version of MAME.
+This section contains configuration options that are specific to the native
+(non-SDL) Windows version of MAME.
@@ -12,7 +13,10 @@ Performance options
**-priority** *<priority>*
- Sets the thread priority for the MAME threads. By default the priority is left alone to guarantee proper cooperation with other applications. The valid range is -15 to 1, with 1 being the highest priority. The default is *0* (*NORMAL priority*).
+ Sets the thread priority for the MAME threads. By default the priority is
+ left alone to guarantee proper cooperation with other applications. The
+ valid range is -15 to 1, with 1 being the highest priority. The default is
+ *0* (*NORMAL priority*).
.. _mame-wcommandline-profile:
@@ -28,25 +32,46 @@ Full screen options
**-[no]triplebuffer** / **-[no]tb**
- Enables or disables "triple buffering". Normally, MAME just draws directly to the screen, without any fancy buffering. But with this option enabled, MAME creates three buffers to draw to, and cycles between them in order. It attempts to keep things flowing such that one buffer is currently displayed, the second buffer is waiting to be displayed, and the third buffer is being drawn to. **-triplebuffer** will override **-waitvsync**, if the buffer is successfully created. This option does not work with **-video gdi**. The default is OFF (**-notriplebuffer**).
+ Enables or disables “triple buffering”. Normally, MAME just draws directly
+ to the screen, without any fancy buffering. But with this option enabled,
+ MAME creates three buffers to draw to, and cycles between them in order. It
+ attempts to keep things flowing such that one buffer is currently displayed,
+ the second buffer is waiting to be displayed, and the third buffer is being
+ drawn to. **-triplebuffer** will override **-waitvsync**, if the buffer is
+ successfully created. This option does not work with **-video gdi**. The
+ default is OFF (**-notriplebuffer**).
.. _mame-wcommandline-fullscreenbrightness:
**-full_screen_brightness** *<value>* / **-fsb** *<value>*
- Controls the brightness, or black level, of the entire display. The standard value is 1.0. Selecting lower values (down to 0.1) will produce a darkened display, while selecting higher values (up to 2.0) will give a brighter display. Note that not all video cards have hardware to support this option. This option does not work with **-video gdi**. The default is ``1.0``.
+ Controls the brightness, or black level, of the entire display. The
+ standard value is 1.0. Lower values (down to 0.1) will produce a darkened
+ display, while higher values (up to 2.0) will give a brighter display. Note
+ that not all video cards have hardware to support this option. This option
+ does not work with **-video gdi**. The default is *1.0*.
.. _mame-wcommandline-fullscreencontrast:
**-full_screen_contrast** *<value>* / **-fsc** *<value>*
- Controls the contrast, or white level, of the entire display. The standard value is 1.0. Selecting lower values (down to 0.1) will produce a dimmer display, while selecting higher values (up to 2.0) will give a more saturated display. Note that not all video cards have hardware to support this option. This option does not work with **-video gdi**. The default is ``1.0``.
+ Controls the contrast, or white level, of the entire display. The standard
+ value is 1.0. Lower values (down to 0.1) will produce a dimmer display,
+ while higher values (up to 2.0) will give a more saturated display. Note
+ that not all video cards have hardware to support this option. This option
+ does not work with **-video gdi**. The default is *1.0*.
.. _mame-wcommandline-fullscreengamma:
**-full_screen_gamma** *<value>* / **-fsg** *<value>*
- Controls the gamma, which produces a potentially nonlinear black to white ramp, for the entire display. The standard value is 1.0, which gives a linear ramp from black to white. Selecting lower values (down to 0.1) will increase the nonlinearity toward black, while selecting higher values (up to 3.0) will push the nonlinearity toward white. Note that not all video cards have hardware to support this option. This option does not work with **-video gdi**. The default is ``1.0``.
+ Controls the gamma, which produces a potentially nonlinear black to white
+ ramp, for the entire display. The standard value is 1.0, which gives a
+ linear ramp from black to white. Lower values (down to 0.1) will increase
+ the nonlinearity toward black, while higher values (up to 3.0) will push the
+ nonlinearity toward white. Note that not all video cards have hardware to
+ support this option. This option does not work with **-video gdi**. The
+ default is *1.0*.
@@ -57,4 +82,20 @@ Input device options
**-[no]dual_lightgun** / **-[no]dual**
- Controls whether or not MAME attempts to track two lightguns connected at the same time. This option requires -lightgun. This option is a hack for supporting certain older dual lightgun setups. If you have multiple lightguns connected, you will probably just need to enable -mouse and configure each lightgun independently. The default is *OFF* (**-nodual_lightgun**).
+ Controls whether or not MAME attempts to track two lightguns that appear as
+ a single mouse. This option requires the :ref:`lightgun option
+ <mame-commandline-nolightgun>` to be on and the :ref:`lightgunprovider
+ option <mame-commandline-lightgunprovider>` to be set to *win32*.
+
+ This option supports certain older dual lightgun setups that work by setting
+ the mouse pointer location at the moment a lightgun trigger is activated.
+ The primary and secondary triggers on the first lightgun correspond to the
+ first and second mouse buttons, and the primary and secondary triggers on
+ the second lightgun correspond to the third and fourth mouse buttons.
+
+ If you have multiple lightguns connected, you will probably just need to
+ enable the :ref:`lightgun option <mame-commandline-nolightgun>`, use the
+ default :ref:`lightgunprovider option <mame-commandline-lightgunprovider>`
+ of *rawinput*, and configure each lightgun individually.
+
+ The default is OFF (**-nodual_lightgun**).
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 95dc1d19bbf..8251128d44c 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -56,16 +56,16 @@ master_doc = 'index'
# General information about the project.
project = u'MAME Documentation'
-copyright = u'1997-2021, MAMEdev and contributors'
+copyright = u'1997-2023, MAMEdev and contributors'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
-version = '0.238'
+version = '0.254'
# The full version, including alpha/beta/rc tags.
-release = '0.238'
+release = '0.254'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/docs/source/contributing/cxx.rst b/docs/source/contributing/cxx.rst
new file mode 100644
index 00000000000..918c72032d2
--- /dev/null
+++ b/docs/source/contributing/cxx.rst
@@ -0,0 +1,573 @@
+.. _contributing-cxx:
+
+C++ Coding Guidelines
+=====================
+
+.. contents:: :local:
+
+
+.. _contributing-cxx-intro:
+
+Introduction
+------------
+
+**In terms of coding conventions, the style present within an existing
+source file should be favoured over the standards found below.**
+
+When a new source file is being created, the following coding
+conventions should be observed if creating a new file within the MAME
+core (``src/emu`` and ``src/lib``). If the source file is outside the
+core, deference can be given to a contributor’s preferred style,
+although it is strongly encouraged to code with the understanding that
+the file may need to be comprehensible by more than one person as time
+marches forward.
+
+
+.. _contributing-cxx-definitions:
+
+Definitions
+-----------
+
+Snake case
+ All lowercase letters with words separated by underscores:
+ ``this_is_snake_case``
+Screaming snake case
+ All uppercase letters with words separated by underscores:
+ ``SCREAMING_SNAKE_CASE``
+Camel case:
+ Lowercase initial letter, first letter of each subsequent word
+ capitalised, with no separators between words: ``exampleCamelCase``
+Llama case:
+ Uppercase initial letter, first letter of each subsequent word
+ capitalised, with no separators between words: ``LlamaCaseSample``
+
+
+.. _contributing-cxx-fileformat:
+
+Source file format
+------------------
+
+MAME C++ source files are encoded as UTF-8 text, assuming fixed-width
+characters, with tab stops at four-space intervals. Source files should
+end with a terminating end-of-line. Any valid printable Unicode text is
+permitted in comments. Outside comments and strings, only the printable
+ASCII subset of Unicode is permitted.
+
+The ``srcclean`` tool is used to enforce file format rules before each
+release. You can build this tool and apply it to the files you modify
+before opening a pull request to avoid conflicts or surprising changes
+later.
+
+
+.. _contributing-cxx-naming:
+
+Naming conventions
+------------------
+
+Preprocessor macros
+ Macro names should use screaming snake case. Macros are always
+ global and name conflicts can cause confusing errors – think
+ carefully about what macros really need to be in headers and name
+ them carefully.
+Include guards
+ Include guard macros should begin with ``MAME_``, and end with a
+ capitalised version of the file name, with separators replaced by
+ underscores.
+Constants
+ Constants should use screaming snake case, whether they are constant
+ globals, constant data members, enumerators or preprocessor
+ constants.
+Functions
+ Free functions names should use snake case. (There are some utility
+ function that were previously implemented as preprocessor macros
+ that still use screaming snake case.)
+Classes
+ Class names should use snake case. Abstract class names should end
+ in ``_base``. Public member functions (including static member
+ functions) should use snake case.
+Device classes
+ Concrete driver ``driver_device`` implementation names
+ conventionally end in ``_state``, while other concrete device class
+ names end in ``_device``. Concrete ``device_interface`` names
+ conventionally begin with ``device_`` and end with ``_interface``.
+Device types
+ Device types should use screaming snake case. Remember that device
+ types are names in the global namespace, so choose explicit,
+ unambiguous names.
+Enumerations
+ The enumeration name should use snake case. The enumerators should
+ use screaming snake case.
+Template parameters
+ Template parameters should use llama case (both type and value
+ parameters).
+
+Identifiers containing two consecutive underscores or starting with an
+underscore followed by an uppercase letter are always reserved and
+should not be used.
+
+Type names and other identifiers with a leading underscore should be
+avoided within the global namespace, as they are explicitly reserved
+according to the C++ standard. Additionally, identifiers suffixed with
+``_t`` should be avoided within the global namespace, as they are also
+reserved according to POSIX standards. While MAME violates this policy
+occasionally – most notably with ``device_t`` – it’s considered to be an
+unfortunate legacy decision that should be avoided in any new code.
+
+
+.. _contributing-cxx-literals:
+
+Variables and literals
+----------------------
+
+Octal literals are discouraged from use outside of specific cases. They
+lack the obvious letter-based prefixes found in hexadecimal and binary
+literals, and therefore can be difficult to distinguish at a glance from
+a decimal literal to coders who are unfamiliar with octal notation.
+
+Lower-case hexadecimal literals are preferred, e.g. ``0xbadc0de`` rather
+than ``0xBADC0DE``. For clarity, try not to exceed the bit width of the
+variable which will be used to store it.
+
+Binary literals have rarely been used in the MAME source code due to the
+``0b`` prefix not being standardised until C++14, but there is no policy
+to avoid their use.
+
+Integer suffix notation should be used when specifying 64-bit literals,
+but is not strictly required in other cases. It can, however, clarify
+the intended use of a given literal at a glance. Uppercase long integer
+literal suffixes should be used to avoid confusion with the digit 1,
+e.g. ``7LL`` rather than ``7ll``.
+
+Digit grouping should be used for longer numeric literals, as it aids in
+recognising order of magnitude or bit field positions at a glance.
+Decimal literals should use groups of three digits, and hexadecimal
+literals should use groups of four digits, outside of specific
+situations where different grouping would be easier to understand, e.g.
+``4'433'619`` or ``0xfff8'1fff``.
+
+Types that do not have a specifically defined size should be avoided if
+they are to be registered with MAME’s save-state system, as it harms
+portability. In general, this means avoiding the use of ``int`` for
+these members.
+
+It's encouraged, but not required, for class data members to be prefixed
+with ``m_`` for non-static instance members and ``s_`` for static
+members. This does not apply to nested classes or structs.
+
+
+.. _contributing-cxx-braceindent:
+
+Bracing and indentation
+-----------------------
+
+Tabs are used for initial indentation of lines, with one tab used per
+nested scope level. Statements split across multiple lines should be
+indented by two tabs. Spaces are used for alignment at other places
+within a line.
+
+Either K&R or Allman-style bracing is preferred. There is no specific
+preference for bracing on single-line statements, although bracing
+should be consistent for a given ``if/else`` block, as shown:
+
+.. code-block:: C++
+
+ if (x == 0)
+ {
+ return;
+ }
+ else
+ {
+ call_some_function();
+ x--;
+ }
+
+When using a series of ``if``/``else`` or ``if``/``else if``/``else``
+blocks with comments at the top indentation level, avoid extraneous
+newlines. The use of additional newlines may lead to ``else if`` or
+``else`` blocks being missed due to the newlines pushing the blocks
+outside the visible editor height:
+
+.. code-block:: C++
+
+ // Early-out if our hypothetical counter has run out.
+ if (x == 0)
+ {
+ return;
+ }
+ // We should do something if the counter is running.
+ else
+ {
+ call_some_function();
+ x--;
+ }
+
+Indentation for ``case`` statements inside a ``switch`` body can either
+be on the same level as the ``switch`` statement or inward by one level.
+There is no specific style which is used across all core files, although
+indenting by one level appears to be used most often.
+
+
+.. _contributing-cxx-spacing:
+
+Spacing
+-------
+
+Consistent single-spacing between binary operators, variables, and
+literals is strongly preferred. The following examples exhibit
+reasonably consistent spacing:
+
+.. code-block:: C++
+
+ uint8_t foo = (((bar + baz) + 3) & 7) << 1;
+ uint8_t foo = ((bar << 1) + baz) & 0x0e;
+ uint8_t foo = bar ? baz : 5;
+
+The following examples exhibit extremes in either direction, although
+having extra spaces is less difficult to read than having too few:
+
+.. code-block:: C++
+
+ uint8_t foo = ( ( ( bar + baz ) + 3 ) & 7 ) << 1;
+ uint8_t foo = ((bar<<1)+baz)&0x0e;
+ uint8_t foo = (bar?baz:5);
+
+A space should be used between a fundamental C++ statement and its
+opening parenthesis, e.g.:
+
+.. code-block:: C++
+
+ switch (value) ...
+ if (a != b) ...
+ for (int i = 0; i < foo; i++) ...
+
+
+.. _contributing-cxx-scoping:
+
+Scoping
+-------
+
+Variables should be scoped as narrowly as is reasonably possible. There
+are many instances of C89-style local variable declaration in the MAME
+codebase, but this is largely a hold-over from MAME’s early days, which
+pre-date the C99 specification.
+
+The following two snippets exhibit the legacy style of local variable
+declaration, followed by the more modern and preferred style:
+
+.. code-block:: C++
+
+ void example_device::some_function()
+ {
+ int i;
+ uint8_t data;
+
+ for (i = 0; i < std::size(m_buffer); i++)
+ {
+ data = m_buffer[i];
+ if (data)
+ {
+ some_other_function(data);
+ }
+ }
+ }
+
+.. code-block:: C++
+
+ void example_device::some_function()
+ {
+ for (int i = 0; i < std::size(m_buffer); i++)
+ {
+ const uint8_t data = m_buffer[i];
+ if (data)
+ {
+ some_other_function(data);
+ }
+ }
+ }
+
+Enumerated values, structs, and classes used only by one specific device
+should be declared within the device's class itself. This avoids
+pollution of the global namespace and makes the device-specific use of
+them more obvious at a glance.
+
+
+.. _contributing-cxx-const:
+
+Const Correctness
+-----------------
+
+Const-correctness has not historically been a strict requirement of code
+that goes into MAME, but there’s increasing value in it as the amount of
+code refactoring increases and technical debt decreases.
+
+When writing new code, it’s worth taking the time to determine if a
+local variable can be declared ``const``. Similarly, it's encouraged to
+consider which member functions of a new class can be ``const``
+qualified.
+
+In a similar vein, arrays of constants should be declared ``constexpr``
+and should use screaming snake case, as outlined towards the top of this
+document. Lastly, arrays of C-style strings should be declared as both
+a const array of const strings, as so:
+
+.. code-block:: C++
+
+ static const char *const EXAMPLE_NAMES[4] =
+ {
+ "1-bit",
+ "2-bit",
+ "4-bit",
+ "Invalid"
+ };
+
+
+.. _contributing-cxx-comments:
+
+Comments
+--------
+
+While ``/* ANSI C comments */`` are often found in the codebase, there
+has been a gradual shift towards ``// C++-style comments`` for
+single-line comments. This is very much a guideline, and coders are
+encouraged to use whichever style is most comfortable.
+
+Unless specifically quoting content from a machine or ancillary
+materials, comments should be in English so as to match the predominant
+language that the MAME team shares worldwide.
+
+Commented-out code should typically be removed prior to authoring a pull
+request, as it has a tendency to rot due to the fast-moving nature of
+MAME’s core API. If there is a desire known beforehand for the code to
+eventually be included, it should be bookended in ``if (0)`` or
+``if (false)``, as code removed through a preprocessor macro will rot at
+the same rate.
+
+
+.. _contributing-cxx-helpers:
+
+MAME-Specific Helpers
+---------------------
+
+When at all possible, use helper functions and macros for bit
+manipulation operations.
+
+The ``BIT(value, bit)`` helper can be used to extract the state of a bit
+at a given position from an integer value. The resulting value will be
+aligned to the least significant bit position, i.e. will be either 0 or
+1.
+
+An overload of the same function, ``BIT(value, bit, width)`` can be used
+to extract a bit field of a specified width from an integer value,
+starting at the specified bit position. The result will also be
+right-justified and will be of the same type as the incoming value.
+
+There are, additionally, a number of helpers for functionality such as
+counting leading zeroes/ones, population count, and signed/unsigned
+integer multiplication and division for both 32-bit and 64-bit results.
+Not all of these helpers have wide use in the MAME codebase, but using
+them in new code is strongly preferred when that code is performance-
+critical, as they utilise inline assembly or compiler intrinsics per-
+platform when available.
+
+``count_leading_zeros_32/64(T value)``
+ Accepts an unsigned 32/64-bit value and returns an unsigned 8-bit
+ value containing the number of consecutive zeros starting from the
+ most significant bit.
+``count_leading_ones_32/64(T value)``
+ Same functionality as above, but examining consecutive one-bits.
+``population_count_32/64(T value)``
+ Accepts an unsigned 32/64-bit value and returns the number of
+ one-bits found, i.e. the Hamming weight of the value.
+``rotl_32/64(T value, int shift)``
+ Performs a circular/barrel left shift of an unsigned 32/64-bit value
+ with the specified shift value. The shift value will be masked to
+ the valid bit range for a 32-bit or 64-bit value.
+``rotr_32/64(T value, int shift)``
+ Same functionality as above, but with a right shift.
+
+For documentation on helpers related to multiplication and division,
+refer to ``src/osd/eminline.h``.
+
+
+.. _contributing-cxx-logging:
+
+Logging
+-------
+
+MAME has multiple logging function for different purposes. Two of the
+most frequently used logging functions are ``logerror`` and
+``osd_printf_verbose``:
+
+* Devices inherit a ``logerror`` member function. This automatically
+ includes the fully-qualified tag of the invoking device in log
+ messages. Output is sent to MAME’s debugger’s rotating log buffer if
+ the debugger is enabled. If the
+ :ref:`-log option <mame-commandline-log>` is enabled, it’s also
+ written to the file ``error.log`` in the working directory. If the
+ :ref:`-oslog option <mame-commandline-oslog>` is enabled, it’s
+ additionally sent to the OS diagnostic output (the host debugger
+ diagnostic log on Windows if a host debugger is attached, or standard
+ error otherwise).
+* The output of the ``osd_printf_verbose`` function is sent to standard
+ error if the :ref:`-verbose option <mame-commandline-verbose>` is
+ enabled.
+
+The ``osd_printf_verbose`` function should be used for logging that is
+useful for diagnosing user issues, while ``logerror`` should be used for
+messages more relevant to developers (either developing MAME itself, or
+developing software for emulated systems using MAME’s debugger).
+
+For debug logging, a channel-based logging system exists via the header
+``logmacro.h``. It can be used as a generic logging system as follows,
+without needing to make use of its ability to mask out specific
+channels:
+
+.. code-block:: C++
+
+ // All other headers in the .cpp file should be above this line.
+ #define VERBOSE (1)
+ #include "logmacro.h"
+ ...
+ void some_device::some_reg_write(u8 data)
+ {
+ LOG("%s: some_reg_write: %02x\n", machine().describe_context(), data);
+ }
+
+The above example also makes use of a helper function which is available
+in all derivatives of ``device_t``: ``machine().describe_context()``.
+This function will return a string that describes the emulation context
+in which the function is being run. This includes the fully-qualified
+tag of the currently executing device (if any). If the relevant device
+implements ``device_state_interface``, it will also include the current
+program-counter value reported by the device.
+
+For more fine-grained control, specific bit masks can be defined and
+used via the ``LOGMASKED`` macro:
+
+.. code-block:: C++
+
+ // All other headers in the .cpp file should be above this line.
+ #define LOG_FOO (1 << 1U)
+ #define LOG_BAR (1 << 2U)
+
+ #define VERBOSE (LOG_FOO | LOG_BAR)
+ #include "logmacro.h"
+ ...
+ void some_device::some_reg_write(u8 data)
+ {
+ LOGMASKED(LOG_FOO, "some_reg_write: %02x\n", data);
+ }
+
+ void some_device::another_reg_write(u8 data)
+ {
+ LOGMASKED(LOG_BAR, "another_reg_write: %02x\n", data);
+ }
+
+Note that the least significant bit position for user-supplied masks is
+1, as bit position 0 is reserved for ``LOG_GENERAL``.
+
+By default, ``LOG`` and ``LOGMASKED`` will use the device-supplied
+``logerror`` function. However, this can be redirected as desired. The
+most common use case would be to direct output to the standard output
+instead, which can be accomplished by explicitly defining
+``LOG_OUTPUT_FUNC`` as so:
+
+.. code-block:: C++
+
+ #define LOG_OUTPUT_FUNC osd_printf_info
+
+A developer should always ensure that ``VERBOSE`` is set to 0 and that
+any definition of ``LOG_OUTPUT_FUNC`` is commented out prior to opening
+a pull request.
+
+
+.. _contributing-cxx-structure:
+
+Structural organization
+-----------------------
+
+All C++ source files must begin with a two comments listing the
+distribution license and copyright holders in a standard format.
+Licenses are specified by their SPDX short identifier if available.
+Here is an example of the standard format:
+
+.. code-block:: C++
+
+ // license:BSD-3-Clause
+ // copyright-holders:David Haywood, Tomasz Slanina
+
+Header includes should generally be grouped from most-dependent to
+least-dependent, and sorted alphabetically within said groups:
+
+* The project prefix header, ``emu.h``, must be the first thing in a
+ translation unit
+* Local project headers (i.e. headers found in the same source
+ directory)
+* Headers in ``src/devices``
+* Headers in ``src/emu``
+* Headers in ``src/lib/formats``
+* Headers in ``src/lib/util``
+* Headers from the OSD layer
+* C++ standard library headers
+* C standard library headers
+* OS-specific headers
+* Layout headers
+
+Finally, task-specific headers such as ``logmacro.h`` - described in the
+previous section - should be included last. A practical example
+follows:
+
+.. code-block:: C++
+
+ #include "emu.h"
+
+ #include "cpu/m68000/m68000.h"
+ #include "machine/mc68328.h"
+ #include "machine/ram.h"
+ #include "sound/dac.h"
+ #include "video/mc68328lcd.h"
+ #include "video/sed1375.h"
+
+ #include "emupal.h"
+ #include "screen.h"
+ #include "speaker.h"
+
+ #include "pilot1k.lh"
+
+ #define VERBOSE (0)
+ #include "logmacro.h"
+
+In most cases, the class declaration for a system driver should be
+within the corresponding source file along with the implementation. In
+such cases, the class declaration and all contents of the source file,
+excluding the ``GAME``, ``COMP``, or ``CONS`` macro, should be enclosed
+in an anonymous namespace (this produces better compiler diagnostics,
+allows more aggressive optimisation, reduces the chance of duplicate
+symbols, and reduces linking time).
+
+Within a class declaration, there should be one section for each member
+access level (``public``, ``protected`` and ``private``) if practical.
+This may not be possible in cases where private constants and/or types
+need to be declared before public members. Members should use the least
+public access level necessary. Overridden virtual member functions
+should generally use the same access level as the corresponding member
+function in the base class.
+
+Class member declarations should be grouped to aid understanding:
+
+* Within a member access level section, constants, types, data members,
+ instance member functions and static member functions should be
+ grouped.
+* In device classes, configuration member functions should be grouped
+ separately from live signal member functions.
+* Overridden virtual member functions should be grouped according to the
+ base classes they are inherited from.
+
+For classes with multiple overloaded constructors, constructor
+delegation should be used where possible to avoid repeated member
+initialiser lists.
+
+Constants which are used by a device or machine driver should be in the
+form of explicitly-sized enumerated values within the class declaration,
+or be relegated to ``#define`` macros within the source file. This
+helps avoid polluting the preprocessor.
diff --git a/docs/source/contributing/index.rst b/docs/source/contributing/index.rst
new file mode 100644
index 00000000000..df18b248374
--- /dev/null
+++ b/docs/source/contributing/index.rst
@@ -0,0 +1,144 @@
+.. _contributing:
+
+Contributing to MAME
+====================
+
+So you want to contribute to MAME but aren’t sure where to start? Well
+the great news is that there’s always plenty to do for people with a
+variety of skill sets.
+
+
+.. _contributing-testing:
+
+Testing and reporting bugs
+--------------------------
+
+One thing MAME can always do with is more testing and bug reports. If
+you’re familiar with a system that MAME emulates and notice something
+wrong, or if you find a bug in MAME’s user interface, you can head over
+to `MAME Testers <https://mametesters.org/>`_ and, assuming it isn’t
+already reported, register an account and open an issue. Be sure to
+read the `FAQ <https://mametesters.org/faq.html>`_ and
+`rules <https://mametesters.org/rules.html>`_ first to ensure you start
+out on the right foot. Please note that MAME Testers only accepts
+user-facing bugs in tagged release versions.
+
+For other kinds of issues, we have
+`GitHub Issues <https://github.com/mamedev/mame/issues/>`_. There’s a
+bit more leeway here. For example we accept developer-facing issues
+(e.g. bugs in internal APIs, or build system inadequacies), feature
+requests, and major regressions before they make it into a released
+version. Please respect the fact that the issue tracker is *not* a
+discussion or support forum, it’s only for reporting reproducible
+issues. Don’t open issues to ask questions or request support. Also,
+keep in mind that the ``master`` branch is unstable. If the current
+revision doesn’t compile at all or is completely broken, we’re probably
+already aware of it and don’t need issues opened for that. Wait a while
+and see if there’s an update. You might want to comment on the commit
+in question with the compiler error message, particularly if you’re
+compiling in an unorthodox but supported configuration.
+
+When opening an issue, remember to provide as much information as
+possible to help others understand, reproduce, and diagnose the issue.
+Things that are helpful to include:
+
+* The incorrect behaviour, and expected or correct behaviour. Be
+ specific: just saying it “doesn’t work” usually isn’t enough detail.
+* Environment details, including your operating system, CPU
+ architecture, system locale, and display language, if applicable. For
+ video output bugs, note your video hardware (GPU), driver version, and
+ the MAME video output module you’re using. For input handling bugs,
+ include the input peripherals and MAME input modules you’re using.
+* The exact version of MAME you’re using, including a git commit digest
+ if it isn’t a tagged release version, and any non-standard build
+ options.
+* The exact system and software being emulated (may not be applicable
+ for issues with parts of MAME’s UI, like the system selection menu).
+ Include things like the selected BIOS version, and emulated peripheral
+ (slot device) configuration.
+* Steps to reproduce the issue. Assume the person reading is familiar
+ with MAME itself, but not necessarily familiar with the emulated
+ system and software in question. For emulation issues, input
+ recordings and/or saved state files for reproducing the issue can be
+ invaluable.
+* An original reference for the correct behaviour. If you have access
+ to the original hardware for the emulated system, it helps to make a
+ recording of the correct behaviour for comparison.
+
+
+.. _contributing-code:
+
+Contributing to MAME’s source code
+----------------------------------
+
+MAME itself is written in C++, but that isn’t the sum total of the
+source code. The source code also includes:
+
+* The documentation hosted on this site (and also included in releases
+ as a PDF), written in
+ `reStructuredText <https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html>`_
+ markup.
+* The supplied :ref:`plugins <plugins>`, written in
+ `Lua 5.3 <https://www.lua.org/manual/5.3/>`_.
+* Internal layouts for emulated machines that need to display more than
+ a simple video screen. These are an XML application
+ :ref:`described here <layfile>`.
+* The software lists, describing known software media for systems that
+ MAME emulates. MAME software lists are an XML application.
+* The user interface translations, in GNU gettext PO format. They can
+ be edited with a good text editor, or a dedicated tool like
+ `Poedit <https://poedit.net/>`_.
+
+Our primary source code repository is
+`hosted on GitHub <https://github.com/mamedev/mame/>`_. We prefer to
+receive source code contributions in the form of
+`pull requests <https://github.com/mamedev/mame/pulls>`_. You’ll need
+to learn the basics of git distributed version control and familiarise
+yourself with the git tools. The basic process for creating a pull
+request is as follows:
+
+* Sign up for an account on GitHub.
+* Create a fork of the mamedev/mame repository.
+* Create a new branch off the ``master`` branch in your forked
+ repository.
+* Clone your forked repository, and check out your new branch.
+* Make your changes, and build and test them locally.
+* Commit your changes, and push your branch to GitHub.
+* Optionally enable GitHub Actions for your forked repository, allowing
+ your changes to be built on Windows, macOS and Linux.
+* Open a pull request to merge your changes into the ``master`` branch
+ in the mamedev/mame repository.
+
+Please keep the following in mind (note that not all points are relevant
+to all kinds of changes):
+
+* Make your commit messages descriptive. Please include what the change
+ affects, and what it’s supposed to achieve. A person reading the
+ commit log shouldn’t need to resort to examining the diff to get a
+ basic idea of what a commit is supposed to do. The default commit
+ messages provided by GitHub are completely useless, as they don’t give
+ any indication of what a change is supposed to do.
+* Test your changes. Ensure that a full build of MAME completes, and
+ that the code you changed works. It’s a good idea to build with
+ ``DEBUG=1`` to check that assertions compile and don’t trigger.
+* Use an enlightening pull request title and description. The title
+ should give a one-line summary of what the overall change affects and
+ what it’s supposed to do. The description should contain more detail.
+ Don’t leave the description empty and describe the change in comments,
+ as this makes searching and filtering more difficult.
+* Be aware that GitHub Actions has opaque resource limits. It isn’t
+ clear when you’re close to the limits, and we’ve had contributors
+ banned from GitHub Actions for violating the limits. Even if you
+ appeal the ban, they still won’t tell you what the actual limits are,
+ justifying this by saying that if you know the limits, you can take
+ steps to evade them. If you enable GitHub Actions, consider not
+ pushing individual commits if you don’t need them to be automatically
+ built, or cancelling workflow runs when you don’t need the results.
+
+We have guidelines for specific parts of the source:
+
+.. toctree::
+ :titlesonly:
+
+ cxx
+ softlist
diff --git a/docs/source/contributing/softlist.rst b/docs/source/contributing/softlist.rst
new file mode 100644
index 00000000000..c70523b1fc2
--- /dev/null
+++ b/docs/source/contributing/softlist.rst
@@ -0,0 +1,175 @@
+.. _contributing-softlist:
+
+Guidelines for Software Lists
+=============================
+
+.. contents:: :local:
+
+
+.. _contributing-softlist-intro:
+
+Introduction
+------------
+
+MAME’s software lists describe known software media for emulated
+systems in a form that can be used to identify media image files for
+known software, verify media image file integrity, and load media
+image files for emulation. Software lists are implemented as XML
+files in the ``hash`` folder. The XML structure is described in the
+file ``hash/softwarelist.dtd``.
+
+Philosophically, software list items should represent the original
+media, rather than a specific dump of the media. Ideally, it should be
+possible for anyone with the media to dump it and produce the same image
+file. Of course, this isn’t always possible in practice – in particular
+it’s problematic for inherently analog media, like home computer
+software stored on audio tape cassettes.
+
+MAME strives to document the best available media images. It is not our
+intention to propagate corrupted, truncated, defaced, watermarked, or
+otherwise bad media images. Where possible, file structures matching
+the original media structure are preferred. For example we prefer
+individual files for separate ROM chips in cartridge media, and we use
+disk images rather than archives of files extracted from the original
+disks.
+
+
+.. _contributing-softlist-itempart:
+
+Items and parts
+---------------
+
+A software list is a collection of *items* and each item may have
+multiple *parts*. An item represents a piece of software, as
+distributed as a complete package. A part represents a single piece of
+media within the package. Parts can be mounted individually in
+emulated media devices. For example a piece of software distributed on
+three floppy disks will be a single item, while each floppy disk will be
+one part within that item.
+
+Sometimes, logically separate parts of a single physical piece of media
+are represented as separate parts within a software item. For example
+each side of an audio tape cassette is represented as a separate part.
+However individual ROM chips within a cartridge may be separate files,
+but they are *not* separate parts, as the cartridge is mounted as a
+whole.
+
+Each item is a ``software`` element. The ``software`` element may have
+the following attributes:
+
+name (required)
+ The short name identifying the item. This is used for file names,
+ command line arguments, database keys, URL fragments, and many other
+ purposes. It should be terse but still recognisable. It must be
+ unique within the software list. Valid characters are lowercase
+ English letters, decimal digits and underscores. The maximum
+ allowed length is sixteen characters.
+cloneof (optional)
+ The short name of the parent item if the item is a clone. The
+ parent must be within the same software list – parent/clone
+ relationships spanning multiple software lists are not supported.
+supported (optional)
+ One of the values ``yes`` (fully usable in emulation), ``no`` (not
+ usable in emulation), or ``partial`` (usable in emulation with
+ limitations). If the attribute is not present, it is equivalent to
+ ``yes``. Examples of partially supported software include games
+ that are playable with graphical glitches, and office software where
+ some but not all functionality works.
+
+Each part is a ``part`` element within the ``software`` element. The
+``part`` element must have the following attributes:
+
+name (required)
+ The short name identifying the part. This is used for command line
+ arguments, database keys, URL fragments, and many other purposes.
+ It must be unique within the item. It is also used as the display
+ name if a separate display name is not provided. Valid characters
+ are lowercase English letters, decimal digits and underscores. The
+ maximum allowed length is sixteen characters.
+interface (required)
+ This attribute is used to identify suitable emulated media devices
+ for mounting the software part. Applicable values depend on the
+ emulated system.
+
+
+.. _contributing-softlist-metadata:
+
+Metadata
+--------
+
+Software lists support various kinds of metadata. All software list
+items require the following metadata elements to be present:
+
+description
+ This is the primary display name for the software item. It should
+ be the original name of the software, transliterated into English
+ Latin script if necessary. It must be unique within the software
+ list. If extra text besides the title itself is required for
+ disambiguation, use lowercase outside of proper nouns, initialisms
+ and verbatim quotes.
+year
+ The year of release or copyright year for the software. If unknown,
+ use an estimate with a question mark. Items can be filtered by year
+ in the software selection menu.
+publisher
+ The publisher of the software. This may be the same as the
+ developer if the software was self-published. Items can be filtered
+ by published in the software selection menu.
+
+Most user-visible software item metadata is provided using ``info``
+elements. Each ``info`` element must have a ``name`` attribute and a
+``value`` attribute. The ``name`` attribute identifies the type of
+metadata, and the ``value`` attribute is the metadata value itself.
+Note that ``name`` attributes do not need to be unique within an item.
+Multiple ``info`` elements with the same ``name`` may be present if
+appropriate. This is frequently seen for software sold using different
+titles in different regions.
+
+MAME displays metadata from ``info`` elements in the software selection
+menu. The following ``name`` attributes are recognised specifically,
+and can show localised names:
+
+alt_title
+ Used for alternate titles. Examples are different tiles used in
+ different languages, scripts or regions, or different titles used
+ on the title screen and packaging. MAME searches alternate titles
+ as well as the description.
+author
+ Author of the software. Items can be filtered by author in the
+ software selection menu.
+barcode
+ Barcode number identifying the software package (typically an EAN).
+developer
+ Developer responsible for implementing the software. Items can be
+ filtered by developer in the software selection menu.
+distributor
+ Party responsible for distributing the software to retailers (or
+ customers in the case of direct sales). Items can be filtered by
+ distributor in the software selection menu.
+install
+ Installation instructions.
+isbn
+ ISBN for software included with a commercial book.
+oem
+ Original equipment manufacturer, typically used with customised
+ versions of software distributed by a hardware vendor.
+original_publisher
+ The original publisher, for items representing software re-released
+ by a different publisher.
+partno
+ Distributor’s part number for the software.
+pcb
+ Printed circuit board identifier, typically for cartridge media.
+programmer
+ Programmer who wrote the code for the software.
+release
+ Fine-grained release date for the software, if known. Use
+ YYYYMMDD format with no punctuation. If only the month is know,
+ use “xx” for the day digits. For example ``199103xx`` or
+ ``19940729``.
+serial
+ Number identifying the software within a series of releases.
+usage
+ Usage instructions.
+version
+ Version number of the software.
diff --git a/docs/source/debugger/exceptionpoint.rst b/docs/source/debugger/exceptionpoint.rst
new file mode 100644
index 00000000000..52a8ee67a19
--- /dev/null
+++ b/docs/source/debugger/exceptionpoint.rst
@@ -0,0 +1,134 @@
+.. _debugger-exceptionpoint-list:
+
+Exception Point Debugger Commands
+=================================
+
+:ref:`debugger-command-epset`
+ sets a new exception point
+:ref:`debugger-command-epclear`
+ clears a specific exception point or all exception points
+:ref:`debugger-command-epdisable`
+ disables a specific exception point or all exception points
+:ref:`debugger-command-epenable`
+ enables a specific exception point or all exception points
+:ref:`debugger-command-eplist`
+ lists exception points
+
+Exception points halt execution and activate the debugger when
+a CPU raises a particular exception number.
+
+
+.. _debugger-command-epset:
+
+epset
+-----
+
+**ep[set] <type>[,<condition>[,<action>]]**
+
+Sets a new exception point for exceptions of type **<type>**. The
+optional **<condition>** parameter lets you specify an expression that
+will be evaluated each time the exception point is hit. If the result
+of the expression is true (non-zero), the exception point will actually
+halt execution at the start of the exception handler; otherwise,
+execution will continue with no notification. The optional **<action>**
+parameter provides a command that is executed whenever the exception
+point is hit and the **<condition>** is true. Note that you may need to
+embed the action within braces ``{ }`` in order to prevent commas and
+semicolons from being interpreted as applying to the ``epset`` command
+itself.
+
+The numbering of exceptions depends upon the CPU type. Causes of
+exceptions may include internally or externally vectored interrupts,
+errors occurring within instructions and system calls.
+
+Each exception point that is set is assigned an index which can be used
+in other exception point commands to reference this exception point.
+
+Examples:
+
+``ep 2``
+ Set an exception that will halt execution whenever the visible CPU
+ raises exception number 2.
+
+Back to :ref:`debugger-exceptionpoint-list`
+
+
+.. _debugger-command-epclear:
+
+epclear
+-------
+
+**epclear [<epnum>[,…]]**
+
+The epclear command clears exception points. If **<epnum>** is
+specified, only the requested exception points are cleared, otherwise
+all exception points are cleared.
+
+Examples:
+
+``epclear 3``
+ Clear exception point index 3.
+
+``epclear``
+ Clear all exception points.
+
+Back to :ref:`debugger-exceptionpoint-list`
+
+
+.. _debugger-command-epdisable:
+
+epdisable
+---------
+
+**epdisable [<epnum>[,…]]**
+
+The epdisable command disables exception points. If **<epnum>** is
+specified, only the requested exception points are disabled, otherwise
+all exception points are disabled. Note that disabling an exception
+point does not delete it, it just temporarily marks the exception
+point as inactive.
+
+Examples:
+
+``epdisable 3``
+ Disable exception point index 3.
+
+``epdisable``
+ Disable all exception points.
+
+Back to :ref:`debugger-exceptionpoint-list`
+
+
+.. _debugger-command-epenable:
+
+epenable
+--------
+
+**epenable [<epnum>[,…]]**
+
+The epenable command enables exception points. If **<epnum>** is
+specified, only the requested exception points are enabled, otherwise
+all exception points are enabled.
+
+Examples:
+
+``epenable 3``
+ Enable exception point index 3.
+
+``epenable``
+ Enable all exception points.
+
+Back to :ref:`debugger-exceptionpoint-list`
+
+
+.. _debugger-command-eplist:
+
+eplist
+------
+
+**eplist**
+
+The eplist command lists all the current exception points, along with
+their index and any conditions or actions attached to them.
+
+Back to :ref:`debugger-exceptionpoint-list`
diff --git a/docs/source/debugger/execution.rst b/docs/source/debugger/execution.rst
index 8a99f52f85a..cc4fc280cc1 100644
--- a/docs/source/debugger/execution.rst
+++ b/docs/source/debugger/execution.rst
@@ -12,10 +12,16 @@ Execution Debugger Commands
(Shift-F11)
:ref:`debugger-command-go`
resume execution (F5)
+:ref:`debugger-command-gbt`
+ resume execution until next true branch is executed
+:ref:`debugger-command-gbf`
+ resume execution until next false branch is executed
:ref:`debugger-command-gex`
resume execution until exception is raised
:ref:`debugger-command-gint`
resume execution until interrupt is taken (F7)
+:ref:`debugger-command-gni`
+ resume execution until next further instruction
:ref:`debugger-command-gtime`
resume execution until the given delay has elapsed
:ref:`debugger-command-gvblank`
@@ -137,6 +143,64 @@ Examples:
Back to :ref:`debugger-execution-list`
+.. _debugger-command-gbf:
+
+gbf
+---
+
+**gbf [<condition>]**
+
+Resumes execution. Control will not be returned to the debugger until
+a breakpoint or watchpoint is triggered, or until a conditional branch
+or skip instruction is not taken, following any delay slots.
+
+The optional **<condition>** parameter lets you specify an expression
+that will be evaluated each time a conditional branch is encountered.
+If the result of the expression is true (non-zero), execution will be
+halted after the branch if it is not taken; otherwise, execution will
+continue with no notification.
+
+Examples:
+
+``gbf``
+ Resume execution until a breakpoint/watchpoint is triggered, or
+ until the next false branch.
+``gbf {pc != 1234}``
+ Resume execution until the next false branch, disregarding the
+ instruction at address 1234.
+
+Back to :ref:`debugger-execution-list`
+
+
+.. _debugger-command-gbt:
+
+gbt
+---
+
+**gbt [<condition>]**
+
+Resumes execution. Control will not be returned to the debugger until
+a breakpoint or watchpoint is triggered, or until a conditional branch
+or skip instruction is taken, following any delay slots.
+
+The optional **<condition>** parameter lets you specify an expression
+that will be evaluated each time a conditional branch is encountered.
+If the result of the expression is true (non-zero), execution will be
+haltedafter the branch if it is taken; otherwise, execution will
+continue with no notification.
+
+Examples:
+
+``gbt``
+ Resume execution until a breakpoint/watchpoint is triggered, or
+ until the next true branch.
+``gbt {pc != 1234}``
+ Resume execution until the next true branch, disregarding the
+ instruction at address 1234.
+
+Back to :ref:`debugger-execution-list`
+
+
.. _debugger-command-gex:
gex
@@ -196,6 +260,34 @@ Examples:
Back to :ref:`debugger-execution-list`
+.. _debugger-command-gni:
+
+gni
+---
+
+**gni [<count>]**
+
+Resumes execution. Control will not be returned to the debugger until a
+breakpoint or watchpoint is triggered. A temporary unconditional breakpoint
+is set at the prorgam address **<count>** instructions sequentially past the
+current one. When this breakpoint is hit, it is automatically removed.
+
+The **<count>** parameter is optional and defaults to 1 if omitted. If
+**<count>** is specified as zero, the command does nothing. **<count>** is
+not permitted to exceed 512 decimal.
+
+Examples:
+
+``gni``
+ Resume execution until a breakpoint/watchpoint is triggered, including
+ the temporary breakpoint set at the address of the following instruction.
+``gni 2``
+ Resume execution until a breakpoint/watchpoint is triggered. A temporary
+ breakpoint is set two instructions past the current one.
+
+Back to :ref:`debugger-execution-list`
+
+
.. _debugger-command-gtime:
gtime
diff --git a/docs/source/debugger/general.rst b/docs/source/debugger/general.rst
index ffeb1379f3f..cdaf9ca4019 100644
--- a/docs/source/debugger/general.rst
+++ b/docs/source/debugger/general.rst
@@ -41,6 +41,8 @@ General Debugger Commands
save a screen snapshot
:ref:`debugger-command-source`
read commands from file and executes them one by one
+:ref:`debugger-command-time`
+ prints the current machine time to the console
:ref:`debugger-command-quit`
exit the debugger and end the emulation session
@@ -78,8 +80,8 @@ do
The **do** command simply evaluates the supplied expression. This is
often used to set or modify device state variable (e.g. CPU registers),
-or to write to memory. See :ref:`debugger-expressions` for details
-about expression syntax.
+or to write to memory. See :ref:`debugger-express` for details about
+expression syntax.
Examples:
@@ -544,6 +546,21 @@ Examples:
Back to :ref:`debugger-general-list`
+.. _debugger-command-time:
+
+time
+----
+
+Prints the total elapsed emulated time to the debugger console.
+
+Examples:
+
+``time``
+ Prints the elapsed emulated time.
+
+Back to :ref:`debugger-general-list`
+
+
.. _debugger-command-quit:
quit
diff --git a/docs/source/debugger/index.rst b/docs/source/debugger/index.rst
index 18785e734e7..dc87a7a2ca3 100644
--- a/docs/source/debugger/index.rst
+++ b/docs/source/debugger/index.rst
@@ -50,6 +50,7 @@ name of a command, to see documentation directly in MAME.
breakpoint
watchpoint
registerpoints
+ exceptionpoint
annotation
cheats
image
@@ -163,7 +164,7 @@ debugger should take the most likely meaning for a device or address
space specification.
-.. _debugger-expressions:
+.. _debugger-express:
Debugger expression syntax
--------------------------
@@ -190,7 +191,7 @@ precedence:
Addition, subtraction
``<<`` ``>>``
Bitwise left/right shift
-``< ``<=`` ``>`` ``>=``
+``<`` ``<=`` ``>`` ``>=``
Less than, less than or equal, greater than, greater than or equal
``==`` ``!=``
Equal, not equal
@@ -218,6 +219,8 @@ Major differences from C expression semantics:
always evaluated.
+.. _debugger-express-num:
+
Numbers
~~~~~~~
@@ -240,6 +243,8 @@ Examples:
* ``0b123`` is invalid
+.. _debugger-express-bool:
+
Boolean values
~~~~~~~~~~~~~~
@@ -253,6 +258,8 @@ debugger commands to use the default value, even when subsequent
parameters are specified.
+.. _debugger-express-mem:
+
Memory accesses
~~~~~~~~~~~~~~~
@@ -281,22 +288,22 @@ multiple effects of a write access. For example:
* Some registers need to be written in sequence to avoid race
conditions. The debugger can issue multiple writes at the same point
- in emulated time, so these race conditions cannot be avoided
- trivially. For example writing to the MC68HC05 output compare
- register high byte (OCRH) inhibits compare until the output compare
- register low byte (OCRL) is written to prevent race conditions.
- Since the debugger can write to both locations at the same instant
- from the emulated machine’s point of view, the race condition is not
- usually relevant. It’s more error-prone if you can accidentally set
- hidden state when all you really want to do is change the value, so
- writing to OCRH with side effects suppressed does not inhibit compare,
- it just changes the value in the output compare register.
+ in emulated time, so these race conditions can be avoided trivially.
+ For example writing to the MC68HC05 output compare register high byte
+ (OCRH) inhibits compare until the output compare register low byte
+ (OCRL) is written to prevent race conditions. Since the debugger can
+ write to both locations at the same instant from the emulated
+ machine’s point of view, the race condition is not usually relevant.
+ It’s more error-prone if you can accidentally set hidden state when
+ all you really want to do is change the value, so writing to OCRH with
+ side effects suppressed does not inhibit compare, it just changes the
+ value in the output compare register.
* Writing to some registers has multiple effects that may be useful to
separate for debugging purposes. Using the MC68HC05 as an example
again, writing to OCRL changes the value in the output compare
register, and also clears the output compare flag (OCF) and enables
compare if it was previously inhibited by writing to OCRH. Writing to
- OCRL with side effects disable just changes the value in the register
+ OCRL with side effects disabled just changes the value in the register
without clearing OCF or enabling compare, since it’s useful for
debugging purposes. Writing to OCRL with side effects enabled has the
additional effects.
@@ -390,6 +397,8 @@ Memory accesses can be used as both lvalues and rvalues, so you can write
``b@100 = ff`` to store a byte in memory.
+.. _debugger-express-func:
+
Functions
~~~~~~~~~
diff --git a/docs/source/debugger/watchpoint.rst b/docs/source/debugger/watchpoint.rst
index 2b25e0631f8..0f4bd12902f 100644
--- a/docs/source/debugger/watchpoint.rst
+++ b/docs/source/debugger/watchpoint.rst
@@ -75,7 +75,7 @@ Examples:
execution.
``temp0 = 0 ; wp 45678,1,w,wpdata==f0,{ temp0++ ; g }``
Set a watchpoint for the visible CPU that will halt execution
- whenever a write do the first address space occurs at address 45678
+ whenever a write to the first address space occurs at address 45678
where the value being written is equal to f0. When this happens,
increment the variable **temp0** and resume execution.
diff --git a/docs/source/images/MAMElogo.svg b/docs/source/images/MAMElogo.svg
index 01d860d18e7..a728ab92a31 100644
--- a/docs/source/images/MAMElogo.svg
+++ b/docs/source/images/MAMElogo.svg
@@ -9,12 +9,12 @@
width="1214px">
<defs>
<linearGradient id="left-dark" x1="0" x2="1" y1="0" y2="0">
- <stop id="stop5213" offset="0" stop-color="#00274f" />
- <stop id="stop5215" offset="1" stop-color="#68cafb" />
+ <stop id="left-dark-0" offset="0" stop-color="#00274f" />
+ <stop id="left-dark-1" offset="1" stop-color="#68cafb" />
</linearGradient>
<linearGradient id="right-dark" x1="0" x2="1" y1="0" y2="0">
- <stop id="stop4" offset="0" stop-color="#68cafb" />
- <stop id="stop6" offset="1" stop-color="#00274f" />
+ <stop id="right-dark-0" offset="0" stop-color="#68cafb" />
+ <stop id="right-dark-1" offset="1" stop-color="#00274f" />
</linearGradient>
</defs>
<g>
diff --git a/docs/source/index.rst b/docs/source/index.rst
index d4761f5a2b4..d17a74e2f19 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -28,6 +28,7 @@ MAME Documentation
debugger/index
tools/index
+ contributing/index
techspecs/index
security
diff --git a/docs/source/initialsetup/compilingmame.rst b/docs/source/initialsetup/compilingmame.rst
index fdd0545db9f..b61b3ca6335 100644
--- a/docs/source/initialsetup/compilingmame.rst
+++ b/docs/source/initialsetup/compilingmame.rst
@@ -10,47 +10,73 @@ All Platforms
* To compile MAME, you need a C++17 compiler and runtime library. We
support building with GCC version 7.2 or later and clang version 6 or
- later. MAME should run with GNU libstdc++ version 7.2 or later.
-
-* Whenever you are changing build parameters, (such as switching between
- a SDL-based build and a native Windows renderer one, or adding tools
- to the compile list) you need to run a **make REGENIE=1** to allow the
- settings to be regenerated. Failure to do this will cause you very
+ later. MAME should run with GNU libstdc++ version 7.2 or later or
+ libc++ version 7 or later. The initial release of any major version
+ of GCC should be avoided. For example, if you want to compile MAME
+ with GCC 10, you should use version 10.3 or later.
+
+* Whenever you are changing build parameters, (for example changing
+ optimisation settings, or adding tools to the compile list), or system
+ drivers sources are added, removed, or renamed, the project files need
+ to be regenerated. You can do this by adding **REGENIE=1** to the
+ make arguments, or updating the modification time of the makefile (for
+ example using the **touch** command). Failure to do this may cause
difficult to troubleshoot problems.
* If you want to add various additional tools to the compile, such as
*chdman*, add a **TOOLS=1** to your make command, like
**make REGENIE=1 TOOLS=1**
-* You can do driver specific builds by using *SOURCES=<driver>* in your
- make command. For instance, building Pac-Man by itself would be
- **make SOURCES=src/mame/drivers/pacman.cpp REGENIE=1** including the
- necessary *REGENIE* for rebuilding the settings.
-
-* Speeding up the compilation can be done by using more cores from your
- CPU. This is done with the **-j** parameter. *Note: a good number to
- start with is the total number of CPU cores in your system plus one.
- An excessive number of concurrent jobs may increase compilation time.
- The optimal number depends on many factors, including number of CPU
- cores, available RAM, disk and filesystem performance, and memory
- bandwidth.* For instance, **make -j5** is a good starting point on a
- system with a quad-core CPU.
+* You can build an emulator for a subset of the systems supported by
+ MAME by using *SOURCES=<driver>,...* in your make command. For
+ example
+ **make SUBTARGET=pacem SOURCES=src/mame/pacman/pacman.cpp REGENIE=1**
+ would build an emulator called *pacem* including the system drivers
+ from the source file pacman.cpp (*REGENIE=1* is specified to ensure
+ project files are regenerated). You can specify folders to include
+ their entire contents, and you can separate multiple files/folders
+ with commas. You can also omit the *src/mame/* prefix in many cases.
+
+ If you encounter linking errors after changing the included sources,
+ delete the static libraries for the subtarget from the build folder.
+ For the previous example on Windows using GCC, these would be in
+ *build/mingw-gcc/bin/x64/Release/mame_pacem* by default.
+
+* On a system with multiple CPU cores, compilation can be sped up by
+ compiling multiple source files in parallel. This is done with the
+ **-j** parameter. For instance, **make -j5** is a good starting point
+ on a system with a quad-core CPU.
+
+ *Note: a good number to start with is the total number of CPU cores
+ in your system plus one. An excessive number of concurrent jobs will
+ increase compilation time, particularly if the compiler jobs exhaust
+ available memory. The optimal number depends on many factors,
+ including number of CPU cores, available RAM, disk and filesystem
+ performance, and memory bandwidth.*
* Debugging information can be added to a compile using *SYMBOLS=1*
though most users will not want or need to use this. This increases
- compile time and disk space used.
+ compile time and disk space used. Note that a full build of MAME
+ including internal debugging symbols will exceed the maximum size for
+ an executable on Windows, and will not be possible to run without
+ first stripping the symbols.
Putting all of these together, we get a couple of examples:
-Rebuilding MAME for just the Pac-Man driver, with tools, on a quad-core
-(e.g. i5 or i7) machine::
-
- make SOURCES=src/mame/drivers/pacman.cpp TOOLS=1 REGENIE=1 -j5
-
Rebuilding MAME on a dual-core (e.g. i3 or laptop i5) machine::
make -j3
+Rebuilding MAME for just the Pac-Man and Galaxian families of systems,
+with tools, on a quad-core (e.g. i5 or i7) machine::
+
+ make SUBTARGET=pacem SOURCES=src/mame/pacman,src/mame/galaxian TOOLS=1 REGENIE=1 -j5
+
+Rebuilding MAME for just the Apple II systems, compiling up to six
+sources in parallel::
+
+ make SUBTARGET=appulator SOURCES=apple/apple2.cpp,apple/apple2e.cpp,apple/apple2gs.cpp REGENIE=1 -j6
+
.. _compiling-windows:
@@ -72,7 +98,7 @@ building MAME on a 64-bit system. Instructions may need to be adjusted for
use the portable SDL (Simple DirectMedia Layer) interfaces instead, you can
add **OSD=sdl** to the make options. The main emulator binary will have an
``sdl`` prefix prepended (e.g. ``sdlmame.exe``). You
- will need to install the MSYS2 packages for SDL 2 version 2.0.3 or later.
+ will need to install the MSYS2 packages for SDL 2 version 2.0.6 or later.
* By default, MAME will include the native Windows debugger. To also include
the portable Qt debugger, add **USE_QTDEBUG=1** to the make options. You
will need to install the MSYS2 packages for Qt 5.
@@ -89,8 +115,9 @@ with MSYS2 and the **pacman** package manager.
* Download the latest version of the ``mame-essentials`` package from the
`MAME package repository <https://repo.mamedev.org/x86_64/>`_ and install it
using the **pacman** command.
-* Add the ``mame`` repository to ``/etc/pacman.conf`` using
- ``/etc/pacman.d/mirrorlist.mame`` for locations.
+* Add the ``mame`` package repository to ``/etc/pacman.conf`` using
+ ``/etc/pacman.d/mirrorlist.mame`` for locations, and disable signature
+ verification for this repository (``SigLevel = Never``).
* Install packages necessary to build MAME. At the very least, you’ll need
``bash``, ``git``, ``make``.
* For 64-bit builds you’ll need ``mingw-w64-x86_64-gcc`` and
@@ -152,7 +179,7 @@ configuration::
curl -O "https://repo.mamedev.org/x86_64/mame-essentials-1.0.6-1-x86_64.pkg.tar.xz"
pacman -U mame-essentials-1.0.6-1-x86_64.pkg.tar.xz
- echo -e '\n[mame]\nInclude = /etc/pacman.d/mirrorlist.mame' >> /etc/pacman.conf
+ echo -e '\n[mame]\nInclude = /etc/pacman.d/mirrorlist.mame\nSigLevel = Never' >> /etc/pacman.conf
Building with Microsoft Visual Studio
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -224,7 +251,7 @@ Fedora Linux
------------
You’ll need a few prerequisites from your Linux distribution. Make sure you get
-SDL2 2.0.4 or later as earlier versions are buggy::
+SDL2 2.0.6 or later as earlier versions lack required functionality::
sudo dnf install gcc gcc-c++ SDL2-devel SDL2_ttf-devel libXi-devel libXinerama-devel qt5-qtbase-devel qt5-qttools expat-devel fontconfig-devel alsa-lib-devel pulseaudio-libs-devel
@@ -246,9 +273,9 @@ Debian and Ubuntu (including Raspberry Pi and ODROID devices)
-------------------------------------------------------------
You’ll need a few prerequisites from your Linux distribution. Make sure you get
-SDL2 2.0.4 or later as earlier versions are buggy::
+SDL2 2.0.6 or later as earlier versions lack required functionality::
- sudo apt-get install git build-essential python libsdl2-dev libsdl2-ttf-dev libfontconfig-dev libpulse-dev qt5-default
+ sudo apt-get install git build-essential python3 libsdl2-dev libsdl2-ttf-dev libfontconfig-dev libpulse-dev qtbase5-dev qtbase5-dev-tools qtchooser qt5-qmake
Compilation is exactly as described above in All Platforms. Note the Ubuntu
Linux modifies GCC to enable the GNU C Library “fortify source” feature by
@@ -262,7 +289,7 @@ Arch Linux
You’ll need a few prerequisites from your distro::
- sudo pacman -S base-devel git sdl2 gconf sdl2_ttf gcc qt5
+ sudo pacman -S base-devel git sdl2_ttf python libxinerama libpulse alsa-lib qt5-base
Compilation is exactly as described above in All Platforms.
@@ -274,8 +301,10 @@ Apple macOS
You’ll need a few prerequisites to get started. Make sure you’re on OS X 10.14
Mojave or later for Intel Macs or macOS 11.0 Big Sur for Apple Silicon. You will
-need SDL2 2.0.4 or later for Intel or SDL2 2.0.14 on Apple Silicon. You’ll also
-need to install Python 3.
+need SDL2 2.0.6 or later for Intel or SDL2 2.0.14 on Apple Silicon. You’ll also
+need to install Python 3 – it’s currently included with the Xcode command line
+tools, but you can also install a stand-alone version or get it via the Homebrew
+package manager.
* Install **Xcode** from the Mac App Store or
`ADC <https://developer.apple.com/download/more/>`_ (AppleID required).
@@ -298,12 +327,13 @@ Next you’ll need to get SDL2 installed.
**SDL2.framework** folder from the SDL disk image into the **Frameworks**
folder. You will have to authenticate with your user password.
-Now get Python 3 set up:
+If you don’t already have it, get Python 3 set up:
-* Go to the `official Python site <https://www.python.org/>`_ and click the link
- to the download page for the current version (this was
- `Python 3.10.0 <https://www.python.org/downloads/release/python-3100/>`_ at
- the time of writing).
+* Go to the official Python site, navigate to the
+ `releases for macOS <https://www.python.org/downloads/macos/>`_, and click the
+ link to download the installer for the latest stable release (this was
+ `Python 3.10.4 <https://www.python.org/ftp/python/3.10.4/python-3.10.4-macos11.pkg>`_
+ at the time of writing).
* Scroll down to the “Files” section, and download the macOS version (called
“macOS 64-bit universal2 installer” or similar).
* Once the package downloads, open it and follow the standard installation
@@ -330,7 +360,7 @@ MAME directory):
.. code-block:: bash
- emmake make SUBTARGET=pacmantest SOURCES=src/mame/drivers/pacman.cpp
+ emmake make SUBTARGET=pacmantest SOURCES=src/mame/pacman/pacman.cpp
The **SOURCES** parameter should have the path to at least one driver **.cpp**
file. The make process will attempt to locate and include all dependencies
@@ -340,7 +370,7 @@ commas) if this process misses something. e.g.
.. code-block:: bash
- emmake make SUBTARGET=apple2e SOURCES=src/mame/drivers/apple2e.cpp,src/mame/machine/applefdc.cpp
+ emmake make SUBTARGET=apple2e SOURCES=src/mame/apple/apple2e.cpp,src/devices/machine/applefdc.cpp
The value of the **SUBTARGET** parameter serves only to differentiate multiple
builds and need not be set to any specific value.
@@ -467,160 +497,193 @@ Overall build options
~~~~~~~~~~~~~~~~~~~~~
PREFIX_MAKEFILE
- Name of a makefile to include for additional options if found (defaults to
- **useroptions.mak**). May be useful if you want to quickly switch between
- different build configurations.
+ Name of a makefile to include for additional options if found (defaults to
+ **useroptions.mak**). May be useful if you want to quickly switch between
+ different build configurations.
BUILDDIR
- Set to change the name of the subfolder used for project files, generated
- sources, object files, and intermediate libraries (defaults to **build**).
+ Set to change the name of the subfolder used for project files, generated
+ sources, object files, and intermediate libraries (defaults to **build**).
REGENIE
- Set to **1** to force project files to be regenerated.
+ Set to **1** to force project files to be regenerated.
VERBOSE
- Set to **1** to show full commands when using GNU make as the build tool.
- This option applies immediately without needing regenerate project files.
+ Set to **1** to show full commands when using GNU make as the build tool.
+ This option applies immediately without needing regenerate project files.
IGNORE_GIT
- Set to **1** to skip the working tree scan and not attempt to embed a git
- revision description in the version string.
+ Set to **1** to skip the working tree scan and not attempt to embed a git
+ revision description in the version string.
Tool locations
~~~~~~~~~~~~~~
OVERRIDE_CC
- Set the C/Objective-C compiler command. (This sets the target C compiler
- command when cross-compiling.)
+ Set the C/Objective-C compiler command. (This sets the target C compiler
+ command when cross-compiling.)
OVERRIDE_CXX
- Set the C++/Objective-C++ compiler command. (This sets the target C++
- compiler command when cross-compiling.)
+ Set the C++/Objective-C++ compiler command. (This sets the target C++
+ compiler command when cross-compiling.)
OVERRIDE_LD
- Set the linker command. This is often not necessary or useful because the C
- or C++ compiler command is used to invoke the linker. (This sets the target
- linker command when cross-compiling.)
+ Set the linker command. This is often not necessary or useful because the C
+ or C++ compiler command is used to invoke the linker. (This sets the target
+ linker command when cross-compiling.)
PYTHON_EXECUTABLE
- Set the Python interpreter command. You need Python 3.2 or later to build
- MAME.
+ Set the Python interpreter command. You need Python 3.2 or later to build
+ MAME.
CROSS_BUILD
- Set to **1** to use separate host and target compilers and linkers, as
- required for cross-compilation. In this case, **OVERRIDE_CC**,
- **OVERRIDE_CXX** and **OVERRIDE_LD** set the target C compiler, C++ compiler
- and linker commands, while **CC**, **CXX** and **LD** set the host C
- compiler, C++ compiler and linker commands.
+ Set to **1** to use separate host and target compilers and linkers, as
+ required for cross-compilation. In this case, **OVERRIDE_CC**,
+ **OVERRIDE_CXX** and **OVERRIDE_LD** set the target C compiler, C++ compiler
+ and linker commands, while **CC**, **CXX** and **LD** set the host C
+ compiler, C++ compiler and linker commands.
+
+Including subsets of supported systems
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+SUBTARGET
+ Set emulator subtarget to build. Some pre-defined subtargets are provided,
+ using Lua scripts in *scripts/target/mame* and system driver filter files in
+ *src/mame*. User-defined substargets can be created using the **SOURCES**
+ or **SOURCEFILTER** option.
+SOURCES
+ Specify system driver source files and/or folders to include. Usually used
+ in conjunction with the **SUBTARGET** option. Separate multiple
+ files/folders with commas.
+SOURCEFILTER
+ Specify a system driver filter file. Usually used in conjunction with the
+ **SUBTARGET** option. The filter file can specify source files to include
+ system drivers from, and individual system drivers to include or exclude.
+ There are some example system driver filter files in the *src/mame* folder.
Optional features
~~~~~~~~~~~~~~~~~
TOOLS
- Set to **1** to build additional tools along with the emulator, including
- **unidasm**, **chdman**, **romcmp**, and **srcclean**.
+ Set to **1** to build additional tools along with the emulator, including
+ **unidasm**, **chdman**, **romcmp**, and **srcclean**.
+NO_OPENGL
+ Set to **1** to disable building the OpenGL video output module.
NO_USE_PORTAUDIO
- Set to **1** to disable building the PortAudio sound output module.
+ Set to **1** to disable building the PortAudio sound output module and the
+ PortAudio library.
+NO_USE_PULSEAUDIO
+ Set to **1** to disable building the PulseAudio sound output module on
+ Linux.
+USE_TAPTUN
+ Set to **1** to include the tap/tun network module, or set to **0** to
+ disable building the tap/tun network module. The tap/tun network module is
+ included by default on Windows and Linux.
+USE_PCAP
+ Set to **1** to include the pcap network module, or set to **0** to disable
+ building the pcap network module. The pcap network module is included by
+ default on macOS and NetBSD.
USE_QTDEBUG
- Set to **1** to include the Qt debugger on platforms where it’s not built by
- default (e.g. Windows or macOS), or to **0** to disable it. You’ll need to
- install Qt development libraries and tools to build the Qt debugger. The
- process depends on the platform.
+ Set to **1** to include the Qt debugger on platforms where it’s not built by
+ default (e.g. Windows or macOS), or to **0** to disable it. You’ll need to
+ install Qt development libraries and tools to build the Qt debugger. The
+ process depends on the platform.
Compilation options
~~~~~~~~~~~~~~~~~~~
NOWERROR
- Set to **1** to disable treating compiler warnings as errors. This may be
- needed in marginally supported configurations.
+ Set to **1** to disable treating compiler warnings as errors. This may be
+ needed in marginally supported configurations.
DEPRECATED
- Set to **0** to disable deprecation warnings (note that deprecation warnings
- are not treated as errors).
+ Set to **0** to disable deprecation warnings (note that deprecation warnings
+ are not treated as errors).
DEBUG
- Set to **1** to enable runtime assertion checks and additional diagnostics.
- Note that this has a performance cost, and is most useful for developers.
+ Set to **1** to enable runtime assertion checks and additional diagnostics.
+ Note that this has a performance cost, and is most useful for developers.
OPTIMIZE
- Set optimisation level. The default is **3** to favour performance at the
- expense of larger executable size. Set to **0** to disable optimisation (can
- make debugging easier), **1** for basic optimisation that doesn’t have a
- space/speed trade-off and doesn’t have a large impact on compile time, **2**
- to enable most optimisation that improves performance and reduces size, or
- **s** to enable only optimisations that generally don’t increase executable
- size. The exact set of supported values depends on your compiler.
+ Set optimisation level. The default is **3** to favour performance at the
+ expense of larger executable size. Set to **0** to disable optimisation
+ (can make debugging easier), **1** for basic optimisation that doesn’t have
+ a space/speed trade-off and doesn’t have a large impact on compile time,
+ **2** to enable most optimisation that improves performance and reduces
+ size, or **s** to enable only optimisations that generally don’t increase
+ executable size. The exact set of supported values depends on your
+ compiler.
SYMBOLS
- Set to **1** to include additional debugging symbols over the default for the
- target platform (many target platforms include function name symbols by
- default).
+ Set to **1** to include additional debugging symbols over the default for
+ the target platform (many target platforms include function name symbols by
+ default).
SYMLEVEL
- Numeric value that controls the level of detail in debugging symbols. Higher
- numbers make debugging easier at the cost of increased build time and
- executable size. The supported values depend on your compiler. For GCC and
- similar compilers, **1** includes line number tables and external variables,
- **2** also includes local variables, and **3** also includes macro
- definitions.
+ Numeric value that controls the level of detail in debugging symbols.
+ Higher numbers make debugging easier at the cost of increased build time and
+ executable size. The supported values depend on your compiler. For GCC and
+ similar compilers, **1** includes line number tables and external variables,
+ **2** also includes local variables, and **3** also includes macro
+ definitions.
ARCHOPTS
- Additional command-line options to pass to the compiler and linker. This is
- useful for supplying code generation or ABI options, for example to enable
- support for optional CPU features.
+ Additional command-line options to pass to the compiler and linker. This is
+ useful for supplying code generation or ABI options, for example to enable
+ support for optional CPU features.
ARCHOPTS_C
- Additional command-line options to pass to the compiler when compiling C
- source files.
+ Additional command-line options to pass to the compiler when compiling C
+ source files.
ARCHOPTS_CXX
- Additional command-line options to pass to the compiler when compiling C++
- source files.
+ Additional command-line options to pass to the compiler when compiling C++
+ source files.
ARCHOPTS_OBJC
- Additional command-line options to pass to the compiler when compiling
- Objective-C source files.
+ Additional command-line options to pass to the compiler when compiling
+ Objective-C source files.
ARCHOPTS_OBJCXX
- Additional command-line options to pass to the compiler when compiling
- Objective-C++ source files.
+ Additional command-line options to pass to the compiler when compiling
+ Objective-C++ source files.
Library/framework locations
~~~~~~~~~~~~~~~~~~~~~~~~~~~
SDL_INSTALL_ROOT
- SDL installation root directory for shared library style SDL.
+ SDL installation root directory for shared library style SDL.
SDL_FRAMEWORK_PATH
- Search path for SDL framework.
+ Search path for SDL framework.
USE_LIBSDL
- Set to **1** to use shared library style SDL on targets where framework is
- default.
+ Set to **1** to use shared library style SDL on targets where framework is
+ default.
USE_SYSTEM_LIB_ASIO
- Set to **1** to prefer the system installation of the Asio C++ asynchronous
- I/O library over the version provided with the MAME source.
+ Set to **1** to prefer the system installation of the Asio C++ asynchronous
+ I/O library over the version provided with the MAME source.
USE_SYSTEM_LIB_EXPAT
- Set to **1** to prefer the system installation of the Expat XML parser
- library over the version provided with the MAME source.
+ Set to **1** to prefer the system installation of the Expat XML parser
+ library over the version provided with the MAME source.
USE_SYSTEM_LIB_ZLIB
- Set to **1** to prefer the system installation of the zlib data compression
- library over the version provided with the MAME source.
+ Set to **1** to prefer the system installation of the zlib data compression
+ library over the version provided with the MAME source.
USE_SYSTEM_LIB_JPEG
- Set to **1** to prefer the system installation of the libjpeg image
- compression library over the version provided with the MAME source.
+ Set to **1** to prefer the system installation of the libjpeg image
+ compression library over the version provided with the MAME source.
USE_SYSTEM_LIB_FLAC
- Set to **1** to prefer the system installation of the libFLAC audio
- compression library over the version provided with the MAME source.
+ Set to **1** to prefer the system installation of the libFLAC audio
+ compression library over the version provided with the MAME source.
USE_SYSTEM_LIB_LUA
- Set to **1** to prefer the system installation of the embedded Lua
- interpreter over the version provided with the MAME source.
+ Set to **1** to prefer the system installation of the embedded Lua
+ interpreter over the version provided with the MAME source.
USE_SYSTEM_LIB_SQLITE3
- Set to **1** to prefer the system installation of the SQLITE embedded
- database engine over the version provided with the MAME source.
+ Set to **1** to prefer the system installation of the SQLITE embedded
+ database engine over the version provided with the MAME source.
USE_SYSTEM_LIB_PORTMIDI
- Set to **1** to prefer the system installation of the PortMidi library over
- the version provided with the MAME source.
+ Set to **1** to prefer the system installation of the PortMidi library over
+ the version provided with the MAME source.
USE_SYSTEM_LIB_PORTAUDIO
- Set to **1** to prefer the system installation of the PortAudio library over
- the version provided with the MAME source.
+ Set to **1** to prefer the system installation of the PortAudio library over
+ the version provided with the MAME source.
USE_BUNDLED_LIB_SDL2
- Set to **1** to prefer the version of SDL provided with the MAME source over
- the system installation. (This is enabled by default for Visual Studio and
- Android builds. For other configurations, the system installation of SDL is
- preferred.)
+ Set to **1** to prefer the version of SDL provided with the MAME source over
+ the system installation. (This is enabled by default for Visual Studio and
+ Android builds. For other configurations, the system installation of SDL is
+ preferred.)
USE_SYSTEM_LIB_UTF8PROC
- Set to **1** to prefer the system installation of the Julia utf8proc library
- over the version provided with the MAME source.
+ Set to **1** to prefer the system installation of the Julia utf8proc library
+ over the version provided with the MAME source.
USE_SYSTEM_LIB_GLM
- Set to **1** to prefer the system installation of the GLM OpenGL Mathematics
- library over the version provided with the MAME source.
+ Set to **1** to prefer the system installation of the GLM OpenGL Mathematics
+ library over the version provided with the MAME source.
USE_SYSTEM_LIB_RAPIDJSON
- Set to **1** to prefer the system installation of the Tencent RapidJSON
- library over the version provided with the MAME source.
+ Set to **1** to prefer the system installation of the Tencent RapidJSON
+ library over the version provided with the MAME source.
USE_SYSTEM_LIB_PUGIXML
- Set to **1** to prefer the system installation of the pugixml library over
- the version provided with the MAME source.
+ Set to **1** to prefer the system installation of the pugixml library over
+ the version provided with the MAME source.
.. _compiling-issues:
@@ -670,6 +733,37 @@ around it by adding **-U_FORTIFY_SOURCE** to the compiler flags (e.g. by using
the **ARCHOPTS** setting, or setting the **CFLAGS** and **CXXFLAGS** environment
variables.
+Issues affecting Microsoft Visual Studio
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Microsoft introduced a new version of XAudio2 with Windows 8 that’s incompatible
+with the version included with DirectX for prior Windows versions at the API
+level. Newer versions of the Microsoft Windows SDK include headers and libraries
+for the new version of XAudio2. By default, the target Windows version is set to
+Windows Vista (6.0) when compiling MAME, which prevents the use of this version
+of the XAudio2 headers and libraries. To build MAME with XAudio2 support using
+the Microsoft Windows SDK, you must do one of the following:
+
+* Add ``MODERN_WIN_API=1`` to the options passed to make when generating the
+ Visual Studio project files. This will set the target Windows version to
+ Windows 8 (6.2). The resulting binaries may not run on earlier versions of
+ Windows.
+* Install the DirectX SDL and configure the **osd_windows** project to search
+ the DirectX header/library paths before searching the Microsoft Windows SDK
+ paths.
+
+The MSVC compiler produces spurious warnings about potentially uninitialised
+local variables. You currently need to add ``NOWERROR=1`` to the options passed
+to make when generating the Visual Studio project files. This stops warnings
+from being treated as errors. (MSVC seems to lack options to control which
+specific warnings are treated as error, which other compilers support.)
+
+There is an as-yet unresolved issue with duplicate COM GUIDS being defined in
+the PortAudio library when the target Windows version is set to Windows Vista
+(6.0) or later. To work around this, add ``NO_USE_PORTAUDIO=1`` to the options
+passed to make when generating the Visual Studio project files. MAME will be
+built without support for sound output via PortAudio.
+
.. _compiling-unusual:
diff --git a/docs/source/license.rst b/docs/source/license.rst
index fd72712d9d8..e58d21b6dea 100644
--- a/docs/source/license.rst
+++ b/docs/source/license.rst
@@ -12,7 +12,7 @@ would encourage new contributors to distribute files under this license.
Please note that MAME is a registered trademark of Gregory Ember, and permission
is required to use the “MAME” name, logo, or wordmark.
- Copyright (C) 1997-2021 MAMEDev and contributors
+ Copyright (C) 1997-2023 MAMEDev and contributors
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/docs/source/plugins/autofire.rst b/docs/source/plugins/autofire.rst
index 56adef9b66f..805b5700151 100644
--- a/docs/source/plugins/autofire.rst
+++ b/docs/source/plugins/autofire.rst
@@ -50,9 +50,9 @@ Button 1* or the equivalent for another player, but it might have have a
different name. On Konami’s Gradius games, *P1 Button 2* is the primary fire
button.
-Select **Hotkey** to set the input combination you’ll use to activate the
-autofire button. This can be any combination that MAME supports for activating
-a digital input.
+Select **Hotkey** to set the control (or combination of controls) you’ll use to
+activate the autofire button. This can be any combination that MAME supports
+for activating a digital input.
**On frames** and **Off frames** are the number of consecutive emulated video
frames that the emulated button will be held and released for, respectively.
@@ -66,10 +66,10 @@ Experiment with different values to get the best effect.
When adding a new autofire button, there is a **Cancel** option that changes to
**Create** after you set the input and hotkey. Select **Create** to finish
creating the autofire button and return to the list of autofire buttons. The
-new autofire button will be added at the end of the list. Press the UI Cancel
-key (Escape/Esc on the keyboard by default), or select **Cancel** before setting
-the input/hotkey, to return to the previous menu without creating the new
-autofire button.
+new autofire button will be added at the end of the list. Press the UI Back key
+(Escape/Esc on the keyboard by default), or select **Cancel** before setting the
+input/hotkey, to return to the previous menu without creating the new autofire
+button.
When modifying an existing autofire button, select **Done** or press the UI
Cancel key to return to the list of autofire buttons. Changes take effect
@@ -81,10 +81,10 @@ immediately.
Notes and potential pitfalls
----------------------------
-Autofire buttons act as if they’re wired in parallel with MAME’s regular inputs.
-This means that if you set the activation hotkey for an autofire button to a
-button or key that’s also assigned to one of the emulated inputs directly, you
-may get unexpected results. Using Gradius as an example:
+Autofire buttons act as if they’re wired in parallel with MAME’s regular
+controls. This means that if you set the activation hotkey for an autofire
+button to a button or key that’s also assigned to one of the emulated inputs
+directly, you may get unexpected results. Using Gradius as an example:
* Suppose you set button 1 on your controller to fire, and set an autofire
hotkey to button 1 as well. Holding the button down to shoot will not trigger
@@ -97,8 +97,8 @@ may get unexpected results. Using Gradius as an example:
powerup because the powerup button is also being held down along with the
autofire button.
-It is suggested you choose input combinations for autofire hotkeys that are not
-assigned to any other emulated inputs in the system.
+It is recommended that you choose control combinations for autofire hotkeys that
+are not assigned to any other emulated inputs in the system.
Autofire is not necessarily desirable in all situations. For example using
autofire in Super-X with the blue “lightning” weapon equipped at high power
diff --git a/docs/source/plugins/data.rst b/docs/source/plugins/data.rst
index 8c19db64779..10b586d9127 100644
--- a/docs/source/plugins/data.rst
+++ b/docs/source/plugins/data.rst
@@ -53,6 +53,7 @@ plugin can also show high scores from non-volatile memory or saved by the
Note that you can only use a single file of each type at a time. You cannot,
for example, use the English and Japanese **mameinfo.dat** files simultaneously.
-The data plugin creates a **history.db** file in the first configured DATs
-folder. This file stores the information from the support files in a format
-suitable for rapid loading. It uses the SQLite3 database format.
+The data plugin creates a **history.db** file in the **data** folder in the
+plugin data folder (see the :ref:`homepath option <mame-commandline-homepath>`).
+This file stores the information from the support files in a format suitable for
+rapid loading. It uses the SQLite3 database format.
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/plugins/inputmacro.rst b/docs/source/plugins/inputmacro.rst
index 99f8a3448fc..1198315fd11 100644
--- a/docs/source/plugins/inputmacro.rst
+++ b/docs/source/plugins/inputmacro.rst
@@ -55,12 +55,12 @@ whole:
descriptive. Press the UI Select key (Return/Enter on the keyboard or the
first button on the first joystick by default) to edit the current name, or
press the UI Clear key to type a new name. Press the UI Select key before
- moving to another menu item to save the new name; press the UI Cancel key
+ moving to another menu item to save the new name; press the UI Back key
(Escape/Esc on the keyboard by default) to change discard the new name.
-* Select **Activation sequence** to set the key or button combination you want
- to use to activate the macro. Keep in mind that regular input settings still
- apply, so you probably want to use a combination that isn’t being used for any
- other emulated input in the system.
+* Select **Activation combination** to set the control (or combination of
+ controls) you want to use to activate the macro. Keep in mind that regular
+ input assignments still apply, so you will probably want to use a combination
+ that isn’t being used for any other emulated input in the system.
* Set **On release** to specify what should happen if the activation sequence is
released before the macro completes. When set to *Stop immediately*, any
emulated inputs activated by the macro will be released immediately, and no
@@ -112,11 +112,11 @@ When creating a new macro, there is a **Cancel** option that changes to
**Create** after you set the activating sequence and the first input for the
initially created step. Select **Create** to finish creating the macro and
return to the list of input macros. The new macro will be added at the end of
-the list. Press the UI Cancel key, or select **Cancel** before setting the
+the list. Press the UI Back key, or select **Cancel** before setting the
activation sequence/input, to return to the previous menu without creating the
new macro.
-When editing an existing macro, select **Done** or press the UI Cancel key to
+When editing an existing macro, select **Done** or press the UI Back key to
return to the list of input macros. Changes take effect immediately.
@@ -133,7 +133,7 @@ thing could be achieved using the :ref:`plugins-autofire`, but this demonstrates
a simple looping macro:
* **Name**: P1 Autofire
-* **Activation sequence**: Kbd Space
+* **Activation combination**: Kbd Space
* **On release**: Stop immediately
* **When held**: Loop to step 2
* **Step 1**:
@@ -159,7 +159,7 @@ This allows you to run in Konami Track & Field by holding a single button. This
takes most of the skill (and fun) out of the game:
* **Name**: P1 Sprint
-* **Activation sequence**: Kbd Shift
+* **Activation combination**: Kbd Shift
* **On release**: Stop immediately
* **When held**: Loop to step 2
* **Step 1**:
@@ -188,7 +188,7 @@ This macro allows you to perform a right-facing Shōryūken (Dragon Punch) by
pressing a single key:
* **Name**: 1P Shoryuken LP
-* **Activation sequence**: Kbd M
+* **Activation combination**: Kbd M
* **On release**: Complete macro
* **When held**: Prolong step 6
* **Step 1**:
diff --git a/docs/source/techspecs/device_memory_interface.rst b/docs/source/techspecs/device_memory_interface.rst
index 2eae46f3906..6056cce81de 100644
--- a/docs/source/techspecs/device_memory_interface.rst
+++ b/docs/source/techspecs/device_memory_interface.rst
@@ -152,14 +152,17 @@ Indicates whether a given space actually exists.
.. code-block:: C++
- bool translate(int spacenum, int intention, offs_t &address);
+ bool translate(int spacenum, int intention, offs_t &address, address_space *&target_space);
Does a logical to physical address translation through the device's
MMU. spacenum gives the space number, intention for the type of the
-future access (``TRANSLATE_(READ\|WRITE\|FETCH)(\|_USER\|_DEBUG)``)
-and address is an in/out parameter holding the address to translate on
-entry and the translated version on return. Should return ``true`` if
-the translation went correctly, or ``false`` if the address is unmapped.
+future access (``TR_(READ\|WRITE\|FETCH)``), address is an in/out
+parameter holding the address to translate on entry and the translated
+version on return, and finally target_space is the actual space the
+access would end up in, which may be in a different device. Should
+return ``true`` if the translation went correctly, or ``false`` if the
+address is unmapped. The call must not change the state of the
+device.
Note that for some historical reason, the device itself must override
the virtual method ``memory_translate`` with the same signature.
diff --git a/docs/source/techspecs/index.rst b/docs/source/techspecs/index.rst
index 40d4048e522..43f57bb6fed 100644
--- a/docs/source/techspecs/index.rst
+++ b/docs/source/techspecs/index.rst
@@ -5,19 +5,20 @@ This section covers technical specifications useful to programmers working on
MAME’s source or working on scripts that run within the MAME framework.
.. toctree::
- :titlesonly:
+ :titlesonly:
- naming
- layout_files
- layout_script
- object_finders
- device_memory_interface
- device_rom_interface
- device_disasm_interface
- memory
- floppy
- nscsi
- luaengine
- luareference
- m6502
- poly_manager
+ naming
+ layout_files
+ layout_script
+ object_finders
+ inputsystem
+ device_memory_interface
+ device_rom_interface
+ device_disasm_interface
+ memory
+ floppy
+ nscsi
+ luaengine
+ luareference
+ m6502
+ poly_manager
diff --git a/docs/source/techspecs/inputsystem.rst b/docs/source/techspecs/inputsystem.rst
new file mode 100644
index 00000000000..d7f0c1a74c4
--- /dev/null
+++ b/docs/source/techspecs/inputsystem.rst
@@ -0,0 +1,460 @@
+.. _inputsystem:
+
+Input System
+============
+
+.. contents::
+ :local:
+ :depth: 2
+
+
+.. _inputsystem-intro:
+
+Introduction
+------------
+
+The variety of systems MAME emulates, as well as the variation in host
+systems and peripherals, necessitates a flexible, configurable input
+system.
+
+Note that the input system is concerned with low-level user input.
+High-level user interaction, involving things like text input and
+pointing devices, is handled separately.
+
+
+.. _inputsystem-components:
+
+Components
+----------
+
+From the emulated system’s point of view, the input system has the
+following conceptual components.
+
+Input device
+~~~~~~~~~~~~
+
+Input devices supply input values. An input device typically
+corresponds to a physical device in the host system, for example a
+keyboard, mouse or game controller. However, there isn’t always a
+one-to-one correspondence between input devices and physical devices.
+For example the SDL keyboard provider module aggregates all keyboards
+into a single input device, and the Win32 lightgun provider module can
+present two input devices using input from a single mouse.
+
+Input devices are identified by their device class (keyboard, mouse,
+joystick or lightgun) and device number within the class. Input
+provider modules can also supply an implementation-dependent identifier
+to allow the user to configure stable device numbering.
+
+Note that input devices are unrelated to emulated devices (``device_t``
+implementations) despite the similar name.
+
+Input device item
+~~~~~~~~~~~~~~~~~
+
+Also known as a **control**, and input device item corresponds to a
+input source that produces a single value. This usually corresponds to
+a physical control or sensor, for example a joystick axis, a button or
+an accelerometer.
+
+MAME supports three kinds of controls: **switches**, **absolute axes**
+and **relative axes**:
+
+* Switches produce the value 0 when inactive (released or off) or 1 when
+ active (pressed or on).
+* Absolute axes produce a value normalised to the range -65,536 to
+ 65,536 with zero corresponding to the neutral position.
+* Relative axes produce a value corresponding to the movement since the
+ previous input update. Mouse-like devices scale values to
+ approximately 512 per nominal 100 DPI pixel.
+
+Negative axis values should correspond to directions up, to the left,
+away from the player, or anti-clockwise. For single-ended axes (e.g.
+pedals or displacement-sensitive triggers and buttons), only zero and
+the negative portion of the range should be used.
+
+Switches are used to represent controls that naturally have two distinct
+states, like buttons and toggle switches.
+
+Absolute axes are used to represent controls with a definite range
+and/or neutral position. Examples include steering wheels with limit
+stops, joystick axes, and displacement-sensitive triggers.
+
+Relative axes are used to represent controls with an effectively
+infinite range. Examples include mouse/trackball axes, incremental
+encoder dials, and gyroscopes.
+
+Accelerometers and force sensing joystick axes should be represented as
+absolute axes, even though the range is theoretically open-ended. In
+practice, there is a limit to the range the transducers can report,
+which is usually substantially larger than needed for normal operation.
+
+Input device items are identified by their associated device’s class and
+device number along with an **input item ID**. MAME supplies item IDs
+for common types of controls. Additional controls or controls that do
+not correspond to a common type are dynamically assigned item IDs. MAME
+supports hundreds to items per input device.
+
+I/O port field
+~~~~~~~~~~~~~~
+
+An I/O port field represents an input source in an emulated device or
+system. Most types of I/O port fields can be assigned one or more
+combinations of controls, allowing the user to control the input to
+the emulated system.
+
+Similarly to input device items, there are multiple types of I/O port
+fields:
+
+* **Digital fields** function as switches that produce one of two
+ distinct values. They are used for keyboard keys, eight-way joystick
+ direction switches, toggle switches, photointerruptors and other
+ emulated inputs that function as two-position switches.
+* **Absolute analog fields** have a range with defined minimum, maximum
+ and neutral positions. They are used for analog joystick axes,
+ displacement-sensitive pedals, paddle knobs, and other emulated inputs
+ with a defined range.
+* **Relative analog fields** have a range with with defined
+ minimum, maximum and starting positions. On each update, the value
+ accumulates and wraps when it passes either end of the range.
+ Functionally, this is like the output of an up/down counter connected
+ to an incremental encoder. They are used for mouse/trackball axes,
+ steering wheels without limit stops, and other emulated inputs that
+ have no range limits.
+* DIP switch, configuration and adjuster fields allow the user to set
+ the value through MAME’s user interface.
+* Additional special field types are used to produce fixed or
+ programmatically generated values.
+
+A digital field appears to the user as a single assignable input, which
+accepts switch values.
+
+An analog field appears to the user as three assignable inputs: an
+**axis input**, which accepts axis values; and an **increment input**
+and a **decrement input** which accept switch values.
+
+Input manager
+~~~~~~~~~~~~~
+
+The input manager has several responsibilities:
+
+* Tracking the available input devices in the system.
+* Reading input values.
+* Converting between internal identifier values, configuration token
+ strings and display strings.
+
+In practice, emulated devices and systems rarely interact with the input
+manager directly. The most common reason to access the input manager is
+implementing special debug controls, which should be disabled in release
+builds. Plugins that respond to input need to call the input manager to
+raed inputs.
+
+I/O port manager
+~~~~~~~~~~~~~~~~
+
+The I/O port manager’s primary responsibilities include:
+
+* Managing assignments of controls to I/O port fields and user interface
+ actions.
+* Reading input values via the input manager and updating I/O port field
+ values.
+
+Like the input manager, the I/O port manager is largely transparent to
+emulated devices and systems. You just need to set up your I/O ports
+and fields, and the I/O port manager handles the rest.
+
+
+.. _inputsystem-structures:
+
+Structures and data types
+-------------------------
+
+The following data types are used for dealing with input.
+
+Input code
+~~~~~~~~~~
+
+An input code specifies an input device item and how it should be
+interpreted. It is a tuple consisting of the following values: **device
+class**, **device number**, **item class**, **item modifier** and **item
+ID**:
+
+* The device class, device number and item ID together identify the
+ input device item to read.
+* The item class specifies the type of output value desired: switch,
+ absolute axis or relative axis. Axis values can be converted to
+ switch values by specifying an appropriate modifier.
+* The modifier specifies how a value should be interpreted. Valid
+ options depend on the type of input device item and the specified
+ item class.
+
+If the specified input item is a switch, it can only be read using the
+switch class, and no modifiers are supported. Attempting to read a
+switch as an absolute or relative axis always returns zero.
+
+If the specified input item is an absolute axis, it can be read as an
+absolute axis or as a switch:
+
+* Reading an absolute axis item as an absolute axis returns the current
+ state of the control, potentially transformed if a modifier is
+ specified. Supported modifiers are **reverse** to reverse the range
+ of the control, **positive** to map the positive range of the control
+ onto the output (zero corresponding to -65,536 and 65,536
+ corresponding to 65,536), and **negative** to map the negative range
+ of the control onto the output (zero corresponding to -65,536 and
+ -65,536 corresponding to 65,536).
+* Reading an absolute axis item as a switch returns zero or 1 depending
+ on whether the control is past a threshold in the direction specified
+ by the modifier. Use the **negative** modifier to return 1 when the
+ control is beyond the threshold in the negative direction (up or
+ left), or the **positive** modifier to return 1 when the control is
+ beyond the threshold in the positive direction (down or right). There
+ are two special pairs of modifiers, **left**/**right** and
+ **up**/**down** that are only applicable to the primary X/Y axes of
+ joystick devices. The user can specify a *joystick map* to control
+ how these modifiers interpret joystick movement.
+* Attempting to read an absolute axis item as a relative axis always
+ returns zero.
+
+If the specified input item is a relative axis, it can be read as a
+relative axis or as a switch:
+
+* Reading a relative axis item as a relative axis returns the change in
+ value since the last input update. The only supported modifier is
+ **reverse**, which negates the value, reversing the direction.
+* Reading a relative axis as a switch returns 1 if the control moved in
+ the direction specified by the modifier since the last input update.
+ Use the **negative**/**left**/**up** modifiers to return 1 when the
+ control has been moved in the negative direction (up or left), or the
+ **positive**/**right**/**down** modifiers to return 1 when the control
+ has moved in the positive direction (down or right).
+* Attempting to read a relative axis item as an absolute axis always
+ returns zero.
+
+There are also special input codes used for specifying how multiple
+controls are to be combined in an input sequence.
+
+The most common place you’ll encounter input codes in device and system
+driver code is when specifying initial assignments for I/O port fields
+that don’t have default assignments supplied by the core. The
+``PORT_CODE`` macro is used for this purpose.
+
+MAME provides macros and helper functions for producing commonly used
+input codes, including standard keyboard keys and
+mouse/joystick/lightgun axes and buttons.
+
+Input sequence
+~~~~~~~~~~~~~~
+
+An input sequence specifies a combination controls that can be assigned
+to an input. The name refers to the fact that it is implemented as a
+sequence container with input codes as elements. It is somewhat
+misleading, as input sequences are interpreted using instantaneous
+control values. Input sequences are interpreted differently for switch
+and axis input.
+
+Input sequences for switch input must only contain input codes with the
+item class set to switch along with the special **or** and **not** input
+codes. The input sequence is interpreted using sum-of-products logic.
+A **not** code causes the value returned by the immediately following
+code to be inverted. The conjunction of values returned by successive
+codes is evaluated until an **or** code is encountered. If the current
+value is 1 when an **or** code is encountered it is returned, otherwise
+evaluation continues.
+
+Input sequences for axis input can contain input codes with the item
+class set to switch, absolute axis or relative axis along with the
+special **or** and **not** codes. It’s helpful to think of the input
+sequence as containing one or more groups of input codes separated by
+**or** codes:
+
+* A **not** code causes the value returned by an immediately following
+ switch code to be inverted. It has no effect on absolute or relative
+ axis codes.
+* Within a group, the conjunction of the values returned by switch codes
+ is evaluated. If it is zero, the group is ignored.
+* Within a group, multiple axis values of the same type are summed.
+ Values returned by absolute axis codes are summed, and values returned
+ by relative axis codes are summed.
+* If any absolute axis code in a group returns a non-zero value, the sum
+ of relative axes in the group is ignored. Any non-zero absolute axis
+ value takes precedence over relative axis values.
+* The same logic is applied when combining group values: group values
+ produced from the same axis type are summed, and values produced from
+ absolute axes take precedence over values produced from relative axes.
+* After the group values are summed, if the value was produced from
+ absolute axes it is clamped to the range -65,536 to 65,536 (values
+ produced from relative axes are not clamped).
+
+Emulation code rarely needs to deal with input sequences directly, as
+they’re handled internally between the I/O port manager and input
+manager. The input manager also converts input sequences to and from
+the token strings stored in configuration files and produces text for
+displaying input sequences to users.
+
+Plugins with controls or hotkeys need to use input sequences to allow
+configuration. Utility classes are provided to allow input sequences to
+be entered by the user in a consistent way, and the input manager can be
+used for conversions to and from configuration and display strings. It
+is very rare to need to directly manipulate input sequences.
+
+
+.. _inputsystem-providermodules:
+
+Input provider modules
+----------------------
+
+Input provider modules are part of the OS-dependent layer (OSD), and are
+not directly exposed to emulation and user interface code. Input
+provider modules are responsible for detecting available host input
+devices, setting up input devices for the input manager, and providing
+callbacks to read the current state of input device items. Input
+provider modules may also provide additional default input assignments
+suitable for host input devices that are present.
+
+The user is given a choice of input modules to use. One input provider
+module is used for each of the four input device classes (keyboard,
+mouse, joystick and lightgun). The available modules depend on the host
+operating system and OSD implementation. Different modules may use
+different APIs, support different kinds of devices, or present devices
+in different ways.
+
+
+.. _inputsystem-playerpositions:
+
+Player positions
+----------------
+
+MAME uses a concept called *player positions* to help manage input
+assignments. The number of player positions supported depends on the
+I/O port field type:
+
+* Ten player positions are supported for common game inputs, including
+ joystick, pedal, paddle, dial, trackball, lightgun and mouse.
+* Four player positions are supported for mahjong and hanafuda inputs.
+* One player position is supported for gambling system inputs.
+* Other inputs do not use player positions. This includes coin slots,
+ arcade start buttons, tilt switches, service switches and
+ keyboard/keypad keys.
+
+The user can configure default input assignments per player position for
+supported I/O port field types which are saved in the file
+**default.cfg**. These assignments are used for all systems unless the
+device/system driver supplies its own default assignments, or the user
+configures system-specific input assignments.
+
+In order to facilitate development of reusable emulated devices with
+inputs, particularly slot devices, the I/O port manager automatically
+renumbers player positions when setting up the emulated system:
+
+* The I/O port manager starts at player position 1 and begins
+ iterating the emulated device tree in depth first order, starting from
+ the root device.
+* If a device has I/O port fields that support player positions, they
+ are renumbered to start from the I/O port manager’s current player
+ position.
+* Before advancing to the next device, the I/O port manager sets its
+ current player position to the last seen player position plus one.
+
+For a simple example, consider what happens when you run a Sega Mega
+Drive console with two game pads connected:
+
+* The I/O port manager starts at player position 1 at the root device.
+* The first device encountered with I/O port fields that support player
+ positions is the first game pad. The inputs are renumbered to start
+ at player position 1. This has no visible effect, as the I/O port
+ fields are initially numbered starting at player position 1.
+* Before moving to the next device, the I/O port manager sets its
+ current player position to 2 (the last player position seen plus one).
+* The next device encountered with I/O port fields that support player
+ positions is the second game pad. The inputs are renumbered to start
+ at player position 2. This avoids I/O port field type conflicts with
+ the first game pad.
+* Before moving to the next device, the I/O port manager sets its
+ current player position to 3 (the last player position seen plus one).
+* No more devices with I/O port fields that support player positions are
+ encountered.
+
+
+.. _inputsystem-updatingfields:
+
+Updating I/O port fields
+------------------------
+
+The I/O port manager updates I/O port fields once for each video frame
+produced by the first emulated screen in the system. How a field is
+updated depends on whether it is a digital or analog field.
+
+Updating digital fields
+~~~~~~~~~~~~~~~~~~~~~~~
+
+Updating digital I/O port fields is simple:
+
+* The I/O port manager reads the current value for the field’s assigned
+ input sequence (via the input manager).
+* If the value is zero, the field’s default value is set.
+* If the value is non-zero, the binary complement of the field’s default
+ value is set.
+
+Updating absolute analog fields
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Updating absolute analog I/O port fields is more complex due to the need
+to support a variety of control setups:
+
+* The I/O port manager reads the current value for the field’s assigned
+ axis input sequence (via the input manager).
+* If the current value changed since the last update and the input
+ device item that produced the current value was an absolute axis, the
+ field’s value is set to the current value scaled to the correct range,
+ and no further processing is performed.
+* If the current value is non-zero and the input device device item that
+ produced the current value was a relative axis, the current value is
+ added to the field’s value, scaled by the field’s sensitivity setting.
+* The I/O port manager reads the current value for the field’s assigned
+ increment input sequence (via the input manager); if this value is
+ non-zero, the field’s increment/decrement speed setting value is added
+ to its value, scaled by its sensitivity setting.
+* The I/O port manager reads the current value for the field’s assigned
+ decrement input sequence (via the input manager); if this value is
+ non-zero, the field’s increment/decrement speed setting value is
+ subtracted from its value, scaled by its sensitivity setting.
+* If the current axis input, increment input and decrement input values
+ are all zero, but either or both of the increment input and decrement
+ input values were non-zero the last time the field’s value changed in
+ response to user input, the field’s auto-centring speed setting value
+ is added to or subtracted from its value to move it toward its default
+ value.
+
+Note that the sensitivity setting value for absolute analog fields
+affects the response to relative axis input device items and
+increment/decrement inputs, but it does not affect the response to
+absolute axis input device items or the auto-centring speed.
+
+Updating relative analog fields
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Relative analog I/O port fields also need special handling to cater for
+multiple control setups, but they are a little simpler than absolute
+analog fields:
+
+* The I/O port manager reads the current value for the field’s assigned
+ axis input sequence (via the input manager).
+* If the current value is non-zero and the input device item that
+ produced the current value was an absolute axis, the current value is
+ added to the field’s value, scaled by the field’s sensitivity setting,
+ and no further processing is performed.
+* If the current value is non-zero and the input device device item that
+ produced the current value was a relative axis, the current value is
+ added to the field’s value, scaled by the field’s sensitivity setting.
+* The I/O port manager reads the current value for the field’s assigned
+ increment input sequence (via the input manager); if this value is
+ non-zero, the field’s increment/decrement speed setting value is added
+ to its value, scaled by its sensitivity setting.
+* The I/O port manager reads the current value for the field’s assigned
+ decrement input sequence (via the input manager); if this value is
+ non-zero, the field’s increment/decrement speed setting value is
+ subtracted from its value, scaled by its sensitivity setting.
+
+Note that the sensitivity setting value for relative analog fields
+affects the response to all user input.
diff --git a/docs/source/techspecs/layout_files.rst b/docs/source/techspecs/layout_files.rst
index c43a7df8e1b..5dd1bba0758 100644
--- a/docs/source/techspecs/layout_files.rst
+++ b/docs/source/techspecs/layout_files.rst
@@ -517,21 +517,6 @@ text
be an integer, where 0 (zero) means centred, 1 (one) means left-aligned, and
2 (two) means right-aligned. If the ``align`` attribute is absent, the text
will be centred.
-dotmatrix
- Draws an eight-pixel horizontal segment of a dot matrix display, using
- circular pixels in the specified colour. The bits of the element’s state
- determine which pixels are lit, with the least significant bit corresponding
- to the leftmost pixel. Unlit pixels are drawn at low intensity (0x20/0xff).
-dotmatrix5dot
- Draws a five-pixel horizontal segment of a dot matrix display, using
- circular pixels in the specified colour. The bits of the element’s state
- determine which pixels are lit, with the least significant bit corresponding
- to the leftmost pixel. Unlit pixels are drawn at low intensity (0x20/0xff).
-dotmatrixdot
- Draws a single element of a dot matrix display as a circular pixels in the
- specified colour. The least significant bit of the element’s state
- determines whether the pixel is lit. An unlit pixel is drawn at low
- intensity (0x20/0xff).
led7seg
Draws a standard seven-segment (plus decimal point) digital LED/fluorescent
display in the specified colour. The low eight bits of the element’s state
@@ -539,14 +524,6 @@ led7seg
the bits correspond to the top segment, the upper right-hand segment,
continuing clockwise to the upper left segment, the middle bar, and the
decimal point. Unlit segments are drawn at low intensity (0x20/0xff).
-led8seg_gts1
- Draws an eight-segment digital fluorescent display of the type used in
- Gottlieb System 1 pinball machines (actually a Futaba part). Compared to
- standard seven-segment displays, these displays have no decimal point, the
- horizontal middle bar is broken in the centre, and there is a broken
- vertical middle bar controlled by the bit that would control the decimal
- point in a standard seven-segment display. Unlit segments are drawn at low
- intensity (0x20/0xff).
led14seg
Draws a standard fourteen-segment alphanumeric LED/fluorescent display in
the specified colour. The low fourteen bits of the element’s state control
@@ -1491,12 +1468,12 @@ internal layouts included in MAME.
This system uses lamps for key gameplay elements. Blending modes are used
for the translucent colour overlay placed over the monitor, and the lamps
reflected in front of the monitor. Also uses collections to allow parts of
- the layout to be disabled selectively. The shapes on the overlay are drawn
- using embedded SVG images.
+ the layout to be disabled selectively.
`armora.lay <https://git.redump.net/mame/tree/src/mame/layout/armora.lay?h=mame0235>`_
This game’s monitor is viewed directly through a translucent colour overlay
rather than being reflected from inside the cabinet. This means the overlay
reflects ambient light as well as affecting the colour of the video image.
+ The shapes on the overlay are drawn using embedded SVG images.
`tranz330.lay <https://git.redump.net/mame/tree/src/mame/layout/tranz330.lay?h=mame0235>`_
A multi-segment alphanumeric display and keypad. The keys are clickable,
and provide visual feedback when pressed.
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 85c7ea8cb8a..18af28b5c2a 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
@@ -63,6 +139,29 @@ Core classes
Many of MAME’s core classes used to implement an emulation session are available
to Lua scripts.
+.. _luareference-core-notifiersub:
+
+Notifier subscription
+~~~~~~~~~~~~~~~~~~~~~
+
+Wraps MAME’s ``util::notifier_subscription`` class, which manages a subscription
+to a broadcast notification.
+
+Methods
+^^^^^^^
+
+subscription:unsubscribe()
+ Unsubscribes from notifications. The subscription will become inactive and
+ no future notifications will be received.
+
+Properties
+^^^^^^^^^^
+
+subscription.is_active (read-only)
+ A Boolean indicating whether the subscription is active. A subscription
+ becomes inactive after explicitly unsubscribing or if the underlying
+ notifier is destroyed.
+
.. _luareference-core-attotime:
Attotime
@@ -282,6 +381,9 @@ machine.hard_reset_pending (read-only)
machine.devices (read-only)
A :ref:`device enumerator <luareference-dev-enum>` that yields all
:ref:`devices <luareference-dev-device>` in the emulated system.
+machine.palettes (read-only)
+ A :ref:`device enumerator <luareference-dev-enum>` that yields all
+ :ref:`palette devices <luareference-dev-dipalette>` in the emulated system.
machine.screens (read-only)
A :ref:`device enumerator <luareference-dev-enum>` that yields all
:ref:`screen devices <luareference-dev-screen>` in the emulated system.
@@ -537,6 +639,8 @@ ui.line_height (read-only)
ui.menu_active (read-only)
A Boolean indicating whether an interactive UI element is currently active.
Examples include menus and slider controls.
+ui.ui_active (read/write)
+ A Boolean indicating whether UI control inputs are currently enabled.
ui.single_step (read/write)
A Boolean controlling whether the emulated system should be automatically
paused when the next frame is drawn. This property is automatically reset
@@ -589,10 +693,6 @@ driver.rotation (read-only)
A string indicating the rotation applied to all screens in the system after
the screen orientation specified in the machine configuration is applied.
Will be one of ``"rot0"``, ``"rot90"``, ``"rot180"`` or ``"rot270"``.
-driver.type (read-only)
- A string providing a system type. Will be one of ``"arcade"``,
- ``"console"``, ``"computer"`` or ``"other"``. This is for informational
- purposes only, and may not be supported in the future.
driver.not_working (read-only)
A Boolean indicating whether the system is marked as not working.
driver.supports_save (read-only)
@@ -702,6 +802,9 @@ Instantiation
manager.machine.devices
Returns a device enumerator that will iterate over
:ref:`devices <luareference-dev-device>` in the system.
+manager.machine.palettes
+ Returns a device enumerator that will iterate over
+ :ref:`palette devices <luareference-dev-dipalette>` in the system.
manager.machine.screens
Returns a device enumerator that will iterate over
:ref:`screen devices <luareference-dev-screen>` in the system.
@@ -721,6 +824,13 @@ emu.device_enumerator(device, [depth])
provided, it must be an integer specifying the maximum number of levels to
iterate below the specified device (i.e. 1 will limit iteration to the
device and its immediate children).
+emu.palette_enumerator(device, [depth])
+ Returns a device enumerator that will iterate over
+ :ref:`palette devices <luareference-dev-dipalette>` in the sub-tree starting
+ at the specified device. The specified device will be included if it is a
+ palette device. If the depth is provided, it must be an integer specifying
+ the maximum number of levels to iterate below the specified device (i.e. 1
+ will limit iteration to the device and its immediate children).
emu.screen_enumerator(device, [depth])
Returns a device enumerator that will iterate over
:ref:`screen devices <luareference-dev-screen>` in the sub-tree starting at
@@ -820,12 +930,104 @@ device.debug (read-only)
The :ref:`debugger interface <luareference-debug-devdebug>` to the device if
it is a CPU device, or ``nil`` if it is not a CPU device or the debugger is
not enabled.
+device.state[] (read-only)
+ The :ref:`state entries <luareference-dev-stateentry>` for devices that
+ expose the register state interface, indexed by symbol, or ``nil`` for other
+ devices. The index operator and ``index_of`` methods have O(n) complexity;
+ all other supported operations have O(1) complexity.
device.spaces[] (read-only)
A table of the device’s :ref:`address spaces <luareference-mem-space>`,
indexed by name. Only valid for devices that implement the memory
interface. Note that the names are specific to the device type and have no
special significance.
+.. _luareference-dev-dipalette:
+
+Palette device
+~~~~~~~~~~~~~~
+
+Wraps MAME’s ``device_palette_interface`` class, which represents a device that
+translates pen values to colours.
+
+Colours are represented in alpha/red/green/blue (ARGB) format. Channel values
+range from 0 (transparent or off) to 255 (opaque or full intensity), inclusive.
+Colour channel values are not pre-multiplied by the alpha value. Channel values
+are packed into the bytes of 32-bit unsigned integers, in the order alpha, red,
+green, blue from most-significant to least-significant byte.
+
+Instantiation
+^^^^^^^^^^^^^
+
+manager.machine.palettes[tag]
+ Gets a palette device by tag relative to the root machine device, or ``nil``
+ if no such device exists or it is not a palette device.
+
+Methods
+^^^^^^^
+
+palette:pen(index)
+ Gets the remapped pen number for the specified palette index.
+palette:pen_color(pen)
+ Gets the colour for the specified pen number.
+palette:pen_contrast(pen)
+ Gets the contrast value for the specified pen number. The contrast is a
+ floating-point number.
+palette:pen_indirect(index)
+ Gets the indirect pen index for the specified palette index.
+palette:indirect_color(index)
+ Gets the indirect pen colour for the specified palette index.
+palette:set_pen_color(pen, color)
+ Sets the colour for the specified pen number. The colour may be specified
+ as a single packed 32-bit value; or as individual red, green and blue
+ channel values, in that order.
+palette:set_pen_red_level(pen, level)
+ Sets the red channel value of the colour for the specified pen number.
+ Other channel values are not affected.
+palette:set_pen_green_level(pen, level)
+ Sets the green channel value of the colour for the specified pen number.
+ Other channel values are not affected.
+palette:set_pen_blue_level(pen, level)
+ Sets the blue channel value of the colour for the specified pen number.
+ Other channel values are not affected.
+palette:set_pen_contrast(pen, factor)
+ Sets the contrast value for the specified pen number. The value must be a
+ floating-point number.
+palette:set_pen_indirect(pen, index)
+ Sets the indirect pen index for the specified pen number.
+palette:set_indirect_color(index, color)
+ Sets the indirect pen colour for the specified palette index. The colour
+ may be specified as a single packed 32-bit value; or as individual red,
+ green and blue channel values, in that order.
+palette:set_shadow_factor(factor)
+ Sets the contrast value for the current shadow group. The value must be a
+ floating-point number.
+palette:set_highlight_factor(factor)
+ Sets the contrast value for the current highlight group. The value must be
+ a floating-point number.
+palette:set_shadow_mode(mode)
+ Sets the shadow mode. The value is the index of the desired shadow table.
+
+Properties
+^^^^^^^^^^
+
+palette.palette (read-only)
+ The underlying :ref:`palette <luareference-render-palette>` managed by the
+ device.
+palette.entries (read-only)
+ The number of colour entries in the palette.
+palette.indirect_entries (read-only)
+ The number of indirect pen entries in the palette.
+palette.black_pen (read-only)
+ The index of the fixed black pen entry.
+palette.white_pen (read-only)
+ The index of the fixed white pen.
+palette.shadows_enabled (read-only)
+ A Boolean indicating whether shadow colours are enabled.
+palette.highlights_enabled (read-only)
+ A Boolean indicating whether highlight colours are enabled.
+palette.device (read-only)
+ The underlying :ref:`device <luareference-dev-device>`.
+
.. _luareference-dev-screen:
Screen device
@@ -881,10 +1083,12 @@ screen:pixel(x, y)
packed into a 32-bit integer. Returns zero (0) if the specified point is
outside the visible area.
screen:pixels()
- Returns all visible pixels as 32-bit integers packed into a binary string in
- host Endian order. Pixels are organised in row-major order, from left to
- right then top to bottom. Pixels values are either palette indices or
- colours in RGB format packed into 32-bit integers.
+ Returns all visible pixels, the visible area width and visible area height.
+
+ Pixels are returned as 32-bit integers packed into a binary string in host
+ Endian order. Pixels are organised in row-major order, from left to right
+ then top to bottom. Pixels values are either palette indices or colours in
+ RGB format packed into 32-bit integers.
screen:draw_box(left, top, right, bottom, [line], [fill])
Draws an outlined rectangle with edges at the specified positions.
@@ -903,8 +1107,8 @@ screen:draw_box(left, top, right, bottom, [line], [fill])
most-significant to least-significant byte. If the line colour is not
provided, the UI text colour is used; if the fill colour is not provided,
the UI background colour is used.
-screen:draw_line(x1, y1, x2, y2, [color])
- Draws a line from (x1, y1) to (x2, y2).
+screen:draw_line(x0, y0, x1, y1, [color])
+ Draws a line from (x0, y0) to (x1, y1).
Coordinates are floating-point numbers in units of emulated screen pixels,
with the origin at (0, 0). Note that emulated screen pixels often aren’t
@@ -993,6 +1197,10 @@ screen.frame_number (read-only)
screen.container (read-only)
The :ref:`render container <luareference-render-container>` used to draw the
screen.
+screen.palette (read-only)
+ The :ref:`palette device <luareference-dev-dipalette>` used to translate
+ pixel values to colours, or ``nil`` if the screen uses a direct colour pixel
+ format.
.. _luareference-dev-cass:
@@ -1075,16 +1283,17 @@ Methods
^^^^^^^
image:load(filename)
- Loads the specified file as a media image. Returns ``"pass"`` or
- ``"fail"``.
+ Loads the specified file as a media image. Returns ``nil`` if no error
+ or a string describing an error if an error occurred.
image:load_software(name)
- Loads a media image described in a software list. Returns ``"pass"`` or
- ``"fail"``.
+ Loads a media image described in a software list. Returns ``nil`` if no
+ error or a string describing an error if an error occurred.
image:unload()
Unloads the mounted image.
image:create(filename)
Creates and mounts a media image file with the specified name. Returns
- ``"pass"`` or ``"fail"``.
+ ``nil`` if no error or a string describing an error if an error
+ occurred.
image:display()
Returns a “front panel display” string for the device, if supported. This
can be used to show status information, like the current head position or
@@ -1186,6 +1395,46 @@ slot.options[] (read-only)
slot.device (read-only)
The underlying :ref:`device <luareference-dev-device>`.
+.. _luareference-dev-stateentry:
+
+Device state entry
+~~~~~~~~~~~~~~~~~~
+
+Wraps MAME’s ``device_state_entry`` class, which allows access to named
+registers exposed by a :ref:`device <luareference-dev-device>`. Supports
+conversion to string for display.
+
+Instantiation
+^^^^^^^^^^^^^
+
+manager.machine.devices[tag].state[symbol]
+ Gets a state entry for a given device by symbol.
+
+Properties
+^^^^^^^^^^
+
+entry.value (read/write)
+ The numeric value of the state entry, as either an integer or floating-point
+ number. Attempting to set the value of a read-only state entry raises an
+ error.
+entry.symbol (read-only)
+ The state entry’s symbolic name.
+entry.visible (read-only)
+ A Boolean indicating whether the state entry should be displayed in the
+ debugger register view.
+entry.writeable (read-only)
+ A Boolean indicating whether it is possible to modify the state entry’s
+ value.
+entry.is_float (read-only)
+ A Boolean indicating whether the state entry’s value is a floating-point
+ number.
+entry.datamask (read-only)
+ A bit mask of the valid bits of the value for integer state entries.
+entry.datasize (read-only)
+ The size of the underlying value in bytes for integer state entries.
+entry.max_length (read-only)
+ The maximum display string length for the state entry.
+
.. _luareference-dev-imagefmt:
Media image format
@@ -1363,6 +1612,36 @@ space:read_range(start, end, width, [step])
Reads a range of addresses as a binary string. The end address must be
greater than or equal to the start address. The width must be 8, 16, 30 or
64. If the step is provided, it must be a positive number of elements.
+space:add_change_notifier(callback)
+ Add a callback to receive notifications for handler changes in address
+ space. The callback function is passed a single string as an argument,
+ either ``r`` if read handlers have potentially changed, ``w`` if write
+ handlers have potentially changed, or ``rw`` if both read and write handlers
+ have potentially changed.
+
+ Returns a :ref:`notifier subscription <luareference-core-notifiersub>`.
+space:install_read_tap(start, end, name, callback)
+ Installs a :ref:`pass-through handler <luareference-mem-tap>` that will
+ receive notifications on reads from the specified range of addresses in the
+ address space. The start and end addresses are inclusive. The name must be
+ a string, and the callback must be a function.
+
+ The callback is passed three arguments for the access offset, the data read,
+ and the memory access mask. The offset is the absolute offset into the
+ address space. To modify the data being read, return the modified value
+ from the callback function as an integer. If the callback does not return
+ an integer, the data will not be modified.
+space:install_write_tap(start, end, name, callback)
+ Installs a :ref:`pass-through handler <luareference-mem-tap>` that will
+ receive notifications on write to the specified range of addresses in the
+ address space. The start and end addresses are inclusive. The name must be
+ a string, and the callback must be a function.
+
+ The callback is passed three arguments for the access offset, the data
+ written, and the memory access mask. The offset is the absolute offset into
+ the address space. To modify the data being written, return the modified
+ value from the callback function as an integer. If the callback does not
+ return an integer, the data will not be modified.
Properties
^^^^^^^^^^
@@ -1387,6 +1666,53 @@ space.map (read-only)
The configured :ref:`address map <luareference-mem-map>` for the space or
``nil``.
+.. _luareference-mem-tap:
+
+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. Note that pass-through handler
+callbacks are not run as coroutines.
+
+Instantiation
+^^^^^^^^^^^^^
+
+manager.machine.devices[tag].spaces[name]:install_read_tap(start, end, name, callback)
+ Installs a pass-through handler that will receive notifications on reads
+ from the specified range of addresses in an
+ :ref:`address space <luareference-mem-space>`.
+manager.machine.devices[tag].spaces[name]:install_write_tap(start, end, name, callback)
+ Installs a pass-through handler that will receive notifications on writes to
+ the specified range of addresses in an
+ :ref:`address space <luareference-mem-space>`.
+
+Methods
+^^^^^^^
+
+passthrough:reinstall()
+ Reinstalls the pass-through handler in the address space. May be necessary
+ if the handler is removed due to other changes to handlers in the address
+ space.
+passthrough:remove()
+ Removes the pass-through handler from the address space. The associated
+ callback will not be called in response to future memory accesses.
+
+Properties
+^^^^^^^^^^
+
+passthrough.addrstart (read-only)
+ The inclusive start address of the address range monitored by the
+ pass-through handler (i.e. the lowest address that the handler will be
+ notified for).
+passthrough.addrend (read-only)
+ The inclusive end address of the address range monitored by the pass-through
+ handler (i.e. the highest address that the handler will be notified for).
+passthrough.name (read-only)
+ The display name for the pass-through handler.
+
.. _luareference-mem-map:
Address map
@@ -1648,9 +1974,12 @@ ioport:count_players()
Returns the number of player controllers in the system.
ioport:type_pressed(type, [player])
Returns a Boolean indicating whether the specified input is currently
- pressed. The input port type is an enumerated value. The player number is
- a zero-based index. If the player number is not supplied, it is assumed to
- be zero.
+ pressed. The input type may be an enumerated value or an
+ :ref:`input type <luareference-input-inputtype>` entry. If the input type
+ is an enumerated value, the player number may be supplied as a zero-based
+ index; if the player number is not supplied, it is assumed to be zero. If
+ the input type is an input type entry, the player number may not be supplied
+ separately.
ioport:type_name(type, [player])
Returns the display name for the specified input type and player number.
The input type is an enumerated value. The player number is a zero-based
@@ -1665,22 +1994,31 @@ ioport:type_group(type, player)
canonical grouping in an input configuration UI.
ioport:type_seq(type, [player], [seqtype])
Get the configured :ref:`input sequence <luareference-input-iptseq>` for the
- specified input type, player number and sequence type. The input type is an
- enumerated value. The player number is a zero-based index. If the player
- number is not supplied, it is assumed to be zero. If the sequence type is
- supplied, it must be ``"standard"``, ``"increment"`` or ``"decrement"``; if
- it is not supplied, it is assumed to be ``"standard"``.
+ specified input type, player number and sequence type. The input type may
+ be an enumerated value or an
+ :ref:`input type <luareference-input-inputtype>` entry. If the input type
+ is an enumerated value, the player number may be supplied as a zero-based
+ index; if the player number is not supplied, it is assumed to be zero. If
+ the input type is an input type entry, the player number may not be supplied
+ separately. If the sequence type is supplied, it must be ``"standard"``,
+ ``"increment"`` or ``"decrement"``; if it is not supplied, it is assumed to
+ be ``"standard"``.
This provides access to general input configuration.
-ioport:set_type_seq(type, player, seqtype, seq)
+ioport:set_type_seq(type, [player], seqtype, seq)
Set the configured :ref:`input sequence <luareference-input-iptseq>` for the
- specified input type, player number and sequence type. The input type is an
- enumerated value. The player number is a zero-based index. The sequence
- type must be ``"standard"``, ``"increment"`` or ``"decrement"``.
+ specified input type, player number and sequence type. The input type may
+ be an enumerated value or an
+ :ref:`input type <luareference-input-inputtype>` entry. If the input type
+ is an enumerated value, the player number must be supplied as a zero-based
+ index. If the input type is an input type entry, the player number may not
+ be supplied separately. The sequence type must be ``"standard"``,
+ ``"increment"`` or ``"decrement"``.
This allows general input configuration to be set.
ioport:token_to_input_type(string)
- Returns the input type and player number for the specified input type token.
+ Returns the input type and player number for the specified input type token
+ string.
ioport:input_type_to_token(type, [player])
Returns the token string for the specified input type and player number. If
the player number is not supplied, it assumed to be zero.
@@ -1688,6 +2026,9 @@ ioport:input_type_to_token(type, [player])
Properties
^^^^^^^^^^
+ioport.types[] (read-only)
+ Gets the supported :ref:`input types <luareference-input-inputtype>`. Keys
+ are arbitrary indices. All supported operations have O(1) complexity.
ioport.ports[]
Gets the emulated :ref:`I/O ports <luareference-input-ioport>` in the
system. Keys are absolute tags. The ``at`` and ``index_of`` methods have
@@ -1850,7 +2191,7 @@ Wraps MAME’s ``ioport_field`` class, representing a field within an I/O port.
Instantiation
^^^^^^^^^^^^^
-manager.machine.ioport.ports[tag]:field[mask]
+manager.machine.ioport.ports[tag]:field(mask)
Gets a field for the given port by bit mask.
manager.machine.ioport.ports[tag].fields[name]
Gets a field for the given port by display name.
@@ -1862,6 +2203,9 @@ field:set_value(value)
Set the value of the I/O port field. For digital fields, the value is
compared to zero to determine whether the field should be active; for
analog fields, the value must be right-aligned and in the correct range.
+field:clear_value()
+ Clear programmatically overridden value and restore the field’s regular
+ behaviour.
field:set_input_seq(seqtype, seq)
Set the :ref:`input sequence <luareference-input-iptseq>` for the
specified sequence type. This is used to configure per-machine input
@@ -1906,9 +2250,13 @@ field.player (read-only)
field.mask (read-only)
Bits in the I/O port corresponding to this field.
field.defvalue (read-only)
- The field’s default value
+ The field’s default value.
+field.minvalue (read-only)
+ The minimum allowed value for analog fields, or ``nil`` for digital fields.
+field.maxvalue (read-only)
+ The maximum allowed value for analog fields, or ``nil`` for digital fields.
field.sensitivity (read-only)
- The sensitivity or gain for analog fields
+ The sensitivity or gain for analog fields, or ``nil`` for digital fields.
field.way (read-only)
The number of directions allowed by the restrictor plate/gate for a digital
joystick, or zero (0) for other inputs.
@@ -1985,6 +2333,41 @@ Properties
live.name
Display name for the field.
+.. _luareference-input-inputtype:
+
+Input type
+~~~~~~~~~~
+
+Wraps MAME’s ``input_type_entry`` class, representing an emulated input type or
+emulator UI input type. Input types are uniquely identified by the combination
+of their enumerated type value and player index.
+
+Instantiation
+^^^^^^^^^^^^^
+
+manager.machine.ioport.types[index]
+ Gets a supported input type.
+
+Properties
+^^^^^^^^^^
+
+type.type (read-only)
+ An enumerated value representing the type of input.
+type.group (read-only)
+ An integer giving the grouping for the input type. Should be used to
+ provide canonical grouping in an input configuration UI.
+type.player (read-only)
+ The zero-based player number, or zero for non-player controls.
+type.token (read-only)
+ The token string for the input type, used in configuration files.
+type.name (read-only)
+ The display name for the input type.
+type.is_analog (read-only)
+ A Boolean indicating whether the input type is analog or digital. Inputs
+ that only have on and off states are considered digital, while all other
+ inputs are considered analog, even if they can only represent discrete
+ values or positions.
+
.. _luareference-input-inputman:
Input manager
@@ -2291,6 +2674,10 @@ manager.machine.uiinput
Methods
^^^^^^^
+uiinput:reset()
+ Clears pending events and UI input states. Should be called when leaving a
+ modal state where input is handled directly (e.g. configuring an input
+ combination).
uiinput:find_mouse()
Returns host system mouse pointer X position, Y position, button state, and
the :ref:`render target <luareference-render-target>` it falls in. The
@@ -2442,6 +2829,555 @@ color.b (read/write)
Blue channel value, in the range of zero (0, off) to one (1, full
intensity).
+.. _luareference-render-palette:
+
+Palette
+~~~~~~~
+
+Wraps MAME’s ``palette_t`` class, which represents a table of colours that can
+be looked up by zero-based index. Palettes always contain additional special
+entries for black and white.
+
+Each colour has an associated contrast adjustment value. Each adjustment group
+has associated brightness and contrast adjustment values. The palette also has
+overall brightness, contrast and gamma adjustment values.
+
+Colours are represented in alpha/red/green/blue (ARGB) format. Channel values
+range from 0 (transparent or off) to 255 (opaque or full intensity), inclusive.
+Colour channel values are not pre-multiplied by the alpha value. Channel values
+are packed into the bytes of 32-bit unsigned integers, in the order alpha, red,
+green, blue from most-significant to least-significant byte.
+
+Instantiation
+^^^^^^^^^^^^^
+
+emu.palette(colors, [groups])
+ Creates a palette with the specified number of colours and
+ brightness/contrast adjustment groups. The number of colour groups defaults
+ to one if not specified. Colours are initialised to black, brightness
+ adjustment is initialised to 0.0, contrast adjustment initialised to 1.0,
+ and gamma adjustment is initialised to 1.0.
+
+Methods
+^^^^^^^
+
+palette:entry_color(index)
+ Gets the colour at the specified zero-based index.
+
+ Index values range from zero to the number of colours in the palette minus
+ one. Returns black if the index is greater than or equal to the number of
+ colours in the palette.
+palette:entry_contrast(index)
+ Gets the contrast adjustment for the colour at the specified zero-based
+ index. This is a floating-point number.
+
+ Index values range from zero to the number of colours in the palette minus
+ one. Returns 1.0 if the index is greater than or equal to the number of
+ colours in the palette.
+palette:entry_adjusted_color(index, [group])
+ Gets a colour with brightness, contrast and gamma adjustments applied.
+
+ If the group is specified, colour index values range from zero to the number
+ of colours in the palette minus one, and group values range from zero to the
+ number of adjustment groups in the palette minus one.
+
+ If the group is not specified, index values range from zero to the number of
+ colours multiplied by the number of adjustment groups plus one. Index
+ values may be calculated by multiplying the zero-based group index by the
+ number of colours in the palette, and adding the zero-based colour index.
+ The last two index values correspond to the special entries for black and
+ white, respectively.
+
+ Returns black if the specified combination of index and adjustment group is
+ invalid.
+palette:entry_set_color(index, color)
+ Sets the colour at the specified zero-based index. The colour may be
+ specified as a single packed 32-bit value; or as individual red, green and
+ blue channel values, in that order.
+
+ Index values range from zero to the number of colours in the palette minus
+ one. Raises an error if the index value is invalid.
+palette:entry_set_red_level(index, level)
+ Sets the red channel value of the colour at the specified zero-based index.
+ Other channel values are not affected.
+
+ Index values range from zero to the number of colours in the palette minus
+ one. Raises an error if the index value is invalid.
+palette:entry_set_green_level(index, level)
+ Sets the green channel value of the colour at the specified zero-based
+ index. Other channel values are not affected.
+
+ Index values range from zero to the number of colours in the palette minus
+ one. Raises an error if the index value is invalid.
+palette:entry_set_blue_level(index, level)
+ Sets the blue channel value of the colour at the specified zero-based index.
+ Other channel values are not affected.
+
+ Index values range from zero to the number of colours in the palette minus
+ one. Raises an error if the index value is invalid.
+palette:entry_set_contrast(index, level)
+ Sets the contrast adjustment value for the colour at the specified
+ zero-based index. This must be a floating-point number.
+
+ Index values range from zero to the number of colours in the palette minus
+ one. Raises an error if the index value is invalid.
+palette:group_set_brightness(group, brightness)
+ Sets the brightness adjustment value for the adjustment group at the
+ specified zero-based index. This must be a floating-point number.
+
+ Group values range from zero to the number of adjustment groups in the
+ palette minus one. Raises an error if the index value is invalid.
+palette:group_set_contrast(group, contrast)
+ Sets the contrast adjustment value for the adjustment group at the specified
+ zero-based index. This must be a floating-point number.
+
+ Group values range from zero to the number of adjustment groups in the
+ palette minus one. Raises an error if the index value is invalid.
+
+Properties
+^^^^^^^^^^
+
+palette.colors (read-only)
+ The number of colour entries in each group of colours in the palette.
+palette.groups (read-only)
+ The number of groups of colours in the palette.
+palette.max_index (read-only)
+ The number of valid colour indices in the palette.
+palette.black_entry (read-only)
+ The index of the special entry for the colour black.
+palette.white_entry (read-only)
+ The index of the special entry for the colour white.
+palette.brightness (write-only)
+ The overall brightness adjustment for the palette. This is a floating-point
+ number.
+palette.contrast (write-only)
+ The overall contrast adjustment for the palette. This is a floating-point
+ number.
+palette.gamma (write-only)
+ The overall gamma adjustment for the palette. This is a floating-point
+ number.
+
+.. _luareference-render-bitmap:
+
+Bitmap
+~~~~~~
+
+Wraps implementations of MAME’s ``bitmap_t`` and ``bitmap_specific`` classes,
+which represent two-dimensional bitmaps stored in row-major order. Pixel
+coordinates are zero-based, increasing to the right and down. Several pixel
+formats are supported.
+
+Instantiation
+^^^^^^^^^^^^^
+
+emu.bitmap_ind8(palette, [width, height], [xslop, yslop])
+ Creates an 8-bit indexed bitmap. Each pixel is a zero-based, unsigned 8-bit
+ index into a :ref:`palette <luareference-render-palette>`.
+
+ If no width and height are specified, they are assumed to be zero. If the
+ width is specified, the height must also be specified. The X and Y slop
+ values set the amount of extra storage in pixels to reserve at the
+ left/right of each row and top/bottom of each column, respectively. If an X
+ slop value is specified, a Y slop value must be specified as well. If no X
+ and Y slop values are specified, they are assumed to be zero (the storage
+ will be sized to fit the bitmap content). If the width and/or height is
+ less than or equal to zero, no storage will be allocated, irrespective of
+ the X and Y slop values, and the width and height of the bitmap will both be
+ set to zero.
+
+ The initial clipping rectangle is set to the entirety of the bitmap.
+emu.bitmap_ind16(palette, [width, height], [xslop, yslop])
+ Creates a 16-bit indexed bitmap. Each pixel is a zero-based, unsigned
+ 16-bit index into a :ref:`palette <luareference-render-palette>`.
+
+ If no width and height are specified, they are assumed to be zero. If the
+ width is specified, the height must also be specified. The X and Y slop
+ values set the amount of extra storage in pixels to reserve at the
+ left/right of each row and top/bottom of each column, respectively. If an X
+ slop value is specified, a Y slop value must be specified as well. If no X
+ and Y slop values are specified, they are assumed to be zero (the storage
+ will be sized to fit the bitmap content). If the width and/or height is
+ less than or equal to zero, no storage will be allocated, irrespective of
+ the X and Y slop values, and the width and height of the bitmap will both be
+ set to zero.
+
+ The initial clipping rectangle is set to the entirety of the bitmap.
+emu.bitmap_ind32(palette, [width, height], [xslop, yslop])
+ Creates a 32-bit indexed bitmap. Each pixel is a zero-based, unsigned
+ 32-bit index into a :ref:`palette <luareference-render-palette>`.
+
+ If no width and height are specified, they are assumed to be zero. If the
+ width is specified, the height must also be specified. The X and Y slop
+ values set the amount of extra storage in pixels to reserve at the
+ left/right of each row and top/bottom of each column, respectively. If an X
+ slop value is specified, a Y slop value must be specified as well. If no X
+ and Y slop values are specified, they are assumed to be zero (the storage
+ will be sized to fit the bitmap content). If the width and/or height is
+ less than or equal to zero, no storage will be allocated, irrespective of
+ the X and Y slop values, and the width and height of the bitmap will both be
+ set to zero.
+
+ The initial clipping rectangle is set to the entirety of the bitmap.
+emu.bitmap_ind64(palette, [width, height], [xslop, yslop])
+ Creates a 64-bit indexed bitmap. Each pixel is a zero-based, unsigned
+ 64-bit index into a :ref:`palette <luareference-render-palette>`.
+
+ If no width and height are specified, they are assumed to be zero. If the
+ width is specified, the height must also be specified. The X and Y slop
+ values set the amount of extra storage in pixels to reserve at the
+ left/right of each row and top/bottom of each column, respectively. If an X
+ slop value is specified, a Y slop value must be specified as well. If no X
+ and Y slop values are specified, they are assumed to be zero (the storage
+ will be sized to fit the bitmap content). If the width and/or height is
+ less than or equal to zero, no storage will be allocated, irrespective of
+ the X and Y slop values, and the width and height of the bitmap will both be
+ set to zero.
+
+ The initial clipping rectangle is set to the entirety of the bitmap.
+emu.bitmap_yuy16([width, height], [xslop], yslop])
+ Creates a Y'CbCr format bitmap with 4:2:2 chroma subsampling (horizontal
+ pairs of pixels have individual luma values but share chroma values). Each
+ pixel is a 16-bit integer value. The most significant byte of the pixel
+ value is the unsigned 8-bit Y' (luma) component of the pixel colour. For
+ each horizontal pair of pixels, the least significant byte of the first
+ pixel (even zero-based X coordinate) value is the signed 8-bit Cb value for
+ the pair of pixels, and the least significant byte of the second pixel (odd
+ zero-based X coordinate) value is the signed 8-bit Cr value for the pair of
+ pixels.
+
+ If no width and height are specified, they are assumed to be zero. If the
+ width is specified, the height must also be specified. The X and Y slop
+ values set the amount of extra storage in pixels to reserve at the
+ left/right of each row and top/bottom of each column, respectively. If an X
+ slop value is specified, a Y slop value must be specified as well. If no X
+ and Y slop values are specified, they are assumed to be zero (the storage
+ will be sized to fit the bitmap content). If the width and/or height is
+ less than or equal to zero, no storage will be allocated, irrespective of
+ the X and Y slop values, and the width and height of the bitmap will both be
+ set to zero.
+
+ The initial clipping rectangle is set to the entirety of the bitmap.
+emu.bitmap_rgb32([width, height], [xslop, yslop])
+ Creates an RGB format bitmap with no alpha (transparency) channel. Each
+ pixel is represented by a 32-bit integer value. The most significant byte
+ of the pixel value is ignored. The remaining three bytes, from most
+ significant to least significant, are the unsigned 8-bit unsigned red, green
+ and blue channel values (larger values correspond to higher intensities).
+
+ If no width and height are specified, they are assumed to be zero. If the
+ width is specified, the height must also be specified. The X and Y slop
+ values set the amount of extra storage in pixels to reserve at the
+ left/right of each row and top/bottom of each column, respectively. If an X
+ slop value is specified, a Y slop value must be specified as well. If no X
+ and Y slop values are specified, they are assumed to be zero (the storage
+ will be sized to fit the bitmap content). If the width and/or height is
+ less than or equal to zero, no storage will be allocated, irrespective of
+ the X and Y slop values, and the width and height of the bitmap will both be
+ set to zero.
+
+ The initial clipping rectangle is set to the entirety of the bitmap.
+emu.bitmap_argb32([width, height], [xslop, yslop])
+ Creates an ARGB format bitmap. Each pixel is represented by a 32-bit
+ integer value. The most significant byte of the pixel is the 8-bit unsigned
+ alpha (transparency) channel value (smaller values are more transparent).
+ The remaining three bytes, from most significant to least significant, are
+ the unsigned 8-bit unsigned red, green and blue channel values (larger
+ values correspond to higher intensities). Colour channel values are not
+ pre-multiplied by the alpha channel value.
+
+ If no width and height are specified, they are assumed to be zero. If the
+ width is specified, the height must also be specified. The X and Y slop
+ values set the amount of extra storage in pixels to reserve at the
+ left/right of each row and top/bottom of each column, respectively. If an X
+ slop value is specified, a Y slop value must be specified as well. If no X
+ and Y slop values are specified, they are assumed to be zero (the storage
+ will be sized to fit the bitmap content). If the width and/or height is
+ less than or equal to zero, no storage will be allocated, irrespective of
+ the X and Y slop values, and the width and height of the bitmap will both be
+ set to zero.
+
+ The initial clipping rectangle is set to the entirety of the bitmap.
+emu.bitmap_ind8(source, [x0, y0, x1, y1])
+ Creates an 8-bit indexed bitmap representing a view of a portion of an
+ existing bitmap. The initial clipping rectangle is set to the bounds of the
+ view. The source bitmap will be locked, preventing resizing and
+ reallocation.
+
+ If no coordinates are specified, the new bitmap will represent a view of the
+ source bitmap’s current clipping rectangle. If coordinates are specified,
+ the new bitmap will represent a view of the rectangle with top left corner
+ at (x0, y0) and bottom right corner at (x1, y1) in the source bitmap.
+ Coordinates are in units of pixels. The bottom right coordinates are
+ inclusive.
+
+ The source bitmap must be owned by the Lua script and must use the 8-bit
+ indexed format. Raises an error if coordinates are specified representing a
+ rectangle not fully contained within the source bitmap’s clipping rectangle.
+emu.bitmap_ind16(source, [x0, y0, x1, y1])
+ Creates a 16-bit indexed bitmap representing a view of a portion of an
+ existing bitmap. The initial clipping rectangle is set to the bounds of the
+ view. The source bitmap will be locked, preventing resizing and
+ reallocation.
+
+ If no coordinates are specified, the new bitmap will represent a view of the
+ source bitmap’s current clipping rectangle. If coordinates are specified,
+ the new bitmap will represent a view of the rectangle with top left corner
+ at (x0, y0) and bottom right corner at (x1, y1) in the source bitmap.
+ Coordinates are in units of pixels. The bottom right coordinates are
+ inclusive.
+
+ The source bitmap must be owned by the Lua script and must use the 16-bit
+ indexed format. Raises an error if coordinates are specified representing a
+ rectangle not fully contained within the source bitmap’s clipping rectangle.
+emu.bitmap_ind32(source, [x0, y0, x1, y1])
+ Creates a 32-bit indexed bitmap representing a view of a portion of an
+ existing bitmap. The initial clipping rectangle is set to the bounds of the
+ view. The source bitmap will be locked, preventing resizing and
+ reallocation.
+
+ If no coordinates are specified, the new bitmap will represent a view of the
+ source bitmap’s current clipping rectangle. If coordinates are specified,
+ the new bitmap will represent a view of the rectangle with top left corner
+ at (x0, y0) and bottom right corner at (x1, y1) in the source bitmap.
+ Coordinates are in units of pixels. The bottom right coordinates are
+ inclusive.
+
+ The source bitmap must be owned by the Lua script and must use the 32-bit
+ indexed format. Raises an error if coordinates are specified representing a
+ rectangle not fully contained within the source bitmap’s clipping rectangle.
+emu.bitmap_ind64(source, [x0, y0, x1, y1])
+ Creates a 64-bit indexed bitmap representing a view of a portion of an
+ existing bitmap. The initial clipping rectangle is set to the bounds of the
+ view. The source bitmap will be locked, preventing resizing and
+ reallocation.
+
+ If no coordinates are specified, the new bitmap will represent a view of the
+ source bitmap’s current clipping rectangle. If coordinates are specified,
+ the new bitmap will represent a view of the rectangle with top left corner
+ at (x0, y0) and bottom right corner at (x1, y1) in the source bitmap.
+ Coordinates are in units of pixels. The bottom right coordinates are
+ inclusive.
+
+ The source bitmap must be owned by the Lua script and must use the 64-bit
+ indexed format. Raises an error if coordinates are specified representing a
+ rectangle not fully contained within the source bitmap’s clipping rectangle.
+emu.bitmap_yuy16(source, [x0, y0, x1, y1])
+ Creates a Y'CbCr format bitmap with 4:2:2 chroma subsampling representing a
+ view of a portion of an existing bitmap. The initial clipping rectangle is
+ set to the bounds of the view. The source bitmap will be locked, preventing
+ resizing and reallocation.
+
+ If no coordinates are specified, the new bitmap will represent a view of the
+ source bitmap’s current clipping rectangle. If coordinates are specified,
+ the new bitmap will represent a view of the rectangle with top left corner
+ at (x0, y0) and bottom right corner at (x1, y1) in the source bitmap.
+ Coordinates are in units of pixels. The bottom right coordinates are
+ inclusive.
+
+ The source bitmap must be owned by the Lua script and must use the Y'CbCr
+ format. Raises an error if coordinates are specified representing a
+ rectangle not fully contained within the source bitmap’s clipping rectangle.
+emu.bitmap_rgb32(source, [x0, y0, x1, y1])
+ Creates an RGB format bitmap with 4:2:2 chroma subsampling representing a
+ view of a portion of an existing bitmap. The initial clipping rectangle is
+ set to the bounds of the view. The source bitmap will be locked, preventing
+ resizing and reallocation.
+
+ If no coordinates are specified, the new bitmap will represent a view of the
+ source bitmap’s current clipping rectangle. If coordinates are specified,
+ the new bitmap will represent a view of the rectangle with top left corner
+ at (x0, y0) and bottom right corner at (x1, y1) in the source bitmap.
+ Coordinates are in units of pixels. The bottom right coordinates are
+ inclusive.
+
+ The source bitmap must be owned by the Lua script and must use the RGB
+ format. Raises an error if coordinates are specified representing a
+ rectangle not fully contained within the source bitmap’s clipping rectangle.
+emu.bitmap_argb32(source, [x0, y0, x1, y1])
+ Creates an ARGB format bitmap with 4:2:2 chroma subsampling representing a
+ view of a portion of an existing bitmap. The initial clipping rectangle is
+ set to the bounds of the view. The source bitmap will be locked, preventing
+ resizing and reallocation.
+
+ If no coordinates are specified, the new bitmap will represent a view of the
+ source bitmap’s current clipping rectangle. If coordinates are specified,
+ the new bitmap will represent a view of the rectangle with top left corner
+ at (x0, y0) and bottom right corner at (x1, y1) in the source bitmap.
+ Coordinates are in units of pixels. The bottom right coordinates are
+ inclusive.
+
+ The source bitmap must be owned by the Lua script and must use the ARGB
+ format. Raises an error if coordinates are specified representing a
+ rectangle not fully contained within the source bitmap’s clipping rectangle.
+emu.bitmap_argb32.load(data)
+ Creates an ARGB format bitmap from data in PNG, JPEG (JFIF/EXIF) or
+ Microsoft DIB (BMP) format. Raises an error if the data invalid or not a
+ supported format.
+
+Methods
+^^^^^^^
+
+bitmap:cliprect()
+ Returns the left, top, right and bottom coordinates of the bitmap’s clipping
+ rectangle. Coordinates are in units of pixels; the bottom and right
+ coordinates are inclusive.
+bitmap:reset()
+ Sets the width and height to zero, and frees the pixel storage if the bitmap
+ owns its own storage, or releases the source bitmap if the it represents a
+ view of another bitmap.
+
+ The bitmap must be owned by the Lua script. Raises an error if the bitmap’s
+ storage is referenced by another bitmap or a :ref:`texture
+ <luareference-render-texture>`.
+bitmap:allocate(width, height, [xslop, yslop])
+ Reallocates storage for the bitmap, sets its width and height, and sets the
+ clipping rectangle to the entirety of the bitmap. If the bitmap already
+ owns allocated storage, it will always be freed and reallocated; if the
+ bitmap represents a view of another bitmap, the source bitmap will be
+ released. The storage will be filled with pixel value zero.
+
+ The X and Y slop values set the amount of extra storage in pixels to reserve
+ at the left/right of each row and top/bottom of each column, respectively.
+ If an X slop value is specified, a Y slop value must be specified as well.
+ If no X and Y slop values are specified, they are assumed to be zero (the
+ storage will be sized to fit the bitmap content). If the width and/or
+ height is less than or equal to zero, no storage will be allocated,
+ irrespective of the X and Y slop values, and the width and height of the
+ bitmap will both be set to zero.
+
+ The bitmap must be owned by the Lua script. Raises an error if the bitmap’s
+ storage is referenced by another bitmap or a :ref:`texture
+ <luareference-render-texture>`.
+bitmap:resize(width, height, [xslop, yslop])
+ Changes the width and height, and sets the clipping rectangle to the
+ entirety of the bitmap.
+
+ The X and Y slop values set the amount of extra storage in pixels to reserve
+ at the left/right of each row and top/bottom of each column, respectively.
+ If an X slop value is specified, a Y slop value must be specified as well.
+ If no X and Y slop values are specified, they are assumed to be zero (rows
+ will be stored contiguously, and the top row will be placed at the beginning
+ of the bitmap’s storage).
+
+ If the bitmap already owns allocated storage and it is large enough for the
+ updated size, it will be used without being freed; if it is too small for
+ the updated size, it will always be freed and reallocated. If the bitmap
+ represents a view of another bitmap, the source bitmap will be released. If
+ storage is allocated, it will be filled with pixel value zero (if existing
+ storage is used, its contents will not be changed).
+
+ Raises an error if the bitmap’s storage is referenced by another bitmap or a
+ :ref:`texture <luareference-render-texture>`.
+bitmap:wrap(source, [x0, y0, x1, y1])
+ Makes the bitmap represent a view of a portion of another bitmap and sets
+ the clipping rectangle to the bounds of the view.
+
+ If no coordinates are specified, the target bitmap will represent a view of
+ the source bitmap’s current clipping rectangle. If coordinates are
+ specified, the target bitmap will represent a view of the rectangle with top
+ left corner at (x0, y0) and bottom right corner at (x1, y1) in the source
+ bitmap. Coordinates are in units of pixels. The bottom right coordinates
+ are inclusive.
+
+ The source bitmap will be locked, preventing resizing and reallocation. If
+ the target bitmap owns allocated storage, it will be freed; if it represents
+ a view of another bitmap, the current source bitmap will be released.
+
+ The source and target bitmaps must both be owned by the Lua script and must
+ use the same pixel format. Raises an error if coordinates are specified
+ representing a rectangle not fully contained within the source bitmap’s
+ clipping rectangle; if the bitmap’s storage is referenced by another bitmap
+ or a :ref:`texture <luareference-render-texture>`; or if the source and
+ target are the same bitmap.
+bitmap:pix(x, y)
+ Returns the colour value of the pixel at the specified location.
+ Coordinates are zero-based in units of pixels.
+bitmap:pixels([x0, y0, x1, y1])
+ Returns the pixels, width and height of the portion of the bitmap with top
+ left corner at (x0, y0) and bottom right corner at (x1, y1). Coordinates
+ are in units of pixels. The bottom right coordinates are inclusive. If
+ coordinates are not specified, the bitmap’s clipping rectangle is used.
+
+ Pixels are returned packed into a binary string in host Endian order.
+ Pixels are organised in row-major order, from left to right then top to
+ bottom. The size and format of the pixel values depends on the format of
+ the bitmap. Raises an error if coordinates are specified representing a
+ rectangle not fully contained within the bitmap’s clipping rectangle.
+bitmap:fill(color, [x0, y0, x1, y1])
+ Fills a portion of the bitmap with the specified colour value. If
+ coordinates are not specified, the clipping rectangle is filled; if
+ coordinates are specified, the intersection of the clipping rectangle and
+ the rectangle with top left corner at (x0, y0) and bottom right corner at
+ (x1, y1) is filled. Coordinates are in units of pixels. The bottom right
+ coordinates are inclusive.
+bitmap:plot(x, y, color)
+ Sets the colour value of the pixel at the specified location if it is within
+ the clipping rectangle. Coordinates are zero-based in units of pixels.
+bitmap:plot_box(x, y, width, height, color)
+ Fills the intersection of the clipping rectangle and the rectangle with top
+ left (x, y) and the specified height and width with the specified colour
+ value. Coordinates and dimensions are in units of pixels.
+
+Properties
+^^^^^^^^^^
+
+bitmap.palette (read/write)
+ The :ref:`palette <luareference-render-palette>` used to translate pixel
+ values to colours. Only applicable for bitmaps that use indexed pixel
+ formats.
+bitmap.width (read-only)
+ Width of the bitmap in pixels.
+bitmap.height (read-only)
+ Height of the bitmap in pixels.
+bitmap.rowpixels (read-only)
+ Row stride of the bitmap’s storage in pixels. That is, the difference in
+ pixel offsets of the pixels at the same horizontal location in consecutive
+ rows. May be greater than the width.
+bitmap.rowbytes (read-only)
+ Row stride of the bitmap’s storage in bytes. That is, the difference in
+ byte addresses of the pixels at the same horizontal location in consecutive
+ rows.
+bitmap.bpp (read-only)
+ Size of the type used to represent pixels in the bitmap in bits (may be
+ larger than the number of significant bits).
+bitmap.valid (read-only)
+ A Boolean indicating whether the bitmap has storage available (may be false
+ for empty bitmaps).
+bitmap.locked (read-only)
+ A Boolean indicating whether the bitmap’s storage is referenced by another
+ bitmap or a :ref:`texture <luareference-render-texture>`.
+
+.. _luareference-render-texture:
+
+Render texture
+~~~~~~~~~~~~~~
+
+Wraps MAME’s ``render_texture`` class, representing a texture that cam be drawn
+in a :ref:`render container <luareference-render-container>`. Render textures
+must be freed before the emulation session ends.
+
+Instantiation
+^^^^^^^^^^^^^
+
+manager.machine.render:texture_alloc(bitmap)
+ Creates a render texture based on a :ref:`bitmap
+ <luareference-render-bitmap>`. The bitmap must be owned by the Lua script,
+ and must use the Y'CbCr, RGB or ARGB format. The bitmap’s storage will be
+ locked, preventing resizing and reallocation.
+
+Methods
+^^^^^^^
+
+texture:free()
+ Frees the texture. The storage of the underlying bitmap will be released.
+
+Properties
+^^^^^^^^^^
+
+texture.valid (read-only)
+ A Boolean indicating whether the texture is valid (false if the texture has
+ been freed).
+
.. _luareference-render-manager:
Render manager
@@ -2456,6 +3392,16 @@ Instantiation
manager.machine.render
Gets the global render manager instance for the emulation session.
+Methods
+^^^^^^^
+
+render:texture_alloc(bitmap)
+ Creates a :ref:`render texture <luareference-render-texture>` based on a
+ :ref:`bitmap <luareference-render-bitmap>`. The bitmap must be owned by the
+ Lua script, and must use the Y'CbCr, RGB or ARGB pixel format. The bitmap’s
+ storage will be locked, preventing resizing and reallocation. Render
+ textures must be freed before the emulation session ends.
+
Properties
^^^^^^^^^^
@@ -2564,7 +3510,7 @@ container:draw_box(left, top, right, bottom, [line], [fill])
Coordinates are floating-point numbers in the range of 0 (zero) to 1 (one),
with (0, 0) at the top left and (1, 1) at the bottom right of the window or
- screen that showss the user interface. Note that the aspect ratio is
+ the screen that shows the user interface. Note that the aspect ratio is
usually not square. Coordinates are limited to the window or screen area.
The fill and line colours are in alpha/red/green/blue (ARGB) format.
@@ -2575,21 +3521,14 @@ container:draw_box(left, top, right, bottom, [line], [fill])
most-significant to least-significant byte. If the line colour is not
provided, the UI text colour is used; if the fill colour is not provided,
the UI background colour is used.
-container:draw_line(x1, y1, x2, y2, [color])
- Draws a line from (x1, y1) to (x2, y2).
+container:draw_line(x0, y0, x1, y1, [color])
+ Draws a line from (x0, y0) to (x1, y1).
Coordinates are floating-point numbers in the range of 0 (zero) to 1 (one),
with (0, 0) at the top left and (1, 1) at the bottom right of the window or
- screen that showss the user interface. Note that the aspect ratio is
+ the screen that shows the user interface. Note that the aspect ratio is
usually not square. Coordinates are limited to the window or screen area.
- Coordinates are floating-point numbers in units of screen pixels, with the
- origin at (0, 0). Note that screen pixels often aren’t square. The
- coordinate system is rotated if the screen is rotated, which is usually the
- case for vertical-format screens. Before rotation, the origin is at the top
- left, and coordinates increase to the right and downwards. Coordinates are
- limited to the screen area.
-
The line colour is in alpha/red/green/blue (ARGB) format. Channel values
are in the range 0 (transparent or off) to 255 (opaque or full intensity),
inclusive. Colour channel values are not pre-multiplied by the alpha value.
@@ -2597,6 +3536,24 @@ container:draw_line(x1, y1, x2, y2, [color])
integer, in the order alpha, red, green, blue from most-significant to
least-significant byte. If the line colour is not provided, the UI text
colour is used.
+container:draw_quad(texture, x0, y0, x1, y1, [color])
+ Draws a textured rectangle with top left corner at (x0, y0) and bottom right
+ corner at (x1, y1). If a colour is specified, the ARGB channel values of
+ the texture’s pixels are multiplied by the corresponding values of the
+ specified colour.
+
+ Coordinates are floating-point numbers in the range of 0 (zero) to 1 (one),
+ with (0, 0) at the top left and (1, 1) at the bottom right of the window or
+ the screen that shows the user interface. Note that the aspect ratio is
+ usually not square. If the rectangle extends beyond the container’s bounds,
+ it will be cropped.
+
+ The colour is in alpha/red/green/blue (ARGB) format. Channel values are in
+ the range 0 (transparent or off) to 255 (opaque or full intensity),
+ inclusive. Colour channel values are not pre-multiplied by the alpha value.
+ The channel values must be packed into the bytes of a 32-bit unsigned
+ integer, in the order alpha, red, green, blue from most-significant to
+ least-significant byte.
container:draw_text(x|justify, y, text, [foreground], [background])
Draws text at the specified position. If the screen is rotated the text
will be rotated.
@@ -2611,7 +3568,7 @@ container:draw_text(x|justify, y, text, [foreground], [background])
Coordinates are floating-point numbers in the range of 0 (zero) to 1 (one),
with (0, 0) at the top left and (1, 1) at the bottom right of the window or
- screen that showss the user interface. Note that the aspect ratio is
+ the screen that shows the user interface. Note that the aspect ratio is
usually not square. Coordinates are limited to the window or screen area.
The foreground and background colours are in alpha/red/green/blue (ARGB)
@@ -2696,7 +3653,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
^^^^^^^^^^^^^
@@ -2740,15 +3698,18 @@ 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
^^^^^^^^^^^^^
-Layout scripts generally
-
manager.machine.render.targets[index].current_view
Gets the currently selected view for a given render target.
+file.views[name]
+ Gets the view with the specified name from a
+ :ref:`layout file <luareference-render-layfile>`. This is how layout
+ scripts generally obtain views.
Methods
^^^^^^^
@@ -2817,7 +3778,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
^^^^^^^^^^^^^
@@ -2982,9 +3944,223 @@ Debugger
--------
Some of MAME’s core debugging features can be controlled from Lua script. The
-debugger must be enabled to use the debugging features (usually by passing
+debugger must be enabled to use the debugger features (usually by passing
``-debug`` on the command line).
+.. _luareference-debug-symtable:
+
+Symbol table
+~~~~~~~~~~~~
+
+Wrap’s MAME’s ``symbol_table`` class, providing named symbols that can be used
+in expressions. Note that symbol tables can be created and used even when the
+debugger is not enabled.
+
+Instantiation
+^^^^^^^^^^^^^
+
+emu.symbol_table(machine)
+ Creates a new symbol table in the context of the specified machine,
+emu.symbol_table(parent, [device])
+ Creates a new symbol table with the specified parent symbol table. If a
+ device is specified and it implements ``device_memory_interface``, it will
+ be used as the base for looking up address spaces and memory regions. Note
+ that if a device that does not implement ``device_memory_interface`` is
+ supplied, it will not be used (address spaces and memory regions will be
+ looked up relative to the root device).
+emu.symbol_table(device)
+ Creates a new symbol table in the context of the specified device. If the
+ device implements ``device_memory_interface``, it will be used as the base
+ for looking up address spaces and memory regions. Note that if a device
+ that does not implement ``device_memory_interface`` is supplied, it will
+ only be used to determine the machine context (address spaces and memory
+ regions will be looked up relative to the root device).
+
+Methods
+^^^^^^^
+
+symbols:set_memory_modified_func(cb)
+ Set a function to call when memory is modified via the symbol table. No
+ arguments are passed to the function and any return values are ignored.
+ Call with ``nil`` to remove the callback.
+symbols:add(name, [value])
+ Adds a named integer symbol. The name must be a string. If a value is
+ supplied, it must be an integer. If a value is supplied, a read-only symbol
+ is added with the supplied value. If no value is supplied, a read/write
+ symbol is created with and initial value of zero. If a symbol entry with
+ the specified name already exists in the symbol table, it will be replaced.
+
+ Returns the new :ref:`symbol entry <luareference-debug-symentry>`.
+symbols:add(name, getter, [setter], [format])
+ Adds a named integer symbol using getter and optional setter callbacks. The
+ name must be a string. The getter must be a function returning an integer
+ for the symbol value. If supplied, the setter must be a function that
+ accepts a single integer argument for the new value of the symbol. A format
+ string for displaying the symbol value may optionally be supplied. If a
+ symbol entry with the specified name already exists in the symbol table, it
+ will be replaced.
+
+ Returns the new :ref:`symbol entry <luareference-debug-symentry>`.
+symbols:add(name, minparams, maxparams, execute)
+ Adds a named function symbol. The name must be a string. The minimum and
+ maximum numbers of parameters must be integers. If a symbol entry with the
+ specified name already exists in the symbol table, it will be replaced.
+
+ Returns the new :ref:`symbol entry <luareference-debug-symentry>`.
+symbols:find(name)
+ Returns the :ref:`symbol entry <luareference-debug-symentry>` with the
+ specified name, or ``nil`` if there is no symbol with the specified name in
+ the symbol table.
+symbols:find_deep(name)
+ Returns the :ref:`symbol entry <luareference-debug-symentry>` with the
+ specified name, or ``nil`` if there is no symbol with the specified name in
+ the symbol table or any of its parent symbol tables.
+symbols:value(name)
+ Returns the integer value of the symbol with the specified name, or zero if
+ there is no symbol with the specified name in the symbol table or any of its
+ parent symbol tables. Raises an error if the symbol with specified name is
+ a function symbol.
+symbols:set_value(name, value)
+ Sets the value of the symbol with the specified name. Raises an error if
+ the symbol with the specified name is a read-only integer symbol or if it is
+ a function symbol. Has no effect if there is no symbol with the specified
+ name in the symbol table or any of its parent symbol tables.
+symbols:memory_value(name, space, offset, size, disable_se)
+ Read a value from memory. Supply the name or tag of the address space or
+ memory region to read from, or ``nil`` to use the address space or memory
+ region implied by the ``space`` argument. See
+ :ref:`memory accesses in debugger expressions <debugger-express-mem>` for
+ access type specifications that can be used for the ``space`` argument.
+ The access size is specified in bytes, and must be 1, 2, 4 or 8. The
+ ``disable_se`` argument specifies whether memory access side effects should
+ be disabled.
+symbols:set_memory_value(name, space, offset, value, size, disable_se)
+ Write a value to memory. Supply the name or tag of the address space or
+ memory region to write to, or ``nil`` to use the address space or memory
+ region implied by the ``space`` argument. See
+ :ref:`memory accesses in debugger expressions <debugger-express-mem>` for
+ access type specifications that can be used for the ``space`` argument.
+ The access size is specified in bytes, and must be 1, 2, 4 or 8. The
+ ``disable_se`` argument specifies whether memory access side effects should
+ be disabled.
+symbols:read_memory(space, address, size, apply_translation)
+ Read a value from an address space. The access size is specified in bytes,
+ and must be 1, 2, 4, or 8. If the ``apply_translation`` argument is true,
+ the address will be translated with debug read intention. Returns a value
+ of the requested size with all bits set if address translation fails.
+symbols:write_memory(space, address, data, size, apply_translation)
+ Write a value to an address space. The access size is specified in bytes,
+ and must be 1, 2, 4, or 8. If the ``apply_translation`` argument is true,
+ the address will be translated with debug write intention. The symbol
+ table’s memory modified function will be called after the value is written.
+ The value will not be written and the symbol table’s memory modified
+ function will not be called if address translation fails.
+
+Properties
+^^^^^^^^^^
+
+symbols.entries[]
+ The :ref:`symbol entries <luareference-debug-symentry>` in the symbol table,
+ indexed by name. The ``at`` and ``index_of`` methods have O(n) complexity;
+ all other supported operations have O(1) complexity.
+symbols.parent (read-only)
+ The parent symbol table, or ``nil`` if the symbol table has no parent.
+
+.. _luareference-debug-expression:
+
+Parsed expression
+~~~~~~~~~~~~~~~~~
+
+Wraps MAME’s ``parsed_expression`` class, which represents a tokenised debugger
+expression. Note that parsed expressions can be created and used even when the
+debugger is not enabled.
+
+Instantiation
+^^^^^^^^^^^^^
+
+emu.parsed_expression(symbols)
+ Creates an empty expression that will use the supplied
+ :ref:`symbol table <luareference-debug-symtable>` to look up symbols.
+emu.parsed_expression(symbols, string, [default_base])
+ Creates an expression by parsing the supplied string, looking up symbols in
+ the supplied :ref:`symbol table <luareference-debug-symtable>`. If the
+ default base for interpreting integer literals is not supplied, 16 is used
+ (hexadecimal). Raises an :ref:`expression error
+ <luareference-debug-expressionerror>` if the string contains syntax errors
+ or uses undefined symbols.
+
+Methods
+^^^^^^^
+
+expression:set_default_base(base)
+ Set the default base for interpreting numeric literals. The base must be a
+ positive integer.
+expression:parse(string)
+ Parse a debugger expression string. Replaces the current contents of the
+ expression if it is not empty. Raises an :ref:`expression error
+ <luareference-debug-expressionerror>` if the string contains syntax errors
+ or uses undefined symbols. The previous content of the expression is not
+ preserved when attempting to parse an invalid expression string.
+expression:execute()
+ Evaluates the expression, returning an unsigned integer result. Raises an
+ :ref:`expression error <luareference-debug-expressionerror>` if the
+ expression cannot be evaluated (e.g. attempting to call a function with an
+ invalid number of arguments).
+
+Properties
+^^^^^^^^^^
+
+expression.is_empty (read-only)
+ A Boolean indicating whether the expression contains no tokens.
+expression.original_string (read-only)
+ The original string that was parsed to create the expression.
+expression.symbols (read/write)
+ The :ref:`symbol table <luareference-debug-symtable>` used for to look up
+ symbols in the expression.
+
+.. _luareference-debug-symentry:
+
+Symbol entry
+~~~~~~~~~~~~
+
+Wraps MAME’s ``symbol_entry`` class, which represents an entry in a
+:ref:`symbol table <luareference-debug-symtable>`. Note that symbol entries
+must not be used after the symbol table they belong to is destroyed.
+
+Instantiation
+^^^^^^^^^^^^^
+
+symbols:add(name, [value])
+ Adds an integer symbol to a
+ :ref:`symbol table <luareference-debug-symtable>`, returning the new symbol
+ entry.
+symbols:add(name, getter, [setter], [format])
+ Adds an integer symbol to a
+ :ref:`symbol table <luareference-debug-symtable>`, returning the new symbol
+ entry.
+symbols:add(name, minparams, maxparams, execute)
+ Adds function symbol to a
+ :ref:`symbol table <luareference-debug-symtable>`, returning the new symbol
+ entry.
+
+Properties
+^^^^^^^^^^
+
+entry.name (read-only)
+ The name of the symbol entry.
+entry.format (read-only)
+ The format string used to convert the symbol entry to text for display.
+entry.is_function (read-only)
+ A Boolean indicating whether the symbol entry is a callable function.
+entry.is_lval (read-only)
+ A Boolean indicating whether the symbol entry is an integer symbol that can
+ be set (i.e. whether it can be used on the left-hand side of assignment
+ expressions).
+entry.value (read/write)
+ The integer value of the symbol entry. Attempting to set the value raises
+ an error if the symbol entry is read-only. Attempting to get or set the
+ value of a function symbol raises an error.
+
.. _luareference-debug-manager:
Debugger manager
@@ -3035,7 +4211,7 @@ emulated CPU device.
Instantiation
^^^^^^^^^^^^^
-manager.machine.devices[tag]:debug()
+manager.machine.devices[tag].debug
Returns the debugger interface for an emulated CPU device, or ``nil`` if the
device is not a CPU.
@@ -3120,7 +4296,7 @@ emulated CPU device.
Instantiation
^^^^^^^^^^^^^
-manager.machine.devices[tag]:debug():bplist()[bp]
+manager.machine.devices[tag].debug:bplist()[bp]
Gets the specified breakpoint for an emulated CPU device, or ``nil`` if no
breakpoint corresponds to the specified index.
@@ -3131,7 +4307,7 @@ breakpoint.index (read-only)
The breakpoint’s index. The can be used to enable, disable or clear the
breakpoint via the
:ref:`CPU debugger interface <luareference-debug-devdebug>`.
-breakpoint.enabled (read-only)
+breakpoint.enabled (read/write)
A Boolean indicating whether the breakpoint is currently enabled.
breakpoint.address (read-only)
The breakpoint’s address.
@@ -3154,7 +4330,7 @@ emulated CPU device.
Instantiation
^^^^^^^^^^^^^
-manager.machine.devices[tag]:debug():wplist(space)[wp]
+manager.machine.devices[tag].debug:wplist(space)[wp]
Gets the specified watchpoint for an address space of an emulated CPU
device, or ``nil`` if no watchpoint in the address space corresponds to the
specified index.
@@ -3166,7 +4342,7 @@ watchpoint.index (read-only)
The watchpoint’s index. The can be used to enable, disable or clear the
watchpoint via the
:ref:`CPU debugger interface <luareference-debug-devdebug>`.
-watchpoint.enabled (read-only)
+watchpoint.enabled (read/write)
A Boolean indicating whether the watchpoint is currently enabled.
watchpoint.type (read-only)
Either ``"r"``, ``"w"`` or ``"rw"`` for a read, write or read/write
@@ -3182,3 +4358,22 @@ watchpoint.condition (read-only)
watchpoint.action (read-only)
An action the debugger will run when the watchpoint is hit and the condition
evaluates to a non-zero value. An empty string if no action was specified.
+
+.. _luareference-debug-expressionerror:
+
+Expression error
+~~~~~~~~~~~~~~~~
+
+Wraps MAME’s ``expression_error`` class, describing an error occurring while
+parsing or executing a debugger expression. Raised on errors when using
+:ref:`parsed expressions <luareference-debug-expression>`. Can be converted to
+a string to provide a description of the error.
+
+Properties
+^^^^^^^^^^
+
+err.code (read-only)
+ An implementation-dependent number representing the category of error.
+ Should not be displayed to the user.
+err.offset (read-only)
+ The offset within the expression string where the error was encountered.
diff --git a/docs/source/techspecs/m6502.rst b/docs/source/techspecs/m6502.rst
index c4cb45f5cea..b7fdab5d895 100644
--- a/docs/source/techspecs/m6502.rst
+++ b/docs/source/techspecs/m6502.rst
@@ -26,7 +26,7 @@ The MOS 6502 family has been large and productive. A large number of variants ex
|
+------+--------+--+--+-------+-------+
| | | | | |
- 6510 deco16 6504 6509 n2a03 65c02
+ 6510 deco16 6504 6509 rp2a03 65c02
| |
+-----+-----+ r65c02
| | | |
@@ -46,7 +46,7 @@ The 6504 is a pin and address-bus reduced version.
The 6509 adds internal support for paging.
-The n2a03 is the NES variant with the D flag disabled and sound functionality integrated.
+The rp2a03 is the NES variant with the D flag disabled and sound functionality integrated.
The 65c02 is the very first cmos variant with some additional instructions, some fixes, and most of the undocumented instructions turned into nops. The R (Rockwell, but eventually produced by WDC too among others) variant adds a number of bitwise instructions and also stp and wai. The SC variant, used by the Lynx portable console, looks identical to the R variant. The 'S' probably indicates a static-ram-cell process allowing full DC-to-max clock control.
@@ -374,6 +374,6 @@ Current TO-DO:
- Integrate the I/O subsystems in the 4510
-- Possibly integrate the sound subsytem in the n2a03
+- Possibly integrate the sound subsytem in the rp2a03
- Add decent hookups for the Apple 3 madness
diff --git a/docs/source/techspecs/memory.rst b/docs/source/techspecs/memory.rst
index 5d18c4e1202..9d7eb3c1b29 100644
--- a/docs/source/techspecs/memory.rst
+++ b/docs/source/techspecs/memory.rst
@@ -126,7 +126,8 @@ A memory share can be created if it doesn’t exist in a memory map
through that creator class. If it already exists it is just
retrieved. That class behaves like a pointer but also has the
``target()``, ``length()``, ``bytes()``, ``endianness()``,
-``bitwidth()`` and ``bytewidth()`` methods for share information.
+``bitwidth()`` and ``bytewidth()`` methods for share information. The
+desired size is specified in bytes.
.. code-block:: C++
@@ -154,12 +155,17 @@ A memory bank is a named memory zone indirection that can be mapped in
address spaces. It points to ``nullptr`` when created.
``configure_entry`` associates an entry number and a base pointer.
``configure_entries`` does the same for multiple consecutive entries
-spanning a memory zone. Alternatively ``set_base`` sets the base for
-entry 0 and selects it.
+spanning a memory zone.
-``set_entry`` allows to dynamically and efficiently select the current
-active entry, ``entry()`` gets that selection back, and ``base()`` gets
-the associated base pointer.
+``set_base`` sets the base address for the active entry. If there are
+no entries, entry 0 (zero) is automatically created and selected. Use
+of ``set_base`` should be avoided in favour of pre-configured entries
+unless there are an impractically large number of possible base
+addresses.
+
+``set_entry`` dynamically and efficiently selects the active entry,
+``entry()`` returns the active entry number, and ``base()`` gets the
+associated base pointer.
.. code-block:: C++
@@ -180,7 +186,7 @@ retrieved by building one of these four finders.
[device constructor] m_bank(*this, "name"),
-A memory share can be created if it doesn’t exist in a memory map
+A memory bank can be created if it doesn’t exist in a memory map
through that creator class. If it already exists it is just
retrieved.
@@ -197,7 +203,7 @@ that the lookup can be expensive, prefer finders instead.
.. code-block:: C++
- class memory_bank {
+ class memory_region {
u8 *base();
u8 *end();
u32 bytes() const;
diff --git a/docs/source/techspecs/naming.rst b/docs/source/techspecs/naming.rst
index 94d3a889649..b91e5ba9d93 100644
--- a/docs/source/techspecs/naming.rst
+++ b/docs/source/techspecs/naming.rst
@@ -1,3 +1,5 @@
+.. _naming:
+
MAME Naming Conventions
=======================
@@ -13,25 +15,6 @@ To promote consistency and readability in MAME source code, we have some
naming conventions for various elements.
-.. _naming-definitions:
-
-Definitions
------------
-
-Snake case
- All lowercase letters with words separated by underscores:
- ``this_is_snake_case``
-Screaming snake case
- All uppercase letters with words separated by underscores:
- ``SCREAMING_SNAKE_CASE``
-Camel case:
- Lowercase initial letter, first letter of each subsequent word
- capitalised, with no separators between words: ``exampleCamelCase``
-Llama case:
- Uppercase initial letter, first letter of each subsequent word
- capitalised, with no separators between words: ``LlamaCaseSample``
-
-
.. _naming-transliteration:
Transliteration
@@ -108,39 +91,5 @@ use lowercase for anything else besides proper nouns and initialisms.
C++ naming conventions
----------------------
-Preprocessor macros
- Macro names should use screaming snake case. Macros are always
- global and name conflicts can cause confusing errors – think
- carefully about what macros really need to be in headers and name
- them carefully.
-Include guards
- Include guard macros should begin with ``MAME_``, and end with a
- capitalised version of the file name, withe separators replaced by
- underscores.
-Constants
- Constants should use screaming snake case, whether they are constant
- globals, constant data members, enumerators or preprocessor
- constants.
-Functions
- Free functions names should use snake case. (There are some utility
- function that were previously implemented as preprocessor macros
- that still use screaming snake case.)
-Classes
- Class names should use snake case. Abstract class names should end
- in ``_base``. Public member functions (including static member
- functions) should use snake case.
-Device classes
- Concrete driver ``driver_device`` implementation names
- conventionally end in ``_state``, while other concrete device class
- names end in ``_device``. Concrete ``device_interface`` names
- conventionally begin with ``device_`` and end with ``_interface``.
-Device types
- Device types should use screaming snake case. Remember that device
- types are names in the global namespace, so choose explicit,
- unambiguous names.
-Enumerations
- The enumeration name should use snake case. The enumerators should
- use screaming snake case.
-Template parameters
- Template parameters should use llama case (both type and value
- parameters).
+For C++ naming conventions, see the relevant section in the C++
+Coding Guidelines: :ref:`contributing-cxx-naming`
diff --git a/docs/source/techspecs/object_finders.rst b/docs/source/techspecs/object_finders.rst
index 2256d74b677..e05146c3167 100644
--- a/docs/source/techspecs/object_finders.rst
+++ b/docs/source/techspecs/object_finders.rst
@@ -239,7 +239,7 @@ the object finders in the device class (with all distractions removed):
}
sbus_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) :
- device_t(mconfig, type, tag, owner, clock),
+ device_t(mconfig, SBUS, tag, owner, clock),
device_memory_interface(mconfig, *this),
m_maincpu(*this, finder_base::DUMMY_TAG),
m_type1space(*this, finder_base::DUMMY_TAG, -1)
diff --git a/docs/source/tools/othertools.rst b/docs/source/tools/othertools.rst
index eb4c479b846..ebf31719d16 100644
--- a/docs/source/tools/othertools.rst
+++ b/docs/source/tools/othertools.rst
@@ -44,12 +44,18 @@ ldresample
This tool recompresses video data for laserdisc and VHS dumps. Most users will not need to work with this.
-
ldverify
--------
This tool is used for comparing laserdisc or VHS CHD images with the source AVI. Most users will not need to work with this.
+
+romcmp
+------
+
+This tool is used to perform basic data comparisons and integrity checks on binary dumps. With the -h switch, it can also be used to calculate hash functions. Most users will not need to work with this.
+
+
unidasm
-------
diff --git a/docs/source/usingmame/assetsearch.rst b/docs/source/usingmame/assetsearch.rst
new file mode 100644
index 00000000000..a8002db1c69
--- /dev/null
+++ b/docs/source/usingmame/assetsearch.rst
@@ -0,0 +1,402 @@
+.. _assetsearch:
+
+How does MAME look for files?
+=============================
+
+.. contents:: :local:
+
+Introduction
+------------
+
+Unlike typical desktop applications where you browse your disk and select a file
+to open or a location to save to, MAME has settings to tell it where to look for
+the files it needs. You can change these settings by starting MAME without
+specifying a system, selecting **Configure Options** from the system selection
+menu, and then selecting **Configure Directories** (remember to select **Save
+Configuration** if you want to keep your changes). You can also change settings
+by editing your mame.ini and ui.ini files directly, or specify settings on the
+command line. For information on available options for controlling where MAME
+searches for files, see :ref:`mame-commandline-pathoptions`.
+
+Terminology
+~~~~~~~~~~~
+
+It’s necessary to understand some MAME-specific terminology used in the
+explanations here:
+
+System
+ A system is a complete machine that can be emulated by MAME. Some systems
+ run fixed software, while others can load software from software list items
+ and/or media files.
+Device
+ An emulated component that can be used by multiple systems, or by other
+ devices. Some devices require ROM dumps, and some devices allow software
+ from additional software lists to be used with a system.
+Parent system
+ MAME uses so-called parent/clone relationships to group related systems.
+ One system in the group is chosen to be the *parent* and the others are
+ called *clones*. (The choice of the parent system is somewhat arbitrary.
+ It is not necessarily the original or definitive variant.)
+BIOS system
+ A system configured with no software. This is mostly applicable for arcade
+ systems that used interchangeable game cartridges or ROM boards. Note that
+ this is *not* the same as the BIOS selection settings that allow you to
+ select system boot ROMs or device firmware.
+Software item
+ A software package described in a software list. Software items may consist
+ of multiple *parts* that can be mounted independently. Due to the large
+ variety of media supported by MAME, software parts may use different
+ *loaders*. These include the *ROM loader*, typically used for cartridge
+ media, and the *image file loader*, used for software parts consisting of a
+ single media image (including floppy disk and cassette media).
+Parent software item
+ Related software items are grouped using parent/clone relationships, in a
+ similar way to related systems. This is usually used to group different
+ versions or releases of the same piece of software. If a software item has
+ a parent item, it will always be in the same software list.
+Short name
+ MAME uses *short names* to uniquely identify systems and devices, to
+ uniquely identify software lists, to uniquely identify software items within
+ a software list, and to uniquely identify software parts within a software
+ item.
+
+ You can see the short name for a system by highlighting it in the system
+ selection menu, ensuring the info panel is visible on the right, and
+ showing the **General Info** in the **Infos** tab. For example the short
+ name for the Nintendo Virtual Boy is ``vboy``. System and device short
+ names can also be seen in the output of various command line verbs,
+ including ``-listxml``, ``-listfull``, ``-listroms`` and ``-listcrc``.
+
+ You can see the short names for a software item and the software list it
+ belongs to by highlighting it in the software selection menu, ensuring the
+ info panel is visible on the right, and showing the **Software List Info**
+ in the **Infos** tab. For example the short name for Macintosh System
+ Software 6.0.3 is ``sys603`` and the short name of the software list it
+ belongs to is ``mac_flop``. Software list short names match their file
+ names (for example the Sega Mega Drive/Genesis cartridge software list is
+ called **megadriv.xml** and its short name is ``megadriv``). You can also
+ see the short names software lists, software items and parts by finding the
+ ``name`` attributes in the XML software list files.
+
+
+Search path options
+-------------------
+
+Most options for specifying locations to search allow multiple directories to be
+specified, separated by semicolon (``;``) characters. Environment variables are
+expanded, using CMD shell syntax on Windows, or Bourne shell syntax on UNIX-like
+systems.
+
+Relative paths are interpreted relative to the current working directory at the
+time of use. If you start MAME by double-clicking it in Windows Explorer, the
+working directory is set to the folder containing the MAME executable. If you
+start MAME by double-clicking it in the macOS Finder or from most Linux desktop
+environments, the working directory will be set to your home directory.
+
+
+Archive files
+-------------
+
+MAME can load files from PKZIP and 7-Zip archives (these must have ``.zip`` and
+``.7z`` file name extensions, respectively). A number of extensions to the
+PKZIP format are supported, including Zip64 for large archives, NTFS timestamps,
+and LZMA compression. Only ASCII or UTF-8 filenames are supported in PKZIP
+archives (7-Zip archives always use UTF-16 filenames).
+
+MAME *does not* load files from nested archives. MAME will not load files
+stored in a PKZIP or 7-Zip archive which is itself contained within a PKZIP or
+7-Zip archive. Multi-segment archives and encrypted archives are not supported.
+The legacy “implode” compression method in PKZIP archives is not supported.
+
+MAME may perform poorly with archives containing large numbers of files. Files
+compressed using the LZMA compression algorithm are inherently more
+CPU-intensive to decompress than files compressed using simpler algorithms.
+MAME does not take the archive layout into consideration when loading files from
+archives, so using “solid compression” often results in MAME decompressing the
+same data repeatedly when loading media.
+
+
+How does MAME search for media?
+-------------------------------
+
+Use the :ref:`rompath <mame-commandline-rompath>` option sets the folders where
+searches for ROM dumps, disk images, and other media. By default MAME looks for
+media in a folder called **roms** in the working directory. For the purpose of
+this discussion, floppy disk, cassette, paper tape and other media images that
+are not stored in CHD format are treated as ROM dumps.
+
+When searching for system, device and software ROM dumps, MAME treats folders
+and archives inside the folders configured in you ``rompath`` setting as
+equivalent, but remember the limitation that MAME cannot load files from an
+archive contained within another archive. MAME looks for a folder first, then a
+PKZIP archive, and finally a 7-Zip archive. When searching for a ROM dump in an
+archive, MAME first looks for a file with the expected name and CRC. If no
+matching file is found, MAME looks for a file with the expected CRC ignoring the
+name. If no matching file is found, MAME finally looks for a file with the
+expected name, ignoring the CRC.
+
+While MAME can load disk images in CHD format from inside archives, this is not
+recommended. CHD files contain compressed data stored in a format allowing
+random access. If a CHD format disk image is stored in a PKZIP or 7-Zip
+archive, MAME needs to load the entire file into memory in order to use it. For
+hard disk or LaserDisc images in particular, this will likely use an excessive
+amount of swap file space, hurting performance and possibly reducing the life
+expectancy of your disks or SSDs. It’s best to keep CHD format disk images in
+folders.
+
+System ROMs
+~~~~~~~~~~~
+
+For each folder configured in your ``rompath`` setting, MAME looks for system
+ROMs in the following locations:
+
+* A folder or archive matching the short name of the system itself.
+* A folder or archive matching the short name of the system’s parent system, if
+ applicable.
+* A folder or archive matching the short name of the corresponding BIOS system,
+ if applicable.
+
+Using Shiritsu Justice Gakuen as an example, MAME will search for system ROMs as
+follows:
+
+* The short name of the system is ``jgakuen``, so MAME will look for a folder
+ called **jgakuen**, a PKZIP archive called **jgakuen.zip**, or a 7-Zip archive
+ called **jgakuen.7z**.
+* The parent system is the European version of Rival Schools, which has the
+ short name ``rvschool``, so MAME will look for a folder called **rvschool**, a
+ PKZIP archive called **rvschool.zip**, or a 7-Zip archive called
+ **rvschool.7z**.
+* The corresponding BIOS system is the Capcom ZN2 board, which has the short
+ name ``coh3002c``, so MAME will look for a folder called **coh3002c**, a PKZIP
+ archive called **coh3002c.zip**, or a 7-Zip archive called **coh3002c.7z**.
+
+Device ROMs
+~~~~~~~~~~~
+
+For each folder configured in your ``rompath`` setting, MAME looks for device
+ROMs in the following locations:
+
+* A folder or archive matching the short name of the device.
+* A folder or archive matching the short name of the device’s parent ROM device,
+ if applicable.
+* A folder or archive matching the short name of the system.
+* A folder or archive matching the short name of the system’s parent system, if
+ applicable.
+* A folder or archive matching the short name of the corresponding BIOS system,
+ if applicable.
+
+Using a Unitron 1024 Macintosh clone with a French Macintosh Plus keyboard with
+integrated numeric keypad attached as an example, MAME will look for the
+keyboard microcontroller ROM as follows:
+
+* The short name of the French Macintosh Plus keyboard is ``mackbd_m0110a_f``,
+ so MAME will look for a folder called **mackbd_m0110a_f**, a PKZIP archive
+ called **mackbd_m0110a_f.zip**, or a 7-Zip archive called
+ **mackbd_m0110a_f.7z**.
+* The parent ROM device is the U.S. Macintosh Plus keyboard with integrated
+ numeric keypad, whcih has the short name ``mackbd_m0110a``, so MAME will look
+ for a folder called **mackbd_m0110a**, a PKZIP archive called
+ **mackbd_m0110a.zip**, or a 7-Zip archive called **mackbd_m0110a.7z**.
+* The short name of the Unitron 1024 system is ``utrn1024``, so MAME will look
+ for a folder called **utrn1024**, a PKZIP archive called **utrn1024.zip**, or
+ a 7-Zip archive called **utrn1024.7z**.
+* The parent system of the Unitron 1024 is the Macintosh Plus, which has the
+ short name ``macplus``, so MAME will look for a folder called **macplus**, a
+ PKZIP archive called **macplus.zip**, or a 7-Zip archive called
+ **macplus.7z**.
+* There is no corresponding BIOS system, so MAME will not search in any further
+ locations.
+
+Software Item ROMs
+~~~~~~~~~~~~~~~~~~
+
+For each folder configured in your ``rompath`` setting, MAME looks for software
+item ROMs in the following locations:
+
+* A folder or archive matching the short name of the software item inside a
+ folder matching the short name of the software list (or a folder matching the
+ short name of the software item inside an archive matching the name of the
+ software list).
+* A folder or archive matching the short name of the parent software item inside
+ a folder matching the short name of the software list, if applicable (or a
+ folder matching the short name of the parent software item in an archive
+ matching the name of the software list).
+* A folder or archive matching the short name of the software item. (This is
+ for convenience for software items that also run as stand-alone systems with
+ the same short name, such as Neo Geo games.)
+* A folder or archive matching the short name of the parent software item, if
+ applicable. (This is for convenience for software items that also run as
+ stand-alone systems with the same short name, such as Neo Geo games.)
+* Any folders and archives that would be searched for system or device ROMs for
+ the system or device that the software list belongs to. This is for
+ historical reasons due to the way software list support was originally added
+ to MESS and will be removed in a future version of MAME.
+
+If you load the German version of Dune II from the Mega Drive/Genesis cartridge
+software list in the PAL Mega Drive console, MAME will look for the cartridge
+ROM as follows:
+
+* The short name of the software item for the German version of Dune II is
+ ``dune2g`` and the short name of the Mega Drive/Genesis cartridge software
+ list is ``megadriv``, so MAME will look for a folder called **dune2g**, a
+ PKZIP archive called **dune2g.zip** or a 7-Zip archive called **dune2g.7z**
+ inside a folder called **megadriv** (or a folder called **dune2g** inside a
+ PKZIP archive called **megadriv.zip** or a 7-Zip archive called
+ **megadriv.7z**).
+* The parent software item is the general European PAL version of Dune II in the
+ same software list, which has the short name ``dune2``, so MAME will look for
+ a folder called **dune2**, a PKZIP archive called **dune2.zip** or a 7-Zip
+ archive called **dune2.7z** inside a folder called **megadriv** (or a folder
+ called **dune2** inside a PKZIP archive called **megadriv.zip** or a 7-Zip
+ archive called **megadriv.7z**).
+* Next MAME will ignore the short name of the software list and use the short
+ name of the software item only, looking for a folder called **dune2g**, a
+ PKZIP archive called **dune2g.zip** or a 7-Zip archive called **dune2g.7z**.
+* Still ignoring the short name of the software list, MAME will use the short
+ name of the parent software item only, looking for a folder called **dune2**,
+ a PKZIP archive called **dune2.zip** or a 7-Zip archive called **dune2.7z**.
+* The short name of the PAL Mega Drive system is ``megadriv``, so MAME will look
+ for a folder called **megadriv**, a PKZIP archive called **megadriv.zip**, or
+ a 7-Zip archive called **megadriv.7z**.
+* The parent system of the PAL Mega Drive is the North American Genesis system,
+ which has the short name ``genesis``, so MAME will look for a folder called
+ **genesis**, a PKZIP archive called **genesis.zip**, or a 7-Zip archive called
+ **genesis.7z**.
+
+CHD format disk images
+~~~~~~~~~~~~~~~~~~~~~~
+
+MAME searches for system, device and software item CHD format disk images in
+almost the same way it searches for ROMs, with just a few differences:
+
+* For systems and software items, MAME will check the parent system or software
+ item if applicable for alternate names for a disk image with the same content
+ digest. This allows you to keep a single copy of a CHD format disk image for
+ a parent system or software item and any clones that expect a disk image with
+ the same content, irrespective of the name the clones expect.
+* For software items, MAME will look for CHD format disk images in a folder
+ matching the short name of the software list. This is for convenience when
+ all items in a software list only contain a single CHD format disk image each.
+* We recommend that you *do not* store CHD format disk images inside PKZIP or
+ 7-Zip archives. However, if you do decide to do this, MAME will only find CHD
+ format disk images inside archives with an expected name. This is because
+ MAME uses the content digest from the CHD header, not the checksum of the CHD
+ file itself. The checksum of the CHD file itself can vary depending on
+ compression options.
+
+Loose software
+~~~~~~~~~~~~~~
+
+Many systems support loading media from a file by supplying the path on the
+command line for one of the media options. Relative paths are interpreted
+relative to the current working directory.
+
+You can specify a path to a file inside a PKZIP or 7-Zip archive similarly to
+specifying a path to a file in a folder (keep in mind that you can have at most
+a single archive file in a path, as MAME does not support loading files from
+archives contained within other archives). If you specify a path to a PKZIP or
+7-Zip archive, MAME will use the first file found in the archive (this depends
+on the order that files are stored in the archive – it’s most useful for
+archives containing a single file).
+
+Start the Nintendo Entertainment System/Famicom system with the file
+**amazon_diet_EN.nes** mounted in the cartridge slot:
+
+.. code-block:: bash
+
+ mame nes -cart amazon_diet_EN.nes
+
+Start the Osborne-1 system with the first file in the archive **os1xutls.zip**
+mounted in the first floppy disk drive:
+
+.. code-block:: bash
+
+ mame osborne1 -flop1 os1xutils.zip
+
+Start the Macintosh Plus system with the file **system tools.img** in the
+archive **sys603.zip** mounted in the first floppy disk drive:
+
+.. code-block:: bash
+
+ mame macplus -flop1 "sys603.zip/system tools.img"
+
+Diagnosing missing media
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+When starting a system from MAME’s system selection menu or software selection
+menu, MAME will list any missing system or device ROM dumps or disk images, as
+long as at least one ROM dump or disk image for the system is present. For
+clone systems, at least one ROM dump or disk image *unique to the clone* must be
+present for MAME to list missing ROM dumps and disk images.
+
+If all system and device ROM dump and disk images are present and the system is
+being started with a software item, MAME will check that ROM dumps and disk
+images for the software item are present. If at least one ROM dump or disk
+image for the software item is present, MAME will list any missing ROM dumps or
+disk images.
+
+For example if you try to start the Macintosh Plus system and the keyboard
+microcontroller ROM dump is missing, MAME displays the following error message:
+
+ Required ROM/disk images for the selected system are missing or incorrect.
+ Please acquire the correct files or select a different system.
+
+ 341-0332-a.bin (mackbd_m0110a) - not found
+
+ Press any key to continue.
+
+The name of the missing ROM dump is shown (**341-0332-a.bin**), as well as the
+short name of the device it belongs to (``mackbd_m0110a``). When a missing ROM
+dump or disk image is not specific to the selected system, the short name of the
+system or device it belongs to is shown.
+
+If you start a system in MAME from a command prompt, MAME will show where it
+searched for any ROM dumps or disk images that were not found.
+
+Using the example of a Unitron 1024 Macintosh clone with a French keyboard
+connected, MAME will show the following error messages if no ROMs are present::
+
+ mame utrn1024 -kbd frp
+ 342-0341-a.u6d NOT FOUND (tried in utrn1024 macplus)
+ 342-0342-a.u8d NOT FOUND (tried in utrn1024 macplus)
+ 341-0332-a.bin NOT FOUND (tried in mackbd_m0110a_f mackbd_m0110a utrn1024 macplus)
+
+MAME used the system short name ``utrn1024`` and the parent system short name
+``macplus`` when searching for system ROMs. When searching for the keyboard
+microcontroller ROM, MAME used the device short name ``mackbd_m0110a_f``, the
+parent ROM device short name ``mackbd_m0110a``, the system short name
+``utrn1024``, and the parent system short name ``macplus``.
+
+Software parts that use the ROM loader (typically cartridge media) show similar
+messages when ROM dumps are not found. Using the example of the German version
+of Dune II on a PAL Mega Drive, MAME will show the following error messages if
+no ROMs are present::
+
+ mame megadriv dune2g
+ mpr-16838-f.u1 NOT FOUND (tried in megadriv\dune2g megadriv\dune2 dune2g dune2 megadriv genesis)
+ Fatal error: Required files are missing, the machine cannot be run.
+
+MAME searched for the cartridge ROM using:
+
+* The software list short name ``megadriv`` and the software item short name
+ ``dune2g``.
+* The software list short name ``megadriv`` and the parent software item short
+ name ``dune2``.
+* The software item short name ``dune2g`` only.
+* The parent software item short name ``dune2`` only.
+* The locations that would be searched for the PAL Mega Drive system (the system
+ short name ``megadriv`` and the parent system short name ``genesis``).
+
+Software parts that use the image file loader (including floppy disk and
+cassette media) only check for media after ROM images are loaded, and missing
+media files are shown differently. Using the example of Macintosh System 6.0.3,
+MAME will show these error messages if the software is missing::
+
+ mame macplus -flop1 sys603:flop1
+ :fdc:0:35dd: error opening image file system tools.img: No such file or directory (generic:2) (tried in mac_flop\sys603 sys603 macplus)
+ Fatal error: Device Apple/Sony 3.5 DD (400/800K GCR) load (-floppydisk1 sys603:flop1) failed: No such file or directory
+
+The error messages show where MAME searched for the image file in the same
+format. In this case, it used the software list short name ``mac_flop`` and the
+software short name ``sys603``, the software short name ``sys603`` only, and
+the locations that would be searched for system ROMs.
diff --git a/docs/source/usingmame/commonissues.rst b/docs/source/usingmame/commonissues.rst
index bd7a29f31af..50f81671934 100644
--- a/docs/source/usingmame/commonissues.rst
+++ b/docs/source/usingmame/commonissues.rst
@@ -309,7 +309,7 @@ You can try changing the
:ref:`lightgunprovider <mame-commandline-lightgunprovider>` setting (depending
on which kind of device you’re having issues with) from ``rawinput`` to one of
the other options such as ``dinput`` or ``win32``. See
-:ref:`osd-commandline-options` for details on input provider options
+:ref:`mame-commandline-osdoptions` for details on input provider options
.. _ExternalOPL:
diff --git a/docs/source/usingmame/defaultkeys.rst b/docs/source/usingmame/defaultkeys.rst
index d66c6556a4a..f7a7e8ba682 100644
--- a/docs/source/usingmame/defaultkeys.rst
+++ b/docs/source/usingmame/defaultkeys.rst
@@ -35,8 +35,8 @@ and saving/loading save states.
If you are running with -debug, this key sends a ‘break’ in emulation.
- When the on-screen display is visible, you can use the following
- keys to control it:
+ When a slider control is visible, you can use the following keys to control
+ it:
* **Up** - select previous parameter to modify.
* **Down** - select next parameter to modify.
@@ -63,7 +63,8 @@ and saving/loading save states.
Highlight first or last UI menu option.
**[** **]**
Move to previous or next group in UI menus that support it (e.g. move to the
- inputs for the previous or next device in the Input (this Machine) menu).
+ inputs for the previous or next device in the **Input Assignments (this
+ System)** menu).
**Enter**/**Joystick 1 Button 1**
Select currently highlighted UI menu option.
**Space**
@@ -115,8 +116,10 @@ and saving/loading save states.
* **Home**/**End** - move to top/bottom of list.
* **Left**/**Right** - change color displayed.
* **R** - rotate tiles 90 degrees clockwise.
- * **-**/**+** - increase/decrease the number of tiles per row.
- * **0** - restore the default number of tiles per row.
+ * **-**/**+** - increase/decrease the number of tiles per row (hold Shift to
+ restrict to integer scale factors).
+ * **0** - restore the default number of tiles per row (hold Shift to
+ restrict to integer scale factors).
* **Enter** - switch to tilemap viewer.
Tilemap mode:
@@ -704,8 +707,8 @@ All the keys below are fully configurable in the user interface. This list shows
the standard keyboard configuration.
Note that controls can vary widely by computer type, so not all keys are shown
-here. See the “Input (this Machine)” section of MAME’s configuration menu for
-details for the machine you are currently using.
+here. See the **Input Assignments (this system)** section of MAME’s Input
+Settings menu for details for the machine you are currently using.
**Tab**
@@ -740,5 +743,5 @@ All the keys are fully configurable in the user interface.
Note that controls can vary widely by machine type, so default keys are not
shown here and defaults will vary considerably based on the manufacturer and
-style. See the “Input (this Machine)” section of MAME’s configuration menu for
-details for the machine you are currently using.
+style. See the **Input Assignments (this system)** section of MAME’s Input
+Settings menu for details for the machine you are currently using.
diff --git a/docs/source/usingmame/index.rst b/docs/source/usingmame/index.rst
index e1a2ae8f5b1..615d3f34c4b 100644
--- a/docs/source/usingmame/index.rst
+++ b/docs/source/usingmame/index.rst
@@ -13,6 +13,7 @@ documentation for your platform of choice.
ui
defaultkeys
mamemenus
+ assetsearch
frontends
aboutromsets
commonissues
diff --git a/docs/source/usingmame/mamemenus.rst b/docs/source/usingmame/mamemenus.rst
index ca40b5668ed..672a9c7796a 100644
--- a/docs/source/usingmame/mamemenus.rst
+++ b/docs/source/usingmame/mamemenus.rst
@@ -1,9 +1,287 @@
+.. _menus:
+
MAME Menus
==========
-If you started MAME without any command line parameters, you'll be shown the
-system selection menu immediately. While the keys listed above will let you
-navigate the menus, you can also use a mouse.
+.. contents:: :local:
+
+
+.. _menus-intro:
+
+Introduction
+------------
+
+To show the :ref:`main menu <menus-main>` while running an emulated system in
+MAME, press the **Show/Hide Menu** key or button (**Tab** by default). If the
+emulated system has keyboard inputs, you may need to press the
+**Toggle UI Controls** key or button (**Scroll Lock**, or **Forward Delete** on
+macOS, by default) to enable user interface controls first. You can dismiss a
+menu by pressing the **UI Back** key or button (**Escape** by default).
+Dismissing a menu will return to its parent menu, or to the running system in
+the case of the main menu.
+
+You can hide a menu and return to the running system by pressing the
+**Show/Hide Menu** key or button. Pressing the **Show/Hide Menu** key or button
+again will jump back to the same menu. This is useful when testing changes to
+settings.
+
+Emulated system inputs are ignored while menus are displayed. You can still
+pause or resume the running system while most menus are displayed by pressing
+the **Pause** key or button (**P** on the keyboard by default).
+
+If you start MAME without specifying a system on the command line, the system
+selection menu will be shown (assuming the
+:ref:`ui option <mame-commandline-ui>` is set to **cabinet**). The system
+selection menu is also shown if you select **Select New System** from the main
+menu during emulation.
+
+For more information on navigating menus, :ref:`see the relevant section
+<ui-menus>`.
+
+
+.. _menus-main:
+
+Main menu
+---------
+
+The main menu is shown when you press the **Show/Hide Menu** key or button while
+running an emulated system or while the system information screen is displayed.
+It provides access to menus used to change settings, control various features,
+and show information about the running system and MAME itself.
+
+If you press the **Show/Hide Menu** key or button to show the main menu while
+the system information screen is displayed, the emulated system will not start
+until the main menu is dismissed (either by selecting **Start System**, pressing
+the **UI Back** key or button, or pressing the **Show/Hide Menu** key or
+button). This can be useful for mounting media images or changing DIP switches
+and machine configuration settings before the emulated system starts.
+
+Input Settings
+ Shows the :ref:`Input Settings <menus-inputopts>` menu, where you can assign
+ controls to emulated inputs, adjust analog control settings, control toggle
+ inputs, and test input devices.
+DIP Switches
+ Shows the DIP Switches menu, where configuration switches for the running
+ system can be changed. This item is not shown if the running system has no
+ DIP switches.
+Machine Configuration
+ Shows the Machine Configuration menu, where various settings specific to the
+ emulated system can be changed. This item is not shown if the running
+ system has no configuration settings.
+Bookkeeping
+ Shows uptime, coin counter and ticket dispenser statistics (if relevant) for
+ the running system.
+System Information
+ Shows information about the running system as emulated in MAME, including
+ CPU, sound and video devices.
+Warning Information
+ Shows information about imperfectly emulated features of the running system.
+ This item is not shown if there are no relevant warnings.
+Media Image Information
+ Shows information about mounted media images (if any). This item is only
+ shown if the running system has one or more media devices (e.g. floppy disk
+ drives or memory card slots).
+File Manager
+ Shows the File Manager menu, where you can mount new or existing media image
+ files, or unmount currently mounted media images. This item is only shown
+ if the running system has one or more media devices (e.g. floppy disk
+ drives or memory card slots).
+Tape Control
+ Shows the Tape Control menu, where you can control emulated cassette tape
+ mechanisms. This item is only shown for systems that use cassette tape
+ media.
+Pseudo Terminals
+ Shows the status of any pseudo terminal devices in the running system (used
+ to connect the emulated system to host pseudo terminals, for example via
+ emulated serial ports). This item is not shown if there are no pseudo
+ terminal devices in the running system.
+BIOS Selection
+ Shows the BIOS Selection menu, where you can select the BIOS/boot
+ ROM/firmware for the system and slot cards it contains. This item is not
+ shown if no BIOS options are available.
+Slot Devices
+ Shows the Slot Devices menu, where you can choose between emulated
+ peripherals. This item is not shown for systems that have no slot devices.
+Barcode Reader
+ Shows the Barcode Reader menu, where you can simulate scanning barcodes with
+ emulated barcode readers. This item is not shown if there are no barcode
+ readers in the running system.
+Network Devices
+ Shows the Network Devices menu, where you can set up emulated network
+ adapters that support bridging to a host network. This item is not shown if
+ there are no network adaptors that support bridging in the running system.
+Slider Controls
+ Shows the Slider Controls menu, where you can adjust various settings,
+ including video adjustments and individual sound channel levels.
+Video Options
+ Shows the Video Options menu, where you can change the view for each
+ screen/window, as well as for screenshots.
+Crosshair Options
+ Shows the Crosshair Options menu, where you can adjust the appearance of
+ crosshairs used to show the location of emulated light guns and other
+ absolute pointer inputs. This item is not shown if the emulated system has
+ has no absolute pointer inputs.
+Cheat
+ Shows the Cheat menu, for controlling the built-in cheat engine. This item
+ is only shown if the built-in chat engine is enabled. Note that the cheat
+ plugin’s menu is accessed via the Plugin Options menu.
+Plugin Options
+ Shows the Plugin Options menu, where you can access settings for enabled
+ plugins. This item is not shown if no plugins are enabled, or if the main
+ menu is shown before the emulated system starts (by pressing the Show/Hide
+ Menu key/button while the system information screen is displayed).
+External DAT View
+ Shows the info viewer, which displays information loaded from various
+ external support files. This item is not shown if the :ref:`data plugin
+ <plugins-data>` is not enabled, or if the main menu is shown before the
+ emulated system starts (by pressing the Show/Hide Menu key/button while the
+ system information screen is displayed).
+Add To Favorites/Remove From Favorites
+ Adds the running system to the favourites list, or removes it if it’s
+ already in the favourites list. The favourites list can be used as a
+ filter for the system selection menu.
+About MAME
+ Shows the emulator version, data model, and copyright license information.
+Select New System
+ Shows the system selection menu, where you can select a system to start a
+ new emulation session. This item is not shown if the main menu is shown
+ before the emulated system starts (by pressing the Show/Hide Menu key/button
+ while the system information screen is displayed).
+Close Menu/Start System
+ Closes the main menu, returning control of the running system. Shows
+ **Start System** if the main menu is shown before the emulated system
+ starts (by pressing the Show/Hide Menu key/button while the system
+ information screen is displayed).
+
+
+.. _menus-inputopts:
+
+Input Settings menu
+-------------------
+
+The Input Settings provides options for assigning controls to emulated inputs,
+adjusting analog control settings, controlling toggle inputs, and testing input
+devices. You can reach the Input Settings menu by selecting **Input Settings**
+from the :ref:`main menu <menus-main>`. The items shown on this menu depend on
+available emulated inputs for the running system. Available emulated inputs may
+depend on slot options, machine configuration settings and DIP switch settings.
+
+Input Assignments (this system)
+ Lets you select assign controls to emulated inputs for the running system.
+ See the section on :ref:`configuring inputs <ui-inptcfg>` for more details.
+ This item is not shown if the running system has no enabled inputs that can
+ be assigned controls.
+Analog Input Adjustments
+ Shows the Analog Input Adjustments menu, where you can adjust sensitivity,
+ auto-centring speed and inversion settings for emulated analog inputs, and
+ see how the emulated analog inputs respond to controls with your settings.
+ For more details, see the :ref:`analog input settings <ui-inptcfg-analog>`
+ section for more details. This item is not shown if the running system has
+ no enabled analog inputs.
+Keyboard Selection
+ Shows the :ref:`Keyboard Selection menu <menus-keyboard>`, where you can
+ select between emulated and natural keyboard modes, and enable and disable
+ keyboard and keypad inputs for individual emulated devices. This item is
+ not shown if the running system has no keyboard or keypad inputs.
+Toggle Inputs
+ Shows the :ref:`Toggle Inputs menu <menus-inputtoggle>`, where you can view
+ and adjust the state of multi-position or toggle inputs. This item is not
+ shown if the running system has no enabled toggle inputs.
+Input Assignments (general)
+ Lets you select assign user interface controls, or assign default controls
+ for all emulated systems. See the section on :ref:`configuring inputs
+ <ui-inptcfg>` for more details.
+Input Devices
+ Shows the :ref:`Input Devices menu <menus-inputdevices>`, which lists the
+ input devices recognised by MAME.
+
+
+.. _menus-inputtoggle:
+
+Toggle Inputs menu
+------------------
+
+The Toggle Inputs menu shows the current state of multi-position or toggle
+inputs. Common examples include mechanically locking Caps Lock keys on
+computers, and two-position gear shit levers on driving games. You can reach
+the Toggle Inputs menu by selecting **Toggle Inputs** from the :ref:`Input
+Settings menu <menus-inputopts>`. Note that available emulated inputs may
+depend on slot options, machine configuration settings and DIP switch settings.
+
+Inputs are grouped by the emulated device they belong to. You can move between
+devices using the **Next Group** and **Previous Group** keys or buttons. Names
+of inputs are shown on the left, and the current settings are shown on the
+right.
+
+To change the state of an input, highlight it and use the **UI Left** and **UI
+Right** keys or buttons, or click the arrows beside the current setting.
+
+
+.. _menus-keyboard:
+
+Keyboard Selection menu
+-----------------------
+
+The Keyboard Selection menu lets your switch between emulated and natural
+keyboard modes, and enable or disable keyboard inputs for individual emulated
+devices. You can reach the Keyboard Selection menu by selecting **Keyboard
+Selection** from the :ref:`Input Settings menu <menus-inputopts>`.
+
+In emulated keyboard mode, keyboard and keypad inputs behave like any other
+digital inputs, responding to their assigned controls. In natural keyboard
+mode, MAME attempts to translate typed characters to emulated keystrokes. The
+initial keyboard mode is set using the :ref:`natural option
+<mame-commandline-natural>`.
+
+There are a number of unavoidable limitations in natural keyboard mode:
+
+* The emulated system must to support it.
+* The selected keyboard *must* match the keyboard layout selected in the
+ emulated software.
+* Keystrokes that don’t produce characters can’t be translated. (e.g. pressing a
+ modifier key on its own, such as **Shift** or **Control**).
+* Holding a key until the character repeats will cause the emulated key to be
+ pressed repeatedly as opposed to being held down.
+* Dead key sequences are cumbersome to use at best.
+* Complex input methods will not work at all (e.g. for Chinese/Japanese/Korean).
+
+Each emulated device in the system that has keyboard and/or keypad inputs is
+listed on the menu, allowing keyboard/keypad inputs to be enabled or disabled
+for individual devices. By default, keyboard/keypad inputs are enabled for the
+first device with keyboard inputs (if any), and for all other devices that have
+keypad inputs but no keyboard inputs. The enabled keyboard/keypad inputs are
+automatically saved to the configuration file for the system when the emulation
+session ends.
+
+
+.. _menus-inputdevices:
+
+Input Devices menu
+------------------
+
+The Input Devices menu lists input devices recognised by MAME and enabled with
+your current settings. Recognised input devices depend on the
+:ref:`keyboardprovider <mame-commandline-keyboardprovider>`, :ref:`mouseprovider
+<mame-commandline-mouseprovider>`, :ref:`lightgunprovider
+<mame-commandline-lightgunprovider>` and :ref:`joystickprovider
+<mame-commandline-joystickprovider>` options. Classes of input devices can be
+enabled or disabled using the :ref:`mouse <mame-commandline-nomouse>`,
+:ref:`lightgun <mame-commandline-nolightgun>` and :ref:`joystick
+<mame-commandline-nojoystick>` options. You can reach the Input Devices menu by
+selecting **Input Devices** from the :ref:`Input Settings menu
+<menus-inputopts>` or the General Settings menu.
-[todo: This needs SERIOUS expansion. Waiting on answer to a few questions..]
+Input devices are grouped by device class (for example keyboards or light guns).
+You can move between device classes using the **Next Group** and **Previous
+Group** keys or buttons. For each device, the device number (within its class)
+is shown on the left, and the name is shown on the right.
+Select a device to show the supported controls for the device. The name of
+each control is displayed on the left and its current state is shown on the
+right. When an analog axis control is highlighted, its state is also shown in
+graphical form below the menu. Digital control states are either zero
+(inactive) or one (active). Analog axis input states range from -65,536 to
+65,536 with the neutral position at zero. You can also select **Copy Device
+ID** to copy the device’s ID to the clipboard. This is useful for setting up
+:ref:`stable controller IDs <devicemap>` in :ref:`controller configuration files
+<ctrlrcfg>`.
diff --git a/docs/source/usingmame/ui.rst b/docs/source/usingmame/ui.rst
index 1956ca939cd..60bb55618a2 100644
--- a/docs/source/usingmame/ui.rst
+++ b/docs/source/usingmame/ui.rst
@@ -11,7 +11,7 @@ MAME’s User Interface
Introduction
------------
-MAME provides a simple user interface for selecting a system and software to
+MAME provides a simple user interface for selecting the system and software to
run and changing settings while running an emulated system. MAME’s user
interface is designed to be usable with a keyboard, game controller, or pointing
device, but will require a keyboard for initial configuration.
@@ -20,13 +20,13 @@ The default settings for the most important controls to know when running an
emulated system, and the settings they correspond to in case you want to change
them, are as follows:
-Scroll Lock, or Forward Delete on macOS (UI Toggle)
+Scroll Lock, or Forward Delete on macOS (Toggle UI Controls)
For emulated systems with keyboard inputs, enable or disable UI controls.
(MAME starts with UI controls disabled for systems with keyboard inputs
unless the :ref:`ui_active option <mame-commandline-uiactive>` is on.)
-Tab (Config Menu)
+Tab (Show/Hide Menu)
Show or hide the menu during emulation.
-Escape (UI Cancel)
+Escape (UI Back and UI Cancel)
Return to the system selection menu, or exit if MAME was started with a
system specified (from the command line or using an
:ref:`external front-end <frontends>`).
@@ -60,10 +60,11 @@ Return/Enter keypad Enter (UI Select)
Select the highlighted menu item.
Forward Delete, or Fn+Delete on some compact keyboards (UI Clear)
Clear setting or reset to default value.
-Escape (UI Cancel)
+Escape (UI Back and UI Cancel)
Clear the search if searching the menu, otherwise close the menu, returning
- to the previous menu, or returning to the emulated machine for the main menu
- (there’s usually an item at the bottom of the menu for the same purpose).
+ to the previous menu, or returning to the emulated system in the case of the
+ main menu (there’s usually an item at the bottom of the menu for the same
+ purpose).
Home (UI Home)
Highlight the first menu item and scroll to the top of the menu.
End (UI End)
@@ -91,14 +92,24 @@ most important UI controls have joystick assignments by default:
* Move the first joystick left or right in the X axis to adjust settings.
* Press the first button on the first joystick to select the highlighted menu
item.
+* If the first joystick has at least three buttons, press the second button on
+ the first joystick to close the menu, returning to the previous menu, or
+ returning to the emulated system in the case of the main menu (there’s usually
+ an item at the bottom of the menu for the same purpose).
+
+For gamepad-style controllers, the left analog thumb stick and directional pad
+usually control UI navigation. Depending on the controller, the right analog
+thumb stick, triggers and additional buttons may automatically be assigned to UI
+inputs. Check the **User Interface** input assignments menu to see how controls
+are assigned.
If you want to be able to use MAME with a game controller without needing a
keyboard, you’ll need to assign joystick buttons (or combinations of buttons) to
these controls as well:
-* **Config Menu** to show or dismiss the menu during emulation
-* **UI Cancel** to close menus, return to the system selection menu, or exit
- MAME
+* **Show/Hide Menu** to show or hide the menu during emulation
+* **UI Back** to close menus
+* **UI Cancel** to return to the system selection menu or exit MAME
* **UI Clear** isn’t essential for basic emulation, but it’s used to clear or
reset some settings to defaults
* **UI Home**, **UI End**, **UI Page Up**, **UI Page Down**, **UI Previous
@@ -133,8 +144,8 @@ pointing device:
* Click toolbar items to select them, or hover over them to see a description.
If you have enough additional mouse buttons, you may want to assign button
-combinations to the **Config Menu**, **Pause** and/or **UI Cancel** inputs to
-make it possible to use MAME without a keyboard.
+combinations to the **Show/Hide Menu**, **Pause**, **UI Back** and/or
+**UI Cancel** inputs to make it possible to use MAME without a keyboard.
.. _ui-inptcfg:
@@ -145,26 +156,31 @@ Configuring inputs
MAME needs a flexible input system to support the control schemes of the vast
array of systems it emulates. In MAME, inputs that only have two distinct
states, on and off or active and inactive, are called *digital inputs*, and all
-other inputs are called *analog inputs*, even if this is not strictly true.
+other inputs are called *analog inputs*, even if this is not strictly true (for
+example multi-position switches are called analog inputs in MAME).
To assign MAME’s user interface controls or the default inputs for all systems,
-select **Input (general)** from the main menu during emulation, or select
-**Configure Options** from the system selection menu and then select **General
-Inputs**. From there, select a category.
-
-To assign inputs for the currently running machine, select **Input (this
-Machine)** from the main menu during emulation. Inputs are grouped by device
-and sorted by type. You can move between devices with the next group and
-previous group keys/buttons (**[** and **]** on the keyboard by default).
+select **Input Settings** from the main menu during emulation and then select
+**Input Assignments (general)** from the Input Settings menu, or select
+**General Settings** from the system selection menu and then select **Input
+Assignments** from the General Settings menu. From there, select a category.
+
+To assign inputs for the currently running system, select **Input Settings**
+from the main menu during emulation and then select **Input Assignments (this
+system)** from the Input Settings menu. Inputs are grouped by device and sorted
+by type. You can move between devices with the next group and previous group
+keys/buttons (opening/closing brackets **[** and **]** on the keyboard by
+default).
The input assignment menus show the name of the emulated input or user interface
-control on the left, and the input (or combination of inputs) assigned to it on
-the right.
+control on the left, and the controls (or combination of controls) assigned to
+it on the right.
To adjust the sensitivity, auto-centre speed and inversion settings, or to see
-how emulated analog controls react to your inputs, select **Analog Controls**
-from the main menu during emulation. (This item only appears on the main menu
-for systems with analog controls.)
+how emulated analog controls react to your inputs, select **Input Settings**
+from the main menu during emulation, and then select **Analog Input
+Adjustments** from the Input Settings Menu (this item only appears on the Input
+Settings menu for systems with analog controls).
.. _ui-inptcfg-digital:
@@ -173,7 +189,7 @@ Digital input settings
~~~~~~~~~~~~~~~~~~~~~~
Each emulated digital input has a single assignment setting. For flexibility,
-MAME can combine host inputs (keys, buttons and joystick axes) using logical
+MAME can combine controls (keys, buttons and joystick axes) using logical
**and**, **not** and **or** operations. This is best illustrated with some
examples:
@@ -195,11 +211,12 @@ Kbd P Kbd Shift or Kbd P Kbd Right Shift
(In technical terms, MAME uses Boolean sum of products logic to combine inputs.)
When a digital input setting is highlighted, the prompt below the menu shows
-whether selecting it will set the assignment or append an **or** operation to
-it. Press **UI Left/Right** before selecting the setting to switch between
-setting or appending an **or** operation. Press **UI Clear** (**Delete** or
-**Forward Delete** by default) to clear the setting or restore the default
-assignment.
+whether selecting it will replace the current assignment or append an **or**
+operation to it. Press **UI Left/Right** before selecting the setting to switch
+between replacing the assignment or appending an **or** operation to it. Press
+**UI Clear** (**Delete** or **Forward Delete** by default) to clear the
+highlighted setting, or restore the default assignment if it is currently
+cleared.
When you select a digital input setting, MAME will wait for you to enter an
input or a combination of inputs for a logical **and** operation:
@@ -209,10 +226,7 @@ input or a combination of inputs for a logical **and** operation:
* Press a key or button or move an analog control twice to add a **not** item to
the **and** operation. Pressing the same key or button or moving the same
analog control additional times toggles the **not** on and off.
-* Pressing **UI Cancel** (**Escape** by default) *before* activating any other
- controls clears the setting or restores the default assignment.
-* Pressing **UI Cancel** *after* activating another control leaves the setting
- unchanged.
+* Press **UI Cancel** (**Escape** by default) to leave the setting unchanged.
* The new setting is shown below the menu. Wait one second after activating an
input to accept the new setting.
@@ -242,14 +256,14 @@ Each emulated analog input has three assignment settings:
input. The axis setting uses the name of the input with the suffix “Analog”.
For example the axis setting for the steering wheel in Ridge Racer is called
**Steering Wheel Analog**.
-* Use the *increment setting* assign an input (or combination of inputs) to
+* Use the *increment setting* assign a control (or combination of controls) to
increase the value of the emulated analog input. The increment setting uses
the name of the input with the suffix “Analog Inc”. For example the increment
setting for the steering wheel in Ridge Racer is called **Steering Wheel
Analog Inc**. This is a digital input setting – if an analog axis is
assigned to it, MAME will not increase the emulated input value at a
proportional speed.
-* Use the *decrement setting* assign an input (or combination of inputs) to
+* Use the *decrement setting* assign a control (or combination of controls) to
decrease the value of the emulated analog input. The decrement setting uses
the name of the input with the suffix “Analog Dec”. For example the decrement
setting for the steering wheel in Ridge Racer is called **Steering Wheel
@@ -272,12 +286,12 @@ You can assign one or more analog axes to the axis setting for an emulated
analog input. When multiple axes are assigned to an axis setting, they will be
added together, but absolute position controls will override relative position
controls. For example suppose for Arkanoid you assign the **Dial Analog** axis
-setting to **Mouse X or Joy 1 LSX or Joy 1 RSX** on a mouse Xbox-style
+setting to **Mouse X or Joy 1 LSX or Joy 1 RSX** on a mouse and Xbox-style
controller. You will be able to control the paddle with the mouse or either
analog stick, but the mouse will only take effect if both analog sticks are in
the neutral position (centred) on the X axis. If either analog stick is *not*
centred on the X axis, the mouse will have no effect, because a mouse is a
-relative position control while a joystick is an absolute position control.
+relative position control while joysticks are absolute position controls.
For absolute position controls like joysticks and pedals, MAME allows you to
assign either the full range of an axis or the range on one side of the neutral
@@ -311,10 +325,10 @@ Mouse X or Joy 1 LT or Joy 1 RT Reverse
direction to the left trigger.
Joy 1 LB Joy 1 LSX
Use horizontal movement of the left analog stick to control the emulated
- input, but *only* while holding the left shoulder button. If the right
+ input, but *only* while holding the left shoulder button. If the left
shoulder button is released while the left analog stick is not centred
- horizontally, the emulated input will hold its value until the right
- shoulder button is pressed again (a “sticky” control).
+ horizontally, the emulated input will hold its value until the left shoulder
+ button is pressed again (a “sticky” control).
not Joy 1 RB Joy 1 RSX or Joy 1 RB Joy 1 RSX Reverse
Use horizontal movement of the right analog stick to control the emulated
input, but invert the control if the right shoulder button is held.
@@ -333,23 +347,21 @@ When you select an axis setting, MAME will wait for you to enter an input:
direction of the control on or off.
* When appending to a setting, move an analog control other than the last
assigned control or press a key or button to add an **or** operation.
-* Pressing **UI Cancel** (**Escape** by default) *before* activating any other
- controls clears the setting or restores the default assignment.
-* Pressing **UI Cancel** *after* activating another control leaves the setting
- unchanged.
+* Pressing **UI Cancel** (**Escape** by default) leaves the setting unchanged.
* The new setting is shown below the menu. Wait one second after moving an
analog control to accept the new setting.
To adjust sensitivity, auto-centring speed and inversion settings for emulated
-analog inputs, or to see how they respond to your settings, select **Analog
-Controls** from the main menu during emulation. Settings for emulated analog
+analog inputs, or to see how they respond to controls with your settings, select
+**Input Settings** from the main menu during emulation, and then select **Analog
+Input Adjustments** from the Input Settings Menu. Settings for emulated analog
inputs are grouped by device and sorted by type. You can move between devices
-with the next group and previous group keys/buttons (**[** and **]** on the
-keyboard by default). The state of the emulated analog inputs is shown below
-the menu, and reacts in real time. Press the **On Screen Display** key or
-button (the backtick/tilde key by default on a US ANSI QWERTY keyboard) to hide
-the menu to make it easier to test without changing settings. Press the same
-key or button to show the menu again.
+with the next group and previous group keys/buttons (opening/closing brackets
+**[** and **]** on the keyboard by default). The state of the emulated analog
+inputs is shown below the menu, and reacts in real time. Press the **On Screen
+Display** key or button (the backtick/tilde key by default on a US ANSI QWERTY
+keyboard) to hide the menu to make it easier to test without changing settings.
+Press the same key or button to show the menu again.
Each emulated input has four settings on the **Analog Controls** menu:
@@ -387,7 +399,7 @@ The system and software selection menus
If you start MAME without specifying a system on the command line, the system
selection menu will be shown (assuming the
:ref:`ui option <mame-commandline-ui>` is set to **cabinet**). The system
-selection menu is also shown if you select **Select New Machine** from the main
+selection menu is also shown if you select **Select New System** from the main
menu during emulation. Selecting a system that uses software lists shows the
similar software selection menu.
@@ -407,7 +419,7 @@ The system and software selection menus have the following parts:
* The list of systems or software in the centre. For the system selection menu,
there are configuration options below the list of systems. Clones are shown
with a different text colour (grey by default). You can right-click a system
- name as a shortcut to show the machine configuration options for the system.
+ name as a shortcut to show the System Settings menu for the system.
Systems or software items are sorted by full name or description, keeping
clones immediately below their parents. This may appear confusing if your
@@ -454,8 +466,8 @@ Navigation controls
In addition to the usual :ref:`menu navigation controls <ui-menus>`, the system
and software selection menus have additional configurable controls for
navigating the multi-pane layout, and providing alternatives to toolbar buttons
-if you don’t want to use a pointing device. The default additional controls (on
-a US ANSI QWERTY keyboard), and the settings they correspond to, are:
+if you don’t want to use a pointing device. The default additional controls
+(with a US ANSI QWERTY keyboard), and the settings they correspond to, are:
Tab (UI Focus Next)
Move focus to the next area. The order is system/software list,
@@ -488,7 +500,7 @@ The simple system selection menu
--------------------------------
If you start MAME without specifying a system on the command line (or choose
-**Select New Machine** from the main menu during emulation) with the
+**Select New System** from the main menu during emulation) with the
:ref:`ui option <mame-commandline-ui>` set to **simple**, the simple system
selection menu will be shown. The simple system selection menu shows fifteen
randomly selected systems that have ROM sets present in your configured
diff --git a/docs/source/usingmame/usingmame.rst b/docs/source/usingmame/usingmame.rst
index f808199cb52..9a66bc814c4 100644
--- a/docs/source/usingmame/usingmame.rst
+++ b/docs/source/usingmame/usingmame.rst
@@ -79,8 +79,8 @@ gives a basic summary of command line options for MAME, as explained above.
**mame.exe -showusage**
gives you the (quite long) list of available command line options for MAME.
-The main options are described, in the :ref:`universal-command-line` section of
-this manual.
+The main options are described, in the :ref:`mame-commandline-universal` section
+of this manual.
**mame.exe -showconfig**
@@ -88,9 +88,10 @@ this manual.
gives you a (quite long) list of available configuration options for MAME.
These optons can always be modified at command line, or by editing them in
mame.ini which is the main configuration file for MAME. You can find a
-description of some configuration options in the :ref:`universal-command-line`
-section of the manual (in most cases, each configuration option has a
-corresponding command line option to configure and modify it).
+description of some configuration options in the
+:ref:`mame-commandline-universal` section of the manual (in most cases, each
+configuration option has a corresponding command line option to configure and
+modify it).
**mame.exe -createconfig**
diff --git a/docs/source/whatis.rst b/docs/source/whatis.rst
index 6f6f772e480..42dee6ff701 100644
--- a/docs/source/whatis.rst
+++ b/docs/source/whatis.rst
@@ -19,7 +19,7 @@ that were its initial focus.
|
| **MAME®**
-| **Copyright © 1997-2021 Nicola Salmoria and the MAME team**
+| **Copyright © 1997-2023 MAMEdev and contributors**
| **MAME is a registered trademark of Gregory Ember**
|