src/mess/machine/lisa.c
| r2459 | r2460 | |
| 391 | 391 | /* keyboard matrix to detect transition */ |
| 392 | 392 | static int key_matrix[8]; |
| 393 | 393 | |
| 394 | | static void scan_keyboard( void ) |
| 394 | static void scan_keyboard(running_machine *machine) |
| 395 | 395 | { |
| 396 | 396 | int i, j; |
| 397 | 397 | int keybuf; |
| 398 | 398 | UINT8 keycode; |
| 399 | char port[6]; |
| 399 | 400 | |
| 400 | 401 | if (! COPS_force_unplug) |
| 401 | 402 | for (i=0; i<8; i++) |
| 402 | 403 | { |
| 403 | | keybuf = readinputport(i+2); |
| 404 | sprintf(port, "LINE%d", i); |
| 405 | keybuf = input_port_read(machine, port); |
| 404 | 406 | |
| 405 | 407 | if (keybuf != key_matrix[i]) |
| 406 | 408 | { /* if state has changed, find first bit which has changed */ |
| r2459 | r2460 | |
| 445 | 447 | /*if (COPS_force_unplug) |
| 446 | 448 | return;*/ /* ???? */ |
| 447 | 449 | |
| 448 | | new_mx = readinputport(0); |
| 449 | | new_my = readinputport(1); |
| 450 | new_mx = input_port_read(machine, "MOUSE_X"); |
| 451 | new_my = input_port_read(machine, "MOUSE_Y"); |
| 450 | 452 | |
| 451 | 453 | /* see if it moved in the x coord */ |
| 452 | 454 | if (new_mx != last_mx) |
| r2459 | r2460 | |
| 1303 | 1305 | set_VTIR(machine, 0); |
| 1304 | 1306 | |
| 1305 | 1307 | /* do keyboard scan */ |
| 1306 | | scan_keyboard(); |
| 1308 | scan_keyboard(machine); |
| 1307 | 1309 | } |
| 1308 | 1310 | |
| 1309 | 1311 | /* |
| r2459 | r2460 | |
| 1746 | 1748 | COMBINE_DATA((UINT16 *) (lisa_ram_ptr + address)); |
| 1747 | 1749 | if (diag2) |
| 1748 | 1750 | { |
| 1749 | | if ((ACCESSING_LSB) |
| 1751 | if ((ACCESSING_BITS_0_7) |
| 1750 | 1752 | && ! (bad_parity_table[address >> 3] & (0x1 << (address & 0x7)))) |
| 1751 | 1753 | { |
| 1752 | 1754 | bad_parity_table[address >> 3] |= 0x1 << (address & 0x7); |
| 1753 | 1755 | bad_parity_count++; |
| 1754 | 1756 | } |
| 1755 | | if ((ACCESSING_MSB) |
| 1757 | if ((ACCESSING_BITS_8_15) |
| 1756 | 1758 | && ! (bad_parity_table[address >> 3] & (0x2 << (address & 0x7)))) |
| 1757 | 1759 | { |
| 1758 | 1760 | bad_parity_table[address >> 3] |= 0x2 << (address & 0x7); |
| r2459 | r2460 | |
| 1761 | 1763 | } |
| 1762 | 1764 | else if (bad_parity_table[address >> 3] & (0x3 << (address & 0x7))) |
| 1763 | 1765 | { |
| 1764 | | if ((ACCESSING_LSB) |
| 1766 | if ((ACCESSING_BITS_0_7) |
| 1765 | 1767 | && (bad_parity_table[address >> 3] & (0x1 << (address & 0x7)))) |
| 1766 | 1768 | { |
| 1767 | 1769 | bad_parity_table[address >> 3] &= ~ (0x1 << (address & 0x7)); |
| 1768 | 1770 | bad_parity_count--; |
| 1769 | 1771 | } |
| 1770 | | if ((ACCESSING_MSB) |
| 1772 | if ((ACCESSING_BITS_8_15) |
| 1771 | 1773 | && (bad_parity_table[address >> 3] & (0x2 << (address & 0x7)))) |
| 1772 | 1774 | { |
| 1773 | 1775 | bad_parity_table[address >> 3] &= ~ (0x2 << (address & 0x7)); |
| r2459 | r2460 | |
| 1785 | 1787 | COMBINE_DATA((UINT16 *) (lisa_ram_ptr + address)); |
| 1786 | 1788 | if (diag2) |
| 1787 | 1789 | { |
| 1788 | | if ((ACCESSING_LSB) |
| 1790 | if ((ACCESSING_BITS_0_7) |
| 1789 | 1791 | && ! (bad_parity_table[address >> 3] & (0x1 << (address & 0x7)))) |
| 1790 | 1792 | { |
| 1791 | 1793 | bad_parity_table[address >> 3] |= 0x1 << (address & 0x7); |
| 1792 | 1794 | bad_parity_count++; |
| 1793 | 1795 | } |
| 1794 | | if ((ACCESSING_MSB) |
| 1796 | if ((ACCESSING_BITS_8_15) |
| 1795 | 1797 | && ! (bad_parity_table[address >> 3] & (0x2 << (address & 0x7)))) |
| 1796 | 1798 | { |
| 1797 | 1799 | bad_parity_table[address >> 3] |= 0x2 << (address & 0x7); |
| r2459 | r2460 | |
| 1800 | 1802 | } |
| 1801 | 1803 | else if (bad_parity_table[address >> 3] & (0x3 << (address & 0x7))) |
| 1802 | 1804 | { |
| 1803 | | if ((ACCESSING_LSB) |
| 1805 | if ((ACCESSING_BITS_0_7) |
| 1804 | 1806 | && (bad_parity_table[address >> 3] & (0x1 << (address & 0x7)))) |
| 1805 | 1807 | { |
| 1806 | 1808 | bad_parity_table[address >> 3] &= ~ (0x1 << (address & 0x7)); |
| 1807 | 1809 | bad_parity_count--; |
| 1808 | 1810 | } |
| 1809 | | if ((ACCESSING_MSB) |
| 1811 | if ((ACCESSING_BITS_8_15) |
| 1810 | 1812 | && (bad_parity_table[address >> 3] & (0x2 << (address & 0x7)))) |
| 1811 | 1813 | { |
| 1812 | 1814 | bad_parity_table[address >> 3] &= ~ (0x2 << (address & 0x7)); |
| r2459 | r2460 | |
| 1949 | 1951 | { |
| 1950 | 1952 | if (! (offset & 0x400)) |
| 1951 | 1953 | { |
| 1952 | | /*if (ACCESSING_LSB)*/ /* Geez, who cares ? */ |
| 1954 | /*if (ACCESSING_BITS_0_7)*/ /* Geez, who cares ? */ |
| 1953 | 1955 | answer = lisa_fdc_ram[offset & 0x03ff] & 0xff; /* right ??? */ |
| 1954 | 1956 | } |
| 1955 | 1957 | } |
| r2459 | r2460 | |
| 1966 | 1968 | |
| 1967 | 1969 | case 2: /* parallel port */ |
| 1968 | 1970 | /* 1 VIA located at 0xD901 */ |
| 1969 | | if (ACCESSING_LSB) |
| 1971 | if (ACCESSING_BITS_0_7) |
| 1970 | 1972 | return via_read(1, (offset >> 2) & 0xf); |
| 1971 | 1973 | break; |
| 1972 | 1974 | |
| 1973 | 1975 | case 3: /* keyboard/mouse cops via */ |
| 1974 | 1976 | /* 1 VIA located at 0xDD81 */ |
| 1975 | | if (ACCESSING_LSB) |
| 1977 | if (ACCESSING_BITS_0_7) |
| 1976 | 1978 | return via_read(0, offset & 0xf); |
| 1977 | 1979 | break; |
| 1978 | 1980 | } |
| r2459 | r2460 | |
| 2075 | 2077 | /* Floppy Disk Controller shared RAM */ |
| 2076 | 2078 | if (! (offset & 0x0400)) |
| 2077 | 2079 | { |
| 2078 | | if (ACCESSING_LSB) |
| 2080 | if (ACCESSING_BITS_0_7) |
| 2079 | 2081 | lisa_fdc_ram[offset & 0x03ff] = data & 0xff; |
| 2080 | 2082 | } |
| 2081 | 2083 | } |
| r2459 | r2460 | |
| 2088 | 2090 | break; |
| 2089 | 2091 | |
| 2090 | 2092 | case 2: /* paralel port */ |
| 2091 | | if (ACCESSING_LSB) |
| 2093 | if (ACCESSING_BITS_0_7) |
| 2092 | 2094 | via_write(1, (offset >> 2) & 0xf, data & 0xff); |
| 2093 | 2095 | break; |
| 2094 | 2096 | |
| 2095 | 2097 | case 3: /* keyboard/mouse cops via */ |
| 2096 | | if (ACCESSING_LSB) |
| 2098 | if (ACCESSING_BITS_0_7) |
| 2097 | 2099 | via_write(0, offset & 0xf, data & 0xff); |
| 2098 | 2100 | break; |
| 2099 | 2101 | } |
src/mess/drivers/lisa.c
| r2459 | r2460 | |
| 83 | 83 | |
| 84 | 84 | |
| 85 | 85 | static INPUT_PORTS_START( lisa ) |
| 86 | | PORT_START /* Mouse - X AXIS */ |
| 86 | PORT_START_TAG("MOUSE_X") /* Mouse - X AXIS */ |
| 87 | 87 | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1) |
| 88 | 88 | |
| 89 | | PORT_START /* Mouse - Y AXIS */ |
| 89 | PORT_START_TAG("MOUSE_Y") /* Mouse - Y AXIS */ |
| 90 | 90 | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1) |
| 91 | 91 | |
| 92 | 92 | /* pseudo-input ports with (unverified) keyboard layout */ |
| 93 | 93 | |
| 94 | | PORT_START /* 2 */ |
| 94 | PORT_START_TAG("LINE0")/* 2 */ |
| 95 | 95 | PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 96 | 96 | |
| 97 | 97 | PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("mouse button") |
| 98 | 98 | |
| 99 | | PORT_START /* 3 */ |
| 99 | PORT_START_TAG("LINE1") /* 3 */ |
| 100 | 100 | PORT_BIT(0xFFFF, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 101 | 101 | |
| 102 | | PORT_START /* 4 */ |
| 102 | PORT_START_TAG("LINE2") /* 4 */ |
| 103 | 103 | PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Clear") PORT_CODE(KEYCODE_DEL) |
| 104 | 104 | PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("- (KP)") PORT_CODE(KEYCODE_NUMLOCK) |
| 105 | 105 | PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("+ (KP)") PORT_CODE(KEYCODE_SLASH_PAD) |
| r2459 | r2460 | |
| 117 | 117 | PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("3 (KP)") PORT_CODE(KEYCODE_3_PAD) |
| 118 | 118 | PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Enter (KP)") PORT_CODE(KEYCODE_ENTER_PAD) |
| 119 | 119 | |
| 120 | | PORT_START /* 5 */ |
| 120 | PORT_START_TAG("LINE3") /* 5 */ |
| 121 | 121 | PORT_BIT(0xFFFF, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 122 | 122 | |
| 123 | | PORT_START /* 6 */ |
| 123 | PORT_START_TAG("LINE4") /* 6 */ |
| 124 | 124 | PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("-") PORT_CODE(KEYCODE_MINUS) |
| 125 | 125 | PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("=") PORT_CODE(KEYCODE_EQUALS) |
| 126 | 126 | PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("\\") PORT_CODE(KEYCODE_BACKSLASH) |
| r2459 | r2460 | |
| 143 | 143 | PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Right Option") PORT_CODE(KEYCODE_RALT) |
| 144 | 144 | PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 145 | 145 | |
| 146 | | PORT_START /* 7 */ |
| 146 | PORT_START_TAG("LINE5") /* 7 */ |
| 147 | 147 | PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) |
| 148 | 148 | PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) |
| 149 | 149 | PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U) |
| r2459 | r2460 | |
| 161 | 161 | PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(".") PORT_CODE(KEYCODE_STOP) |
| 162 | 162 | PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O) |
| 163 | 163 | |
| 164 | | PORT_START /* 8 */ |
| 164 | PORT_START_TAG("LINE6") /* 8 */ |
| 165 | 165 | PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E) |
| 166 | 166 | PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6) |
| 167 | 167 | PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7) |
| r2459 | r2460 | |
| 179 | 179 | PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) |
| 180 | 180 | PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N) |
| 181 | 181 | |
| 182 | | PORT_START /* 9 */ |
| 182 | PORT_START_TAG("LINE7") /* 9 */ |
| 183 | 183 | PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) |
| 184 | 184 | PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) |
| 185 | 185 | PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3) |