summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/video
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2020-08-14 20:43:54 +0200
committer hap <happppp@users.noreply.github.com>2020-08-14 20:43:54 +0200
commita7f7fb9e6a7763320210e9938cd5867b894c6926 (patch)
tree5cdf674ed24671e02781a0a5fa5182bb3a3939e8 /src/devices/video
parentd355314cd6832b5161cac8c13e2078eebf00a25d (diff)
i8244: add external collision detection
Diffstat (limited to 'src/devices/video')
-rw-r--r--src/devices/video/i8244.cpp18
-rw-r--r--src/devices/video/i8244.h1
2 files changed, 19 insertions, 0 deletions
diff --git a/src/devices/video/i8244.cpp b/src/devices/video/i8244.cpp
index 35733a9da24..2b2526b71ac 100644
--- a/src/devices/video/i8244.cpp
+++ b/src/devices/video/i8244.cpp
@@ -469,6 +469,24 @@ int i8244_device::hblank()
}
+void i8244_device::write_cx(int x, bool cx)
+{
+ if (cx)
+ {
+ // Check if we collide with an already drawn source object
+ if ( m_vdc.s.collision & m_collision_map[x] )
+ {
+ m_collision_status |= 0x40;
+ }
+ // Check if an already drawn object would collide with us
+ if ( m_vdc.s.collision & 0x40 )
+ {
+ m_collision_status |= m_collision_map[x];
+ }
+ }
+}
+
+
uint32_t i8244_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
// Some local constants for this method
diff --git a/src/devices/video/i8244.h b/src/devices/video/i8244.h
index 685ba1fb6a2..d27ae19ea52 100644
--- a/src/devices/video/i8244.h
+++ b/src/devices/video/i8244.h
@@ -35,6 +35,7 @@ public:
uint8_t read(offs_t offset);
void write(offs_t offset, uint8_t data);
+ void write_cx(int x, bool cx); // CX pin on current scanline
int vblank();
int hblank();