summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess
diff options
context:
space:
mode:
author cracyc <cracyc@users.noreply.github.com>2015-09-20 10:28:58 -0500
committer cracyc <cracyc@users.noreply.github.com>2015-09-20 10:28:58 -0500
commit0bb208ce12059a112308d682c4691cc4db6c79b0 (patch)
tree115a9621082ea02013cf4c98e6292d1ef2d773a7 /src/mess
parent164d9513d535c2448bfe40180acde2936cbaf822 (diff)
mc146818: optional binary default and epoch setting (nw)
pcd: video attributes (nw)
Diffstat (limited to 'src/mess')
-rw-r--r--src/mess/drivers/pcd.c2
-rw-r--r--src/mess/video/pcd.c22
-rw-r--r--src/mess/video/pcd.h2
3 files changed, 23 insertions, 3 deletions
diff --git a/src/mess/drivers/pcd.c b/src/mess/drivers/pcd.c
index bedb0adf87e..649a824e7b5 100644
--- a/src/mess/drivers/pcd.c
+++ b/src/mess/drivers/pcd.c
@@ -537,6 +537,8 @@ static MACHINE_CONFIG_START( pcd, pcd_state )
// rtc
MCFG_MC146818_ADD("rtc", XTAL_32_768kHz)
MCFG_MC146818_IRQ_HANDLER(DEVWRITELINE("pic1", pic8259_device, ir7_w))
+ MCFG_MC146818_BINARY(true)
+ MCFG_MC146818_EPOCH(1900)
MCFG_DEVICE_ADD("keyboard", PCD_KEYBOARD, 0)
MCFG_PCD_KEYBOARD_OUT_TX_HANDLER(DEVWRITELINE("usart2", mc2661_device, rx_w))
diff --git a/src/mess/video/pcd.c b/src/mess/video/pcd.c
index 2ae4029c14a..26e3809dc4c 100644
--- a/src/mess/video/pcd.c
+++ b/src/mess/video/pcd.c
@@ -88,7 +88,8 @@ static MACHINE_CONFIG_FRAGMENT( pcd_video )
MCFG_SCREEN_UPDATE_DEVICE("crtc", scn2674_device, screen_update)
MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
- MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
+ MCFG_PALETTE_ADD("palette", 3)
+ MCFG_PALETTE_INIT_OWNER(pcdx_video_device, pcdx)
MCFG_SCN2674_VIDEO_ADD("crtc", 0, NULL);
MCFG_SCN2674_TEXT_CHARACTER_WIDTH(8)
@@ -158,12 +159,20 @@ SCN2674_DRAW_CHARACTER_MEMBER(pcd_video_device::display_pixels)
}
else
{
- UINT8 data;
+ UINT8 data, attr;
+ int bgnd = 0;
data = m_charram[m_vram[address] * 16 + linecount];
+ attr = m_vram[address + 1];
if(cursor && blink)
data = 0xff;
+ if((linecount > 11) && (attr & 0x20))
+ data = 0xff;
+ if(attr & 8)
+ bgnd = 2;
+ if(attr & 0x10)
+ data = ~data;
for(int i = 0; i < 8; i++)
- bitmap.pix32(y, x + i) = m_palette->pen((data & (1 << (7 - i))) ? 1 : 0);
+ bitmap.pix32(y, x + i) = m_palette->pen((data & (1 << (7 - i))) ? 1 : bgnd);
}
}
@@ -180,6 +189,13 @@ SCN2674_DRAW_CHARACTER_MEMBER(pcx_video_device::display_pixels)
bitmap.pix32(y, x + i) = m_palette->pen((data & (1 << (7 - i))) ? 1 : 0);
}
+PALETTE_INIT_MEMBER(pcdx_video_device, pcdx)
+{
+ palette.set_pen_color(0,rgb_t::black);
+ palette.set_pen_color(1,rgb_t::white);
+ palette.set_pen_color(2,rgb_t(128,128,128));
+}
+
WRITE8_MEMBER(pcd_video_device::vram_w)
{
if(m_vram_sw)
diff --git a/src/mess/video/pcd.h b/src/mess/video/pcd.h
index 817e23d0b1a..39312232631 100644
--- a/src/mess/video/pcd.h
+++ b/src/mess/video/pcd.h
@@ -19,6 +19,8 @@ public:
virtual DECLARE_ADDRESS_MAP(map, 16) = 0;
DECLARE_READ8_MEMBER(detect_r);
DECLARE_WRITE8_MEMBER(detect_w);
+ DECLARE_PALETTE_INIT(pcdx);
+
protected:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_mcu;