From d41a31dd1260ece2f94cde76112c8389d5e9f1d0 Mon Sep 17 00:00:00 2001 From: Curt Coder Date: Mon, 19 May 2008 15:38:19 +0000 Subject: [PATCH] Fixed CDP1869 character memory access, and Cidelsa sprite flashing. --- src/emu/video/cdp1869.c | 48 ++++++++++++++++++++++---------------- src/mame/drivers/cidelsa.c | 6 ++--- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/src/emu/video/cdp1869.c b/src/emu/video/cdp1869.c index 7ffffc97c3a..fe4160572b5 100644 --- a/src/emu/video/cdp1869.c +++ b/src/emu/video/cdp1869.c @@ -582,42 +582,50 @@ READ8_DEVICE_HANDLER( cdp1869_charram_r ) { cdp1869_t *cdp1869 = get_safe_token(device); + UINT8 cma = offset & 0x0f; + UINT16 pma; + if (cdp1869->cmem) { - UINT16 pma = cdp1869_get_pma(device); - UINT8 cma = offset & 0x0f; - - if (cdp1869_get_lines(device) == 8) - { - cma &= 0x07; - } - - return cdp1869->intf->char_ram_r(device, pma, cma); + pma = cdp1869_get_pma(device); } else { - return 0xff; + pma = offset; } + + if (cdp1869->dblpage) + { + cma &= 0x07; + } + + return cdp1869->intf->char_ram_r(device, pma, cma); } WRITE8_DEVICE_HANDLER( cdp1869_charram_w ) { cdp1869_t *cdp1869 = get_safe_token(device); + UINT8 cma = offset & 0x0f; + UINT16 pma; + if (cdp1869->cmem) { - UINT16 pma = cdp1869_get_pma(device); - UINT8 cma = offset & 0x0f; + pma = cdp1869_get_pma(device); + } + else + { + pma = offset; + } - if (cdp1869_get_lines(device) == 8) - { - cma &= 0x07; - } + if (cdp1869->dblpage) + { + cma &= 0x07; + } - if (cdp1869->intf->char_ram_w) - { - cdp1869->intf->char_ram_w(device, pma, cma, data); - } + if (cdp1869->intf->char_ram_w) + { + cdp1869->intf->char_ram_w(device, pma, cma, data); } } diff --git a/src/mame/drivers/cidelsa.c b/src/mame/drivers/cidelsa.c index a459957423d..93e23d6c839 100644 --- a/src/mame/drivers/cidelsa.c +++ b/src/mame/drivers/cidelsa.c @@ -394,7 +394,7 @@ static INPUT_PORTS_START( destryer ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) // LF PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) // FR PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(cdp1869_pcb_r, 0) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(cdp1869_pcb_r, 0) PORT_START_TAG("IN1") PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) ) @@ -434,7 +434,7 @@ static INPUT_PORTS_START( altair ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) // LF PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) // FR PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(cdp1869_pcb_r, 0) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(cdp1869_pcb_r, 0) PORT_START_TAG("IN1") PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) ) @@ -484,7 +484,7 @@ static INPUT_PORTS_START( draco ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(cdp1869_pcb_r, 0) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(cdp1869_pcb_r, 0) PORT_START_TAG("IN1") PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) )