Previous Thread
Next Thread
Print Thread
Joined: Feb 2014
Posts: 816
Likes: 30
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 816
Likes: 30
Hi guys,

was trying to set up the dip switches for the mx80 and noticed that there's a setting that crosses dip switches.


There's three switches that set the country, sw1-7, sw2-1 and sw 2-2.

Since it crosses a dip switch, what's the best way to handle this?

something like:

sw 1-7 ON = USA/France/Germany/England
sw 1-7 OFF = Denmark/Sweden/Italy/Spain

sw 2-1 2-2 ON ON = USA/Denmark
ON OFF = France/Sweden
OFF ON = Germany/Italy
OFF OFF = England/Spain

the formatting here is lousy since I copy/pasted from a pdf manual:

SW1-7
SW2-1
SW2-2
Country

ON
ON
ON
U.S.A.

ON
ON
OFF
FRANCE

ON
OFF
ON
GERMANY

ON
OFF
OFF
ENGLAND

OFF
ON
ON
DENMARK

OFF
ON
OFF
SWEDEN

OFF
OFF
ON
ITALY

OFF
OFF
OFF
SPAIN

Joined: Mar 2002
Posts: 1,250
Likes: 41
H
hap Offline
Very Senior Member
Offline
Very Senior Member
H
Joined: Mar 2002
Posts: 1,250
Likes: 41
Add a new 3 bit port "COUNTRY", and in the SW input ports, add a PORT_CUSTOM with PORT_CONDITION on those switches.
I don't know if PORT_DIPLOCATION can cope with it.

Joined: May 2004
Posts: 1,704
Likes: 2
H
Very Senior Member
Offline
Very Senior Member
H
Joined: May 2004
Posts: 1,704
Likes: 2
I thought creating fake ports in such a way was highly discouraged.

Joined: Feb 2014
Posts: 816
Likes: 30
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 816
Likes: 30
It didn't end up as ugly as I thought it'd be.

You just have to set two settings instead of one.

Code
	PORT_START("DIPSW1")
	PORT_DIPNAME(0x01, 0x00, "Line Spacing") PORT_DIPLOCATION("SW 1:!1")
	PORT_DIPSETTING(   0x00, "1/6\"")
	PORT_DIPSETTING(   0x01, "1/8\"")
	PORT_DIPNAME(0x02, 0x00, "Form Length") PORT_DIPLOCATION("SW 1:!2")
	PORT_DIPSETTING(   0x00, "11\"")
	PORT_DIPSETTING(   0x02, "12\"")
	PORT_DIPNAME(0x0c, 0x00, "Character Size") PORT_DIPLOCATION("SW 1:!3,!4")
	PORT_DIPSETTING(   0x00, "Normal (80)")
	PORT_DIPSETTING(   0x08, "Condensed (132)")
	PORT_DIPSETTING(   0x0c, "Emphasized (80)") 
	PORT_DIPNAME(0x10, 0x00, "Always leave OFF") PORT_DIPLOCATION("SW 1:!5")
	PORT_DIPSETTING(   0x00, DEF_STR(Off))
	PORT_DIPSETTING(   0x10, DEF_STR(On))
	PORT_DIPNAME(0x20, 0x00, "Paper End Detector") PORT_DIPLOCATION("SW 1:!6")
	PORT_DIPSETTING(   0x00, "Valid")
	PORT_DIPSETTING(   0x20, "Invalid")
	PORT_DIPNAME(0x40, 0x40, "Intl. character set") PORT_DIPLOCATION("SW 1:!7")
	PORT_DIPSETTING(   0x00, "Denmark/Sweden/Italy/Spain")
	PORT_DIPSETTING(   0x40, "USA/France/Germany/England")
	PORT_DIPNAME(0x80, 0x00, "Select In") PORT_DIPLOCATION("SW 1:!8")
	PORT_DIPSETTING(   0x00, "Not Fixed")
	PORT_DIPSETTING(   0x80, "Fixed")

	PORT_START("DIPSW2")
	PORT_DIPNAME(0x03, 0x03, "Intl. character set") PORT_DIPLOCATION("SW 2:!1,!2")
	PORT_DIPSETTING(   0x00, "UK/Spanish")
	PORT_DIPSETTING(   0x01, "French/Swedish")
	PORT_DIPSETTING(   0x02, "German/Italian")
	PORT_DIPSETTING(   0x03, "USA/Danish")
	PORT_DIPNAME(0x04, 0x00, "Auto Feed Signal") PORT_DIPLOCATION("SW 2:!3")
	PORT_DIPSETTING(   0x00, "Not Fixed")
	PORT_DIPSETTING(   0x04, "Fixed")
	PORT_DIPNAME(0x08, 0x08, "Skip-over-perforation") PORT_DIPLOCATION("SW 2:!4")
	PORT_DIPSETTING(   0x00, "1 inch")
	PORT_DIPSETTING(   0x08, DEF_STR(None))

For fun segfaults I accidentally had a space in DIPLOCATION("SW 2:!1, !2") << before the !2 part since I've gotten so much in the habit of putting spaces after commas and it made the dip switch very loooooooong.

[Linked Image from i.imgur.com]

PORT_DIPNAME(0x03, 0x03, "Intl. character set") PORT_DIPLOCATION("SW 2:!1,!2")


Link Copied to Clipboard
Who's Online Now
1 members (Golden Child), 22 guests, and 1 robot.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics9,085
Posts119,077
Members5,014
Most Online890
Jan 17th, 2020
Our Sponsor
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!

Superior Solitaire
Forum hosted by www.retrogamesformac.com