mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-16 18:30:32 +00:00
Support horizontal offsets.
This commit is contained in:
parent
1b4df01a28
commit
e49e98d309
@ -419,6 +419,11 @@ void TMS9918<personality>::run_for(const HalfCycles cycles) {
|
||||
break;
|
||||
}
|
||||
|
||||
if constexpr (is_yamaha_vdp(personality)) {
|
||||
this->fetch_line_buffer_->first_pixel_output_column += Storage<personality>::adjustment_[0];
|
||||
this->fetch_line_buffer_->next_border_column += Storage<personality>::adjustment_[0];
|
||||
}
|
||||
|
||||
this->fetch_line_buffer_->vertical_state =
|
||||
this->screen_mode_ == ScreenMode::Blank ?
|
||||
VerticalState::Blank :
|
||||
@ -874,9 +879,8 @@ void Base<personality>::commit_register(int reg, uint8_t value) {
|
||||
break;
|
||||
|
||||
case 18:
|
||||
if(value) {
|
||||
LOG("TODO: Yamaha position adjustment; " << PADHEX(2) << +value);
|
||||
}
|
||||
Storage<personality>::adjustment_[0] = (8 - ((value & 15) ^ 8)) * 4;
|
||||
Storage<personality>::adjustment_[1] = 8 - ((value >> 4) ^ 8);
|
||||
// b0-b3: horizontal adjustment
|
||||
// b4-b7: vertical adjustment
|
||||
break;
|
||||
|
@ -38,6 +38,8 @@ template <Personality personality> struct Storage<personality, std::enable_if_t<
|
||||
int indirect_register_ = 0;
|
||||
bool increment_indirect_register_ = false;
|
||||
|
||||
int adjustment_[2]{};
|
||||
|
||||
std::array<uint32_t, 16> palette_{};
|
||||
std::array<uint32_t, 16> background_palette_{};
|
||||
bool solid_background_ = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user