summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/video/mc6847.h
diff options
context:
space:
mode:
author robcfg <robcfg@gmail.com>2019-05-02 22:27:49 +0200
committer robcfg <robcfg@gmail.com>2019-05-02 22:27:49 +0200
commitac76ec42c7048342b8494ae45b3746dd12806940 (patch)
tree28a25a4d097210da559d1523d203d047110235d4 /src/devices/video/mc6847.h
parentefdbbb6593951a08fbc24ca14b6866205fb60627 (diff)
Working PAL color blend emulation. Next step is only perfom blend based on the colors luma values.
Diffstat (limited to 'src/devices/video/mc6847.h')
-rw-r--r--src/devices/video/mc6847.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/devices/video/mc6847.h b/src/devices/video/mc6847.h
index b9e8e02ed4c..c437d1fffd4 100644
--- a/src/devices/video/mc6847.h
+++ b/src/devices/video/mc6847.h
@@ -179,9 +179,38 @@ protected:
// artifacting config
void setup_config(device_t *device);
void poll_config() { m_artifacting = (m_config!=nullptr) ? m_config->read() : 0; }
+ void set_pal_artifacting( bool palartifacting ) { m_palartifacting = palartifacting; }
+ bool get_pal_artifacting() { return m_palartifacting; }
// artifacting application
template<int xscale>
+ void process_artifacts_pal(bitmap_rgb32 &bitmap, int y, int base_x, int base_y, uint8_t mode, const pixel_t *palette)
+ {
+ if( !m_artifacting || !m_palartifacting )
+ return;
+
+ //if( (mode & (MODE_AS|MODE_GM0)) == MODE_AS )
+ {
+ uint32_t tmpPixel;
+ pixel_t *line1 = &bitmap.pix32(y + base_y, base_x);
+ pixel_t *line2 = &bitmap.pix32(y + base_y + 1, base_x);
+
+ for( int pixel = 0; pixel < bitmap.width(); ++pixel )
+ {
+ if( line1[pixel] != line2[pixel] )
+ {
+ tmpPixel = (( ((line1[pixel] & 0xFF0000) >> 16) + ((line2[pixel] & 0xFF0000) >> 16) / 2) << 16);
+ tmpPixel |= (( ((line1[pixel] & 0xFF00 ) >> 8 ) + ((line2[pixel] & 0xFF00 ) >> 8 ) / 2) << 8 );
+ tmpPixel |= ( ( line1[pixel] & 0xFF ) + (line2[pixel] & 0xFF ) ) / 2;
+
+ line1[pixel] = tmpPixel;
+ line2[pixel] = tmpPixel;
+ }
+ }
+ }
+ }
+
+ template<int xscale>
ATTR_FORCE_INLINE void process_artifacts(pixel_t *pixels, uint8_t mode, const pixel_t *palette)
{
if (((mode & (MODE_AG|MODE_GM2|MODE_GM1|MODE_GM0)) == (MODE_AG|MODE_GM2|MODE_GM1|MODE_GM0))
@@ -218,6 +247,7 @@ protected:
}
private:
+ bool m_palartifacting;
ioport_port *m_config;
ioport_value m_artifacting;
ioport_value m_saved_artifacting;