interpro: lle keyboard working (#3608)

* interpro: lle keyboard working

* lle keyboard working, mapping incomplete
* slow down cpu, fixes keyboard boot and graphic glitching
* remove unnecessary reset suspend/timer
* 6700/6800 eprom confirmed to match 2700/2800
* fix line clipping crash and remove noisy logging

* interpro: don't use UCHAR_MAMEKEY (nw)
This commit is contained in:
Patrick Mackinlay 2018-05-26 00:40:59 +07:00 committed by R. Belmont
parent 106e274784
commit 12f3b9f8a7
8 changed files with 454 additions and 182 deletions

View File

@ -4,6 +4,66 @@
/* /*
* A low level emulation implementation of the Intergraph InterPro keyboard. * A low level emulation implementation of the Intergraph InterPro keyboard.
* *
* These keyboards have two primary banks of keys. The lower bank consists of
* a total of 67 regular keyboard keyswitches plus a numeric keypad with a
* further 18 keys. The upper bank consists of 57 membrane-style programmable
* function keys in groups of 9, 36 and 12 from left to right.
*
* The following describes the key labels and positions according to the
* standard US English keyboard layout. At least a German keyboard variant is
* known to have existed.
*
* Upper bank keys indicated here with asterisks are printed in white, as are
* all the A*, B* and C* keys; all the others are printed in brown.
*
* Setup* Home* 2nd A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15 2nd
* Help Clear F* F*
* Screen
*
* Find Insert Print B1 B2 B3 B4 B5 B6 B7 B8 B9 B10 B11 B12 B13 B14 B15 B16
* Here Screen*
* Remove
*
* Select Prev Next C1 C2 C3 C4 C5 C6 C7 C8 C9 C10 C11 C12 C13 C14 C15 C16
* Screen Screen
*
*
* In between the banks on the right hand side, there is a row of LEDs, the
* first three are pictures, rather than the descriptions given here).
*
* Disk Lock ----- L1 L2 L3 L4
*
* Lower bank keys have up to 3 labels, in shifted and unshifted positions, and
* in red on the front face of the key-cap.
*
* Esc ~ ! @ # $ % ^ & * ( ) _ + Back Delete PF1 PF2 PF3 PF4
* ` 1 2 3 4 5 6 7 8 9 0 - = Space ± ÷ × +
* Esc Num Lk ScrlLk Sys
*
* Alt Tab Q W E R T Y U I O P { } 7 8 9 _
* Mode [ ]
* Home Pg Up Prt Sc
*
* Ctrl Caps A S D F G H J K L : " | Return 4 5 6 ,
* Lock
*
*
* Shift > Z X C V B N M , . ? Shift 1 2 3 =
* <
* End Pg Dn
*
* Hold Super- Line Repeat 0
* Screen impose Feed . Enter
* Ins Del +
*
* Alt Mode and Caps Lock keys have locking switches, capturing the key in the
* depressed position, as well as physical leds visible on the keycaps
* themselves. The keyboard also has two physical buttons on its rear face, a
* circular button labelled Boot, and a square one labelled Reset.
*
* The keyboard uses a 1200bps serial protocol to communicate with the host,
* with 1 start bit, 8 data bits, 1 stop bit, and even parity.
*
* Ref Part Function * Ref Part Function
* 1 SN74LS244N octal buffer and line driver with tri-state outputs * 1 SN74LS244N octal buffer and line driver with tri-state outputs
* 2 M2732A-2F1 NMOS 32K (4Kx8) UV EPROM * 2 M2732A-2F1 NMOS 32K (4Kx8) UV EPROM
@ -17,16 +77,28 @@
* 10 DS75452N dual peripheral NAND driver * 10 DS75452N dual peripheral NAND driver
* 52 11.000MHz crystal * 52 11.000MHz crystal
* *
* 67 membrane matrix connector? * 67 upper matrix connector?
* 68 reset and boot button connector * 68 reset and boot button connector
* 69 computer interface cable connector * 69 computer interface cable connector
* 70, 71, 72 keyswitch matrix connectors? * 70, 71, 72 lower matrix connectors?
* 5?-64 status LEDs * 5?-64 status LEDs
* *
* The keyboard software relies on a timer interrupt to handle all serial I/O
* and the speaker, while running the main loop which processes commands, and
* scans the upper and lower banks for key status. The lower bank is scanned
* via some unknown external means, possibly the custom Motorola device? This
* method involves clearing and incrementing a counter corresponding to each
* key position, and then reading the selected key state on the T1 input. The
* upper bank is handled via more conventional matrix scan where 6 bits of data
* are read from the bus for each of 15 matrix rows in turn.
*
* The raw count or matrix information is then looked up in various tables (one
* in the on-board rom, and others in the external EPROM), to translate into the
* relevant make/break codes that are then output via the serial interface.
*
* TODO * TODO
* - not functional, WIP * - upper matrix is not mapped
* - requires ~500us after start before ready to accept commands * - arrow keys, keypad and some other keys are not mapped
* - keyboard matrix is not yet mapped
*/ */
/* /*
@ -36,33 +108,38 @@
* - prescaler loaded with 0xfa, gives ~262us/tick (~3.819kHz) * - prescaler loaded with 0xfa, gives ~262us/tick (~3.819kHz)
* *
* P1 * P1
* 0x01 * 0x0f - out: upper row select
* 0x02 * 0x10 - out: speaker
* 0x04 * 0x20 - out: enable upper row select
* 0x08 * 0x40 - out: update led state
* 0x10 - speaker out * 0x80 - out: speaker enable?
* 0x20
* 0x40 - bus data valid?
* 0x80
* *
* P2 * P2
* 0x0f - bank select * 0x0f - out: bank select
* 0x20 - serial tx, inverted * 0x10 - ?
* 0x20 - out: serial tx, inverted
* 0x40 - out: increment lower count
* 0x80 - out: reset lower count
* *
* T0 * T0
* serial rx, inverted * in: serial rx, inverted
* *
* T1 * T1
* in: lower key state
* *
* At runtime, R7 contains status flags: * BUS
* 0x01 * in: upper scan state
* 0x02 * out: led state
* 0x04 *
* 0x08 - tx buffer empty? * LEDs
* 0x10 - rx double ESC? * 0x01 - L1?
* 0x20 - timer 0x3a expired * 0x02 - L2?
* 0x40 - rx complete * 0x04 - L3?
* 0x80 - rx timer active * 0x08 - L4?
* 0x10 - bar?
* 0x20 - lock?
* 0x40 - caps
* 0x80 - alt mode
*/ */
#include "emu.h" #include "emu.h"
@ -84,85 +161,249 @@ namespace bus { namespace interpro { namespace keyboard {
namespace { namespace {
// TODO: actual matrix is not yet mapped
INPUT_PORTS_START(interpro_en_us) INPUT_PORTS_START(interpro_en_us)
PORT_START("row_0") PORT_START("upper.0")
PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_ESC) PORT_NAME("Esc") PORT_CHAR(UCHAR_MAMEKEY(ESC)) // nothing
PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('`') PORT_CHAR('~') // fc 4c
PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') // fc 6c
PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@') // nothing
PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') // nothing
PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') // nothing
PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%')
PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^')
PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&')
PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*')
PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(')
PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')')
PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_')
PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+')
PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("Backspace") PORT_CHAR(UCHAR_MAMEKEY(BACKSPACE))
PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_DEL) PORT_NAME("Delete") PORT_CHAR(UCHAR_MAMEKEY(DEL))
PORT_START("row_1") PORT_START("upper.1")
PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_UNUSED) // "Alt Mode" // fc 28
PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_TAB) PORT_NAME("Tab") PORT_CHAR(9) // fc 46
PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') // fc 66
PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') // fc 64
PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') // fc 44
PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') // fc 26
PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T')
PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y')
PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U')
PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I')
PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O')
PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P')
PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{')
PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}')
PORT_START("row_2") PORT_START("upper.2")
PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_LCONTROL) PORT_NAME("Control") PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) // fc 2a
PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_CAPSLOCK) PORT_NAME("Caps Lock") PORT_TOGGLE PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) // fc 48
PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') // fc 68
PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') // fc 62
PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') // fc 42
PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') // fc 24
PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G')
PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H')
PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J')
PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K')
PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L')
PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':')
PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('"')
PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|')
PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_NAME("Return") PORT_CHAR(UCHAR_MAMEKEY(ENTER))
PORT_START("row_3") PORT_START("upper.3")
PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_LSHIFT) PORT_NAME("LShift") PORT_CHAR(UCHAR_MAMEKEY(LSHIFT)) // fc 2c
PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH2) PORT_CHAR('<') PORT_CHAR('>') // fc 4a
PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') // fc 6a
PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') // fc 60
PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') // fc 40
PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') // fc 22
PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B')
PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N')
PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M')
PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',')
PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.')
PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?')
PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_RSHIFT) PORT_NAME("RShift") PORT_CHAR(UCHAR_MAMEKEY(RSHIFT))
PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_UP) PORT_NAME("Up") PORT_CHAR(UCHAR_MAMEKEY(UP))
PORT_START("row_4") PORT_START("upper.4")
PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_UNUSED) // "Hold Screen" // fc 1c
PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_UNUSED) // "Superimpose" // fc 3a
PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_UNUSED) // "Line Feed" // fc 5a
PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_NAME("Space") PORT_CHAR(UCHAR_MAMEKEY(SPACE)) // fc 58
PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_UNUSED) // "Repeat" // fc 38
PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_LEFT) PORT_NAME("Left") PORT_CHAR(UCHAR_MAMEKEY(LEFT)) // fc 1a
PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_DOWN) PORT_NAME("Down") PORT_CHAR(UCHAR_MAMEKEY(DOWN))
PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_RIGHT) PORT_NAME("Right") PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) PORT_START("upper.5")
// fc 1e
// fc 3c
// fc 5c
// fc 56
// fc 36
// fc 18
PORT_START("upper.6")
// fc 20
// fc 3e
// fc 5e
// fc 54
// fc 34
// fc 16
PORT_START("upper.7")
// fc 14
// fc 32
// fc 52
// fc 01
// fc 04
// fc 07
PORT_START("upper.8")
// fc 12
// fc 30
// fc 50
// fc 02
// fc 05
// fc 08
PORT_START("upper.9")
// fc 10
// fc 2e
// fc 4e
// fc 03
// fc 06
// nothing?
PORT_START("upper.a")
// fc 6e
// fc 76
// fc 7e
// nothing
// nothing
// nothing
PORT_START("upper.b")
// fc 70
// fc 78
// fc 80
// nothing
// nothing
// nothing
PORT_START("upper.c")
// fc 72
// fc 7a
// fc 82
// nothing
// nothing
// nothing
PORT_START("upper.d")
// fc 74
// fc 7c
// nothing
// nothing
// nothing
// 1c fc
PORT_START("upper.e")
// nothing
// nothing
// nothing
// nothing
// nothing
// nothing
PORT_START("lower.0")
// 0x00-0x07: 0x82 3 4 5 6 7 0 -
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) // 0x82
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_0) PORT_CHAR('0') PORT_CHAR(')')
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_')
PORT_START("lower.1")
// 0x08-0x0f: del 0xf5 0xab 2 w e t u
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_DEL) PORT_NAME("Delete") PORT_CHAR(127)
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) // 0xf5
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) // 0xab
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@')
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_E) PORT_CHAR('e') PORT_CHAR('E')
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T')
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U')
PORT_START("lower.2")
// 0x10-0x17: 8 9 = bs 0xaf 0xaa 1 q
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*')
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(')
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+')
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("Backspace") PORT_CHAR(8)
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) // 0xaf
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) // 0xaa
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q')
PORT_START("lower.3")
// 0x18-0x1f: a r y i p ] none 0xb7
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A')
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R')
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y')
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I')
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P')
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}')
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) // none - 0x1e never scanned?
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) // 0xb7
PORT_START("lower.4")
// 0x20-0x27: 0xad ` tab s f j o '
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) // 0xad
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('`') PORT_CHAR('~')
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_TAB) PORT_NAME("Tab") PORT_CHAR(9)
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S')
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F')
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J')
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O')
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('"')
PORT_START("lower.5")
// 0x28-0x2f: [ cr 0xb8 0xb9 none shift d g
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{')
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_NAME("Return") PORT_CHAR(13)
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) // 0xb8
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) // 0xb9
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Alt Mode") PORT_TOGGLE
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_CAPSLOCK) PORT_NAME("Caps Lock") PORT_TOGGLE PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK))
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D')
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G')
PORT_START("lower.6")
// 0x30-0x37: h k ; \ 0x85 0xb4 0xac esc
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H')
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K')
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) 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) // 0x85
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) // 0xb4
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) // 0xac - superimpose?
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_ESC) PORT_NAME("Esc") PORT_CHAR(27)
PORT_START("lower.7")
// 0x38-0x3f: shift < x b l / shift 0xb1
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_LSHIFT) PORT_NAME("LShift") PORT_CHAR(UCHAR_SHIFT_1)
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH2) PORT_CHAR('<') PORT_CHAR('>')
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X')
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B')
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L')
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_RSHIFT) PORT_NAME("RShift") PORT_CHAR(UCHAR_MAMEKEY(RSHIFT))
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) // 0xb1
PORT_START("lower.8")
// 0x40-0x47: 0xb5 0xb6 control 0x81 z c n .
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) // 0xb5
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) // 0xb6
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL)
PORT_NAME("Control") PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) PORT_CHAR(UCHAR_MAMEKEY(RCONTROL))
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) // 0x81
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z')
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C')
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N')
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.')
PORT_START("lower.9")
// 0x48-0x4f: none 0x83 0x84 0xb2 0xb3 0x00 0x82 lf
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Repeat")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) // 0x83
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) // 0x84
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) // 0xb2
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) // 0xb3
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) // 0x00
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) // 0x82
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Line Feed") PORT_CHAR(10)
PORT_START("lower.a")
// 0x50-0x57: v m , space 0x80 0xb0 0xae 0x8d
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V')
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M')
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',')
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_NAME("Space") PORT_CHAR(' ')
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) // 0x80
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) // 0xb0
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) // 0xae
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) // 0x8d
INPUT_PORTS_END INPUT_PORTS_END
@ -183,11 +424,12 @@ ROM_END
lle_device_base::lle_device_base(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock) lle_device_base::lle_device_base(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock)
: device_t(mconfig, type, tag, owner, clock) : device_t(mconfig, type, tag, owner, clock)
, device_interpro_keyboard_port_interface(mconfig, *this) , device_interpro_keyboard_port_interface(mconfig, *this)
, device_matrix_keyboard_interface(mconfig, *this, "row_0", "row_1", "row_2", "row_3", "row_4")
, m_mcu(*this, "mcu") , m_mcu(*this, "mcu")
, m_bell(*this, "bell")
, m_ext(*this, "ext") , m_ext(*this, "ext")
, m_txd(0) , m_upper(*this, "upper.%x", 0)
, m_lower(*this, "lower.%x", 0)
, m_speaker(*this, "speaker")
, m_leds(*this, "led_%u", 0U)
{ {
} }
MACHINE_CONFIG_START(lle_device_base::device_add_mconfig) MACHINE_CONFIG_START(lle_device_base::device_add_mconfig)
@ -195,9 +437,7 @@ MACHINE_CONFIG_START(lle_device_base::device_add_mconfig)
MCFG_DEVICE_ADDRESS_MAP(AS_IO, io_map) MCFG_DEVICE_ADDRESS_MAP(AS_IO, io_map)
MCFG_MCS48_PORT_T0_IN_CB(READLINE(*this, lle_device_base, t0_r)) MCFG_MCS48_PORT_T0_IN_CB(READLINE(*this, lle_device_base, t0_r))
MCFG_MCS48_PORT_T1_IN_CB(READLINE(*this, lle_device_base, t1_r)) MCFG_MCS48_PORT_T1_IN_CB(READLINE(*this, lle_device_base, t1_r))
MCFG_MCS48_PORT_P1_IN_CB(READ8(*this, lle_device_base, p1_r))
MCFG_MCS48_PORT_P1_OUT_CB(WRITE8(*this, lle_device_base, p1_w)) MCFG_MCS48_PORT_P1_OUT_CB(WRITE8(*this, lle_device_base, p1_w))
MCFG_MCS48_PORT_P2_IN_CB(READ8(*this, lle_device_base, p2_r))
MCFG_MCS48_PORT_P2_OUT_CB(WRITE8(*this, lle_device_base, p2_w)) MCFG_MCS48_PORT_P2_OUT_CB(WRITE8(*this, lle_device_base, p2_w))
MCFG_MCS48_PORT_BUS_IN_CB(READ8(*this, lle_device_base, bus_r)) MCFG_MCS48_PORT_BUS_IN_CB(READ8(*this, lle_device_base, bus_r))
MCFG_MCS48_PORT_BUS_OUT_CB(WRITE8(*this, lle_device_base, bus_w)) MCFG_MCS48_PORT_BUS_OUT_CB(WRITE8(*this, lle_device_base, bus_w))
@ -209,16 +449,26 @@ MACHINE_CONFIG_START(lle_device_base::device_add_mconfig)
MCFG_ADDRESS_MAP_BANK_STRIDE(0x100) MCFG_ADDRESS_MAP_BANK_STRIDE(0x100)
SPEAKER(config, "keyboard").front_center(); SPEAKER(config, "keyboard").front_center();
MCFG_DEVICE_ADD("bell", SPEAKER_SOUND, 0) MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "keyboard", 0.25) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "keyboard", 0.25)
MACHINE_CONFIG_END MACHINE_CONFIG_END
void lle_device_base::device_start() void lle_device_base::device_start()
{ {
m_leds.resolve();
save_item(NAME(m_txd));
save_item(NAME(m_p1));
save_item(NAME(m_p2));
save_item(NAME(m_bus));
save_item(NAME(m_row));
save_item(NAME(m_count));
} }
void lle_device_base::device_reset() void lle_device_base::device_reset()
{ {
m_txd = 0;
} }
void lle_device_base::io_map(address_map &map) void lle_device_base::io_map(address_map &map)
@ -230,7 +480,14 @@ void lle_device_base::ext_map(address_map &map)
{ {
map(0, 0xfff).rom().region("eprom", 0); map(0, 0xfff).rom().region("eprom", 0);
map(0x7fe, 0x7fe).w(this, FUNC(lle_device_base::latch_w)); // not clear what these addresses correspond to, possibly
// used in manufacturer testing?
if (VERBOSE & LOG_GENERAL)
map(0x7fe, 0x7ff).lw8("write",
[this](address_space &space, offs_t offset, u8 data, u8 mem_mask)
{
LOG("write offset 0x%03f data 0x%02x (%s)\n", offset, data, machine().describe_context());
});
} }
READ_LINE_MEMBER(lle_device_base::t0_r) READ_LINE_MEMBER(lle_device_base::t0_r)
@ -250,30 +507,34 @@ READ_LINE_MEMBER(lle_device_base::t0_r)
READ_LINE_MEMBER(lle_device_base::t1_r) READ_LINE_MEMBER(lle_device_base::t1_r)
{ {
// TODO: possibly one of the modifiers? return BIT(m_lower[m_count >> 3]->read(), m_count & 0x7) ? ASSERT_LINE : CLEAR_LINE;
return CLEAR_LINE;
}
READ8_MEMBER(lle_device_base::p1_r)
{
LOGMASKED(LOG_PORT, "p1_r (%s)\n", machine().describe_context());
return 0xff;
} }
WRITE8_MEMBER(lle_device_base::p1_w) WRITE8_MEMBER(lle_device_base::p1_w)
{ {
LOGMASKED(LOG_PORT, "p1_w 0x%02x (%s)\n", data, machine().describe_context()); LOGMASKED(LOG_PORT, "p1_w 0x%02x (%s)\n", data, machine().describe_context());
m_bell->level_w(BIT(data, 4)); // speaker enable?
} if (!BIT(m_p1, 7) && BIT(data, 7))
LOGMASKED(LOG_PORT, "p1.7 set (%s)\n", machine().describe_context());
READ8_MEMBER(lle_device_base::p2_r) // update led state
{ if (!BIT(m_p1, 6) && BIT(data, 6))
LOGMASKED(LOG_PORT, "p2_r (%s)\n", machine().describe_context()); for (int i = 0; i < 8; i++)
m_leds[i] = !BIT(m_bus, i);
return 0xff; // select upper row
if (BIT(m_p1, 5) && !BIT(data, 5))
{
LOGMASKED(LOG_PORT, "select upper row 0x%01x\n", data & 0xf);
m_row = data & 0xf;
}
// speaker output
m_speaker->level_w(BIT(data, 4));
m_p1 = data;
} }
WRITE8_MEMBER(lle_device_base::p2_w) WRITE8_MEMBER(lle_device_base::p2_w)
@ -292,31 +553,51 @@ WRITE8_MEMBER(lle_device_base::p2_w)
LOGMASKED(LOG_RXTX, "transmitting byte 0x%02x\n", output); LOGMASKED(LOG_RXTX, "transmitting byte 0x%02x\n", output);
} }
m_ext->set_bank(data & 0x0f); // clear counter
// FIXME: 0xfe is a strange init value, but makes the double-increment
// that follows line up precisely with the make/break codes
if (BIT(m_p2, 7) && !BIT(data, 7))
m_count = 0xfe;
// increment counter
if (BIT(m_p2, 6) && !BIT(data, 6))
m_count++;
// serial transmit // serial transmit
output_rxd((data & 0x20) ? CLEAR_LINE : ASSERT_LINE); output_rxd(BIT(data, 5) ? CLEAR_LINE : ASSERT_LINE);
// BIT(data, 4)?
if (!BIT(m_p2, 4) && BIT(data, 4))
LOG("p2.4 set (%s)\n", machine().describe_context());
// bank select
m_ext->set_bank(data & 0x0f);
m_p2 = data;
} }
READ8_MEMBER(lle_device_base::bus_r) READ8_MEMBER(lle_device_base::bus_r)
{ {
LOGMASKED(LOG_PORT, "bus_r (%s)\n", machine().describe_context()); if (!BIT(m_p1, 5))
{
LOGMASKED(LOG_PORT, "read upper row 0x%01x\n", m_row);
return m_upper[m_row]->read();
}
else
LOGMASKED(LOG_PORT, "bus_r (%s)\n", machine().describe_context());
return 0xff; return 0xff;
} }
WRITE8_MEMBER(lle_device_base::bus_w) WRITE8_MEMBER(lle_device_base::bus_w)
{ {
LOGMASKED(LOG_PORT, "bus_w 0x%02x (%s)\n", data, machine().describe_context()); if (data != 0xff)
LOGMASKED(LOG_PORT, "bus_w 0x%02x (%s)\n", data, machine().describe_context());
m_bus = data; m_bus = data;
} }
WRITE8_MEMBER(lle_device_base::latch_w)
{
LOGMASKED(LOG_PORT, "latch_w 0x%02x (%s)\n", data, machine().describe_context());
}
lle_en_us_device::lle_en_us_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) lle_en_us_device::lle_en_us_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock)
: lle_device_base(mconfig, INTERPRO_LLE_EN_US_KEYBOARD, tag, owner, clock) : lle_device_base(mconfig, INTERPRO_LLE_EN_US_KEYBOARD, tag, owner, clock)
{ {

View File

@ -17,7 +17,6 @@ namespace bus { namespace interpro { namespace keyboard {
class lle_device_base class lle_device_base
: public device_t : public device_t
, public device_interpro_keyboard_port_interface , public device_interpro_keyboard_port_interface
, protected device_matrix_keyboard_interface<5U>
{ {
protected: protected:
// constructor/destructor // constructor/destructor
@ -28,10 +27,6 @@ protected:
virtual void device_start() override; virtual void device_start() override;
virtual void device_reset() override; virtual void device_reset() override;
// device_matrix_keyboard_interface overrides
virtual void key_make(u8 row, u8 column) override {};
virtual void key_break(u8 row, u8 column) override {};
virtual void io_map(address_map &map); virtual void io_map(address_map &map);
virtual void ext_map(address_map &map); virtual void ext_map(address_map &map);
@ -43,17 +38,23 @@ protected:
DECLARE_WRITE8_MEMBER(p2_w); DECLARE_WRITE8_MEMBER(p2_w);
DECLARE_READ8_MEMBER(bus_r); DECLARE_READ8_MEMBER(bus_r);
DECLARE_WRITE8_MEMBER(bus_w); DECLARE_WRITE8_MEMBER(bus_w);
DECLARE_READ8_MEMBER(p1_r);
DECLARE_READ8_MEMBER(p2_r);
DECLARE_WRITE8_MEMBER(latch_w);
private: private:
required_device<cpu_device> m_mcu; required_device<cpu_device> m_mcu;
required_device<speaker_sound_device> m_bell;
required_device<address_map_bank_device> m_ext; required_device<address_map_bank_device> m_ext;
required_ioport_array<15> m_upper;
required_ioport_array<11> m_lower;
required_device<speaker_sound_device> m_speaker;
output_finder<8> m_leds;
u8 m_txd; u8 m_txd;
u8 m_p1;
u8 m_p2;
u8 m_bus; u8 m_bus;
u8 m_row;
u8 m_count;
}; };
class lle_en_us_device : public lle_device_base class lle_en_us_device : public lle_device_base

View File

@ -57,7 +57,6 @@
#define LOG_LINE (1U << 1) #define LOG_LINE (1U << 1)
#define LOG_BLIT (1U << 2) #define LOG_BLIT (1U << 2)
#define VERBOSE (LOG_GENERAL | LOG_LINE | LOG_BLIT)
//#define VERBOSE (LOG_GENERAL | LOG_LINE) //#define VERBOSE (LOG_GENERAL | LOG_LINE)
#include "logmacro.h" #include "logmacro.h"
@ -155,6 +154,7 @@ void single_gt_device_base::map(address_map &map)
{ {
gt_device_base::map(map); gt_device_base::map(map);
map(0x00000080, 0x0000008f).m("ramdac0", FUNC(bt459_device::map)).umask32(0x000000ff); map(0x00000080, 0x0000008f).m("ramdac0", FUNC(bt459_device::map)).umask32(0x000000ff);
map(0x00000090, 0x0000009f).nopw(); // second (missing) ramdac
map(0x00400000, 0x005fffff).rw(this, FUNC(single_gt_device_base::buffer_r), FUNC(single_gt_device_base::buffer_w)); map(0x00400000, 0x005fffff).rw(this, FUNC(single_gt_device_base::buffer_r), FUNC(single_gt_device_base::buffer_w));
} }
@ -421,7 +421,7 @@ void gt_device_base::device_start()
WRITE32_MEMBER(gt_device_base::control_w) WRITE32_MEMBER(gt_device_base::control_w)
{ {
// LOG("control_w 0x%08x\n", data); // LOG("control_w 0x%08x\n", data);
if (data & GFX_BSGA_RST) if (data & GFX_BSGA_RST)
{ {
// set graphics busy and schedule a reset // set graphics busy and schedule a reset
@ -538,8 +538,8 @@ WRITE32_MEMBER(gt_device_base::bsga_xin1yin1_w)
m_bsga_xin1 = (m_bsga_xin1 & ~(mem_mask >> 0)) | ((data & mem_mask) >> 0); m_bsga_xin1 = (m_bsga_xin1 & ~(mem_mask >> 0)) | ((data & mem_mask) >> 0);
m_bsga_yin1 = (m_bsga_yin1 & ~(mem_mask >> 16)) | ((data & mem_mask) >> 16); m_bsga_yin1 = (m_bsga_yin1 & ~(mem_mask >> 16)) | ((data & mem_mask) >> 16);
logerror("xin = %04x\n", m_bsga_xin1); LOG("xin = %04x\n", m_bsga_xin1);
logerror("yin = %04x\n", m_bsga_yin1); LOG("yin = %04x\n", m_bsga_yin1);
LOG("bsga_xin1yin1_w data 0x%08x mem_mask 0x%08x xin1 0x%04x yin1 0x%04x\n", data, mem_mask, m_bsga_xin1, m_bsga_yin1); LOG("bsga_xin1yin1_w data 0x%08x mem_mask 0x%08x xin1 0x%04x yin1 0x%04x\n", data, mem_mask, m_bsga_xin1, m_bsga_yin1);
@ -908,8 +908,8 @@ TIMER_CALLBACK_MEMBER(gt_device_base::line)
{ {
// draw a clipped line // draw a clipped line
// FIXME: fix clipping to use >= min and < max (don't subtract 1) // FIXME: fix clipping to use >= min and < max
kuzmin_clip(m_bsga_xin1, m_bsga_yin1, m_bsga_xin2, m_bsga_yin2, m_bsga_xmin, m_bsga_ymin, m_bsga_xmax - 1, m_bsga_ymax - 1); kuzmin_clip(m_bsga_xin1, m_bsga_yin1, m_bsga_xin2, m_bsga_yin2, m_bsga_xmin, m_bsga_ymin, m_bsga_xmax, m_bsga_ymax);
// point #2 becomes point #1 // point #2 becomes point #1
m_bsga_xin1 = m_bsga_xin2; m_bsga_xin1 = m_bsga_xin2;
@ -1046,7 +1046,7 @@ u32 single_gt_device_base::screen_update0(screen_device &screen, bitmap_rgb32 &b
{ {
const gt_t &gt = m_gt[0]; const gt_t &gt = m_gt[0];
gt.ramdac->screen_update(screen, bitmap, cliprect, gt.ramdac->screen_update(screen, bitmap, cliprect,
(m_control & GFX_SCREEN0_DISP_BUF1) ? &gt.buffer[GT_BUFFER_SIZE] : &gt.buffer[0]); (m_control & GFX_SCREEN0_DISP_BUF1) ? &gt.buffer[GT_BUFFER_SIZE] : &gt.buffer[0]);
return 0; return 0;
@ -1056,7 +1056,7 @@ u32 dual_gt_device_base::screen_update0(screen_device &screen, bitmap_rgb32 &bit
{ {
const gt_t &gt = m_gt[0]; const gt_t &gt = m_gt[0];
gt.ramdac->screen_update(screen, bitmap, cliprect, gt.ramdac->screen_update(screen, bitmap, cliprect,
(m_control & GFX_SCREEN0_DISP_BUF1) ? &gt.buffer[GT_BUFFER_SIZE] : &gt.buffer[0]); (m_control & GFX_SCREEN0_DISP_BUF1) ? &gt.buffer[GT_BUFFER_SIZE] : &gt.buffer[0]);
return 0; return 0;
@ -1066,7 +1066,7 @@ u32 dual_gt_device_base::screen_update1(screen_device &screen, bitmap_rgb32 &bit
{ {
const gt_t &gt = m_gt[1]; const gt_t &gt = m_gt[1];
gt.ramdac->screen_update(screen, bitmap, cliprect, gt.ramdac->screen_update(screen, bitmap, cliprect,
(m_control & GFX_SCREEN1_DISP_BUF1) ? &gt.buffer[GT_BUFFER_SIZE] : &gt.buffer[0]); (m_control & GFX_SCREEN1_DISP_BUF1) ? &gt.buffer[GT_BUFFER_SIZE] : &gt.buffer[0]);
return 0; return 0;

View File

@ -91,44 +91,44 @@ public:
DECLARE_WRITE16_MEMBER(bsga_tmp_w) { COMBINE_DATA(&m_bsga_tmp); } DECLARE_WRITE16_MEMBER(bsga_tmp_w) { COMBINE_DATA(&m_bsga_tmp); }
DECLARE_READ16_MEMBER(bsga_xmin_r) { return m_bsga_xmin; } DECLARE_READ16_MEMBER(bsga_xmin_r) { return m_bsga_xmin; }
DECLARE_WRITE16_MEMBER(bsga_xmin_w) { COMBINE_DATA(&m_bsga_xmin); logerror("xmin = %04x\n", m_bsga_xmin); } DECLARE_WRITE16_MEMBER(bsga_xmin_w) { COMBINE_DATA(&m_bsga_xmin); }
DECLARE_READ16_MEMBER(bsga_ymin_r) { return m_bsga_ymin; } DECLARE_READ16_MEMBER(bsga_ymin_r) { return m_bsga_ymin; }
DECLARE_WRITE16_MEMBER(bsga_ymin_w) { COMBINE_DATA(&m_bsga_ymin); logerror("ymin = %04x\n", m_bsga_ymin); } DECLARE_WRITE16_MEMBER(bsga_ymin_w) { COMBINE_DATA(&m_bsga_ymin); }
DECLARE_READ16_MEMBER(bsga_acc0_r) { return (m_bsga_width - m_bsga_xin1); } DECLARE_READ16_MEMBER(bsga_acc0_r) { return (m_bsga_width - m_bsga_xin1); }
DECLARE_READ16_MEMBER(bsga_acc1_r) { return -(m_bsga_width - m_bsga_xin1); } DECLARE_READ16_MEMBER(bsga_acc1_r) { return -(m_bsga_width - m_bsga_xin1); }
DECLARE_READ16_MEMBER(bsga_xmax_r) { return m_bsga_xmax; } DECLARE_READ16_MEMBER(bsga_xmax_r) { return m_bsga_xmax; }
DECLARE_WRITE16_MEMBER(bsga_xmax_w) { COMBINE_DATA(&m_bsga_xmax); logerror("xmax = %04x\n", m_bsga_xmax); } DECLARE_WRITE16_MEMBER(bsga_xmax_w) { COMBINE_DATA(&m_bsga_xmax); }
DECLARE_READ16_MEMBER(bsga_ymax_r) { return m_bsga_ymax; } DECLARE_READ16_MEMBER(bsga_ymax_r) { return m_bsga_ymax; }
DECLARE_WRITE16_MEMBER(bsga_ymax_w) { COMBINE_DATA(&m_bsga_ymax); logerror("ymax = %04x\n", m_bsga_ymax); bsga_clip_status(m_bsga_xin1, m_bsga_yin1); } DECLARE_WRITE16_MEMBER(bsga_ymax_w) { COMBINE_DATA(&m_bsga_ymax); bsga_clip_status(m_bsga_xin1, m_bsga_yin1); }
DECLARE_READ16_MEMBER(bsga_src0_r) { return m_bsga_xin1; } DECLARE_READ16_MEMBER(bsga_src0_r) { return m_bsga_xin1; }
DECLARE_READ16_MEMBER(bsga_src1_r) { return m_bsga_xin1; } DECLARE_READ16_MEMBER(bsga_src1_r) { return m_bsga_xin1; }
DECLARE_WRITE16_MEMBER(bsga_xin1_w) { COMBINE_DATA(&m_bsga_xin1); m_bsga_xin = m_bsga_xin1; m_bsga_tmp = m_bsga_xin1; logerror("xin = %04x\n", m_bsga_xin1); } DECLARE_WRITE16_MEMBER(bsga_xin1_w) { COMBINE_DATA(&m_bsga_xin1); m_bsga_xin = m_bsga_xin1; m_bsga_tmp = m_bsga_xin1; }
DECLARE_WRITE16_MEMBER(bsga_yin1_w) { COMBINE_DATA(&m_bsga_yin1); m_bsga_yin = m_bsga_yin1; logerror("yin = %04x\n", m_bsga_yin1); } DECLARE_WRITE16_MEMBER(bsga_yin1_w) { COMBINE_DATA(&m_bsga_yin1); m_bsga_yin = m_bsga_yin1; }
DECLARE_WRITE32_MEMBER(bsga_xin1yin1_w); DECLARE_WRITE32_MEMBER(bsga_xin1yin1_w);
enum bsga_status_mask enum bsga_status_mask
{ {
STATUS_CLIP0_YMAX = 0x1000, // y1 > max y STATUS_CLIP0_YMAX = 0x1000, // y1 > max y
STATUS_CLIP0_YMIN = 0x0800, // y1 < min y STATUS_CLIP0_YMIN = 0x0800, // y1 < min y
STATUS_CLIP0_XMAX = 0x0400, // x1 > max x STATUS_CLIP0_XMAX = 0x0400, // x1 > max x
STATUS_CLIP0_XMIN = 0x0200, // x1 < min x STATUS_CLIP0_XMIN = 0x0200, // x1 < min x
STATUS_CLIP1_YMAX = 0x0100, // y2 > max y STATUS_CLIP1_YMAX = 0x0100, // y2 > max y
STATUS_CLIP1_YMIN = 0x0080, // y2 < min y STATUS_CLIP1_YMIN = 0x0080, // y2 < min y
STATUS_CLIP1_XMAX = 0x0040, // x2 > max x STATUS_CLIP1_XMAX = 0x0040, // x2 > max x
STATUS_CLIP1_XMIN = 0x0020, // x2 < min x STATUS_CLIP1_XMIN = 0x0020, // x2 < min x
STATUS_FLOAT_OFLOW = 0x0010, STATUS_FLOAT_OFLOW = 0x0010,
STATUS_CLIP_BOTH = 0x0008, // set if both inputs fall outside clipping region STATUS_CLIP_BOTH = 0x0008, // set if both inputs fall outside clipping region
STATUS_CLIP_ANY = 0x0004, // set if any input falls outside clipping region STATUS_CLIP_ANY = 0x0004, // set if any input falls outside clipping region
STATUS_CLIP0_MASK = 0x1e00, // x1,y1 clip result STATUS_CLIP0_MASK = 0x1e00, // x1,y1 clip result
STATUS_CLIP1_MASK = 0x01e0, // x2,y2 clip result STATUS_CLIP1_MASK = 0x01e0, // x2,y2 clip result
STATUS_CLIP_MASK = 0x1fe0 // both clip results STATUS_CLIP_MASK = 0x1fe0 // both clip results
}; };
DECLARE_READ16_MEMBER(bsga_status_r); DECLARE_READ16_MEMBER(bsga_status_r);

View File

@ -296,7 +296,7 @@ void clipper_device::execute_run()
// FIXME: some instructions take longer (significantly) than one cycle // FIXME: some instructions take longer (significantly) than one cycle
// and also the timings are often slower for the C100 and C300 // and also the timings are often slower for the C100 and C300
m_icount--; m_icount -= 4;
} }
} }

View File

@ -26,7 +26,7 @@
#include "emu.h" #include "emu.h"
#include "dp8510.h" #include "dp8510.h"
#define VERBOSE 1 #define VERBOSE 0
#include "logmacro.h" #include "logmacro.h"
DEFINE_DEVICE_TYPE(DP8510, dp8510_device, "dp8510", "National Semiconductor BITBLT Processing Unit") DEFINE_DEVICE_TYPE(DP8510, dp8510_device, "dp8510", "National Semiconductor BITBLT Processing Unit")

View File

@ -254,8 +254,6 @@ void interpro_state::machine_start()
save_item(NAME(m_sreg_ctrl2)); save_item(NAME(m_sreg_ctrl2));
save_item(NAME(m_sreg_ctrl3)); save_item(NAME(m_sreg_ctrl3));
m_reset_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(interpro_state::reset_timer), this));
} }
void interpro_state::machine_reset() void interpro_state::machine_reset()
@ -264,10 +262,6 @@ void interpro_state::machine_reset()
m_sreg_error = 0; m_sreg_error = 0;
m_sreg_status = 0x400; m_sreg_status = 0x400;
m_sreg_ctrl1 = CTRL1_FLOPLOW; m_sreg_ctrl1 = CTRL1_FLOPLOW;
// suspend the main cpu long enough for the keyboard to boot
m_maincpu->suspend(SUSPEND_REASON_RESET, false);
m_reset_timer->adjust(attotime::from_msec(750));
} }
void interpro_state::init_common() void interpro_state::init_common()
@ -609,7 +603,7 @@ MACHINE_CONFIG_START(interpro_state::interpro_scc2)
MCFG_Z80SCC_OUT_INT_CB(WRITELINE(INTERPRO_IOGA_TAG, interpro_ioga_device, ir11_w)) MCFG_Z80SCC_OUT_INT_CB(WRITELINE(INTERPRO_IOGA_TAG, interpro_ioga_device, ir11_w))
MCFG_Z80SCC_OUT_WREQB_CB(WRITELINE(INTERPRO_IOGA_TAG, interpro_ioga_device, drq_serial0)) MCFG_Z80SCC_OUT_WREQB_CB(WRITELINE(INTERPRO_IOGA_TAG, interpro_ioga_device, drq_serial0))
MCFG_INTERPRO_KEYBOARD_PORT_ADD(INTERPRO_KEYBOARD_PORT_TAG, interpro_keyboard_devices, "hle_en_us") MCFG_INTERPRO_KEYBOARD_PORT_ADD(INTERPRO_KEYBOARD_PORT_TAG, interpro_keyboard_devices, "lle_en_us")
MCFG_INTERPRO_KEYBOARD_RXD_HANDLER(WRITELINE(INTERPRO_SCC2_TAG, z80scc_device, rxa_w)) MCFG_INTERPRO_KEYBOARD_RXD_HANDLER(WRITELINE(INTERPRO_SCC2_TAG, z80scc_device, rxa_w))
MCFG_DEVICE_ADD(INTERPRO_SERIAL_PORT0_TAG, RS232_PORT, default_rs232_devices, nullptr) MCFG_DEVICE_ADD(INTERPRO_SERIAL_PORT0_TAG, RS232_PORT, default_rs232_devices, nullptr)
@ -1182,10 +1176,9 @@ ROM_START(ip6700)
ROM_REGION(0x80, INTERPRO_IDPROM_TAG, 0) ROM_REGION(0x80, INTERPRO_IDPROM_TAG, 0)
ROM_LOAD32_BYTE("msmt127b.bin", 0x0, 0x20, CRC(cc112f65) SHA1(8533a31b4733fd91bb87effcd276fc93f2858629)) ROM_LOAD32_BYTE("msmt127b.bin", 0x0, 0x20, CRC(cc112f65) SHA1(8533a31b4733fd91bb87effcd276fc93f2858629))
// FIXME: use 2800 eprom until we have a 6700 dump
ROM_REGION(0x20000, INTERPRO_EPROM_TAG, 0) ROM_REGION(0x20000, INTERPRO_EPROM_TAG, 0)
ROM_SYSTEM_BIOS(0, "ip6700", "InterPro 6700 EPROM") ROM_SYSTEM_BIOS(0, "ip6700", "InterPro 6700 EPROM")
ROMX_LOAD("mprgz530a.u144", 0x00000, 0x20000, BAD_DUMP CRC(467ce7bd) SHA1(53faee40d5df311f53b24c930e434cbf94a5c4aa), ROM_BIOS(1)) ROMX_LOAD("mprgz530a.u144", 0x00000, 0x20000, CRC(467ce7bd) SHA1(53faee40d5df311f53b24c930e434cbf94a5c4aa), ROM_BIOS(1))
ROM_REGION(0x20000, INTERPRO_FLASH_TAG "_lo", 0) ROM_REGION(0x20000, INTERPRO_FLASH_TAG "_lo", 0)
ROM_LOAD_OPTIONAL("y225.u117", 0x00000, 0x20000, CRC(46c0b105) SHA1(7c4a104e4fb3d0e5e8db7c911cdfb3f5c4fb0218)) ROM_LOAD_OPTIONAL("y225.u117", 0x00000, 0x20000, CRC(46c0b105) SHA1(7c4a104e4fb3d0e5e8db7c911cdfb3f5c4fb0218))
@ -1198,10 +1191,9 @@ ROM_START(ip6800)
ROM_REGION(0x80, INTERPRO_IDPROM_TAG, 0) ROM_REGION(0x80, INTERPRO_IDPROM_TAG, 0)
ROM_LOAD32_BYTE("msmt127b.bin", 0x0, 0x20, CRC(cc112f65) SHA1(8533a31b4733fd91bb87effcd276fc93f2858629)) ROM_LOAD32_BYTE("msmt127b.bin", 0x0, 0x20, CRC(cc112f65) SHA1(8533a31b4733fd91bb87effcd276fc93f2858629))
// FIXME: use 2800 eprom until we have a 6800 dump
ROM_REGION(0x20000, INTERPRO_EPROM_TAG, 0) ROM_REGION(0x20000, INTERPRO_EPROM_TAG, 0)
ROM_SYSTEM_BIOS(0, "ip6800", "InterPro 6800 EPROM") ROM_SYSTEM_BIOS(0, "ip6800", "InterPro 6800 EPROM")
ROMX_LOAD("mprgz530a__9406270.u144", 0x00000, 0x20000, BAD_DUMP CRC(467ce7bd) SHA1(53faee40d5df311f53b24c930e434cbf94a5c4aa), ROM_BIOS(1)) ROMX_LOAD("mprgz530a__9406270.u144", 0x00000, 0x20000, CRC(467ce7bd) SHA1(53faee40d5df311f53b24c930e434cbf94a5c4aa), ROM_BIOS(1))
ROM_REGION(0x20000, INTERPRO_FLASH_TAG "_lo", 0) ROM_REGION(0x20000, INTERPRO_FLASH_TAG "_lo", 0)
ROM_LOAD_OPTIONAL("y225.u117", 0x00000, 0x20000, CRC(46c0b105) SHA1(7c4a104e4fb3d0e5e8db7c911cdfb3f5c4fb0218)) ROM_LOAD_OPTIONAL("y225.u117", 0x00000, 0x20000, CRC(46c0b105) SHA1(7c4a104e4fb3d0e5e8db7c911cdfb3f5c4fb0218))

View File

@ -171,8 +171,6 @@ protected:
virtual void machine_start() override; virtual void machine_start() override;
virtual void machine_reset() override; virtual void machine_reset() override;
TIMER_CALLBACK_MEMBER(reset_timer) { m_maincpu->resume(SUSPEND_REASON_RESET); }
output_finder<> m_led; output_finder<> m_led;
emu_timer *m_reset_timer; emu_timer *m_reset_timer;