summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2018-07-22 09:52:50 +1000
committer Vas Crabb <vas@vastheman.com>2018-07-22 09:52:50 +1000
commit6669489679753daa8c5766ae24b31b0ce0748221 (patch)
treed387975a23867ee4650f45cd33bfc518c64d3288
parent7809e9005dff6769ad18cf924f285fd60519b044 (diff)
allow repeating elements and groups - useful if you need e.g. a lot of numbered labels, but it limits complay.py's ability to check for invalid references as it can't evaluate expressions (nw)
-rw-r--r--docs/source/advanced/bgfx.rst6
-rw-r--r--docs/source/advanced/glsl.rst14
-rw-r--r--docs/source/advanced/hlsl.rst162
-rw-r--r--docs/source/advanced/multiconfig.rst4
-rw-r--r--docs/source/commandline/commandline-all.rst20
-rw-r--r--docs/source/debugger/breakpoint.rst4
-rw-r--r--docs/source/debugger/execution.rst14
-rw-r--r--docs/source/debugger/general.rst18
-rw-r--r--docs/source/debugger/memory.rst18
-rw-r--r--docs/source/debugger/watchpoint.rst6
-rw-r--r--docs/source/index.rst2
-rw-r--r--docs/source/initialsetup/compilingmame.rst2
-rw-r--r--docs/source/techspecs/device_rom_interface.rst2
-rw-r--r--docs/source/techspecs/luaengine.rst6
-rw-r--r--docs/source/techspecs/m6502.rst24
-rw-r--r--docs/source/usingmame/defaultkeys.rst26
-rw-r--r--docs/source/usingmame/usingmame.rst2
-rw-r--r--scripts/build/complay.py43
-rw-r--r--src/emu/render.h11
-rw-r--r--src/emu/rendlay.cpp83
-rw-r--r--src/mame/layout/intlc44.lay18
-rw-r--r--src/mame/layout/intlc440.lay18
22 files changed, 280 insertions, 223 deletions
diff --git a/docs/source/advanced/bgfx.rst b/docs/source/advanced/bgfx.rst
index 67f03937221..5508ee01d53 100644
--- a/docs/source/advanced/bgfx.rst
+++ b/docs/source/advanced/bgfx.rst
@@ -41,7 +41,7 @@ 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**
@@ -54,7 +54,7 @@ Configuration Settings
| **metal** -- Metal Apple Graphics API (Requires OS X 10.11 El Capitan or newer)
|
| **bgfx_debug**
-|
+|
| Enables BGFX debugging features. Most users will not need to use this.
|
| **bgfx_screen_chains**
@@ -116,4 +116,4 @@ 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 changable on a per-screen basis. \ No newline at end of file
+Note that settings are individually changable on a per-screen basis.
diff --git a/docs/source/advanced/glsl.rst b/docs/source/advanced/glsl.rst
index 543538d4ef7..033403cb150 100644
--- a/docs/source/advanced/glsl.rst
+++ b/docs/source/advanced/glsl.rst
@@ -63,23 +63,23 @@ Configuration Settings
----------------------
| **gl_glsl**
-|
+|
| Enables GLSL when set to 1, disabled if set to 0. Defaults to *0*.
-|
+|
| **gl_glsl_filter**
-|
+|
| Enables filtering to GLSL output. Reduces jagginess at the cost of blurriness.
-|
+|
| **glsl_shader_mame0**
| ...
| **glsl_shader_mame9**
-|
+|
| Specifies the shaders to run, in the order from 0 to 9. See your shader pack author for details on which to run in which order for best effect.
-|
+|
| **glsl_shader_screen0**
| ...
| **glsl_shader_screen9**
-|
+|
| Specifies screen to apply the shaders on.
|
diff --git a/docs/source/advanced/hlsl.rst b/docs/source/advanced/hlsl.rst
index c1536dc3d8f..3fb25578e2e 100644
--- a/docs/source/advanced/hlsl.rst
+++ b/docs/source/advanced/hlsl.rst
@@ -65,22 +65,22 @@ Configuration Settings
----------------------
| **hlslpath**
-|
+|
| This is where your HLSL files are stored. By default, this will be the HLSL folder in your MAME installation.
-|
+|
| **hlsl_snap_width**
| **hlsl_snap_height**
-|
+|
| Sets the resolution that Alt+F12 HLSL screenshots are output at.
-|
+|
| **shadow_mask_alpha** (*Shadow Mask Amount*)
-|
+|
| This defines how strong the effect of the shadowmask is. Acceptable range is from 0 to 1, where 0 will show no shadowmask effect, 1 will be a completely opaque shadowmask, and 0.5 will be 50% transparent.
-|
+|
| **shadow_mask_tile_mode** (*Shadow Mask Tile Mode*)
-|
+|
| This defines whether the shadowmask should be tiled based on the screen resolution of your monitor or based on the source resolution of the emulated system. Valid values are 0 for *Screen* mode and 1 for *Source* mode.
-|
+|
| **shadow_mask_texture**
| **shadow_mask_x_count** (*Shadow Mask Pixel X Count*)
| **shadow_mask_y_count** (*Shadow Mask Pixel Y Count*)
@@ -88,177 +88,177 @@ Configuration Settings
| **shadow_mask_vsize** (*Shadow Mask V Size*)
| **shadow_mask_x_count** (*Shadow Mask U Offset*)
| **shadow_mask_y_count** (*Shadow Mask V Offset*)
-|
+|
| These settings need to be set in unison with one another. In particular, **shadow_mask_texture** sets rules for how you need to set the other options.
-|
+|
| **shadow_mask_texture** sets the texture of the shadowmask effect. Three shadowmasks are included with MAME: *aperture-grille.png*, *shadow-mask.png*, and *slot-mask.png*
-|
+|
| **shadow_mask_usize** and **shadow_mask_vsize** define the used size of the shadow_mask_texture in percentage, staring at the top-left corner. The means for a texture with the actual size of 24x24 pixel and an u/v size of 0.5,0.5 the top-left 12x12 pixel will be used. Keep in mind to define an u/v size that makes is possible to tile the texture without gaps or glitches. 0.5,0.5 is fine for any shadowmask texture that is included with MAME.
-|
+|
| **shadow_mask_x_count** and **shadow_mask_y_count** define how many screen pixel should be used to display the u/v sized texture. e.g. if you use the example from above and define a x/y count of 12,12 every pixel of the texture will be displayed 1:1 on the screen, if you define a x/y count of 24,24 the texture will be displayed twice as large.
-|
+|
| example settings for **shadow_mask.png**:
-|
+|
| shadow_mask_texture shadow-mask.png
| shadow_mask_x_count 12
| shadow_mask_y_count 6 or 12
| shadow_mask_usize 0.5
| shadow_mask_vsize 0.5
-|
+|
| example settings for **slot-mask.png**:
-|
+|
| shadow_mask_texture slot-mask.png
| shadow_mask_x_count 12
| shadow_mask_y_count 8 or 16
| shadow_mask_usize 0.5
| shadow_mask_vsize 0.5
-|
+|
| example settings for **aperture-grille**:
-|
+|
| shadow_mask_texture aperture-grille.png
| shadow_mask_x_count 12
| shadow_mask_y_count 12 or any
| shadow_mask_usize 0.5
| shadow_mask_vsize 0.5
-|
+|
| **shadow_mask_uoffset** and **shadow_mask_voffset** can be used to tweak the alignment of the final shadowmask in subpixel range. Range is from -1.00 to 1.00, where 0.5 moves the shadowmask by 50 percent of the u/v sized texture.
-|
+|
| **distortion** (*Quadric Distortion Amount*)
-|
+|
| This setting determines strength of the quadric distortion of the screen image.
-|
+|
| **cubic_distortion** (*Cubic Distortion Amount*)
-|
+|
| This setting determines strength of the qubic distortion of the screen image.
-|
+|
| Both distortion factors can be negative to compensate each other. e.g. distortion 0.5 and cubic_distortion -0.5
-|
+|
| **distort_corner** (*Distorted Corner Amount*)
-|
+|
| This setting determines strength of distortion of the screen corners, which does not affect the distortion of screen image itself.
-|
+|
| **round_corner** (*Rounded Corner Amount*)
-|
+|
| The corners of the display can be rounded off through the use of this setting.
-|
+|
| **smooth_border** (*Smooth Border Amount*)
-|
+|
| Sets a smoothened/blurred border around the edges of the screen.
-|
+|
| **reflection** (*Reflection Amount*)
-|
+|
| If set above 0, this creates a white reflective blotch on the display. By default, this is put in the upper right corner of the display. By editing the POST.FX file's GetSpotAddend section, you can change the location. Range is from 0.00 to 1.00.
-|
+|
| **vignetting** (*Vignetting Amount*)
-|
+|
| When set above 0, will increasingly darken the outer edges of the display in a pseudo-3D effect. Range is from 0.00 to 1.00.
-|
+|
| **scanline_alpha** (*Scanline Amount*)
-|
+|
| This defines how strong the effect of the scanlines are. Acceptable range is from 0 to 1, where 0 will show no scanline effect, 1 will be a completely black line, and 0.5 will be 50% transparent. Note that arcade monitors did not have completely black scanlines.
-|
+|
| **scanline_size** (*Overall Scanline Scale*)
-|
+|
| The overall spacing of the scanlines is set with this option. Setting it at 1 represents consistent alternating spacing between display lines and scanlines.
|
| **scanline_height** (*Individual Scanline Scale*)
-|
+|
| This determines the overall size of each scanline. Setting lower than 1 makes them thinner, larger than 1 makes them thicker.
-|
+|
| **scanline_variation** (*Scanline Variation*)
-|
+|
| This affects the size of each scanline depending on its brightness. Brighter scanlines will be thicker than darker scanline. Acceptable range is from 0 to 2.0, with the default being 1.0. At 0.0 all scanlines will have the same size independent of their brightness.
-|
+|
| **scanline_bright_scale** (*Scanline Brightness Scale*)
-|
+|
| Specifies how bright the scanlines are. Larger than 1 will make them brighter, lower will make them dimmer. Setting to 0 will make scanlines disappear entirely.
-|
+|
| **scanline_bright_offset** (*Scanline Brightness Offset*)
-|
+|
| This will give scanlines a glow/overdrive effect, softening and smoothing the top and bottom of each scanline.
-|
+|
| **scanline_jitter** (*Scanline Jitter Amount*)
-|
+|
| Specifies the wobble or jitter of the scanlines, causing them to jitter on the monitor. Warning: Higher settings may hurt your eyes.
-|
+|
| **hum_bar_alpha** (*Hum Bar Amount*)
-|
+|
| Defines the strength of the hum bar effect.
-|
+|
| **defocus** (*Defocus*)
-|
+|
| This option will defocus the display, blurring individual pixels like an extremely badly maintained monitor. Specify as X,Y values (e.g. **defocus 1,1**)
-|
+|
| **converge_x** (*Linear Convergence X, RGB*)
| **converge_y** (*Linear Convergence Y, RGB*)
| **radial_converge_x** (*Radial Convergence X, RGB*)
| **radial_converge_y** (*Radial Convergence Y, RGB*)
-|
+|
| Adjust the convergence of the red, green, and blue channels in a given direction. Many badly maintained monitors with bad convergence would bleed colored ghosting off-center of a sprite, and this simulates that.
-|
+|
| **red_ratio** (*Red Output from RGB*)
| **grn_ratio** (*Green Output from RGB*)
| **blu_ratio** (*Blue Output from RGB*)
-|
+|
| Defines a 3x3 matrix that is multiplied with the RGB signals to simulate color channel interference. For instance, a green channel of (0.100, 1.000, 0.250) is weakened 10% by the red channel and strengthened 25% through the blue channel.
-|
+|
| **offset** (*Signal Offset*)
-|
+|
| Strengthen or weakens the current color value of a given channel. For instance, a red signal of 0.5 with an offset of 0.2 will be raised to 0.7
-|
+|
| **scale** (*Signal Scale*)
-|
+|
| Applies scaling to the current color value of the channel. For instance, a red signal of 0.5 with a scale of 1.1 will result in a red signal of 0.55
-|
+|
| **power** (*Signal Exponent, RGB*)
-|
+|
| Exponentiate the current color value of the channel, also called gamma. For instance, a red signal of 0.5 with red power of 2 will result in a red signal of 0.25
-|
+|
| This setting also can be used to adjust line thickness in vector games.
-|
+|
| **floor** (*Signal Floor, RGB*)
-|
+|
| Sets the absolute minimum color value of a channel. For instance, a red signal of 0.0 (total absence of red) with a red floor of 0.2 will result in a red signal of 0.2
-|
+|
| Typically used in conjunction with artwork turned on to make the screen have a dim raster glow.
-|
+|
| **phosphor_life** (*Phosphor Persistence, RGB*)
-|
+|
| How long the color channel stays on the screen, also called phosphor ghosting. 0 gives absolutely no ghost effect, and 1 will leave a contrail behind that is only overwritten by a higher color value.
-|
+|
| This also affects vector games quite a bit.
-|
+|
| **saturation** (*Color Saturation*)
-|
+|
| Color saturation can be adjusted here.
-|
+|
| **bloom_blend_mode** (*Bloom Blend Mode*)
-|
+|
| Determines the mode of the bloom effect. Valid values are 0 for *Brighten* mode and 1 for *Darken* mode, last is only useful for systems with STN LCD.
-|
+|
| **bloom_scale** (*Bloom Scale*)
-|
+|
| Determines the intensity of bloom effect. Arcade CRT displays had a tendency towards bloom, where bright colors could bleed out into neighboring pixels. This effect is extremely graphics card intensive, and can be turned completely off to save GPU power by setting it to 0
-|
+|
| **bloom_overdrive** (*Bloom Overdrive, RGB*)
-|
+|
| Sets a RGB color, separated by commas, that has reached the brightest possible color and will be overdriven to white. This is only useful on color raster, color LCD, or color vector games.
-|
+|
| **bloom_lvl0_weight** (*Bloom Level 0 Scale*)
| **bloom_lvl1_weight** (*Bloom Level 1 Scale*)
| . . . .
| **bloom_lvl7_weight** (*Bloom Level 7 Scale*)
| **bloom_lvl8_weight** (*Bloom Level 8 Scale*)
-|
+|
| These define the bloom effect. Range is from 0.00 to 1.00. If used carefully in conjunction with phosphor_life, glowing/ghosting for moving objects can be achieved.
|
| **hlsl_write**
-|
+|
| Enables writing of an uncompressed AVI video with the HLSL effects included with set to *1*. This uses a massive amount of disk space very quickly, so a large HD with fast write speeds is highly recommended. Default is *0*, which is off.
|
| Suggested defaults for raster-based games:
-|
+|
+-------------------------------+-------------------------+------------------------------------+
| | bloom_lvl0_weight 1.00 | | Bloom level 0 weight | | Full-size target. |
@@ -301,7 +301,7 @@ In the Vector Post-Processing Options section:
Suggested settings for vector games:
* **bloom_scale** should typically be set higher for vector games than raster games. Try between 0.4 and 1.0 for best effect.
-* **bloom_overdrive** should only be used with color vector games.
+* **bloom_overdrive** should only be used with color vector games.
* **bloom_lvl_weights** should be set as follows:
diff --git a/docs/source/advanced/multiconfig.rst b/docs/source/advanced/multiconfig.rst
index 707d980d1fc..3424f1fb4ee 100644
--- a/docs/source/advanced/multiconfig.rst
+++ b/docs/source/advanced/multiconfig.rst
@@ -12,7 +12,7 @@ Order of Config Loading
2. **MAME.INI** (or other platform INI; e.g. **MESS.INI**) is parsed twice.
The first pass may change various path settings, so the second pass is done to see if there is a valid config file at that new location (and if so, change settings using that file)
3. **DEBUG.INI** if in debug mode.
- This is an advanced config file, most people won't need to use it or be concerned by it.
+ This is an advanced config file, most people won't need to use it or be concerned by it.
4. System-specific INI files where appropriate (e.g. **NEOGEO_NOSLOT.INI** or **CPS2.INI**)
As an example, Street Fighter Alpha is a CPS2 game, and so **CPS2.INI** would be loaded here.
5. Monitor orientation INI file (either **HORIZONT.INI** or **VERTICAL.INI**)
@@ -21,7 +21,7 @@ Order of Config Loading
Both Pac-Man and Street Fighter Alpha are arcade games, so **ARCADE.INI** would be loaded here. Atari 2600 would load **CONSOLE.INI**.
7. Screen-type INI file (**VECTOR.INI** for vector games, **RASTER.INI** for raster games, **LCD.INI** for LCD games)
Pac-Man and Street Fighter Alpha are raster, so **RASTER.INI** gets loaded here. Tempest is a vector monitor game, and **VECTOR.INI** would be loaded here.
-8. Source INI files.
+8. Source INI files.
This is an advanced config file, most people won't need to use it and it can be safely ignored.
MAME will attempt to load **SOURCE/SOURCEFILE.INI** and **SOURCEFILE.INI**, where sourcefile is the actual filename of the source code file.
*mame -listsource <game>* will show the source file for a given game.
diff --git a/docs/source/commandline/commandline-all.rst b/docs/source/commandline/commandline-all.rst
index 58aac635d41..2f6bb761eba 100644
--- a/docs/source/commandline/commandline-all.rst
+++ b/docs/source/commandline/commandline-all.rst
@@ -180,7 +180,7 @@ Example:
If slots are populated with devices, any additional slots those devices provide will be visible with **-listslots** as well. For instance, installing a floppy controller into a PC will expose the disk drive slots.
- The slot name (e.g. **ctrl1**) can be used from the command line (**-ctrl1** in this case)
+ The slot name (e.g. **ctrl1**) can be used from the command line (**-ctrl1** in this case)
.. _mame-commandline-listmedia:
@@ -539,13 +539,13 @@ Core State/Playback Options
**-snapname** *<name>*
- Describes how MAME should name files for snapshots. <name> is a string that provides a template that is used to generate a filename.
+ Describes how MAME should name files for snapshots. <name> is a string that 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 string %g represents the driver name of the current system; and the string %i represents an incrementing index. If %i is omitted, then each snapshot taken will overwrite the previous one; otherwise, MAME will find the next empty value for %i and use that for a filename.
The default is %g/%i, 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 %d_[media] indicator. Replace [media] with the media switch you want to use.
+ In addition to the above, for drivers using different media, like carts or floppy disks, you can also use the %d_[media] indicator. Replace [media] with the media switch you want to use.
A few examples: if you use 'mame robby -snapname foo/%g%i' snapshots will be saved as 'snaps\\foo\\robby0000.png' , 'snaps\\foo\\robby0001.png' and so on; if you use 'mame nes -cart robby -snapname %g/%d_cart' snapshots will be saved as 'snaps\\nes\\robby.png' ; if you use 'mame c64 -flop1 robby -snapname %g/%d_flop1/%i' snapshots will be saved as 'snaps\\c64\\robby\\0000.png'.
@@ -579,7 +579,7 @@ Core State/Playback Options
The default is %g, which creates a separate folder for each system.
- In addition to the above, for drivers using different media, like carts or floppy disks, you can also use the %d_[media] indicator. Replace [media] with the media switch you want to use.
+ In addition to the above, for drivers using different media, like carts or floppy disks, you can also use the %d_[media] indicator. Replace [media] with the media switch you want to use.
A few examples: if you use 'mame robby -statename foo/%g' save states will be stored inside 'sta\\foo\\robby\\' ; if you use 'mame nes -cart robby -statename %g/%d_cart' save states will be stored inside 'sta\\nes\\robby\\' ; if you use 'mame c64 -flop1 robby -statename %g/%d_flop1' save states will be stored inside 'sta\\c64\\robby\\'.
@@ -671,7 +671,7 @@ Core Rotation Options
| **-[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). The default for both of these options is OFF (*-noror -norol*).
|
@@ -684,7 +684,7 @@ Core Rotation Options
| **-[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**.
|
@@ -697,7 +697,7 @@ Core Rotation Options
| **-[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. The default for both of these options is OFF (*-noflipx -noflipy*).
|
@@ -825,7 +825,7 @@ NOTE: **Multiple Screens may fail to work correctly on some Mac machines as of
|
| Specifies which physical monitor on your system you wish to have each window use by default. In order to use multiple windows, you must have increased the value of the **-numscreens** option. The name of each display in your system can be determined by running MAME with the -verbose option. The display names are typically in the format of: *\\\\.\\DISPLAYn*, where 'n' is a number from 1 to the number of connected monitors. The default value for these options is '*auto*', which means that the first window is placed on the first display, the second window on the second display, etc.
|
-| The **-screen0**, **-screen1**, **-screen2**, **-screen3** parameters apply to the specific window. The **-screen** parameter applies to all windows. The window-specific options override values from the all window option.
+| The **-screen0**, **-screen1**, **-screen2**, **-screen3** parameters apply to the specific window. The **-screen** parameter applies to all windows. The window-specific options override values from the all window option.
|
|
@@ -1184,7 +1184,7 @@ Core Input Options
+-------------------------------------------------------------------------------------------+
| 777888999.777888999.777888999.444555666.444555666.444555666.111222333.111222333.111222333 |
+-------------------------------------------------------------------------------------------+
-
+
However, this can be reduced using several shorthands supported by the <map> parameter. If information about a row is missing, then it is assumed that any missing data in columns 5-9 are left/right symmetric with data in columns 0-4; and any missing data in columns 0-4 is assumed to be copies of the previous data. The same logic applies to missing rows, except that up/down symmetry is assumed.
By using these shorthands, the 81 character map can be simply specified by this 11 character string: 7778...4445
@@ -1446,7 +1446,7 @@ Core Misc Options
**-autoboot_command** *"<command>"*
- Command string to execute after machine boot (in quotes " "). To issue a quote to the emulation, use """ in the string. Using **\\n** will issue a create a new line, issuing what was typed prior as a command.
+ Command string to execute after machine boot (in quotes " "). To issue a quote to the emulation, use """ in the string. Using **\\n** will issue a create a new line, issuing what was typed prior as a command.
Example: -autoboot_command "load """$""",8,1\\n"
diff --git a/docs/source/debugger/breakpoint.rst b/docs/source/debugger/breakpoint.rst
index a87530f6953..7dede5475be 100644
--- a/docs/source/debugger/breakpoint.rst
+++ b/docs/source/debugger/breakpoint.rst
@@ -20,8 +20,8 @@ bpset
| **bp[set] <address>[,<condition>[,<action>]]**
|
-| Sets a new execution breakpoint at the specified <address>.
-| The optional <condition> parameter lets you specify an expression that will be evaluated each time the breakpoint is hit. If the result of the expression is true (non-zero), the breakpoint will actually halt execution; otherwise, execution will continue with no notification.
+| Sets a new execution breakpoint at the specified <address>.
+| The optional <condition> parameter lets you specify an expression that will be evaluated each time the breakpoint is hit. If the result of the expression is true (non-zero), the breakpoint will actually halt execution; otherwise, execution will continue with no notification.
| The optional <action> parameter provides a command that is executed whenever the breakpoint 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 bpset command itself. Each breakpoint that is set is assigned an index which can be used in other breakpoint commands to reference this breakpoint.
|
| Examples:
diff --git a/docs/source/debugger/execution.rst b/docs/source/debugger/execution.rst
index dc8a52abd43..fd2cc597f26 100644
--- a/docs/source/debugger/execution.rst
+++ b/docs/source/debugger/execution.rst
@@ -156,7 +156,7 @@ gtime
-----
| **gt[ime] <milliseconds>**
-|
+|
| The gtime command resumes execution of the current code. Control will not be returned to the debugger until a specified delay has elapsed. The delay is in milliseconds.
|
| Example:
@@ -186,7 +186,7 @@ focus
-----
| **focus <cpu>**
-|
+|
| Sets the debugger focus exclusively to the given <cpu>. This is equivalent to specifying 'ignore' on all other CPUs.
|
| Example:
@@ -257,13 +257,13 @@ trace
| **trace {<filename>|OFF}[,<cpu>[,[noloop|logerror][,<action>]]]**
|
-| Starts or stops tracing of the execution of the specified <cpu>. If <cpu> is omitted, the currently active CPU is specified.
+| Starts or stops tracing of the execution of the specified <cpu>. If <cpu> is omitted, the currently active CPU is specified.
|
| When enabling tracing, specify the filename in the <filename> parameter. To disable tracing, substitute the keyword 'off' for <filename>.
|
-| <detectloops> should be either true or false.
+| <detectloops> should be either true or false.
|
-| If 'noloop' is omitted, the trace will have loops detected and condensed to a single line. If 'noloop' is specified, the trace will contain every opcode as it is executed.
+| If 'noloop' is omitted, the trace will have loops detected and condensed to a single line. If 'noloop' is specified, the trace will contain every opcode as it is executed.
|
| If 'logerror' is specified, logerror output will augment the trace. If you wish to log additional information on each trace, you can append an <action> parameter which is a command that is executed before each trace is logged. Generally, this is used to include a 'tracelog' command. 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 trace command itself.
|
@@ -314,9 +314,9 @@ traceover
|
| Starts or stops tracing of the execution of the specified <cpu>.
|
-| When tracing reaches a subroutine or call, tracing will skip over the subroutine. The same algorithm is used as is used in the step over command. This means that traceover will not work properly when calls are recursive or the return address is not immediately following the call instruction.
+| When tracing reaches a subroutine or call, tracing will skip over the subroutine. The same algorithm is used as is used in the step over command. This means that traceover will not work properly when calls are recursive or the return address is not immediately following the call instruction.
|
-| <detectloops> should be either true or false. If <detectloops> is *true or omitted*, the trace will have loops detected and condensed to a single line. If it is false, the trace will contain every opcode as it is executed.
+| <detectloops> should be either true or false. If <detectloops> is *true or omitted*, the trace will have loops detected and condensed to a single line. If it is false, the trace will contain every opcode as it is executed.
| If <cpu> is omitted, the currently active CPU is specified.
| When enabling tracing, specify the filename in the <filename> parameter.
| To disable tracing, substitute the keyword 'off' for <filename>.
diff --git a/docs/source/debugger/general.rst b/docs/source/debugger/general.rst
index 79698938e49..752ec677841 100644
--- a/docs/source/debugger/general.rst
+++ b/docs/source/debugger/general.rst
@@ -33,11 +33,11 @@ do
--
| **do <expression>**
-|
+|
| The do command simply evaluates the given <expression>. This is typically used to set or modify variables.
-|
+|
| Examples:
-|
+|
| do pc = 0
|
| Sets the register 'pc' to 0.
@@ -50,7 +50,7 @@ symlist
-------
| **symlist [<cpu>]**
-|
+|
| Lists registered symbols. If <cpu> is not specified, then symbols in the global symbol table are displayed; otherwise, the symbols for <cpu>'s specific CPU are displayed. Symbols are listed alphabetically. Read-only symbols are flagged with an asterisk.
|
| Examples:
@@ -67,7 +67,7 @@ symlist
.. _debugger-command-softreset:
-
+
softreset
---------
@@ -85,7 +85,7 @@ softreset
.. _debugger-command-hardreset:
-
+
hardreset
---------
@@ -125,7 +125,7 @@ print
.. _debugger-command-printf:
-
+
printf
------
@@ -152,7 +152,7 @@ printf
.. _debugger-command-logerror:
-
+
logerror
--------
@@ -285,7 +285,7 @@ pcatmem
.. _debugger-command-rewind:
-
+
rewind
------
diff --git a/docs/source/debugger/memory.rst b/docs/source/debugger/memory.rst
index addbaf23dbe..7f9414e085f 100644
--- a/docs/source/debugger/memory.rst
+++ b/docs/source/debugger/memory.rst
@@ -71,11 +71,11 @@ dump
| **dump[{d|i}] <filename>,<address>,<length>[,<size>[,<ascii>[,<cpu>]]]**
|
-| The **dump**/**dumpd**/**dumpi** commands dump memory to the text file specified in the <filename> parameter.
+| The **dump**/**dumpd**/**dumpi** commands dump memory to the text file specified in the <filename> parameter.
| 'dump' will dump program space memory, while 'dumpd' will dump data space memory and 'dumpi' will dump I/O space memory.
-| <address> indicates the address of the start of dumping, and <length> indicates how much memory to dump. The range <address> through <address>+<length>-1 inclusive will be output to the file.
+| <address> indicates the address of the start of dumping, and <length> indicates how much memory to dump. The range <address> through <address>+<length>-1 inclusive will be output to the file.
| By default, the data will be output in byte format, unless the underlying address space is word/dword/qword-only. You can override this by specifying the <size> parameter, which can be used to group the data in 1, 2, 4 or 8-byte chunks.
-| The optional <ascii> parameter can be used to enable (1) or disable (0) the output of ASCII characters to the right of each line; by default, this is enabled.
+| The optional <ascii> parameter can be used to enable (1) or disable (0) the output of ASCII characters to the right of each line; by default, this is enabled.
| Finally, you can dump memory from another CPU by specifying the <cpu> parameter.
|
|
@@ -101,7 +101,7 @@ save
|
| The **save**/**saved**/**savei** commands save raw memory to the binary file specified in the <filename> parameter.
| 'save' will save program space memory, while 'saved' will save data space memory and 'savei' will save I/O space memory.
-| <address> indicates the address of the start of saving, and <length> indicates how much memory to save. The range <address> through <address>+<length>-1 inclusive will be output to the file.
+| <address> indicates the address of the start of saving, and <length> indicates how much memory to save. The range <address> through <address>+<length>-1 inclusive will be output to the file.
| You can also save memory from another CPU by specifying the <cpu> parameter.
|
|
@@ -125,10 +125,10 @@ load
| **load[{d|i}] <filename>,<address>[,<length>,<cpu>]**
|
-| The **load**/**loadd**/**loadi** commands load raw memory from the binary file specified in the <filename> parameter.
-| 'load' will load program space memory, while 'loadd' will load data space memory and 'loadi' will load I/O space memory.
-| <address> indicates the address of the start of saving, and <length> indicates how much memory to load. The range <address> through <address>+<length>-1 inclusive will be read in from the file.
-| If you specify <length> = 0 or a length greater than the total length of the file it will load the entire contents of the file and no more.
+| The **load**/**loadd**/**loadi** commands load raw memory from the binary file specified in the <filename> parameter.
+| 'load' will load program space memory, while 'loadd' will load data space memory and 'loadi' will load I/O space memory.
+| <address> indicates the address of the start of saving, and <length> indicates how much memory to load. The range <address> through <address>+<length>-1 inclusive will be read in from the file.
+| If you specify <length> = 0 or a length greater than the total length of the file it will load the entire contents of the file and no more.
| You can also load memory from another CPU by specifying the <cpu> parameter.
|
| NOTE: This will only actually write memory that is possible to overwrite in the Memory Window
@@ -154,7 +154,7 @@ map
| **map[{d|i}] <address>**
|
-| The map/mapd/mapi commands map a logical address in memory to the correct physical address, as well as specifying the bank.
+| The map/mapd/mapi commands map a logical address in memory to the correct physical address, as well as specifying the bank.
| 'map' will map program space memory, while 'mapd' will map data space memory and 'mapi' will map I/O space memory.
|
| Example:
diff --git a/docs/source/debugger/watchpoint.rst b/docs/source/debugger/watchpoint.rst
index 22a0d8e7c92..f80fa152197 100644
--- a/docs/source/debugger/watchpoint.rst
+++ b/docs/source/debugger/watchpoint.rst
@@ -19,12 +19,12 @@ wpset
| **wp[{d|i}][set] <address>,<length>,<type>[,<condition>[,<action>]]**
|
-| Sets a new watchpoint starting at the specified <address> and extending for <length>. The inclusive range of the watchpoint is <address> through <address> + <length> - 1.
+| Sets a new watchpoint starting at the specified <address> and extending for <length>. The inclusive range of the watchpoint is <address> through <address> + <length> - 1.
| The 'wpset' command sets a watchpoint on program memory; the 'wpdset' command sets a watchpoint on data memory; and the 'wpiset' sets a watchpoint on I/O memory.
| The <type> parameter specifies which sort of accesses to trap on. It can be one of three values: 'r' for a read watchpoint 'w' for a write watchpoint, and 'rw' for a read/write watchpoint.
|
-| The optional <condition> parameter lets you specify an expression that will be evaluated each time the watchpoint is hit. If the result of the expression is true (non-zero), the watchpoint will actually halt execution; otherwise, execution will continue with no notification.
-| The optional <action> parameter provides a command that is executed whenever the watchpoint 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 wpset command itself.
+| The optional <condition> parameter lets you specify an expression that will be evaluated each time the watchpoint is hit. If the result of the expression is true (non-zero), the watchpoint will actually halt execution; otherwise, execution will continue with no notification.
+| The optional <action> parameter provides a command that is executed whenever the watchpoint 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 wpset command itself.
| Each watchpoint that is set is assigned an index which can be used in other watchpoint commands to reference this watchpoint.
| In order to help <condition> expressions, two variables are available. For all watchpoints, the variable 'wpaddr' is set to the address that actually triggered the watchpoint. For write watchpoints, the variable 'wpdata' is set to the data that is being written.
|
diff --git a/docs/source/index.rst b/docs/source/index.rst
index 4d31c42c873..1cee5d6f714 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -10,7 +10,7 @@ MAME Documentation
.. toctree::
:titlesonly:
-
+
whatis
initialsetup/index
diff --git a/docs/source/initialsetup/compilingmame.rst b/docs/source/initialsetup/compilingmame.rst
index 847b66b7072..f306e58eb2f 100644
--- a/docs/source/initialsetup/compilingmame.rst
+++ b/docs/source/initialsetup/compilingmame.rst
@@ -48,7 +48,7 @@ Fedora Linux
You'll need a few prerequisites from your distro. Make sure you get SDL2 2.0.3 or 2.0.4 as earlier versions are buggy.
-**sudo dnf install gcc gcc-c++ SDL2-devel SDL2_ttf-devel libXinerama-devel qt5-qtbase-devel qt5-qttools expat-devel fontconfig-devel alsa-lib-devel**
+**sudo dnf install gcc gcc-c++ SDL2-devel SDL2_ttf-devel libXinerama-devel qt5-qtbase-devel qt5-qttools expat-devel fontconfig-devel alsa-lib-devel**
Compilation is exactly as described above in All Platforms.
diff --git a/docs/source/techspecs/device_rom_interface.rst b/docs/source/techspecs/device_rom_interface.rst
index 3a40590fc01..576800e634a 100644
--- a/docs/source/techspecs/device_rom_interface.rst
+++ b/docs/source/techspecs/device_rom_interface.rst
@@ -46,7 +46,7 @@ present in the machine config.
| void **set_rom_addr_width**\ (u8 width)
These methods, intended for generic devices with indefinite hardware
-specifications, override the endianness, data bus width and address
+specifications, override the endianness, data bus width and address
bus width assigned through the constructor. They must be called from
within the device before **config_complete** time.
diff --git a/docs/source/techspecs/luaengine.rst b/docs/source/techspecs/luaengine.rst
index 8d148b5197f..fa1c04cdb10 100644
--- a/docs/source/techspecs/luaengine.rst
+++ b/docs/source/techspecs/luaengine.rst
@@ -55,11 +55,11 @@ Let's first run MAME in a terminal to reach the LUA console:
_/ _/ _/ _/ _/ _/ _/_/_/_/
mame v0.195
Copyright (C) Nicola Salmoria and the MAME team
-
+
Lua 5.3
Copyright (C) Lua.org, PUC-Rio
- [MAME]>
+ [MAME]>
At this point, your game is probably running in demo mode, let's pause it:
@@ -153,6 +153,6 @@ On some of them, you can also inspect and manipulate memory and state:
[MAME]> -- inspect memory
[MAME]> for k,v in pairs(cpu.spaces) do print(k) end
program
- [MAME]> mem = cpu.spaces["program"]
+ [MAME]> mem = cpu.spaces["program"]
[MAME]> print(mem:read_i8(0xC000))
41
diff --git a/docs/source/techspecs/m6502.rst b/docs/source/techspecs/m6502.rst
index dbc7a0a02a5..c4cb45f5cea 100644
--- a/docs/source/techspecs/m6502.rst
+++ b/docs/source/techspecs/m6502.rst
@@ -21,7 +21,7 @@ The 6502 family
The MOS 6502 family has been large and productive. A large number of variants exist, varying on bus sizes, I/O, and even opcodes. Some offshots (g65c816, hu6280) even exist that live elsewhere in the mame tree. The final class hierarchy is this:
::
-
+
6502
|
+------+--------+--+--+-------+-------+
@@ -35,8 +35,8 @@ The MOS 6502 family has been large and productive. A large number of variants ex
65ce02 65sc02
|
4510
-
-
+
+
The 6510 adds an up to 8 bits I/O port, with the 6510t, 7501 and 8502 being software-identical variants with different pin count (hence I/O count), die process (NMOS, HNMOS, etc) and clock support.
@@ -181,7 +181,7 @@ The generated code
A code generator is used to support interrupting and restarting an instruction in the middle. This is done through a two-level state machine with updates only at the boundaries. More precisely, inst_state tells you which main state you're in. It's equal to the opcode byte when 0-255, and 0xff00 means reset. It's always valid and used by instructions like rmb. inst_substate indicates at which step we are in an instruction, but it set only when an instruction has been interrupted. Let's go back to the asl <abs> code:
-|
+|
| asl_aba
| TMP = read_pc();
| TMP = set_h(TMP, read_pc());
@@ -190,7 +190,7 @@ A code generator is used to support interrupting and restarting an instruction i
| TMP2 = do_asl(TMP2);
| write(TMP, TMP2);
| prefetch();
-|
+|
The complete generated code is:
@@ -226,11 +226,11 @@ The complete generated code is:
| }
| inst_substate = 0;
| }
-|
+|
One can see that the initial switch() restarts the instruction at the appropriate substate, that icount is updated after each access, and upon reaching 0 the instruction is interrupted and the substate updated. Since most instructions are started from the beginning a specific variant is generated for when inst_substate is known to be 0:
-|
+|
| void m6502_device::asl_aba_full()
| {
| if(icount == 0) { inst_substate = 1; return; }
@@ -253,7 +253,7 @@ One can see that the initial switch() restarts the instruction at the appropriat
| prefetch();
| icount--;
| }
-|
+|
That variant removes the switch, avoiding a costly computed branch and also an inst_substate write. There is in addition a fair chance that the decrement-test with zero pair is compiled into something efficient.
@@ -265,7 +265,7 @@ The execute main call ends up very simple:
| {
| if(inst_substate)
| do_exec_partial();
-|
+|
| while(icount > 0) {
| if(inst_state < 0x100) {
| PPC = NPC;
@@ -342,10 +342,10 @@ A modern try/catch costs nothing if an exception is not thrown. Using this the c
| icount -= waiting_cycles;
| waiting_cycles = 0;
| }
-|
+|
| if(icount > 0 && inst_substate)
| do_exec_partial();
-|
+|
| while(icount > 0) {
| if(inst_state < 0x100) {
| PPC = NPC;
@@ -355,7 +355,7 @@ A modern try/catch costs nothing if an exception is not thrown. Using this the c
| }
| do_exec_full();
| }
-|
+|
| waiting_cycles = -icount;
| icount = 0;
| }
diff --git a/docs/source/usingmame/defaultkeys.rst b/docs/source/usingmame/defaultkeys.rst
index dabfb6c5474..73bcb1c12fe 100644
--- a/docs/source/usingmame/defaultkeys.rst
+++ b/docs/source/usingmame/defaultkeys.rst
@@ -12,7 +12,7 @@ All the keys below are fully configurable in the user interface. This list shows
**Tab** | Toggles the configuration menu.
**~** | Toggles the On Screen Display. When the on-screen display is
| visible, you can use the following keys to control it:
- |
+ |
| * **Up** - select previous parameter to modify
| * **Down** - select next parameter to modify
| * **Left** - decrease the value of the selected parameter
@@ -24,29 +24,29 @@ All the keys below are fully configurable in the user interface. This list shows
| * **Control+Right** - increase the value by 10x
| * **Shift+Right** - increase the value by 0.1x
| * **Alt+Right** - increase the value by the smallest amount
- |
+ |
| If you are running with -debug, this key sends a 'break' in emulation.
**P** | Pauses the game.
**Shift+P** | While paused, advances to next frame. If rewind is enabled, a new rewind save state is also captured.
**Shift+~** | While paused, loads the most recent rewind save state.
**F2** | Service Mode for games that support it.
**F3** | Resets the game.
-**Shift+F3** | Performs a "hard reset", which tears everything down and re-creates it
+**Shift+F3** | Performs a "hard reset", which tears everything down and re-creates it
| from scratch. This is a more thorough and complete reset than the reset
| you get from hitting F3.
**LCtrl+F3** | [SDL ONLY] - Toggle uneven stretch.
**F4** | Shows the game palette, decoded GFX, and any tilemaps. Use the Enter key to
| switch between the three modes (palette, graphics, and tilemaps). Press F4
| again to turn off the display. The key controls in each mode vary slightly:
- |
+ |
| Palette/colortable mode:
- | * **[ ]** - switch between palette and colortable modes
+ | * **[ ]** - switch between palette and colortable modes
| * **Up/Down** - scroll up/down one line at a time
| * **Page Up/Page Down** - scroll up/down one page at a time
| * **Home/End** - move to top/bottom of list
| * **-/+** - increase/decrease the number of colors per row
| * **Enter** - switch to graphics viewer
- |
+ |
| Graphics mode:
| * **[ ]** - switch between different graphics sets
| * **Up/Down** - scroll up/down one line at a time
@@ -56,7 +56,7 @@ All the keys below are fully configurable in the user interface. This list shows
| * **R** - rotate tiles 90 degrees clockwise
| * **-/+** - increase/decrease the number of tiles per row
| * **Enter** - switch to tilemap viewer
- |
+ |
| Tilemap mode:
| * **[ ]** - switch between different tilemaps
| * **Up/Down/Left/Right** - scroll 8 pixels at a time
@@ -65,7 +65,7 @@ All the keys below are fully configurable in the user interface. This list shows
| * **R** - rotate tilemap view 90 degrees clockwise
| * **-/+** - increase/decrease the zoom factor
| * **Enter** - switch to palette/colortable mode
- |
+ |
| Note: Not all games have decoded graphics and/or tilemaps.
**LCtrl+F4** | [*SDL ONLY*] - Toggles keeping aspect ratio.
**LCtrl+F5** | [*SDL ONLY*] - Toggle Filter.
@@ -73,10 +73,10 @@ All the keys below are fully configurable in the user interface. This list shows
**F6** | Toggle cheat mode (if started with "-cheat").
**LCtrl+F6** | Decrease Prescaling.
**F7** | Load a save state. You will be requested to press a key to determine which
- | save state you wish to load.
+ | save state you wish to load.
|
| *Note that the save state feature is not supported for a large number of*
- | *drivers. If support is not enabled for a given driver, you will receive*
+ | *drivers. If support is not enabled for a given driver, you will receive*
| *a warning when attempting to save or load.*
**LCtrl+F7** | Increase Prescaling.
**Shift+F7** | Create a save state. Requires an additional keypress to identify the state,
@@ -89,12 +89,12 @@ All the keys below are fully configurable in the user interface. This list shows
**Alt+F11** | Record HLSL Rendered Video.
**F12** | Saves a screen snapshot.
**Alt+F12** | Take HLSL Rendered Snapshot.
-**Insert** | [*WINDOW ONLY, NON-SDL*] Fast forward. While held, runs game with
+**Insert** | [*WINDOW ONLY, NON-SDL*] Fast forward. While held, runs game with
| throttling disabled and with the maximum frameskip.
-**Page DN** | [*SDL ONLY*] Fast forward. While held, runs the game with throttling
+**Page DN** | [*SDL ONLY*] Fast forward. While held, runs the game with throttling
| disabled and with the maximum frameskip.
**Alt+ENTER** | Toggles between full-screen and windowed mode.
-**Scroll Lock** | Default mapping for the **uimodekey**.
+**Scroll Lock** | Default mapping for the **uimodekey**.
|
| This key allows users to disable and enable the emulated keyboard
| in machines that require it. All emulations which require emulated
diff --git a/docs/source/usingmame/usingmame.rst b/docs/source/usingmame/usingmame.rst
index 2050ae5e499..4163158aba6 100644
--- a/docs/source/usingmame/usingmame.rst
+++ b/docs/source/usingmame/usingmame.rst
@@ -66,7 +66,7 @@ gives you a (quite long) list of available configuration options for MAME. These
creates a brand new **mame.ini** file, with default configuration settings. Notice that mame.ini is basically a plain text file, hence you can open it with any text editor (e.g. Notepad, Emacs or TextEdit) and configure every option you need. However, no particular tweaks are needed to start, so you can basically leave most of the options unaltered.
-If you execute **mame64 -createconfig** when you already have an existing mame.ini from a previous MAME version, MAME automatically updates the pre-existing mame.ini by copying changed options into it.
+If you execute **mame64 -createconfig** when you already have an existing mame.ini from a previous MAME version, MAME automatically updates the pre-existing mame.ini by copying changed options into it.
Once you are more confident with MAME options, you may want to configure a bit more your setup. In this case, keep in mind the order in which options are read; see :ref:`advanced-multi-CFG` for details.
diff --git a/scripts/build/complay.py b/scripts/build/complay.py
index 8ac24bb005a..f6e7db4320e 100644
--- a/scripts/build/complay.py
+++ b/scripts/build/complay.py
@@ -274,6 +274,7 @@ class LayoutChecker(Minifyer):
except:
self.handleError('Element mamelayout attribute version "%s" is not an integer' % (attrs['version'], ))
self.variable_scopes.append({ })
+ self.repeat_depth.append(0)
self.handlers.append((self.layoutStartHandler, self.layoutEndHandler))
def rootEndHandler(self, name, attrs):
@@ -284,18 +285,24 @@ class LayoutChecker(Minifyer):
if 'name' not in attrs:
self.handleError('Element element missing attribute name')
else:
+ generated_name = self.VARPATTERN.match(attrs['name'])
+ if generated_name:
+ self.generated_element_names = True
if attrs['name'] not in self.elements:
self.elements[attrs['name']] = self.formatLocation()
- elif not self.VARPATTERN.match(attrs['name']):
+ elif not generated_name:
self.handleError('Element element has duplicate name (previous %s)' % (self.elements[attrs['name']], ))
self.handlers.append((self.elementStartHandler, self.elementEndHandler))
elif 'group' == name:
if 'name' not in attrs:
self.handleError('Element group missing attribute name')
else:
+ generated_name = self.VARPATTERN.match(attrs['name'])
+ if generated_name:
+ self.generated_group_names = True
if attrs['name'] not in self.groups:
self.groups[attrs['name']] = self.formatLocation()
- elif not self.VARPATTERN.match(attrs['name']):
+ elif not generated_name:
self.handleError('Element group has duplicate name (previous %s)' % (self.groups[attrs['name']], ))
self.handlers.append((self.groupViewStartHandler, self.groupViewEndHandler))
self.variable_scopes.append({ })
@@ -313,6 +320,15 @@ class LayoutChecker(Minifyer):
self.variable_scopes.append({ })
self.repeat_depth.append(0)
self.have_bounds.append(False)
+ elif 'repeat' == name:
+ if 'count' not in attrs:
+ self.handleError('Element repeat missing attribute count')
+ else:
+ count = self.checkIntAttribute(name, attrs, 'count', None)
+ if (count is not None) and (0 >= count):
+ self.handleError('Element repeat attribute count "%s" is negative' % (attrs['count'], ))
+ self.variable_scopes.append({ })
+ self.repeat_depth[-1] += 1
elif 'param' == name:
self.checkParameter(attrs)
self.ignored_depth = 1
@@ -323,14 +339,19 @@ class LayoutChecker(Minifyer):
self.ignored_depth = 1
def layoutEndHandler(self, name):
- for element in self.referenced_elements:
- if (element not in self.elements) and (not self.VARPATTERN.match(element)):
- self.handleError('Element "%s" not found (first referenced at %s)' % (element, self.referenced_elements[element]))
- for group in self.referenced_groups:
- if (group not in self.groups) and (not self.VARPATTERN.match(group)):
- self.handleError('Group "%s" not found (first referenced at %s)' % (group, self.referenced_groups[group]))
self.variable_scopes.pop()
- self.handlers.pop()
+ if self.repeat_depth[-1]:
+ self.repeat_depth[-1] -= 1
+ else:
+ if not self.generated_element_names:
+ for element in self.referenced_elements:
+ if (element not in self.elements) and (not self.VARPATTERN.match(element)):
+ self.handleError('Element "%s" not found (first referenced at %s)' % (element, self.referenced_elements[element]))
+ if not self.generated_group_names:
+ for group in self.referenced_groups:
+ if (group not in self.groups) and (not self.VARPATTERN.match(group)):
+ self.handleError('Group "%s" not found (first referenced at %s)' % (group, self.referenced_groups[group]))
+ self.handlers.pop()
def elementStartHandler(self, name, attrs):
if name in self.SHAPES:
@@ -456,6 +477,8 @@ class LayoutChecker(Minifyer):
self.repeat_depth = [ ]
self.have_bounds = [ ]
self.have_color = [ ]
+ self.generated_element_names = False
+ self.generated_group_names = False
super(LayoutChecker, self).startDocument()
def endDocument(self):
@@ -471,6 +494,8 @@ class LayoutChecker(Minifyer):
del self.repeat_depth
del self.have_bounds
del self.have_color
+ del self.generated_element_names
+ del self.generated_group_names
super(LayoutChecker, self).endDocument()
def startElement(self, name, attrs):
diff --git a/src/emu/render.h b/src/emu/render.h
index e07e7e7cad7..387b4fc141d 100644
--- a/src/emu/render.h
+++ b/src/emu/render.h
@@ -932,6 +932,17 @@ public:
view_list const &views() const { return m_viewlist; }
private:
+ using environment = emu::render::detail::layout_environment;
+
+ // add elements and parameters
+ void add_elements(
+ char const *dirname,
+ environment &env,
+ util::xml::data_node const &parentnode,
+ group_map &groupmap,
+ bool repeat,
+ bool init);
+
// internal state
element_map m_elemmap; // list of shared layout elements
view_list m_viewlist; // list of views
diff --git a/src/emu/rendlay.cpp b/src/emu/rendlay.cpp
index e23d8308f96..896391b264e 100644
--- a/src/emu/rendlay.cpp
+++ b/src/emu/rendlay.cpp
@@ -3356,13 +3356,14 @@ void layout_view::item::resolve_tags()
// layout_file - constructor
//-------------------------------------------------
-layout_file::layout_file(device_t &device, util::xml::data_node const &rootnode, const char *dirname)
+layout_file::layout_file(device_t &device, util::xml::data_node const &rootnode, char const *dirname)
: m_elemmap()
, m_viewlist()
{
- emu::render::detail::layout_environment env(device);
try
{
+ environment env(device);
+
// find the layout node
util::xml::data_node const *const mamelayoutnode = rootnode.get_child("mamelayout");
if (!mamelayoutnode)
@@ -3373,30 +3374,9 @@ layout_file::layout_file(device_t &device, util::xml::data_node const &rootnode,
if (version != LAYOUT_VERSION)
throw layout_syntax_error(util::string_format("unsupported version %d", version));
- // parse all the parameters
- for (util::xml::data_node const *elemnode = mamelayoutnode->get_child("param") ; elemnode; elemnode = elemnode->get_next_sibling("param"))
- env.set_parameter(*elemnode);
-
- // parse all the elements
- for (util::xml::data_node const *elemnode = mamelayoutnode->get_child("element"); elemnode; elemnode = elemnode->get_next_sibling("element"))
- {
- char const *const name(env.get_attribute_string(*elemnode, "name", nullptr));
- if (!name)
- throw layout_syntax_error("element lacks name attribute");
- if (!m_elemmap.emplace(std::piecewise_construct, std::forward_as_tuple(name), std::forward_as_tuple(env, *elemnode, dirname)).second)
- throw layout_syntax_error(util::string_format("duplicate element name %s", name));
- }
-
- // parse all the groups
+ // parse all the parameters, elements and groups
group_map groupmap;
- for (util::xml::data_node const *groupnode = mamelayoutnode->get_child("group"); groupnode; groupnode = groupnode->get_next_sibling("group"))
- {
- char const *const name(env.get_attribute_string(*groupnode, "name", nullptr));
- if (!name)
- throw layout_syntax_error("group lacks name attribute");
- if (!groupmap.emplace(std::piecewise_construct, std::forward_as_tuple(name), std::forward_as_tuple(*groupnode)).second)
- throw layout_syntax_error(util::string_format("duplicate group name %s", name));
- }
+ add_elements(dirname, env, *mamelayoutnode, groupmap, false, true);
// parse all the views
for (util::xml::data_node const *viewnode = mamelayoutnode->get_child("view"); viewnode != nullptr; viewnode = viewnode->get_next_sibling("view"))
@@ -3430,3 +3410,56 @@ layout_file::layout_file(device_t &device, util::xml::data_node const &rootnode,
layout_file::~layout_file()
{
}
+
+
+void layout_file::add_elements(
+ char const *dirname,
+ environment &env,
+ util::xml::data_node const &parentnode,
+ group_map &groupmap,
+ bool repeat,
+ bool init)
+{
+ for (util::xml::data_node const *childnode = parentnode.get_first_child(); childnode; childnode = childnode->get_next_sibling())
+ {
+ if (!strcmp(childnode->get_name(), "param"))
+ {
+ if (!repeat)
+ env.set_parameter(*childnode);
+ else
+ env.set_repeat_parameter(*childnode, init);
+ }
+ else if (!strcmp(childnode->get_name(), "element"))
+ {
+ char const *const name(env.get_attribute_string(*childnode, "name", nullptr));
+ if (!name)
+ throw layout_syntax_error("element lacks name attribute");
+ if (!m_elemmap.emplace(std::piecewise_construct, std::forward_as_tuple(name), std::forward_as_tuple(env, *childnode, dirname)).second)
+ throw layout_syntax_error(util::string_format("duplicate element name %s", name));
+ }
+ else if (!strcmp(childnode->get_name(), "group"))
+ {
+ char const *const name(env.get_attribute_string(*childnode, "name", nullptr));
+ if (!name)
+ throw layout_syntax_error("group lacks name attribute");
+ if (!groupmap.emplace(std::piecewise_construct, std::forward_as_tuple(name), std::forward_as_tuple(*childnode)).second)
+ throw layout_syntax_error(util::string_format("duplicate group name %s", name));
+ }
+ else if (!strcmp(childnode->get_name(), "repeat"))
+ {
+ int const count(env.get_attribute_int(*childnode, "count", -1));
+ if (0 >= count)
+ throw layout_syntax_error("repeat must have positive integer count attribute");
+ environment local(env);
+ for (int i = 0; count > i; ++i)
+ {
+ add_elements(dirname, local, *childnode, groupmap, true, !i);
+ local.increment_parameters();
+ }
+ }
+ else if (repeat || (strcmp(childnode->get_name(), "view") && strcmp(childnode->get_name(), "script")))
+ {
+ throw layout_syntax_error(util::string_format("unknown layout item %s", childnode->get_name()));
+ }
+ }
+}
diff --git a/src/mame/layout/intlc44.lay b/src/mame/layout/intlc44.lay
index 5f64a31bd6e..55502dafa78 100644
--- a/src/mame/layout/intlc44.lay
+++ b/src/mame/layout/intlc44.lay
@@ -41,18 +41,12 @@ Intel INTELLEC® 4/MOD 40 layout
</rect>
</element>
- <element name="label_0"><text string="0"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="label_1"><text string="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="label_2"><text string="2"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="label_3"><text string="3"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="label_4"><text string="4"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="label_5"><text string="5"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="label_6"><text string="6"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="label_7"><text string="7"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="label_8"><text string="8"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="label_9"><text string="9"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="label_10"><text string="10"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="label_11"><text string="11"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <repeat count="12">
+ <param name="labelnum" start="0" increment="1" />
+ <element name="label_~labelnum~">
+ <text string="~labelnum~"><color red="1.0" green="1.0" blue="1.0" /></text>
+ </element>
+ </repeat>
<element name="label_a1"><text string="A1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="label_a2"><text string="A2"><color red="1.0" green="1.0" blue="1.0" /></text></element>
diff --git a/src/mame/layout/intlc440.lay b/src/mame/layout/intlc440.lay
index fa2b97734e8..d2732278cd8 100644
--- a/src/mame/layout/intlc440.lay
+++ b/src/mame/layout/intlc440.lay
@@ -41,18 +41,12 @@ Intel INTELLEC® 4/MOD 40 layout
</rect>
</element>
- <element name="label_0"><text string="0"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="label_1"><text string="1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="label_2"><text string="2"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="label_3"><text string="3"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="label_4"><text string="4"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="label_5"><text string="5"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="label_6"><text string="6"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="label_7"><text string="7"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="label_8"><text string="8"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="label_9"><text string="9"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="label_10"><text string="10"><color red="1.0" green="1.0" blue="1.0" /></text></element>
- <element name="label_11"><text string="11"><color red="1.0" green="1.0" blue="1.0" /></text></element>
+ <repeat count="12">
+ <param name="labelnum" start="0" increment="1" />
+ <element name="label_~labelnum~">
+ <text string="~labelnum~"><color red="1.0" green="1.0" blue="1.0" /></text>
+ </element>
+ </repeat>
<element name="label_a1"><text string="A1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="label_a2"><text string="A2"><color red="1.0" green="1.0" blue="1.0" /></text></element>