summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Dirk Best <mail@dirk-best.de>2015-07-30 10:29:41 +0200
committer Dirk Best <mail@dirk-best.de>2015-07-30 10:31:00 +0200
commit93bd0f0daf4bce350dc66071799edb38812a8d2f (patch)
treecdac6386e04993ecfa419c3a03de60d33e4f36d8 /src
parent0c30315e46c2fac91dd65e7baabae21d2084e6ec (diff)
pmd85: use standard palette, clean up video emulation
Diffstat (limited to 'src')
-rw-r--r--src/mess/drivers/pmd85.c33
-rw-r--r--src/mess/includes/pmd85.h7
-rw-r--r--src/mess/video/pmd85.c69
3 files changed, 31 insertions, 78 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")
diff --git a/src/mess/includes/pmd85.h b/src/mess/includes/pmd85.h
index 46ec61a52d9..07d9986994b 100644
--- a/src/mess/includes/pmd85.h
+++ b/src/mess/includes/pmd85.h
@@ -76,8 +76,6 @@ public:
DECLARE_DRIVER_INIT(alfa);
DECLARE_DRIVER_INIT(c2717);
virtual void machine_reset();
- virtual void video_start();
- DECLARE_PALETTE_INIT(pmd85);
UINT32 screen_update_pmd85(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(pmd85_cassette_timer_callback);
DECLARE_WRITE_LINE_MEMBER(write_cas_tx);
@@ -148,15 +146,10 @@ protected:
void mato_update_memory();
void c2717_update_memory();
void pmd85_common_driver_init();
- void pmd85_draw_scanline(bitmap_ind16 &bitmap, int pmd85_scanline);
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
int m_cas_tx;
};
-/*----------- defined in video/pmd85.c -----------*/
-
-extern const unsigned char pmd85_palette[3*3];
-
#endif /* PMD85_H_ */
diff --git a/src/mess/video/pmd85.c b/src/mess/video/pmd85.c
deleted file mode 100644
index 146e7a03e6f..00000000000
--- a/src/mess/video/pmd85.c
+++ /dev/null
@@ -1,69 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Krzysztof Strzecha
-/***************************************************************************
-
- pmd85.c
-
- Functions to emulate the video hardware of PMD-85.
-
- Krzysztof Strzecha
-
-***************************************************************************/
-
-#include "emu.h"
-#include "includes/pmd85.h"
-
-const unsigned char pmd85_palette[3*3] =
-{
- 0x00, 0x00, 0x00,
- 0x7f, 0x7f, 0x7f,
- 0xff, 0xff, 0xff
-};
-
-PALETTE_INIT_MEMBER(pmd85_state, pmd85)
-{
- int i;
-
- for ( i = 0; i < sizeof(pmd85_palette) / 3; i++ ) {
- m_palette->set_pen_color(i, pmd85_palette[i*3], pmd85_palette[i*3+1], pmd85_palette[i*3+2]);
- }
-}
-
-void pmd85_state::video_start()
-{
-}
-
-void pmd85_state::pmd85_draw_scanline(bitmap_ind16 &bitmap, int pmd85_scanline)
-{
- int x, i;
- int pen0, pen1;
- UINT8 data;
-
- /* set up scanline */
- UINT16 *scanline = &bitmap.pix16(pmd85_scanline);
-
- /* address of current line in PMD-85 video memory */
- UINT8* pmd85_video_ram_line = m_ram->pointer() + 0xc000 + 0x40*pmd85_scanline;
-
- for (x=0; x<288; x+=6)
- {
- data = pmd85_video_ram_line[x/6];
- pen0 = 0;
- pen1 = data & 0x80 ? 1 : 2;
-
- for (i=0; i<6; i++)
- scanline[x+i] = (data & (0x01<<i)) ? pen1 : pen0;
-
- }
-}
-
-UINT32 pmd85_state::screen_update_pmd85(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
-{
- int pmd85_scanline;
-
- for (pmd85_scanline=0; pmd85_scanline<256; pmd85_scanline++)
- {
- pmd85_draw_scanline(bitmap, pmd85_scanline);
- }
- return 0;
-}