diff options
author | 2015-07-30 10:29:41 +0200 | |
---|---|---|
committer | 2015-07-30 10:31:00 +0200 | |
commit | 93bd0f0daf4bce350dc66071799edb38812a8d2f (patch) | |
tree | cdac6386e04993ecfa419c3a03de60d33e4f36d8 /src/mess/drivers/pmd85.c | |
parent | 0c30315e46c2fac91dd65e7baabae21d2084e6ec (diff) |
pmd85: use standard palette, clean up video emulation
Diffstat (limited to 'src/mess/drivers/pmd85.c')
-rw-r--r-- | src/mess/drivers/pmd85.c | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/src/mess/drivers/pmd85.c b/src/mess/drivers/pmd85.c index 737c7e63a4f..ce1189c9592 100644 --- a/src/mess/drivers/pmd85.c +++ b/src/mess/drivers/pmd85.c @@ -182,6 +182,36 @@ I/O ports #include "formats/pmd_cas.h" #include "machine/ram.h" + +//************************************************************************** +// VIDEO EMULATION +//************************************************************************** + +UINT32 pmd85_state::screen_update_pmd85(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + for (int y = 0; y < 256; y++) + { + // address of current line in PMD-85 video memory + UINT8 *line = m_ram->pointer() + 0xc000 + 0x40 * y; + + for (int x = 0; x < 288/6; x++) + { + int pen = BIT(line[x], 7) ? 1 : 2; + + bitmap.pix16(y, x * 6 + 0) = BIT(line[x], 0) ? pen : 0; + bitmap.pix16(y, x * 6 + 1) = BIT(line[x], 1) ? pen : 0; + bitmap.pix16(y, x * 6 + 2) = BIT(line[x], 2) ? pen : 0; + bitmap.pix16(y, x * 6 + 3) = BIT(line[x], 3) ? pen : 0; + bitmap.pix16(y, x * 6 + 4) = BIT(line[x], 4) ? pen : 0; + bitmap.pix16(y, x * 6 + 5) = BIT(line[x], 5) ? pen : 0; + } + + } + + return 0; +} + + /* I/O ports */ static ADDRESS_MAP_START( pmd85_io_map, AS_IO, 8, pmd85_state ) @@ -578,8 +608,7 @@ static MACHINE_CONFIG_START( pmd85, pmd85_state ) MCFG_SCREEN_UPDATE_DRIVER(pmd85_state, screen_update_pmd85) MCFG_SCREEN_PALETTE("palette") - MCFG_PALETTE_ADD("palette", sizeof (pmd85_palette) / 3) - MCFG_PALETTE_INIT_OWNER(pmd85_state, pmd85) + MCFG_PALETTE_ADD_MONOCHROME_GREEN_HIGHLIGHT("palette") /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") |