mirror of
https://github.com/holub/mame
synced 2025-06-06 12:53:46 +03:00
[CDP1869] Added a macro for the interface, and made write handlers optional.
This commit is contained in:
parent
63acd17b6a
commit
e8abef328c
@ -2,8 +2,8 @@
|
|||||||
#include "sndintrf.h"
|
#include "sndintrf.h"
|
||||||
#include "streams.h"
|
#include "streams.h"
|
||||||
#include "cpu/cdp1802/cdp1802.h"
|
#include "cpu/cdp1802/cdp1802.h"
|
||||||
#include "video/cdp1869.h"
|
|
||||||
#include "sound/cdp1869.h"
|
#include "sound/cdp1869.h"
|
||||||
|
#include "video/cdp1869.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
@ -569,8 +569,11 @@ WRITE8_DEVICE_HANDLER( cdp1869_pageram_w )
|
|||||||
pma = offset;
|
pma = offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cdp1869->intf->page_ram_w)
|
||||||
|
{
|
||||||
cdp1869->intf->page_ram_w(device, pma, data);
|
cdp1869->intf->page_ram_w(device, pma, data);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Character RAM Access */
|
/* Character RAM Access */
|
||||||
|
|
||||||
@ -610,9 +613,12 @@ WRITE8_DEVICE_HANDLER( cdp1869_charram_w )
|
|||||||
cma &= 0x07;
|
cma &= 0x07;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cdp1869->intf->char_ram_w)
|
||||||
|
{
|
||||||
cdp1869->intf->char_ram_w(device, pma, cma, data);
|
cdp1869->intf->char_ram_w(device, pma, cma, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Screen Update */
|
/* Screen Update */
|
||||||
|
|
||||||
@ -776,10 +782,8 @@ static DEVICE_START( cdp1869 )
|
|||||||
cdp1869->intf = device->static_config;
|
cdp1869->intf = device->static_config;
|
||||||
|
|
||||||
assert(cdp1869->intf->page_ram_r != NULL);
|
assert(cdp1869->intf->page_ram_r != NULL);
|
||||||
assert(cdp1869->intf->page_ram_w != NULL);
|
|
||||||
assert(cdp1869->intf->pcb_r != NULL);
|
assert(cdp1869->intf->pcb_r != NULL);
|
||||||
assert(cdp1869->intf->char_ram_r != NULL);
|
assert(cdp1869->intf->char_ram_r != NULL);
|
||||||
assert(cdp1869->intf->char_ram_w != NULL);
|
|
||||||
|
|
||||||
// set initial values
|
// set initial values
|
||||||
|
|
||||||
|
@ -132,6 +132,7 @@ struct _cdp1869_interface
|
|||||||
/* if specified, this gets called for every change of the predisplay pin (CDP1870/76 pin 1) */
|
/* if specified, this gets called for every change of the predisplay pin (CDP1870/76 pin 1) */
|
||||||
cdp1869_on_prd_changed_func on_prd_changed;
|
cdp1869_on_prd_changed_func on_prd_changed;
|
||||||
};
|
};
|
||||||
|
#define CDP1869_INTERFACE(name) const cdp1869_interface (name) =
|
||||||
|
|
||||||
/* device interface */
|
/* device interface */
|
||||||
DEVICE_GET_INFO( cdp1869_video );
|
DEVICE_GET_INFO( cdp1869_video );
|
||||||
@ -139,7 +140,7 @@ DEVICE_GET_INFO( cdp1869_video );
|
|||||||
/* palette initialization */
|
/* palette initialization */
|
||||||
PALETTE_INIT( cdp1869 );
|
PALETTE_INIT( cdp1869 );
|
||||||
|
|
||||||
/* io port access */
|
/* register access */
|
||||||
WRITE8_DEVICE_HANDLER( cdp1869_out3_w );
|
WRITE8_DEVICE_HANDLER( cdp1869_out3_w );
|
||||||
WRITE8_DEVICE_HANDLER( cdp1869_out4_w );
|
WRITE8_DEVICE_HANDLER( cdp1869_out4_w );
|
||||||
WRITE8_DEVICE_HANDLER( cdp1869_out5_w );
|
WRITE8_DEVICE_HANDLER( cdp1869_out5_w );
|
||||||
@ -154,7 +155,7 @@ WRITE8_DEVICE_HANDLER ( cdp1869_charram_w );
|
|||||||
READ8_DEVICE_HANDLER ( cdp1869_pageram_r );
|
READ8_DEVICE_HANDLER ( cdp1869_pageram_r );
|
||||||
WRITE8_DEVICE_HANDLER ( cdp1869_pageram_w );
|
WRITE8_DEVICE_HANDLER ( cdp1869_pageram_w );
|
||||||
|
|
||||||
/* updates the screen */
|
/* screen update */
|
||||||
void cdp1869_update(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect);
|
void cdp1869_update(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -182,7 +182,7 @@ static const cdp1869_interface altair_cdp1869_intf =
|
|||||||
cidelsa_prd_changed,
|
cidelsa_prd_changed,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const cdp1869_interface draco_cdp1869_intf =
|
static CDP1869_INTERFACE( draco_cdp1869_intf )
|
||||||
{
|
{
|
||||||
SCREEN_TAG,
|
SCREEN_TAG,
|
||||||
DRACO_CHR2,
|
DRACO_CHR2,
|
||||||
|
Loading…
Reference in New Issue
Block a user