src/mess/drivers/kyocera.c
| r4709 | r4710 | |
| 27 | 27 | |
| 28 | 28 | TODO: |
| 29 | 29 | |
| 30 | | - pc8201 keyboard |
| 31 | | - pc8201 I/O control registers |
| 30 | - keyboard is unresponsive for couple of seconds after boot |
| 32 | 31 | - soft power on/off |
| 33 | 32 | - kc85 IM6042 UART |
| 34 | 33 | - pc8201 NEC PC-8233 floppy controller |
| r4709 | r4710 | |
| 43 | 42 | |
| 44 | 43 | */ |
| 45 | 44 | |
| 45 | /* |
| 46 | |
| 47 | * PC-8201/8300 HARDWARE PORT DEFINITIONS * |
| 48 | |
| 49 | -Port- |
| 50 | Name Hex Dec Notes |
| 51 | -------- --- --- ----------------------------------------- |
| 52 | A8255 070 112 Video interface port A (8255) |
| 53 | B8255 071 113 Video interface port B (8255) |
| 54 | C8255 072 114 Video interface port C (8255) |
| 55 | CW8255 073 115 Video interface command/mode port (8255) |
| 56 | ROMAH 080 128 128k ROM select and MSBIT of address |
| 57 | ROMAL 084 132 Lowest 8 bits of extended ROM address |
| 58 | ROMAM 088 136 Middle eight bits of 128k ROM address |
| 59 | ROMRD 08C 140 Read data port for 128k ROM |
| 60 | IOCNT 090 144 I/O control port |
| 61 | BIT 0-Bank #0 select |
| 62 | BIT 1-Bank #1 select |
| 63 | BIT 2-Bank #2 (0000-7FFF) |
| 64 | BIT 3-Bank #2 (8000-FFFF) |
| 65 | BIT 4-Clock strobe |
| 66 | BIT 5-Cassette motor |
| 67 | BIT 6&7- Serial interface multiplexor |
| 68 | 00=Not used |
| 69 | 01=RAM file |
| 70 | 10=F/D interface |
| 71 | 11=COM port RS232C |
| 72 | IOSTS 0A0 160 Return status of IOCNT port |
| 73 | BNKSTT 0A0 160 Current bank number is stored here |
| 74 | PRTSTB 0A1 161 Printer strobe |
| 75 | BNKSEL 0A1 161 This port is used to set the current bank |
| 76 | CS8155 0B8 184 8155 command/status port |
| 77 | PORTA 0B9 185 Printer data |
| 78 | KEYBOARD STROBE |
| 79 | LCD CHIP SELECT |
| 80 | CLOCK DATA |
| 81 | PORTB 0BA 186 Bit 0&1 LCD block select |
| 82 | BIT 2-Disable music output |
| 83 | BIT 3-CAR detect(0)/RING detect(1) |
| 84 | BIT 4-Disable auto power off |
| 85 | BIT 5-Disable buzzer |
| 86 | BIT 6-DTR ON |
| 87 | BIT 7-RTS ON |
| 88 | PORTC 0BB 187 Bit 0-clock data in |
| 89 | BIT 1-Printer select |
| 90 | BIT 2-Printer busy |
| 91 | BIT 3-Bar code reader data in |
| 92 | BIT 4-CTS IN |
| 93 | BIT 5-DSR IN |
| 94 | TIML 0BC 188 Low byte of timer |
| 95 | TIMH 0BD 189 High byte of timer count |
| 96 | TXRXD 0C8 200 6402 data register |
| 97 | CS6402 0D8 216 RS232 command & status port |
| 98 | KYRTIN 0E8 232 Read keyboard matrix port |
| 99 | LCDCM 0FE 254 LCD command/status port |
| 100 | LCDDT 0FF 255 LCD data port |
| 101 | |
| 102 | */ |
| 103 | |
| 46 | 104 | #include "driver.h" |
| 47 | 105 | #include "includes/kyocera.h" |
| 48 | 106 | #include "cpu/i8085/i8085.h" |
| r4709 | r4710 | |
| 62 | 120 | |
| 63 | 121 | /* Read/Write Handlers */ |
| 64 | 122 | |
| 65 | | static UINT8 sio; |
| 66 | | |
| 67 | 123 | static READ8_HANDLER( pc8201_bank_r ) |
| 68 | 124 | { |
| 125 | /* |
| 126 | |
| 127 | bit signal description |
| 128 | |
| 129 | 0 LADR1 select address 0 to 7fff |
| 130 | 1 LADR2 select address 0 to 7fff |
| 131 | 2 HADR1 select address 8000 to ffff |
| 132 | 3 HADR2 select address 8000 to ffff |
| 133 | 4 |
| 134 | 5 |
| 135 | 6 SELB serial interface status bit 1 |
| 136 | 7 SELA serial interface status bit 0 |
| 137 | |
| 138 | */ |
| 139 | |
| 69 | 140 | kc85_state *state = space->machine->driver_data; |
| 70 | 141 | |
| 71 | | return (sio & 0xc0) | state->bank; |
| 142 | return (state->iosel << 5) | state->bank; |
| 72 | 143 | } |
| 73 | 144 | |
| 74 | 145 | static void pc8201_bankswitch(running_machine *machine, UINT8 data) |
| r4709 | r4710 | |
| 133 | 204 | |
| 134 | 205 | static WRITE8_HANDLER( pc8201_bank_w ) |
| 135 | 206 | { |
| 136 | | pc8201_bankswitch(space->machine, data); |
| 137 | | } |
| 138 | | |
| 139 | | static WRITE8_HANDLER( pc8201_90_w ) |
| 140 | | { |
| 141 | 207 | /* |
| 142 | 208 | |
| 143 | 209 | bit signal description |
| 144 | 210 | |
| 145 | | 0 |
| 146 | | 1 |
| 147 | | 2 |
| 148 | | 3 |
| 149 | | 4 STB RTC strobe |
| 211 | 0 LADR1 select address 0 to 7fff |
| 212 | 1 LADR2 select address 0 to 7fff |
| 213 | 2 HADR1 select address 8000 to ffff |
| 214 | 3 HADR2 select address 8000 to ffff |
| 215 | 4 |
| 150 | 216 | 5 |
| 151 | | 6 |
| 152 | | 7 |
| 217 | 6 |
| 218 | 7 |
| 153 | 219 | |
| 154 | 220 | */ |
| 155 | 221 | |
| 156 | | kc85_state *state = space->machine->driver_data; |
| 157 | | |
| 158 | | sio = data; |
| 159 | | |
| 160 | | upd1990a_stb_w(state->upd1990a, BIT(data, 4)); |
| 222 | pc8201_bankswitch(space->machine, data & 0x0f); |
| 161 | 223 | } |
| 162 | 224 | |
| 163 | | static WRITE8_HANDLER( pc8201_e0_w ) |
| 225 | static WRITE8_HANDLER( pc8201_ctrl_w ) |
| 164 | 226 | { |
| 165 | 227 | /* |
| 166 | 228 | |
| r4709 | r4710 | |
| 169 | 231 | 0 |
| 170 | 232 | 1 |
| 171 | 233 | 2 |
| 172 | | 3 |
| 173 | | 4 |
| 174 | | 5 |
| 175 | | 6 |
| 176 | | 7 |
| 234 | 3 REMOTE cassette motor |
| 235 | 4 TSTB RTC strobe |
| 236 | 5 PSTB printer strobe |
| 237 | 6 SELB serial interface select bit 1 |
| 238 | 7 SELA serial interface select bit 0 |
| 177 | 239 | |
| 178 | 240 | */ |
| 179 | 241 | |
| 180 | | // kc85_state *state = space->machine->driver_data; |
| 242 | kc85_state *state = space->machine->driver_data; |
| 243 | |
| 244 | /* cassette motor */ |
| 245 | cassette_change_state(cassette_device_image(space->machine), BIT(data, 3) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR); |
| 246 | |
| 247 | /* RTC strobe */ |
| 248 | upd1990a_stb_w(state->upd1990a, BIT(data, 4)); |
| 249 | |
| 250 | /* printer strobe */ |
| 251 | centronics_strobe_w(state->centronics, BIT(data, 5)); |
| 252 | |
| 253 | /* serial interface select */ |
| 254 | state->iosel = data >> 5; |
| 181 | 255 | } |
| 182 | 256 | |
| 183 | 257 | static WRITE8_HANDLER( im6402_ctrl_w ) |
| r4709 | r4710 | |
| 242 | 316 | return 0xf0; |
| 243 | 317 | } |
| 244 | 318 | |
| 319 | static READ8_HANDLER( pc8201_im6402_status_r ) |
| 320 | { |
| 321 | /* |
| 322 | |
| 323 | bit signal description |
| 324 | |
| 325 | 0 _DCD/_RD data carrier detect / ring detect |
| 326 | 1 OE overrun error |
| 327 | 2 FE framing error |
| 328 | 3 PE parity error |
| 329 | 4 TBRE transmit buffer register empty |
| 330 | 5 RP |
| 331 | 6 +5V |
| 332 | 7 _LPS low power signal |
| 333 | |
| 334 | */ |
| 335 | /* |
| 336 | kc85_state *state = space->machine->driver_data; |
| 337 | |
| 338 | UINT8 data = 0; |
| 339 | |
| 340 | int cd = im6402_cd_r(state->im6402); |
| 341 | int oe = im6402_oe_r(state->im6402); |
| 342 | int fe = im6402_fe_r(state->im6402); |
| 343 | int pe = im6402_pe_r(state->im6402); |
| 344 | int tbre = im6402_tbre_r(state->im6402); |
| 345 | |
| 346 | data = (tbre << 4) | (pe << 3) | (fe << 2) | (oe << 1) | cd; |
| 347 | |
| 348 | return data; |
| 349 | */ |
| 350 | |
| 351 | return 0xf0; |
| 352 | } |
| 245 | 353 | static WRITE8_HANDLER( modem_w ) |
| 246 | 354 | { |
| 247 | 355 | /* |
| r4709 | r4710 | |
| 428 | 536 | static ADDRESS_MAP_START( pc8201_io, ADDRESS_SPACE_IO, 8 ) |
| 429 | 537 | ADDRESS_MAP_UNMAP_HIGH |
| 430 | 538 | // AM_RANGE(0x70, 0x70) AM_MIRROR(0x0f) optional RAM unit |
| 431 | | // AM_RANGE(0x80, 0x80) AM_MIRROR(0x0f) optional I/O controller unit |
| 432 | | AM_RANGE(0x90, 0x90) AM_WRITE(pc8201_90_w) |
| 539 | // AM_RANGE(0x80, 0x80) AM_MIRROR(0x0f) optional 128K ROM cartridge |
| 540 | AM_RANGE(0x90, 0x90) AM_WRITE(pc8201_ctrl_w) |
| 433 | 541 | AM_RANGE(0xa0, 0xa0) AM_MIRROR(0x0f) AM_READWRITE(pc8201_bank_r, pc8201_bank_w) |
| 434 | | AM_RANGE(0xb0, 0xb7) AM_MIRROR(0x08) AM_DEVREADWRITE( PIO8155_TAG, pio8155_r, pio8155_w ) |
| 542 | AM_RANGE(0xb0, 0xb7) AM_MIRROR(0x08) AM_DEVREADWRITE(PIO8155_TAG, pio8155_r, pio8155_w ) |
| 435 | 543 | // AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x0f) AM_DEVREADWRITE(IM6402_TAG, im6402_data_r, im6402_data_w) |
| 436 | | AM_RANGE(0xd0, 0xd0) AM_MIRROR(0x0f) AM_READWRITE(im6402_status_r, im6402_ctrl_w) |
| 437 | | AM_RANGE(0xe0, 0xe0) AM_MIRROR(0x0f) AM_READWRITE(keyboard_r, pc8201_e0_w) |
| 544 | AM_RANGE(0xd0, 0xd0) AM_MIRROR(0x0f) AM_READWRITE(pc8201_im6402_status_r, im6402_ctrl_w) |
| 545 | AM_RANGE(0xe0, 0xe0) AM_MIRROR(0x0f) AM_READ(keyboard_r) |
| 438 | 546 | AM_RANGE(0xf0, 0xf0) AM_MIRROR(0x0e) AM_READWRITE(kc85_lcd_status_r, kc85_lcd_command_w) |
| 439 | 547 | AM_RANGE(0xf1, 0xf1) AM_MIRROR(0x0e) AM_READWRITE(kc85_lcd_data_r, kc85_lcd_data_w) |
| 440 | 548 | ADDRESS_MAP_END |
| r4709 | r4710 | |
| 537 | 645 | PORT_START("KEY8") |
| 538 | 646 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("PAUSE BREAK") PORT_CODE(KEYCODE_F12) PORT_CHAR(UCHAR_MAMEKEY(F12)) |
| 539 | 647 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 540 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CAPS LOCK") PORT_CODE(KEYCODE_CAPSLOCK) |
| 648 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CAPS LOCK") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE |
| 541 | 649 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("NUM") PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(RCONTROL)) |
| 542 | 650 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CODE") PORT_CODE(KEYCODE_RALT) PORT_CHAR(UCHAR_MAMEKEY(RALT)) |
| 543 | 651 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("GRAPH") PORT_CODE(KEYCODE_LALT) PORT_CHAR(UCHAR_MAMEKEY(LALT)) |
| r4709 | r4710 | |
| 563 | 671 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"') |
| 564 | 672 | |
| 565 | 673 | PORT_MODIFY("KEY5") |
| 566 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_INSERT) PORT_CHAR(UCHAR_MAMEKEY(INSERT)) |
| 567 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') |
| 674 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("PAST INS") PORT_CODE(KEYCODE_INSERT) PORT_CHAR(UCHAR_MAMEKEY(INSERT)) |
| 675 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') |
| 568 | 676 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_RALT) PORT_CHAR('[') PORT_CHAR('{') |
| 569 | 677 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') |
| 570 | 678 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(':') PORT_CHAR('*') |
| r4709 | r4710 | |
| 583 | 691 | |
| 584 | 692 | PORT_MODIFY("KEY7") |
| 585 | 693 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("STOP") PORT_CODE(KEYCODE_F8) PORT_CHAR(UCHAR_MAMEKEY(F8)) |
| 586 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 587 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 694 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 695 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 588 | 696 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("f.5") PORT_CODE(KEYCODE_F5) PORT_CHAR(UCHAR_MAMEKEY(F5)) |
| 589 | 697 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("f.4") PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F4)) |
| 590 | 698 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("f.3") PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F3)) |
| r4709 | r4710 | |
| 592 | 700 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("f.1") PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1)) |
| 593 | 701 | |
| 594 | 702 | PORT_MODIFY("KEY8") |
| 595 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 596 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 597 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CAPS LOCK") PORT_CODE(KEYCODE_CAPSLOCK) |
| 598 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR('[') PORT_CHAR('{') |
| 599 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_RALT) PORT_CHAR(']') PORT_CHAR('}') |
| 703 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 704 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 705 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 706 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CAPS LOCK") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE |
| 707 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 600 | 708 | INPUT_PORTS_END |
| 601 | 709 | |
| 602 | 710 | static INPUT_PORTS_START( olivm10 ) |
| r4709 | r4710 | |
| 682 | 790 | |
| 683 | 791 | PORT_START("KEY8") |
| 684 | 792 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("PAUSE BREAK") PORT_CODE(KEYCODE_F12) PORT_CHAR(UCHAR_MAMEKEY(F12)) |
| 685 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CAPS LOCK") PORT_CODE(KEYCODE_CAPSLOCK) |
| 793 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CAPS LOCK") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE |
| 686 | 794 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("NUM") PORT_CODE(KEYCODE_RALT) PORT_CHAR(UCHAR_MAMEKEY(RALT)) |
| 687 | 795 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("GRAPH") PORT_CODE(KEYCODE_LALT) PORT_CHAR(UCHAR_MAMEKEY(LALT)) |
| 688 | 796 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) |
| r4709 | r4710 | |
| 715 | 823 | |
| 716 | 824 | /* 8155 Interface */ |
| 717 | 825 | |
| 718 | | static READ8_DEVICE_HANDLER( kyocera_8155_port_c_r ) |
| 826 | static READ8_DEVICE_HANDLER( kc85_8155_port_c_r ) |
| 719 | 827 | { |
| 720 | 828 | /* |
| 721 | 829 | |
| r4709 | r4710 | |
| 741 | 849 | return data; |
| 742 | 850 | } |
| 743 | 851 | |
| 744 | | static WRITE8_DEVICE_HANDLER( kyocera_8155_port_a_w ) |
| 852 | static WRITE8_DEVICE_HANDLER( kc85_8155_port_a_w ) |
| 745 | 853 | { |
| 746 | 854 | /* |
| 747 | 855 | |
| r4709 | r4710 | |
| 781 | 889 | upd1990a_data_w(state->upd1990a, BIT(data, 4)); |
| 782 | 890 | } |
| 783 | 891 | |
| 784 | | static WRITE8_DEVICE_HANDLER( kyocera_8155_port_b_w ) |
| 892 | static WRITE8_DEVICE_HANDLER( kc85_8155_port_b_w ) |
| 785 | 893 | { |
| 786 | 894 | /* |
| 787 | 895 | |
| r4709 | r4710 | |
| 814 | 922 | if (state->buzzer) speaker_level_w(state->speaker, state->bell); |
| 815 | 923 | } |
| 816 | 924 | |
| 817 | | static WRITE_LINE_DEVICE_HANDLER( kyocera_8155_to_w ) |
| 925 | static WRITE_LINE_DEVICE_HANDLER( kc85_8155_to_w ) |
| 818 | 926 | { |
| 819 | 927 | kc85_state *driver_state = device->machine->driver_data; |
| 820 | 928 | |
| r4709 | r4710 | |
| 824 | 932 | } |
| 825 | 933 | } |
| 826 | 934 | |
| 827 | | static PIO8155_INTERFACE( kyocera_8155_intf ) |
| 935 | static PIO8155_INTERFACE( kc85_8155_intf ) |
| 828 | 936 | { |
| 829 | 937 | DEVCB_NULL, /* port A read */ |
| 830 | 938 | DEVCB_NULL, /* port B read */ |
| 831 | | DEVCB_HANDLER(kyocera_8155_port_c_r), /* port C read */ |
| 832 | | DEVCB_HANDLER(kyocera_8155_port_a_w), /* port A write */ |
| 833 | | DEVCB_HANDLER(kyocera_8155_port_b_w), /* port B write */ |
| 939 | DEVCB_HANDLER(kc85_8155_port_c_r), /* port C read */ |
| 940 | DEVCB_HANDLER(kc85_8155_port_a_w), /* port A write */ |
| 941 | DEVCB_HANDLER(kc85_8155_port_b_w), /* port B write */ |
| 834 | 942 | DEVCB_NULL, /* port C write */ |
| 835 | | DEVCB_LINE(kyocera_8155_to_w) /* timer output */ |
| 943 | DEVCB_LINE(kc85_8155_to_w) /* timer output */ |
| 836 | 944 | }; |
| 837 | 945 | |
| 946 | static READ8_DEVICE_HANDLER( pc8201_8155_port_c_r ) |
| 947 | { |
| 948 | /* |
| 949 | |
| 950 | bit signal description |
| 951 | |
| 952 | 0 CDI clock data input |
| 953 | 1 SLCT _BUSY signal from printer |
| 954 | 2 BUSY BUSY signal from printer |
| 955 | 3 BCR bar code reader data input |
| 956 | 4 _CTS RS232 clear to send input |
| 957 | 5 _DSR RS232 DSR input |
| 958 | |
| 959 | */ |
| 960 | |
| 961 | kc85_state *state = device->machine->driver_data; |
| 962 | |
| 963 | UINT8 data = 0; |
| 964 | |
| 965 | data |= state->upd1990a_data; |
| 966 | data |= centronics_not_busy_r(state->centronics) << 1; |
| 967 | data |= centronics_busy_r(state->centronics) << 2; |
| 968 | |
| 969 | return data; |
| 970 | } |
| 971 | |
| 972 | static WRITE8_DEVICE_HANDLER( pc8201_8155_port_b_w ) |
| 973 | { |
| 974 | /* |
| 975 | |
| 976 | bit signal description |
| 977 | |
| 978 | 0 LCD chip select 8, key scan 8 |
| 979 | 1 LCD chip select 9 |
| 980 | 2 _MC memory control output ? |
| 981 | 3 DCD/_RD RS232 DCD/_RD select |
| 982 | 4 AP0 auto power off output |
| 983 | 5 BELL buzzer output (0=ring, 1=not ring) |
| 984 | 6 _DTR RS232 data terminal ready output |
| 985 | 7 _RTS RS232 request to send output |
| 986 | |
| 987 | */ |
| 988 | |
| 989 | kc85_state *state = device->machine->driver_data; |
| 990 | |
| 991 | /* keyboard */ |
| 992 | state->keylatch = (BIT(data, 0) << 8) | (state->keylatch & 0xff); |
| 993 | |
| 994 | /* LCD */ |
| 995 | state->lcd_cs2[8] = BIT(data, 0); |
| 996 | state->lcd_cs2[9] = BIT(data, 1); |
| 997 | |
| 998 | /* beeper */ |
| 999 | state->buzzer = BIT(data, 2); |
| 1000 | state->bell = BIT(data, 5); |
| 1001 | |
| 1002 | if (state->buzzer) speaker_level_w(state->speaker, state->bell); |
| 1003 | } |
| 1004 | |
| 1005 | |
| 1006 | static PIO8155_INTERFACE( pc8201_8155_intf ) |
| 1007 | { |
| 1008 | DEVCB_NULL, /* port A read */ |
| 1009 | DEVCB_NULL, /* port B read */ |
| 1010 | DEVCB_HANDLER(pc8201_8155_port_c_r), /* port C read */ |
| 1011 | DEVCB_HANDLER(kc85_8155_port_a_w), /* port A write */ |
| 1012 | DEVCB_HANDLER(pc8201_8155_port_b_w), /* port B write */ |
| 1013 | DEVCB_NULL, /* port C write */ |
| 1014 | DEVCB_LINE(kc85_8155_to_w) /* timer output */ |
| 1015 | }; |
| 1016 | |
| 838 | 1017 | static READ8_DEVICE_HANDLER( tandy200_8155_port_c_r ) |
| 839 | 1018 | { |
| 840 | 1019 | /* |
| r4709 | r4710 | |
| 996 | 1175 | |
| 997 | 1176 | /* configure ROM banking */ |
| 998 | 1177 | memory_configure_bank(machine, 1, 0, 1, memory_region(machine, I8085_TAG), 0); |
| 999 | | memory_configure_bank(machine, 1, 1, 1, memory_region(machine, "ext"), 0); |
| 1178 | memory_configure_bank(machine, 1, 1, 1, memory_region(machine, "option"), 0); |
| 1000 | 1179 | memory_configure_bank(machine, 1, 2, 2, mess_ram + 0x8000, 0x8000); |
| 1001 | 1180 | memory_set_bank(machine, 1, 0); |
| 1002 | 1181 | |
| r4709 | r4710 | |
| 1013 | 1192 | state_save_register_global(machine, state->keylatch); |
| 1014 | 1193 | state_save_register_global(machine, state->buzzer); |
| 1015 | 1194 | state_save_register_global(machine, state->bell); |
| 1195 | state_save_register_global(machine, state->iosel); |
| 1016 | 1196 | } |
| 1017 | 1197 | |
| 1018 | 1198 | static MACHINE_START( trsm100 ) |
| r4709 | r4710 | |
| 1150 | 1330 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 1151 | 1331 | |
| 1152 | 1332 | /* devices */ |
| 1153 | | MDRV_PIO8155_ADD(PIO8155_TAG, XTAL_4_9152MHz/2, kyocera_8155_intf) |
| 1333 | MDRV_PIO8155_ADD(PIO8155_TAG, XTAL_4_9152MHz/2, kc85_8155_intf) |
| 1154 | 1334 | MDRV_UPD1990A_ADD(UPD1990A_TAG, XTAL_32_768kHz, kyocera_upd1990a_intf) |
| 1155 | 1335 | |
| 1156 | 1336 | /* printer */ |
| r4709 | r4710 | |
| 1185 | 1365 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 1186 | 1366 | |
| 1187 | 1367 | /* devices */ |
| 1188 | | MDRV_PIO8155_ADD(PIO8155_TAG, XTAL_4_9152MHz/2, kyocera_8155_intf) |
| 1368 | MDRV_PIO8155_ADD(PIO8155_TAG, XTAL_4_9152MHz/2, pc8201_8155_intf) |
| 1189 | 1369 | MDRV_UPD1990A_ADD(UPD1990A_TAG, XTAL_32_768kHz, kyocera_upd1990a_intf) |
| 1190 | 1370 | |
| 1191 | 1371 | /* printer */ |
| r4709 | r4710 | |
| 1258 | 1438 | |
| 1259 | 1439 | ROM_START( npc8201a ) |
| 1260 | 1440 | ROM_REGION( 0x10000, I8085_TAG, 0 ) |
| 1261 | | ROM_LOAD( "pc8201rom.bin", 0x0000, 0x8000, BAD_DUMP CRC(4c534662) SHA1(758fefbba251513e7f9d86f7e9016ad8817188d8) ) /* Y2K hacked */ |
| 1441 | ROM_LOAD( "pc8201rom.rom0", 0x0000, 0x8000, BAD_DUMP CRC(4c534662) SHA1(758fefbba251513e7f9d86f7e9016ad8817188d8) ) /* Y2K hacked, good crc32 30555035 */ |
| 1262 | 1442 | |
| 1263 | | ROM_REGION( 0x8000, "ext", ROMREGION_ERASEFF ) |
| 1443 | ROM_REGION( 0x8000, "option", ROMREGION_ERASEFF ) |
| 1264 | 1444 | ROM_CART_LOAD("cart", 0x0000, 0x8000, ROM_NOMIRROR | ROM_OPTIONAL) |
| 1265 | 1445 | ROM_END |
| 1266 | 1446 | |
| r4709 | r4710 | |
| 1332 | 1512 | /* System Drivers */ |
| 1333 | 1513 | |
| 1334 | 1514 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME */ |
| 1335 | | COMP( 1983, kc85, 0, 0, kc85, kc85, 0, kc85, "Kyocera", "Kyotronic 85 (Japan)", 0 ) |
| 1515 | COMP( 1983, kc85, 0, 0, kc85, kc85, 0, kc85, "Kyosei", "Kyotronic 85 (Japan)", 0 ) |
| 1336 | 1516 | COMP( 1983, olivm10, kc85, 0, kc85, olivm10, 0, kc85, "Olivetti", "M-10", 0 ) |
| 1337 | 1517 | //COMP( 1983, olivm10m, kc85, 0, kc85, olivm10, 0, kc85, "Olivetti", "M-10 Modem (US)", 0 ) |
| 1338 | 1518 | COMP( 1983, trsm100, 0, 0, trsm100, kc85, 0, trsm100, "Tandy Radio Shack", "TRS-80 Model 100", 0 ) |