Previous 15994 Revisions Next

r3014 Sunday 3rd August, 2008 at 15:33:22 UTC by Wilbert Pol
[IBM5150] Added true keybaord emulation.
[docs]messnew.txt
[src/mess/drivers]at.c pc.c
[src/mess/includes]pc.h
[src/mess/machine]at.c kb_keytro.c pc.c

src/mess/includes/pc.h
r3013r3014
3535READ8_HANDLER( pc_page_r );
3636WRITE8_HANDLER( pc_page_w );
3737
38DRIVER_INIT( ibm5150 );
3839DRIVER_INIT( pccga );
3940DRIVER_INIT( pcmda );
4041DRIVER_INIT( europc );
src/mess/machine/at.c
r3013r3014
520520}
521521
522522
523static void at_kbdc8042_set_keyboard_interface( write8_machine_func clock_cb, write8_machine_func data_cb )
523static void at_kbdc8042_set_keyboard_interface( running_machine *machine, write8_machine_func clock_cb, write8_machine_func data_cb )
524524{
525525   at_kbdc8042.offset1 = 0xFF;
526526   at_kbdc8042.clock_callback = clock_cb;
r3013r3014
639639   init_at_common(machine, &at8042);
640640
641641   /* Attach keyboard to the keyboard controller */
642   at_kbdc8042_set_keyboard_interface( kb_keytronic_set_clock_signal, kb_keytronic_set_data_signal );
642   at_kbdc8042_set_keyboard_interface( machine, kb_keytronic_set_clock_signal, kb_keytronic_set_data_signal );
643643   kb_keytronic_set_host_interface( machine, at_kbdc8042_set_clock_signal, at_kbdc8042_set_data_signal );
644644}
645645
r3013r3014
663663   }
664664
665665   /* Attach keyboard to the keyboard controller */
666   at_kbdc8042_set_keyboard_interface( kb_keytronic_set_clock_signal, kb_keytronic_set_data_signal );
666   at_kbdc8042_set_keyboard_interface( machine, kb_keytronic_set_clock_signal, kb_keytronic_set_data_signal );
667667   kb_keytronic_set_host_interface( machine, at_kbdc8042_set_clock_signal, at_kbdc8042_set_data_signal );
668668}
669669
r3013r3014
678678   init_at_common(machine, &at8042);
679679
680680   /* Attach keyboard to the keyboard controller */
681   at_kbdc8042_set_keyboard_interface( kb_keytronic_set_clock_signal, kb_keytronic_set_data_signal );
681   at_kbdc8042_set_keyboard_interface( machine, kb_keytronic_set_clock_signal, kb_keytronic_set_data_signal );
682682   kb_keytronic_set_host_interface( machine, at_kbdc8042_set_clock_signal, at_kbdc8042_set_data_signal );
683683}
684684
r3013r3014
735735   pc_vga_init(machine, &vga_interface, NULL);
736736
737737   /* Attach keyboard to the keyboard controller */
738   at_kbdc8042_set_keyboard_interface( kb_keytronic_set_clock_signal, kb_keytronic_set_data_signal );
738   at_kbdc8042_set_keyboard_interface( machine, kb_keytronic_set_clock_signal, kb_keytronic_set_data_signal );
739739   kb_keytronic_set_host_interface( machine, at_kbdc8042_set_clock_signal, at_kbdc8042_set_data_signal );
740740}
741741
r3013r3014
752752   pc_vga_init(machine, &vga_interface, NULL);
753753
754754   /* Attach keyboard to the keyboard controller */
755   at_kbdc8042_set_keyboard_interface( kb_keytronic_set_clock_signal, kb_keytronic_set_data_signal );
755   at_kbdc8042_set_keyboard_interface( machine, kb_keytronic_set_clock_signal, kb_keytronic_set_data_signal );
756756   kb_keytronic_set_host_interface( machine, at_kbdc8042_set_clock_signal, at_kbdc8042_set_data_signal );
757757}
758758
src/mess/machine/kb_keytro.c
r3013r3014
11/***************************************************************************
22
3Emulation file for Keytronic KB3270/PC keyboard.
3TODO:
4- Add support for PF01 - PF24
45
6Emulation file for Keytronic KB3270/PC keyboard by Wilbert Pol.
7
58This keyboard supports both the PC/XT and the PC/AT keyboard protocols. The
69desired protocol can be selected by a switch on the keybaord.
710
8SW1 is connected to Port 1 of a 8031.
9  P1.0 - On  - Standard PC and XT
10         Off - Enhanced XT, AT and PS/2 Models.
11  P1.1 - On  - IRMA Emulation
12         Off - Native Scan Code Set
13  P1.2 - On  - Enhanced 101 Scan Code Set
14         Off - Native Scan Code Set
15  P1.3 - On  - Disable E0
16         Off - Enable E0
17  P1.4 - On  - Int'l Code Tables
18         Off - U.S. Code Tables
19  P1.5 - Off - Not Used
20  P1.6 - Off - Not Used
21  P1.7 - On  - Key click
22         Off - No key click
23
24TODO:
25- Verify P1 boot up behavior. Right now we ignore the signals when
26  P1 != 0xFF. (Code at 0x0FCF)
27
2811Keyboard matrix.
2912
3013Z5 = XR 22-00950-001
r3013r3014
3417Z11 = XR 22-908-03B
3518
3619
37              Z11 pin 8
38              |                Z11 pin 7
39              |                |        Z11 pin 6
40              |                |        |        Z11 pin 5
41              |                |        |        |        Z11 pin 4
20  |           Z11 pin 8
21  |           |                Z11 pin 7
22  |           |                |        Z11 pin 6
23  |           |                |        |        Z11 pin 5
24  |           |                |        |        |        Z11 pin 4
4225  |           |                |        |        |        |
4326  F1 -------- F2 ------------- F3 ----- F4 ----- F5 ----- F6 -------- J2 pin 2 - Z5 pin 19
4427  |           |                |        |        |        |
r3013r3014
6851  |           |                |        |        |        |
6952  Backspace - PA1/Dup -------- |<-- --- /a\ ---- Pad + -- Pad + ----- J9 pin 5 - Z7 pin 12
7053  |           |                |        |        |        |
71  Esc ------- NumLock -------- Pad 7 -- Pad 8 -- Pad 4 -- Pad 5 ---------------- Can't finish trace, goes under SW1
54  Esc ------- NumLock -------- Pad 7 -- Pad 8 -- Pad 4 -- Pad 5 ------J9 pin 3 - Z7 pin 2
7255  |           |                |        |        |        |
73  SysReq ---- ScrLk ---------- -->| --- Pad 9 -- Pad - -- Pad 6 ---------------- Can't finish trace, goes under Z8 between pins 5 and 6
56  SysReq ---- ScrLk ---------- -->| --- Pad 9 -- Pad - -- Pad 6 ---------------- goes under Z8 between pins 5 and 6 to Z8 pin 15?
7457  |           |                |        |        |        |
7558  Pad 3 ----- Pad 0 ---------- Pad 0 -- Pad . -- Unused - Up ------------------- Z7 pin 7
7659  |           |                |        |        |        |
77  PrtSc * --- PA2/Field Mark - Right -- /a ----- Center - Unused --------------- Can't finish trace, SW1 blocks view
60  PrtSc * --- PA2/Field Mark - Right -- /a ----- Center - Unused ---- J9 pin 2 - Z7 pin 3
7861  |           |                |        |        |        |
7962
8063The 'Return', 'Backspace, 'Pad 0', 'Right Shift', 'Pad +'  keys on the keyboard
r3013r3014
8669#include "machine/kb_keytro.h"
8770#include "cpu/i8051/i8051.h"
8871
72#define   LOG      0
73
8974static struct {
9075   UINT8               p1;
9176   UINT8               p1_data;
r3013r3014
9681   write8_machine_func      clock_callback;
9782   write8_machine_func      data_callback;
9883   int                  cpunum;
84   UINT16               last_write_addr;
9985} kb_keytronic;
10086
10187
r3013r3014
10692***************************************************************************/
10793INPUT_PORTS_START( kb_keytronic )
10894   PORT_START_TAG( "kb_keytronic_0b" )
109PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
110PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
111PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
112PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
113PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
114PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
115PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
116PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
95   PORT_DIPNAME( 0x01, 0x00, "Protocol selection" )
96   PORT_DIPSETTING( 0x00, "Enhanced XT, AT and PS/2 models" )
97   PORT_DIPSETTING( 0x01, "Standard PC and XT" )
98   PORT_DIPNAME( 0x02, 0x02, "IRMA/Native scan code set" )
99   PORT_DIPSETTING( 0x00, "Native scan code set" )
100   PORT_DIPSETTING( 0x02, "IRMA Emulation" )
101   PORT_DIPNAME( 0x04, 0x04, "Enhanced 101/Native scan code set" )
102   PORT_DIPSETTING( 0x00, "Native scan code set" )
103   PORT_DIPSETTING( 0x04, "Enhanced 101 scan code set" )
104   PORT_DIPNAME( 0x08, 0x08, "Enable E0" )
105   PORT_DIPSETTING( 0x00, "Enable E0" )
106   PORT_DIPSETTING( 0x08, "Disable E0" )
107   PORT_DIPNAME( 0x10, 0x10, "Code tables" )
108   PORT_DIPSETTING( 0x00, "U.S. code tables" )
109   PORT_DIPSETTING( 0x10, "International code tables" )
110   PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_UNUSED )
111   PORT_DIPNAME( 0x80, 0x80, "Key click" )
112   PORT_DIPSETTING( 0x00, "No key click" )
113   PORT_DIPSETTING( 0x80, "Key click" )
117114
118   PORT_START_TAG( "kb_keytronic_0e" )
119   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
120   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
121   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
122   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
123   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
124   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
125   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
126   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
127
128115   PORT_START_TAG( "kb_keytronic_0f" )
129116   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_5)         PORT_CHAR('5')                  /* 06 */
130117   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_4)         PORT_CHAR('4')                  /* 05 */
r3013r3014
132119   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_R)         PORT_CHAR('R')                  /* 13 */
133120   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_G)         PORT_CHAR('G')                  /* 22 */
134121   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_F)         PORT_CHAR('F')                  /* 21 */
135   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_RIGHT)      PORT_NAME("Cursor Right (MF2?)")   /* 6a */
136   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_F7)         PORT_CHAR(UCHAR_MAMEKEY(F7))      /* 41 */
122   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )                                                      /* 41 */
123   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )                                                      /* 6a */
137124
138   PORT_START_TAG( "kb_keytronic_30" )
139   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_F12)         PORT_CHAR(UCHAR_MAMEKEY(F12))      /* 58 */
125   PORT_START_TAG( "kb_keytronic_30_0" )
126   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_N)         PORT_CHAR('N')                  /* 31 */
140127   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_M)         PORT_CHAR('M')                  /* 32 */
141128   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_B)         PORT_CHAR('B')                  /* 30 */
142   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )   /* 5b */
143   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )   /* 5c */
144   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )   /* 5d */
145   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_END)         PORT_NAME("End (MF2?)")            /* 6b */
146   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_F8)         PORT_CHAR(UCHAR_MAMEKEY(F8))      /* 42 */
129   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_V)         PORT_CHAR('V')                  /* 2f */
130   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_C)         PORT_CHAR('C')                  /* 2e */
131   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_COMMA)      PORT_CHAR(',')                  /* 33 */
132   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
147133
148   PORT_START_TAG( "kb_keytronic_31" )
149   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_ASTERISK)      PORT_NAME("KP *")               /* 37 */
134   PORT_START_TAG( "kb_keytronic_30_1" )
135   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_F1)         PORT_CHAR(UCHAR_MAMEKEY(F1))      /* 58 */
136   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_F2)         PORT_CHAR(UCHAR_MAMEKEY(F2))      /* 59 */
137   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_F3)         PORT_CHAR(UCHAR_MAMEKEY(F3))      /* 5a */
138   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_F4)         PORT_CHAR(UCHAR_MAMEKEY(F4))      /* 5b */
139   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_F5)         PORT_CHAR(UCHAR_MAMEKEY(F5))      /* 5c */
140   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_F6)         PORT_CHAR(UCHAR_MAMEKEY(F6))      /* 5d */
141   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )                                                      /* 6b */
142   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )                                                      /* 42 */
143
144   PORT_START_TAG( "kb_keytronic_31_0" )
145   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_6)         PORT_CHAR('6')                  /* 07 */
150146   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_7)         PORT_CHAR('7')                  /* 08 */
151   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_LSHIFT)      PORT_CHAR(UCHAR_MAMEKEY(LSHIFT))   /* 2a */
152   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )   /* 70 */
153   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_Z)         PORT_CHAR('Z')                  /* 2c */
147   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_Y)         PORT_CHAR('Y')                  /* 15 */
148   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_U)         PORT_CHAR('U')                  /* 16 */
149   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_H)         PORT_CHAR('H')                  /* 23 */
154150   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_J)         PORT_CHAR('J')                  /* 24 */
155   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_DOWN)         PORT_NAME("Cursor Down (MF2?)")      /* 6c */
156   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_F9)         PORT_CHAR(UCHAR_MAMEKEY(F9))      /* 43 */
151   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
157152
158   PORT_START_TAG( "kb_keytronic_32" )
153   PORT_START_TAG( "kb_keytronic_31_1" )
154   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_F7)         PORT_CHAR(UCHAR_MAMEKEY(F7))      /* 37 */
155   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_F8)         PORT_CHAR(UCHAR_MAMEKEY(F8))      /* 5f */
156   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_LSHIFT)      PORT_NAME("LShift")               /* 2a */
157   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_NAME("<")                  /* 70 */
158   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_Z)         PORT_CHAR('Z')                  /* 2c */
159   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_X)         PORT_CHAR('X')                  /* 2d */
160   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )                                                      /* 6c */
161   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )                                                      /* 43 */
162
163   PORT_START_TAG( "kb_keytronic_32_0" )
159164   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_9)         PORT_CHAR('9')                  /* 0a */
160   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_LCONTROL)      PORT_CHAR(UCHAR_MAMEKEY(LCONTROL))   /* 1d */
161   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )   /* 71 */
162   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_LALT)         PORT_NAME("Alt")               /* 38 */
163   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_SPACE)      PORT_NAME("Space")               /* 39 */
164   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_LALT)         PORT_NAME("Alt")               /* 38 */
165   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_LEFT)         PORT_NAME("Cursor Left (MF2?)")      /* 69 */
166   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_F6)         PORT_CHAR(UCHAR_MAMEKEY(F6))      /* 40 */
165   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_8)         PORT_CHAR('8')                  /* 09 */
166   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_O)         PORT_CHAR('O')                  /* 18 */
167   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_I)         PORT_CHAR('I')                  /* 17 */
168   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_L)         PORT_CHAR('L')                  /* 26 */
169   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_K)         PORT_CHAR('K')                  /* 25 */
170   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
167171
168   PORT_START_TAG( "kb_keytronic_33" )
172   PORT_START_TAG( "kb_keytronic_32_1" )
173   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_F9)         PORT_CHAR(UCHAR_MAMEKEY(F9))      /* 57 */
174   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_F10)         PORT_CHAR(UCHAR_MAMEKEY(F10))      /* 1d */
175   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_LCONTROL)      PORT_CHAR(UCHAR_MAMEKEY(LCONTROL))   /* 71 */
176   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_LALT)         PORT_NAME("LAlt")               /* 38 */
177   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_SPACE)      PORT_CHAR(' ')                  /* 39 */
178   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_RALT)         PORT_NAME("RAlt")               /* 38 */
179   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )                                                      /* 69 */
180   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )                                                      /* 40 */
181
182   PORT_START_TAG( "kb_keytronic_33_0" )
183   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_2_PAD)      PORT_NAME("KP 2")               /* 50 */
184   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_1_PAD)      PORT_NAME("KP 1")               /* 4f */
185   PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNUSED )
186   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_DOWN)         PORT_NAME("Down")               /* 55 */
187   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_NAME("Enter")               /* 75 */
188   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
189
190   PORT_START_TAG( "kb_keytronic_33_1" )
169191   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_1)         PORT_CHAR('1')                  /* 02 */
170192   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_TILDE)      PORT_CHAR('`')                  /* 29 */
171193   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_Q)         PORT_CHAR('Q')                  /* 10 */
172194   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_TAB)         PORT_CHAR(9)                  /* 0f */
173195   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_A)         PORT_CHAR('A')                  /* 1e */
174196   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_CAPSLOCK)      PORT_NAME("Caps")               /* 3a */
175   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_PGUP)         PORT_NAME("Page Up (MF2?)")         /* 68 */
176   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_F5)         PORT_CHAR(UCHAR_MAMEKEY(F5))      /* 3f */
197   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )                                                      /* 68 */
198   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )                                                      /* 3f */
177199
178   PORT_START_TAG( "kb_keytronic_34" )
200   PORT_START_TAG( "kb_keytronic_34_0" )
201   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
202   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_SLASH)      PORT_CHAR('/')                  /* 35 */
203   PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_RSHIFT)      PORT_CHAR(UCHAR_MAMEKEY(RSHIFT))   /* 36 */
204   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_LEFT)         PORT_NAME("Left")               /* 56 */
205   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_STOP)         PORT_CHAR('.')                  /* 34 */
206   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
207
208   PORT_START_TAG( "kb_keytronic_34_1" )
179209   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_2)         PORT_CHAR('2')                  /* 02 */
180210   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_3)         PORT_CHAR('3')                  /* 03 */
181211   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_W)         PORT_CHAR('W')                  /* 11 */
182212   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_E)         PORT_CHAR('E')                  /* 12 */
183213   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_S)         PORT_CHAR('S')                  /* 1f */
184214   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_D)         PORT_CHAR('D')                  /* 20 */
185   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_UP)         PORT_NAME("Cursor Up (MF2?)")      /* 67 */
186   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_F4)         PORT_CHAR(UCHAR_MAMEKEY(F4))      /* 3e */
215   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )                                                      /* 67 */
216   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )                                                      /* 3e */
187217
188   PORT_START_TAG( "kb_keytronic_35" )
218   PORT_START_TAG( "kb_keytronic_35_0" )
189219   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_0)         PORT_CHAR('0')                  /* 0b */
190220   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_MINUS)      PORT_CHAR('-')                  /* 0c */
191221   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_P)         PORT_CHAR('P')                  /* 19 */
192222   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_OPENBRACE)   PORT_CHAR('[')                  /* 1a */
193223   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_COLON)      PORT_CHAR(';')                  /* 27 */
194224   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_QUOTE)      PORT_CHAR('\'')                  /* 28 */
195   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_HOME)         PORT_NAME("Home (MF2?)")         /* 66 */
196   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_F3)         PORT_CHAR(UCHAR_MAMEKEY(F3))      /* 3d */
225   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
197226
198   PORT_START_TAG( "kb_keytronic_36" )
227   PORT_START_TAG( "kb_keytronic_35_1" )
228   PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
229   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )                                                      /* 66 */
230   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )                                                      /* 3d */
231
232   PORT_START_TAG( "kb_keytronic_36_0" )
199233   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_BACKSPACE)   PORT_CHAR(8)                  /* 0e */
200234   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_EQUALS)      PORT_CHAR('=')                  /* 0d */
201   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_ENTER)      PORT_CHAR(13)                  /* 1c */
235   PORT_BIT( 0x14, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_ENTER)      PORT_CHAR(13)                  /* 1c */
202236   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_BACKSLASH)   PORT_CHAR('\\')                  /* 2b */
203   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
204237   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_CLOSEBRACE)   PORT_CHAR(']')                  /* 1b */
205   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_PAUSE)      PORT_NAME("Pause (MF2?)")         /* 65 */
206   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_F2)         PORT_CHAR(UCHAR_MAMEKEY(F2))      /* 3c */
238   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
207239
208   PORT_START_TAG( "kb_keytronic_37" )
209   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
210   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )   /* 7b */
211   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )   /* 7e */
212   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )   /* 7a */
213   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_PLUS_PAD)      PORT_NAME("KP +")               /* 4e */
214   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
215   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_RALT)         PORT_NAME("AltGr (MF2?)")         /* 64 */
216   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_F1)         PORT_CHAR(UCHAR_MAMEKEY(F1))      /* 3b */
240   PORT_START_TAG( "kb_keytronic_37_0" )
241   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_NAME("PA1")               /* 7b */
242   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_NAME("|<--")               /* 7e */
243   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_NAME("/a\\")                /* 7a */
244   PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_PLUS_PAD)      PORT_NAME("KP +")               /* 4e */
245   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
217246
218   PORT_START_TAG( "kb_keytronic_38" )
219   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )   /* 54 */
247   PORT_START_TAG( "kb_keytronic_37_1" )
248   PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
249   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )                                                      /* 64 */
250   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )                                                      /* 3b */
251
252   PORT_START_TAG( "kb_keytronic_38_0" )
253   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_NAME("SysReq")               /* 54 */
220254   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_SCRLOCK)      PORT_NAME("ScrLock")            /* 46 */
221   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )   /* 7c */
255   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_NAME("-->|")               /* 7c */
222256   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_9_PAD)      PORT_NAME("KP 9")               /* 49 */
223257   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_MINUS_PAD)   PORT_NAME("KP -")               /* 4a */
224258   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_6_PAD)      PORT_NAME("KP 6")               /* 4d */
225   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
226   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
259   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
227260
228   PORT_START_TAG( "kb_keytronic_39" )
261   PORT_START_TAG( "kb_keytronic_39_0" )
229262   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_ESC)         PORT_NAME("Esc")               /* 01 */
230263   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_NUMLOCK)      PORT_NAME("NumLock")            /* 45 */
231264   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_7_PAD)      PORT_NAME("KP 7")               /* 47 */
232265   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_8_PAD)      PORT_NAME("KP 8")               /* 48 */
233266   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_4_PAD)      PORT_NAME("KP 4")               /* 4b */
234267   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_5_PAD)      PORT_NAME("KP 5")               /* 4c */
235   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )   /* 76 */
236   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_PRTSCR)      PORT_NAME("PrtScr (MF2?)")         /* 63 */
268   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )                                                      /* 76 */
269   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )                                                      /* 63 */
237270
238   PORT_START_TAG( "kb_keytronic_3a" )
239   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_DEL)         PORT_NAME("Delete (MF2?)")         /* 6f */
240   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )   /* 7f */
241   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )   /* 7d */
242   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )   /* 79 */
243   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )   /* 77 */
271   PORT_START_TAG( "kb_keytronic_3a_0" )
272   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_NAME("PrtSc *")            /* 6f */
273   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_NAME("PA2")               /* 7f */
274   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_RIGHT)      PORT_NAME("Right")               /* 7d */
275   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_NAME("/a")                  /* 79 */
276   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_NAME("Center")               /* 77 */
244277   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
245   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_INSERT)      PORT_NAME("Insert (MF2?)")         /* 6e */
246   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_SLASH_PAD)   PORT_NAME("KP / (MF2?)")         /* 62 */
278   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )                                                      /* 6e */
279   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )                                                      /* 62 */
247280
248   PORT_START_TAG( "kb_keytronic_3b" )
281   PORT_START_TAG( "kb_keytronic_3b_0" )
249282   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_3_PAD)      PORT_NAME("KP 3")               /* 51 */
250   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
251   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_0_PAD)      PORT_NAME("KP 0")               /* 52 */
283   PORT_BIT( 0x06, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_0_PAD)      PORT_NAME("KP 0")               /* 52 */
252284   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_DEL_PAD)      PORT_NAME("KP .")               /* 53 */
253285   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
254   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )   /* 78 */
255   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_PGDN)         PORT_NAME("Page Down (MF2?)")      /* 6d */
256   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_F10)         PORT_CHAR(UCHAR_MAMEKEY(F10))      /* 44 */
286   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )   PORT_CODE(KEYCODE_UP)         PORT_NAME("Up")                  /* 78 */
287   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )                                                      /* 6d */
288   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )                                                      /* 44 */
257289
258290INPUT_PORTS_END
259291
r3013r3014
270302WRITE8_HANDLER( kb_keytronic_set_data_signal )
271303{
272304   kb_keytronic.data_signal = data;
273//printf("kb_keytronic_set_data_signal(): data = %d\n", data);
274305   cpunum_set_input_line( machine, kb_keytronic.cpunum, I8051_T0_LINE, data ? HOLD_LINE : CLEAR_LINE );
275306}
276307
r3013r3014
286317
287318static READ8_HANDLER( kb_keytronic_p1_r )
288319{
289   UINT8 data = kb_keytronic.p1_data;
290
291   return data;
320   return kb_keytronic.p1 & kb_keytronic.p1_data;
292321}
293322
294323
295324static WRITE8_HANDLER( kb_keytronic_p1_w )
296325{
297   logerror("kb_keytronic_p1_w(): write %02x\n", data );
326   if (LOG)
327      logerror( "kb_keytronic_p1_w(): write %02x\n", data );
298328
299   switch( data )
300   {
301   case 0x0b:
302//      kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_0b" );
303      kb_keytronic.p1_data = 0xFF;
304      break;
305   case 0x0e:
306//      kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_0e" );
307      kb_keytronic.p1_data = 0xFE;
308      break;
309   case 0x0f:
310//      kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_0f" );
311      break;
312   case 0x30:
313//      kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_30" );
314      break;
315   case 0x31:
316//      kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_31" );
317      break;
318   case 0x32:
319//      kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_32" );
320      break;
321   case 0x33:
322//      kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_33" );
323      break;
324   case 0x34:
325//      kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_34" );
326      break;
327   case 0x35:
328//      kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_35" );
329      break;
330   case 0x36:
331//      kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_36" );
332      break;
333   case 0x37:
334//      kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_37" );
335      break;
336   case 0x38:
337//      kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_38" );
338      break;
339   case 0x39:
340//      kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_39" );
341      break;
342   case 0x3a:
343//      kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_3a" );
344      break;
345   case 0x3b:
346//      kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_3b" );
347      break;
348   }
349329   kb_keytronic.p1 = data;
350330}
351331
r3013r3014
360340
361341static WRITE8_HANDLER( kb_keytronic_p2_w )
362342{
363   logerror("kb_keytronic_p2_w(): write %02x\n", data );
343   if (LOG)
344      logerror( "kb_keytronic_p2_w(): write %02x\n", data );
364345
365346   kb_keytronic.p2 = data;
366347}
r3013r3014
378359   /* T0 signal */
379360   data |= ( kb_keytronic.data_signal ? 0x00 : 0x10 );
380361
381//printf("kb_keytronic_p3_r(): %02x\n", data);
382362   return data;
383363}
384364
385365
386366static WRITE8_HANDLER( kb_keytronic_p3_w )
387367{
388   logerror("kb_keytronic_p3_w(): write %02x\n", data );
368   if (LOG)
369      logerror( "kb_keytronic_p3_w(): write %02x\n", data );
370
371   kb_keytronic.p3 = data;
389372}
390373
391374
392375static READ8_HANDLER( kb_keytronic_data_r )
393376{
394   logerror("kb_keytronic_data_r(): read from %04x\n", offset );
377   if (LOG)
378      logerror( "kb_keytronic_data_r(): read from %04x\n", offset );
395379
396   if ( kb_keytronic.p1 == 0xFF )
397   {
398      kb_keytronic.data_signal = ( offset & 0x0100 ) ? 1 : 0;
399      kb_keytronic.clock_signal = ( offset & 0x0200 ) ? 1 : 0;
380   kb_keytronic.data_signal = ( offset & 0x0100 ) ? 1 : 0;
381   kb_keytronic.clock_signal = ( offset & 0x0200 ) ? 1 : 0;
400382
401      kb_keytronic.data_callback( machine, 0, kb_keytronic.data_signal );
402      kb_keytronic.clock_callback( machine, 0, kb_keytronic.clock_signal );
383   kb_keytronic.data_callback( machine, 0, kb_keytronic.data_signal );
384   kb_keytronic.clock_callback( machine, 0, kb_keytronic.clock_signal );
403385
404//printf("data = %d, clock = %d\n", kb_keytronic.data_signal, kb_keytronic.clock_signal );
405   }
406386   return 0xFF;
407387}
408388
409389
410390static WRITE8_HANDLER( kb_keytronic_data_w )
411391{
412   if ( kb_keytronic.p1 == 0xFF )
392   if (LOG)
393      logerror( "kb_keytronic_data_w(): write to offset %04x\n", offset );
394
395   /* Check for low->high transition on AD8 */
396   if ( ! ( kb_keytronic.last_write_addr & 0x0100 ) && ( offset & 0x0100 ) )
413397   {
414      kb_keytronic.data_signal = ( offset & 0x0100 ) ? 1 : 0;
415      kb_keytronic.clock_signal = ( offset & 0x0200 ) ? 1 : 0;
398      switch ( kb_keytronic.p1 )
399      {
400      case 0x0e:
401         break;
402      case 0x0f:
403         kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_0f" );
404         break;
405      case 0x30:
406         kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_30_0" );
407         break;
408      case 0x31:
409         kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_31_0" );
410         break;
411      case 0x32:
412         kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_32_0" );
413         break;
414      case 0x33:
415         kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_33_0" );
416         break;
417      case 0x34:
418         kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_34_0" );
419         break;
420      case 0x35:
421         kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_35_0" );
422         break;
423      case 0x36:
424         kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_36_0" );
425         break;
426      case 0x37:
427         kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_37_0" ) | ( input_port_read( machine, "kb_keytronic_36_0" ) & 0x01 );
428         break;
429      case 0x38:
430         kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_38_0" );
431         break;
432      case 0x39:
433         kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_39_0" );
434         break;
435      case 0x3a:
436         kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_3a_0" );
437         break;
438      case 0x3b:
439         kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_3b_0" );
440         break;
441      }
442   }
416443
417      kb_keytronic.data_callback( machine, 0, kb_keytronic.data_signal );
418      kb_keytronic.clock_callback( machine, 0, kb_keytronic.clock_signal );
419   
420//printf("data = %d, clock = %d\n", kb_keytronic.data_signal, kb_keytronic.clock_signal );
444   /* Check for low->high transition on AD9 */
445   if ( ! ( kb_keytronic.last_write_addr & 0x0200 ) && ( offset & 0x0200 ) )
446   {
447      switch ( kb_keytronic.p1 )
448      {
449      case 0x0b:
450         kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_0b" );
451         break;
452      case 0x30:
453         kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_30_1" );
454         break;
455      case 0x31:
456         kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_31_1" );
457         break;
458      case 0x32:
459         kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_32_1" );
460         break;
461      case 0x33:
462         kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_33_1" );
463         break;
464      case 0x34:
465         kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_34_1" );
466         break;
467      case 0x35:
468         kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_35_1" );
469         break;
470      case 0x36:
471         kb_keytronic.p1_data = 0xFF;
472         break;
473      case 0x37:
474         kb_keytronic.p1_data = input_port_read( machine, "kb_keytronic_37_1" );
475         break;
476      case 0x38:
477         kb_keytronic.p1_data = 0xFF;
478         break;
479      case 0x39:
480         kb_keytronic.p1_data = 0xFF;
481         break;
482      case 0x3a:
483         kb_keytronic.p1_data = 0xFF;
484         break;
485      }
421486   }
487
488   kb_keytronic.last_write_addr = offset;
422489}
423490
424491
src/mess/machine/pc.c
r3013r3014
4848
4949#include "machine/8237dma.h"
5050
51#include "machine/kb_keytro.h"
5152
53
5254#define VERBOSE_PIO 0   /* PIO (keyboard controller) */
5355
5456#define PIO_LOG(N,M,A) \
r3013r3014
292294{
293295   {
294296      {
295         4772720/4,            /* heartbeat IRQ */
297         XTAL_14_31818MHz/12,            /* heartbeat IRQ */
296298         ibm5150_timer0_w
297299      }, {
298         4772720/4,            /* dram refresh */
300         XTAL_14_31818MHz/12,            /* dram refresh */
299301         ibm5150_pit8253_out1_changed
300302      }, {
301         4772720/4,            /* pio port c pin 4, and speaker polling enough */
303         XTAL_14_31818MHz/12,            /* pio port c pin 4, and speaker polling enough */
302304         ibm5150_pit8253_out2_changed
303305      }
304306   }
r3013r3014
315317{
316318   {
317319      {
318         4772720/4,              /* heartbeat IRQ */
320         XTAL_14_31818MHz/12,              /* heartbeat IRQ */
319321         ibm5150_timer0_w
320322      }, {
321         4772720/4,              /* dram refresh */
323         XTAL_14_31818MHz/12,              /* dram refresh */
322324         NULL
323325      }, {
324         4772720/4,              /* pio port c pin 4, and speaker polling enough */
326         XTAL_14_31818MHz/12,              /* pio port c pin 4, and speaker polling enough */
325327         ibm5150_pit8253_out2_changed
326328      }
327329   }
r3013r3014
594596 * 4 - PB4 - ENBRAMPCK   - Enable ram parity check
595597 * 5 - PB5 - ENABLEI/OCK - Enable expansion I/O check
596598 * 6 - PB6 -             - Connected to keyboard clock signal
599 *                         0 = ignore keyboard signals
600 *                         1 = accept keyboard signals
597601 * 7 - PB7 -             - Clear/disable shift register and IRQ1 line
602 *                         0 = normal operation
603 *                         1 = clear and disable shift register and clear IRQ1 flip flop
598604 *
599605 * PORT C
600606 * 0 - PC0 -         - Dipswitch 0/4
r3013r3014
609615 **********************************************************/
610616
611617static struct {
612   int portc_switch_high;
613   int speaker;
614   int keyboard_disabled;
615   UINT8   keyb_clock;
616   UINT8   portb;
618   int                  portc_switch_high;
619   int                  speaker;
620   int                  keyboard_clear;
621   UINT8               keyb_clock;
622   UINT8               portb;
623   UINT8               clock_signal;
624   UINT8               data_signal;
625   UINT8               shift_register;
626   UINT8               shift_enable;
627   write8_machine_func      clock_callback;
628   write8_machine_func      data_callback;
617629} pc_ppi={ 0 };
618630
619631
620static READ8_HANDLER (pc_ppi_porta_r)
632static READ8_HANDLER (ibm5150_ppi_porta_r)
621633{
622634   int data = 0xFF;
623635
624636   /* KB port A */
625   if (pc_ppi.keyboard_disabled)
637   if (pc_ppi.keyboard_clear)
626638   {
627639      /*   0  0 - no floppy drives
628640       *   1  Not used
r3013r3014
637649   }
638650   else
639651   {
640      if ( pc_ppi.keyb_clock )
641      {
642         data = pc_keyb_read();
643      }
652      data = pc_ppi.shift_register;
644653   }
645654    PIO_LOG(1,"PIO_A_r",("$%02x\n", data));
646655    return data;
647656}
648657
649658
650static READ8_HANDLER (pc_ppi_portb_r )
659static READ8_HANDLER (ibm5150_ppi_portb_r )
651660{
652661   int data;
653662
r3013r3014
657666}
658667
659668
660static READ8_HANDLER ( pc_ppi_portc_r )
669static READ8_HANDLER ( ibm5150_ppi_portc_r )
661670{
662671   int timer2_output = pit8253_get_output( pc_devices.pit8253, 2 );
663672   int data=0xff;
r3013r3014
665674   data&=~0x80; // no parity error
666675   data&=~0x40; // no error on expansion board
667676   /* KB port C: equipment flags */
668//   if (pc_port[0x61] & 0x08)
669677   if (pc_ppi.portc_switch_high)
670678   {
671679      /* read hi nibble of S2 */
r3013r3014
705713}
706714
707715
708static WRITE8_HANDLER ( pc_ppi_porta_w )
716static WRITE8_HANDLER ( ibm5150_ppi_porta_w )
709717{
710718   /* KB controller port A */
711719   PIO_LOG(1,"PIO_A_w",("$%02x\n", data));
712720}
713721
714722
715static WRITE8_HANDLER ( pc_ppi_portb_w )
723static WRITE8_HANDLER ( ibm5150_ppi_portb_w )
716724{
717725   /* KB controller port B */
718726   pc_ppi.portb = data;
719727   pc_ppi.portc_switch_high = data & 0x08;
720   pc_ppi.keyboard_disabled = data & 0x80;
728   pc_ppi.keyboard_clear = data & 0x80;
721729   pc_ppi.keyb_clock = data & 0x40;
722730   pit8253_gate_w( pc_devices.pit8253, 2, data & 1);
723731   pc_speaker_set_spkrdata( data & 0x02 );
724   pc_keyb_set_clock( pc_ppi.keyb_clock );
725732
726733   cassette_change_state( image_from_devtype_and_index( IO_CASSETTE, 0 ), ( data & 0x08 ) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
727734
728   if (data & 0x80)
729      pc_keyb_clear();
735   pc_ppi.clock_signal = ( pc_ppi.keyb_clock ) ? 1 : 0;
736
737   pc_ppi.clock_callback( machine, 0, pc_ppi.clock_signal );
738
739   /* If PB7 is set clear the shift register and reset the IRQ line */
740   if ( pc_ppi.keyboard_clear )
741   {
742      pic8259_set_irq_line(pc_devices.pic8259_master, 1, 0);
743      pc_ppi.shift_register = 0;
744      pc_ppi.shift_enable = 1;
745   }
730746}
731747
732748
733static WRITE8_HANDLER ( pc_ppi_portc_w )
749static WRITE8_HANDLER ( ibm5150_ppi_portc_w )
734750{
735751   /* KB controller port C */
736752   PIO_LOG(1,"PIO_C_w",("$%02x\n", data));
737753}
738754
739755
756static WRITE8_HANDLER( ibm5150_kb_set_clock_signal )
757{
758   if ( pc_ppi.clock_signal != data )
759   {
760      if ( pc_ppi.keyb_clock && pc_ppi.shift_enable )
761      {
762         pc_ppi.clock_signal = data;
763         if ( ! pc_ppi.keyboard_clear )
764         {
765            /* Data is clocked in on a high->low transition */
766            if ( ! data )
767            {
768               UINT8   trigger_irq = pc_ppi.shift_register & 0x01;
769
770               pc_ppi.shift_register = ( pc_ppi.shift_register >> 1 ) | ( pc_ppi.data_signal << 7 );
771               if ( trigger_irq )
772               {
773                  pic8259_set_irq_line(pc_devices.pic8259_master, 1, 1);
774                  pc_ppi.shift_enable = 0;
775                  pc_ppi.clock_signal = 0;
776                  pc_ppi.clock_callback( machine, 0, 0 );
777               }
778            }
779         }
780      }
781   }
782
783   pc_ppi.clock_callback( machine, 0, pc_ppi.clock_signal );
784}
785
786
787static WRITE8_HANDLER( ibm5150_kb_set_data_signal )
788{
789   pc_ppi.data_signal = data;
790
791   pc_ppi.data_callback( machine, 0, pc_ppi.data_signal );
792}
793
794
795static void ibm5150_set_keyboard_interface( running_machine *machine, write8_machine_func clock_cb, write8_machine_func data_cb )
796{
797   pc_ppi.clock_callback = clock_cb;
798   pc_ppi.data_callback = data_cb;
799}
800
801
740802/* IBM PC has a 8255 which is connected to keyboard and other
741803status information */
742804const ppi8255_interface ibm5150_ppi8255_interface =
743805{
744   pc_ppi_porta_r,
745   pc_ppi_portb_r,
746   pc_ppi_portc_r,
747   pc_ppi_porta_w,
748   pc_ppi_portb_w,
749   pc_ppi_portc_w
806   ibm5150_ppi_porta_r,
807   ibm5150_ppi_portb_r,
808   ibm5150_ppi_portc_r,
809   ibm5150_ppi_porta_w,
810   ibm5150_ppi_portb_w,
811   ibm5150_ppi_portc_w
750812};
751813
752814
815static READ8_HANDLER (ibm5160_ppi_porta_r)
816{
817   int data = 0xFF;
818
819   /* KB port A */
820   if (pc_ppi.keyboard_clear)
821   {
822      /*   0  0 - no floppy drives
823       *   1  Not used
824       * 2-3  The number of memory banks on the system board
825       * 4-5  Display mode
826       *       11 = monochrome
827       *      10 - color 80x25
828       *      01 - color 40x25
829       * 6-7  The number of floppy disk drives
830       */
831      data = input_port_read(machine, "DSW0");
832   }
833   else
834   {
835      if ( pc_ppi.keyb_clock )
836      {
837         data = pc_keyb_read();
838      }
839   }
840    PIO_LOG(1,"PIO_A_r",("$%02x\n", data));
841    return data;
842}
843
844
753845static READ8_HANDLER ( ibm5160_ppi_portc_r )
754846{
755847   int timer2_output = pit8253_get_output( pc_devices.pit8253, 2 );
r3013r3014
786878{
787879   pc_ppi.portb = data;
788880   pc_ppi.portc_switch_high = data & 0x08;
789   pc_ppi.keyboard_disabled = data & 0x80;
881   pc_ppi.keyboard_clear = data & 0x80;
790882   pc_ppi.keyb_clock = data & 0x40;
791883   pit8253_gate_w( pc_devices.pit8253, 2, data & 0x01 );
792884   pc_speaker_set_spkrdata( data & 0x02 );
793885   pc_keyb_set_clock( pc_ppi.keyb_clock );
794886
795   if ( data & 0x80 )
887   if ( pc_ppi.keyboard_clear )
796888      pc_keyb_clear();
797889}
798890
799891
800892const ppi8255_interface ibm5160_ppi8255_interface =
801893{
802   pc_ppi_porta_r,
803   pc_ppi_portb_r,
894   ibm5160_ppi_porta_r,
895   ibm5150_ppi_portb_r,
804896   ibm5160_ppi_portc_r,
805   pc_ppi_porta_w,
897   ibm5150_ppi_porta_w,
806898   ibm5160_ppi_portb_w,
807   pc_ppi_portc_w
899   ibm5150_ppi_portc_w
808900};
809901
810902
r3013r3014
882974const ppi8255_interface pcjr_ppi8255_interface =
883975{
884976   pcjr_ppi_porta_r,
885   pc_ppi_portb_r,
977   ibm5150_ppi_portb_r,
886978   pcjr_ppi_portc_r,
887   pc_ppi_porta_w,
979   ibm5150_ppi_porta_w,
888980   pcjr_ppi_portb_w,
889   pc_ppi_portc_w
981   ibm5150_ppi_portc_w
890982};
891983
892984
r3013r3014
9591051   pc_mouse_initialise();
9601052}
9611053
1054
1055DRIVER_INIT( ibm5150 )
1056{
1057   mess_init_pc_common(machine, PCCOMMON_KEYBOARD_PC, pc_set_keyb_int, pc_set_irq_line);
1058   pc_rtc_init();
1059
1060   /* Attach keyboard to the keyboard controller */
1061   ibm5150_set_keyboard_interface( machine, kb_keytronic_set_clock_signal, kb_keytronic_set_data_signal );
1062   kb_keytronic_set_host_interface( machine, ibm5150_kb_set_clock_signal, ibm5150_kb_set_data_signal );
1063}
1064
1065
9621066DRIVER_INIT( pccga )
9631067{
9641068   mess_init_pc_common(machine, PCCOMMON_KEYBOARD_PC, pc_set_keyb_int, pc_set_irq_line);
9651069   pc_rtc_init();
9661070}
9671071
1072
9681073DRIVER_INIT( bondwell )
9691074{
9701075   mess_init_pc_common(machine, PCCOMMON_KEYBOARD_PC, pc_set_keyb_int, pc_set_irq_line);
src/mess/drivers/at.c
r3013r3014
304304   PORT_BIT( 0x02, 0x02,   IPT_UNUSED ) /* no turbo switch */
305305   PORT_BIT( 0x01, 0x01,   IPT_UNUSED )
306306
307   PORT_INCLUDE( at_keyboard )      /* IN4 - IN11 */
307   PORT_INCLUDE( kb_keytronic )      /* IN4 - IN11 */
308308   PORT_INCLUDE( pc_mouse_microsoft )   /* IN12 - IN14 */
309309   PORT_INCLUDE( pc_joystick )         /* IN15 - IN19 */
310310   PORT_INCLUDE( pcvideo_cga_at )
r3013r3014
390390   PORT_BIT( 0x02, 0x02,   IPT_UNUSED ) /* no turbo switch */
391391   PORT_BIT( 0x01, 0x01,   IPT_UNUSED )
392392
393   PORT_INCLUDE( at_keyboard )      /* IN4 - IN11 */
393   PORT_INCLUDE( kb_keytronic )      /* IN4 - IN11 */
394394   PORT_INCLUDE( pc_mouse_microsoft )   /* IN12 - IN14 */
395395   PORT_INCLUDE( pc_joystick )         /* IN15 - IN19 */
396396INPUT_PORTS_END
src/mess/drivers/pc.c
r3013r3014
2020IBM PC 5150
2121===========
2222
23- Intel 8088 at 4.77 MHz derived from a 14.31818 MHz crystal
24- RAM: min. 16KB, max. 256KB
25- Graphics: MDA, CGA, or MDA and CGA
26- Cassette port
27- Optional 8087 co-processor
28- Optional up to 2 160KB single-sided or 360KB double-sided 5 1/4" floppy drives
29- Optional 10MB hard disk
30
31
2332IBM PC-JR
2433=========
2534
35
2636IBM PC-XT 5160
2737==============
2838
39- Intel 8086 at 4.77 MHz derived from a 14.31818 MHz crystal
40- RAM: min. 128KB, max. 640KB
41- Graphics: MDA, CGA, or MDA and CGA
42- Optional 8087 co-processor
43- One 360KB double-sided 5 1/4" floppy drive
44- 10MB or 20MB Seagate ST-412 hard disk
45- Optional second 360KB double-sided 5 1/4" floppy drive
46
47
48Tandy 1000
49==========
50
51Tandy 1000 machines are similar to the IBM 5160s with CGA graphics. Tandy
52added some additional graphic capabilities similar, but not equal, to
53those added for the IBM PC Jr.
54
2955Tandy 1000 (8086/8088) variations:
30561000            128KB-640KB RAM      4.77 MHz      v01.00.00, v01.01.00
31571000A/1000HD      128KB-640KB RAM      4.77 MHz      v01.01.00
r3013r3014
100126#include "sound/sn76496.h"
101127#include "sound/3812intf.h"
102128
129#include "machine/kb_keytro.h"
103130
131
104132#define ym3812_StdClock 3579545
105133
106134/*
r3013r3014
548576   PORT_INCLUDE( pcvideo_cga )
549577INPUT_PORTS_END
550578
579static INPUT_PORTS_START( ibm5150 )
580   PORT_START_TAG("IN0") /* IN0 */
581   PORT_BIT ( 0xf0, 0xf0,    IPT_UNUSED )
582   PORT_BIT ( 0x08, 0x08,    IPT_VBLANK )
583   PORT_BIT ( 0x07, 0x07,    IPT_UNUSED )
584
585   PORT_START_TAG("DSW0") /* IN1 */
586   PORT_DIPNAME( 0xc0, 0x40, "Number of floppy drives")
587   PORT_DIPSETTING(   0x00, "1" )
588   PORT_DIPSETTING(   0x40, "2" )
589   PORT_DIPSETTING(   0x80, "3" )
590   PORT_DIPSETTING(   0xc0, "4" )
591   PORT_DIPNAME( 0x30, 0x20, "Graphics adapter")
592   PORT_DIPSETTING(   0x00, "EGA/VGA" )
593   PORT_DIPSETTING(   0x10, "Color 40x25" )
594   PORT_DIPSETTING(   0x20, "Color 80x25" )
595   PORT_DIPSETTING(   0x30, "Monochrome" )
596   PORT_DIPNAME( 0x0c, 0x0c, "RAM banks")
597   PORT_DIPSETTING(   0x00, "1 - 16  64 256K" )
598   PORT_DIPSETTING(   0x04, "2 - 32 128 512K" )
599   PORT_DIPSETTING(   0x08, "3 - 48 192 576K" )
600   PORT_DIPSETTING(   0x0c, "4 - 64 256 640K" )
601   PORT_DIPNAME( 0x02, 0x00, "80387 installed")
602   PORT_DIPSETTING(   0x00, DEF_STR( No ) )
603   PORT_DIPSETTING(   0x02, DEF_STR( Yes ) )
604   PORT_DIPNAME( 0x01, 0x01, "Floppy installed")
605   PORT_DIPSETTING(   0x00, DEF_STR( No ) )
606   PORT_DIPSETTING(   0x01, DEF_STR( Yes ) )
607
608   PORT_START_TAG("DSW1") /* IN2 */
609   PORT_DIPNAME( 0x80, 0x80, "COM1: enable")
610   PORT_DIPSETTING(   0x00, DEF_STR( No ) )
611   PORT_DIPSETTING(   0x80, DEF_STR( Yes ) )
612   PORT_DIPNAME( 0x40, 0x40, "COM2: enable")
613   PORT_DIPSETTING(   0x00, DEF_STR( No ) )
614   PORT_DIPSETTING(   0x40, DEF_STR( Yes ) )
615   PORT_DIPNAME( 0x20, 0x00, "COM3: enable")
616   PORT_DIPSETTING(   0x00, DEF_STR( No ) )
617   PORT_DIPSETTING(   0x20, DEF_STR( Yes ) )
618   PORT_DIPNAME( 0x10, 0x00, "COM4: enable")
619   PORT_DIPSETTING(   0x00, DEF_STR( No ) )
620   PORT_DIPSETTING(   0x10, DEF_STR( Yes ) )
621   PORT_DIPNAME( 0x08, 0x08, "LPT1: enable")
622   PORT_DIPSETTING(   0x00, DEF_STR( No ) )
623   PORT_DIPSETTING(   0x08, DEF_STR( Yes ) )
624   PORT_DIPNAME( 0x04, 0x00, "LPT2: enable")
625   PORT_DIPSETTING(   0x00, DEF_STR( No ) )
626   PORT_DIPSETTING(   0x04, DEF_STR( Yes ) )
627   PORT_DIPNAME( 0x02, 0x00, "LPT3: enable")
628   PORT_DIPSETTING(   0x00, DEF_STR( No ) )
629   PORT_DIPSETTING(   0x02, DEF_STR( Yes ) )
630   PORT_DIPNAME( 0x01, 0x00, "Game port enable")
631   PORT_DIPSETTING(   0x00, DEF_STR( No ) )
632   PORT_DIPSETTING(    0x01, DEF_STR( Yes ) )
633
634   PORT_START_TAG("DSW2") /* IN3 */
635   PORT_DIPNAME( 0xf0, 0x80, "Serial mouse")
636   PORT_DIPSETTING(   0x80, "COM1" )
637   PORT_DIPSETTING(   0x40, "COM2" )
638   PORT_DIPSETTING(   0x20, "COM3" )
639   PORT_DIPSETTING(   0x10, "COM4" )
640   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
641   PORT_DIPNAME( 0x08, 0x08, "HDC1 (C800:0 port 320-323)")
642   PORT_DIPSETTING(   0x00, DEF_STR( No ) )
643   PORT_DIPSETTING(   0x08, DEF_STR( Yes ) )
644   PORT_DIPNAME( 0x04, 0x04, "HDC2 (CA00:0 port 324-327)")
645   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
646   PORT_DIPSETTING(   0x04, DEF_STR( Yes ) )
647   PORT_BIT( 0x02, 0x02,   IPT_UNUSED ) /* no turbo switch */
648   PORT_BIT( 0x01, 0x01,   IPT_UNUSED )
649
650   PORT_INCLUDE( kb_keytronic )      /* IN4 - IN11 */
651   PORT_INCLUDE( pc_mouse_microsoft )   /* IN12 - IN14 */
652   PORT_INCLUDE( pc_joystick )         /* IN15 - IN19 */
653   PORT_INCLUDE( pcvideo_cga )
654INPUT_PORTS_END
655
551656static INPUT_PORTS_START( europc )
552657   PORT_START_TAG("IN0") /* IN0 */
553658   PORT_BIT ( 0xf0, 0xf0,    IPT_UNUSED )
r3013r3014
12011306   MDRV_CPU_IO_MAP(pc8_io, 0)
12021307   MDRV_CPU_VBLANK_INT_HACK(pc_frame_interrupt, 4)
12031308
1309   MDRV_INTERLEAVE(1)
1310
12041311   MDRV_MACHINE_START(pc)
12051312   MDRV_MACHINE_RESET(pc)
12061313
r3013r3014
13191426   MDRV_DEVICE_ADD("printer3", PRINTER)
13201427MACHINE_DRIVER_END
13211428
1429static MACHINE_DRIVER_START( ibm5150 )
1430   /* basic machine hardware */
1431   MDRV_CPU_ADD("main", I8088, XTAL_14_31818MHz/3)
1432   MDRV_CPU_PROGRAM_MAP(pc8_map, 0)
1433   MDRV_CPU_IO_MAP(pc8_io, 0)
1434   MDRV_CPU_CONFIG(i86_address_mask)
1435
1436   MDRV_INTERLEAVE(1)
1437
1438   MDRV_MACHINE_START(pc)
1439   MDRV_MACHINE_RESET(pc)
1440
1441   MDRV_DEVICE_ADD( "pit8253", PIT8253 )
1442   MDRV_DEVICE_CONFIG( ibm5150_pit8253_config )
1443
1444   MDRV_DEVICE_ADD( "dma8237", DMA8237 )
1445   MDRV_DEVICE_CONFIG( ibm5150_dma8237_config )
1446
1447   MDRV_DEVICE_ADD( "pic8259_master", PIC8259 )
1448   MDRV_DEVICE_CONFIG( ibm5150_pic8259_master_config )
1449
1450   MDRV_DEVICE_ADD( "pic8259_slave", PIC8259 )
1451   MDRV_DEVICE_CONFIG( ibm5150_pic8259_slave_config )
1452
1453   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
1454   MDRV_DEVICE_CONFIG( ibm5150_ppi8255_interface )
1455
1456   MDRV_DEVICE_ADD( "ins8250_0", INS8250 )         /* TODO: Verify model */
1457   MDRV_DEVICE_CONFIG( ibm5150_com_interface[0] )
1458
1459   MDRV_DEVICE_ADD( "ins8250_1", INS8250 )         /* TODO: Verify model */
1460   MDRV_DEVICE_CONFIG( ibm5150_com_interface[1] )
1461
1462   MDRV_DEVICE_ADD( "ins8250_2", INS8250 )         /* TODO: Verify model */
1463   MDRV_DEVICE_CONFIG( ibm5150_com_interface[2] )
1464
1465   MDRV_DEVICE_ADD( "ins8250_3", INS8250 )         /* TODO: Verify model */
1466   MDRV_DEVICE_CONFIG( ibm5150_com_interface[3] )
1467
1468   /* video hardware */
1469   MDRV_IMPORT_FROM( pcvideo_cga )
1470
1471   /* sound hardware */
1472   MDRV_SPEAKER_STANDARD_MONO("mono")
1473   MDRV_SOUND_ADD("speaker", SPEAKER, 0)
1474   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
1475#ifdef ADLIB
1476   MDRV_SOUND_ADD("ym3812", YM3812, ym3812_StdClock)
1477   MDRV_SOUND_CONFIG(ym3812_interface)
1478   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
1479#endif
1480#ifdef GAMEBLASTER
1481   MDRV_SOUND_ADD("saa1099.1", SAA1099, 4772720)
1482   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
1483   MDRV_SOUND_ADD("saa1099.2", SAA1099, 4772720)
1484   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
1485#endif
1486
1487   MDRV_IMPORT_FROM( kb_keytronic )
1488
1489   /* printer */
1490   MDRV_DEVICE_ADD("printer", PRINTER)
1491   MDRV_DEVICE_ADD("printer2", PRINTER)
1492   MDRV_DEVICE_ADD("printer3", PRINTER)
1493MACHINE_DRIVER_END
1494
13221495static MACHINE_DRIVER_START( pccga )
13231496   /* basic machine hardware */
13241497   MDRV_CPU_PC(pc8, pc8, I8088, 4772720, pc_frame_interrupt)   /* 4,77 Mhz */
13251498
1499   MDRV_INTERLEAVE(1)
1500
13261501   MDRV_MACHINE_START(pc)
13271502   MDRV_MACHINE_RESET(pc)
13281503
r3013r3014
13391514   MDRV_DEVICE_CONFIG( ibm5150_pic8259_slave_config )
13401515
13411516   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
1342   MDRV_DEVICE_CONFIG( ibm5150_ppi8255_interface )
1517   MDRV_DEVICE_CONFIG( ibm5160_ppi8255_interface )
13431518
13441519   MDRV_DEVICE_ADD( "ins8250_0", INS8250 )         /* TODO: Verify model */
13451520   MDRV_DEVICE_CONFIG( ibm5150_com_interface[0] )
r3013r3014
13721547   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
13731548#endif
13741549
1550//   MDRV_IMPORT_FROM( kb_keytronic )
1551
13751552   /* printer */
13761553   MDRV_DEVICE_ADD("printer", PRINTER)
13771554   MDRV_DEVICE_ADD("printer2", PRINTER)
r3013r3014
14371614
14381615static MACHINE_DRIVER_START( ibm5160 )
14391616   /* basic machine hardware */
1440   MDRV_CPU_PC(pc16, pc16, I8086, 4772720, pc_frame_interrupt)
1617   MDRV_CPU_PC(pc16, pc16, I8086, XTAL_14_31818MHz/3, pc_frame_interrupt)
14411618
14421619   MDRV_MACHINE_START(pc)
14431620   MDRV_MACHINE_RESET(pc)
r3013r3014
14881665   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
14891666#endif
14901667
1668//   MDRV_IMPORT_FROM( kb_keytronic )
1669
14911670   /* printer */
14921671   MDRV_DEVICE_ADD("printer", PRINTER)
14931672   MDRV_DEVICE_ADD("printer2", PRINTER)
r3013r3014
18972076   /* Character rom */
18982077   ROM_REGION(0x2000,"gfx1", 0)
18992078   ROM_LOAD("5788005.u33", 0x00000, 0x2000, CRC(0bf56d70) SHA1(c2a8b10808bf51a3c123ba3eb1e9dd608231916f))
2079
2080   /* 8051 keytronic keyboard controller */
2081   ROM_REGION( 0x2000, KEYTRONIC_KB3270PC_CPU, 0 )
2082   ROM_LOAD("14166.bin", 0x0000, 0x2000, CRC(1aea1b53) SHA1(b75b6d4509036406052157bc34159f7039cdc72e))
19002083ROM_END
19012084
19022085ROM_START( ibmpca )
r3013r3014
22612444   }
22622445}
22632446
2264static SYSTEM_CONFIG_START(ibmpc)
2447static SYSTEM_CONFIG_START(ibm5150)
22652448   CONFIG_RAM_DEFAULT( 640 * 1024 )
22662449   CONFIG_DEVICE(ibmpc_cassette_getinfo)
22672450   CONFIG_DEVICE(ibmpc_floppy_getinfo)
r3013r3014
22902473***************************************************************************/
22912474
22922475/*     YEAR     NAME        PARENT  COMPAT  MACHINE     INPUT       INIT        CONFIG   COMPANY     FULLNAME */
2293COMP(  1981,   ibm5150,   0,         0,      pccga,      pccga,       pccga,       ibmpc,   "International Business Machines",  "IBM PC 5150" , 0)
2294COMP(  1984,   dgone,      ibm5150,   0,      pccga,      pccga,       pccga,       ibmpc,   "Data General",  "Data General/One" , GAME_NOT_WORKING)   /* CGA, 2x 3.5" disk drives */
2295COMP(  1987,   pc,         ibm5150,   0,      pccga,      pccga,      pccga,       ibmpc,   "",  "PC (CGA)" , 0)
2296COMP(  1985,   bondwell,   ibm5150,   0,      pccga,      bondwell,   bondwell,   ibmpc,   "Bondwell Holding",  "BW230 (PRO28 Series)", GAME_NOT_WORKING )
2297COMP(  1988,   europc,      ibm5150,   0,      europc,     europc,      europc,     ibmpc,   "Schneider Rdf. AG",  "EURO PC", GAME_NOT_WORKING)
2476COMP(  1981,   ibm5150,   0,         0,      ibm5150,    ibm5150,    ibm5150,    ibm5150, "International Business Machines",  "IBM PC 5150" , 0)
2477COMP(  1984,   dgone,      ibm5150,   0,      pccga,      pccga,       pccga,       ibm5160, "Data General",  "Data General/One" , GAME_NOT_WORKING)   /* CGA, 2x 3.5" disk drives */
2478COMP(  1987,   pc,         ibm5150,   0,      pccga,      pccga,      pccga,       ibm5160, "",  "PC (CGA)" , 0)
2479COMP(  1985,   bondwell,   ibm5150,   0,      pccga,      bondwell,   bondwell,   ibm5160, "Bondwell Holding",  "BW230 (PRO28 Series)", GAME_NOT_WORKING )
2480COMP(  1988,   europc,      ibm5150,   0,      europc,     europc,      europc,     ibm5160, "Schneider Rdf. AG",  "EURO PC", GAME_NOT_WORKING)
22982481
22992482// pcjr (better graphics, better sound)
23002483COMP(  1983,   ibmpcjr,   ibm5150,   0,      ibmpcjr,    tandy1t,   pcjr,       pcjr,    "International Business Machines",  "IBM PC Jr", GAME_NOT_WORKING|GAME_IMPERFECT_COLORS )
2301COMP(  1987,   t1000hx,   ibm5150,   0,      t1000hx,    tandy1t,   t1000hx,   ibmpc,   "Tandy Radio Shack",  "Tandy 1000HX", 0)
2302COMP(  1987,   t1000sx,   ibm5150,   0,      t1000hx,    tandy1t,   t1000hx,   ibmpc,   "Tandy Radio Shack",  "Tandy 1000SX", 0)
2484COMP(  1987,   t1000hx,   ibm5150,   0,      t1000hx,    tandy1t,   t1000hx,   ibm5160, "Tandy Radio Shack",  "Tandy 1000HX", 0)
2485COMP(  1987,   t1000sx,   ibm5150,   0,      t1000hx,    tandy1t,   t1000hx,   ibm5160, "Tandy Radio Shack",  "Tandy 1000SX", 0)
23032486
23042487// xt class (pc but 8086)
2305COMP(  1982,   ibm5160,   ibm5150,   0,      ibm5160,    xtcga,      pccga,      ibm5160,   "International Business Machines",  "IBM XT 5160" , 0)
2306COMP(  1988,   pc200,      ibm5150,   0,      pc200,      pc200,      pc200,      ibmpc,   "Sinclair Research",  "PC200 Professional Series", GAME_NOT_WORKING)
2307COMP(  1988,   pc20,      ibm5150,   0,      pc200,      pc200,      pc200,      ibmpc,   "Amstrad plc",  "Amstrad PC20" , GAME_NOT_WORKING)
2308COMP(  1987,   ppc512,      ibm5150,   0,      pc200,      pc200,      pc200,      ibmpc,   "Amstrad plc",  "Amstrad PPC512", 0)
2309COMP(  1987,   ppc640,      ibm5150,   0,      pc200,      pc200,      pc200,      ibmpc,   "Amstrad plc",  "Amstrad PPC640", 0)
2310COMP(  1986,   pc1512,      ibm5150,   0,      pc1512,     pc1512,      pc1512,      ibmpc,   "Amstrad plc",  "Amstrad PC1512 (version 1)", GAME_NOT_WORKING)
2311COMP(  198?,   pc1512v2,   ibm5150,   0,      pc1512,     pc1512,      pc1512,      ibmpc,   "Amstrad plc",  "Amstrad PC1512 (version 2)", GAME_NOT_WORKING)
2312COMP(  1987,   pc1640,      ibm5150,   0,      pc1640,     pc1640,      pc1640,      ibmpc,   "Amstrad plc",  "Amstrad PC1640 / PC6400 (US)", GAME_NOT_WORKING )
2488COMP(  1982,   ibm5160,   ibm5150,   0,      ibm5160,    xtcga,      pccga,      ibm5160, "International Business Machines",  "IBM XT 5160" , 0)
2489COMP(  1988,   pc200,      ibm5150,   0,      pc200,      pc200,      pc200,      ibm5160, "Sinclair Research",  "PC200 Professional Series", GAME_NOT_WORKING)
2490COMP(  1988,   pc20,      ibm5150,   0,      pc200,      pc200,      pc200,      ibm5160, "Amstrad plc",  "Amstrad PC20" , GAME_NOT_WORKING)
2491COMP(  1987,   ppc512,      ibm5150,   0,      pc200,      pc200,      pc200,      ibm5160, "Amstrad plc",  "Amstrad PPC512", 0)
2492COMP(  1987,   ppc640,      ibm5150,   0,      pc200,      pc200,      pc200,      ibm5160, "Amstrad plc",  "Amstrad PPC640", 0)
2493COMP(  1986,   pc1512,      ibm5150,   0,      pc1512,     pc1512,      pc1512,      ibm5160, "Amstrad plc",  "Amstrad PC1512 (version 1)", GAME_NOT_WORKING)
2494COMP(  198?,   pc1512v2,   ibm5150,   0,      pc1512,     pc1512,      pc1512,      ibm5160, "Amstrad plc",  "Amstrad PC1512 (version 2)", GAME_NOT_WORKING)
2495COMP(  1987,   pc1640,      ibm5150,   0,      pc1640,     pc1640,      pc1640,      ibm5160, "Amstrad plc",  "Amstrad PC1640 / PC6400 (US)", GAME_NOT_WORKING )
23132496// pc2086 pc1512 with vga??
2314COMP ( 1987,   pcmda,      ibm5150,   0,      pcmda,      pcmda,      pcmda,       ibmpc,   "",  "PC (MDA)" , 0)
2315COMP ( 1987,    pcherc,     ibm5150,   0,      pcherc,     pcmda,      pcmda,      ibmpc,   "MESS",  "PC (Hercules)" , 0)
2316COMP ( 1987,   xtvga,      ibm5150,   0,      xtvga,      xtvga,      pc_vga,     ibmpc,   "",  "PC/XT (VGA, MF2 Keyboard)" , GAME_NOT_WORKING)
2497COMP ( 1987,   pcmda,      ibm5150,   0,      pcmda,      pcmda,      pcmda,       ibm5160, "",  "PC (MDA)" , 0)
2498COMP ( 1987,    pcherc,     ibm5150,   0,      pcherc,     pcmda,      pcmda,      ibm5160, "MESS",  "PC (Hercules)" , 0)
2499COMP ( 1987,   xtvga,      ibm5150,   0,      xtvga,      xtvga,      pc_vga,     ibm5160, "",  "PC/XT (VGA, MF2 Keyboard)" , GAME_NOT_WORKING)
23172500
docs/messnew.txt
r3013r3014
1111- [DRAGON] Fixed crash that could occur when accessing the printer.  (bug
1212  #1643)  [Nate Woods]
1313
14- [IBM5150] Implemented low-level keyboard interface to allow real
15  emulation of pc keyboards. Hooked up emulation of a Keytronic
16  KB3270/PC keyboard to this driver.
17  [Wilbert Pol]
18
1419- [IBM5170] Added support for the 8042 keyboard controller dumped
1520  by Kevtris.  [Wilbert Pol]
1621

Previous 15994 Revisions Next


© 1998-2018 The MESS Team