summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Vincent-Halver <Vincent.Halver@gmail.com>2025-07-25 18:16:18 -0700
committer GitHub <noreply@github.com>2025-07-25 21:16:18 -0400
commita4fcc6630d8586e5176f133a1413a0d797b6106a (patch)
treec8d535bd32ba503d91c9c5a44d099c599600daf1 /src
parentb90b916e5d644b45182602c213bc444ba1461fac (diff)
CD-i: Fix Cursor Inversion Color and Add External Video Placeholder (#13989)
* CD-i: Fix Cursor Inversion Color This corrects a slight error in the cursor inversion color. A full brightness color should keep the brightness value, and only invert the RGB. See MCD212 section 7.5 * CD-i: Introduce External Video Input This replaces the static background color with a function that will switch behavior if the EV flag is set. Currently there is no DVC chip, so this will produce black output. This fixes #13980 .
Diffstat (limited to 'src')
-rw-r--r--src/mame/philips/mcd212.cpp15
-rw-r--r--src/mame/philips/mcd212.h2
2 files changed, 15 insertions, 2 deletions
diff --git a/src/mame/philips/mcd212.cpp b/src/mame/philips/mcd212.cpp
index 24e24628dbd..19c0f2437fe 100644
--- a/src/mame/philips/mcd212.cpp
+++ b/src/mame/philips/mcd212.cpp
@@ -318,6 +318,17 @@ int mcd212_device::get_border_width()
return width;
}
+uint32_t mcd212_device::get_backdrop_plane() {
+ if (BIT(m_image_coding_method, ICM_EV_BIT))
+ {
+ return 0; // External Video Background. Default to Black since there is no DVC.
+ }
+ else
+ {
+ return s_4bpp_color[m_backdrop_color];
+ }
+}
+
template <int Path>
void mcd212_device::process_ica()
{
@@ -664,7 +675,7 @@ void mcd212_device::mix_lines(uint32_t *plane_a, bool *transparent_a, uint32_t *
{
if (transparent_a[x] && transparent_b[x])
{
- out[x] = s_4bpp_color[m_backdrop_color];
+ out[x] = get_backdrop_plane();
continue;
}
uint32_t plane_a_cur = MosaicA ? plane_a[x - (x % mosaic_count_a)] : plane_a[x];
@@ -727,7 +738,7 @@ void mcd212_device::draw_cursor(uint32_t *scanline)
if (!invert)
return; // Normal Blink
else
- color_index = ~color_index & 0xf; // Inverted Color Blink
+ color_index = color_index ^ 0x7; // Inverted Color Blink. MCD212 Section 7.5
}
const uint16_t cursor_x = m_cursor_position & 0x3ff;
diff --git a/src/mame/philips/mcd212.h b/src/mame/philips/mcd212.h
index 89da72a9add..fe81045abec 100644
--- a/src/mame/philips/mcd212.h
+++ b/src/mame/philips/mcd212.h
@@ -101,6 +101,7 @@ protected:
ICM_MODE2 = 0x000f00, // Plane 2
ICM_MODE2_SHIFT = 8,
ICM_EV = 0x040000, // External video
+ ICM_EV_BIT = 18,
ICM_NM = 0x080000, // Number of Matte flags
ICM_NM_BIT = 19,
ICM_CS = 0x400000, // CLUT select
@@ -249,6 +250,7 @@ protected:
int get_screen_width();
int get_border_width();
+ uint32_t get_backdrop_plane();
template <int Path> void set_vsr(uint32_t value);
template <int Path> uint32_t get_vsr();