mirror of
https://github.com/holub/mame
synced 2025-04-19 23:12:11 +03:00
(MESS) apple2: rewrote keyboard handling according to schematics and using the generic AY-3600. [R. Belmont]
nw: next up, devcb2 the generic 3600.
This commit is contained in:
parent
6fa4137852
commit
93a00f2b0b
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -7879,8 +7879,6 @@ src/mess/machine/at_keybc.h svneol=native#text/plain
|
||||
src/mess/machine/ataricrt.c svneol=native#text/plain
|
||||
src/mess/machine/atarifdc.c svneol=native#text/plain
|
||||
src/mess/machine/atarifdc.h svneol=native#text/plain
|
||||
src/mess/machine/ay3600.c svneol=native#text/plain
|
||||
src/mess/machine/ay3600.h svneol=native#text/plain
|
||||
src/mess/machine/b2m.c svneol=native#text/plain
|
||||
src/mess/machine/bbc.c svneol=native#text/plain
|
||||
src/mess/machine/bebox.c svneol=native#text/plain
|
||||
|
@ -336,76 +336,180 @@ static INPUT_PORTS_START( apple2_gameport )
|
||||
//PORT_INCLUDE( apple2_paddle )
|
||||
INPUT_PORTS_END
|
||||
|
||||
/*
|
||||
Apple II / II Plus key matrix (from "The Apple II Circuit Description")
|
||||
|
||||
| Y0 | Y1 | Y2 | Y3 | Y4 | Y5 | Y6 | Y7 | Y8 | Y9 |
|
||||
| | | | | | | | | | |
|
||||
----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
|
||||
X0 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | :* | - |
|
||||
----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
|
||||
X1 | Q | W | E | R | T | Y | U | I | O | P |
|
||||
----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
|
||||
X2 | D | F | G | H | J | K | L | ;+ |LEFT |RIGHT|
|
||||
----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
|
||||
X3 | Z | X | C | V | B | N | M | ,< | .> | /? |
|
||||
----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
|
||||
X4 | S | 2 | 1 | ESC | A |SPACE| | | |ENTER|
|
||||
----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
|
||||
*/
|
||||
|
||||
/*
|
||||
Apple IIe & IIc key matrix (from "Sams ComputerFacts: Apple IIe" and "Sams ComputerFacts: Apple IIc")
|
||||
|
||||
| Y0 | Y1 | Y2 | Y3 | Y4 | Y5 | Y6 | Y7 | Y8 | Y9 |
|
||||
| | | | | | | | | | |
|
||||
----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
|
||||
X0 | ESC | 1 | 2 | 3 | 4 | 6 | 5 | 7 | 8 | 9 |
|
||||
----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
|
||||
X1 | TAB | Q | W | E | R | Y | T | U | I | O |
|
||||
----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
|
||||
X2 | A | D | S | H | F | G | J | K | ;: | L |
|
||||
----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
|
||||
X3 | Z | X | C | V | B | M | N | ,< | .> | /? |
|
||||
----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
|
||||
X4 | | | | | | | \| | += | 0 | -_ |
|
||||
----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
|
||||
X5 | | | | | | | `~ | P | [{ | ]} |
|
||||
----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
|
||||
X6 | | | | | | |RETRN| UP | SPC | '" |
|
||||
----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
|
||||
X7 | | | | | | | DEL |DOWN |LEFT |RIGHT|
|
||||
----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
|
||||
*/
|
||||
|
||||
/*
|
||||
Apple IIe platinum key matrix
|
||||
|
||||
| Y0 | Y1 | Y2 | Y3 | Y4 | Y5 | Y6 | Y7 | Y8 | Y9 |
|
||||
| | | | | | | | | | |
|
||||
----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
|
||||
X0 | ESC | 1 | 2 | 3 | 4 | 6 | 5 | 7 | 8 | 9 |
|
||||
----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
|
||||
X1 | TAB | Q | W | E | R | Y | T | U | I | O |
|
||||
----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
|
||||
X2 | A | D | S | H | F | G | J | K | ;: | L |
|
||||
----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
|
||||
X3 | Z | X | C | V | B | M | N | ,< | .> | /? |
|
||||
----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
|
||||
X4 | KP/ | | KP0 | KP1 | KP2 | KP3 | \| | += | 0 | -_ |
|
||||
----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
|
||||
X5 | |KPEsc| KP4 | KP5 | KP6 | KP7 | `~ | P | [{ | ]} |
|
||||
----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
|
||||
X6 | KP* | | KP8 | KP9 | KP. | KP+ |RETRN| UP | SPC | '" |
|
||||
----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
|
||||
X7 | | | | KP- |KPENT| | DEL |DOWN |LEFT |RIGHT|
|
||||
----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----|
|
||||
*/
|
||||
|
||||
static INPUT_PORTS_START( apple2_common )
|
||||
PORT_START("keyb_0")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_LEFT) PORT_CODE(KEYCODE_LEFT)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Return") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_RIGHT) PORT_CODE(KEYCODE_RIGHT)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Esc") PORT_CODE(KEYCODE_ESC) PORT_CHAR(27)
|
||||
PORT_START("X0")
|
||||
PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#')
|
||||
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$')
|
||||
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&')
|
||||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%')
|
||||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'')
|
||||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(')
|
||||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')')
|
||||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')')
|
||||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':')
|
||||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_')
|
||||
|
||||
PORT_START("keyb_1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR(':') PORT_CHAR('*')
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>')
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?')
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0')
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')
|
||||
PORT_START("X1")
|
||||
PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') PORT_CHAR('q')
|
||||
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('W') PORT_CHAR('w')
|
||||
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('E') PORT_CHAR('e')
|
||||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('R') PORT_CHAR('r')
|
||||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('T') PORT_CHAR('t')
|
||||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') PORT_CHAR('y')
|
||||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('U') PORT_CHAR('u')
|
||||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('I') PORT_CHAR('i')
|
||||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('O') PORT_CHAR('o')
|
||||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('P') PORT_CHAR('p')
|
||||
|
||||
PORT_START("keyb_2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('\"')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%')
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&')
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'')
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(')
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')')
|
||||
PORT_START("X2")
|
||||
PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('D') PORT_CHAR('d')
|
||||
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('F') PORT_CHAR('f')
|
||||
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('G') PORT_CHAR('g')
|
||||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('H') PORT_CHAR('h')
|
||||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('J') PORT_CHAR('j')
|
||||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('K') PORT_CHAR('k')
|
||||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('L') PORT_CHAR('l')
|
||||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+')
|
||||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_LEFT) PORT_CODE(KEYCODE_LEFT)
|
||||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_RIGHT) PORT_CODE(KEYCODE_RIGHT)
|
||||
|
||||
PORT_START("keyb_3")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR('+')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('-') PORT_CHAR('=')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('A')
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('B')
|
||||
PORT_START("X3")
|
||||
PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') PORT_CHAR('z')
|
||||
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('X') PORT_CHAR('x')
|
||||
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('C') PORT_CHAR('c')
|
||||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('V') PORT_CHAR('v')
|
||||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('B') PORT_CHAR('b')
|
||||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('M') PORT_CHAR('m')
|
||||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_CHAR('n')
|
||||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<')
|
||||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>')
|
||||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?')
|
||||
|
||||
PORT_START("keyb_4")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('C')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('D')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('E')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('F')
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('G')
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('H')
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('I')
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('J')
|
||||
PORT_START("X4")
|
||||
PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('S') PORT_CHAR('s')
|
||||
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('\"')
|
||||
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')
|
||||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Esc") PORT_CODE(KEYCODE_ESC) PORT_CHAR(27)
|
||||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('A') PORT_CHAR('a')
|
||||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
|
||||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Return") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
|
||||
|
||||
PORT_START("keyb_5")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('K')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('L')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('M') PORT_CHAR(']')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_CHAR('^')
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('O')
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('P') PORT_CHAR('@')
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q')
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('R')
|
||||
PORT_START("X5")
|
||||
PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
|
||||
PORT_START("keyb_6")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('S')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('T')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('U')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('V')
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('W')
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('X')
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y')
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z')
|
||||
PORT_START("X6")
|
||||
PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
|
||||
PORT_START("X7")
|
||||
PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
|
||||
PORT_START("X8")
|
||||
PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
|
||||
PORT_START("keyb_special")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
@ -437,75 +541,113 @@ static INPUT_PORTS_START( apple2p )
|
||||
INPUT_PORTS_END
|
||||
|
||||
static INPUT_PORTS_START( apple2e_common )
|
||||
PORT_START("keyb_0")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Delete") PORT_CODE(KEYCODE_BACKSPACE)PORT_CHAR(8)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_LEFT) PORT_CODE(KEYCODE_LEFT)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Tab") PORT_CODE(KEYCODE_TAB) PORT_CHAR(9)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_DOWN) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(10)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_UP) PORT_CODE(KEYCODE_UP)
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Return") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_RIGHT) PORT_CODE(KEYCODE_RIGHT)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Esc") PORT_CODE(KEYCODE_ESC) PORT_CHAR(27)
|
||||
PORT_START("X0")
|
||||
PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Esc") PORT_CODE(KEYCODE_ESC) PORT_CHAR(27)
|
||||
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')
|
||||
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('\"')
|
||||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#')
|
||||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$')
|
||||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&')
|
||||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%')
|
||||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'')
|
||||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(')
|
||||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')')
|
||||
|
||||
PORT_START("keyb_1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('\"')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_')
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>')
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?')
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')')
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')
|
||||
PORT_START("X1")
|
||||
PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Tab") PORT_CODE(KEYCODE_TAB) PORT_CHAR(9)
|
||||
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') PORT_CHAR('q')
|
||||
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('W') PORT_CHAR('w')
|
||||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('E') PORT_CHAR('e')
|
||||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('R') PORT_CHAR('r')
|
||||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') PORT_CHAR('y')
|
||||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('T') PORT_CHAR('t')
|
||||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('U') PORT_CHAR('u')
|
||||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('I') PORT_CHAR('i')
|
||||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('O') PORT_CHAR('o')
|
||||
|
||||
PORT_START("keyb_2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%')
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^')
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&')
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*')
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(')
|
||||
PORT_START("X2")
|
||||
PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('A') PORT_CHAR('a')
|
||||
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('D') PORT_CHAR('d')
|
||||
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('S') PORT_CHAR('s')
|
||||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('H') PORT_CHAR('h')
|
||||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('F') PORT_CHAR('f')
|
||||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('G') PORT_CHAR('g')
|
||||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('J') PORT_CHAR('j')
|
||||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('K') PORT_CHAR('k')
|
||||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':')
|
||||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('L') PORT_CHAR('l')
|
||||
|
||||
PORT_START("keyb_3")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|')
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}')
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('`') PORT_CHAR('~')
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('A') PORT_CHAR('a')
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('B') PORT_CHAR('b')
|
||||
PORT_START("X3")
|
||||
PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') PORT_CHAR('z')
|
||||
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('X') PORT_CHAR('x')
|
||||
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('C') PORT_CHAR('c')
|
||||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('V') PORT_CHAR('v')
|
||||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('B') PORT_CHAR('b')
|
||||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('M') PORT_CHAR('m')
|
||||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_CHAR('n')
|
||||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<')
|
||||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>')
|
||||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?')
|
||||
|
||||
PORT_START("keyb_4")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('C') PORT_CHAR('c')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('D') PORT_CHAR('d')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('E') PORT_CHAR('e')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('F') PORT_CHAR('f')
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('G') PORT_CHAR('g')
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('H') PORT_CHAR('h')
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('I') PORT_CHAR('i')
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('J') PORT_CHAR('j')
|
||||
PORT_START("X4")
|
||||
PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|')
|
||||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+')
|
||||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')')
|
||||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_')
|
||||
|
||||
PORT_START("keyb_5")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('K') PORT_CHAR('k')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('L') PORT_CHAR('l')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('M') PORT_CHAR('m')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_CHAR('n')
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('O') PORT_CHAR('o')
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('P') PORT_CHAR('p')
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') PORT_CHAR('q')
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('R') PORT_CHAR('r')
|
||||
PORT_START("X5")
|
||||
PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('`') PORT_CHAR('~')
|
||||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('P') PORT_CHAR('p')
|
||||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{')
|
||||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}')
|
||||
|
||||
PORT_START("keyb_6")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('S') PORT_CHAR('s')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('T') PORT_CHAR('t')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('U') PORT_CHAR('u')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('V') PORT_CHAR('v')
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('W') PORT_CHAR('w')
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('X') PORT_CHAR('x')
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') PORT_CHAR('y')
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') PORT_CHAR('z')
|
||||
PORT_START("X6")
|
||||
PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Return") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
|
||||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_UP) PORT_CODE(KEYCODE_UP)
|
||||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
|
||||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('\"')
|
||||
|
||||
PORT_START("X7")
|
||||
PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Delete") PORT_CODE(KEYCODE_BACKSPACE)PORT_CHAR(8)
|
||||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_DOWN) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(10)
|
||||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_LEFT) PORT_CODE(KEYCODE_LEFT)
|
||||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_RIGHT) PORT_CODE(KEYCODE_RIGHT)
|
||||
|
||||
PORT_START("X8")
|
||||
PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
|
||||
PORT_START("keyb_special")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Caps Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE
|
||||
@ -517,37 +659,130 @@ static INPUT_PORTS_START( apple2e_common )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RESET") PORT_CODE(KEYCODE_F12)
|
||||
INPUT_PORTS_END
|
||||
|
||||
static INPUT_PORTS_START( apple2_keypad )
|
||||
PORT_START("keypad_1")
|
||||
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD))
|
||||
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR(UCHAR_MAMEKEY(1_PAD))
|
||||
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR(UCHAR_MAMEKEY(2_PAD))
|
||||
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3_PAD) PORT_CHAR(UCHAR_MAMEKEY(3_PAD))
|
||||
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4_PAD) PORT_CHAR(UCHAR_MAMEKEY(4_PAD))
|
||||
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_5_PAD) PORT_CHAR(UCHAR_MAMEKEY(5_PAD))
|
||||
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_6_PAD) PORT_CHAR(UCHAR_MAMEKEY(6_PAD))
|
||||
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR(UCHAR_MAMEKEY(7_PAD))
|
||||
|
||||
PORT_START("keypad_2")
|
||||
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_8_PAD) PORT_CHAR(UCHAR_MAMEKEY(8_PAD))
|
||||
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9_PAD) PORT_CHAR(UCHAR_MAMEKEY(9_PAD))
|
||||
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH_PAD) PORT_CHAR(UCHAR_MAMEKEY(SLASH_PAD))
|
||||
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR(UCHAR_MAMEKEY(ASTERISK))
|
||||
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(MINUS_PAD))
|
||||
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_PLUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(PLUS_PAD))
|
||||
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_DEL_PAD) PORT_CHAR(UCHAR_MAMEKEY(DEL_PAD))
|
||||
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER_PAD) PORT_CHAR(UCHAR_MAMEKEY(ENTER_PAD))
|
||||
INPUT_PORTS_END
|
||||
|
||||
static INPUT_PORTS_START( apple2e )
|
||||
PORT_INCLUDE( apple2e_common )
|
||||
PORT_INCLUDE( apple2_gameport )
|
||||
INPUT_PORTS_END
|
||||
|
||||
INPUT_PORTS_START( apple2ep )
|
||||
PORT_INCLUDE( apple2e_common )
|
||||
PORT_START("X0")
|
||||
PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Esc") PORT_CODE(KEYCODE_ESC) PORT_CHAR(27)
|
||||
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')
|
||||
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('\"')
|
||||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#')
|
||||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$')
|
||||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&')
|
||||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%')
|
||||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'')
|
||||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(')
|
||||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')')
|
||||
|
||||
PORT_START("X1")
|
||||
PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Tab") PORT_CODE(KEYCODE_TAB) PORT_CHAR(9)
|
||||
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') PORT_CHAR('q')
|
||||
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('W') PORT_CHAR('w')
|
||||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('E') PORT_CHAR('e')
|
||||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('R') PORT_CHAR('r')
|
||||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') PORT_CHAR('y')
|
||||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('T') PORT_CHAR('t')
|
||||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('U') PORT_CHAR('u')
|
||||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('I') PORT_CHAR('i')
|
||||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('O') PORT_CHAR('o')
|
||||
|
||||
PORT_START("X2")
|
||||
PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('A') PORT_CHAR('a')
|
||||
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('D') PORT_CHAR('d')
|
||||
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('S') PORT_CHAR('s')
|
||||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('H') PORT_CHAR('h')
|
||||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('F') PORT_CHAR('f')
|
||||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('G') PORT_CHAR('g')
|
||||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('J') PORT_CHAR('j')
|
||||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('K') PORT_CHAR('k')
|
||||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':')
|
||||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('L') PORT_CHAR('l')
|
||||
|
||||
PORT_START("X3")
|
||||
PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') PORT_CHAR('z')
|
||||
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('X') PORT_CHAR('x')
|
||||
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('C') PORT_CHAR('c')
|
||||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('V') PORT_CHAR('v')
|
||||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('B') PORT_CHAR('b')
|
||||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('M') PORT_CHAR('m')
|
||||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_CHAR('n')
|
||||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<')
|
||||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>')
|
||||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?')
|
||||
|
||||
PORT_START("X4")
|
||||
PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH_PAD) PORT_CHAR(UCHAR_MAMEKEY(SLASH_PAD))
|
||||
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD))
|
||||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR(UCHAR_MAMEKEY(1_PAD))
|
||||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR(UCHAR_MAMEKEY(2_PAD))
|
||||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3_PAD) PORT_CHAR(UCHAR_MAMEKEY(3_PAD))
|
||||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|')
|
||||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+')
|
||||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')')
|
||||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_')
|
||||
|
||||
PORT_START("X5")
|
||||
PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Keypad Esc") PORT_CODE(KEYCODE_NUMLOCK)
|
||||
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4_PAD) PORT_CHAR(UCHAR_MAMEKEY(4_PAD))
|
||||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_5_PAD) PORT_CHAR(UCHAR_MAMEKEY(5_PAD))
|
||||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_6_PAD) PORT_CHAR(UCHAR_MAMEKEY(6_PAD))
|
||||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR(UCHAR_MAMEKEY(7_PAD))
|
||||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('`') PORT_CHAR('~')
|
||||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('P') PORT_CHAR('p')
|
||||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{')
|
||||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}')
|
||||
|
||||
PORT_START("X6")
|
||||
PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR(UCHAR_MAMEKEY(ASTERISK))
|
||||
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_8_PAD) PORT_CHAR(UCHAR_MAMEKEY(8_PAD))
|
||||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9_PAD) PORT_CHAR(UCHAR_MAMEKEY(9_PAD))
|
||||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_DEL_PAD) PORT_CHAR(UCHAR_MAMEKEY(DEL_PAD))
|
||||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_PLUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(PLUS_PAD))
|
||||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Return") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
|
||||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_UP) PORT_CODE(KEYCODE_UP)
|
||||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
|
||||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('\"')
|
||||
|
||||
PORT_START("X7")
|
||||
PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(MINUS_PAD))
|
||||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER_PAD) PORT_CHAR(UCHAR_MAMEKEY(ENTER_PAD))
|
||||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Delete") PORT_CODE(KEYCODE_BACKSPACE)PORT_CHAR(8)
|
||||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_DOWN) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(10)
|
||||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_LEFT) PORT_CODE(KEYCODE_LEFT)
|
||||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_RIGHT) PORT_CODE(KEYCODE_RIGHT)
|
||||
|
||||
PORT_START("X8")
|
||||
PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_UNUSED)
|
||||
|
||||
PORT_START("keyb_special")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Caps Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Left Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Right Shift") PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Control") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Open Apple") PORT_CODE(KEYCODE_LALT)
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Solid Apple") PORT_CODE(KEYCODE_RALT)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RESET") PORT_CODE(KEYCODE_F12)
|
||||
|
||||
PORT_INCLUDE( apple2_gameport )
|
||||
PORT_INCLUDE( apple2_keypad )
|
||||
INPUT_PORTS_END
|
||||
|
||||
/* according to Steve Nickolas (author of Dapple), our original palette would
|
||||
@ -646,6 +881,40 @@ static SLOT_INTERFACE_START(apple2eaux_cards)
|
||||
SLOT_INTERFACE("rw3", A2EAUX_RAMWORKS3) /* Applied Engineering RamWorks III */
|
||||
SLOT_INTERFACE_END
|
||||
|
||||
static AY3600_INTERFACE( ay3600_intf )
|
||||
{
|
||||
DEVCB_INPUT_PORT("X0"),
|
||||
DEVCB_INPUT_PORT("X1"),
|
||||
DEVCB_INPUT_PORT("X2"),
|
||||
DEVCB_INPUT_PORT("X3"),
|
||||
DEVCB_INPUT_PORT("X4"),
|
||||
DEVCB_INPUT_PORT("X5"),
|
||||
DEVCB_INPUT_PORT("X6"),
|
||||
DEVCB_INPUT_PORT("X7"),
|
||||
DEVCB_INPUT_PORT("X8"),
|
||||
DEVCB_DRIVER_LINE_MEMBER(apple2_state, ay3600_shift_r),
|
||||
DEVCB_DRIVER_LINE_MEMBER(apple2_state, ay3600_control_r),
|
||||
DEVCB_DRIVER_LINE_MEMBER(apple2_state, ay3600_data_ready_w),
|
||||
DEVCB_NULL
|
||||
};
|
||||
|
||||
static AY3600_INTERFACE( ay3600_iie_intf )
|
||||
{
|
||||
DEVCB_INPUT_PORT("X0"),
|
||||
DEVCB_INPUT_PORT("X1"),
|
||||
DEVCB_INPUT_PORT("X2"),
|
||||
DEVCB_INPUT_PORT("X3"),
|
||||
DEVCB_INPUT_PORT("X4"),
|
||||
DEVCB_INPUT_PORT("X5"),
|
||||
DEVCB_INPUT_PORT("X6"),
|
||||
DEVCB_INPUT_PORT("X7"),
|
||||
DEVCB_INPUT_PORT("X8"),
|
||||
DEVCB_DRIVER_LINE_MEMBER(apple2_state, ay3600_shift_r),
|
||||
DEVCB_DRIVER_LINE_MEMBER(apple2_state, ay3600_control_r),
|
||||
DEVCB_DRIVER_LINE_MEMBER(apple2_state, ay3600_iie_data_ready_w),
|
||||
DEVCB_NULL
|
||||
};
|
||||
|
||||
static MACHINE_CONFIG_START( apple2_common, apple2_state )
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_ADD("maincpu", M6502, 1021800) /* close to actual CPU frequency of 1.020484 MHz */
|
||||
@ -673,7 +942,7 @@ static MACHINE_CONFIG_START( apple2_common, apple2_state )
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
|
||||
|
||||
/* keyboard controller */
|
||||
MCFG_DEVICE_ADD("ay3600", AY3600N, 0)
|
||||
MCFG_AY3600_ADD("ay3600", 0, ay3600_intf)
|
||||
|
||||
/* slot devices */
|
||||
MCFG_A2BUS_BUS_ADD("a2bus", "maincpu", a2bus_intf)
|
||||
@ -728,6 +997,10 @@ static MACHINE_CONFIG_DERIVED( apple2e, apple2_common )
|
||||
MCFG_RAM_DEFAULT_VALUE(0x00)
|
||||
MCFG_CASSETTE_ADD( "cassette", apple2_cassette_interface )
|
||||
|
||||
/* keyboard controller */
|
||||
MCFG_DEVICE_REMOVE("ay3600")
|
||||
MCFG_AY3600_ADD("ay3600", 0, ay3600_iie_intf)
|
||||
|
||||
// IIe and later have no physical slot 0, the "language card" is built into the motherboard
|
||||
MCFG_A2BUS_SLOT_REMOVE("sl0")
|
||||
MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl0", A2BUS_LANG, NULL)
|
||||
@ -971,11 +1244,11 @@ ROM_START(apple2e)
|
||||
ROM_LOAD ( "342-0134-a.64", 0x2000, 0x2000, CRC(fc3d59d8) SHA1(8895a4b703f2184b673078f411f4089889b61c54))
|
||||
|
||||
ROM_REGION( 0x800, "keyboard", ROMREGION_ERASE00 )
|
||||
ROM_LOAD( "342-0132-c.e12", 0x000, 0x800, CRC(e47045f4) SHA1(12a2e718f5f4acd69b6c33a45a4a940b1440a481) ) // 1983 US-Dvorak
|
||||
// ROM_LOAD_OPTIONAL( "341-0132-a.e12", 0x000, 0x800, CRC(7ded1ac6) SHA1(69f45cd487e8210e37c839df78a0b8930a3a6ac1) ) // 1982 US-DE
|
||||
// ROM_LOAD_OPTIONAL( "341-0150-a.e12", 0x000, 0x800, CRC(66ffacd7) SHA1(47bb9608be38ff75429a989b930a93b47099648e) ) // 1982 US-UK
|
||||
// ROM_LOAD_OPTIONAL( "341-0151-a.e12", 0x000, 0x800, CRC(64574bb4) SHA1(c44809bbb017bfe3c07dc99e87a3a9fa7b9741c3) ) // 1982 US-DE
|
||||
// ROM_LOAD_OPTIONAL( "342-0132-b.e12", 0x000, 0x800, CRC(ecfceb45) SHA1(c2f249589ee02121c27336af022bbca0cc9b2245) ) // 1982 US-Dvorak
|
||||
// ROM_LOAD( "342-0132-c.e12", 0x000, 0x800, CRC(e47045f4) SHA1(12a2e718f5f4acd69b6c33a45a4a940b1440a481) ) // 1983 US-Dvorak
|
||||
// ROM_LOAD_OPTIONAL( "342-0132-b.e12", 0x000, 0x800, CRC(ecfceb45) SHA1(c2f249589ee02121c27336af022bbca0cc9b2245) ) // 1982 US-Dvorak
|
||||
ROM_END
|
||||
|
||||
ROM_START(mprof3)
|
||||
@ -987,6 +1260,8 @@ ROM_START(mprof3)
|
||||
ROM_LOAD ( "mpf3-cd.rom", 0x0000, 0x2000, CRC(5b662e06) SHA1(aa0db775ca78986480829fcc10f00e57629e1a7c))
|
||||
ROM_LOAD ( "mpf3-ef.rom", 0x2000, 0x2000, CRC(2c5e8b92) SHA1(befeb03e04b7c3ef36ef5829948a53880df85e92))
|
||||
|
||||
ROM_REGION( 0x800, "keyboard", ROMREGION_ERASE00 )
|
||||
ROM_LOAD( "342-0132-c.e12", 0x000, 0x800, BAD_DUMP CRC(e47045f4) SHA1(12a2e718f5f4acd69b6c33a45a4a940b1440a481) ) // need to dump real mprof keyboard ROM
|
||||
ROM_END
|
||||
|
||||
ROM_START(apple2ee)
|
||||
@ -1009,6 +1284,10 @@ ROM_START(apple2ep)
|
||||
|
||||
ROM_REGION(0x4700,"maincpu",0)
|
||||
ROM_LOAD ("32-0349-b.128", 0x0000, 0x4000, CRC(1d70b193) SHA1(b8ea90abe135a0031065e01697c4a3a20d51198b)) /* should rom name be 342-0349-b? */
|
||||
|
||||
ROM_REGION( 0x800, "keyboard", 0 )
|
||||
// chip printed markings say 342-0132-d, but internally text says "341-0132-d". Go figure.
|
||||
ROM_LOAD( "341-0132-d.e12", 0x000, 0x800, CRC(c506efb9) SHA1(8e14e85c645187504ec9d162b3ea614a0c421d32) )
|
||||
ROM_END
|
||||
|
||||
ROM_START(apple2c)
|
||||
@ -1018,6 +1297,9 @@ ROM_START(apple2c)
|
||||
|
||||
ROM_REGION(0x4000,"maincpu",0)
|
||||
ROM_LOAD ( "a2c.128", 0x0000, 0x4000, CRC(f0edaa1b) SHA1(1a9b8aca5e32bb702ddb7791daddd60a89655729))
|
||||
|
||||
ROM_REGION( 0x800, "keyboard", ROMREGION_ERASE00 )
|
||||
ROM_LOAD( "342-0132-c.e12", 0x000, 0x800, CRC(e47045f4) SHA1(12a2e718f5f4acd69b6c33a45a4a940b1440a481) ) // 1983 US-Dvorak
|
||||
ROM_END
|
||||
|
||||
ROM_START(tk2000)
|
||||
@ -1083,6 +1365,9 @@ ROM_START(laser128)
|
||||
|
||||
ROM_REGION(0x8700,"maincpu",0)
|
||||
ROM_LOAD("laser128.256", 0x0000, 0x8000, CRC(39E59ED3) SHA1(CBD2F45C923725BFD57F8548E65CC80B13BC18DA))
|
||||
|
||||
ROM_REGION( 0x800, "keyboard", ROMREGION_ERASE00 )
|
||||
ROM_LOAD( "342-0132-c.e12", 0x000, 0x800, BAD_DUMP CRC(e47045f4) SHA1(12a2e718f5f4acd69b6c33a45a4a940b1440a481) ) // need to dump real laser rom
|
||||
ROM_END
|
||||
|
||||
ROM_START(las128ex)
|
||||
@ -1092,6 +1377,9 @@ ROM_START(las128ex)
|
||||
|
||||
ROM_REGION(0x8700,"maincpu",0)
|
||||
ROM_LOAD("las128ex.256", 0x0000, 0x8000, CRC(B67C8BA1) SHA1(8BD5F82A501B1CF9D988C7207DA81E514CA254B0))
|
||||
|
||||
ROM_REGION( 0x800, "keyboard", ROMREGION_ERASE00 )
|
||||
ROM_LOAD( "342-0132-c.e12", 0x000, 0x800, BAD_DUMP CRC(e47045f4) SHA1(12a2e718f5f4acd69b6c33a45a4a940b1440a481) ) // need to dump real laser rom
|
||||
ROM_END
|
||||
|
||||
ROM_START(las128e2)
|
||||
@ -1101,6 +1389,9 @@ ROM_START(las128e2)
|
||||
|
||||
ROM_REGION(0x8700,"maincpu",0)
|
||||
ROM_LOAD( "laser 128ex2 v6.1 rom.bin", 0x000000, 0x008000, CRC(7f911c90) SHA1(125754c1bd777d4c510f5239b96178c6f2e3236b) )
|
||||
|
||||
ROM_REGION( 0x800, "keyboard", ROMREGION_ERASE00 )
|
||||
ROM_LOAD( "342-0132-c.e12", 0x000, 0x800, BAD_DUMP CRC(e47045f4) SHA1(12a2e718f5f4acd69b6c33a45a4a940b1440a481) ) // need to dump real laser rom
|
||||
ROM_END
|
||||
|
||||
ROM_START(apple2cp)
|
||||
@ -1110,6 +1401,9 @@ ROM_START(apple2cp)
|
||||
|
||||
ROM_REGION(0x8700,"maincpu",0)
|
||||
ROM_LOAD("341-0625-a.256", 0x0000, 0x8000, CRC(0b996420) SHA1(1a27ae26966bbafd825d08ad1a24742d3e33557c))
|
||||
|
||||
ROM_REGION( 0x800, "keyboard", ROMREGION_ERASE00 )
|
||||
ROM_LOAD( "341-0132-d.e12", 0x000, 0x800, CRC(c506efb9) SHA1(8e14e85c645187504ec9d162b3ea614a0c421d32) )
|
||||
ROM_END
|
||||
|
||||
ROM_START(ivelultr)
|
||||
|
@ -44,7 +44,6 @@
|
||||
#include "emu.h"
|
||||
#include "cpu/g65816/g65816.h"
|
||||
#include "includes/apple2.h"
|
||||
#include "machine/ay3600.h"
|
||||
#include "imagedev/flopdrv.h"
|
||||
#include "formats/ap2_dsk.h"
|
||||
#include "formats/ap_dsk35.h"
|
||||
@ -320,6 +319,23 @@ static SLOT_INTERFACE_START(apple2_cards)
|
||||
SLOT_INTERFACE("hsscsi", A2BUS_HSSCSI) /* Apple II High-Speed SCSI Card */
|
||||
SLOT_INTERFACE_END
|
||||
|
||||
static AY3600_INTERFACE( ay3600_iie_intf )
|
||||
{
|
||||
DEVCB_INPUT_PORT("X0"),
|
||||
DEVCB_INPUT_PORT("X1"),
|
||||
DEVCB_INPUT_PORT("X2"),
|
||||
DEVCB_INPUT_PORT("X3"),
|
||||
DEVCB_INPUT_PORT("X4"),
|
||||
DEVCB_INPUT_PORT("X5"),
|
||||
DEVCB_INPUT_PORT("X6"),
|
||||
DEVCB_INPUT_PORT("X7"),
|
||||
DEVCB_INPUT_PORT("X8"),
|
||||
DEVCB_DRIVER_LINE_MEMBER(apple2_state, ay3600_shift_r),
|
||||
DEVCB_DRIVER_LINE_MEMBER(apple2_state, ay3600_control_r),
|
||||
DEVCB_DRIVER_LINE_MEMBER(apple2_state, ay3600_iie_data_ready_w),
|
||||
DEVCB_NULL
|
||||
};
|
||||
|
||||
static MACHINE_CONFIG_START( apple2gs, apple2gs_state )
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_ADD("maincpu", G65816, APPLE2GS_14M/5)
|
||||
@ -355,7 +371,7 @@ static MACHINE_CONFIG_START( apple2gs, apple2gs_state )
|
||||
MCFG_VIDEO_START_OVERRIDE(apple2gs_state, apple2gs )
|
||||
|
||||
/* keyboard controller */
|
||||
MCFG_DEVICE_ADD("ay3600", AY3600N, 0)
|
||||
MCFG_AY3600_ADD("ay3600", 0, ay3600_iie_intf)
|
||||
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
@ -447,6 +463,10 @@ ROM_START(apple2gs)
|
||||
ROM_LOAD("341-0748", 0x20000, 0x20000, CRC(d4c50550) SHA1(2784cdd7ac7094b3e494409db3e72b4e6d2d9e81)) /* Needs verification; 341-0748: IIgs ROM03 FE-FF */
|
||||
|
||||
ROM_REGION(0x20000, "es5503", ROMREGION_ERASE00)
|
||||
|
||||
// temporary: use IIe enhanced keyboard decode ROM
|
||||
ROM_REGION( 0x800, "keyboard", 0 )
|
||||
ROM_LOAD( "341-0132-d.e12", 0x000, 0x800, CRC(c506efb9) SHA1(8e14e85c645187504ec9d162b3ea614a0c421d32) )
|
||||
ROM_END
|
||||
|
||||
ROM_START(apple2gsr3p)
|
||||
@ -465,6 +485,10 @@ ROM_START(apple2gsr3p)
|
||||
ROM_LOAD("341-0729", 0x20000, 0x20000, NO_DUMP) /* 341-0729: IIgs ROM03 prototype FE-FF */
|
||||
|
||||
ROM_REGION(0x20000, "es5503", ROMREGION_ERASE00)
|
||||
|
||||
// temporary: use IIe enhanced keyboard decode ROM
|
||||
ROM_REGION( 0x800, "keyboard", 0 )
|
||||
ROM_LOAD( "341-0132-d.e12", 0x000, 0x800, CRC(c506efb9) SHA1(8e14e85c645187504ec9d162b3ea614a0c421d32) )
|
||||
ROM_END
|
||||
|
||||
ROM_START(apple2gsr3lp)
|
||||
@ -483,6 +507,10 @@ ROM_START(apple2gsr3lp)
|
||||
ROM_LOAD("341-0749", 0x20000, 0x20000, NO_DUMP) /* 341-0749: unknown ?post? ROM03 IIgs prototype? FE-FF */
|
||||
|
||||
ROM_REGION(0x20000, "es5503", ROMREGION_ERASE00)
|
||||
|
||||
// temporary: use IIe enhanced keyboard decode ROM
|
||||
ROM_REGION( 0x800, "keyboard", 0 )
|
||||
ROM_LOAD( "341-0132-d.e12", 0x000, 0x800, CRC(c506efb9) SHA1(8e14e85c645187504ec9d162b3ea614a0c421d32) )
|
||||
ROM_END
|
||||
|
||||
ROM_START(apple2gsr1)
|
||||
@ -500,6 +528,10 @@ ROM_START(apple2gsr1)
|
||||
ROM_LOAD("342-0077-b", 0x0000, 0x20000, CRC(42f124b0) SHA1(e4fc7560b69d062cb2da5b1ffbe11cd1ca03cc37)) /* 342-0077-B: IIgs ROM01 */
|
||||
|
||||
ROM_REGION(0x20000, "es5503", ROMREGION_ERASE00)
|
||||
|
||||
// temporary: use IIe enhanced keyboard decode ROM
|
||||
ROM_REGION( 0x800, "keyboard", 0 )
|
||||
ROM_LOAD( "341-0132-d.e12", 0x000, 0x800, CRC(c506efb9) SHA1(8e14e85c645187504ec9d162b3ea614a0c421d32) )
|
||||
ROM_END
|
||||
|
||||
ROM_START(apple2gsr0)
|
||||
@ -521,6 +553,10 @@ ROM_START(apple2gsr0)
|
||||
ROM_LOAD("rom0d.bin", 0x18000, 0x8000, CRC(200a15b8) SHA1(0c2890bb169ead63369738bbd5f33b869f24c42a))
|
||||
|
||||
ROM_REGION(0x20000, "es5503", ROMREGION_ERASE00)
|
||||
|
||||
// temporary: use IIe enhanced keyboard decode ROM
|
||||
ROM_REGION( 0x800, "keyboard", 0 )
|
||||
ROM_LOAD( "341-0132-d.e12", 0x000, 0x800, CRC(c506efb9) SHA1(8e14e85c645187504ec9d162b3ea614a0c421d32) )
|
||||
ROM_END
|
||||
|
||||
ROM_START(apple2gsr0p) // 6/19/1986 Cortland prototype
|
||||
@ -538,6 +574,10 @@ ROM_START(apple2gsr0p) // 6/19/1986 Cortland prototype
|
||||
ROM_LOAD( "rombf.bin", 0x000000, 0x020000, CRC(ab04fedf) SHA1(977589a17553956d583a21020080a39dd396df5c) )
|
||||
|
||||
ROM_REGION(0x20000, "es5503", ROMREGION_ERASE00)
|
||||
|
||||
// temporary: use IIe enhanced keyboard decode ROM
|
||||
ROM_REGION( 0x800, "keyboard", 0 )
|
||||
ROM_LOAD( "341-0132-d.e12", 0x000, 0x800, CRC(c506efb9) SHA1(8e14e85c645187504ec9d162b3ea614a0c421d32) )
|
||||
ROM_END
|
||||
|
||||
/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include "machine/applefdc.h"
|
||||
#include "machine/ram.h"
|
||||
#include "imagedev/cassette.h"
|
||||
#include "machine/ay3600.h"
|
||||
#include "machine/kb3600.h"
|
||||
#include "sound/speaker.h"
|
||||
#include "machine/ram.h"
|
||||
|
||||
@ -121,34 +121,24 @@ public:
|
||||
m_joy2x(*this, "joystick_2_x"),
|
||||
m_joy2y(*this, "joystick_2_y"),
|
||||
m_joybuttons(*this, "joystick_buttons"),
|
||||
m_kb0(*this, "keyb_0"),
|
||||
m_kb1(*this, "keyb_1"),
|
||||
m_kb2(*this, "keyb_2"),
|
||||
m_kb3(*this, "keyb_3"),
|
||||
m_kb4(*this, "keyb_4"),
|
||||
m_kb5(*this, "keyb_5"),
|
||||
m_kb6(*this, "keyb_6"),
|
||||
m_kbdrom(*this, "keyboard"),
|
||||
m_kbspecial(*this, "keyb_special"),
|
||||
m_kbrepeat(*this, "keyb_repeat"),
|
||||
m_resetdip(*this, "reset_dip"),
|
||||
m_kpad1(*this, "keypad_1"),
|
||||
m_kpad2(*this, "keypad_2"),
|
||||
m_kbprepeat(*this, "keyb_repeat"),
|
||||
m_cassette(*this, "cassette")
|
||||
{ }
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<ram_device> m_ram;
|
||||
required_device<ay3600n_device> m_ay3600;
|
||||
required_device<ay3600_device> m_ay3600;
|
||||
required_device<a2bus_device> m_a2bus;
|
||||
optional_device<a2eauxslot_device> m_a2eauxslot;
|
||||
|
||||
optional_ioport m_joy1x, m_joy1y, m_joy2x, m_joy2y, m_joybuttons;
|
||||
required_ioport m_kb0, m_kb1, m_kb2, m_kb3, m_kb4, m_kb5, m_kb6, m_kbspecial;
|
||||
optional_memory_region m_kbdrom;
|
||||
required_ioport m_kbspecial;
|
||||
optional_ioport m_kbrepeat;
|
||||
optional_ioport m_resetdip;
|
||||
optional_ioport m_kpad1, m_kpad2;
|
||||
optional_ioport m_kbprepeat;
|
||||
optional_device<cassette_image_device> m_cassette;
|
||||
|
||||
UINT32 m_flags, m_flags_mask;
|
||||
@ -185,6 +175,9 @@ public:
|
||||
|
||||
device_a2eauxslot_card_interface *m_auxslotdevice;
|
||||
|
||||
UINT16 m_lastchar, m_strobe;
|
||||
UINT8 m_transchar;
|
||||
|
||||
READ8_MEMBER(apple2_c0xx_r);
|
||||
WRITE8_MEMBER(apple2_c0xx_w);
|
||||
READ8_MEMBER(apple2_c080_r);
|
||||
@ -318,6 +311,10 @@ public:
|
||||
DECLARE_WRITE8_MEMBER(a2bus_irq_w);
|
||||
DECLARE_WRITE8_MEMBER(a2bus_nmi_w);
|
||||
DECLARE_WRITE8_MEMBER(a2bus_inh_w);
|
||||
DECLARE_READ_LINE_MEMBER(ay3600_shift_r);
|
||||
DECLARE_READ_LINE_MEMBER(ay3600_control_r);
|
||||
DECLARE_WRITE_LINE_MEMBER(ay3600_data_ready_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(ay3600_iie_data_ready_w);
|
||||
void apple2_update_memory_postload();
|
||||
virtual void machine_reset();
|
||||
void apple2_setup_memory(const apple2_memmap_config *config);
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "emu.h"
|
||||
#include "cpu/m6502/m6502.h"
|
||||
#include "includes/apple2.h"
|
||||
#include "machine/ay3600.h"
|
||||
#include "machine/applefdc.h"
|
||||
#include "machine/sonydriv.h"
|
||||
#include "machine/appldriv.h"
|
||||
@ -1169,7 +1168,7 @@ void apple2_state::machine_reset()
|
||||
|
||||
int apple2_state::a2_no_ctrl_reset()
|
||||
{
|
||||
return (((m_kbprepeat != NULL) && (m_resetdip == NULL)) ||
|
||||
return (((m_kbrepeat != NULL) && (m_resetdip == NULL)) ||
|
||||
((m_resetdip != NULL) && !m_resetdip->read()));
|
||||
}
|
||||
|
||||
@ -1183,9 +1182,8 @@ TIMER_DEVICE_CALLBACK_MEMBER(apple2_state::apple2_interrupt)
|
||||
|
||||
if((scanline % 8) == 0)
|
||||
machine().primary_screen->update_partial(machine().primary_screen->vpos());
|
||||
|
||||
if (apple2_pressed_specialkey(0x80) &&
|
||||
(a2_no_ctrl_reset() || (m_ay3600->keymod_r() & AY3600_KEYMOD_CONTROL)))
|
||||
if ((m_kbspecial->read() & 0x80) &&
|
||||
(a2_no_ctrl_reset() || (m_kbspecial->read() & 0x08)))
|
||||
{
|
||||
if (!m_reset_flag)
|
||||
{
|
||||
@ -1611,7 +1609,7 @@ READ8_MEMBER ( apple2_state::apple2_c00x_r )
|
||||
{
|
||||
/* Read the keyboard data and strobe */
|
||||
g_profiler.start(PROFILER_C00X);
|
||||
result = m_ay3600->keydata_strobe_r();
|
||||
result = m_transchar | m_strobe;
|
||||
g_profiler.stop();
|
||||
}
|
||||
|
||||
@ -1668,7 +1666,7 @@ READ8_MEMBER( apple2_state::apple2_c01x_r )
|
||||
LOG(("a2 softswitch_r: %04x\n", offset + 0xc010));
|
||||
switch (offset)
|
||||
{
|
||||
case 0x00: result |= m_ay3600->anykey_clearstrobe_r(); break;
|
||||
case 0x00: result |= m_transchar | m_strobe; m_strobe = 0; break;
|
||||
case 0x01: result |= (m_flags & VAR_LCRAM2) ? 0x80 : 0x00; break;
|
||||
case 0x02: result |= (m_flags & VAR_LCRAM) ? 0x80 : 0x00; break;
|
||||
case 0x03: result |= (m_flags & VAR_RAMRD) ? 0x80 : 0x00; break;
|
||||
@ -1700,9 +1698,9 @@ READ8_MEMBER( apple2_state::apple2_c01x_r )
|
||||
|
||||
WRITE8_MEMBER( apple2_state::apple2_c01x_w )
|
||||
{
|
||||
/* Clear the keyboard strobe - ignore the returned results */
|
||||
/* Clear the keyboard strobe */
|
||||
g_profiler.start(PROFILER_C01X);
|
||||
m_ay3600->anykey_clearstrobe_r();
|
||||
m_strobe = 0;
|
||||
g_profiler.stop();
|
||||
}
|
||||
|
||||
@ -2125,8 +2123,6 @@ void apple2_state::apple2_init_common()
|
||||
m_a2_mask &= ~(VAR_RAMRD | VAR_RAMWRT | VAR_80STORE | VAR_ALTZP | VAR_80COL);
|
||||
|
||||
apple2_refresh_delegates();
|
||||
|
||||
m_ay3600->set_runtime_config(m_kpad1 != NULL, m_kbprepeat != NULL);
|
||||
}
|
||||
|
||||
MACHINE_START_MEMBER(apple2_state,apple2)
|
||||
@ -2354,3 +2350,123 @@ void apple2_state::apple2_refresh_delegates()
|
||||
write_delegates_e000[0] = write8_delegate(FUNC(apple2_state::apple2_auxrame000_w), this);
|
||||
write_delegates_e000[1] = write8_delegate(FUNC(apple2_state::apple2_mainrame000_w), this);
|
||||
}
|
||||
|
||||
READ_LINE_MEMBER(apple2_state::ay3600_shift_r)
|
||||
{
|
||||
// either shift key
|
||||
if (m_kbspecial->read() & 0x06)
|
||||
{
|
||||
return ASSERT_LINE;
|
||||
}
|
||||
|
||||
return CLEAR_LINE;
|
||||
}
|
||||
|
||||
READ_LINE_MEMBER(apple2_state::ay3600_control_r)
|
||||
{
|
||||
if (m_kbspecial->read() & 0x08)
|
||||
{
|
||||
return ASSERT_LINE;
|
||||
}
|
||||
|
||||
return CLEAR_LINE;
|
||||
}
|
||||
|
||||
static const UINT8 a2_key_remap[0x32][4] =
|
||||
{
|
||||
/* norm shft ctrl both */
|
||||
{ 0x33,0x23,0x33,0x23 }, /* 3 # 00 */
|
||||
{ 0x34,0x24,0x34,0x24 }, /* 4 $ 01 */
|
||||
{ 0x35,0x25,0x35,0x25 }, /* 5 % 02 */
|
||||
{ 0x36,0x5e,0x35,0x53 }, /* 6 ^ 03 */
|
||||
{ 0x37,0x26,0x37,0x26 }, /* 7 & 04 */
|
||||
{ 0x38,0x2a,0x38,0x2a }, /* 8 * 05 */
|
||||
{ 0x39,0x28,0x39,0x28 }, /* 9 ( 06 */
|
||||
{ 0x30,0x29,0x30,0x29 }, /* 0 ) 07 */
|
||||
{ 0x3b,0x3a,0x3b,0x3a }, /* ; : 08 */
|
||||
{ 0x2d,0x5f,0x2d,0x1f }, /* - _ 09 */
|
||||
{ 0x51,0x51,0x11,0x11 }, /* q Q 0a */
|
||||
{ 0x57,0x57,0x17,0x17 }, /* w W 0b */
|
||||
{ 0x45,0x45,0x05,0x05 }, /* e E 0c */
|
||||
{ 0x52,0x52,0x12,0x12 }, /* r R 0d */
|
||||
{ 0x54,0x54,0x14,0x14 }, /* t T 0e */
|
||||
{ 0x59,0x59,0x19,0x19 }, /* y Y 0f */
|
||||
{ 0x55,0x55,0x15,0x15 }, /* u U 10 */
|
||||
{ 0x49,0x49,0x09,0x09 }, /* i I 11 */
|
||||
{ 0x4f,0x4f,0x0f,0x0f }, /* o O 12 */
|
||||
{ 0x50,0x50,0x10,0x10 }, /* p P 13 */
|
||||
{ 0x44,0x44,0x04,0x04 }, /* d D 14 */
|
||||
{ 0x46,0x46,0x06,0x06 }, /* f F 15 */
|
||||
{ 0x47,0x47,0x07,0x07 }, /* g G 16 */
|
||||
{ 0x48,0x48,0x08,0x08 }, /* h H 17 */
|
||||
{ 0x4a,0x4a,0x0a,0x0a }, /* j J 18 */
|
||||
{ 0x4b,0x4b,0x0b,0x0b }, /* k K 19 */
|
||||
{ 0x4c,0x4c,0x0c,0x0c }, /* l L 1a */
|
||||
{ 0x3d,0x2b,0x3d,0x2b }, /* = + 1b */
|
||||
{ 0x08,0x08,0x08,0x08 }, /* Left 1c */
|
||||
{ 0x15,0x15,0x15,0x15 }, /* Right 1d */
|
||||
{ 0x5a,0x5a,0x1a,0x1a }, /* z Z 1e */
|
||||
{ 0x58,0x58,0x18,0x18 }, /* x X 1f */
|
||||
{ 0x43,0x43,0x03,0x03 }, /* c C 20 */
|
||||
{ 0x56,0x56,0x16,0x16 }, /* v V 21 */
|
||||
{ 0x42,0x42,0x02,0x02 }, /* b B 22 */
|
||||
{ 0x4e,0x4e,0x0e,0x0e }, /* n N 23 */
|
||||
{ 0x4d,0x4d,0x0d,0x0d }, /* m M 24 */
|
||||
{ 0x2c,0x3c,0x2c,0x3c }, /* , < 25 */
|
||||
{ 0x2e,0x3e,0x2e,0x3e }, /* . > 26 */
|
||||
{ 0x2f,0x3f,0x2f,0x3f }, /* / ? 27 */
|
||||
{ 0x53,0x53,0x13,0x13 }, /* s S 28 */
|
||||
{ 0x32,0x40,0x32,0x00 }, /* 2 @ 29 */
|
||||
{ 0x31,0x21,0x31,0x31 }, /* 1 ! 2a */
|
||||
{ 0x9b,0x9b,0x9b,0x9b }, /* Escape 2b */
|
||||
{ 0x41,0x41,0x01,0x01 }, /* a A 2c */
|
||||
{ 0x20,0x20,0x20,0x20 }, /* Space 2d */
|
||||
{ 0x00,0x00,0x00,0x00 }, /* 0x2e unused */
|
||||
{ 0x00,0x00,0x00,0x00 }, /* 0x2f unused */
|
||||
{ 0x00,0x00,0x00,0x00 }, /* 0x30 unused */
|
||||
{ 0x0d,0x0d,0x0d,0x0d }, /* Enter 31 */
|
||||
};
|
||||
|
||||
WRITE_LINE_MEMBER(apple2_state::ay3600_data_ready_w)
|
||||
{
|
||||
if (state == ASSERT_LINE)
|
||||
{
|
||||
int mod = 0;
|
||||
m_lastchar = m_ay3600->b_r();
|
||||
|
||||
mod = (m_kbspecial->read() & 0x06) ? 0x01 : 0x00;
|
||||
mod |= (m_kbspecial->read() & 0x08) ? 0x02 : 0x00;
|
||||
|
||||
m_transchar = a2_key_remap[m_lastchar&0x3f][mod];
|
||||
|
||||
if (m_transchar != 0)
|
||||
{
|
||||
m_strobe = 0x80;
|
||||
// printf("new char = %04x (%02x)\n", m_lastchar&0x3f, m_transchar);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(apple2_state::ay3600_iie_data_ready_w)
|
||||
{
|
||||
if (state == ASSERT_LINE)
|
||||
{
|
||||
UINT8 *decode = m_kbdrom->base();
|
||||
UINT16 trans;
|
||||
int mod = 0;
|
||||
|
||||
m_lastchar = m_ay3600->b_r();
|
||||
|
||||
trans = m_lastchar & ~(0x1c0); // clear the 3600's control/shift stuff
|
||||
trans |= (m_lastchar & 0x100)>>2; // bring the 0x100 bit down to the 0x40 place
|
||||
trans <<= 2; // 4 entries per key
|
||||
trans |= (m_kbspecial->read() & 0x06) ? 0x00 : 0x01; // shift is bit 1 (active low)
|
||||
trans |= (m_kbspecial->read() & 0x08) ? 0x00 : 0x02; // control is bit 2 (active low)
|
||||
trans |= (m_kbspecial->read() & 0x01) ? 0x0000 : 0x0200; // caps lock is bit 9 (active low)
|
||||
|
||||
m_transchar = decode[trans];
|
||||
m_strobe = 0x80;
|
||||
|
||||
// printf("new char = %04x (%02x)\n", m_lastchar, m_transchar);
|
||||
}
|
||||
}
|
||||
|
@ -944,8 +944,49 @@ READ8_MEMBER( apple2gs_state::apple2gs_c0xx_r )
|
||||
#if RUN_ADB_MICRO
|
||||
result = keyglu_816_read(GLU_KEYMOD);
|
||||
#else
|
||||
result = m_ay3600->keymod_r();
|
||||
#endif
|
||||
|
||||
result = 0;
|
||||
{
|
||||
UINT8 temp = m_kbspecial->read();
|
||||
if (temp & 1) // capslock
|
||||
{
|
||||
result |= 4;
|
||||
}
|
||||
if (temp & 6) // shift
|
||||
{
|
||||
result |= 1;
|
||||
}
|
||||
if (temp & 8) // control
|
||||
{
|
||||
result |= 2;
|
||||
}
|
||||
if (temp & 0x10) // open apple/command
|
||||
{
|
||||
result |= 0x40;
|
||||
}
|
||||
if (temp & 0x20) // option
|
||||
{
|
||||
result |= 0x80;
|
||||
}
|
||||
// keypad is a little rough right now
|
||||
if (m_lastchar >= 0x28 && m_lastchar <= 0x2d)
|
||||
{
|
||||
result |= 0x10;
|
||||
}
|
||||
else if (m_lastchar >= 0x32 && m_lastchar <= 0x3f)
|
||||
{
|
||||
result |= 0x10;
|
||||
}
|
||||
else if (m_lastchar >= 0x100 && m_lastchar <= 0x101)
|
||||
{
|
||||
result |= 0x10;
|
||||
}
|
||||
else if (m_lastchar >= 0x109 && m_lastchar <= 0x10a)
|
||||
{
|
||||
result |= 0x10;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 0x26: /* C026 - DATAREG */
|
||||
|
@ -1,580 +0,0 @@
|
||||
/***************************************************************************
|
||||
|
||||
AY3600.c
|
||||
|
||||
GI AY-3600 keyboard controller device
|
||||
|
||||
Rewritten 2014 by R. Belmont, thanks to earlier efforts by
|
||||
Barry Nelson and Nathan Woods.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "machine/ay3600.h"
|
||||
|
||||
/***************************************************************************
|
||||
PARAMETERS
|
||||
***************************************************************************/
|
||||
|
||||
#ifdef MAME_DEBUG
|
||||
#define VERBOSE 1
|
||||
#else
|
||||
#define VERBOSE 0
|
||||
#endif /* MAME_DEBUG */
|
||||
|
||||
#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
|
||||
|
||||
/**************************************************************************/
|
||||
|
||||
// bit order in the input port of the special keys
|
||||
#define SPECIALKEY_CAPSLOCK 0x01
|
||||
#define SPECIALKEY_SHIFTL 0x04
|
||||
#define SPECIALKEY_SHIFTR 0x08
|
||||
#define SPECIALKEY_CONTROL 0x08
|
||||
#define SPECIALKEY_ALTL 0x10
|
||||
#define SPECIALKEY_ALTR 0x20
|
||||
#define SPECIALKEY_WIN 0x40
|
||||
#define SPECIALKEY_RESET 0x80
|
||||
|
||||
static const unsigned char ay3600_key_remap_2[9*8][4] =
|
||||
{
|
||||
/* norm ctrl shft both */
|
||||
{ 0x7f,0x7f,0x7f,0x7f }, /* UNUSED */
|
||||
{ 0x08,0x08,0x08,0x08 }, /* Left */
|
||||
{ 0x09,0x09,0x09,0x09 }, /* UNUSED */
|
||||
{ 0x0a,0x0a,0x0a,0x0a }, /* UNUSED */
|
||||
{ 0x0b,0x0b,0x0b,0x0b }, /* UNUSED */
|
||||
{ 0x0d,0x0d,0x0d,0x0d }, /* Enter */
|
||||
{ 0x15,0x15,0x15,0x15 }, /* Right */
|
||||
{ 0x1b,0x1b,0x1b,0x1b }, /* Escape */
|
||||
{ 0x20,0x20,0x20,0x20 }, /* Space */
|
||||
{ 0x27,0x27,0x22,0x22 }, /* UNUSED */
|
||||
{ 0x2c,0x2c,0x3c,0x3c }, /* , < */
|
||||
{ 0x3a,0x3a,0x2a,0x2a }, /* : * */
|
||||
{ 0x2e,0x2e,0x3e,0x3e }, /* . > */
|
||||
{ 0x2f,0x2f,0x3f,0x3f }, /* / ? */
|
||||
{ 0x30,0x30,0x30,0x30 }, /* 0 */
|
||||
{ 0x31,0x31,0x21,0x21 }, /* 1 ! */
|
||||
{ 0x32,0x32,0x22,0x22 }, /* 2 " */
|
||||
{ 0x33,0x33,0x23,0x23 }, /* 3 # */
|
||||
{ 0x34,0x34,0x24,0x24 }, /* 4 $ */
|
||||
{ 0x35,0x35,0x25,0x25 }, /* 5 % */
|
||||
{ 0x36,0x36,0x26,0x26 }, /* 6 & */
|
||||
{ 0x37,0x37,0x27,0x27 }, /* 7 ' */
|
||||
{ 0x38,0x38,0x28,0x28 }, /* 8 ( */
|
||||
{ 0x39,0x39,0x29,0x29 }, /* 9 ) */
|
||||
{ 0x3b,0x3b,0x2b,0x2b }, /* ; + */
|
||||
{ 0x2d,0x2d,0x3d,0x3d }, /* - = */
|
||||
{ 0x5b,0x1b,0x7b,0x1b }, /* UNUSED */
|
||||
{ 0x5c,0x1c,0x7c,0x1c }, /* UNUSED */
|
||||
{ 0x5d,0x1d,0x7d,0x1d }, /* UNUSED */
|
||||
{ 0x60,0x60,0x7e,0x7e }, /* UNUSED */
|
||||
{ 0x41,0x01,0x41,0x01 }, /* A */
|
||||
{ 0x42,0x02,0x42,0x02 }, /* B */
|
||||
{ 0x43,0x03,0x43,0x03 }, /* C */
|
||||
{ 0x44,0x04,0x44,0x04 }, /* D */
|
||||
{ 0x45,0x05,0x45,0x05 }, /* E */
|
||||
{ 0x46,0x06,0x46,0x06 }, /* F */
|
||||
{ 0x47,0x07,0x47,0x07 }, /* G */
|
||||
{ 0x48,0x08,0x48,0x08 }, /* H */
|
||||
{ 0x49,0x09,0x49,0x09 }, /* I */
|
||||
{ 0x4a,0x0a,0x4a,0x0a }, /* J */
|
||||
{ 0x4b,0x0b,0x4b,0x0b }, /* K */
|
||||
{ 0x4c,0x0c,0x4c,0x0c }, /* L */
|
||||
{ 0x4d,0x0d,0x5d,0x0d }, /* M ] */
|
||||
{ 0x4e,0x0e,0x5e,0x1e }, /* N ^ */
|
||||
{ 0x4f,0x0f,0x4f,0x0f }, /* O */
|
||||
{ 0x50,0x10,0x40,0x00 }, /* P @ */
|
||||
{ 0x51,0x11,0x51,0x11 }, /* Q */
|
||||
{ 0x52,0x12,0x52,0x12 }, /* R */
|
||||
{ 0x53,0x13,0x53,0x13 }, /* S */
|
||||
{ 0x54,0x14,0x54,0x14 }, /* T */
|
||||
{ 0x55,0x15,0x55,0x15 }, /* U */
|
||||
{ 0x56,0x16,0x56,0x16 }, /* V */
|
||||
{ 0x57,0x17,0x57,0x17 }, /* W */
|
||||
{ 0x58,0x18,0x58,0x18 }, /* X */
|
||||
{ 0x59,0x19,0x59,0x19 }, /* Y */
|
||||
{ 0x5a,0x1a,0x5a,0x1a } /* Z */
|
||||
};
|
||||
|
||||
static const unsigned char ay3600_key_remap_2e[2][9*8][4] =
|
||||
{
|
||||
/* caps lock off norm ctrl shft both */
|
||||
{
|
||||
{ 0x7f,0x7f,0x7f,0x7f }, /* Backspace */
|
||||
{ 0x08,0x08,0x08,0x08 }, /* Left */
|
||||
{ 0x09,0x09,0x09,0x09 }, /* Tab */
|
||||
{ 0x0a,0x0a,0x0a,0x0a }, /* Down */
|
||||
{ 0x0b,0x0b,0x0b,0x0b }, /* Up */
|
||||
{ 0x0d,0x0d,0x0d,0x0d }, /* Enter */
|
||||
{ 0x15,0x15,0x15,0x15 }, /* Right */
|
||||
{ 0x1b,0x1b,0x1b,0x1b }, /* Escape */
|
||||
{ 0x20,0x20,0x20,0x20 }, /* Space */
|
||||
{ 0x27,0x27,0x22,0x22 }, /* ' " */
|
||||
{ 0x2c,0x2c,0x3c,0x3c }, /* , < */
|
||||
{ 0x2d,0x2d,0x5f,0x1f }, /* - _ */
|
||||
{ 0x2e,0x2e,0x3e,0x3e }, /* . > */
|
||||
{ 0x2f,0x2f,0x3f,0x3f }, /* / ? */
|
||||
{ 0x30,0x30,0x29,0x29 }, /* 0 ) */
|
||||
{ 0x31,0x31,0x21,0x21 }, /* 1 ! */
|
||||
{ 0x32,0x00,0x40,0x00 }, /* 2 @ */
|
||||
{ 0x33,0x33,0x23,0x23 }, /* 3 # */
|
||||
{ 0x34,0x34,0x24,0x24 }, /* 4 $ */
|
||||
{ 0x35,0x35,0x25,0x25 }, /* 5 % */
|
||||
{ 0x36,0x1e,0x5e,0x1e }, /* 6 ^ */
|
||||
{ 0x37,0x37,0x26,0x26 }, /* 7 & */
|
||||
{ 0x38,0x38,0x2a,0x2a }, /* 8 * */
|
||||
{ 0x39,0x39,0x28,0x28 }, /* 9 ( */
|
||||
{ 0x3b,0x3b,0x3a,0x3a }, /* ; : */
|
||||
{ 0x3d,0x3d,0x2b,0x2b }, /* = + */
|
||||
{ 0x5b,0x1b,0x7b,0x1b }, /* [ { */
|
||||
{ 0x5c,0x1c,0x7c,0x1c }, /* \ | */
|
||||
{ 0x5d,0x1d,0x7d,0x1d }, /* ] } */
|
||||
{ 0x60,0x60,0x7e,0x7e }, /* ` ~ */
|
||||
{ 0x61,0x01,0x41,0x01 }, /* a A */
|
||||
{ 0x62,0x02,0x42,0x02 }, /* b B */
|
||||
{ 0x63,0x03,0x43,0x03 }, /* c C */
|
||||
{ 0x64,0x04,0x44,0x04 }, /* d D */
|
||||
{ 0x65,0x05,0x45,0x05 }, /* e E */
|
||||
{ 0x66,0x06,0x46,0x06 }, /* f F */
|
||||
{ 0x67,0x07,0x47,0x07 }, /* g G */
|
||||
{ 0x68,0x08,0x48,0x08 }, /* h H */
|
||||
{ 0x69,0x09,0x49,0x09 }, /* i I */
|
||||
{ 0x6a,0x0a,0x4a,0x0a }, /* j J */
|
||||
{ 0x6b,0x0b,0x4b,0x0b }, /* k K */
|
||||
{ 0x6c,0x0c,0x4c,0x0c }, /* l L */
|
||||
{ 0x6d,0x0d,0x4d,0x0d }, /* m M */
|
||||
{ 0x6e,0x0e,0x4e,0x0e }, /* n N */
|
||||
{ 0x6f,0x0f,0x4f,0x0f }, /* o O */
|
||||
{ 0x70,0x10,0x50,0x10 }, /* p P */
|
||||
{ 0x71,0x11,0x51,0x11 }, /* q Q */
|
||||
{ 0x72,0x12,0x52,0x12 }, /* r R */
|
||||
{ 0x73,0x13,0x53,0x13 }, /* s S */
|
||||
{ 0x74,0x14,0x54,0x14 }, /* t T */
|
||||
{ 0x75,0x15,0x55,0x15 }, /* u U */
|
||||
{ 0x76,0x16,0x56,0x16 }, /* v V */
|
||||
{ 0x77,0x17,0x57,0x17 }, /* w W */
|
||||
{ 0x78,0x18,0x58,0x18 }, /* x X */
|
||||
{ 0x79,0x19,0x59,0x19 }, /* y Y */
|
||||
{ 0x7a,0x1a,0x5a,0x1a }, /* z Z */
|
||||
{ 0x30,0x30,0x30,0x30 }, /* 0 (KP) */
|
||||
{ 0x31,0x31,0x31,0x31 }, /* 1 (KP) */
|
||||
{ 0x32,0x32,0x32,0x32 }, /* 2 (KP) */
|
||||
{ 0x33,0x33,0x33,0x33 }, /* 3 (KP) */
|
||||
{ 0x34,0x34,0x34,0x34 }, /* 4 (KP) */
|
||||
{ 0x35,0x35,0x35,0x35 }, /* 5 (KP) */
|
||||
{ 0x36,0x36,0x36,0x36 }, /* 6 (KP) */
|
||||
{ 0x37,0x37,0x37,0x37 }, /* 7 (KP) */
|
||||
{ 0x38,0x38,0x38,0x38 }, /* 8 (KP) */
|
||||
{ 0x39,0x39,0x39,0x39 }, /* 9 (KP) */
|
||||
{ 0x2f,0x2f,0x2f,0x2f }, /* / (KP) */
|
||||
{ 0x2a,0x2a,0x2a,0x2a }, /* * (KP) */
|
||||
{ 0x2d,0x2d,0x2d,0x2d }, /* - (KP) */
|
||||
{ 0x2b,0x2b,0x2b,0x2b }, /* + (KP) */
|
||||
{ 0x2e,0x2e,0x2e,0x2e }, /* . (KP) */
|
||||
{ 0x0d,0x0d,0x0d,0x0d } /* Enter (KP) */
|
||||
},
|
||||
/* caps lock on norm ctrl shft both */
|
||||
{
|
||||
{ 0x7f,0x7f,0x7f,0x7f }, /* Backspace */
|
||||
{ 0x08,0x08,0x08,0x08 }, /* Left */
|
||||
{ 0x09,0x09,0x09,0x09 }, /* Tab */
|
||||
{ 0x0a,0x0a,0x0a,0x0a }, /* Down */
|
||||
{ 0x0b,0x0b,0x0b,0x0b }, /* Up */
|
||||
{ 0x0d,0x0d,0x0d,0x0d }, /* Enter */
|
||||
{ 0x15,0x15,0x15,0x15 }, /* Right */
|
||||
{ 0x1b,0x1b,0x1b,0x1b }, /* Escape */
|
||||
{ 0x20,0x20,0x20,0x20 }, /* Space */
|
||||
{ 0x27,0x27,0x22,0x22 }, /* ' " */
|
||||
{ 0x2c,0x2c,0x3c,0x3c }, /* , < */
|
||||
{ 0x2d,0x2d,0x5f,0x1f }, /* - _ */
|
||||
{ 0x2e,0x2e,0x3e,0x3e }, /* . > */
|
||||
{ 0x2f,0x2f,0x3f,0x3f }, /* / ? */
|
||||
{ 0x30,0x30,0x29,0x29 }, /* 0 ) */
|
||||
{ 0x31,0x31,0x21,0x21 }, /* 1 ! */
|
||||
{ 0x32,0x00,0x40,0x00 }, /* 2 @ */
|
||||
{ 0x33,0x33,0x23,0x23 }, /* 3 # */
|
||||
{ 0x34,0x34,0x24,0x24 }, /* 4 $ */
|
||||
{ 0x35,0x35,0x25,0x25 }, /* 5 % */
|
||||
{ 0x36,0x1e,0x5e,0x1e }, /* 6 ^ */
|
||||
{ 0x37,0x37,0x26,0x26 }, /* 7 & */
|
||||
{ 0x38,0x38,0x2a,0x2a }, /* 8 * */
|
||||
{ 0x39,0x39,0x28,0x28 }, /* 9 ( */
|
||||
{ 0x3b,0x3b,0x3a,0x3a }, /* ; : */
|
||||
{ 0x3d,0x3d,0x2b,0x2b }, /* = + */
|
||||
{ 0x5b,0x1b,0x7b,0x1b }, /* [ { */
|
||||
{ 0x5c,0x1c,0x7c,0x1c }, /* \ | */
|
||||
{ 0x5d,0x1d,0x7d,0x1d }, /* ] } */
|
||||
{ 0x60,0x60,0x7e,0x7e }, /* ` ~ */
|
||||
{ 0x41,0x01,0x61,0x01 }, /* A a */
|
||||
{ 0x42,0x02,0x62,0x02 }, /* B b */
|
||||
{ 0x43,0x03,0x63,0x03 }, /* C c */
|
||||
{ 0x44,0x04,0x64,0x04 }, /* D d */
|
||||
{ 0x45,0x05,0x65,0x05 }, /* E e */
|
||||
{ 0x46,0x06,0x66,0x06 }, /* F f */
|
||||
{ 0x47,0x07,0x67,0x07 }, /* G g */
|
||||
{ 0x48,0x08,0x68,0x08 }, /* H h */
|
||||
{ 0x49,0x09,0x69,0x09 }, /* I i */
|
||||
{ 0x4a,0x0a,0x6a,0x0a }, /* J j */
|
||||
{ 0x4b,0x0b,0x6b,0x0b }, /* K k */
|
||||
{ 0x4c,0x0c,0x6c,0x0c }, /* L l */
|
||||
{ 0x4d,0x0d,0x6d,0x0d }, /* M m */
|
||||
{ 0x4e,0x0e,0x6e,0x0e }, /* N n */
|
||||
{ 0x4f,0x0f,0x6f,0x0f }, /* O o */
|
||||
{ 0x50,0x10,0x70,0x10 }, /* P p */
|
||||
{ 0x51,0x11,0x71,0x11 }, /* Q q */
|
||||
{ 0x52,0x12,0x72,0x12 }, /* R r */
|
||||
{ 0x53,0x13,0x73,0x13 }, /* S s */
|
||||
{ 0x54,0x14,0x74,0x14 }, /* T t */
|
||||
{ 0x55,0x15,0x75,0x15 }, /* U u */
|
||||
{ 0x56,0x16,0x76,0x16 }, /* V v */
|
||||
{ 0x57,0x17,0x77,0x17 }, /* W w */
|
||||
{ 0x58,0x18,0x78,0x18 }, /* X x */
|
||||
{ 0x59,0x19,0x79,0x19 }, /* Y y */
|
||||
{ 0x5a,0x1a,0x7a,0x1a }, /* Z z */
|
||||
{ 0x30,0x30,0x30,0x30 }, /* 0 (KP) */
|
||||
{ 0x31,0x31,0x31,0x31 }, /* 1 (KP) */
|
||||
{ 0x32,0x32,0x32,0x32 }, /* 2 (KP) */
|
||||
{ 0x33,0x33,0x33,0x33 }, /* 3 (KP) */
|
||||
{ 0x34,0x34,0x34,0x34 }, /* 4 (KP) */
|
||||
{ 0x35,0x35,0x35,0x35 }, /* 5 (KP) */
|
||||
{ 0x36,0x36,0x36,0x36 }, /* 6 (KP) */
|
||||
{ 0x37,0x37,0x37,0x37 }, /* 7 (KP) */
|
||||
{ 0x38,0x38,0x38,0x38 }, /* 8 (KP) */
|
||||
{ 0x39,0x39,0x39,0x39 }, /* 9 (KP) */
|
||||
{ 0x2f,0x2f,0x2f,0x2f }, /* / (KP) */
|
||||
{ 0x2a,0x2a,0x2a,0x2a }, /* * (KP) */
|
||||
{ 0x2d,0x2d,0x2d,0x2d }, /* - (KP) */
|
||||
{ 0x2b,0x2b,0x2b,0x2b }, /* + (KP) */
|
||||
{ 0x2e,0x2e,0x2e,0x2e }, /* . (KP) */
|
||||
{ 0x0d,0x0d,0x0d,0x0d } /* Enter (KP) */
|
||||
}
|
||||
};
|
||||
|
||||
#define AY3600_KEY_NORMAL 0
|
||||
#define AY3600_KEY_CONTROL 1
|
||||
#define AY3600_KEY_SHIFT 2
|
||||
#define AY3600_KEY_BOTH 3
|
||||
#define MAGIC_KEY_REPEAT_NUMBER 80
|
||||
|
||||
#define AY3600_KEYS_LENGTH 128
|
||||
|
||||
const device_type AY3600N = &device_creator<ay3600n_device>;
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// ay3600n_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
ay3600n_device::ay3600n_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: device_t(mconfig, AY3600N, "AY-3600 keyboard controller", tag, owner, clock, "ay3600", __FILE__)
|
||||
{
|
||||
m_keypad = m_repeat = false;
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
AY3600_init
|
||||
***************************************************************************/
|
||||
|
||||
void ay3600n_device::device_start()
|
||||
{
|
||||
/* Init the key remapping table */
|
||||
m_ay3600_keys = auto_alloc_array_clear(machine(), unsigned int, AY3600_KEYS_LENGTH);
|
||||
|
||||
/* We poll the keyboard periodically to scan the keys. This is
|
||||
actually consistent with how the AY-3600 keyboard controller works. */
|
||||
m_timer = timer_alloc(0, NULL);
|
||||
m_timer->adjust(attotime::never);
|
||||
|
||||
machine().ioport().natkeyboard().configure(
|
||||
ioport_queue_chars_delegate(FUNC(ay3600n_device::AY3600_keyboard_queue_chars), this),
|
||||
ioport_accept_char_delegate(FUNC(ay3600n_device::AY3600_keyboard_accept_char), this),
|
||||
ioport_charqueue_empty_delegate(FUNC(ay3600n_device::AY3600_keyboard_charqueue_empty), this));
|
||||
|
||||
save_item(NAME(m_keycode));
|
||||
save_item(NAME(m_keycode_unmodified));
|
||||
save_item(NAME(m_keywaiting));
|
||||
save_item(NAME(m_keystilldown));
|
||||
save_item(NAME(m_keymodreg));
|
||||
save_item(NAME(m_last_key));
|
||||
save_item(NAME(m_last_key_unmodified));
|
||||
save_item(NAME(m_time_until_repeat));
|
||||
}
|
||||
|
||||
void ay3600n_device::device_reset()
|
||||
{
|
||||
/* Set Caps Lock light to ON, since that's how we default it. */
|
||||
set_led_status(machine(), 1, 1);
|
||||
|
||||
m_keywaiting = 0;
|
||||
m_keycode = 0;
|
||||
m_keystilldown = 0;
|
||||
m_keymodreg = AY3600_KEYMOD_CAPSLOCK; // caps lock on
|
||||
|
||||
m_last_key = 0xff; /* necessary for special repeat key behaviour */
|
||||
m_last_key_unmodified = 0xff; /* necessary for special repeat key behaviour */
|
||||
m_time_until_repeat = MAGIC_KEY_REPEAT_NUMBER;
|
||||
|
||||
m_timer->adjust(attotime::from_hz(60), 0, attotime::from_hz(60));
|
||||
}
|
||||
|
||||
void ay3600n_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
int switchkey; /* Normal, Shift, Control, or both */
|
||||
int port, num_ports, bit, data;
|
||||
int any_key_pressed = 0; /* Have we pressed a key? True/False */
|
||||
int caps_lock = 0;
|
||||
int curkey;
|
||||
int curkey_unmodified;
|
||||
static const char *const portnames[] =
|
||||
{
|
||||
"keyb_0", "keyb_1", "keyb_2", "keyb_3", "keyb_4", "keyb_5", "keyb_6",
|
||||
"keypad_1", "keypad_2"
|
||||
};
|
||||
|
||||
/* check for these special cases because they affect the emulated key codes */
|
||||
/* does this machine have a special repeat key? */
|
||||
if (m_repeat)
|
||||
m_time_until_repeat = machine().root_device().ioport("keyb_repeat")->read() & 0x01 ? 0 : ~0;
|
||||
|
||||
int special_state = machine().root_device().ioport("keyb_special")->read();
|
||||
|
||||
/* check caps lock and set LED here */
|
||||
if (special_state & SPECIALKEY_CAPSLOCK)
|
||||
{
|
||||
caps_lock = 1;
|
||||
set_led_status(machine(), 1, 1);
|
||||
m_keymodreg |= AY3600_KEYMOD_CAPSLOCK;
|
||||
}
|
||||
else
|
||||
{
|
||||
caps_lock = 0;
|
||||
set_led_status(machine(), 1, 0);
|
||||
m_keymodreg &= ~AY3600_KEYMOD_CAPSLOCK;
|
||||
}
|
||||
|
||||
switchkey = AY3600_KEY_NORMAL;
|
||||
|
||||
/* shift key check */
|
||||
if (special_state & (SPECIALKEY_SHIFTL | SPECIALKEY_SHIFTR))
|
||||
{
|
||||
switchkey |= AY3600_KEY_SHIFT;
|
||||
m_keymodreg |= AY3600_KEYMOD_SHIFT;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_keymodreg &= ~AY3600_KEYMOD_SHIFT;
|
||||
}
|
||||
|
||||
/* control key check - only one control key */
|
||||
if (special_state & SPECIALKEY_CONTROL)
|
||||
{
|
||||
switchkey |= AY3600_KEY_CONTROL;
|
||||
m_keymodreg |= AY3600_KEYMOD_CONTROL;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_keymodreg &= ~AY3600_KEYMOD_CONTROL;
|
||||
}
|
||||
|
||||
/* apple key check */
|
||||
if (special_state & SPECIALKEY_ALTL)
|
||||
{
|
||||
m_keymodreg |= AY3600_KEYMOD_COMMAND;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_keymodreg &= ~AY3600_KEYMOD_COMMAND;
|
||||
}
|
||||
|
||||
/* option key check */
|
||||
if (special_state & SPECIALKEY_ALTR)
|
||||
{
|
||||
m_keymodreg |= AY3600_KEYMOD_OPTION;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_keymodreg &= ~AY3600_KEYMOD_OPTION;
|
||||
}
|
||||
|
||||
/* run through real keys and see what's being pressed */
|
||||
num_ports = m_keypad ? 9 : 7;
|
||||
|
||||
m_keymodreg &= ~AY3600_KEYMOD_KEYPAD;
|
||||
|
||||
for (port = 0; port < num_ports; port++)
|
||||
{
|
||||
data = machine().root_device().ioport(portnames[port])->read();
|
||||
|
||||
for (bit = 0; bit < 8; bit++)
|
||||
{
|
||||
if (!m_repeat)
|
||||
{
|
||||
curkey = ay3600_key_remap_2e[caps_lock][port*8+bit][switchkey];
|
||||
curkey_unmodified = ay3600_key_remap_2e[caps_lock][port*8+bit][0];
|
||||
}
|
||||
else
|
||||
{
|
||||
curkey = ay3600_key_remap_2[port*8+bit][switchkey];
|
||||
curkey_unmodified = ay3600_key_remap_2[port*8+bit][0];
|
||||
}
|
||||
if (data & (1 << bit))
|
||||
{
|
||||
any_key_pressed = 1;
|
||||
|
||||
if (port == 8)
|
||||
{
|
||||
m_keymodreg |= AY3600_KEYMOD_KEYPAD;
|
||||
}
|
||||
|
||||
/* prevent overflow */
|
||||
if (m_ay3600_keys[port*8+bit] < 65000)
|
||||
m_ay3600_keys[port*8+bit]++;
|
||||
|
||||
/* on every key press, reset the time until repeat and the key to repeat */
|
||||
if ((m_ay3600_keys[port*8+bit] == 1) && (curkey_unmodified != m_last_key_unmodified))
|
||||
{
|
||||
m_time_until_repeat = MAGIC_KEY_REPEAT_NUMBER;
|
||||
m_last_key = curkey;
|
||||
m_last_key_unmodified = curkey_unmodified;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ay3600_keys[port*8+bit] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_keymodreg &= ~AY3600_KEYMOD_REPEAT;
|
||||
|
||||
if (!any_key_pressed)
|
||||
{
|
||||
/* If no keys have been pressed, reset the repeat time and return */
|
||||
m_time_until_repeat = MAGIC_KEY_REPEAT_NUMBER;
|
||||
m_last_key = 0xff;
|
||||
m_last_key_unmodified = 0xff;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Otherwise, count down the repeat time */
|
||||
if (m_time_until_repeat > 0)
|
||||
m_time_until_repeat--;
|
||||
|
||||
/* Even if a key has been released, repeat it if it was the last key pressed */
|
||||
/* If we should output a key, set the appropriate Apple II data lines */
|
||||
if (m_time_until_repeat == 0 ||
|
||||
m_time_until_repeat == MAGIC_KEY_REPEAT_NUMBER-1)
|
||||
{
|
||||
m_keywaiting = 1;
|
||||
m_keycode = m_last_key;
|
||||
m_keycode_unmodified = m_last_key_unmodified;
|
||||
m_keymodreg |= AY3600_KEYMOD_REPEAT;
|
||||
}
|
||||
}
|
||||
m_keystilldown = (m_last_key_unmodified == m_keycode_unmodified);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
AY3600_keydata_strobe_r
|
||||
***************************************************************************/
|
||||
|
||||
int ay3600n_device::keydata_strobe_r()
|
||||
{
|
||||
int rc;
|
||||
rc = m_keycode | (m_keywaiting ? 0x80 : 0x00);
|
||||
LOG(("AY3600_keydata_strobe_r(): rc=0x%02x\n", rc));
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
AY3600_anykey_clearstrobe_r
|
||||
***************************************************************************/
|
||||
|
||||
int ay3600n_device::anykey_clearstrobe_r()
|
||||
{
|
||||
int rc;
|
||||
m_keywaiting = 0;
|
||||
rc = m_keycode | (m_keystilldown ? 0x80 : 0x00);
|
||||
LOG(("AY3600_anykey_clearstrobe_r(): rc=0x%02x\n", rc));
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
AY3600_keymod_r
|
||||
***************************************************************************/
|
||||
|
||||
int ay3600n_device::keymod_r()
|
||||
{
|
||||
return m_keymodreg;
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
Natural keyboard support
|
||||
***************************************************************************/
|
||||
|
||||
UINT8 ay3600n_device::AY3600_get_keycode(unicode_char ch)
|
||||
{
|
||||
UINT8 result;
|
||||
|
||||
switch(ch)
|
||||
{
|
||||
case UCHAR_MAMEKEY(UP):
|
||||
result = 0x0B;
|
||||
break;
|
||||
case UCHAR_MAMEKEY(DOWN):
|
||||
result = 0x0A;
|
||||
break;
|
||||
case UCHAR_MAMEKEY(LEFT):
|
||||
result = 0x08;
|
||||
break;
|
||||
case UCHAR_MAMEKEY(RIGHT):
|
||||
result = 0x15;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (ch <= 0x7F)
|
||||
result = (UINT8) ch;
|
||||
else
|
||||
result = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int ay3600n_device::AY3600_keyboard_queue_chars(const unicode_char *text, size_t text_len)
|
||||
{
|
||||
if (m_keywaiting)
|
||||
return 0;
|
||||
m_keycode = AY3600_get_keycode(text[0]);
|
||||
m_keywaiting = 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool ay3600n_device::AY3600_keyboard_accept_char(unicode_char ch)
|
||||
{
|
||||
return AY3600_get_keycode(ch) != 0;
|
||||
}
|
||||
|
||||
bool ay3600n_device::AY3600_keyboard_charqueue_empty()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void ay3600n_device::set_runtime_config(bool keypad, bool repeat)
|
||||
{
|
||||
m_keypad = keypad;
|
||||
m_repeat = repeat;
|
||||
}
|
||||
|
@ -1,70 +0,0 @@
|
||||
/***************************************************************************
|
||||
|
||||
ay3600.h
|
||||
|
||||
Include file for AY-3600 keyboard
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef AY3600_H
|
||||
#define AY3600_H
|
||||
|
||||
// keymod flags returned by AY3600_keymod_r()
|
||||
#define AY3600_KEYMOD_SHIFT 1
|
||||
#define AY3600_KEYMOD_CONTROL 2
|
||||
#define AY3600_KEYMOD_CAPSLOCK 4
|
||||
#define AY3600_KEYMOD_REPEAT 8
|
||||
#define AY3600_KEYMOD_KEYPAD 0x10
|
||||
#define AY3600_KEYMOD_MODLATCH 0x20
|
||||
#define AY3600_KEYMOD_COMMAND 0x40
|
||||
#define AY3600_KEYMOD_OPTION 0x80
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> ay3600n_device
|
||||
|
||||
class ay3600n_device : public device_t
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
ay3600n_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// interface routines
|
||||
int keydata_strobe_r();
|
||||
int anykey_clearstrobe_r();
|
||||
int keymod_r();
|
||||
|
||||
// config
|
||||
void set_runtime_config(bool keypad, bool repeat);
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
|
||||
|
||||
private:
|
||||
UINT8 AY3600_get_keycode(unicode_char ch);
|
||||
int AY3600_keyboard_queue_chars(const unicode_char *text, size_t text_len);
|
||||
bool AY3600_keyboard_accept_char(unicode_char ch);
|
||||
bool AY3600_keyboard_charqueue_empty();
|
||||
|
||||
bool m_keypad, m_repeat;
|
||||
unsigned int *m_ay3600_keys;
|
||||
UINT8 m_keycode;
|
||||
UINT8 m_keycode_unmodified;
|
||||
UINT8 m_keywaiting;
|
||||
UINT8 m_keystilldown;
|
||||
UINT8 m_keymodreg;
|
||||
int m_last_key;
|
||||
int m_last_key_unmodified;
|
||||
unsigned int m_time_until_repeat;
|
||||
emu_timer *m_timer;
|
||||
};
|
||||
|
||||
// device type definition
|
||||
extern const device_type AY3600N;
|
||||
|
||||
#endif /* AY3600_H */
|
@ -953,7 +953,6 @@ $(MESSOBJ)/apple.a: \
|
||||
$(MESS_VIDEO)/apple2gs.o \
|
||||
$(MESS_MACHINE)/apple2gs.o \
|
||||
$(MESS_DRIVERS)/apple2gs.o \
|
||||
$(MESS_MACHINE)/ay3600.o \
|
||||
$(MESS_MACHINE)/lisa.o \
|
||||
$(MESS_DRIVERS)/lisa.o \
|
||||
$(MESS_AUDIO)/mac.o \
|
||||
|
Loading…
Reference in New Issue
Block a user