|
Rotary DIP switches
#193940 - 06/22/09 10:53 AM
|
|
|
Just wondering if these types of DIP switches are supported in MAME ? If not then what would be the best way to go about it.
I have four of these on the board that I am emulating.
Thanks..
|
|
|
|
Re: Rotary DIP switches
[Re: palindrome]
#193943 - 06/22/09 12:37 PM
|
|
|
> Just wondering if these types of DIP switches are supported in MAME ? If not then > what would be the best way to go about it. > > I have four of these on the board that I am emulating. > > Thanks..
They usually behave like four DIP switches and make BCD codes.
|
|
|
|
Re: Rotary DIP switches
[Re: Vas Crabb]
#194008 - 06/23/09 07:38 AM
|
|
|
Do you mean 4 independent switches for each DIP package ?
That will give max binary value of 0x0F with all of the switches on per DIP but I only need to use a value from 0x0 to 0x9.
Thanks
|
|
|
|
Re: Rotary DIP switches
[Re: palindrome]
#194037 - 06/23/09 01:46 PM
|
|
|
> Do you mean 4 independent switches for each DIP package ? > > That will give max binary value of 0x0F with all of the switches on per DIP but I > only need to use a value from 0x0 to 0x9. > > Thanks
Do you know what BCD is?
|
|
|
Kale |
Il Sindaco
|
|
|
Reged: 09/26/03
|
Posts: 155
|
Loc: Naples, Italy
|
|
Send PM
|
|
|
Re: Rotary DIP switches
[Re: palindrome]
#194061 - 06/23/09 05:24 PM
|
|
|
Code:
PORT_START("name_of_the_bcd_dipsw_tag") PORT_DIPNAME( 0x0f, default_val, whatever_the_dip_does ) //BCD DIP-SW PORT_DIPSETTING( 0x00, "value_0" ) PORT_DIPSETTING( 0x01, "value_1" ) ... PORT_DIPSETTING( 0x09, "value_9" ) //A-F invalid / doesn't exist
In short, it's not necessary that you call all the dipsettings of a given input (there are various examples in the source that does that).
|
|
|
|
Re: Rotary DIP switches
[Re: Kale]
#194135 - 06/24/09 05:00 AM
|
|
|
Thanks Kale, that works well with my read handler.
|
|
|