trunk/src/mess/machine/nes.c
| r18105 | r18106 | |
| 332 | 332 | int cfg = ioport("CTRLSEL")->read(); |
| 333 | 333 | int ret; |
| 334 | 334 | |
| 335 | | if ((cfg & 0x000f) >= 0x07) // for now we treat the FC keyboard separately from other inputs! |
| 335 | if ((cfg & 0x000f) >= 0x08) // for now we treat the FC keyboard separately from other inputs! |
| 336 | 336 | { |
| 337 | 337 | // here we should have the tape input |
| 338 | 338 | ret = 0; |
| r18105 | r18106 | |
| 384 | 384 | static UINT8 nes_read_fc_keyboard_line( running_machine &machine, UINT8 scan, UINT8 mode ) |
| 385 | 385 | { |
| 386 | 386 | static const char *const fc_keyport_names[] = { "FCKEY0", "FCKEY1", "FCKEY2", "FCKEY3", "FCKEY4", "FCKEY5", "FCKEY6", "FCKEY7", "FCKEY8" }; |
| 387 | | return ((machine.root_device().ioport(fc_keyport_names[scan])->read() >> (mode * 4)) & 0x0f) << 1; |
| 387 | nes_state *state = machine.driver_data<nes_state>(); |
| 388 | return ((state->ioport(fc_keyport_names[scan])->read() >> (mode * 4)) & 0x0f) << 1; |
| 388 | 389 | } |
| 389 | 390 | |
| 390 | 391 | static UINT8 nes_read_subor_keyboard_line( running_machine &machine, UINT8 scan, UINT8 mode ) |
| 391 | 392 | { |
| 392 | 393 | static const char *const sub_keyport_names[] = { "SUBKEY0", "SUBKEY1", "SUBKEY2", "SUBKEY3", "SUBKEY4", |
| 393 | 394 | "SUBKEY5", "SUBKEY6", "SUBKEY7", "SUBKEY8", "SUBKEY9", "SUBKEY10", "SUBKEY11", "SUBKEY12" }; |
| 394 | | return ((machine.root_device().ioport(sub_keyport_names[scan])->read() >> (mode * 4)) & 0x0f) << 1; |
| 395 | nes_state *state = machine.driver_data<nes_state>(); |
| 396 | return ((state->ioport(sub_keyport_names[scan])->read() >> (mode * 4)) & 0x0f) << 1; |
| 395 | 397 | } |
| 396 | 398 | |
| 397 | 399 | READ8_MEMBER(nes_state::nes_IN1_r) |
| r18105 | r18106 | |
| 399 | 401 | int cfg = ioport("CTRLSEL")->read(); |
| 400 | 402 | int ret; |
| 401 | 403 | |
| 402 | | if ((cfg & 0x000f) == 0x07) // for now we treat the FC keyboard separately from other inputs! |
| 404 | if ((cfg & 0x000f) == 0x08) // for now we treat the FC keyboard separately from other inputs! |
| 403 | 405 | { |
| 404 | 406 | if (m_fck_scan < 9) |
| 405 | 407 | ret = ~nes_read_fc_keyboard_line(machine(), m_fck_scan, m_fck_mode) & 0x1e; |
| 406 | 408 | else |
| 407 | 409 | ret = 0x1e; |
| 408 | 410 | } |
| 409 | | else if ((cfg & 0x000f) == 0x08) // for now we treat the Subor keyboard separately from other inputs! |
| 411 | else if ((cfg & 0x000f) == 0x09) // for now we treat the Subor keyboard separately from other inputs! |
| 410 | 412 | { |
| 411 | 413 | if (m_fck_scan < 12) |
| 412 | 414 | ret = ~nes_read_subor_keyboard_line(machine(), m_fck_scan, m_fck_mode) & 0x1e; |
| r18105 | r18106 | |
| 554 | 556 | /* Check if lightgun has been chosen as input: if so, enable crosshair */ |
| 555 | 557 | machine().scheduler().timer_set(attotime::zero, FUNC(lightgun_tick)); |
| 556 | 558 | |
| 557 | | if ((cfg & 0x000f) >= 0x07) // for now we treat the FC keyboard separately from other inputs! |
| 559 | if ((cfg & 0x000f) >= 0x08) // for now we treat the FC keyboard separately from other inputs! |
| 558 | 560 | { |
| 559 | 561 | // here we should also have the tape output |
| 560 | 562 | |