src/mame/drivers/cidelsa.c
| r2663 | r2664 | |
| 373 | 373 | |
| 374 | 374 | static CUSTOM_INPUT( cdp1869_pcb_r ) |
| 375 | 375 | { |
| 376 | | cidelsa_state *state = machine->driver_data; |
| 376 | cidelsa_state *state = field->port->machine->driver_data; |
| 377 | 377 | |
| 378 | 378 | return state->cdp1869_pcb; |
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | static CUSTOM_INPUT( cdp1869_predisplay_r ) |
| 382 | 382 | { |
| 383 | | cidelsa_state *state = machine->driver_data; |
| 383 | cidelsa_state *state = field->port->machine->driver_data; |
| 384 | 384 | |
| 385 | 385 | return state->cdp1869_prd; |
| 386 | 386 | } |
| r2663 | r2664 | |
| 394 | 394 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) // LF |
| 395 | 395 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) // FR |
| 396 | 396 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 397 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(cdp1869_pcb_r, 0) |
| 397 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(cdp1869_pcb_r, 0) |
| 398 | 398 | |
| 399 | 399 | PORT_START_TAG("IN1") |
| 400 | 400 | PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) ) |
| r2663 | r2664 | |
| 434 | 434 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) // LF |
| 435 | 435 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) // FR |
| 436 | 436 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 437 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(cdp1869_pcb_r, 0) |
| 437 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(cdp1869_pcb_r, 0) |
| 438 | 438 | |
| 439 | 439 | PORT_START_TAG("IN1") |
| 440 | 440 | PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) ) |
| r2663 | r2664 | |
| 484 | 484 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 485 | 485 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 486 | 486 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 487 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(cdp1869_pcb_r, 0) |
| 487 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(cdp1869_pcb_r, 0) |
| 488 | 488 | |
| 489 | 489 | PORT_START_TAG("IN1") |
| 490 | 490 | PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) ) |
src/emu/video/cdp1869.c
| r2663 | r2664 | |
| 582 | 582 | { |
| 583 | 583 | cdp1869_t *cdp1869 = get_safe_token(device); |
| 584 | 584 | |
| 585 | UINT8 cma = offset & 0x0f; |
| 586 | UINT16 pma; |
| 587 | |
| 585 | 588 | if (cdp1869->cmem) |
| 586 | 589 | { |
| 587 | | UINT16 pma = cdp1869_get_pma(device); |
| 588 | | UINT8 cma = offset & 0x0f; |
| 589 | | |
| 590 | | if (cdp1869_get_lines(device) == 8) |
| 591 | | { |
| 592 | | cma &= 0x07; |
| 593 | | } |
| 594 | | |
| 595 | | return cdp1869->intf->char_ram_r(device, pma, cma); |
| 590 | pma = cdp1869_get_pma(device); |
| 596 | 591 | } |
| 597 | 592 | else |
| 598 | 593 | { |
| 599 | | return 0xff; |
| 594 | pma = offset; |
| 600 | 595 | } |
| 596 | |
| 597 | if (cdp1869->dblpage) |
| 598 | { |
| 599 | cma &= 0x07; |
| 600 | } |
| 601 | |
| 602 | return cdp1869->intf->char_ram_r(device, pma, cma); |
| 601 | 603 | } |
| 602 | 604 | |
| 603 | 605 | WRITE8_DEVICE_HANDLER( cdp1869_charram_w ) |
| 604 | 606 | { |
| 605 | 607 | cdp1869_t *cdp1869 = get_safe_token(device); |
| 606 | 608 | |
| 609 | UINT8 cma = offset & 0x0f; |
| 610 | UINT16 pma; |
| 611 | |
| 607 | 612 | if (cdp1869->cmem) |
| 608 | 613 | { |
| 609 | | UINT16 pma = cdp1869_get_pma(device); |
| 610 | | UINT8 cma = offset & 0x0f; |
| 614 | pma = cdp1869_get_pma(device); |
| 615 | } |
| 616 | else |
| 617 | { |
| 618 | pma = offset; |
| 619 | } |
| 611 | 620 | |
| 612 | | if (cdp1869_get_lines(device) == 8) |
| 613 | | { |
| 614 | | cma &= 0x07; |
| 615 | | } |
| 621 | if (cdp1869->dblpage) |
| 622 | { |
| 623 | cma &= 0x07; |
| 624 | } |
| 616 | 625 | |
| 617 | | if (cdp1869->intf->char_ram_w) |
| 618 | | { |
| 619 | | cdp1869->intf->char_ram_w(device, pma, cma, data); |
| 620 | | } |
| 626 | if (cdp1869->intf->char_ram_w) |
| 627 | { |
| 628 | cdp1869->intf->char_ram_w(device, pma, cma, data); |
| 621 | 629 | } |
| 622 | 630 | } |
| 623 | 631 | |