trunk/src/mess/drivers/xerox820.c
r241607 | r241608 | |
39 | 39 | |
40 | 40 | |
41 | 41 | #include "includes/xerox820.h" |
42 | | #include "bus/rs232/rs232.h" |
43 | 42 | |
44 | | #define KEYBOARD_TAG "keyboard" |
45 | | |
46 | 43 | /* Read/Write Handlers */ |
47 | 44 | |
48 | 45 | void xerox820_state::bankswitch(int bank) |
r241607 | r241608 | |
320 | 317 | |
321 | 318 | */ |
322 | 319 | |
323 | | return m_keydata; |
| 320 | return m_kb->read() ^ 0xff; |
324 | 321 | }; |
325 | 322 | |
326 | 323 | WRITE8_MEMBER( xerox820ii_state::rdpio_pb_w ) |
r241607 | r241608 | |
407 | 404 | m_sio->txca_w(state); |
408 | 405 | } |
409 | 406 | |
410 | | WRITE8_MEMBER( xerox820_state::kbd_w ) |
411 | | { |
412 | | m_keydata = ~data; |
413 | | |
414 | | /* strobe in keyboard data */ |
415 | | m_kbpio->strobe_b(0); |
416 | | m_kbpio->strobe_b(1); |
417 | | } |
418 | | |
419 | 407 | /* Video */ |
420 | 408 | |
421 | 409 | UINT32 xerox820_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
r241607 | r241608 | |
470 | 458 | void xerox820_state::machine_start() |
471 | 459 | { |
472 | 460 | // state saving |
473 | | save_item(NAME(m_keydata)); |
474 | 461 | save_item(NAME(m_scroll)); |
475 | 462 | save_item(NAME(m_ncset2)); |
476 | 463 | save_item(NAME(m_vatt)); |
r241607 | r241608 | |
627 | 614 | MCFG_COM8116_FR_HANDLER(WRITELINE(xerox820_state, fr_w)) |
628 | 615 | MCFG_COM8116_FT_HANDLER(DEVWRITELINE(Z80SIO_TAG, z80dart_device, rxtxcb_w)) |
629 | 616 | |
630 | | MCFG_DEVICE_ADD(KEYBOARD_TAG, GENERIC_KEYBOARD, 0) |
631 | | MCFG_GENERIC_KEYBOARD_CB(WRITE8(xerox820_state, kbd_w)) |
| 617 | MCFG_DEVICE_ADD(KEYBOARD_TAG, XEROX_820_KEYBOARD, 0) |
| 618 | MCFG_XEROX_820_KEYBOARD_KBSTB_CALLBACK(DEVWRITELINE(Z80PIO_KB_TAG, z80pio_device, strobe_b)) |
632 | 619 | |
633 | 620 | /* internal ram */ |
634 | 621 | MCFG_RAM_ADD(RAM_TAG) |
r241607 | r241608 | |
714 | 701 | MCFG_COM8116_FR_HANDLER(WRITELINE(xerox820_state, fr_w)) |
715 | 702 | MCFG_COM8116_FT_HANDLER(DEVWRITELINE(Z80SIO_TAG, z80dart_device, rxtxcb_w)) |
716 | 703 | |
717 | | MCFG_DEVICE_ADD(KEYBOARD_TAG, GENERIC_KEYBOARD, 0) |
718 | | MCFG_GENERIC_KEYBOARD_CB(WRITE8(xerox820_state, kbd_w)) |
| 704 | MCFG_DEVICE_ADD(KEYBOARD_TAG, XEROX_820_KEYBOARD, 0) |
| 705 | MCFG_XEROX_820_KEYBOARD_KBSTB_CALLBACK(DEVWRITELINE(Z80PIO_KB_TAG, z80pio_device, strobe_b)) |
719 | 706 | |
720 | 707 | // SASI bus |
721 | 708 | MCFG_DEVICE_ADD(SASIBUS_TAG, SCSI_PORT, 0) |
r241607 | r241608 | |
785 | 772 | |
786 | 773 | ROM_REGION( 0x800, "chargen", 0 ) |
787 | 774 | ROM_LOAD( "x820.u92", 0x0000, 0x0800, CRC(b823fa98) SHA1(ad0ea346aa257a53ad5701f4201896a2b3a0f928) ) |
788 | | |
789 | | ROM_REGION( 0x800, "keyboard", 0 ) |
790 | | ROM_LOAD( "keyboard", 0x0000, 0x0800, NO_DUMP ) |
791 | 775 | ROM_END |
792 | 776 | |
793 | 777 | ROM_START( x820ii ) |
r241607 | r241608 | |
824 | 808 | ROM_REGION( 0x1000, "chargen", 0 ) |
825 | 809 | ROM_LOAD( "x820ii.u57", 0x0000, 0x0800, CRC(1a50f600) SHA1(df4470c80611c14fa7ea8591f741fbbecdfe4fd9) ) |
826 | 810 | ROM_LOAD( "x820ii.u58", 0x0800, 0x0800, CRC(aca4b9b3) SHA1(77f41470b0151945b8d3c3a935fc66409e9157b3) ) |
827 | | |
828 | | ROM_REGION( 0x400, "keyboard", 0 ) |
829 | | ROM_LOAD( "820iikey.bin", 0x000, 0x400, CRC(8ea3b39b) SHA1(3f05959f54a558b273567b1b4f0c7cdf46d8d9bf) ) // ASCII keyboard, QZERTY layout (Italian) |
830 | 811 | ROM_END |
831 | 812 | |
832 | 813 | ROM_START( x168 ) |
r241607 | r241608 | |
849 | 830 | ROM_REGION( 0x1000, "chargen", 0 ) |
850 | 831 | ROM_LOAD( "x820ii.u57", 0x0000, 0x0800, CRC(1a50f600) SHA1(df4470c80611c14fa7ea8591f741fbbecdfe4fd9) ) |
851 | 832 | ROM_LOAD( "x820ii.u58", 0x0800, 0x0800, CRC(aca4b9b3) SHA1(77f41470b0151945b8d3c3a935fc66409e9157b3) ) |
852 | | |
853 | | ROM_REGION( 0x400, "keyboard", 0 ) |
854 | | ROM_LOAD( "820iikey.bin", 0x000, 0x400, CRC(8ea3b39b) SHA1(3f05959f54a558b273567b1b4f0c7cdf46d8d9bf) ) // ASCII keyboard, QZERTY layout (Italian) |
855 | 833 | ROM_END |
856 | 834 | |
857 | 835 | ROM_START( mk83 ) |
r241607 | r241608 | |
865 | 843 | /* System Drivers */ |
866 | 844 | |
867 | 845 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
868 | | COMP( 1980, bigboard, 0, 0, bigboard, xerox820, driver_device, 0, "Digital Research Computers", "Big Board", GAME_IMPERFECT_KEYBOARD ) |
869 | | COMP( 1981, x820, bigboard, 0, xerox820, xerox820, driver_device, 0, "Xerox", "Xerox 820", GAME_IMPERFECT_KEYBOARD | GAME_NO_SOUND_HW ) |
870 | | COMP( 1982, mk82, bigboard, 0, bigboard, xerox820, driver_device, 0, "Scomar", "MK-82", GAME_IMPERFECT_KEYBOARD ) |
871 | | COMP( 1983, x820ii, 0, 0, xerox820ii, xerox820, driver_device, 0, "Xerox", "Xerox 820-II", GAME_NOT_WORKING | GAME_IMPERFECT_KEYBOARD ) |
872 | | COMP( 1983, x168, x820ii, 0, xerox168, xerox820, driver_device, 0, "Xerox", "Xerox 16/8", GAME_NOT_WORKING | GAME_IMPERFECT_KEYBOARD ) |
873 | | COMP( 1983, mk83, x820ii, 0, mk83, xerox820, driver_device, 0, "Scomar", "MK-83", GAME_NOT_WORKING | GAME_IMPERFECT_KEYBOARD | GAME_NO_SOUND_HW ) |
| 846 | COMP( 1980, bigboard, 0, 0, bigboard, xerox820, driver_device, 0, "Digital Research Computers", "Big Board", 0 ) |
| 847 | COMP( 1981, x820, bigboard, 0, xerox820, xerox820, driver_device, 0, "Xerox", "Xerox 820", GAME_NO_SOUND_HW ) |
| 848 | COMP( 1982, mk82, bigboard, 0, bigboard, xerox820, driver_device, 0, "Scomar", "MK-82", 0 ) |
| 849 | COMP( 1983, x820ii, 0, 0, xerox820ii, xerox820, driver_device, 0, "Xerox", "Xerox 820-II", GAME_NOT_WORKING ) |
| 850 | COMP( 1983, x168, x820ii, 0, xerox168, xerox820, driver_device, 0, "Xerox", "Xerox 16/8", GAME_NOT_WORKING ) |
| 851 | COMP( 1983, mk83, x820ii, 0, mk83, xerox820, driver_device, 0, "Scomar", "MK-83", GAME_NOT_WORKING | GAME_NO_SOUND_HW ) |
trunk/src/mess/includes/xerox820.h
r241607 | r241608 | |
5 | 5 | |
6 | 6 | #include "emu.h" |
7 | 7 | #include "bus/scsi/sa1403d.h" |
| 8 | #include "bus/rs232/rs232.h" |
8 | 9 | #include "cpu/z80/z80.h" |
9 | 10 | #include "cpu/z80/z80daisy.h" |
10 | 11 | #include "cpu/i86/i86.h" |
11 | 12 | #include "machine/com8116.h" |
12 | | #include "machine/keyboard.h" |
13 | 13 | #include "machine/ram.h" |
14 | 14 | #include "bus/scsi/scsi.h" |
15 | 15 | #include "bus/scsi/scsihd.h" |
16 | 16 | #include "machine/wd_fdc.h" |
| 17 | #include "machine/x820kb.h" |
17 | 18 | #include "machine/z80pio.h" |
18 | 19 | #include "machine/z80ctc.h" |
19 | 20 | #include "machine/z80dart.h" |
r241607 | r241608 | |
35 | 36 | #define SASIBUS_TAG "sasi" |
36 | 37 | #define RS232_A_TAG "rs232a" |
37 | 38 | #define RS232_B_TAG "rs232b" |
| 39 | #define KEYBOARD_TAG "kb" |
38 | 40 | |
39 | 41 | #define XEROX820_VIDEORAM_SIZE 0x1000 |
40 | 42 | #define XEROX820_VIDEORAM_MASK 0x0fff |
r241607 | r241608 | |
42 | 44 | class xerox820_state : public driver_device |
43 | 45 | { |
44 | 46 | public: |
45 | | xerox820_state(const machine_config &mconfig, device_type type, const char *tag) |
46 | | : driver_device(mconfig, type, tag), |
47 | | m_maincpu(*this, Z80_TAG), |
48 | | m_kbpio(*this, Z80PIO_KB_TAG), |
49 | | m_ctc(*this, Z80CTC_TAG), |
50 | | m_sio(*this, Z80SIO_TAG), |
51 | | m_fdc(*this, FD1771_TAG), |
52 | | m_ram(*this, RAM_TAG), |
53 | | m_palette(*this, "palette"), |
54 | | m_floppy0(*this, FD1771_TAG":0"), |
55 | | m_floppy1(*this, FD1771_TAG":1"), |
56 | | m_rom(*this, Z80_TAG), |
57 | | m_char_rom(*this, "chargen"), |
58 | | m_video_ram(*this, "video_ram"), |
59 | | m_fdc_irq(0), |
60 | | m_fdc_drq(0), |
61 | | m_8n5(0), |
62 | | m_400_460(0) |
| 47 | xerox820_state(const machine_config &mconfig, device_type type, const char *tag) : |
| 48 | driver_device(mconfig, type, tag), |
| 49 | m_maincpu(*this, Z80_TAG), |
| 50 | m_kbpio(*this, Z80PIO_KB_TAG), |
| 51 | m_ctc(*this, Z80CTC_TAG), |
| 52 | m_sio(*this, Z80SIO_TAG), |
| 53 | m_fdc(*this, FD1771_TAG), |
| 54 | m_ram(*this, RAM_TAG), |
| 55 | m_palette(*this, "palette"), |
| 56 | m_floppy0(*this, FD1771_TAG":0"), |
| 57 | m_floppy1(*this, FD1771_TAG":1"), |
| 58 | m_kb(*this, KEYBOARD_TAG), |
| 59 | m_rom(*this, Z80_TAG), |
| 60 | m_char_rom(*this, "chargen"), |
| 61 | m_video_ram(*this, "video_ram"), |
| 62 | m_fdc_irq(0), |
| 63 | m_fdc_drq(0), |
| 64 | m_8n5(0), |
| 65 | m_400_460(0) |
63 | 66 | { } |
64 | 67 | |
65 | 68 | virtual void machine_start(); |
r241607 | r241608 | |
76 | 79 | required_device<palette_device> m_palette; |
77 | 80 | required_device<floppy_connector> m_floppy0; |
78 | 81 | required_device<floppy_connector> m_floppy1; |
| 82 | required_device<xerox_820_keyboard_t> m_kb; |
79 | 83 | required_memory_region m_rom; |
80 | 84 | required_memory_region m_char_rom; |
81 | 85 | required_shared_ptr<UINT8> m_video_ram; |
r241607 | r241608 | |
89 | 93 | DECLARE_READ8_MEMBER( kbpio_pb_r ); |
90 | 94 | DECLARE_WRITE_LINE_MEMBER( intrq_w ); |
91 | 95 | DECLARE_WRITE_LINE_MEMBER( drq_w ); |
92 | | DECLARE_WRITE8_MEMBER( kbd_w ); |
93 | 96 | DECLARE_WRITE_LINE_MEMBER( fr_w ); |
94 | 97 | DECLARE_WRITE_LINE_MEMBER( fdc_intrq_w ); |
95 | 98 | DECLARE_WRITE_LINE_MEMBER( fdc_drq_w ); |
r241607 | r241608 | |
97 | 100 | void bankswitch(int bank); |
98 | 101 | void update_nmi(); |
99 | 102 | |
100 | | /* keyboard state */ |
101 | | int m_keydata; /* keyboard data */ |
102 | | |
103 | 103 | /* video state */ |
104 | 104 | UINT8 m_scroll; /* vertical scroll */ |
105 | 105 | UINT8 m_framecnt; |
trunk/src/mess/machine/x820kb.c
r0 | r241608 | |
| 1 | // license:BSD-3-Clause |
| 2 | // copyright-holders:Curt Coder |
| 3 | /********************************************************************** |
| 4 | |
| 5 | Xerox 820/820-II ASCII keyboard emulation |
| 6 | |
| 7 | Copyright MESS Team. |
| 8 | Visit http://mamedev.org for licensing and usage restrictions. |
| 9 | |
| 10 | *********************************************************************/ |
| 11 | |
| 12 | /* |
| 13 | |
| 14 | TODO: |
| 15 | |
| 16 | - LOCK key |
| 17 | - repeat |
| 18 | - what are T0/T1/INT? |
| 19 | |
| 20 | */ |
| 21 | |
| 22 | #include "x820kb.h" |
| 23 | |
| 24 | |
| 25 | |
| 26 | //************************************************************************** |
| 27 | // MACROS / CONSTANTS |
| 28 | //************************************************************************** |
| 29 | |
| 30 | #define I8748_TAG "i8748" |
| 31 | |
| 32 | |
| 33 | |
| 34 | //************************************************************************** |
| 35 | // DEVICE DEFINITIONS |
| 36 | //************************************************************************** |
| 37 | |
| 38 | const device_type XEROX_820_KEYBOARD = &device_creator<xerox_820_keyboard_t>; |
| 39 | |
| 40 | |
| 41 | //------------------------------------------------- |
| 42 | // ROM( xerox_820_keyboard ) |
| 43 | //------------------------------------------------- |
| 44 | |
| 45 | ROM_START( xerox_820_keyboard ) |
| 46 | ROM_REGION( 0x400, I8748_TAG, 0 ) |
| 47 | ROM_LOAD( "820iikey.bin", 0x000, 0x400, CRC(8ea3b39b) SHA1(3f05959f54a558b273567b1b4f0c7cdf46d8d9bf) ) |
| 48 | ROM_END |
| 49 | |
| 50 | |
| 51 | //------------------------------------------------- |
| 52 | // rom_region - device-specific ROM region |
| 53 | //------------------------------------------------- |
| 54 | |
| 55 | const rom_entry *xerox_820_keyboard_t::device_rom_region() const |
| 56 | { |
| 57 | return ROM_NAME( xerox_820_keyboard ); |
| 58 | } |
| 59 | |
| 60 | |
| 61 | //------------------------------------------------- |
| 62 | // ADDRESS_MAP( kb_io ) |
| 63 | //------------------------------------------------- |
| 64 | |
| 65 | static ADDRESS_MAP_START( xerox_820_keyboard_io, AS_IO, 8, xerox_820_keyboard_t ) |
| 66 | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READWRITE(kb_p1_r, kb_p1_w) |
| 67 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READ(kb_p2_r) |
| 68 | AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(kb_t0_r) |
| 69 | AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T1) AM_READ(kb_t1_r) |
| 70 | AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_WRITE(kb_bus_w) |
| 71 | ADDRESS_MAP_END |
| 72 | |
| 73 | |
| 74 | //------------------------------------------------- |
| 75 | // MACHINE_DRIVER( xerox_820_keyboard ) |
| 76 | //------------------------------------------------- |
| 77 | |
| 78 | static MACHINE_CONFIG_FRAGMENT( xerox_820_keyboard ) |
| 79 | MCFG_CPU_ADD(I8748_TAG, I8048, 4608000) // ??? |
| 80 | MCFG_CPU_IO_MAP(xerox_820_keyboard_io) |
| 81 | |
| 82 | MCFG_DEVICE_ADD("int_clk", CLOCK, 16) // ??? |
| 83 | MCFG_CLOCK_SIGNAL_HANDLER(INPUTLINE(I8748_TAG, MCS48_INPUT_IRQ)) |
| 84 | MACHINE_CONFIG_END |
| 85 | |
| 86 | |
| 87 | //------------------------------------------------- |
| 88 | // machine_config_additions - device-specific |
| 89 | // machine configurations |
| 90 | //------------------------------------------------- |
| 91 | |
| 92 | machine_config_constructor xerox_820_keyboard_t::device_mconfig_additions() const |
| 93 | { |
| 94 | return MACHINE_CONFIG_NAME( xerox_820_keyboard ); |
| 95 | } |
| 96 | |
| 97 | |
| 98 | //------------------------------------------------- |
| 99 | // INPUT_PORTS( xerox_820_keyboard ) |
| 100 | //------------------------------------------------- |
| 101 | |
| 102 | INPUT_PORTS_START( xerox_820_keyboard ) |
| 103 | PORT_START("Y0") |
| 104 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') |
| 105 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') |
| 106 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') |
| 107 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') |
| 108 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') |
| 109 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') |
| 110 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') |
| 111 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') |
| 112 | |
| 113 | PORT_START("Y1") |
| 114 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') |
| 115 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') |
| 116 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') |
| 117 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') |
| 118 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') |
| 119 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("ESC") PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) |
| 120 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(PLUS_PAD)) |
| 121 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4_PAD) PORT_CHAR(UCHAR_MAMEKEY(4_PAD)) |
| 122 | |
| 123 | PORT_START("Y2") |
| 124 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR(UCHAR_MAMEKEY(2_PAD)) |
| 125 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR(UCHAR_MAMEKEY(1_PAD)) |
| 126 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_UP) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) |
| 127 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LINE FEED") PORT_CODE(KEYCODE_ENTER_PAD) PORT_CHAR(UCHAR_MAMEKEY(ENTER_PAD)) |
| 128 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("RETURN") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) |
| 129 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('"') PORT_CHAR('`') |
| 130 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') PORT_CHAR('~') |
| 131 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') |
| 132 | |
| 133 | PORT_START("Y3") |
| 134 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad .") |
| 135 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD)) |
| 136 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_RIGHT) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) |
| 137 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_DOWN) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) |
| 138 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_LEFT) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) |
| 139 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') PORT_CHAR('\\') |
| 140 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') |
| 141 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') |
| 142 | |
| 143 | PORT_START("Y4") |
| 144 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3_PAD) PORT_CHAR(UCHAR_MAMEKEY(3_PAD)) |
| 145 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) // ; = |
| 146 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) // : < > |
| 147 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6_PAD) PORT_CHAR(UCHAR_MAMEKEY(6_PAD)) |
| 148 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9_PAD) PORT_CHAR(UCHAR_MAMEKEY(9_PAD)) |
| 149 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5_PAD) PORT_CHAR(UCHAR_MAMEKEY(5_PAD)) |
| 150 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8_PAD) PORT_CHAR(UCHAR_MAMEKEY(8_PAD)) |
| 151 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR(UCHAR_MAMEKEY(7_PAD)) |
| 152 | |
| 153 | PORT_START("Y5") |
| 154 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') |
| 155 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('0') PORT_CHAR(')') |
| 156 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('9') PORT_CHAR('(') |
| 157 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_') |
| 158 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+') |
| 159 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("BACK SPACE") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) |
| 160 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("DEL") PORT_CODE(KEYCODE_DEL) PORT_CHAR(UCHAR_MAMEKEY(DEL)) |
| 161 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad -") PORT_CODE(KEYCODE_MINUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(MINUS_PAD)) |
| 162 | |
| 163 | PORT_START("Y6") |
| 164 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&') |
| 165 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^') |
| 166 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') |
| 167 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') |
| 168 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') |
| 169 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@') |
| 170 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') |
| 171 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("HELP") PORT_CODE(KEYCODE_TILDE) |
| 172 | |
| 173 | PORT_START("Y7") |
| 174 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') |
| 175 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') |
| 176 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') |
| 177 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') |
| 178 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') |
| 179 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') |
| 180 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') |
| 181 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("TAB") PORT_CODE(KEYCODE_TAB) PORT_CHAR(UCHAR_MAMEKEY(TAB)) |
| 182 | |
| 183 | PORT_START("Y8") |
| 184 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') |
| 185 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') |
| 186 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') |
| 187 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') |
| 188 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') |
| 189 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') |
| 190 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') |
| 191 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') |
| 192 | |
| 193 | PORT_START("YD") |
| 194 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LOCK") PORT_CODE(KEYCODE_Q) PORT_TOGGLE |
| 195 | |
| 196 | PORT_START("YF") |
| 197 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Left SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) |
| 198 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Right SHIFT") PORT_CODE(KEYCODE_RSHIFT) |
| 199 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Left CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) |
| 200 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 201 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 202 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 203 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Right CTRL") PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(RCONTROL)) |
| 204 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 205 | INPUT_PORTS_END |
| 206 | |
| 207 | |
| 208 | //------------------------------------------------- |
| 209 | // input_ports - device-specific input ports |
| 210 | //------------------------------------------------- |
| 211 | |
| 212 | ioport_constructor xerox_820_keyboard_t::device_input_ports() const |
| 213 | { |
| 214 | return INPUT_PORTS_NAME( xerox_820_keyboard ); |
| 215 | } |
| 216 | |
| 217 | |
| 218 | |
| 219 | //************************************************************************** |
| 220 | // LIVE DEVICE |
| 221 | //************************************************************************** |
| 222 | |
| 223 | //------------------------------------------------- |
| 224 | // xerox_820_keyboard_t - constructor |
| 225 | //------------------------------------------------- |
| 226 | |
| 227 | xerox_820_keyboard_t::xerox_820_keyboard_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 228 | device_t(mconfig, XEROX_820_KEYBOARD, "Xerox 820 Keyboard", tag, owner, clock, "x820kb", __FILE__), |
| 229 | m_maincpu(*this, I8748_TAG), |
| 230 | m_y0(*this, "Y0"), |
| 231 | m_y1(*this, "Y1"), |
| 232 | m_y2(*this, "Y2"), |
| 233 | m_y3(*this, "Y3"), |
| 234 | m_y4(*this, "Y4"), |
| 235 | m_y5(*this, "Y5"), |
| 236 | m_y6(*this, "Y6"), |
| 237 | m_y7(*this, "Y7"), |
| 238 | m_y8(*this, "Y8"), |
| 239 | m_yd(*this, "YD"), |
| 240 | m_yf(*this, "YF"), |
| 241 | m_kbstb_cb(*this), |
| 242 | m_p1(0xff), |
| 243 | m_bus(0xff) |
| 244 | { |
| 245 | } |
| 246 | |
| 247 | |
| 248 | //------------------------------------------------- |
| 249 | // device_start - device-specific startup |
| 250 | //------------------------------------------------- |
| 251 | |
| 252 | void xerox_820_keyboard_t::device_start() |
| 253 | { |
| 254 | // state saving |
| 255 | save_item(NAME(m_p1)); |
| 256 | save_item(NAME(m_bus)); |
| 257 | } |
| 258 | |
| 259 | |
| 260 | //------------------------------------------------- |
| 261 | // device_reset - device-specific reset |
| 262 | //------------------------------------------------- |
| 263 | |
| 264 | void xerox_820_keyboard_t::device_reset() |
| 265 | { |
| 266 | m_kbstb_cb.resolve_safe(); |
| 267 | } |
| 268 | |
| 269 | |
| 270 | //------------------------------------------------- |
| 271 | // kb_p1_r - |
| 272 | //------------------------------------------------- |
| 273 | |
| 274 | READ8_MEMBER( xerox_820_keyboard_t::kb_p1_r ) |
| 275 | { |
| 276 | return m_p1; // TODO: move to mcs48.c |
| 277 | } |
| 278 | |
| 279 | |
| 280 | //------------------------------------------------- |
| 281 | // kb_p1_w - |
| 282 | //------------------------------------------------- |
| 283 | |
| 284 | WRITE8_MEMBER( xerox_820_keyboard_t::kb_p1_w ) |
| 285 | { |
| 286 | /* |
| 287 | |
| 288 | bit description |
| 289 | |
| 290 | 0 A0 |
| 291 | 1 A1 |
| 292 | 2 A2 |
| 293 | 3 A3 |
| 294 | 4 KBSTB |
| 295 | 5 |
| 296 | 6 |
| 297 | 7 ? (toggled if T1=0) |
| 298 | |
| 299 | */ |
| 300 | |
| 301 | m_p1 = data; |
| 302 | |
| 303 | m_kbstb_cb(BIT(data, 4) ? CLEAR_LINE : ASSERT_LINE); |
| 304 | } |
| 305 | |
| 306 | |
| 307 | //------------------------------------------------- |
| 308 | // kb_p2_r - |
| 309 | //------------------------------------------------- |
| 310 | |
| 311 | READ8_MEMBER( xerox_820_keyboard_t::kb_p2_r ) |
| 312 | { |
| 313 | UINT8 data = 0xff; |
| 314 | |
| 315 | switch (m_p1 & 0x0f) |
| 316 | { |
| 317 | case 0: data &= m_y0->read(); break; |
| 318 | case 1: data &= m_y1->read(); break; |
| 319 | case 2: data &= m_y2->read(); break; |
| 320 | case 3: data &= m_y3->read(); break; |
| 321 | case 4: data &= m_y4->read(); break; |
| 322 | case 5: data &= m_y5->read(); break; |
| 323 | case 6: data &= m_y6->read(); break; |
| 324 | case 7: data &= m_y7->read(); break; |
| 325 | case 8: data &= m_y8->read(); break; |
| 326 | case 0xf: data &= m_yf->read(); break; |
| 327 | } |
| 328 | |
| 329 | return data; |
| 330 | } |
| 331 | |
| 332 | |
| 333 | //------------------------------------------------- |
| 334 | // kb_t0_r - |
| 335 | //------------------------------------------------- |
| 336 | |
| 337 | READ8_MEMBER( xerox_820_keyboard_t::kb_t0_r ) |
| 338 | { |
| 339 | return 1; // ??? |
| 340 | } |
| 341 | |
| 342 | |
| 343 | //------------------------------------------------- |
| 344 | // kb_t1_r - |
| 345 | //------------------------------------------------- |
| 346 | |
| 347 | READ8_MEMBER( xerox_820_keyboard_t::kb_t1_r ) |
| 348 | { |
| 349 | return 1; // ??? |
| 350 | } |
| 351 | |
| 352 | |
| 353 | //------------------------------------------------- |
| 354 | // kb_bus_w - |
| 355 | //------------------------------------------------- |
| 356 | |
| 357 | WRITE8_MEMBER( xerox_820_keyboard_t::kb_bus_w ) |
| 358 | { |
| 359 | m_bus = data; |
| 360 | } |