Previous 15994 Revisions Next

r2664 Monday 19th May, 2008 at 15:40:15 UTC by Curt Coder
[CDP1869] Fixed character memory access.
[src/emu/video]cdp1869.c
[src/mame/drivers]cidelsa.c

src/mame/drivers/cidelsa.c
r2663r2664
373373
374374static CUSTOM_INPUT( cdp1869_pcb_r )
375375{
376   cidelsa_state *state = machine->driver_data;
376   cidelsa_state *state = field->port->machine->driver_data;
377377
378378   return state->cdp1869_pcb;
379379}
380380
381381static CUSTOM_INPUT( cdp1869_predisplay_r )
382382{
383   cidelsa_state *state = machine->driver_data;
383   cidelsa_state *state = field->port->machine->driver_data;
384384
385385   return state->cdp1869_prd;
386386}
r2663r2664
394394   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) // LF
395395   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) // FR
396396   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)
398398
399399   PORT_START_TAG("IN1")
400400   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) )
r2663r2664
434434   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) // LF
435435   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) // FR
436436   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)
438438
439439   PORT_START_TAG("IN1")
440440   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) )
r2663r2664
484484   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
485485   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
486486   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)
488488
489489   PORT_START_TAG("IN1")
490490   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) )
src/emu/video/cdp1869.c
r2663r2664
582582{
583583   cdp1869_t *cdp1869 = get_safe_token(device);
584584
585   UINT8 cma = offset & 0x0f;
586   UINT16 pma;
587
585588   if (cdp1869->cmem)
586589   {
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);
596591   }
597592   else
598593   {
599      return 0xff;
594      pma = offset;
600595   }
596
597   if (cdp1869->dblpage)
598   {
599      cma &= 0x07;
600   }
601
602   return cdp1869->intf->char_ram_r(device, pma, cma);
601603}
602604
603605WRITE8_DEVICE_HANDLER( cdp1869_charram_w )
604606{
605607   cdp1869_t *cdp1869 = get_safe_token(device);
606608
609   UINT8 cma = offset & 0x0f;
610   UINT16 pma;
611
607612   if (cdp1869->cmem)
608613   {
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   }
611620
612      if (cdp1869_get_lines(device) == 8)
613      {
614         cma &= 0x07;
615      }
621   if (cdp1869->dblpage)
622   {
623      cma &= 0x07;
624   }
616625
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);
621629   }
622630}
623631

Previous 15994 Revisions Next


© 1998-2018 The MESS Team