trunk/src/mess/machine/tf20.c
| r26920 | r26921 | |
| 7 | 7 | |
| 8 | 8 | Dual 5.25" floppy drive with HX-20 factory option |
| 9 | 9 | |
| 10 | | Status: Issues with new uPD765, missing uPD7201 emulation. |
| 10 | Status: Needs testing. |
| 11 | 11 | |
| 12 | 12 | http://fjkraan.home.xs4all.nl/comp/tf20/index.html |
| 13 | 13 | |
| r26920 | r26921 | |
| 25 | 25 | |
| 26 | 26 | const device_type EPSON_TF20 = &device_creator<epson_tf20_device>; |
| 27 | 27 | |
| 28 | | |
| 29 | 28 | //------------------------------------------------- |
| 30 | 29 | // address maps |
| 31 | 30 | //------------------------------------------------- |
| r26920 | r26921 | |
| 45 | 44 | AM_RANGE(0xfa, 0xfb) AM_DEVICE("5a", upd765a_device, map) |
| 46 | 45 | ADDRESS_MAP_END |
| 47 | 46 | |
| 48 | | |
| 49 | 47 | //------------------------------------------------- |
| 50 | 48 | // rom_region - device-specific ROM region |
| 51 | 49 | //------------------------------------------------- |
| r26920 | r26921 | |
| 60 | 58 | return ROM_NAME( tf20 ); |
| 61 | 59 | } |
| 62 | 60 | |
| 63 | | |
| 64 | 61 | //------------------------------------------------- |
| 65 | 62 | // input_ports - device-specific input ports |
| 66 | 63 | //------------------------------------------------- |
| 67 | 64 | |
| 68 | 65 | INPUT_PORTS_START( tf20 ) |
| 69 | 66 | PORT_START("tf20_dip") |
| 70 | | PORT_DIPNAME(0x0f, 0x0f, "Drive extension") |
| 71 | | PORT_DIPLOCATION("TF-20 TFX:8,7,6,5") |
| 72 | | PORT_DIPSETTING(0x0f, "A & B Drive") |
| 73 | | PORT_DIPSETTING(0x07, "C & D Drive") |
| 67 | PORT_DIPNAME(0x0f, 0x00, "Drive extension") |
| 68 | PORT_DIPLOCATION("TF-20:8,7,6,5") |
| 69 | PORT_DIPSETTING(0x00, "A & B Drive") |
| 70 | PORT_DIPSETTING(0x01, "C & D Drive") |
| 74 | 71 | INPUT_PORTS_END |
| 75 | 72 | |
| 76 | 73 | ioport_constructor epson_tf20_device::device_input_ports() const |
| r26920 | r26921 | |
| 78 | 75 | return INPUT_PORTS_NAME( tf20 ); |
| 79 | 76 | } |
| 80 | 77 | |
| 81 | | |
| 82 | 78 | //------------------------------------------------- |
| 83 | 79 | // machine_config_additions - device-specific |
| 84 | 80 | // machine configurations |
| r26920 | r26921 | |
| 86 | 82 | |
| 87 | 83 | static UPD7201_INTERFACE( tf20_upd7201_intf ) |
| 88 | 84 | { |
| 89 | | XTAL_CR2 / 128, XTAL_CR2 / 128, XTAL_CR2 / 128, XTAL_CR2 / 128, |
| 85 | 0, 0, 0, 0, |
| 90 | 86 | |
| 87 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, epson_tf20_device, txda_w), |
| 88 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, epson_tf20_device, dtra_w), |
| 91 | 89 | DEVCB_NULL, |
| 92 | 90 | DEVCB_NULL, |
| 93 | 91 | DEVCB_NULL, |
| 94 | | DEVCB_NULL, |
| 95 | | DEVCB_NULL, |
| 96 | 92 | |
| 97 | 93 | DEVCB_NULL, |
| 98 | 94 | DEVCB_NULL, |
| r26920 | r26921 | |
| 132 | 128 | |
| 133 | 129 | // serial interface to another device |
| 134 | 130 | MCFG_EPSON_SIO_ADD("sio", NULL) |
| 131 | MCFG_EPSON_SIO_RX(DEVWRITELINE(DEVICE_SELF, epson_tf20_device, rxc_w)) |
| 132 | MCFG_EPSON_SIO_PIN(DEVWRITELINE(DEVICE_SELF, epson_tf20_device, pinc_w)) |
| 135 | 133 | MACHINE_CONFIG_END |
| 136 | 134 | |
| 137 | 135 | machine_config_constructor epson_tf20_device::device_mconfig_additions() const |
| r26920 | r26921 | |
| 155 | 153 | m_ram(*this, "ram"), |
| 156 | 154 | m_fdc(*this, "5a"), |
| 157 | 155 | m_mpsc(*this, "3a"), |
| 158 | | m_sio(*this, "sio") |
| 156 | m_sio_output(*this, "sio"), |
| 157 | m_rxc(1) |
| 159 | 158 | { |
| 159 | m_sio_input = dynamic_cast<epson_sio_device *>(owner); |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | | |
| 163 | 162 | //------------------------------------------------- |
| 164 | 163 | // device_start - device-specific startup |
| 165 | 164 | //------------------------------------------------- |
| r26920 | r26921 | |
| 185 | 184 | |
| 186 | 185 | } |
| 187 | 186 | |
| 188 | | |
| 189 | 187 | //------------------------------------------------- |
| 190 | 188 | // device_reset - device-specific reset |
| 191 | 189 | //------------------------------------------------- |
| r26920 | r26921 | |
| 193 | 191 | void epson_tf20_device::device_reset() |
| 194 | 192 | { |
| 195 | 193 | // init timers |
| 196 | | m_timer_serial->adjust(attotime::from_hz(XTAL_CR2 / 128), 0, attotime::from_hz(XTAL_CR2 / 128)); |
| 194 | m_timer_serial->adjust(attotime::zero, 0, attotime::from_hz(XTAL_CR2 / 8)); |
| 197 | 195 | m_timer_tc->adjust(attotime::never); |
| 198 | 196 | |
| 197 | m_mpsc->rxa_w(1); |
| 198 | m_mpsc->rxb_w(1); |
| 199 | |
| 199 | 200 | // enable rom |
| 200 | 201 | m_cpu->space(AS_PROGRAM).install_rom(0x0000, 0x07ff, 0, 0x7800, memregion("rom")->base()); |
| 201 | 202 | } |
| 202 | 203 | |
| 203 | | |
| 204 | 204 | //------------------------------------------------- |
| 205 | 205 | // device_timer - handler timer events |
| 206 | 206 | //------------------------------------------------- |
| r26920 | r26921 | |
| 211 | 211 | { |
| 212 | 212 | case 0: |
| 213 | 213 | m_mpsc->rxca_w(1); |
| 214 | m_mpsc->rxca_w(0); |
| 214 | 215 | m_mpsc->txca_w(1); |
| 216 | m_mpsc->txca_w(0); |
| 215 | 217 | m_mpsc->rxcb_w(1); |
| 218 | m_mpsc->rxcb_w(0); |
| 216 | 219 | m_mpsc->txcb_w(1); |
| 220 | m_mpsc->txcb_w(0); |
| 217 | 221 | break; |
| 218 | 222 | |
| 219 | 223 | case 1: |
| r26920 | r26921 | |
| 224 | 228 | } |
| 225 | 229 | |
| 226 | 230 | |
| 231 | //************************************************************************** |
| 232 | // CPU & MEMORY |
| 233 | //************************************************************************** |
| 234 | |
| 227 | 235 | //------------------------------------------------- |
| 228 | 236 | // irq vector callback |
| 229 | 237 | //------------------------------------------------- |
| r26920 | r26921 | |
| 233 | 241 | return 0x00; |
| 234 | 242 | } |
| 235 | 243 | |
| 244 | // a read from this location disables the rom |
| 245 | READ8_MEMBER( epson_tf20_device::rom_disable_r ) |
| 246 | { |
| 247 | // switch in ram |
| 248 | m_cpu->space(AS_PROGRAM).install_ram(0x0000, 0x7fff, m_ram->pointer()); |
| 249 | return 0xff; |
| 250 | } |
| 236 | 251 | |
| 252 | |
| 253 | //************************************************************************** |
| 254 | // FLOPPY DISK CONTROLLER |
| 255 | //************************************************************************** |
| 256 | |
| 237 | 257 | //------------------------------------------------- |
| 238 | 258 | // fdc interrupt |
| 239 | 259 | //------------------------------------------------- |
| r26920 | r26921 | |
| 243 | 263 | m_cpu->set_input_line(INPUT_LINE_IRQ0, state ? ASSERT_LINE : CLEAR_LINE); |
| 244 | 264 | } |
| 245 | 265 | |
| 266 | READ8_MEMBER( epson_tf20_device::upd765_tc_r ) |
| 267 | { |
| 268 | logerror("%s: upd765_tc_r\n", space.machine().describe_context()); |
| 246 | 269 | |
| 247 | | //------------------------------------------------- |
| 248 | | // tx_w |
| 249 | | //------------------------------------------------- |
| 270 | // toggle tc on read |
| 271 | m_fdc->tc_w(true); |
| 272 | m_timer_tc->adjust(attotime::zero); |
| 250 | 273 | |
| 251 | | void epson_tf20_device::tx_w(int level) |
| 274 | return 0xff; |
| 275 | } |
| 276 | |
| 277 | WRITE8_MEMBER( epson_tf20_device::fdc_control_w ) |
| 252 | 278 | { |
| 253 | | logerror("%s: tx_w(%d)\n", tag(), level); |
| 254 | | //m_mpsc->rxda_w(level); |
| 279 | logerror("%s: tf20_fdc_control_w(%02x)\n", space.machine().describe_context(), data); |
| 280 | |
| 281 | // bit 0, motor on signal |
| 282 | m_fd0->mon_w(!BIT(data, 0)); |
| 283 | m_fd1->mon_w(!BIT(data, 0)); |
| 255 | 284 | } |
| 256 | 285 | |
| 257 | 286 | |
| 287 | //************************************************************************** |
| 288 | // SIO INTERFACE |
| 289 | //************************************************************************** |
| 290 | |
| 258 | 291 | //------------------------------------------------- |
| 259 | | // pout_w |
| 292 | // rxc_w - rx input |
| 260 | 293 | //------------------------------------------------- |
| 261 | 294 | |
| 262 | | void epson_tf20_device::pout_w(int level) |
| 295 | WRITE_LINE_MEMBER( epson_tf20_device::rxc_w ) |
| 263 | 296 | { |
| 264 | | logerror("%s: pout_w(%d)\n", tag(), level); |
| 265 | | m_mpsc->ctsa_w(level); |
| 297 | m_rxc = state; |
| 298 | m_sio_input->rx_w(m_txda & m_rxc); |
| 266 | 299 | } |
| 267 | 300 | |
| 268 | | |
| 269 | 301 | //------------------------------------------------- |
| 270 | | // rx_r |
| 302 | // pinc_w - pin input |
| 271 | 303 | //------------------------------------------------- |
| 272 | 304 | |
| 273 | | int epson_tf20_device::rx_r() |
| 305 | WRITE_LINE_MEMBER( epson_tf20_device::pinc_w ) |
| 274 | 306 | { |
| 275 | | logerror("%s: rx_r\n", tag()); |
| 276 | | return 1;//m_mpsc->txda_r(); |
| 307 | m_pinc = state; |
| 308 | m_sio_input->pin_w(!m_dtra | m_pinc); |
| 277 | 309 | } |
| 278 | 310 | |
| 279 | | |
| 280 | 311 | //------------------------------------------------- |
| 281 | | // pin_r |
| 312 | // txda_w - rx output |
| 282 | 313 | //------------------------------------------------- |
| 283 | 314 | |
| 284 | | int epson_tf20_device::pin_r() |
| 315 | WRITE_LINE_MEMBER( epson_tf20_device::txda_w ) |
| 285 | 316 | { |
| 286 | | logerror("%s: pin_r\n", tag()); |
| 287 | | return 1;//m_mpsc->dtra_r(); |
| 317 | m_txda = state; |
| 318 | m_sio_input->rx_w(m_txda & m_rxc); |
| 288 | 319 | } |
| 289 | 320 | |
| 321 | //------------------------------------------------- |
| 322 | // dtra_w - pin output |
| 323 | //------------------------------------------------- |
| 290 | 324 | |
| 291 | | // a read from this location disables the rom |
| 292 | | READ8_MEMBER( epson_tf20_device::rom_disable_r ) |
| 325 | WRITE_LINE_MEMBER( epson_tf20_device::dtra_w ) |
| 293 | 326 | { |
| 294 | | // switch in ram |
| 295 | | m_cpu->space(AS_PROGRAM).install_ram(0x0000, 0x7fff, m_ram->pointer()); |
| 296 | | return 0xff; |
| 327 | m_dtra = state; |
| 328 | m_sio_input->pin_w(!m_dtra | m_pinc); |
| 297 | 329 | } |
| 298 | 330 | |
| 331 | //------------------------------------------------- |
| 332 | // tx_w - tx input |
| 333 | //------------------------------------------------- |
| 299 | 334 | |
| 300 | | READ8_MEMBER( epson_tf20_device::upd765_tc_r ) |
| 335 | void epson_tf20_device::tx_w(int level) |
| 301 | 336 | { |
| 302 | | logerror("%s: upd765_tc_r\n", space.machine().describe_context()); |
| 303 | | |
| 304 | | // toggle tc on read |
| 305 | | m_fdc->tc_w(true); |
| 306 | | m_timer_tc->adjust(attotime::zero); |
| 307 | | |
| 308 | | return 0xff; |
| 337 | m_mpsc->rxa_w(level); |
| 338 | m_sio_output->tx_w(level); |
| 309 | 339 | } |
| 310 | 340 | |
| 341 | //------------------------------------------------- |
| 342 | // pout_w - pout input |
| 343 | //------------------------------------------------- |
| 311 | 344 | |
| 312 | | WRITE8_MEMBER( epson_tf20_device::fdc_control_w ) |
| 345 | void epson_tf20_device::pout_w(int level) |
| 313 | 346 | { |
| 314 | | logerror("%s: tf20_fdc_control_w(%02x)\n", space.machine().describe_context(), data); |
| 315 | | |
| 316 | | // bit 0, motor on signal |
| 317 | | m_fd0->mon_w(!BIT(data, 0)); |
| 318 | | m_fd1->mon_w(!BIT(data, 0)); |
| 347 | m_mpsc->ctsa_w(!level); |
| 348 | m_sio_output->pout_w(level); |
| 319 | 349 | } |
trunk/src/mess/machine/epson_sio.h
| r26920 | r26921 | |
| 23 | 23 | MCFG_DEVICE_ADD(_tag, EPSON_SIO, 0) \ |
| 24 | 24 | MCFG_DEVICE_SLOT_INTERFACE(epson_sio_devices, _def_slot, false) |
| 25 | 25 | |
| 26 | #define MCFG_EPSON_SIO_RX(_rx) \ |
| 27 | downcast<epson_sio_device *>(device)->set_rx_callback(DEVCB2_##_rx); |
| 26 | 28 | |
| 29 | #define MCFG_EPSON_SIO_PIN(_pin) \ |
| 30 | downcast<epson_sio_device *>(device)->set_pin_callback(DEVCB2_##_pin); |
| 31 | |
| 32 | |
| 27 | 33 | //************************************************************************** |
| 28 | 34 | // TYPE DEFINITIONS |
| 29 | 35 | //************************************************************************** |
| r26920 | r26921 | |
| 39 | 45 | epson_sio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 40 | 46 | virtual ~epson_sio_device(); |
| 41 | 47 | |
| 42 | | DECLARE_READ_LINE_MEMBER(rx_r); |
| 43 | | DECLARE_READ_LINE_MEMBER(pin_r); |
| 48 | // callbacks |
| 49 | template<class _rx> void set_rx_callback(_rx rx) { m_write_rx.set_callback(rx); } |
| 50 | template<class _pin> void set_pin_callback(_pin pin) { m_write_pin.set_callback(pin); } |
| 44 | 51 | |
| 45 | | DECLARE_WRITE_LINE_MEMBER(tx_w); |
| 46 | | DECLARE_WRITE_LINE_MEMBER(pout_w); |
| 52 | // called from owner |
| 53 | DECLARE_WRITE_LINE_MEMBER( tx_w ); |
| 54 | DECLARE_WRITE_LINE_MEMBER( pout_w ); |
| 47 | 55 | |
| 56 | // called from subdevice |
| 57 | DECLARE_WRITE_LINE_MEMBER( rx_w ) { m_write_rx(state); } |
| 58 | DECLARE_WRITE_LINE_MEMBER( pin_w ) { m_write_pin(state); } |
| 59 | |
| 48 | 60 | protected: |
| 49 | 61 | // device-level overrides |
| 50 | 62 | virtual void device_start(); |
| 51 | 63 | virtual void device_reset(); |
| 52 | 64 | |
| 53 | 65 | device_epson_sio_interface *m_cart; |
| 66 | |
| 67 | private: |
| 68 | devcb2_write_line m_write_rx; |
| 69 | devcb2_write_line m_write_pin; |
| 54 | 70 | }; |
| 55 | 71 | |
| 56 | 72 | |
| r26920 | r26921 | |
| 62 | 78 | device_epson_sio_interface(const machine_config &mconfig, device_t &device); |
| 63 | 79 | virtual ~device_epson_sio_interface(); |
| 64 | 80 | |
| 65 | | virtual int rx_r() { return 1; }; |
| 66 | | virtual int pin_r() { return 1; }; |
| 67 | | |
| 68 | 81 | virtual void tx_w(int state) { }; |
| 69 | 82 | virtual void pout_w(int state) { }; |
| 70 | 83 | |
trunk/src/mess/drivers/px4.c
| r26920 | r26921 | |
| 127 | 127 | UINT8 m_artcr; |
| 128 | 128 | UINT8 m_swr; |
| 129 | 129 | |
| 130 | | int rxd_r(); |
| 131 | 130 | void txd_w(int data); |
| 132 | 131 | |
| 133 | 132 | // 7508 internal |
| r26920 | r26921 | |
| 156 | 155 | |
| 157 | 156 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 158 | 157 | |
| 159 | | DECLARE_WRITE_LINE_MEMBER( serial_rx_w ); |
| 160 | | DECLARE_WRITE_LINE_MEMBER( serial_dcd_w ); |
| 161 | | DECLARE_WRITE_LINE_MEMBER( serial_dsr_w ); |
| 162 | | DECLARE_WRITE_LINE_MEMBER( serial_cts_w ); |
| 158 | DECLARE_WRITE_LINE_MEMBER( sio_rx_w ); |
| 159 | DECLARE_WRITE_LINE_MEMBER( sio_pin_w ); |
| 163 | 160 | |
| 161 | DECLARE_WRITE_LINE_MEMBER( rs232_rx_w ); |
| 162 | DECLARE_WRITE_LINE_MEMBER( rs232_dcd_w ); |
| 163 | DECLARE_WRITE_LINE_MEMBER( rs232_dsr_w ); |
| 164 | DECLARE_WRITE_LINE_MEMBER( rs232_cts_w ); |
| 165 | |
| 166 | int m_sio_pin; |
| 167 | |
| 164 | 168 | int m_rs232_dcd; |
| 165 | 169 | int m_rs232_cts; |
| 166 | 170 | |
| r26920 | r26921 | |
| 208 | 212 | TIMER_CALLBACK_MEMBER(receive_data); |
| 209 | 213 | TIMER_DEVICE_CALLBACK_MEMBER(frc_tick); |
| 210 | 214 | TIMER_DEVICE_CALLBACK_MEMBER(upd7508_1sec_callback); |
| 215 | |
| 216 | private: |
| 217 | DECLARE_WRITE_LINE_MEMBER( serial_rx_w ); |
| 211 | 218 | }; |
| 212 | 219 | |
| 213 | 220 | |
| r26920 | r26921 | |
| 411 | 418 | // status register |
| 412 | 419 | READ8_MEMBER( px4_state::px4_str_r ) |
| 413 | 420 | { |
| 414 | | UINT8 result = 0; |
| 421 | UINT8 data = 0; |
| 415 | 422 | |
| 416 | | if (VERBOSE) |
| 423 | if (0) |
| 417 | 424 | logerror("%s: px4_str_r\n", machine().describe_context()); |
| 418 | 425 | |
| 419 | | result |= (m_ext_cas)->input() > 0 ? 1 : 0; |
| 420 | | result |= 1 << 1; // BCRD, barcode reader input |
| 421 | | result |= 1 << 2; // RDY signal from 7805 |
| 422 | | result |= 1 << 3; // RDYSIO, enable access to the 7805 |
| 423 | | result |= m_bankr & 0xf0; // bit 4-7, BANK - memory bank |
| 426 | data |= (m_ext_cas)->input() > 0 ? 1 : 0; |
| 427 | data |= 1 << 1; // BCRD, barcode reader input |
| 428 | data |= 1 << 2; // RDY signal from 7805 |
| 429 | data |= 1 << 3; // RDYSIO, enable access to the 7805 |
| 430 | data |= m_bankr & 0xf0; // bit 4-7, BANK - memory bank |
| 424 | 431 | |
| 425 | | return result; |
| 432 | return data; |
| 426 | 433 | } |
| 427 | 434 | |
| 428 | 435 | // helper function to map rom capsules |
| r26920 | r26921 | |
| 670 | 677 | input_callback(m_input_state & ~RX); |
| 671 | 678 | } |
| 672 | 679 | |
| 673 | | WRITE_LINE_MEMBER( px4_state::serial_dcd_w ) |
| 680 | WRITE_LINE_MEMBER( px4_state::sio_rx_w ) |
| 674 | 681 | { |
| 682 | if (!BIT(m_swr, 3) && BIT(m_swr, 2)) |
| 683 | serial_rx_w(state); |
| 684 | } |
| 685 | |
| 686 | WRITE_LINE_MEMBER( px4_state::sio_pin_w ) |
| 687 | { |
| 688 | m_sio_pin = state; |
| 689 | } |
| 690 | |
| 691 | WRITE_LINE_MEMBER( px4_state::rs232_rx_w ) |
| 692 | { |
| 693 | if (BIT(m_swr, 3)) |
| 694 | serial_rx_w(state); |
| 695 | } |
| 696 | |
| 697 | WRITE_LINE_MEMBER( px4_state::rs232_dcd_w ) |
| 698 | { |
| 675 | 699 | m_rs232_dcd = state; |
| 676 | 700 | } |
| 677 | 701 | |
| 678 | | WRITE_LINE_MEMBER( px4_state::serial_dsr_w ) |
| 702 | WRITE_LINE_MEMBER( px4_state::rs232_dsr_w ) |
| 679 | 703 | { |
| 680 | 704 | m_artsr |= !state << 7; |
| 681 | 705 | } |
| 682 | 706 | |
| 683 | | WRITE_LINE_MEMBER( px4_state::serial_cts_w ) |
| 707 | WRITE_LINE_MEMBER( px4_state::rs232_cts_w ) |
| 684 | 708 | { |
| 685 | 709 | m_rs232_cts = state; |
| 686 | 710 | } |
| r26920 | r26921 | |
| 760 | 784 | m_input_state = state; |
| 761 | 785 | } |
| 762 | 786 | |
| 763 | | // helper function to read from selected serial port |
| 764 | | int px4_state::rxd_r() |
| 765 | | { |
| 766 | | if (BIT(m_swr, 3)) |
| 767 | | // from rs232 |
| 768 | | return get_in_data_bit(); |
| 769 | | else |
| 770 | | if (BIT(m_swr, 2)) |
| 771 | | // from sio |
| 772 | | return m_sio->rx_r(); |
| 773 | | else |
| 774 | | // from cartridge |
| 775 | | return 0; |
| 776 | | } |
| 777 | | |
| 778 | 787 | // helper function to write to selected serial port |
| 779 | 788 | void px4_state::txd_w(int data) |
| 780 | 789 | { |
| 781 | 790 | if (BIT(m_swr, 2)) |
| 782 | | // from sio |
| 791 | // to sio |
| 783 | 792 | m_sio->tx_w(data); |
| 784 | 793 | else |
| 785 | 794 | if (BIT(m_swr, 3)) |
| 786 | | // from rs232 |
| 795 | // to rs232 |
| 787 | 796 | m_rs232->tx(data); |
| 788 | 797 | // else to cartridge |
| 789 | 798 | } |
| r26920 | r26921 | |
| 808 | 817 | READ8_MEMBER( px4_state::px4_artdir_r ) |
| 809 | 818 | { |
| 810 | 819 | if (VERBOSE) |
| 811 | | logerror("%s: px4_artdir_r\n", machine().describe_context()); |
| 820 | logerror("%s: px4_artdir_r (%02x)\n", machine().describe_context(), m_artdir); |
| 812 | 821 | |
| 813 | 822 | // clear ready |
| 814 | 823 | m_artsr &= ~ART_RXRDY; |
| r26920 | r26921 | |
| 873 | 882 | data |= !m_centronics->pe_r() << 1; |
| 874 | 883 | |
| 875 | 884 | // sio status |
| 876 | | data |= !m_sio->pin_r() << 2; |
| 885 | data |= !m_sio_pin << 2; |
| 877 | 886 | |
| 878 | 887 | // serial data |
| 879 | | data |= rxd_r() << 3; |
| 888 | data |= get_in_data_bit() << 3; |
| 880 | 889 | |
| 881 | 890 | // rs232 status |
| 882 | 891 | data |= !m_rs232_dcd << 4; |
| r26920 | r26921 | |
| 886 | 895 | data |= 0 << 7; // bit 7, caud - audio input from cartridge |
| 887 | 896 | |
| 888 | 897 | if (0) |
| 889 | | logerror("%s: px4_iostr_r (%02x)\n", machine().describe_context(), data); |
| 898 | logerror("%s: px4_iostr_r: rx = %d, dcd = %d, cts = %d\n", machine().describe_context(), BIT(data, 3), BIT(data, 4), BIT(data, 5)); |
| 890 | 899 | |
| 891 | | logerror("%s: px4_iostr_r: rx = %d, dcd = %d, cts = %d\n", machine().describe_context(), BIT(data, 3), BIT(data, 4), BIT(data, 5)); |
| 892 | | |
| 893 | 900 | return data; |
| 894 | 901 | } |
| 895 | 902 | |
| r26920 | r26921 | |
| 933 | 940 | m_centronics->strobe_w(!BIT(data, 0)); |
| 934 | 941 | m_centronics->init_prime_w(BIT(data, 1)); |
| 935 | 942 | |
| 936 | | m_sio->pout_w(!BIT(data, 2)); |
| 943 | m_sio->pout_w(BIT(data, 2)); |
| 937 | 944 | |
| 938 | 945 | // bit 3, cartridge reset |
| 939 | 946 | |
| r26920 | r26921 | |
| 1189 | 1196 | PORT_START("dips") |
| 1190 | 1197 | |
| 1191 | 1198 | PORT_DIPNAME(0x0f, 0x0f, "Character set") |
| 1192 | | PORT_DIPLOCATION("DIP:8,7,6,5") |
| 1199 | PORT_DIPLOCATION("PX-4:8,7,6,5") |
| 1193 | 1200 | PORT_DIPSETTING(0x0f, "ASCII") |
| 1194 | 1201 | PORT_DIPSETTING(0x0e, "France") |
| 1195 | 1202 | PORT_DIPSETTING(0x0d, "Germany") |
| r26920 | r26921 | |
| 1202 | 1209 | PORT_DIPSETTING(0x06, "Norway") |
| 1203 | 1210 | |
| 1204 | 1211 | PORT_DIPNAME(0x30, 0x30, "LST device") |
| 1205 | | PORT_DIPLOCATION("DIP:4,3") |
| 1212 | PORT_DIPLOCATION("PX-4:4,3") |
| 1206 | 1213 | PORT_DIPSETTING(0x00, "SIO") |
| 1207 | 1214 | PORT_DIPSETTING(0x10, "Cartridge printer") |
| 1208 | 1215 | PORT_DIPSETTING(0x20, "RS-232C") |
| r26920 | r26921 | |
| 1210 | 1217 | |
| 1211 | 1218 | // available for user applications |
| 1212 | 1219 | PORT_DIPNAME(0x40, 0x40, "Not used") |
| 1213 | | PORT_DIPLOCATION("DIP:2") |
| 1220 | PORT_DIPLOCATION("PX-4:2") |
| 1214 | 1221 | PORT_DIPSETTING(0x40, "Enable") |
| 1215 | 1222 | PORT_DIPSETTING(0x00, "Disable") |
| 1216 | 1223 | |
| 1217 | 1224 | // this is automatically selected by the os, the switch has no effect |
| 1218 | 1225 | PORT_DIPNAME(0x80, 0x00, "Keyboard type") |
| 1219 | | PORT_DIPLOCATION("DIP:1") |
| 1226 | PORT_DIPLOCATION("PX-4:1") |
| 1220 | 1227 | PORT_DIPSETTING(0x80, "Item keyboard") |
| 1221 | 1228 | PORT_DIPSETTING(0x00, "Standard keyboard") |
| 1222 | 1229 | INPUT_PORTS_END |
| r26920 | r26921 | |
| 1398 | 1405 | |
| 1399 | 1406 | // sio port |
| 1400 | 1407 | MCFG_EPSON_SIO_ADD("sio", NULL) |
| 1408 | MCFG_EPSON_SIO_RX(WRITELINE(px4_state, sio_rx_w)) |
| 1409 | MCFG_EPSON_SIO_PIN(WRITELINE(px4_state, sio_pin_w)) |
| 1401 | 1410 | |
| 1402 | 1411 | // rs232 port |
| 1403 | 1412 | MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, NULL) |
| 1404 | | MCFG_SERIAL_OUT_RX_HANDLER(WRITELINE(px4_state, serial_rx_w)) |
| 1405 | | MCFG_RS232_OUT_DCD_HANDLER(WRITELINE(px4_state, serial_dcd_w)) |
| 1406 | | MCFG_RS232_OUT_DSR_HANDLER(WRITELINE(px4_state, serial_dsr_w)) |
| 1407 | | MCFG_RS232_OUT_CTS_HANDLER(WRITELINE(px4_state, serial_cts_w)) |
| 1413 | MCFG_SERIAL_OUT_RX_HANDLER(WRITELINE(px4_state, rs232_rx_w)) |
| 1414 | MCFG_RS232_OUT_DCD_HANDLER(WRITELINE(px4_state, rs232_dcd_w)) |
| 1415 | MCFG_RS232_OUT_DSR_HANDLER(WRITELINE(px4_state, rs232_dsr_w)) |
| 1416 | MCFG_RS232_OUT_CTS_HANDLER(WRITELINE(px4_state, rs232_cts_w)) |
| 1408 | 1417 | |
| 1409 | 1418 | // rom capsules |
| 1410 | 1419 | MCFG_CARTSLOT_ADD("capsule1") |