trunk/src/mess/drivers/px4.c
| r18779 | r18780 | |
| 19 | 19 | #include "px4.lh" |
| 20 | 20 | |
| 21 | 21 | |
| 22 | | /*************************************************************************** |
| 23 | | CONSTANTS |
| 24 | | ***************************************************************************/ |
| 22 | //************************************************************************** |
| 23 | // CONSTANTS |
| 24 | //************************************************************************** |
| 25 | 25 | |
| 26 | | #define VERBOSE 0 |
| 26 | #define VERBOSE 1 |
| 27 | 27 | |
| 28 | | /* interrupt sources */ |
| 29 | | #define INT0_7508 0x01 |
| 30 | | #define INT1_ART 0x02 |
| 31 | | #define INT2_ICF 0x04 |
| 32 | | #define INT3_OVF 0x08 |
| 33 | | #define INT4_EXT 0x10 |
| 28 | // interrupt sources |
| 29 | #define INT0_7508 0x01 |
| 30 | #define INT1_ART 0x02 |
| 31 | #define INT2_ICF 0x04 |
| 32 | #define INT3_OVF 0x08 |
| 33 | #define INT4_EXT 0x10 |
| 34 | 34 | |
| 35 | | /* 7508 interrupt sources */ |
| 36 | | #define UPD7508_INT_ALARM 0x02 |
| 37 | | #define UPD7508_INT_POWER_FAIL 0x04 |
| 38 | | #define UPD7508_INT_7508_RESET 0x08 |
| 39 | | #define UPD7508_INT_Z80_RESET 0x10 |
| 40 | | #define UPD7508_INT_ONE_SECOND 0x20 |
| 35 | // 7508 interrupt sources |
| 36 | #define UPD7508_INT_ALARM 0x02 |
| 37 | #define UPD7508_INT_POWER_FAIL 0x04 |
| 38 | #define UPD7508_INT_7508_RESET 0x08 |
| 39 | #define UPD7508_INT_Z80_RESET 0x10 |
| 40 | #define UPD7508_INT_ONE_SECOND 0x20 |
| 41 | 41 | |
| 42 | | /* art (asynchronous receiver transmitter) */ |
| 43 | | #define ART_TXRDY 0x01 /* output buffer empty */ |
| 44 | | #define ART_RXRDY 0x02 /* data byte received */ |
| 45 | | #define ART_TXEMPTY 0x04 /* transmit buffer empty */ |
| 46 | | #define ART_PE 0x08 /* parity error */ |
| 47 | | #define ART_OE 0x10 /* overrun error */ |
| 48 | | #define ART_FE 0x20 /* framing error */ |
| 42 | // art (asynchronous receiver transmitter) |
| 43 | #define ART_TXRDY 0x01 // output buffer empty |
| 44 | #define ART_RXRDY 0x02 // data byte received |
| 45 | #define ART_TXEMPTY 0x04 // transmit buffer empty |
| 46 | #define ART_PE 0x08 // parity error |
| 47 | #define ART_OE 0x10 // overrun error |
| 48 | #define ART_FE 0x20 // framing error |
| 49 | 49 | |
| 50 | | /* art baud rates */ |
| 50 | // art baud rates |
| 51 | 51 | static const int transmit_rate[] = { 2112, 1536, 768, 384, 192, 96, 48, 24, 192, 3072, 12, 6, 1152 }; |
| 52 | 52 | static const int receive_rate[] = { 2112, 1536, 768, 384, 192, 96, 48, 24, 3072, 192, 12, 6, 1152 }; |
| 53 | 53 | |
| 54 | 54 | |
| 55 | | /*************************************************************************** |
| 56 | | MACROS |
| 57 | | ***************************************************************************/ |
| 55 | //************************************************************************** |
| 56 | // MACROS |
| 57 | //************************************************************************** |
| 58 | 58 | |
| 59 | | #define ART_TX_ENABLED (BIT(m_artcr, 0)) |
| 60 | | #define ART_RX_ENABLED (BIT(px4->m_artcr, 2)) |
| 59 | #define ART_TX_ENABLED (BIT(m_artcr, 0)) |
| 60 | #define ART_RX_ENABLED (BIT(m_artcr, 2)) |
| 61 | 61 | |
| 62 | | #define ART_DATA (BIT(px4->m_artmr, 2)) /* number of data bits, 7 or 8 */ |
| 63 | | #define ART_PEN (BIT(px4->m_artmr, 4)) /* parity enabled */ |
| 64 | | #define ART_EVEN (BIT(px4->m_artmr, 5)) /* even or odd parity */ |
| 65 | | #define ART_STOP (BIT(px4->m_artmr, 7)) /* number of stop bits, 1 or 2 */ |
| 62 | #define ART_DATA (BIT(m_artmr, 2)) // number of data bits, 7 or 8 |
| 63 | #define ART_PEN (BIT(m_artmr, 4)) // parity enabled |
| 64 | #define ART_EVEN (BIT(m_artmr, 5)) // even or odd parity |
| 65 | #define ART_STOP (BIT(m_artmr, 7)) // number of stop bits, 1 or 2 |
| 66 | 66 | |
| 67 | 67 | |
| 68 | | /*************************************************************************** |
| 69 | | TYPE DEFINITIONS |
| 70 | | ***************************************************************************/ |
| 68 | //************************************************************************** |
| 69 | // TYPE DEFINITIONS |
| 70 | //************************************************************************** |
| 71 | 71 | |
| 72 | 72 | class px4_state : public driver_device |
| 73 | 73 | { |
| 74 | 74 | public: |
| 75 | 75 | px4_state(const machine_config &mconfig, device_type type, const char *tag) |
| 76 | | : driver_device(mconfig, type, tag) { } |
| 76 | : driver_device(mconfig, type, tag), |
| 77 | m_z80(*this, "maincpu"), |
| 78 | m_ram(*this, RAM_TAG), |
| 79 | m_centronics(*this, "centronics"), |
| 80 | m_ext_cas(*this, "extcas") |
| 81 | { } |
| 77 | 82 | |
| 78 | | /* internal ram */ |
| 79 | | ram_device *m_ram; |
| 83 | // internal devices |
| 84 | required_device<cpu_device> m_z80; |
| 85 | required_device<ram_device> m_ram; |
| 86 | required_device<centronics_device> m_centronics; |
| 87 | required_device<cassette_image_device> m_ext_cas; |
| 80 | 88 | |
| 81 | 89 | /* gapnit register */ |
| 82 | 90 | UINT8 m_ctrl1; |
| r18779 | r18780 | |
| 95 | 103 | UINT8 m_vadr; |
| 96 | 104 | UINT8 m_yoff; |
| 97 | 105 | |
| 106 | void gapnit_interrupt(); |
| 107 | |
| 98 | 108 | /* gapnio */ |
| 99 | 109 | emu_timer *m_receive_timer; |
| 100 | 110 | emu_timer *m_transmit_timer; |
| r18779 | r18780 | |
| 106 | 116 | UINT8 m_swr; |
| 107 | 117 | |
| 108 | 118 | /* 7508 internal */ |
| 109 | | int m_one_sec_int_enabled; |
| 110 | | int m_alarm_int_enabled; |
| 111 | | int m_key_int_enabled; |
| 119 | bool m_one_sec_int_enabled; |
| 120 | bool m_alarm_int_enabled; |
| 121 | bool m_key_int_enabled; |
| 112 | 122 | |
| 113 | 123 | UINT8 m_key_status; |
| 114 | 124 | UINT8 m_interrupt_status; |
| 115 | 125 | |
| 116 | | /* centronics printer */ |
| 117 | | centronics_device *m_centronics; |
| 118 | | |
| 119 | 126 | /* external ramdisk */ |
| 120 | 127 | offs_t m_ramdisk_address; |
| 121 | 128 | UINT8 *m_ramdisk; |
| 122 | 129 | |
| 123 | 130 | /* external cassette/barcode reader */ |
| 124 | | cassette_image_device *m_ext_cas; |
| 125 | 131 | emu_timer *m_ext_cas_timer; |
| 126 | 132 | int m_ear_last_state; |
| 127 | 133 | |
| 128 | 134 | /* external devices */ |
| 129 | 135 | device_t *m_sio_device; |
| 130 | 136 | device_t *m_rs232c_device; |
| 137 | |
| 138 | void install_rom_capsule(address_space &space, int size, const char *region); |
| 139 | |
| 131 | 140 | DECLARE_READ8_MEMBER(px4_icrlc_r); |
| 132 | 141 | DECLARE_WRITE8_MEMBER(px4_ctrl1_w); |
| 133 | 142 | DECLARE_READ8_MEMBER(px4_icrhc_r); |
| r18779 | r18780 | |
| 172 | 181 | TIMER_CALLBACK_MEMBER(receive_data); |
| 173 | 182 | TIMER_DEVICE_CALLBACK_MEMBER(frc_tick); |
| 174 | 183 | TIMER_DEVICE_CALLBACK_MEMBER(upd7508_1sec_callback); |
| 184 | |
| 175 | 185 | void px4_sio_txd(device_t *device,int state); |
| 176 | 186 | int px4_sio_rxd(device_t *device); |
| 177 | 187 | int px4_sio_pin(device_t *device); |
| r18779 | r18780 | |
| 186 | 196 | }; |
| 187 | 197 | |
| 188 | 198 | |
| 189 | | /*************************************************************************** |
| 190 | | SERIAL PORT |
| 191 | | ***************************************************************************/ |
| 199 | //************************************************************************** |
| 200 | // SERIAL PORT |
| 201 | //************************************************************************** |
| 192 | 202 | |
| 193 | | /* The floppy is connected to this port */ |
| 203 | // The floppy is connected to this port |
| 194 | 204 | |
| 195 | 205 | void px4_state::px4_sio_txd(device_t *device,int state) |
| 196 | 206 | { |
| r18779 | r18780 | |
| 233 | 243 | } |
| 234 | 244 | |
| 235 | 245 | |
| 236 | | /*************************************************************************** |
| 237 | | RS232C PORT |
| 238 | | ***************************************************************************/ |
| 246 | //************************************************************************** |
| 247 | // RS232C PORT |
| 248 | //************************************************************************** |
| 239 | 249 | |
| 240 | | /* Currently nothing is connected to this port */ |
| 250 | // Currently nothing is connected to this port |
| 241 | 251 | |
| 242 | 252 | void px4_state::px4_rs232c_txd(device_t *device,int state) |
| 243 | 253 | { |
| r18779 | r18780 | |
| 291 | 301 | } |
| 292 | 302 | |
| 293 | 303 | |
| 294 | | /*************************************************************************** |
| 295 | | GAPNIT |
| 296 | | ***************************************************************************/ |
| 304 | //************************************************************************** |
| 305 | // GAPNIT |
| 306 | //************************************************************************** |
| 297 | 307 | |
| 298 | | /* process interrupts */ |
| 299 | | static void gapnit_interrupt(running_machine &machine) |
| 308 | // process interrupts |
| 309 | void px4_state::gapnit_interrupt() |
| 300 | 310 | { |
| 301 | | px4_state *px4 = machine.driver_data<px4_state>(); |
| 302 | | |
| 303 | | /* any interrupts enabled and pending? */ |
| 304 | | if (px4->m_ier & px4->m_isr & INT0_7508) |
| 311 | // any interrupts enabled and pending? |
| 312 | if (m_ier & m_isr & INT0_7508) |
| 305 | 313 | { |
| 306 | | px4->m_isr &= ~INT0_7508; |
| 307 | | machine.device("maincpu")->execute().set_input_line_and_vector(0, ASSERT_LINE, 0xf0); |
| 314 | m_isr &= ~INT0_7508; |
| 315 | m_z80->set_input_line_and_vector(0, ASSERT_LINE, 0xf0); |
| 308 | 316 | } |
| 309 | | else if (px4->m_ier & px4->m_isr & INT1_ART) |
| 310 | | machine.device("maincpu")->execute().set_input_line_and_vector(0, ASSERT_LINE, 0xf2); |
| 311 | | else if (px4->m_ier & px4->m_isr & INT2_ICF) |
| 312 | | machine.device("maincpu")->execute().set_input_line_and_vector(0, ASSERT_LINE, 0xf4); |
| 313 | | else if (px4->m_ier & px4->m_isr & INT3_OVF) |
| 314 | | machine.device("maincpu")->execute().set_input_line_and_vector(0, ASSERT_LINE, 0xf6); |
| 315 | | else if (px4->m_ier & px4->m_isr & INT4_EXT) |
| 316 | | machine.device("maincpu")->execute().set_input_line_and_vector(0, ASSERT_LINE, 0xf8); |
| 317 | else if (m_ier & m_isr & INT1_ART) |
| 318 | m_z80->set_input_line_and_vector(0, ASSERT_LINE, 0xf2); |
| 319 | else if (m_ier & m_isr & INT2_ICF) |
| 320 | m_z80->set_input_line_and_vector(0, ASSERT_LINE, 0xf4); |
| 321 | else if (m_ier & m_isr & INT3_OVF) |
| 322 | m_z80->set_input_line_and_vector(0, ASSERT_LINE, 0xf6); |
| 323 | else if (m_ier & m_isr & INT4_EXT) |
| 324 | m_z80->set_input_line_and_vector(0, ASSERT_LINE, 0xf8); |
| 317 | 325 | else |
| 318 | | machine.device("maincpu")->execute().set_input_line(0, CLEAR_LINE); |
| 326 | m_z80->set_input_line(0, CLEAR_LINE); |
| 319 | 327 | } |
| 320 | 328 | |
| 321 | | /* external cassette or barcode reader input */ |
| 329 | // external cassette or barcode reader input |
| 322 | 330 | TIMER_CALLBACK_MEMBER(px4_state::ext_cassette_read) |
| 323 | 331 | { |
| 324 | 332 | UINT8 result; |
| 325 | 333 | int trigger = 0; |
| 326 | 334 | |
| 327 | | /* sample input state */ |
| 335 | // sample input state |
| 328 | 336 | result = (m_ext_cas->input() > 0) ? 1 : 0; |
| 329 | 337 | |
| 330 | | /* detect transition */ |
| 338 | // detect transition |
| 331 | 339 | switch ((m_ctrl1 >> 1) & 0x03) |
| 332 | 340 | { |
| 333 | | case 0: /* trigger inhibit */ |
| 341 | case 0: // trigger inhibit |
| 334 | 342 | trigger = 0; |
| 335 | 343 | break; |
| 336 | | case 1: /* falling edge trigger */ |
| 344 | case 1: // falling edge trigger |
| 337 | 345 | trigger = m_ear_last_state == 1 && result == 0; |
| 338 | 346 | break; |
| 339 | | case 2: /* rising edge trigger */ |
| 347 | case 2: // rising edge trigger |
| 340 | 348 | trigger = m_ear_last_state == 0 && result == 1; |
| 341 | 349 | break; |
| 342 | | case 3: /* rising/falling edge trigger */ |
| 350 | case 3: // rising/falling edge trigger |
| 343 | 351 | trigger = m_ear_last_state != result; |
| 344 | 352 | break; |
| 345 | 353 | } |
| 346 | 354 | |
| 347 | | /* generate an interrupt if we need to trigger */ |
| 355 | // generate an interrupt if we need to trigger |
| 348 | 356 | if (trigger) |
| 349 | 357 | { |
| 350 | 358 | m_icrb = m_frc_value; |
| 351 | 359 | m_isr |= INT2_ICF; |
| 352 | | gapnit_interrupt(machine()); |
| 360 | gapnit_interrupt(); |
| 353 | 361 | } |
| 354 | 362 | |
| 355 | | /* save last state */ |
| 363 | // save last state |
| 356 | 364 | m_ear_last_state = result; |
| 357 | 365 | } |
| 358 | 366 | |
| 359 | | /* free running counter */ |
| 367 | // free running counter |
| 360 | 368 | TIMER_DEVICE_CALLBACK_MEMBER(px4_state::frc_tick) |
| 361 | 369 | { |
| 362 | 370 | |
| r18779 | r18780 | |
| 365 | 373 | if (m_frc_value == 0) |
| 366 | 374 | { |
| 367 | 375 | m_isr |= INT3_OVF; |
| 368 | | gapnit_interrupt(machine()); |
| 376 | gapnit_interrupt(); |
| 369 | 377 | } |
| 370 | 378 | } |
| 371 | 379 | |
| 372 | | /* input capture register low command trigger */ |
| 380 | // input capture register low command trigger |
| 373 | 381 | READ8_MEMBER(px4_state::px4_icrlc_r) |
| 374 | 382 | { |
| 375 | | |
| 376 | 383 | if (VERBOSE) |
| 377 | 384 | logerror("%s: px4_icrlc_r\n", machine().describe_context()); |
| 378 | 385 | |
| 379 | | /* latch value */ |
| 386 | // latch value |
| 380 | 387 | m_frc_latch = m_frc_value; |
| 381 | 388 | |
| 382 | 389 | return m_frc_latch & 0xff; |
| 383 | 390 | } |
| 384 | 391 | |
| 385 | | /* control register 1 */ |
| 392 | // control register 1 |
| 386 | 393 | WRITE8_MEMBER(px4_state::px4_ctrl1_w) |
| 387 | 394 | { |
| 388 | 395 | int baud; |
| r18779 | r18780 | |
| 390 | 397 | if (VERBOSE) |
| 391 | 398 | logerror("%s: px4_ctrl1_w (0x%02x)\n", machine().describe_context(), data); |
| 392 | 399 | |
| 393 | | /* baudrate generator */ |
| 400 | // baudrate generator |
| 394 | 401 | baud = data >> 4; |
| 395 | 402 | |
| 396 | 403 | if (baud <= 12) |
| r18779 | r18780 | |
| 402 | 409 | m_ctrl1 = data; |
| 403 | 410 | } |
| 404 | 411 | |
| 405 | | /* input capture register high command trigger */ |
| 412 | // input capture register high command trigger |
| 406 | 413 | READ8_MEMBER(px4_state::px4_icrhc_r) |
| 407 | 414 | { |
| 408 | | |
| 409 | 415 | if (VERBOSE) |
| 410 | 416 | logerror("%s: px4_icrhc_r\n", machine().describe_context()); |
| 411 | 417 | |
| 412 | 418 | return (m_frc_latch >> 8) & 0xff; |
| 413 | 419 | } |
| 414 | 420 | |
| 415 | | /* command register */ |
| 421 | // command register |
| 416 | 422 | WRITE8_MEMBER(px4_state::px4_cmdr_w) |
| 417 | 423 | { |
| 418 | | |
| 419 | 424 | if (VERBOSE) |
| 420 | 425 | logerror("%s: px4_cmdr_w (0x%02x)\n", machine().describe_context(), data); |
| 421 | 426 | |
| 422 | | /* clear overflow interrupt? */ |
| 427 | // clear overflow interrupt? |
| 423 | 428 | if (BIT(data, 2)) |
| 424 | 429 | { |
| 425 | 430 | m_isr &= ~INT3_OVF; |
| 426 | | gapnit_interrupt(machine()); |
| 431 | gapnit_interrupt(); |
| 427 | 432 | } |
| 428 | 433 | } |
| 429 | 434 | |
| 430 | | /* input capture register low barcode trigger */ |
| 435 | // input capture register low barcode trigger |
| 431 | 436 | READ8_MEMBER(px4_state::px4_icrlb_r) |
| 432 | 437 | { |
| 433 | | |
| 434 | 438 | if (VERBOSE) |
| 435 | 439 | logerror("%s: px4_icrlb_r\n", machine().describe_context()); |
| 436 | 440 | |
| 437 | 441 | return m_icrb & 0xff; |
| 438 | 442 | } |
| 439 | 443 | |
| 440 | | /* control register 2 */ |
| 444 | // control register 2 |
| 441 | 445 | WRITE8_MEMBER(px4_state::px4_ctrl2_w) |
| 442 | 446 | { |
| 443 | | |
| 444 | 447 | if (VERBOSE) |
| 445 | 448 | logerror("%s: px4_ctrl2_w (0x%02x)\n", machine().describe_context(), data); |
| 446 | 449 | |
| 447 | | /* bit 0, MIC, cassette output */ |
| 450 | // bit 0, MIC, cassette output |
| 448 | 451 | m_ext_cas->output( BIT(data, 0) ? -1.0 : +1.0); |
| 449 | 452 | |
| 450 | | /* bit 1, RMT, cassette motor */ |
| 453 | // bit 1, RMT, cassette motor |
| 451 | 454 | if (BIT(data, 1)) |
| 452 | 455 | { |
| 453 | | m_ext_cas->change_state(CASSETTE_MOTOR_ENABLED,CASSETTE_MASK_MOTOR); |
| 456 | m_ext_cas->change_state(CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR); |
| 454 | 457 | m_ext_cas_timer->adjust(attotime::zero, 0, attotime::from_hz(44100)); |
| 455 | 458 | } |
| 456 | 459 | else |
| 457 | 460 | { |
| 458 | | m_ext_cas->change_state(CASSETTE_MOTOR_DISABLED,CASSETTE_MASK_MOTOR); |
| 461 | m_ext_cas->change_state(CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR); |
| 459 | 462 | m_ext_cas_timer->adjust(attotime::zero); |
| 460 | 463 | } |
| 461 | 464 | } |
| 462 | 465 | |
| 463 | | /* input capture register high barcode trigger */ |
| 466 | // input capture register high barcode trigger |
| 464 | 467 | READ8_MEMBER(px4_state::px4_icrhb_r) |
| 465 | 468 | { |
| 466 | | |
| 467 | 469 | if (VERBOSE) |
| 468 | 470 | logerror("%s: px4_icrhb_r\n", machine().describe_context()); |
| 469 | 471 | |
| 470 | | /* clear icf interrupt */ |
| 472 | // clear icf interrupt |
| 471 | 473 | m_isr &= ~INT2_ICF; |
| 472 | | gapnit_interrupt(machine()); |
| 474 | gapnit_interrupt(); |
| 473 | 475 | |
| 474 | 476 | return (m_icrb >> 8) & 0xff; |
| 475 | 477 | } |
| 476 | 478 | |
| 477 | | /* interrupt status register */ |
| 479 | // interrupt status register |
| 478 | 480 | READ8_MEMBER(px4_state::px4_isr_r) |
| 479 | 481 | { |
| 480 | | |
| 481 | 482 | if (VERBOSE) |
| 482 | 483 | logerror("%s: px4_isr_r\n", machine().describe_context()); |
| 483 | 484 | |
| 484 | 485 | return m_isr; |
| 485 | 486 | } |
| 486 | 487 | |
| 487 | | /* interrupt enable register */ |
| 488 | // interrupt enable register |
| 488 | 489 | WRITE8_MEMBER(px4_state::px4_ier_w) |
| 489 | 490 | { |
| 490 | | |
| 491 | 491 | if (VERBOSE) |
| 492 | 492 | logerror("%s: px4_ier_w (0x%02x)\n", machine().describe_context(), data); |
| 493 | 493 | |
| 494 | 494 | m_ier = data; |
| 495 | | gapnit_interrupt(machine()); |
| 495 | gapnit_interrupt(); |
| 496 | 496 | } |
| 497 | 497 | |
| 498 | | /* status register */ |
| 498 | // status register |
| 499 | 499 | READ8_MEMBER(px4_state::px4_str_r) |
| 500 | 500 | { |
| 501 | 501 | UINT8 result = 0; |
| r18779 | r18780 | |
| 504 | 504 | logerror("%s: px4_str_r\n", machine().describe_context()); |
| 505 | 505 | |
| 506 | 506 | result |= (m_ext_cas)->input() > 0 ? 1 : 0; |
| 507 | | result |= 1 << 1; /* BCRD, barcode reader input */ |
| 508 | | result |= 1 << 2; /* RDY signal from 7805 */ |
| 509 | | result |= 1 << 3; /* RDYSIO, enable access to the 7805 */ |
| 510 | | result |= m_bankr & 0xf0; /* bit 4-7, BANK - memory bank */ |
| 507 | result |= 1 << 1; // BCRD, barcode reader input |
| 508 | result |= 1 << 2; // RDY signal from 7805 |
| 509 | result |= 1 << 3; // RDYSIO, enable access to the 7805 |
| 510 | result |= m_bankr & 0xf0; // bit 4-7, BANK - memory bank |
| 511 | 511 | |
| 512 | 512 | return result; |
| 513 | 513 | } |
| 514 | 514 | |
| 515 | | /* helper function to map rom capsules */ |
| 516 | | static void install_rom_capsule(address_space &space, int size, const char *region) |
| 515 | // helper function to map rom capsules |
| 516 | void px4_state::install_rom_capsule(address_space &space, int size, const char *region) |
| 517 | 517 | { |
| 518 | | px4_state *state = space.machine().driver_data<px4_state>(); |
| 519 | | |
| 520 | | /* ram, part 1 */ |
| 518 | // ram, part 1 |
| 521 | 519 | space.install_readwrite_bank(0x0000, 0xdfff - size, "bank1"); |
| 522 | | state->membank("bank1")->set_base(state->m_ram->pointer()); |
| 520 | membank("bank1")->set_base(m_ram->pointer()); |
| 523 | 521 | |
| 524 | | /* actual rom data, part 1 */ |
| 522 | // actual rom data, part 1 |
| 525 | 523 | space.install_read_bank(0xe000 - size, 0xffff - size, "bank2"); |
| 526 | 524 | space.nop_write(0xe000 - size, 0xffff - size); |
| 527 | | state->membank("bank2")->set_base(space.machine().root_device().memregion(region)->base() + (size - 0x2000)); |
| 525 | membank("bank2")->set_base(memregion(region)->base() + (size - 0x2000)); |
| 528 | 526 | |
| 529 | | /* rom data, part 2 */ |
| 527 | // rom data, part 2 |
| 530 | 528 | if (size != 0x2000) |
| 531 | 529 | { |
| 532 | 530 | space.install_read_bank(0x10000 - size, 0xdfff, "bank3"); |
| 533 | 531 | space.nop_write(0x10000 - size, 0xdfff); |
| 534 | | state->membank("bank3")->set_base(state->memregion(region)->base()); |
| 532 | membank("bank3")->set_base(memregion(region)->base()); |
| 535 | 533 | } |
| 536 | 534 | |
| 537 | | /* ram, continued */ |
| 535 | // ram, continued |
| 538 | 536 | space.install_readwrite_bank(0xe000, 0xffff, "bank4"); |
| 539 | | state->membank("bank4")->set_base(state->m_ram->pointer() + 0xe000); |
| 537 | membank("bank4")->set_base(m_ram->pointer() + 0xe000); |
| 540 | 538 | } |
| 541 | 539 | |
| 542 | | /* bank register */ |
| 540 | // bank register |
| 543 | 541 | WRITE8_MEMBER(px4_state::px4_bankr_w) |
| 544 | 542 | { |
| 545 | | address_space &space_program = machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 543 | address_space &space_program = m_z80->space(AS_PROGRAM); |
| 546 | 544 | |
| 547 | 545 | if (VERBOSE) |
| 548 | 546 | logerror("%s: px4_bankr_w (0x%02x)\n", machine().describe_context(), data); |
| r18779 | r18780 | |
| 556 | 554 | /* system bank */ |
| 557 | 555 | space_program.install_read_bank(0x0000, 0x7fff, "bank1"); |
| 558 | 556 | space_program.nop_write(0x0000, 0x7fff); |
| 559 | | membank("bank1")->set_base(machine().root_device().memregion("os")->base()); |
| 557 | membank("bank1")->set_base(memregion("os")->base()); |
| 560 | 558 | space_program.install_readwrite_bank(0x8000, 0xffff, "bank2"); |
| 561 | 559 | membank("bank2")->set_base(m_ram->pointer() + 0x8000); |
| 562 | 560 | break; |
| r18779 | r18780 | |
| 581 | 579 | } |
| 582 | 580 | } |
| 583 | 581 | |
| 584 | | /* serial io register */ |
| 582 | // serial io register |
| 585 | 583 | READ8_MEMBER(px4_state::px4_sior_r) |
| 586 | 584 | { |
| 587 | | |
| 588 | 585 | if (VERBOSE) |
| 589 | 586 | logerror("%s: px4_sior_r 0x%02x\n", machine().describe_context(), m_sior); |
| 590 | 587 | |
| 591 | 588 | return m_sior; |
| 592 | 589 | } |
| 593 | 590 | |
| 594 | | /* serial io register */ |
| 591 | // serial io register |
| 595 | 592 | WRITE8_MEMBER(px4_state::px4_sior_w) |
| 596 | 593 | { |
| 597 | | |
| 598 | 594 | if (VERBOSE) |
| 599 | 595 | logerror("%s: px4_sior_w (0x%02x)\n", machine().describe_context(), data); |
| 600 | 596 | |
| r18779 | r18780 | |
| 619 | 615 | if (VERBOSE) |
| 620 | 616 | logerror("> 7508 has interrupts pending: 0x%02x\n", m_interrupt_status); |
| 621 | 617 | |
| 622 | | /* signal the interrupt(s) */ |
| 618 | // signal the interrupt(s) |
| 623 | 619 | m_sior = 0xc1 | m_interrupt_status; |
| 624 | 620 | m_interrupt_status = 0x00; |
| 625 | 621 | } |
| r18779 | r18780 | |
| 630 | 626 | } |
| 631 | 627 | else |
| 632 | 628 | { |
| 633 | | /* nothing happenend */ |
| 629 | // nothing happenend |
| 634 | 630 | m_sior = 0xbf; |
| 635 | 631 | } |
| 636 | 632 | |
| r18779 | r18780 | |
| 649 | 645 | if (VERBOSE) |
| 650 | 646 | logerror("7508 cmd: KB Interrupt OFF\n"); |
| 651 | 647 | |
| 652 | | m_key_int_enabled = FALSE; |
| 648 | m_key_int_enabled = false; |
| 653 | 649 | break; |
| 654 | 650 | |
| 655 | 651 | case 0x16: |
| r18779 | r18780 | |
| 657 | 653 | if (VERBOSE) |
| 658 | 654 | logerror("7508 cmd: KB Interrupt ON\n"); |
| 659 | 655 | |
| 660 | | m_key_int_enabled = TRUE; |
| 656 | m_key_int_enabled = true; |
| 661 | 657 | break; |
| 662 | 658 | |
| 663 | 659 | case 0x07: if (VERBOSE) logerror("7508 cmd: Clock Read\n"); break; |
| r18779 | r18780 | |
| 668 | 664 | if (VERBOSE) |
| 669 | 665 | logerror("7508 cmd: Power Switch Read\n"); |
| 670 | 666 | |
| 671 | | /* indicate that the power switch is in the "ON" position */ |
| 667 | // indicate that the power switch is in the "ON" position |
| 672 | 668 | m_sior = 0x01; |
| 673 | 669 | break; |
| 674 | 670 | |
| r18779 | r18780 | |
| 694 | 690 | if (VERBOSE) |
| 695 | 691 | logerror("7508 cmd: 1 sec. Interrupt OFF\n"); |
| 696 | 692 | |
| 697 | | m_one_sec_int_enabled = FALSE; |
| 693 | m_one_sec_int_enabled = false; |
| 698 | 694 | break; |
| 699 | 695 | |
| 700 | 696 | case 0x1d: |
| r18779 | r18780 | |
| 702 | 698 | if (VERBOSE) |
| 703 | 699 | logerror("7508 cmd: 1 sec. Interrupt ON\n"); |
| 704 | 700 | |
| 705 | | m_one_sec_int_enabled = TRUE; |
| 701 | m_one_sec_int_enabled = true; |
| 706 | 702 | break; |
| 707 | 703 | |
| 708 | 704 | case 0x0e: |
| r18779 | r18780 | |
| 718 | 714 | } |
| 719 | 715 | |
| 720 | 716 | |
| 721 | | /*************************************************************************** |
| 722 | | GAPNDL |
| 723 | | ***************************************************************************/ |
| 717 | //************************************************************************** |
| 718 | // GAPNDL |
| 719 | //************************************************************************** |
| 724 | 720 | |
| 725 | | /* vram start address register */ |
| 721 | // vram start address register |
| 726 | 722 | WRITE8_MEMBER(px4_state::px4_vadr_w) |
| 727 | 723 | { |
| 728 | | |
| 729 | 724 | if (VERBOSE) |
| 730 | 725 | logerror("%s: px4_vadr_w (0x%02x)\n", machine().describe_context(), data); |
| 731 | 726 | |
| 732 | 727 | m_vadr = data; |
| 733 | 728 | } |
| 734 | 729 | |
| 735 | | /* y offset register */ |
| 730 | // y offset register |
| 736 | 731 | WRITE8_MEMBER(px4_state::px4_yoff_w) |
| 737 | 732 | { |
| 738 | | |
| 739 | 733 | if (VERBOSE) |
| 740 | 734 | logerror("%s: px4_yoff_w (0x%02x)\n", machine().describe_context(), data); |
| 741 | 735 | |
| 742 | 736 | m_yoff = data; |
| 743 | 737 | } |
| 744 | 738 | |
| 745 | | /* frame register */ |
| 739 | // frame register |
| 746 | 740 | WRITE8_MEMBER(px4_state::px4_fr_w) |
| 747 | 741 | { |
| 748 | 742 | if (VERBOSE) |
| 749 | 743 | logerror("%s: px4_fr_w (0x%02x)\n", machine().describe_context(), data); |
| 750 | 744 | } |
| 751 | 745 | |
| 752 | | /* speed-up register */ |
| 746 | // speed-up register |
| 753 | 747 | WRITE8_MEMBER(px4_state::px4_spur_w) |
| 754 | 748 | { |
| 755 | 749 | if (VERBOSE) |
| r18779 | r18780 | |
| 757 | 751 | } |
| 758 | 752 | |
| 759 | 753 | |
| 760 | | /*************************************************************************** |
| 761 | | GAPNIO |
| 762 | | ***************************************************************************/ |
| 754 | //************************************************************************** |
| 755 | // GAPNIO |
| 756 | //************************************************************************** |
| 763 | 757 | |
| 764 | 758 | TIMER_CALLBACK_MEMBER(px4_state::transmit_data) |
| 765 | 759 | { |
| 766 | | |
| 767 | | if (BIT(m_artcr, 0))// ART_TX_ENABLED |
| 760 | if (ART_TX_ENABLED) |
| 768 | 761 | { |
| 769 | 762 | |
| 770 | 763 | } |
| r18779 | r18780 | |
| 772 | 765 | |
| 773 | 766 | TIMER_CALLBACK_MEMBER(px4_state::receive_data) |
| 774 | 767 | { |
| 775 | | px4_state *px4 = machine().driver_data<px4_state>(); |
| 776 | | |
| 777 | 768 | if (ART_RX_ENABLED) |
| 778 | 769 | { |
| 779 | 770 | |
| 780 | 771 | } |
| 781 | 772 | } |
| 782 | 773 | |
| 783 | | /* cartridge interface */ |
| 774 | // cartridge interface |
| 784 | 775 | READ8_MEMBER(px4_state::px4_ctgif_r) |
| 785 | 776 | { |
| 786 | 777 | if (VERBOSE) |
| r18779 | r18780 | |
| 789 | 780 | return 0xff; |
| 790 | 781 | } |
| 791 | 782 | |
| 792 | | /* cartridge interface */ |
| 783 | // cartridge interface |
| 793 | 784 | WRITE8_MEMBER(px4_state::px4_ctgif_w) |
| 794 | 785 | { |
| 795 | 786 | if (VERBOSE) |
| 796 | 787 | logerror("%s: px4_ctgif_w (0x%02x @ 0x%02x)\n", machine().describe_context(), data, offset); |
| 797 | 788 | } |
| 798 | 789 | |
| 799 | | /* art data input register */ |
| 790 | // art data input register |
| 800 | 791 | READ8_MEMBER(px4_state::px4_artdir_r) |
| 801 | 792 | { |
| 802 | | |
| 803 | 793 | if (VERBOSE) |
| 804 | 794 | logerror("%s: px4_artdir_r\n", machine().describe_context()); |
| 805 | 795 | |
| 806 | 796 | return m_artdir; |
| 807 | 797 | } |
| 808 | 798 | |
| 809 | | /* art data output register */ |
| 799 | // art data output register |
| 810 | 800 | WRITE8_MEMBER(px4_state::px4_artdor_w) |
| 811 | 801 | { |
| 812 | | |
| 813 | 802 | if (VERBOSE) |
| 814 | 803 | logerror("%s: px4_artdor_w (0x%02x)\n", machine().describe_context(), data); |
| 815 | 804 | |
| 816 | | /* clear ready */ |
| 805 | // clear ready |
| 817 | 806 | m_artsr &= ~ART_TXRDY; |
| 818 | 807 | |
| 819 | 808 | m_artdor = data; |
| 820 | 809 | } |
| 821 | 810 | |
| 822 | | /* art status register */ |
| 811 | // art status register |
| 823 | 812 | READ8_MEMBER(px4_state::px4_artsr_r) |
| 824 | 813 | { |
| 825 | 814 | UINT8 result = 0; |
| r18779 | r18780 | |
| 832 | 821 | return result | m_artsr; |
| 833 | 822 | } |
| 834 | 823 | |
| 835 | | /* art mode register */ |
| 824 | // art mode register |
| 836 | 825 | WRITE8_MEMBER(px4_state::px4_artmr_w) |
| 837 | 826 | { |
| 838 | | |
| 839 | 827 | if (VERBOSE) |
| 840 | 828 | logerror("%s: px4_artmr_w (0x%02x)\n", machine().describe_context(), data); |
| 841 | 829 | |
| 842 | 830 | m_artmr = data; |
| 843 | 831 | } |
| 844 | 832 | |
| 845 | | /* io status register */ |
| 833 | // io status register |
| 846 | 834 | READ8_MEMBER(px4_state::px4_iostr_r) |
| 847 | 835 | { |
| 848 | 836 | UINT8 result = 0; |
| r18779 | r18780 | |
| 856 | 844 | result |= px4_sio_rxd(m_sio_device) << 3; |
| 857 | 845 | result |= px4_rs232c_dcd(m_rs232c_device) << 4; |
| 858 | 846 | result |= px4_rs232c_cts(m_rs232c_device) << 5; |
| 859 | | result |= 1 << 6; /* bit 6, csel, cartridge option select signal, set to 'other mode' */ |
| 860 | | result |= 0 << 7; /* bit 7, caud - audio input from cartridge */ |
| 847 | result |= 1 << 6; // bit 6, csel, cartridge option select signal, set to 'other mode' |
| 848 | result |= 0 << 7; // bit 7, caud - audio input from cartridge |
| 861 | 849 | |
| 862 | 850 | return result; |
| 863 | 851 | } |
| 864 | 852 | |
| 865 | | /* art command register */ |
| 853 | // art command register |
| 866 | 854 | WRITE8_MEMBER(px4_state::px4_artcr_w) |
| 867 | 855 | { |
| 868 | | |
| 869 | 856 | if (VERBOSE) |
| 870 | 857 | logerror("%s: px4_artcr_w (0x%02x)\n", machine().describe_context(), data); |
| 871 | 858 | |
| 872 | 859 | m_artcr = data; |
| 873 | 860 | |
| 874 | | /* bit 0, txe - transmit enable */ |
| 861 | // bit 0, txe - transmit enable |
| 875 | 862 | if (!ART_TX_ENABLED) |
| 876 | 863 | { |
| 877 | | /* force high when disabled */ |
| 864 | // force high when disabled |
| 878 | 865 | px4_sio_txd(m_sio_device, ASSERT_LINE); |
| 879 | 866 | px4_rs232c_txd(m_rs232c_device, ASSERT_LINE); |
| 880 | 867 | } |
| 881 | 868 | |
| 882 | | /* bit 3, sbrk - break output */ |
| 869 | // bit 3, sbrk - break output |
| 883 | 870 | if (ART_TX_ENABLED && BIT(data, 3)) |
| 884 | 871 | { |
| 885 | | /* force low when enabled and transmit enabled */ |
| 872 | // force low when enabled and transmit enabled |
| 886 | 873 | px4_sio_txd(m_sio_device, CLEAR_LINE); |
| 887 | 874 | px4_rs232c_txd(m_rs232c_device, CLEAR_LINE); |
| 888 | 875 | } |
| 889 | 876 | |
| 890 | | /* error reset */ |
| 877 | // error reset |
| 891 | 878 | if (BIT(data, 4)) |
| 892 | 879 | m_artsr &= ~(ART_PE | ART_OE | ART_FE); |
| 893 | 880 | |
| r18779 | r18780 | |
| 895 | 882 | px4_rs232c_rts(m_rs232c_device, BIT(data, 5)); |
| 896 | 883 | } |
| 897 | 884 | |
| 898 | | /* switch register */ |
| 885 | // switch register |
| 899 | 886 | WRITE8_MEMBER(px4_state::px4_swr_w) |
| 900 | 887 | { |
| 901 | | |
| 902 | 888 | if (VERBOSE) |
| 903 | 889 | logerror("%s: px4_swr_w (0x%02x)\n", machine().describe_context(), data); |
| 904 | 890 | |
| 905 | 891 | m_swr = data; |
| 906 | 892 | } |
| 907 | 893 | |
| 908 | | /* io control register */ |
| 894 | // io control register |
| 909 | 895 | WRITE8_MEMBER(px4_state::px4_ioctlr_w) |
| 910 | 896 | { |
| 911 | | |
| 912 | 897 | if (VERBOSE) |
| 913 | 898 | logerror("%s: px4_ioctlr_w (0x%02x)\n", machine().describe_context(), data); |
| 914 | 899 | |
| r18779 | r18780 | |
| 917 | 902 | |
| 918 | 903 | px4_sio_pout(m_sio_device, BIT(data, 2)); |
| 919 | 904 | |
| 920 | | /* bit 3, cartridge reset */ |
| 905 | // bit 3, cartridge reset |
| 921 | 906 | |
| 922 | | output_set_value("led_0", BIT(data, 4)); /* caps lock */ |
| 923 | | output_set_value("led_1", BIT(data, 5)); /* num lock */ |
| 924 | | output_set_value("led_2", BIT(data, 6)); /* "led 2" */ |
| 907 | output_set_value("led_0", BIT(data, 4)); // caps lock |
| 908 | output_set_value("led_1", BIT(data, 5)); // num lock |
| 909 | output_set_value("led_2", BIT(data, 6)); // "led 2" |
| 925 | 910 | |
| 926 | | /* bit 7, sp - speaker */ |
| 911 | // bit 7, sp - speaker |
| 927 | 912 | } |
| 928 | 913 | |
| 929 | 914 | |
| 930 | | /*************************************************************************** |
| 931 | | 7508 RELATED |
| 932 | | ***************************************************************************/ |
| 915 | //************************************************************************** |
| 916 | // 7508 RELATED |
| 917 | //************************************************************************** |
| 933 | 918 | |
| 934 | 919 | TIMER_DEVICE_CALLBACK_MEMBER(px4_state::upd7508_1sec_callback) |
| 935 | 920 | { |
| 936 | 921 | |
| 937 | | /* adjust interrupt status */ |
| 922 | // adjust interrupt status |
| 938 | 923 | m_interrupt_status |= UPD7508_INT_ONE_SECOND; |
| 939 | 924 | |
| 940 | | /* are interrupts enabled? */ |
| 925 | // are interrupts enabled? |
| 941 | 926 | if (m_one_sec_int_enabled) |
| 942 | 927 | { |
| 943 | 928 | m_isr |= INT0_7508; |
| 944 | | gapnit_interrupt(machine()); |
| 929 | gapnit_interrupt(); |
| 945 | 930 | } |
| 946 | 931 | } |
| 947 | 932 | |
| r18779 | r18780 | |
| 958 | 943 | down = (newvalue & (1 << i)) ? 0x10 : 0x00; |
| 959 | 944 | scancode = (FPTR)param * 32 + i; |
| 960 | 945 | |
| 961 | | /* control keys */ |
| 946 | // control keys |
| 962 | 947 | if ((scancode & 0xa0) == 0xa0) |
| 963 | 948 | scancode |= down; |
| 964 | 949 | |
| r18779 | r18780 | |
| 979 | 964 | logerror("upd7508: key interrupt\n"); |
| 980 | 965 | |
| 981 | 966 | m_isr |= INT0_7508; |
| 982 | | gapnit_interrupt(machine()); |
| 967 | gapnit_interrupt(); |
| 983 | 968 | } |
| 984 | 969 | } |
| 985 | 970 | } |
| 986 | 971 | |
| 987 | 972 | |
| 988 | | /*************************************************************************** |
| 989 | | EXTERNAL RAM-DISK |
| 990 | | ***************************************************************************/ |
| 973 | //************************************************************************** |
| 974 | // EXTERNAL RAM-DISK |
| 975 | //************************************************************************** |
| 991 | 976 | |
| 992 | 977 | WRITE8_MEMBER(px4_state::px4_ramdisk_address_w) |
| 993 | 978 | { |
| 994 | | |
| 995 | 979 | switch (offset) |
| 996 | 980 | { |
| 997 | | case 0x00: m_ramdisk_address = (m_ramdisk_address & 0xffff00) | data; break; |
| 998 | | case 0x01: m_ramdisk_address = (m_ramdisk_address & 0xff00ff) | (data << 8); break; |
| 981 | case 0x00: m_ramdisk_address = (m_ramdisk_address & 0xffff00) | ((data & 0xff) << 0); break; |
| 982 | case 0x01: m_ramdisk_address = (m_ramdisk_address & 0xff00ff) | ((data & 0xff) << 8); break; |
| 999 | 983 | case 0x02: m_ramdisk_address = (m_ramdisk_address & 0x00ffff) | ((data & 0x07) << 16); break; |
| 1000 | 984 | } |
| 1001 | 985 | } |
| r18779 | r18780 | |
| 1006 | 990 | |
| 1007 | 991 | if (m_ramdisk_address < 0x20000) |
| 1008 | 992 | { |
| 1009 | | /* read from ram */ |
| 993 | // read from ram |
| 1010 | 994 | ret = m_ramdisk[m_ramdisk_address]; |
| 1011 | 995 | } |
| 1012 | 996 | else if (m_ramdisk_address < 0x40000) |
| 1013 | 997 | { |
| 1014 | | /* read from rom */ |
| 998 | // read from rom |
| 1015 | 999 | ret = memregion("ramdisk")->base()[m_ramdisk_address]; |
| 1016 | 1000 | } |
| 1017 | 1001 | |
| r18779 | r18780 | |
| 1031 | 1015 | |
| 1032 | 1016 | READ8_MEMBER(px4_state::px4_ramdisk_control_r) |
| 1033 | 1017 | { |
| 1034 | | /* bit 7 determines the presence of a ram-disk */ |
| 1018 | // bit 7 determines the presence of a ram-disk |
| 1035 | 1019 | return 0x7f; |
| 1036 | 1020 | } |
| 1037 | 1021 | |
| 1038 | | /*************************************************************************** |
| 1039 | | VIDEO EMULATION |
| 1040 | | ***************************************************************************/ |
| 1022 | //************************************************************************** |
| 1023 | // VIDEO EMULATION |
| 1024 | //************************************************************************** |
| 1041 | 1025 | |
| 1042 | 1026 | UINT32 px4_state::screen_update_px4(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 1043 | 1027 | { |
| 1044 | | |
| 1045 | | /* display enabled? */ |
| 1028 | // display enabled? |
| 1046 | 1029 | if (BIT(m_yoff, 7)) |
| 1047 | 1030 | { |
| 1048 | 1031 | int y, x; |
| 1049 | 1032 | |
| 1050 | | /* get vram start address */ |
| 1033 | // get vram start address |
| 1051 | 1034 | UINT8 *vram = &m_ram->pointer()[(m_vadr & 0xf8) << 8]; |
| 1052 | 1035 | |
| 1053 | 1036 | for (y = 0; y < 64; y++) |
| 1054 | 1037 | { |
| 1055 | | /* adjust against y-offset */ |
| 1038 | // adjust against y-offset |
| 1056 | 1039 | UINT8 row = (y - (m_yoff & 0x3f)) & 0x3f; |
| 1057 | 1040 | |
| 1058 | 1041 | for (x = 0; x < 240/8; x++) |
| r18779 | r18780 | |
| 1069 | 1052 | vram++; |
| 1070 | 1053 | } |
| 1071 | 1054 | |
| 1072 | | /* skip the last 2 unused bytes */ |
| 1055 | // skip the last 2 unused bytes |
| 1073 | 1056 | vram += 2; |
| 1074 | 1057 | } |
| 1075 | 1058 | } |
| 1076 | 1059 | else |
| 1077 | 1060 | { |
| 1078 | | /* display is disabled, draw an empty screen */ |
| 1061 | // display is disabled, draw an empty screen |
| 1079 | 1062 | bitmap.fill(0, cliprect); |
| 1080 | 1063 | } |
| 1081 | 1064 | |
| r18779 | r18780 | |
| 1083 | 1066 | } |
| 1084 | 1067 | |
| 1085 | 1068 | |
| 1086 | | /*************************************************************************** |
| 1087 | | DRIVER INIT |
| 1088 | | ***************************************************************************/ |
| 1069 | //************************************************************************** |
| 1070 | // DRIVER INIT |
| 1071 | //************************************************************************** |
| 1089 | 1072 | |
| 1090 | 1073 | DRIVER_INIT_MEMBER(px4_state,px4) |
| 1091 | 1074 | { |
| 1075 | // init 7508 |
| 1076 | m_one_sec_int_enabled = true; |
| 1077 | m_key_int_enabled = true; |
| 1078 | m_alarm_int_enabled = true; |
| 1092 | 1079 | |
| 1093 | | /* find devices */ |
| 1094 | | m_ram = machine().device<ram_device>(RAM_TAG); |
| 1080 | // art |
| 1081 | m_receive_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(px4_state::receive_data), this)); |
| 1082 | m_transmit_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(px4_state::transmit_data), this)); |
| 1095 | 1083 | |
| 1096 | | /* init 7508 */ |
| 1097 | | m_one_sec_int_enabled = TRUE; |
| 1098 | | m_key_int_enabled = TRUE; |
| 1099 | | m_alarm_int_enabled = TRUE; |
| 1100 | | |
| 1101 | | /* art */ |
| 1102 | | m_receive_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(px4_state::receive_data),this)); |
| 1103 | | m_transmit_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(px4_state::transmit_data),this)); |
| 1104 | | |
| 1105 | | /* printer */ |
| 1106 | | m_centronics = machine().device<centronics_device>("centronics"); |
| 1107 | | |
| 1108 | | /* external cassette or barcode reader */ |
| 1109 | | m_ext_cas_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(px4_state::ext_cassette_read),this)); |
| 1110 | | m_ext_cas = machine().device<cassette_image_device>("extcas"); |
| 1084 | // external cassette or barcode reader |
| 1085 | m_ext_cas_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(px4_state::ext_cassette_read), this)); |
| 1111 | 1086 | m_ear_last_state = 0; |
| 1112 | 1087 | |
| 1113 | | /* external devices */ |
| 1088 | // external devices |
| 1114 | 1089 | m_sio_device = machine().device("floppy"); |
| 1115 | 1090 | m_rs232c_device = NULL; |
| 1116 | 1091 | |
| 1117 | | /* map os rom and last half of memory */ |
| 1118 | | membank("bank1")->set_base(machine().root_device().memregion("os")->base()); |
| 1092 | // map os rom and last half of memory |
| 1093 | membank("bank1")->set_base(memregion("os")->base()); |
| 1119 | 1094 | membank("bank2")->set_base(m_ram->pointer() + 0x8000); |
| 1120 | 1095 | } |
| 1121 | 1096 | |
| 1122 | | DRIVER_INIT_MEMBER(px4_state,px4p) |
| 1097 | DRIVER_INIT_MEMBER(px4_state, px4p) |
| 1123 | 1098 | { |
| 1124 | | |
| 1125 | 1099 | DRIVER_INIT_CALL(px4); |
| 1126 | 1100 | |
| 1127 | | /* reserve memory for external ram-disk */ |
| 1101 | // reserve memory for external ram-disk |
| 1128 | 1102 | m_ramdisk = auto_alloc_array(machine(), UINT8, 0x20000); |
| 1129 | 1103 | } |
| 1130 | 1104 | |
| r18779 | r18780 | |
| 1133 | 1107 | m_artsr = ART_TXRDY | ART_TXEMPTY; |
| 1134 | 1108 | } |
| 1135 | 1109 | |
| 1136 | | MACHINE_START_MEMBER(px4_state,px4_ramdisk) |
| 1110 | MACHINE_START_MEMBER(px4_state, px4_ramdisk) |
| 1137 | 1111 | { |
| 1138 | 1112 | machine().device<nvram_device>("nvram")->set_base(m_ramdisk, 0x20000); |
| 1139 | 1113 | } |
| 1140 | 1114 | |
| 1141 | | /*************************************************************************** |
| 1142 | | ADDRESS MAPS |
| 1143 | | ***************************************************************************/ |
| 1115 | //************************************************************************** |
| 1116 | // ADDRESS MAPS |
| 1117 | //************************************************************************** |
| 1144 | 1118 | |
| 1145 | 1119 | static ADDRESS_MAP_START( px4_mem, AS_PROGRAM, 8, px4_state ) |
| 1146 | 1120 | AM_RANGE(0x0000, 0x7fff) AM_ROMBANK("bank1") |
| r18779 | r18780 | |
| 1150 | 1124 | static ADDRESS_MAP_START( px4_io, AS_IO, 8, px4_state ) |
| 1151 | 1125 | ADDRESS_MAP_UNMAP_HIGH |
| 1152 | 1126 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 1153 | | /* gapnit, 0x00-0x07 */ |
| 1127 | // gapnit, 0x00-0x07 |
| 1154 | 1128 | AM_RANGE(0x00, 0x00) AM_READWRITE(px4_icrlc_r, px4_ctrl1_w) |
| 1155 | 1129 | AM_RANGE(0x01, 0x01) AM_READWRITE(px4_icrhc_r, px4_cmdr_w) |
| 1156 | 1130 | AM_RANGE(0x02, 0x02) AM_READWRITE(px4_icrlb_r, px4_ctrl2_w) |
| r18779 | r18780 | |
| 1159 | 1133 | AM_RANGE(0x05, 0x05) AM_READWRITE(px4_str_r, px4_bankr_w) |
| 1160 | 1134 | AM_RANGE(0x06, 0x06) AM_READWRITE(px4_sior_r, px4_sior_w) |
| 1161 | 1135 | AM_RANGE(0x07, 0x07) AM_NOP |
| 1162 | | /* gapndl, 0x08-0x0f */ |
| 1136 | // gapndl, 0x08-0x0f |
| 1163 | 1137 | AM_RANGE(0x08, 0x08) AM_WRITE(px4_vadr_w) |
| 1164 | 1138 | AM_RANGE(0x09, 0x09) AM_WRITE(px4_yoff_w) |
| 1165 | 1139 | AM_RANGE(0x0a, 0x0a) AM_WRITE(px4_fr_w) |
| 1166 | 1140 | AM_RANGE(0x0b, 0x0b) AM_WRITE(px4_spur_w) |
| 1167 | 1141 | AM_RANGE(0x0c, 0x0f) AM_NOP |
| 1168 | | /* gapnio, 0x10-0x1f */ |
| 1142 | // gapnio, 0x10-0x1f |
| 1169 | 1143 | AM_RANGE(0x10, 0x13) AM_READWRITE(px4_ctgif_r, px4_ctgif_w) |
| 1170 | 1144 | AM_RANGE(0x14, 0x14) AM_READWRITE(px4_artdir_r, px4_artdor_w) |
| 1171 | 1145 | AM_RANGE(0x15, 0x15) AM_READWRITE(px4_artsr_r, px4_artmr_w) |
| r18779 | r18780 | |
| 1184 | 1158 | ADDRESS_MAP_END |
| 1185 | 1159 | |
| 1186 | 1160 | |
| 1187 | | /*************************************************************************** |
| 1188 | | INPUT PORTS |
| 1189 | | ***************************************************************************/ |
| 1161 | //************************************************************************** |
| 1162 | // INPUT PORTS |
| 1163 | //************************************************************************** |
| 1190 | 1164 | |
| 1191 | 1165 | /* The PX-4 has an exchangeable keyboard. Available is a standard ASCII |
| 1192 | 1166 | * keyboard and an "item" keyboard, as well as regional variants for |
| 1193 | 1167 | * UK, France, Germany, Denmark, Sweden, Norway, Italy and Spain. |
| 1194 | 1168 | */ |
| 1195 | 1169 | |
| 1196 | | /* configuration dip switch found on the rom capsule board */ |
| 1170 | // configuration dip switch found on the rom capsule board |
| 1197 | 1171 | static INPUT_PORTS_START( px4_dips ) |
| 1198 | 1172 | PORT_START("dips") |
| 1199 | 1173 | |
| r18779 | r18780 | |
| 1217 | 1191 | PORT_DIPSETTING(0x20, "RS-232C") |
| 1218 | 1192 | PORT_DIPSETTING(0x30, "Centronics printer") |
| 1219 | 1193 | |
| 1220 | | /* available for user applications */ |
| 1194 | // available for user applications |
| 1221 | 1195 | PORT_DIPNAME(0x40, 0x40, "Not used") |
| 1222 | 1196 | PORT_DIPLOCATION("DIP:2") |
| 1223 | 1197 | PORT_DIPSETTING(0x40, "Enable") |
| 1224 | 1198 | PORT_DIPSETTING(0x00, "Disable") |
| 1225 | 1199 | |
| 1226 | | /* this is automatically selected by the os, the switch has no effect */ |
| 1200 | // this is automatically selected by the os, the switch has no effect |
| 1227 | 1201 | PORT_DIPNAME(0x80, 0x00, "Keyboard type") |
| 1228 | 1202 | PORT_DIPLOCATION("DIP:1") |
| 1229 | 1203 | PORT_DIPSETTING(0x80, "Item keyboard") |
| 1230 | 1204 | PORT_DIPSETTING(0x00, "Standard keyboard") |
| 1231 | 1205 | INPUT_PORTS_END |
| 1232 | 1206 | |
| 1233 | | /* US ASCII keyboard */ |
| 1207 | // US ASCII keyboard |
| 1234 | 1208 | static INPUT_PORTS_START( px4_h450a ) |
| 1235 | 1209 | PORT_INCLUDE(px4_dips) |
| 1236 | 1210 | PORT_INCLUDE(tf20) |
| 1237 | 1211 | |
| 1238 | 1212 | PORT_START("keyboard_0") |
| 1239 | | PORT_BIT(0x00000001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(ESC)) // 00 |
| 1240 | | PORT_BIT(0x00000002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(PAUSE)) // 01 |
| 1241 | | PORT_BIT(0x00000004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F6)) PORT_NAME("Help") // 02 |
| 1242 | | PORT_BIT(0x00000008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F1)) PORT_NAME("PF1") // 03 |
| 1243 | | PORT_BIT(0x00000010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_F5) PORT_CHAR(UCHAR_MAMEKEY(F2)) PORT_NAME("PF2") // 04 |
| 1244 | | PORT_BIT(0x00000020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_F6) PORT_CHAR(UCHAR_MAMEKEY(F3)) PORT_NAME("PF3") // 05 |
| 1245 | | PORT_BIT(0x00000040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_F7) PORT_CHAR(UCHAR_MAMEKEY(F4)) PORT_NAME("PF4") // 06 |
| 1246 | | PORT_BIT(0x00000080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_F8) PORT_CHAR(UCHAR_MAMEKEY(F5)) PORT_NAME("PF5") // 07 |
| 1247 | | PORT_BIT(0x0000ff00, IP_ACTIVE_HIGH, IPT_UNUSED) // 08-0f |
| 1248 | | PORT_BIT(0x00010000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(CANCEL)) PORT_NAME("Stop") // 10 |
| 1249 | | PORT_BIT(0x00020000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') // 11 |
| 1250 | | PORT_BIT(0x00040000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"') // 12 |
| 1251 | | PORT_BIT(0x00080000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') // 13 |
| 1252 | | PORT_BIT(0x00100000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') // 14 |
| 1253 | | PORT_BIT(0x00200000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') // 15 |
| 1254 | | PORT_BIT(0x00400000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') // 16 |
| 1255 | | PORT_BIT(0x00800000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') // 17 |
| 1256 | | PORT_BIT(0xff000000, IP_ACTIVE_HIGH, IPT_UNUSED) // 18-1f |
| 1213 | PORT_BIT(0x00000001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(ESC)) // 00 |
| 1214 | PORT_BIT(0x00000002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(PAUSE)) // 01 |
| 1215 | PORT_BIT(0x00000004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F6)) PORT_NAME("Help") // 02 |
| 1216 | PORT_BIT(0x00000008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F1)) PORT_NAME("PF1") // 03 |
| 1217 | PORT_BIT(0x00000010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_F5) PORT_CHAR(UCHAR_MAMEKEY(F2)) PORT_NAME("PF2") // 04 |
| 1218 | PORT_BIT(0x00000020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_F6) PORT_CHAR(UCHAR_MAMEKEY(F3)) PORT_NAME("PF3") // 05 |
| 1219 | PORT_BIT(0x00000040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_F7) PORT_CHAR(UCHAR_MAMEKEY(F4)) PORT_NAME("PF4") // 06 |
| 1220 | PORT_BIT(0x00000080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_F8) PORT_CHAR(UCHAR_MAMEKEY(F5)) PORT_NAME("PF5") // 07 |
| 1221 | PORT_BIT(0x0000ff00, IP_ACTIVE_HIGH, IPT_UNUSED) // 08-0f |
| 1222 | PORT_BIT(0x00010000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(CANCEL)) PORT_NAME("Stop") // 10 |
| 1223 | PORT_BIT(0x00020000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') // 11 |
| 1224 | PORT_BIT(0x00040000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"') // 12 |
| 1225 | PORT_BIT(0x00080000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') // 13 |
| 1226 | PORT_BIT(0x00100000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') // 14 |
| 1227 | PORT_BIT(0x00200000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') // 15 |
| 1228 | PORT_BIT(0x00400000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') // 16 |
| 1229 | PORT_BIT(0x00800000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)0) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') // 17 |
| 1230 | PORT_BIT(0xff000000, IP_ACTIVE_HIGH, IPT_UNUSED) // 18-1f |
| 1257 | 1231 | |
| 1258 | 1232 | PORT_START("keyboard_1") |
| 1259 | | PORT_BIT(0x00000001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') // 20 |
| 1260 | | PORT_BIT(0x00000002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') // 21 |
| 1261 | | PORT_BIT(0x00000004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') // 22 |
| 1262 | | PORT_BIT(0x00000008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') // 23 |
| 1263 | | PORT_BIT(0x00000010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') // 24 |
| 1264 | | PORT_BIT(0x00000020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') // 25 |
| 1265 | | PORT_BIT(0x00000040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') // 26 |
| 1266 | | PORT_BIT(0x00000080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') // 27 |
| 1267 | | PORT_BIT(0x0000ff00, IP_ACTIVE_HIGH, IPT_UNUSED) // 28-2f |
| 1268 | | PORT_BIT(0x00010000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') // 30 |
| 1269 | | PORT_BIT(0x00020000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') // 31 |
| 1270 | | PORT_BIT(0x00040000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') // 32 |
| 1271 | | PORT_BIT(0x00080000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') // 33 |
| 1272 | | PORT_BIT(0x00100000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') // 34 |
| 1273 | | PORT_BIT(0x00200000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') // 35 |
| 1274 | | PORT_BIT(0x00400000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') // 36 |
| 1275 | | PORT_BIT(0x00800000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR('+') // 37 |
| 1276 | | PORT_BIT(0xff000000, IP_ACTIVE_HIGH, IPT_UNUSED) // 38-3f |
| 1233 | PORT_BIT(0x00000001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') // 20 |
| 1234 | PORT_BIT(0x00000002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') // 21 |
| 1235 | PORT_BIT(0x00000004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') // 22 |
| 1236 | PORT_BIT(0x00000008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') // 23 |
| 1237 | PORT_BIT(0x00000010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') // 24 |
| 1238 | PORT_BIT(0x00000020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') // 25 |
| 1239 | PORT_BIT(0x00000040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') // 26 |
| 1240 | PORT_BIT(0x00000080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') // 27 |
| 1241 | PORT_BIT(0x0000ff00, IP_ACTIVE_HIGH, IPT_UNUSED) // 28-2f |
| 1242 | PORT_BIT(0x00010000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') // 30 |
| 1243 | PORT_BIT(0x00020000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') // 31 |
| 1244 | PORT_BIT(0x00040000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') // 32 |
| 1245 | PORT_BIT(0x00080000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') // 33 |
| 1246 | PORT_BIT(0x00100000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') // 34 |
| 1247 | PORT_BIT(0x00200000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') // 35 |
| 1248 | PORT_BIT(0x00400000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') // 36 |
| 1249 | PORT_BIT(0x00800000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)1) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR('+') // 37 |
| 1250 | PORT_BIT(0xff000000, IP_ACTIVE_HIGH, IPT_UNUSED) // 38-3f |
| 1277 | 1251 | |
| 1278 | 1252 | PORT_START("keyboard_2") |
| 1279 | | PORT_BIT(0x00000001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') // 40 |
| 1280 | | PORT_BIT(0x00000002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') // 41 |
| 1281 | | PORT_BIT(0x00000004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') // 42 |
| 1282 | | PORT_BIT(0x00000008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') // 43 |
| 1283 | | PORT_BIT(0x00000010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') // 44 |
| 1284 | | PORT_BIT(0x00000020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') // 45 |
| 1285 | | PORT_BIT(0x00000040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_F9) PORT_CHAR('[') PORT_CHAR('{') // 46 |
| 1286 | | PORT_BIT(0x00000080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_F10) PORT_CHAR(']') PORT_CHAR('}') // 47 |
| 1287 | | PORT_BIT(0x0000ff00, IP_ACTIVE_HIGH, IPT_UNUSED) // 48-4f |
| 1288 | | PORT_BIT(0x00010000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') // 50 |
| 1289 | | PORT_BIT(0x00020000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') // 51 |
| 1290 | | PORT_BIT(0x00040000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR('_') // 52 |
| 1291 | | PORT_BIT(0x00080000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') // 53 |
| 1292 | | PORT_BIT(0x00100000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('^') PORT_CHAR('~') // 54 |
| 1293 | | PORT_BIT(0x00200000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) // 55 |
| 1294 | | PORT_BIT(0x00400000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) PORT_CHAR(UCHAR_MAMEKEY(HOME)) // 56 |
| 1295 | | PORT_BIT(0x00800000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_TAB) PORT_CHAR('\t') // 57 |
| 1296 | | PORT_BIT(0xff000000, IP_ACTIVE_HIGH, IPT_UNUSED) // 58-5f |
| 1253 | PORT_BIT(0x00000001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') // 40 |
| 1254 | PORT_BIT(0x00000002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') // 41 |
| 1255 | PORT_BIT(0x00000004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') // 42 |
| 1256 | PORT_BIT(0x00000008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') // 43 |
| 1257 | PORT_BIT(0x00000010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') // 44 |
| 1258 | PORT_BIT(0x00000020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') // 45 |
| 1259 | PORT_BIT(0x00000040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_F9) PORT_CHAR('[') PORT_CHAR('{') // 46 |
| 1260 | PORT_BIT(0x00000080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_F10) PORT_CHAR(']') PORT_CHAR('}') // 47 |
| 1261 | PORT_BIT(0x0000ff00, IP_ACTIVE_HIGH, IPT_UNUSED) // 48-4f |
| 1262 | PORT_BIT(0x00010000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') // 50 |
| 1263 | PORT_BIT(0x00020000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') // 51 |
| 1264 | PORT_BIT(0x00040000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR('_') // 52 |
| 1265 | PORT_BIT(0x00080000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') // 53 |
| 1266 | PORT_BIT(0x00100000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('^') PORT_CHAR('~') // 54 |
| 1267 | PORT_BIT(0x00200000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) // 55 |
| 1268 | PORT_BIT(0x00400000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) PORT_CHAR(UCHAR_MAMEKEY(HOME)) // 56 |
| 1269 | PORT_BIT(0x00800000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)2) PORT_CODE(KEYCODE_TAB) PORT_CHAR('\t') // 57 |
| 1270 | PORT_BIT(0xff000000, IP_ACTIVE_HIGH, IPT_UNUSED) // 58-5f |
| 1297 | 1271 | |
| 1298 | 1272 | PORT_START("keyboard_3") |
| 1299 | | PORT_BIT(0x00000001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') // 60 |
| 1300 | | PORT_BIT(0x00000002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') // 61 |
| 1301 | | PORT_BIT(0x00000004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('@') PORT_CHAR(96) // 62 |
| 1302 | | PORT_BIT(0x00000008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) // 63 |
| 1303 | | PORT_BIT(0x00000010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) // 64 |
| 1304 | | PORT_BIT(0x00000020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) // 65 |
| 1305 | | PORT_BIT(0x00000040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') // 66 |
| 1306 | | PORT_BIT(0x00000080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') // 67 |
| 1307 | | PORT_BIT(0x0000ff00, IP_ACTIVE_HIGH, IPT_UNUSED) // 48-4f |
| 1308 | | PORT_BIT(0x00010000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(':') PORT_CHAR('*') // 70 |
| 1309 | | PORT_BIT(0x00020000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) // 71 |
| 1310 | | PORT_BIT(0x00040000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|') // 72 |
| 1311 | | PORT_BIT(0x00080000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') // 73 |
| 1312 | | PORT_BIT(0x00100000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') // 74 |
| 1313 | | PORT_BIT(0x00200000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') // 75 |
| 1314 | | PORT_BIT(0x00400000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') // 76 |
| 1315 | | PORT_BIT(0x00800000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') // 77 |
| 1316 | | PORT_BIT(0xff000000, IP_ACTIVE_HIGH, IPT_UNUSED) // 58-5f |
| 1273 | PORT_BIT(0x00000001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') // 60 |
| 1274 | PORT_BIT(0x00000002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') // 61 |
| 1275 | PORT_BIT(0x00000004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('@') PORT_CHAR(96) // 62 |
| 1276 | PORT_BIT(0x00000008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) // 63 |
| 1277 | PORT_BIT(0x00000010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) // 64 |
| 1278 | PORT_BIT(0x00000020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) // 65 |
| 1279 | PORT_BIT(0x00000040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') // 66 |
| 1280 | PORT_BIT(0x00000080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') // 67 |
| 1281 | PORT_BIT(0x0000ff00, IP_ACTIVE_HIGH, IPT_UNUSED) // 48-4f |
| 1282 | PORT_BIT(0x00010000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(':') PORT_CHAR('*') // 70 |
| 1283 | PORT_BIT(0x00020000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) // 71 |
| 1284 | PORT_BIT(0x00040000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|') // 72 |
| 1285 | PORT_BIT(0x00080000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') // 73 |
| 1286 | PORT_BIT(0x00100000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') // 74 |
| 1287 | PORT_BIT(0x00200000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') // 75 |
| 1288 | PORT_BIT(0x00400000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') // 76 |
| 1289 | PORT_BIT(0x00800000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)3) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') // 77 |
| 1290 | PORT_BIT(0xff000000, IP_ACTIVE_HIGH, IPT_UNUSED) // 58-5f |
| 1317 | 1291 | |
| 1318 | 1292 | PORT_START("keyboard_4") |
| 1319 | | PORT_BIT(0x00000001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)4) PORT_CODE(KEYCODE_INSERT) PORT_CHAR(UCHAR_MAMEKEY(INSERT)) PORT_CHAR(UCHAR_MAMEKEY(PRTSCR)) // 80 |
| 1320 | | PORT_BIT(0x00000002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)4) PORT_CODE(KEYCODE_DEL) PORT_CHAR(UCHAR_MAMEKEY(DEL)) PORT_CHAR(12) // 81 |
| 1321 | | PORT_BIT(0xfffffffc, IP_ACTIVE_HIGH, IPT_UNUSED) // 82-9f |
| 1293 | PORT_BIT(0x00000001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)4) PORT_CODE(KEYCODE_INSERT) PORT_CHAR(UCHAR_MAMEKEY(INSERT)) PORT_CHAR(UCHAR_MAMEKEY(PRTSCR)) // 80 |
| 1294 | PORT_BIT(0x00000002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)4) PORT_CODE(KEYCODE_DEL) PORT_CHAR(UCHAR_MAMEKEY(DEL)) PORT_CHAR(12) // 81 |
| 1295 | PORT_BIT(0xfffffffc, IP_ACTIVE_HIGH, IPT_UNUSED) // 82-9f |
| 1322 | 1296 | |
| 1323 | 1297 | PORT_START("keyboard_5") |
| 1324 | | PORT_BIT(0x00000003, IP_ACTIVE_HIGH, IPT_UNUSED) // a0-a1 |
| 1325 | | PORT_BIT(0x00000004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)5) PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2) // a2 |
| 1326 | | PORT_BIT(0x00000008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)5) PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) // a3 |
| 1327 | | PORT_BIT(0x00000010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)5) PORT_CODE(KEYCODE_LALT) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) // a4 |
| 1328 | | PORT_BIT(0x00000020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)5) PORT_CODE(KEYCODE_RALT) PORT_NAME("Graph") // a5 |
| 1329 | | PORT_BIT(0x00000040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)5) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) // a6 |
| 1330 | | PORT_BIT(0x00000080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)5) PORT_CODE(KEYCODE_NUMLOCK) PORT_CHAR(UCHAR_MAMEKEY(NUMLOCK)) // a7 |
| 1331 | | PORT_BIT(0xffffff00, IP_ACTIVE_HIGH, IPT_UNUSED) // a8-bf /* b2-b7 are the 'make' codes for the above keys */ |
| 1298 | PORT_BIT(0x00000003, IP_ACTIVE_HIGH, IPT_UNUSED) // a0-a1 |
| 1299 | PORT_BIT(0x00000004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)5) PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2) // a2 |
| 1300 | PORT_BIT(0x00000008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)5) PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) // a3 |
| 1301 | PORT_BIT(0x00000010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)5) PORT_CODE(KEYCODE_LALT) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) // a4 |
| 1302 | PORT_BIT(0x00000020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)5) PORT_CODE(KEYCODE_RALT) PORT_NAME("Graph") // a5 |
| 1303 | PORT_BIT(0x00000040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)5) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) // a6 |
| 1304 | PORT_BIT(0x00000080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, px4_state, key_callback, (void *)5) PORT_CODE(KEYCODE_NUMLOCK) PORT_CHAR(UCHAR_MAMEKEY(NUMLOCK)) // a7 |
| 1305 | PORT_BIT(0xffffff00, IP_ACTIVE_HIGH, IPT_UNUSED) // a8-bf /* b2-b7 are the 'make' codes for the above keys */ |
| 1332 | 1306 | INPUT_PORTS_END |
| 1333 | 1307 | |
| 1308 | #if 0 |
| 1309 | |
| 1334 | 1310 | /* item keyboard */ |
| 1335 | | /*static INPUT_PORTS_START( px4_h421a ) |
| 1336 | | PORT_INCLUDE(px4_dips) |
| 1337 | | PORT_INCLUDE(tf20) |
| 1311 | static INPUT_PORTS_START( px4_h421a ) |
| 1312 | PORT_INCLUDE(px4_dips) |
| 1313 | PORT_INCLUDE(tf20) |
| 1338 | 1314 | INPUT_PORTS_END |
| 1339 | | */ |
| 1340 | 1315 | |
| 1341 | | /*************************************************************************** |
| 1342 | | PALETTE |
| 1343 | | ***************************************************************************/ |
| 1316 | #endif |
| 1344 | 1317 | |
| 1318 | //************************************************************************** |
| 1319 | // PALETTE |
| 1320 | //************************************************************************** |
| 1321 | |
| 1345 | 1322 | void px4_state::palette_init() |
| 1346 | 1323 | { |
| 1347 | 1324 | palette_set_color(machine(), 0, MAKE_RGB(138, 146, 148)); |
| 1348 | 1325 | palette_set_color(machine(), 1, MAKE_RGB(92, 83, 88)); |
| 1349 | 1326 | } |
| 1350 | 1327 | |
| 1351 | | PALETTE_INIT_MEMBER(px4_state,px4p) |
| 1328 | PALETTE_INIT_MEMBER(px4_state, px4p) |
| 1352 | 1329 | { |
| 1353 | 1330 | palette_set_color(machine(), 0, MAKE_RGB(149, 157, 130)); |
| 1354 | 1331 | palette_set_color(machine(), 1, MAKE_RGB(92, 83, 88)); |
| 1355 | 1332 | } |
| 1356 | 1333 | |
| 1357 | 1334 | |
| 1358 | | /*************************************************************************** |
| 1359 | | MACHINE DRIVERS |
| 1360 | | ***************************************************************************/ |
| 1335 | //************************************************************************** |
| 1336 | // MACHINE DRIVERS |
| 1337 | //************************************************************************** |
| 1361 | 1338 | |
| 1362 | 1339 | static const cassette_interface px4_cassette_interface = |
| 1363 | 1340 | { |
| r18779 | r18780 | |
| 1369 | 1346 | }; |
| 1370 | 1347 | |
| 1371 | 1348 | static MACHINE_CONFIG_START( px4, px4_state ) |
| 1372 | | |
| 1373 | | /* basic machine hardware */ |
| 1374 | | MCFG_CPU_ADD("maincpu", Z80, XTAL_7_3728MHz / 2) /* uPD70008 */ |
| 1349 | // basic machine hardware |
| 1350 | MCFG_CPU_ADD("maincpu", Z80, XTAL_7_3728MHz / 2) // uPD70008 |
| 1375 | 1351 | MCFG_CPU_PROGRAM_MAP(px4_mem) |
| 1376 | 1352 | MCFG_CPU_IO_MAP(px4_io) |
| 1377 | 1353 | |
| 1378 | | |
| 1379 | | /* video hardware */ |
| 1354 | // video hardware |
| 1380 | 1355 | MCFG_SCREEN_ADD("screen", LCD) |
| 1381 | 1356 | MCFG_SCREEN_REFRESH_RATE(72) |
| 1382 | 1357 | MCFG_SCREEN_SIZE(240, 64) |
| r18779 | r18780 | |
| 1390 | 1365 | MCFG_TIMER_DRIVER_ADD_PERIODIC("one_sec", px4_state, upd7508_1sec_callback, attotime::from_seconds(1)) |
| 1391 | 1366 | MCFG_TIMER_DRIVER_ADD_PERIODIC("frc", px4_state, frc_tick, attotime::from_hz(XTAL_7_3728MHz / 2 / 6)) |
| 1392 | 1367 | |
| 1393 | | /* internal ram */ |
| 1368 | // internal ram |
| 1394 | 1369 | MCFG_RAM_ADD(RAM_TAG) |
| 1395 | 1370 | MCFG_RAM_DEFAULT_SIZE("64k") |
| 1396 | 1371 | |
| 1397 | | /* centronics printer */ |
| 1372 | // centronics printer |
| 1398 | 1373 | MCFG_CENTRONICS_PRINTER_ADD("centronics", standard_centronics) |
| 1399 | 1374 | |
| 1400 | | /* external cassette */ |
| 1375 | // external cassette |
| 1401 | 1376 | MCFG_CASSETTE_ADD("extcas", px4_cassette_interface) |
| 1402 | 1377 | |
| 1403 | | /* rom capsules */ |
| 1378 | // rom capsules |
| 1404 | 1379 | MCFG_CARTSLOT_ADD("capsule1") |
| 1405 | 1380 | MCFG_CARTSLOT_NOT_MANDATORY |
| 1406 | 1381 | MCFG_CARTSLOT_ADD("capsule2") |
| 1407 | 1382 | MCFG_CARTSLOT_NOT_MANDATORY |
| 1408 | 1383 | |
| 1409 | | /* tf20 floppy drive */ |
| 1410 | | MCFG_TF20_ADD("floppy") |
| 1384 | // tf20 floppy drive |
| 1385 | MCFG_TF20_ADD("floppy") |
| 1411 | 1386 | MACHINE_CONFIG_END |
| 1412 | 1387 | |
| 1413 | 1388 | static MACHINE_CONFIG_DERIVED( px4p, px4 ) |
| 1414 | | |
| 1415 | 1389 | MCFG_CPU_MODIFY("maincpu") |
| 1416 | 1390 | MCFG_CPU_IO_MAP(px4p_io) |
| 1417 | 1391 | |
| 1418 | | MCFG_MACHINE_START_OVERRIDE(px4_state,px4_ramdisk) |
| 1392 | MCFG_MACHINE_START_OVERRIDE(px4_state, px4_ramdisk) |
| 1419 | 1393 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 1420 | 1394 | |
| 1421 | | MCFG_PALETTE_INIT_OVERRIDE(px4_state,px4p) |
| 1395 | MCFG_PALETTE_INIT_OVERRIDE(px4_state, px4p) |
| 1422 | 1396 | |
| 1423 | 1397 | MCFG_CARTSLOT_ADD("ramdisk") |
| 1424 | 1398 | MCFG_CARTSLOT_NOT_MANDATORY |
| 1425 | 1399 | MACHINE_CONFIG_END |
| 1426 | 1400 | |
| 1427 | 1401 | |
| 1428 | | /*************************************************************************** |
| 1429 | | ROM DEFINITIONS |
| 1430 | | ***************************************************************************/ |
| 1402 | //************************************************************************** |
| 1403 | // ROM DEFINITIONS |
| 1404 | //************************************************************************** |
| 1431 | 1405 | |
| 1432 | | /* Note: We are missing "Kana OS V1.0" and "Kana OS V2.0" (Japanese version) */ |
| 1406 | // Note: We are missing "Kana OS V1.0" and "Kana OS V2.0" (Japanese version) |
| 1433 | 1407 | |
| 1434 | 1408 | ROM_START( px4 ) |
| 1435 | | ROM_REGION(0x8000, "os", 0) |
| 1436 | | ROM_LOAD("m25122aa_po_px4.10c", 0x0000, 0x8000, CRC(62d60dc6) SHA1(3d32ec79a317de7c84c378302e95f48d56505502)) |
| 1409 | ROM_REGION(0x8000, "os", 0) |
| 1410 | ROM_LOAD("m25122aa_po_px4.10c", 0x0000, 0x8000, CRC(62d60dc6) SHA1(3d32ec79a317de7c84c378302e95f48d56505502)) |
| 1437 | 1411 | |
| 1438 | | ROM_REGION(0x1000, "slave", 0) |
| 1439 | | ROM_LOAD("upd7508.bin", 0x0000, 0x1000, NO_DUMP) |
| 1412 | ROM_REGION(0x1000, "slave", 0) |
| 1413 | ROM_LOAD("upd7508.bin", 0x0000, 0x1000, NO_DUMP) |
| 1440 | 1414 | |
| 1441 | 1415 | ROM_REGION(0x8000, "capsule1", 0) |
| 1442 | 1416 | ROM_CART_LOAD("capsule1", 0x0000, 0x8000, ROM_OPTIONAL) |
| r18779 | r18780 | |
| 1446 | 1420 | ROM_END |
| 1447 | 1421 | |
| 1448 | 1422 | ROM_START( px4p ) |
| 1449 | | ROM_REGION(0x8000, "os", 0) |
| 1450 | | ROM_LOAD("b0_pxa.10c", 0x0000, 0x8000, CRC(d74b9ef5) SHA1(baceee076c12f5a16f7a26000e9bc395d021c455)) |
| 1423 | ROM_REGION(0x8000, "os", 0) |
| 1424 | ROM_LOAD("b0_pxa.10c", 0x0000, 0x8000, CRC(d74b9ef5) SHA1(baceee076c12f5a16f7a26000e9bc395d021c455)) |
| 1451 | 1425 | |
| 1452 | | ROM_REGION(0x1000, "slave", 0) |
| 1453 | | ROM_LOAD("upd7508.bin", 0x0000, 0x1000, NO_DUMP) |
| 1426 | ROM_REGION(0x1000, "slave", 0) |
| 1427 | ROM_LOAD("upd7508.bin", 0x0000, 0x1000, NO_DUMP) |
| 1454 | 1428 | |
| 1455 | | ROM_REGION(0x8000, "capsule1", 0) |
| 1456 | | ROM_CART_LOAD("capsule1", 0x0000, 0x8000, ROM_OPTIONAL) |
| 1429 | ROM_REGION(0x8000, "capsule1", 0) |
| 1430 | ROM_CART_LOAD("capsule1", 0x0000, 0x8000, ROM_OPTIONAL) |
| 1457 | 1431 | |
| 1458 | | ROM_REGION(0x8000, "capsule2", 0) |
| 1459 | | ROM_CART_LOAD("capsule2", 0x0000, 0x8000, ROM_OPTIONAL) |
| 1432 | ROM_REGION(0x8000, "capsule2", 0) |
| 1433 | ROM_CART_LOAD("capsule2", 0x0000, 0x8000, ROM_OPTIONAL) |
| 1460 | 1434 | |
| 1461 | | ROM_REGION(0x20000, "ramdisk", 0) |
| 1462 | | ROM_CART_LOAD("ramdisk", 0x0000, 0x20000, ROM_OPTIONAL | ROM_MIRROR) |
| 1435 | ROM_REGION(0x20000, "ramdisk", 0) |
| 1436 | ROM_CART_LOAD("ramdisk", 0x0000, 0x20000, ROM_OPTIONAL | ROM_MIRROR) |
| 1463 | 1437 | ROM_END |
| 1464 | 1438 | |
| 1465 | 1439 | |
| 1466 | | /*************************************************************************** |
| 1467 | | GAME DRIVERS |
| 1468 | | ***************************************************************************/ |
| 1440 | //************************************************************************** |
| 1441 | // GAME DRIVERS |
| 1442 | //************************************************************************** |
| 1469 | 1443 | |
| 1470 | | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 1471 | | COMP( 1985, px4, 0, 0, px4, px4_h450a, px4_state, px4, "Epson", "PX-4", GAME_NO_SOUND ) |
| 1472 | | COMP( 1985, px4p, px4, 0, px4p, px4_h450a, px4_state, px4p, "Epson", "PX-4+", GAME_NO_SOUND ) |
| 1444 | // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS |
| 1445 | COMP( 1985, px4, 0, 0, px4, px4_h450a, px4_state, px4, "Epson", "PX-4", GAME_NO_SOUND_HW ) |
| 1446 | COMP( 1985, px4p, px4, 0, px4p, px4_h450a, px4_state, px4p, "Epson", "PX-4+", GAME_NO_SOUND_HW ) |