1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-05 10:28:58 +00:00

Fix: modulos are 15-bit signed, the minterms are also in regular BLTCON0.

This commit is contained in:
Thomas Harte 2021-09-23 18:30:35 -04:00
parent e06f470044
commit adc071ed7a
2 changed files with 5 additions and 3 deletions

View File

@ -20,7 +20,7 @@ void Blitter::set_control(int index, uint16_t value) {
if(index) {
line_mode_ = !(value & 1);
} else {
minterms_ = value & 0xff;
}
shifts_[index] = value >> 12;
LOG("Set control " << index << " to " << PADHEX(4) << value);
@ -59,7 +59,9 @@ void Blitter::set_horizontal_size(uint16_t value) {
void Blitter::set_modulo(int channel, uint16_t value) {
LOG("Set modulo size " << channel << " to " << PADHEX(4) << value);
modulos_[channel] = value;
// Convert by sign extension.
modulos_[channel] = uint32_t(int16_t(value) >> 1);
}
void Blitter::set_data(int channel, uint16_t value) {

View File

@ -44,7 +44,7 @@ class Blitter: public DMADevice<4> {
uint8_t minterms_ = 0;
int width_ = 0, height_ = 0;
uint32_t a_ = 0, b_ = 0;
uint16_t modulos_[4]{};
uint32_t modulos_[4]{};
int shifts_[2]{};
bool line_mode_ = false;