Merge pull request #5320 from npwoods/fix_mc6847_artifacting

Fixing MC6847 to be responsive to live changes of artifacting config
This commit is contained in:
R. Belmont 2019-07-08 19:55:36 -04:00 committed by GitHub
commit 3c0391dc97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 4 deletions

View File

@ -854,7 +854,7 @@ uint32_t mc6847_base_device::screen_update(screen_device &screen, bitmap_rgb32 &
const pixel_t *palette = m_palette;
/* if the video didn't change, indicate as much */
if (!has_video_changed())
if (!m_artifacter.poll_config() && !has_video_changed())
return UPDATE_HAS_NOT_CHANGED;
/* top border */
@ -1701,13 +1701,26 @@ mc6847_base_device::artifacter::artifacter()
void mc6847_base_device::artifacter::setup_config(device_t *device)
{
char port_name[32];
snprintf(port_name, ARRAY_LENGTH(port_name), "%s:%s", device->tag(), ARTIFACTING_TAG);
std::string port_name = util::string_format("%s:%s", device->tag(), ARTIFACTING_TAG);
m_config = device->ioport(port_name);
}
//-------------------------------------------------
// artifacter::poll_config
//-------------------------------------------------
bool mc6847_base_device::artifacter::poll_config()
{
ioport_value new_artifacting = m_config ? m_config->read() : 0;
bool changed = new_artifacting != m_artifacting;
m_artifacting = new_artifacting;
return changed;
}
//-------------------------------------------------
// artifacter::update_colors
//-------------------------------------------------

View File

@ -178,7 +178,7 @@ protected:
// artifacting config
void setup_config(device_t *device);
void poll_config() { m_artifacting = (m_config!=nullptr) ? m_config->read() : 0; }
bool poll_config();
void set_pal_artifacting( bool palartifacting ) { m_palartifacting = palartifacting; }
bool get_pal_artifacting() { return m_palartifacting; }
void create_color_blend_table( const pixel_t *palette );