From e1aa3e5a7fa67e00f045e650be1b1e7530775819 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 29 Mar 2018 20:04:37 -0400 Subject: [PATCH 1/2] Imports chrominances from the TED documentation. They seem to apply to the VIC-I also. --- Components/6560/6560.hpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Components/6560/6560.hpp b/Components/6560/6560.hpp index b25e2fad5..7ab74c41a 100644 --- a/Components/6560/6560.hpp +++ b/Components/6560/6560.hpp @@ -93,11 +93,11 @@ template class MOS6560 { void set_output_mode(OutputMode output_mode) { output_mode_ = output_mode; - // Lumunances are encoded trivially: on a 0–255 scale. + // Luminances are encoded trivially: on a 0–255 scale. const uint8_t luminances[16] = { 0, 255, 60, 189, - 100, 144, 40, 227, - 126, 161, 227, 207, + 80, 144, 40, 227, + 90, 161, 207, 227, 200, 196, 160, 196 }; @@ -105,16 +105,16 @@ template class MOS6560 { // anything above 191 disables the colour subcarrier. Phase is relative to the // colour burst, so 0 is green. const uint8_t pal_chrominances[16] = { - 255, 255, 36, 112, - 8, 88, 120, 48, - 40, 56, 36, 112, - 8, 72, 126, 56, + 255, 255, 37, 101, + 19, 86, 123, 59, + 46, 53, 37, 101, + 19, 86, 123, 59, }; const uint8_t ntsc_chrominances[16] = { - 255, 255, 8, 72, - 32, 88, 40, 112, - 0, 8, 12, 72, - 32, 88, 48, 112, + 255, 255, 7, 71, + 25, 86, 48, 112, + 0, 119, 7, 71, + 25, 86, 48, 112, }; const uint8_t *chrominances; Outputs::CRT::DisplayType display_type; From 286259c83bd12766284d12e1b8329d2af7012cf5 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 29 Mar 2018 20:49:36 -0400 Subject: [PATCH 2/2] Adds missing 6560 update hooks. --- Machines/Commodore/Vic-20/Vic20.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/Machines/Commodore/Vic-20/Vic20.cpp b/Machines/Commodore/Vic-20/Vic20.cpp index c5fd3a487..889eb1453 100644 --- a/Machines/Commodore/Vic-20/Vic20.cpp +++ b/Machines/Commodore/Vic-20/Vic20.cpp @@ -528,7 +528,10 @@ class ConcreteMachine: if(isReadOperation(operation)) { uint8_t result = processor_read_memory_map_[address >> 10] ? processor_read_memory_map_[address >> 10][address & 0x3ff] : 0xff; if((address&0xfc00) == 0x9000) { - if((address&0xff00) == 0x9000) result &= mos6560_->get_register(address); + if((address&0xff00) == 0x9000) { + update_video(); + result &= mos6560_->get_register(address); + } if((address&0xfc10) == 0x9010) result &= user_port_via_.get_register(address); if((address&0xfc20) == 0x9020) result &= keyboard_via_.get_register(address); } @@ -595,12 +598,16 @@ class ConcreteMachine: } } } else { - mos6560_->run_for(cycles_since_mos6560_update_.flush()); - uint8_t *ram = processor_write_memory_map_[address >> 10]; - if(ram) ram[address & 0x3ff] = *value; + if(ram) { + update_video(); + ram[address & 0x3ff] = *value; + } if((address&0xfc00) == 0x9000) { - if((address&0xff00) == 0x9000) mos6560_->set_register(address, *value); + if((address&0xff00) == 0x9000) { + update_video(); + mos6560_->set_register(address, *value); + } if((address&0xfc10) == 0x9010) user_port_via_.set_register(address, *value); if((address&0xfc20) == 0x9020) keyboard_via_.set_register(address, *value); } @@ -621,7 +628,7 @@ class ConcreteMachine: } void flush() { - mos6560_->run_for(cycles_since_mos6560_update_.flush()); + update_video(); mos6560_->flush(); } @@ -697,6 +704,9 @@ class ConcreteMachine: } private: + void update_video() { + mos6560_->run_for(cycles_since_mos6560_update_.flush()); + } Analyser::Static::Commodore::Target commodore_target_; CPU::MOS6502::Processor m6502_;