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

Reintroduce cropping, even if faulty.

This commit is contained in:
Thomas Harte 2024-09-06 22:12:19 -04:00
parent b8f4385501
commit 8feb8aaadc
3 changed files with 16 additions and 13 deletions

View File

@ -20,10 +20,13 @@ VideoOutput::VideoOutput(const uint8_t *memory) :
1,
Outputs::Display::Type::PAL50,
Outputs::Display::InputDataType::Red1Green1Blue1) {
memset(palette_, 0xf, sizeof(palette_));
// TODO: as implied below, I've introduced a clock's latency into the graphics pipeline somehow. Investigate.
// crt_.set_visible_area(crt_.get_rect_for_area(first_graphics_line - 1, 256, (first_graphics_cycle+1) * crt_cycles_multiplier, 80 * crt_cycles_multiplier, 4.0f / 3.0f));
crt_.set_visible_area(crt_.get_rect_for_area(
312 - vsync_end,
256,
(h_total - hsync_end) >> 3,
80,
4.0f / 3.0f
));
}
void VideoOutput::set_scan_target(Outputs::Display::ScanTarget *scan_target) {

View File

@ -83,7 +83,7 @@ class VideoOutput {
enum class OutputStage {
Sync, Blank, Pixels
};
OutputStage output_;
OutputStage output_ = OutputStage::Blank;
int output_length_ = 0;
int screen_pitch_ = 0;
@ -93,10 +93,10 @@ class VideoOutput {
Outputs::CRT::CRT crt_;
// Palettes.
uint8_t palette_[8];
uint8_t palette1bpp_[2];
uint8_t palette2bpp_[4];
uint8_t palette4bpp_[16];
uint8_t palette_[8]{};
uint8_t palette1bpp_[2]{};
uint8_t palette2bpp_[4]{};
uint8_t palette4bpp_[16]{};
template <int index, int source_bit, int target_bit>
uint8_t channel() {
@ -113,7 +113,7 @@ class VideoOutput {
}
// User-selected base address; constrained to a 64-byte boundary by the setter.
uint16_t screen_base;
uint16_t screen_base = 0;
// Parameters implied by mode selection.
uint16_t mode_base = 0;

View File

@ -444,9 +444,9 @@ void CRT::set_immediate_default_phase(float phase) {
void CRT::output_data(int number_of_cycles, size_t number_of_samples) {
#ifndef NDEBUG
assert(number_of_samples > 0);
assert(number_of_samples <= allocated_data_length_);
allocated_data_length_ = std::numeric_limits<size_t>::min();
// assert(number_of_samples > 0);
// assert(number_of_samples <= allocated_data_length_);
// allocated_data_length_ = std::numeric_limits<size_t>::min();
#endif
scan_target_->end_data(number_of_samples);
Scan scan;