summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess/video/primo.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mess/video/primo.c')
-rw-r--r--src/mess/video/primo.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/mess/video/primo.c b/src/mess/video/primo.c
new file mode 100644
index 00000000000..064a1c849e8
--- /dev/null
+++ b/src/mess/video/primo.c
@@ -0,0 +1,46 @@
+/***************************************************************************
+
+ primo.c
+
+ Functions to emulate the video hardware of Primo.
+
+ Krzysztof Strzecha
+
+***************************************************************************/
+
+#include "emu.h"
+#include "includes/primo.h"
+
+
+
+static void primo_draw_scanline(running_machine &machine,bitmap_ind16 &bitmap, int primo_scanline)
+{
+ primo_state *state = machine.driver_data<primo_state>();
+ int x, i;
+ UINT8 data;
+
+ /* set up scanline */
+ UINT16 *scanline = &bitmap.pix16(primo_scanline);
+
+ /* address of current line in Primo video memory */
+ const UINT8* primo_video_ram_line = (const UINT8*)machine.device("maincpu")->memory().space(AS_PROGRAM)->get_read_ptr(state->m_video_memory_base + 32 * primo_scanline);
+
+ for (x=0; x<256; x+=8)
+ {
+ data = primo_video_ram_line[x/8];
+
+ for (i=0; i<8; i++)
+ scanline[x+i]=(data & (0x80>>i)) ? 1 : 0;
+
+ }
+}
+
+
+SCREEN_UPDATE_IND16( primo )
+{
+ int primo_scanline;
+
+ for (primo_scanline=0; primo_scanline<192; primo_scanline++)
+ primo_draw_scanline(screen.machine(), bitmap, primo_scanline);
+ return 0;
+}