summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu
diff options
context:
space:
mode:
author Angelo Salese <angelosa@users.noreply.github.com>2011-09-21 19:32:50 +0000
committer Angelo Salese <angelosa@users.noreply.github.com>2011-09-21 19:32:50 +0000
commitf603291c0e3e5e6d73280077f07b057aeab924b6 (patch)
tree2a0278a08d6fbe3f3279fc837e23740641ea6b7c /src/emu
parentc06bfbfa2869d31f7d804be69aa6b7071d2b3b0a (diff)
Hooked up drawing
Diffstat (limited to 'src/emu')
-rw-r--r--src/emu/video/h63484.c56
-rw-r--r--src/emu/video/h63484.h8
2 files changed, 60 insertions, 4 deletions
diff --git a/src/emu/video/h63484.c b/src/emu/video/h63484.c
index 01996004ec4..93e8bb1ae0d 100644
--- a/src/emu/video/h63484.c
+++ b/src/emu/video/h63484.c
@@ -849,7 +849,8 @@ void h63484_device::process_fifo()
break;
default:
- fatalerror("stop!");
+ printf("%04x\n",m_cr);
+ //fatalerror("stop!");
break;
}
}
@@ -956,6 +957,22 @@ void h63484_device::video_registers_w(int offset)
m_mwr[(offset & 0x18) >> 3] = vreg_data & 0xfff; // pitch
m_mwr_chr[(offset & 0x18) >> 3] = (vreg_data & 0x8000) >> 15;
break;
+
+ case 0xc4: // Start Address Register
+ case 0xcc:
+ case 0xd4:
+ case 0xdc:
+ m_sar[(offset & 0x18) >> 3] = ((vreg_data & 0xf) << 16) | (m_sar[(offset & 0x18) >> 3] & 0xffff);
+ m_sda[(offset & 0x18) >> 3] = (vreg_data & 0x0f00) >> 8;
+ break;
+
+ case 0xc6: // Start Address Register
+ case 0xce:
+ case 0xd6:
+ case 0xde:
+ m_sar[(offset & 0x18) >> 3] = (vreg_data & 0xffff) | (m_sar[(offset & 0x18) >> 3] & 0xf0000);
+ break;
+
default:
if(LOG) printf("%s -> %04x\n",acrtc_regnames[m_ar/2],vreg_data);
break;
@@ -1037,6 +1054,35 @@ void h63484_device::device_reset()
}
//-------------------------------------------------
+// draw_graphics_line -
+//-------------------------------------------------
+
+void h63484_device::draw_graphics_line(bitmap_t *bitmap, const rectangle *cliprect, int y, int layer_n)
+{
+ int x;
+ int pitch;
+ int base_offs;
+
+ pitch = m_mwr[layer_n];
+ base_offs = m_sar[layer_n];
+
+ for(x=0;x<pitch * 4;x+=4)
+ {
+ UINT16 data;
+
+ data = readbyte(base_offs + (x >> 1) + y * pitch * 2);
+
+ m_display_cb(this, bitmap, y, x+3, (data >> 4) & 0xf);
+ m_display_cb(this, bitmap, y, x+2, data & 0xf);
+
+ data = readbyte(base_offs + ((x + 2) >> 1) + y * pitch * 2);
+
+ m_display_cb(this, bitmap, y, x+1, (data >> 4) & 0xf);
+ m_display_cb(this, bitmap, y, x+0, data & 0xf);
+ }
+}
+
+//-------------------------------------------------
// update_screen -
//-------------------------------------------------
@@ -1044,6 +1090,12 @@ void h63484_device::update_screen(bitmap_t *bitmap, const rectangle *cliprect)
{
if(m_dcr & 0x8000) // correct?
{
- // ...
+ int y;
+
+ for(y=cliprect->min_y;y<cliprect->max_y;y++)
+ {
+ if (m_display_cb)
+ draw_graphics_line(bitmap,cliprect, y, 1);
+ }
}
}
diff --git a/src/emu/video/h63484.h b/src/emu/video/h63484.h
index bb3586d45c2..bcc2bf9033e 100644
--- a/src/emu/video/h63484.h
+++ b/src/emu/video/h63484.h
@@ -26,8 +26,8 @@
#define H63484_INTERFACE(name) \
const h63484_interface (name) =
-typedef void (*h63484_display_pixels_func)(device_t *device, bitmap_t *bitmap, int y, int x, UINT32 address, UINT16 data, UINT8 *vram);
-#define H63484_DISPLAY_PIXELS(name) void name(device_t *device, bitmap_t *bitmap, int y, int x, UINT32 address, UINT16 data, UINT8 *vram)
+typedef void (*h63484_display_pixels_func)(device_t *device, bitmap_t *bitmap, int y, int x, UINT16 data);
+#define H63484_DISPLAY_PIXELS(name) void name(device_t *device, bitmap_t *bitmap, int y, int x, UINT16 data)
// ======================> h63484_interface
@@ -88,6 +88,7 @@ private:
UINT16 video_registers_r(int offset);
void video_registers_w(int offset);
int translate_command(UINT16 data);
+ void draw_graphics_line(bitmap_t *bitmap, const rectangle *cliprect, int y, int layer_n);
screen_device *m_screen;
@@ -123,6 +124,9 @@ private:
UINT16 m_mwr[4];
UINT8 m_mwr_chr[4];
+ UINT32 m_sar[4];
+ UINT8 m_sda[4];
+
UINT16 m_pram[0x10];
UINT8 m_dn;