1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-29 13:29:46 +00:00

Merge pull request #395 from TomHarte/TEDEsqueColours

Introduces Vic luminances sourced from the TED manual.
This commit is contained in:
Thomas Harte 2018-03-30 09:39:02 -04:00 committed by GitHub
commit 067174965e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 17 deletions

View File

@ -93,11 +93,11 @@ template <class T> class MOS6560 {
void set_output_mode(OutputMode output_mode) {
output_mode_ = output_mode;
// Lumunances are encoded trivially: on a 0255 scale.
// Luminances are encoded trivially: on a 0255 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 T> 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;

View File

@ -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<ConcreteMachine, false> m6502_;