<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.mamedev.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mellery</id>
	<title>MAMEDEV Wiki - User contributions [en-gb]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.mamedev.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mellery"/>
	<link rel="alternate" type="text/html" href="https://wiki.mamedev.org/index.php?title=Special:Contributions/Mellery"/>
	<updated>2026-05-06T10:05:51Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.mamedev.org/index.php?title=DIP_Switches_in_MAME&amp;diff=404</id>
		<title>DIP Switches in MAME</title>
		<link rel="alternate" type="text/html" href="https://wiki.mamedev.org/index.php?title=DIP_Switches_in_MAME&amp;diff=404"/>
		<updated>2007-03-21T21:15:20Z</updated>

		<summary type="html">&lt;p&gt;Mellery: /* How DIP Switches work */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;DIP switches were used by arcade games to allow settings like difficulty, cost per play, number of lives, etc.  For more info and pictures of DIP switches see the [http://en.wikipedia.org/wiki/Dip_switch Wikipedia article].  DIP Switches can be viewed and set in game by pressing TAB and going to the menu marked DIP Switches.&lt;br /&gt;
&lt;br /&gt;
A large number of DIP switch settings are not documented, and thus marked as Unknown.  Some games will not run or will display wrong colors if DIP switches are not set correctly, so figuring out what these unknown switches do is helpful.  What these switches do can be determined by looking at the games code, reading the game&#039;s operator manual, or by just adjusting the DIP switches and observing how the game runs differently (this method is usually not enough to figure out what most switches do).  Also, some games manuals do not cover different regions or versions or the same game, so what the settings should be checked in game to verify the manual is correct.  &lt;br /&gt;
&lt;br /&gt;
==How DIP Switches work==&lt;br /&gt;
&lt;br /&gt;
(a picture a of dipswitch would help here) http://en.wikipedia.org/wiki/Image:Dipswitch.JPG&lt;br /&gt;
&lt;br /&gt;
Dip switches usually come in packages of 8, and from left to right are numbered 1 to 8.  DIP Switch 8 would be the least significant bit (LSB) and DIP Switch 1 would be the most significant bit (MSB).  DIP Switches are binary (they can be ON or OFF, 1 or 0).  So using binary, from MSB to LSB the switches have the values 128 64 32 16 8 4 2 1 equaling 256 different possible combinations!&lt;br /&gt;
&lt;br /&gt;
==How DIP Switches are Coded in MAME==&lt;br /&gt;
&lt;br /&gt;
The following macros are the most common ones for DIPs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_START&#039;&#039;&#039; is to declare the start of a new input port (dipswitch)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_DIPNAME&#039;&#039;&#039; is used as the name of what the setting does and follows the format&lt;br /&gt;
&lt;br /&gt;
 PORT_DIPNAME( &#039;&#039;dip_value&#039;&#039;, &#039;&#039;default_position&#039;&#039;, &#039;&#039;name&#039;&#039; )&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;dip_value&#039;&#039; and &#039;&#039;default_position&#039;&#039; are in hex, and &#039;&#039;name&#039;&#039; is a string. Some settings need more than one switch, so &#039;&#039;dip_value&#039;&#039; and &#039;&#039;default_position&#039;&#039; could be the sum of a few switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_DIPSETTING&#039;&#039;&#039; is used to define each setting and follows the format&lt;br /&gt;
&lt;br /&gt;
 PORT_DIPSETTING( &#039;&#039;position&#039;&#039;, &#039;&#039;name&#039;&#039; )&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;position&#039;&#039; is in hex, and &#039;&#039;name&#039;&#039; is a string.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_DIPLOCATION&#039;&#039;&#039; defines which switches are used and are shown in the DIP Switch menu&lt;br /&gt;
&lt;br /&gt;
 PORT_DIPLOCATION( &amp;quot;&#039;&#039;switch&#039;&#039;:&#039;&#039;x&#039;&#039;&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;switch&#039;&#039; is the name of the DIP Switch on the PCB, and &#039;&#039;x&#039;&#039; are the numbers of the dip switches used separated by comma. When covering more than one bit, the dip switch numbers are listed from LSB to MSB order.&lt;br /&gt;
&lt;br /&gt;
PORT_DIPLOCATION was recently added to MAME and most drivers still need someone to add the dip locations &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_DIPUNUSED_DIPLOC&#039;&#039;&#039; is a shorthand way of adding dips when they are unused.  If a board has multiple unused DIPs they should each have there own PORT_DIPUNUSED_DIPLOC so they can still each be individually toggled.&lt;br /&gt;
&lt;br /&gt;
 PORT_DIPUNUSED_DIPLOC( &#039;&#039;dip_value&#039;&#039;, &#039;&#039;default_position&#039;&#039;, &amp;quot;&#039;&#039;switch&#039;&#039;:&#039;&#039;x&#039;&#039;&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
These are the most commonly uses macros, for more advanced ones see /src/emu/inptport.h in the MAME source code.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
Here is the code used to define DIP Switch 0 for the game Zero Hour from the driver redclash.c.  Zero Hour uses an addition DIP Switch DSW1 which is not shown here.  Look in the MAME source for many more examples.  First the dip settings as defined in the operator&#039;s manual, and then the actual code.&lt;br /&gt;
&lt;br /&gt;
Setting the number of lives uses SW1 and SW2&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |&lt;br /&gt;
|SW1&lt;br /&gt;
|SW2&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |2 Lives&lt;br /&gt;
|ON&lt;br /&gt;
|ON&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |3 Lives&lt;br /&gt;
|OFF&lt;br /&gt;
|OFF&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |4 Lives&lt;br /&gt;
|OFF&lt;br /&gt;
|ON&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |5 Lives&lt;br /&gt;
|ON&lt;br /&gt;
|OFF&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Setting the required score for additional spaceship uses SW3 and SW 4&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |&lt;br /&gt;
|SW3&lt;br /&gt;
|SW4&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |Over 5000&lt;br /&gt;
|OFF&lt;br /&gt;
|OFF&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |Over 8000&lt;br /&gt;
|OFF&lt;br /&gt;
|ON&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |Over 10000&lt;br /&gt;
|ON&lt;br /&gt;
|OFF&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |No Extra&lt;br /&gt;
|ON&lt;br /&gt;
|ON&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Setting the mode of the game uses SW5&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |&lt;br /&gt;
|SW5&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |Table&lt;br /&gt;
|OFF&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |Upright&lt;br /&gt;
|ON&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SW6 SW7 and SW8 are not used&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above looks like the following in code,&lt;br /&gt;
 PORT_START	/* DSW0 */&lt;br /&gt;
 PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, &amp;quot;SW1:8&amp;quot; ) 	/* Switches 6-8 are not used */&lt;br /&gt;
 PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, &amp;quot;SW1:7&amp;quot; )&lt;br /&gt;
 PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, &amp;quot;SW1:6&amp;quot; )&lt;br /&gt;
 PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION(&amp;quot;SW1:5&amp;quot;)&lt;br /&gt;
 PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )&lt;br /&gt;
 PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )&lt;br /&gt;
 PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION(&amp;quot;SW1:4,3&amp;quot;)&lt;br /&gt;
 PORT_DIPSETTING(    0x00, &amp;quot;5000&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0x10, &amp;quot;8000&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0x20, &amp;quot;10000&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0x30, &amp;quot;No Bonus&amp;quot; )&lt;br /&gt;
 PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION(&amp;quot;SW1:2,1&amp;quot;)&lt;br /&gt;
 PORT_DIPSETTING(    0x00, &amp;quot;2&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0xc0, &amp;quot;3&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0x80, &amp;quot;4&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0x40, &amp;quot;5&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
==More Information==&lt;br /&gt;
&lt;br /&gt;
To generate a list of games which have dips marked as unknown do the following GREP,&lt;br /&gt;
&lt;br /&gt;
 grep PORT_DIPNAME src/mame/drivers/*.c | grep Unknown&lt;br /&gt;
&lt;br /&gt;
or on Windows&lt;br /&gt;
&lt;br /&gt;
 findstr PORT_DIPNAME src\mame\drivers\*.c | findstr Unknown&lt;br /&gt;
&lt;br /&gt;
A list of games with unknown dips, but is not always up to date can be found at [http://www.mameworld.net/gurudumps/DumpingProject/diplist.html Guru&#039;s Unknown DIPs page].&lt;br /&gt;
&lt;br /&gt;
The inptport.h file where the DIP related macros are declared can be viewed at&lt;br /&gt;
[http://www.mameworld.net/maws/mamesrc/src/emu/inptport.h MAWS - MAME souce]&lt;/div&gt;</summary>
		<author><name>Mellery</name></author>
	</entry>
	<entry>
		<id>https://wiki.mamedev.org/index.php?title=DIP_Switches_in_MAME&amp;diff=324</id>
		<title>DIP Switches in MAME</title>
		<link rel="alternate" type="text/html" href="https://wiki.mamedev.org/index.php?title=DIP_Switches_in_MAME&amp;diff=324"/>
		<updated>2007-03-07T17:46:50Z</updated>

		<summary type="html">&lt;p&gt;Mellery: /* Example */  adding table&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;DIP switches were used by arcade games to allow settings like difficulty, cost per play, number of lives, etc.  For more info and pictures of DIP switches see the [http://en.wikipedia.org/wiki/Dip_switch Wikipedia article].  DIP Switches can be viewed and set in game by pressing TAB and going to the menu marked DIP Switches.&lt;br /&gt;
&lt;br /&gt;
A large number of DIP switch settings are not documented, and thus marked as Unknown.  Some games will not run or will display wrong colors if DIP switches are not set correctly, so figuring out what these unknown switches do is helpful.  What these switches do can be determined by looking at the games code, reading the game&#039;s operator manual, or by just adjusting the DIP switches and observing how the game runs differently (this method is usually not enough to figure out what most switches do).  Also, some games manuals do not cover different regions or versions or the same game, so what the settings should be checked in game to verify the manual is correct.  &lt;br /&gt;
&lt;br /&gt;
==How DIP Switches work==&lt;br /&gt;
&lt;br /&gt;
(a picture a of dipswitch would help here) http://en.wikipedia.org/wiki/Image:Dipswitch.JPG&lt;br /&gt;
&lt;br /&gt;
Dip switches usually come in packages of 8, and from left to right are numbered 1 to 8.  DIP Switch 8 would be the least significant bit (LSB0 and DIP Switch 1 would be the most significant bit (MSB).  DIP Switches are binary (they can be ON or OFF, 1 or 0).  So using binary, from MSB to LSB the switches have the values 128 64 32 16 8 4 2 1 equaling 256 different possible combinations!  &lt;br /&gt;
&lt;br /&gt;
==How DIP Switches are Coded in MAME==&lt;br /&gt;
&lt;br /&gt;
The following macros are the most common ones for DIPs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_START&#039;&#039;&#039; is to declare the start of a new input port (dipswitch)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_DIPNAME&#039;&#039;&#039; is used as the name of what the setting does and follows the format&lt;br /&gt;
&lt;br /&gt;
 PORT_DIPNAME( &#039;&#039;dip_value&#039;&#039;, &#039;&#039;default_position&#039;&#039;, &#039;&#039;name&#039;&#039; )&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;dip_value&#039;&#039; and &#039;&#039;default_position&#039;&#039; are in hex, and &#039;&#039;name&#039;&#039; is a string. Some settings need more than one switch, so &#039;&#039;dip_value&#039;&#039; and &#039;&#039;default_position&#039;&#039; could be the sum of a few switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_DIPSETTING&#039;&#039;&#039; is used to define each setting and follows the format&lt;br /&gt;
&lt;br /&gt;
 PORT_DIPSETTING( &#039;&#039;position&#039;&#039;, &#039;&#039;name&#039;&#039; )&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;position&#039;&#039; is in hex, and &#039;&#039;name&#039;&#039; is a string.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_DIPLOCATION&#039;&#039;&#039; defines which switches are used and are shown in the DIP Switch menu&lt;br /&gt;
&lt;br /&gt;
 PORT_DIPLOCATION( &amp;quot;&#039;&#039;switch&#039;&#039;:&#039;&#039;x&#039;&#039;&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;switch&#039;&#039; is the name of the DIP Switch on the PCB, and &#039;&#039;x&#039;&#039; are the numbers of the dip switches used separated by comma. When covering more than one bit, the dip switch numbers are listed from LSB to MSB order.&lt;br /&gt;
&lt;br /&gt;
PORT_DIPLOCATION was recently added to MAME and most drivers still need someone to add the dip locations &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_DIPUNUSED_DIPLOC&#039;&#039;&#039; is a shorthand way of adding dips when they are unused.  If a board has multiple unused DIPs they should each have there own PORT_DIPUNUSED_DIPLOC so they can still each be individually toggled.&lt;br /&gt;
&lt;br /&gt;
 PORT_DIPUNUSED_DIPLOC( &#039;&#039;dip_value&#039;&#039;, &#039;&#039;default_position&#039;&#039;, &amp;quot;&#039;&#039;switch&#039;&#039;:&#039;&#039;x&#039;&#039;&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
These are the most commonly uses macros, for more advanced ones see /src/emu/inptport.h in the MAME source code.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
Here is the code used to define DIP Switch 0 for the game Zero Hour from the driver redclash.c.  Zero Hour uses an addition DIP Switch DSW1 which is not shown here.  Look in the MAME source for many more examples.  First the dip settings as defined in the operator&#039;s manual, and then the actual code.&lt;br /&gt;
&lt;br /&gt;
Setting the number of lives uses SW1 and SW2&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |&lt;br /&gt;
|SW1&lt;br /&gt;
|SW2&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |2 Lives&lt;br /&gt;
|ON&lt;br /&gt;
|ON&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |3 Lives&lt;br /&gt;
|OFF&lt;br /&gt;
|OFF&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |4 Lives&lt;br /&gt;
|OFF&lt;br /&gt;
|ON&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |5 Lives&lt;br /&gt;
|ON&lt;br /&gt;
|OFF&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Setting the required score for additional spaceship uses SW3 and SW 4&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |&lt;br /&gt;
|SW3&lt;br /&gt;
|SW4&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |Over 5000&lt;br /&gt;
|OFF&lt;br /&gt;
|OFF&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |Over 8000&lt;br /&gt;
|OFF&lt;br /&gt;
|ON&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |Over 10000&lt;br /&gt;
|ON&lt;br /&gt;
|OFF&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |No Extra&lt;br /&gt;
|ON&lt;br /&gt;
|ON&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Setting the mode of the game uses SW5&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |&lt;br /&gt;
|SW5&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |Table&lt;br /&gt;
|OFF&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |Upright&lt;br /&gt;
|ON&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SW6 SW7 and SW8 are not used&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above looks like the following in code,&lt;br /&gt;
 PORT_START	/* DSW0 */&lt;br /&gt;
 PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, &amp;quot;SW1:8&amp;quot; ) 	/* Switches 6-8 are not used */&lt;br /&gt;
 PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, &amp;quot;SW1:7&amp;quot; )&lt;br /&gt;
 PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, &amp;quot;SW1:6&amp;quot; )&lt;br /&gt;
 PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION(&amp;quot;SW1:5&amp;quot;)&lt;br /&gt;
 PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )&lt;br /&gt;
 PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )&lt;br /&gt;
 PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION(&amp;quot;SW1:4,3&amp;quot;)&lt;br /&gt;
 PORT_DIPSETTING(    0x00, &amp;quot;5000&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0x10, &amp;quot;8000&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0x20, &amp;quot;10000&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0x30, &amp;quot;No Bonus&amp;quot; )&lt;br /&gt;
 PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION(&amp;quot;SW1:2,1&amp;quot;)&lt;br /&gt;
 PORT_DIPSETTING(    0x00, &amp;quot;2&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0xc0, &amp;quot;3&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0x80, &amp;quot;4&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0x40, &amp;quot;5&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
==More Information==&lt;br /&gt;
&lt;br /&gt;
To generate a list of games which have dips marked as unknown do the following GREP,&lt;br /&gt;
&lt;br /&gt;
 grep PORT_DIPNAME src/mame/drivers/*.c | grep Unknown&lt;br /&gt;
&lt;br /&gt;
or on Windows&lt;br /&gt;
&lt;br /&gt;
 findstr PORT_DIPNAME src\mame\drivers\*.c | findstr Unknown&lt;br /&gt;
&lt;br /&gt;
A list of games with unknown dips, but is not always up to date can be found at [http://www.mameworld.net/gurudumps/DumpingProject/diplist.html Guru&#039;s Unknown DIPs page].&lt;br /&gt;
&lt;br /&gt;
The inptport.h file where the DIP related macros are declared can be viewed at&lt;br /&gt;
[http://www.mameworld.net/maws/mamesrc/src/emu/inptport.h MAWS - MAME souce]&lt;/div&gt;</summary>
		<author><name>Mellery</name></author>
	</entry>
	<entry>
		<id>https://wiki.mamedev.org/index.php?title=DIP_Switches_in_MAME&amp;diff=323</id>
		<title>DIP Switches in MAME</title>
		<link rel="alternate" type="text/html" href="https://wiki.mamedev.org/index.php?title=DIP_Switches_in_MAME&amp;diff=323"/>
		<updated>2007-03-07T17:42:50Z</updated>

		<summary type="html">&lt;p&gt;Mellery: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;DIP switches were used by arcade games to allow settings like difficulty, cost per play, number of lives, etc.  For more info and pictures of DIP switches see the [http://en.wikipedia.org/wiki/Dip_switch Wikipedia article].  DIP Switches can be viewed and set in game by pressing TAB and going to the menu marked DIP Switches.&lt;br /&gt;
&lt;br /&gt;
A large number of DIP switch settings are not documented, and thus marked as Unknown.  Some games will not run or will display wrong colors if DIP switches are not set correctly, so figuring out what these unknown switches do is helpful.  What these switches do can be determined by looking at the games code, reading the game&#039;s operator manual, or by just adjusting the DIP switches and observing how the game runs differently (this method is usually not enough to figure out what most switches do).  Also, some games manuals do not cover different regions or versions or the same game, so what the settings should be checked in game to verify the manual is correct.  &lt;br /&gt;
&lt;br /&gt;
==How DIP Switches work==&lt;br /&gt;
&lt;br /&gt;
(a picture a of dipswitch would help here) http://en.wikipedia.org/wiki/Image:Dipswitch.JPG&lt;br /&gt;
&lt;br /&gt;
Dip switches usually come in packages of 8, and from left to right are numbered 1 to 8.  DIP Switch 8 would be the least significant bit (LSB0 and DIP Switch 1 would be the most significant bit (MSB).  DIP Switches are binary (they can be ON or OFF, 1 or 0).  So using binary, from MSB to LSB the switches have the values 128 64 32 16 8 4 2 1 equaling 256 different possible combinations!  &lt;br /&gt;
&lt;br /&gt;
==How DIP Switches are Coded in MAME==&lt;br /&gt;
&lt;br /&gt;
The following macros are the most common ones for DIPs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_START&#039;&#039;&#039; is to declare the start of a new input port (dipswitch)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_DIPNAME&#039;&#039;&#039; is used as the name of what the setting does and follows the format&lt;br /&gt;
&lt;br /&gt;
 PORT_DIPNAME( &#039;&#039;dip_value&#039;&#039;, &#039;&#039;default_position&#039;&#039;, &#039;&#039;name&#039;&#039; )&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;dip_value&#039;&#039; and &#039;&#039;default_position&#039;&#039; are in hex, and &#039;&#039;name&#039;&#039; is a string. Some settings need more than one switch, so &#039;&#039;dip_value&#039;&#039; and &#039;&#039;default_position&#039;&#039; could be the sum of a few switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_DIPSETTING&#039;&#039;&#039; is used to define each setting and follows the format&lt;br /&gt;
&lt;br /&gt;
 PORT_DIPSETTING( &#039;&#039;position&#039;&#039;, &#039;&#039;name&#039;&#039; )&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;position&#039;&#039; is in hex, and &#039;&#039;name&#039;&#039; is a string.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_DIPLOCATION&#039;&#039;&#039; defines which switches are used and are shown in the DIP Switch menu&lt;br /&gt;
&lt;br /&gt;
 PORT_DIPLOCATION( &amp;quot;&#039;&#039;switch&#039;&#039;:&#039;&#039;x&#039;&#039;&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;switch&#039;&#039; is the name of the DIP Switch on the PCB, and &#039;&#039;x&#039;&#039; are the numbers of the dip switches used separated by comma. When covering more than one bit, the dip switch numbers are listed from LSB to MSB order.&lt;br /&gt;
&lt;br /&gt;
PORT_DIPLOCATION was recently added to MAME and most drivers still need someone to add the dip locations &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_DIPUNUSED_DIPLOC&#039;&#039;&#039; is a shorthand way of adding dips when they are unused.  If a board has multiple unused DIPs they should each have there own PORT_DIPUNUSED_DIPLOC so they can still each be individually toggled.&lt;br /&gt;
&lt;br /&gt;
 PORT_DIPUNUSED_DIPLOC( &#039;&#039;dip_value&#039;&#039;, &#039;&#039;default_position&#039;&#039;, &amp;quot;&#039;&#039;switch&#039;&#039;:&#039;&#039;x&#039;&#039;&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
These are the most commonly uses macros, for more advanced ones see /src/emu/inptport.h in the MAME source code.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
Here is the code used to define DIP Switch 0 for the game Zero Hour from the driver redclash.c.  Zero Hour uses an addition DIP Switch DSW1 which is not shown here.  Look in the MAME source for many more examples.  First the dip settings as defined in the operator&#039;s manual, and then the actual code.&lt;br /&gt;
&lt;br /&gt;
Setting the number of lives uses SW1 and SW2&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |&lt;br /&gt;
|SW1&lt;br /&gt;
|SW2&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |2 Lives&lt;br /&gt;
|ON&lt;br /&gt;
|ON&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |3 Lives&lt;br /&gt;
|OFF&lt;br /&gt;
|OFF&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |4 Lives&lt;br /&gt;
|OFF&lt;br /&gt;
|ON&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |5 Lives&lt;br /&gt;
|ON&lt;br /&gt;
|OFF&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Setting the required score for additional spaceship uses SW3 and SW 4&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |&lt;br /&gt;
|SW3&lt;br /&gt;
|SW4&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |Over 5000&lt;br /&gt;
|OFF&lt;br /&gt;
|OFF&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |Over 8000&lt;br /&gt;
|OFF&lt;br /&gt;
|ON&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |Over 10000&lt;br /&gt;
|ON&lt;br /&gt;
|OFF&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |No Extra&lt;br /&gt;
|ON&lt;br /&gt;
|ON&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Setting the mode of the game uses SW5&lt;br /&gt;
&amp;lt;br&amp;gt;Table   = off&lt;br /&gt;
&amp;lt;br&amp;gt;Upright = on&lt;br /&gt;
&lt;br /&gt;
SW6 SW7 and SW8 are not used&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above looks like the following in code,&lt;br /&gt;
 PORT_START	/* DSW0 */&lt;br /&gt;
 PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, &amp;quot;SW1:8&amp;quot; ) 	/* Switches 6-8 are not used */&lt;br /&gt;
 PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, &amp;quot;SW1:7&amp;quot; )&lt;br /&gt;
 PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, &amp;quot;SW1:6&amp;quot; )&lt;br /&gt;
 PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION(&amp;quot;SW1:5&amp;quot;)&lt;br /&gt;
 PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )&lt;br /&gt;
 PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )&lt;br /&gt;
 PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION(&amp;quot;SW1:4,3&amp;quot;)&lt;br /&gt;
 PORT_DIPSETTING(    0x00, &amp;quot;5000&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0x10, &amp;quot;8000&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0x20, &amp;quot;10000&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0x30, &amp;quot;No Bonus&amp;quot; )&lt;br /&gt;
 PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION(&amp;quot;SW1:2,1&amp;quot;)&lt;br /&gt;
 PORT_DIPSETTING(    0x00, &amp;quot;2&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0xc0, &amp;quot;3&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0x80, &amp;quot;4&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0x40, &amp;quot;5&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
==More Information==&lt;br /&gt;
&lt;br /&gt;
To generate a list of games which have dips marked as unknown do the following GREP,&lt;br /&gt;
&lt;br /&gt;
 grep PORT_DIPNAME src/mame/drivers/*.c | grep Unknown&lt;br /&gt;
&lt;br /&gt;
or on Windows&lt;br /&gt;
&lt;br /&gt;
 findstr PORT_DIPNAME src\mame\drivers\*.c | findstr Unknown&lt;br /&gt;
&lt;br /&gt;
A list of games with unknown dips, but is not always up to date can be found at [http://www.mameworld.net/gurudumps/DumpingProject/diplist.html Guru&#039;s Unknown DIPs page].&lt;br /&gt;
&lt;br /&gt;
The inptport.h file where the DIP related macros are declared can be viewed at&lt;br /&gt;
[http://www.mameworld.net/maws/mamesrc/src/emu/inptport.h MAWS - MAME souce]&lt;/div&gt;</summary>
		<author><name>Mellery</name></author>
	</entry>
	<entry>
		<id>https://wiki.mamedev.org/index.php?title=DIP_Switches_in_MAME&amp;diff=322</id>
		<title>DIP Switches in MAME</title>
		<link rel="alternate" type="text/html" href="https://wiki.mamedev.org/index.php?title=DIP_Switches_in_MAME&amp;diff=322"/>
		<updated>2007-03-07T17:42:18Z</updated>

		<summary type="html">&lt;p&gt;Mellery: adding some more info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;DIP switches were used by arcade games to allow settings like difficulty, cost per play, number of lives, etc.  For more info and pictures of DIP switches see the [http://en.wikipedia.org/wiki/Dip_switch Wikipedia article].  DIP Switches can be viewed and set in game by pressing TAB and going to the menu marked DIP Switches.&lt;br /&gt;
&lt;br /&gt;
A large number of DIP switch settings are not documented, and thus marked as Unknown.  Some games will not run or will display wrong colors if DIP switches are not set correctly, so figuring out what these unknown switches do is helpful.  What these switches do can be determined by looking at the games code, reading the game&#039;s operator manual, or by just adjusting the DIP switches and observing how the game runs differently (this method is usually not enough to figure out what most switches do).  Also, some games manuals do not cover different regions or versions or the same game, so what the settings should be checked in game to verify the manual is correct.  &lt;br /&gt;
&lt;br /&gt;
==How DIP Switches work==&lt;br /&gt;
&lt;br /&gt;
(a picture a of dipswitch would help here) http://en.wikipedia.org/wiki/Image:Dipswitch.JPG&lt;br /&gt;
&lt;br /&gt;
Dip switches usually come in packages of 8, and from left to right are numbered 1 to 8.  DIP Switch 8 would be the least significant bit (LSB0 and DIP Switch 1 would be the most significant bit (MSB).  DIP Switches are binary (they can be ON or OFF, 1 or 0).  So using binary, from MSB to LSB the switches have the values 128 64 32 16 8 4 2 1 equaling 256 different possible combinations!  &lt;br /&gt;
&lt;br /&gt;
==How DIP Switches are Coded in MAME==&lt;br /&gt;
&lt;br /&gt;
The following macros are the most common ones for DIPs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_START&#039;&#039;&#039; is to declare the start of a new input port (dipswitch)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_DIPNAME&#039;&#039;&#039; is used as the name of what the setting does and follows the format&lt;br /&gt;
&lt;br /&gt;
 PORT_DIPNAME( &#039;&#039;dip_value&#039;&#039;, &#039;&#039;default_position&#039;&#039;, &#039;&#039;name&#039;&#039; )&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;dip_value&#039;&#039; and &#039;&#039;default_position&#039;&#039; are in hex, and &#039;&#039;name&#039;&#039; is a string. Some settings need more than one switch, so &#039;&#039;dip_value&#039;&#039; and &#039;&#039;default_position&#039;&#039; could be the sum of a few switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_DIPSETTING&#039;&#039;&#039; is used to define each setting and follows the format&lt;br /&gt;
&lt;br /&gt;
 PORT_DIPSETTING( &#039;&#039;position&#039;&#039;, &#039;&#039;name&#039;&#039; )&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;position&#039;&#039; is in hex, and &#039;&#039;name&#039;&#039; is a string.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_DIPLOCATION&#039;&#039;&#039; defines which switches are used and are shown in the DIP Switch menu&lt;br /&gt;
&lt;br /&gt;
 PORT_DIPLOCATION( &amp;quot;&#039;&#039;switch&#039;&#039;:&#039;&#039;x&#039;&#039;&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;switch&#039;&#039; is the name of the DIP Switch on the PCB, and &#039;&#039;x&#039;&#039; are the numbers of the dip switches used separated by comma. When covering more than one bit, the dip switch numbers are listed from LSB to MSB order.&lt;br /&gt;
&lt;br /&gt;
PORT_DIPLOCATION was recently added to MAME and most drivers still need someone to add the dip locations &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_DIPUNUSED_DIPLOC&#039;&#039;&#039; is a shorthand way of adding dips when they are unused.  If a board has multiple unused DIPs they should each have there own PORT_DIPUNUSED_DIPLOC so they can still each be individually toggled.&lt;br /&gt;
&lt;br /&gt;
 PORT_DIPUNUSED_DIPLOC( &#039;&#039;dip_value&#039;&#039;, &#039;&#039;default_position&#039;&#039;, &amp;quot;&#039;&#039;switch&#039;&#039;:&#039;&#039;x&#039;&#039;&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
These are the most commonly uses macros, for more advanced ones see /src/emu/inptport.h in the MAME source code.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
Here is the code used to define DIP Switch 0 for the game Zero Hour from the driver redclash.c.  Zero Hour uses an addition DIP Switch DSW1 which is not shown here.  Look in the MAME source for many more examples.  First the dip settings as defined in the operator&#039;s manual, and then the actual code.&lt;br /&gt;
&lt;br /&gt;
Setting the number of lives uses SW1 and SW2&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |&lt;br /&gt;
|SW1&lt;br /&gt;
|SW2&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |2 Lives&lt;br /&gt;
|ON&lt;br /&gt;
|ON&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |3 Lives&lt;br /&gt;
|OFF&lt;br /&gt;
|OFF&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |4 Lives&lt;br /&gt;
|OFF&lt;br /&gt;
|ON&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |5 Lives&lt;br /&gt;
|ON&lt;br /&gt;
|OFF&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Setting the required score for additional spaceship uses SW3 and SW 4&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |&lt;br /&gt;
|SW3&lt;br /&gt;
|SW4&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |Over 5000&lt;br /&gt;
|OFF&lt;br /&gt;
|OFF&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |Over 8000&lt;br /&gt;
|OFF&lt;br /&gt;
|ON&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |Over 10000&lt;br /&gt;
|ON&lt;br /&gt;
|OFF&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |No Extra&lt;br /&gt;
|ON&lt;br /&gt;
|ON&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Setting the mode of the game uses SW5&lt;br /&gt;
&amp;lt;br&amp;gt;Table   = off&lt;br /&gt;
&amp;lt;br&amp;gt;Upright = on&lt;br /&gt;
&lt;br /&gt;
SW6 SW7 and SW8 are not used&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above looks like the following in code,&lt;br /&gt;
 PORT_START	/* DSW0 */&lt;br /&gt;
 PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, &amp;quot;SW1:8&amp;quot; ) 	/* Switches 6-8 are not used */&lt;br /&gt;
 PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, &amp;quot;SW1:7&amp;quot; )&lt;br /&gt;
 PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, &amp;quot;SW1:6&amp;quot; )&lt;br /&gt;
 PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION(&amp;quot;SW1:5&amp;quot;)&lt;br /&gt;
 PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )&lt;br /&gt;
 PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )&lt;br /&gt;
 PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION(&amp;quot;SW1:4,3&amp;quot;)&lt;br /&gt;
 PORT_DIPSETTING(    0x00, &amp;quot;5000&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0x10, &amp;quot;8000&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0x20, &amp;quot;10000&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0x30, &amp;quot;No Bonus&amp;quot; )&lt;br /&gt;
 PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION(&amp;quot;SW1:2,1&amp;quot;)&lt;br /&gt;
 PORT_DIPSETTING(    0x00, &amp;quot;2&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0xc0, &amp;quot;3&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0x80, &amp;quot;4&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0x40, &amp;quot;5&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
==More Information==&lt;br /&gt;
&lt;br /&gt;
To generate a list of games which have dips marked as unknown do the following GREP,&lt;br /&gt;
&lt;br /&gt;
 grep PORT_DIPNAME src/mame/drivers/*.c | grep Unknown&lt;br /&gt;
&lt;br /&gt;
or on Windows&lt;br /&gt;
&lt;br /&gt;
 findstr PORT_DIPNAME src\mame\drivers\*.c | findstr Unknown&lt;br /&gt;
&lt;br /&gt;
A list of games with unknown dips, but is not always up to date can be found at [http://www.mameworld.net/gurudumps/DumpingProject/diplist.html Guru&#039;s Unknown DIPs page].&lt;br /&gt;
&lt;br /&gt;
The inptport.h file where the DIP related macros are declared can be viewed at&lt;br /&gt;
[http://www.mameworld.net/maws/mamesrc/src/emu/inptport.h]&lt;/div&gt;</summary>
		<author><name>Mellery</name></author>
	</entry>
	<entry>
		<id>https://wiki.mamedev.org/index.php?title=DIP_Switches_in_MAME&amp;diff=266</id>
		<title>DIP Switches in MAME</title>
		<link rel="alternate" type="text/html" href="https://wiki.mamedev.org/index.php?title=DIP_Switches_in_MAME&amp;diff=266"/>
		<updated>2007-02-25T07:20:45Z</updated>

		<summary type="html">&lt;p&gt;Mellery: /* Example */  formating&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=DIP Switches in MAME=&lt;br /&gt;
&lt;br /&gt;
DIP switches were used by arcade games to allow certain settings like difficulty, cost per play, number of lives, etc.  For more info and pictures of DIP switches see the [http://en.wikipedia.org/wiki/Dip_switch Wikipedia article].  DIP Switches can be viewed and set in game by pressing TAB and going to the menu marked DIP Switches.&lt;br /&gt;
&lt;br /&gt;
A large number of DIP switch settings are not documented, and thus marked as Unknown.  Some games will not run or will display wrong colors if DIP switches are not set correctly, so figuring out what these unknown switches do can be helpful.  What these switches do can be determined by looking at the games code, reading the game&#039;s operator manual, or by just adjusting the DIP switches and observing how the game runs differently (this method is usually not enough to figure out what most switches do).  Also, some games manuals do not cover different regions or versions or the same game, so what the settings should be checked in game to verify the manual is correct.  &lt;br /&gt;
&lt;br /&gt;
==How DIP Switches work==&lt;br /&gt;
&lt;br /&gt;
(a picture a of dipswitch would help here) http://en.wikipedia.org/wiki/Image:Dipswitch.JPG&lt;br /&gt;
&lt;br /&gt;
Dip switches usually come in packages of 8, and from left to right are numbered 1 to 8.  DIP Switch 8 would be the least significant bit (LSB0 and DIP Switch 1 would be the most significant bit (MSB).  DIP Switches are binary (they can be ON or OFF, 1 or 0).  So using binary, from MSB to LSB the switches have the values 128 64 32 16 8 4 2 1 equaling 256 different possible combinations!  &lt;br /&gt;
&lt;br /&gt;
==How DIP Switches are Coded in MAME==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_DIPNAME&#039;&#039;&#039; is used as the name of what the setting does and follows the format&lt;br /&gt;
&lt;br /&gt;
PORT_DIPNAME( dip value, default position, name)&lt;br /&gt;
&lt;br /&gt;
Where dip value and default position are in hex, and name is a string.&lt;br /&gt;
&lt;br /&gt;
Some settings need more than one switch, so dip value and position could be the sum of a few switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_DIPSETTING&#039;&#039;&#039; is used to define each setting and follows the format&lt;br /&gt;
&lt;br /&gt;
PORT_DIPSETTING( position, name )&lt;br /&gt;
&lt;br /&gt;
Where position is in hex, and name is a string.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_DIPLOCATION&#039;&#039;&#039; defines which switches are used and are shown in the DIP Switch menu&lt;br /&gt;
&lt;br /&gt;
PORT_DIPLOCATION(&amp;quot;switch:x&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Where switch is the name of the DIP Switch on the PCB, and x are the numbers of the dip switches used separated by comma.&lt;br /&gt;
&lt;br /&gt;
PORT_DIPLOCATION was recently added to MAME and most drivers still need someone to add the dip locations &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_DIPUNUSED_DIPLOC&#039;&#039;&#039; is a shorthand way of adding dips when they are unused.  If a board has multiple unused DIPs they should each have there own PORT_DIPUNUSED_DIPLOC so they can still each be individually toggled.&lt;br /&gt;
&lt;br /&gt;
PORT_DIPUNUSED_DIPLOC( dip value, default position, &amp;quot;switch:x&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
Here is the code used to define DIP Switch 0 for the game Zero Hour from the driver redclash.c.  Zero Hour uses an addition DIP Switch DSW1 which is not shown here.  Look in the MAME source for many more examples.  First the dip settings as defined in the operator&#039;s manual, and then the actual code.&lt;br /&gt;
&lt;br /&gt;
Setting the number of lives uses SW1 and SW2&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |&lt;br /&gt;
|SW1&lt;br /&gt;
|SW2&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |2 Lives&lt;br /&gt;
|ON&lt;br /&gt;
|ON&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |3 Lives&lt;br /&gt;
|OFF&lt;br /&gt;
|OFF&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |4 Lives&lt;br /&gt;
|OFF&lt;br /&gt;
|ON&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |5 Lives&lt;br /&gt;
|ON&lt;br /&gt;
|OFF&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Setting the required score for additional spaceship uses SW3 and SW 4&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |&lt;br /&gt;
|SW3&lt;br /&gt;
|SW4&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |Over 5000&lt;br /&gt;
|OFF&lt;br /&gt;
|OFF&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |Over 8000&lt;br /&gt;
|OFF&lt;br /&gt;
|ON&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |Over 10000&lt;br /&gt;
|ON&lt;br /&gt;
|OFF&lt;br /&gt;
|-&lt;br /&gt;
!align=&amp;quot;right&amp;quot; |No Extra&lt;br /&gt;
|ON&lt;br /&gt;
|ON&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Setting the mode of the game uses SW5&lt;br /&gt;
&amp;lt;br&amp;gt;Table   = off&lt;br /&gt;
&amp;lt;br&amp;gt;Upright = on&lt;br /&gt;
&lt;br /&gt;
SW6 SW7 and SW8 are not used&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above looks like the following in code,&lt;br /&gt;
 PORT_START	/* DSW0 */&lt;br /&gt;
 PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, &amp;quot;SW1:8&amp;quot; ) 	/* Switches 6-8 are not used */&lt;br /&gt;
 PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, &amp;quot;SW1:7&amp;quot; )&lt;br /&gt;
 PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, &amp;quot;SW1:6&amp;quot; )&lt;br /&gt;
 PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION(&amp;quot;SW1:5&amp;quot;)&lt;br /&gt;
 PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )&lt;br /&gt;
 PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )&lt;br /&gt;
 PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION(&amp;quot;SW1:4,3&amp;quot;)&lt;br /&gt;
 PORT_DIPSETTING(    0x00, &amp;quot;5000&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0x10, &amp;quot;8000&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0x20, &amp;quot;10000&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0x30, &amp;quot;No Bonus&amp;quot; )&lt;br /&gt;
 PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION(&amp;quot;SW1:2,1&amp;quot;)&lt;br /&gt;
 PORT_DIPSETTING(    0x00, &amp;quot;2&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0xc0, &amp;quot;3&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0x80, &amp;quot;4&amp;quot; )&lt;br /&gt;
 PORT_DIPSETTING(    0x40, &amp;quot;5&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
==More Information==&lt;br /&gt;
&lt;br /&gt;
To generate a list of games which have dips marked as unknown do the following GREP,&lt;br /&gt;
&lt;br /&gt;
grep PORT_DIPNAME src/mame/drivers/*.c | grep Unknown&lt;br /&gt;
&lt;br /&gt;
or a list of games with unknown dips, but is a few releases out of date can be found here&lt;br /&gt;
&lt;br /&gt;
http://www.mameworld.net/gurudumps/DumpingProject/diplist.html&lt;/div&gt;</summary>
		<author><name>Mellery</name></author>
	</entry>
	<entry>
		<id>https://wiki.mamedev.org/index.php?title=DIP_Switches_in_MAME&amp;diff=265</id>
		<title>DIP Switches in MAME</title>
		<link rel="alternate" type="text/html" href="https://wiki.mamedev.org/index.php?title=DIP_Switches_in_MAME&amp;diff=265"/>
		<updated>2007-02-24T17:52:22Z</updated>

		<summary type="html">&lt;p&gt;Mellery: /* How DIP Switches are Coded in MAME */  correction&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=DIP Switches in MAME=&lt;br /&gt;
&lt;br /&gt;
DIP switches were used by arcade games to allow certain settings like difficulty, cost per play, number of lives, etc.  For more info and pictures of DIP switches see the [http://en.wikipedia.org/wiki/Dip_switch Wikipedia article].  DIP Switches can be viewed and set in game by pressing TAB and going to the menu marked DIP Switches.&lt;br /&gt;
&lt;br /&gt;
A large number of DIP switch settings are not documented, and thus marked as Unknown.  Some games will not run or will display wrong colors if DIP switches are not set correctly, so figuring out what these unknown switches do can be helpful.  What these switches do can be determined by looking at the games code, reading the game&#039;s operator manual, or by just adjusting the DIP switches and observing how the game runs differently (this method is usually not enough to figure out what most switches do).  Also, some games manuals do not cover different regions or versions or the same game, so what the settings should be checked in game to verify the manual is correct.  &lt;br /&gt;
&lt;br /&gt;
==How DIP Switches work==&lt;br /&gt;
&lt;br /&gt;
(a picture a of dipswitch would help here) http://en.wikipedia.org/wiki/Image:Dipswitch.JPG&lt;br /&gt;
&lt;br /&gt;
Dip switches usually come in packages of 8, and from left to right are numbered 1 to 8.  DIP Switch 8 would be the least significant bit (LSB0 and DIP Switch 1 would be the most significant bit (MSB).  DIP Switches are binary (they can be ON or OFF, 1 or 0).  So using binary, from MSB to LSB the switches have the values 128 64 32 16 8 4 2 1 equaling 256 different possible combinations!  &lt;br /&gt;
&lt;br /&gt;
==How DIP Switches are Coded in MAME==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_DIPNAME&#039;&#039;&#039; is used as the name of what the setting does and follows the format&lt;br /&gt;
&lt;br /&gt;
PORT_DIPNAME( dip value, default position, name)&lt;br /&gt;
&lt;br /&gt;
Where dip value and default position are in hex, and name is a string.&lt;br /&gt;
&lt;br /&gt;
Some settings need more than one switch, so dip value and position could be the sum of a few switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_DIPSETTING&#039;&#039;&#039; is used to define each setting and follows the format&lt;br /&gt;
&lt;br /&gt;
PORT_DIPSETTING( position, name )&lt;br /&gt;
&lt;br /&gt;
Where position is in hex, and name is a string.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_DIPLOCATION&#039;&#039;&#039; defines which switches are used and are shown in the DIP Switch menu&lt;br /&gt;
&lt;br /&gt;
PORT_DIPLOCATION(&amp;quot;switch:x&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Where switch is the name of the DIP Switch on the PCB, and x are the numbers of the dip switches used separated by comma.&lt;br /&gt;
&lt;br /&gt;
PORT_DIPLOCATION was recently added to MAME and most drivers still need someone to add the dip locations &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_DIPUNUSED_DIPLOC&#039;&#039;&#039; is a shorthand way of adding dips when they are unused.  If a board has multiple unused DIPs they should each have there own PORT_DIPUNUSED_DIPLOC so they can still each be individually toggled.&lt;br /&gt;
&lt;br /&gt;
PORT_DIPUNUSED_DIPLOC( dip value, default position, &amp;quot;switch:x&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
Here is the code used to define DIP Switch 0 for the game Zero Hour from the driver redclash.c.  Zero Hour uses an addition DIP Switch DSW1 which is not shown here.  Look in the MAME source for many more examples.  First the dip settings as defined in the operator&#039;s manual, and then the actual code.&lt;br /&gt;
&lt;br /&gt;
Setting the number of lives uses SW1 and SW2&lt;br /&gt;
&amp;lt;br&amp;gt;          SW1 SW2&lt;br /&gt;
&amp;lt;br&amp;gt;2 lives = on  on&lt;br /&gt;
&amp;lt;br&amp;gt;3 lives = off off&lt;br /&gt;
&amp;lt;br&amp;gt;4 lives = off on&lt;br /&gt;
&amp;lt;br&amp;gt;5 lives = on  off&lt;br /&gt;
&lt;br /&gt;
Setting the required score for additional spaceship uses SW3 and SW 4&lt;br /&gt;
&amp;lt;br&amp;gt;             SW3 SW4&lt;br /&gt;
&amp;lt;br&amp;gt;over 5000  = off off&lt;br /&gt;
&amp;lt;br&amp;gt;over 8000  = off on&lt;br /&gt;
&amp;lt;br&amp;gt;over 10000 = on  off&lt;br /&gt;
&amp;lt;br&amp;gt;no extra   = on  on&lt;br /&gt;
&lt;br /&gt;
Setting the mode of the game uses SW5&lt;br /&gt;
&amp;lt;br&amp;gt;Table   = off&lt;br /&gt;
&amp;lt;br&amp;gt;Upright = on&lt;br /&gt;
&lt;br /&gt;
SW6 SW7 and SW8 are not used&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_START	/* DSW0 */&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, &amp;quot;SW1:8&amp;quot; ) 	/* Switches 6-8 are not used */&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, &amp;quot;SW1:7&amp;quot; )&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, &amp;quot;SW1:6&amp;quot; )&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION(&amp;quot;SW1:5&amp;quot;)&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION(&amp;quot;SW1:4,3&amp;quot;)&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPSETTING(    0x00, &amp;quot;5000&amp;quot; )&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPSETTING(    0x10, &amp;quot;8000&amp;quot; )&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPSETTING(    0x20, &amp;quot;10000&amp;quot; )&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPSETTING(    0x30, &amp;quot;No Bonus&amp;quot; )&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION(&amp;quot;SW1:2,1&amp;quot;)&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPSETTING(    0x00, &amp;quot;2&amp;quot; )&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPSETTING(    0xc0, &amp;quot;3&amp;quot; )&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPSETTING(    0x80, &amp;quot;4&amp;quot; )&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPSETTING(    0x40, &amp;quot;5&amp;quot; )&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==More Information==&lt;br /&gt;
&lt;br /&gt;
To generate a list of games which have dips marked as unknown do the following GREP,&lt;br /&gt;
&lt;br /&gt;
grep PORT_DIPNAME src/mame/drivers/*.c | grep Unknown&lt;br /&gt;
&lt;br /&gt;
or a list of games with unknown dips, but is a few releases out of date can be found here&lt;br /&gt;
&lt;br /&gt;
http://www.mameworld.net/gurudumps/DumpingProject/diplist.html&lt;/div&gt;</summary>
		<author><name>Mellery</name></author>
	</entry>
	<entry>
		<id>https://wiki.mamedev.org/index.php?title=DIP_Switches_in_MAME&amp;diff=264</id>
		<title>DIP Switches in MAME</title>
		<link rel="alternate" type="text/html" href="https://wiki.mamedev.org/index.php?title=DIP_Switches_in_MAME&amp;diff=264"/>
		<updated>2007-02-24T17:48:22Z</updated>

		<summary type="html">&lt;p&gt;Mellery: Created article, could still use some formating and editing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=DIP Switches in MAME=&lt;br /&gt;
&lt;br /&gt;
DIP switches were used by arcade games to allow certain settings like difficulty, cost per play, number of lives, etc.  For more info and pictures of DIP switches see the [http://en.wikipedia.org/wiki/Dip_switch Wikipedia article].  DIP Switches can be viewed and set in game by pressing TAB and going to the menu marked DIP Switches.&lt;br /&gt;
&lt;br /&gt;
A large number of DIP switch settings are not documented, and thus marked as Unknown.  Some games will not run or will display wrong colors if DIP switches are not set correctly, so figuring out what these unknown switches do can be helpful.  What these switches do can be determined by looking at the games code, reading the game&#039;s operator manual, or by just adjusting the DIP switches and observing how the game runs differently (this method is usually not enough to figure out what most switches do).  Also, some games manuals do not cover different regions or versions or the same game, so what the settings should be checked in game to verify the manual is correct.  &lt;br /&gt;
&lt;br /&gt;
==How DIP Switches work==&lt;br /&gt;
&lt;br /&gt;
(a picture a of dipswitch would help here) http://en.wikipedia.org/wiki/Image:Dipswitch.JPG&lt;br /&gt;
&lt;br /&gt;
Dip switches usually come in packages of 8, and from left to right are numbered 1 to 8.  DIP Switch 8 would be the least significant bit (LSB0 and DIP Switch 1 would be the most significant bit (MSB).  DIP Switches are binary (they can be ON or OFF, 1 or 0).  So using binary, from MSB to LSB the switches have the values 128 64 32 16 8 4 2 1 equaling 256 different possible combinations!  &lt;br /&gt;
&lt;br /&gt;
==How DIP Switches are Coded in MAME==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_DIPNAME&#039;&#039;&#039; is used as the name of what the setting does and follows the format&lt;br /&gt;
&lt;br /&gt;
PORT_DIPNAME( dip value, default position, name)&lt;br /&gt;
&lt;br /&gt;
Where dip value and default position are in hex, and name is a string.&lt;br /&gt;
&lt;br /&gt;
Some settings need more than one switch, so dip value and position could be the sum of a few switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_DIPSETTING&#039;&#039;&#039; is used to define each setting and follows the format&lt;br /&gt;
&lt;br /&gt;
PORT_DIPSETTING( position, name )&lt;br /&gt;
&lt;br /&gt;
Where position is in hex, and name is a string.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_DIPLOCATION&#039;&#039;&#039; defines which switches are used and are shown in the DIP Switch menu&lt;br /&gt;
&lt;br /&gt;
PORT_DIPLOCATION(&amp;quot;switch:x&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Where switch is the name of the DIP Switch on the PCB, and x are the numbers of the dip switches used separated by comma.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PORT_DIPUNUSED_DIPLOC&#039;&#039;&#039; is a shorthand way of adding dips when they are unused.  If a board has multiple unused DIPs they should each have there own PORT_DIPUNUSED_DIPLOC so they can still each be individually toggled.&lt;br /&gt;
&lt;br /&gt;
PORT_DIPUNUSED_DIPLOC( dip value, default position, &amp;quot;switch:x&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
PORT_DIPUNUSED_DIPLOC was recently added to MAME and most drivers still need someone to add the dip locations &lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
Here is the code used to define DIP Switch 0 for the game Zero Hour from the driver redclash.c.  Zero Hour uses an addition DIP Switch DSW1 which is not shown here.  Look in the MAME source for many more examples.  First the dip settings as defined in the operator&#039;s manual, and then the actual code.&lt;br /&gt;
&lt;br /&gt;
Setting the number of lives uses SW1 and SW2&lt;br /&gt;
&amp;lt;br&amp;gt;          SW1 SW2&lt;br /&gt;
&amp;lt;br&amp;gt;2 lives = on  on&lt;br /&gt;
&amp;lt;br&amp;gt;3 lives = off off&lt;br /&gt;
&amp;lt;br&amp;gt;4 lives = off on&lt;br /&gt;
&amp;lt;br&amp;gt;5 lives = on  off&lt;br /&gt;
&lt;br /&gt;
Setting the required score for additional spaceship uses SW3 and SW 4&lt;br /&gt;
&amp;lt;br&amp;gt;             SW3 SW4&lt;br /&gt;
&amp;lt;br&amp;gt;over 5000  = off off&lt;br /&gt;
&amp;lt;br&amp;gt;over 8000  = off on&lt;br /&gt;
&amp;lt;br&amp;gt;over 10000 = on  off&lt;br /&gt;
&amp;lt;br&amp;gt;no extra   = on  on&lt;br /&gt;
&lt;br /&gt;
Setting the mode of the game uses SW5&lt;br /&gt;
&amp;lt;br&amp;gt;Table   = off&lt;br /&gt;
&amp;lt;br&amp;gt;Upright = on&lt;br /&gt;
&lt;br /&gt;
SW6 SW7 and SW8 are not used&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_START	/* DSW0 */&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, &amp;quot;SW1:8&amp;quot; ) 	/* Switches 6-8 are not used */&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, &amp;quot;SW1:7&amp;quot; )&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, &amp;quot;SW1:6&amp;quot; )&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION(&amp;quot;SW1:5&amp;quot;)&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION(&amp;quot;SW1:4,3&amp;quot;)&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPSETTING(    0x00, &amp;quot;5000&amp;quot; )&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPSETTING(    0x10, &amp;quot;8000&amp;quot; )&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPSETTING(    0x20, &amp;quot;10000&amp;quot; )&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPSETTING(    0x30, &amp;quot;No Bonus&amp;quot; )&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION(&amp;quot;SW1:2,1&amp;quot;)&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPSETTING(    0x00, &amp;quot;2&amp;quot; )&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPSETTING(    0xc0, &amp;quot;3&amp;quot; )&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPSETTING(    0x80, &amp;quot;4&amp;quot; )&lt;br /&gt;
&amp;lt;br&amp;gt;PORT_DIPSETTING(    0x40, &amp;quot;5&amp;quot; )&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==More Information==&lt;br /&gt;
&lt;br /&gt;
To generate a list of games which have dips marked as unknown do the following GREP,&lt;br /&gt;
&lt;br /&gt;
grep PORT_DIPNAME src/mame/drivers/*.c | grep Unknown&lt;br /&gt;
&lt;br /&gt;
or a list of games with unknown dips, but is a few releases out of date can be found here&lt;br /&gt;
&lt;br /&gt;
http://www.mameworld.net/gurudumps/DumpingProject/diplist.html&lt;/div&gt;</summary>
		<author><name>Mellery</name></author>
	</entry>
	<entry>
		<id>https://wiki.mamedev.org/index.php?title=How_MAME_Works&amp;diff=263</id>
		<title>How MAME Works</title>
		<link rel="alternate" type="text/html" href="https://wiki.mamedev.org/index.php?title=How_MAME_Works&amp;diff=263"/>
		<updated>2007-02-24T15:59:17Z</updated>

		<summary type="html">&lt;p&gt;Mellery: adding link to dipswitch page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following is a list of documents describing the internal workings (core) of the MAME emulator.  Most are penned by Aaron Giles.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://aarongiles.com/?p=146 Resource Management in MAME]&lt;br /&gt;
&lt;br /&gt;
[http://aarongiles.com/?p=137 CPU Scheduling in MAME]&lt;br /&gt;
&lt;br /&gt;
[http://aarongiles.com/?p=74 Filters and streams in the MAME Sound System]&lt;br /&gt;
&lt;br /&gt;
[[MAME Interrupt Function Review]]&lt;br /&gt;
&lt;br /&gt;
[[Executing Code Out of a Memory Region With a Read Handler]]&lt;br /&gt;
&lt;br /&gt;
[http://aarongiles.com/?p=149 Save State Fundamentals]&lt;br /&gt;
&lt;br /&gt;
[[Using the GFX/TileMap viewer (F4)]]&lt;br /&gt;
&lt;br /&gt;
[http://aarongiles.com/?p=182 How To Use the &#039;New&#039; Renderer]&lt;br /&gt;
&lt;br /&gt;
[http://aarongiles.com/?p=161 Layouts and Rendering for MAME Artwork System]&lt;br /&gt;
&lt;br /&gt;
[http://aarongiles.com/?p=180 Writing Messages to the Screen In a MAME Driver]&lt;br /&gt;
&lt;br /&gt;
[http://aarongiles.com/?p=159 Programmable Logic Devices in MAME]&lt;br /&gt;
&lt;br /&gt;
[http://aarongiles.com/?p=195 Checklist for Cleaning Up Drivers]&lt;br /&gt;
&lt;br /&gt;
[http://aarongiles.com/?p=199 Building under Windows Vista]&lt;br /&gt;
&lt;br /&gt;
[[DIP Switches in MAME]]&lt;/div&gt;</summary>
		<author><name>Mellery</name></author>
	</entry>
</feed>