mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-18 01:30:56 +00:00
Corrects bug whereby changing pixel mode mid-line will produce an improper amount of data.
This commit is contained in:
parent
617e0bada9
commit
455e831b87
@ -513,8 +513,8 @@ void Video::update_output_mode() {
|
|||||||
video_stream_.set_bpp(output_bpp_);
|
video_stream_.set_bpp(output_bpp_);
|
||||||
}
|
}
|
||||||
|
|
||||||
const int freqs[] = {50, 60, 72};
|
// const int freqs[] = {50, 60, 72};
|
||||||
printf("%d, %d -> %d [%d %d]\n", x_ / 2, y_, freqs[int(field_frequency_)], horizontal_.enable, vertical_.enable);
|
// printf("%d, %d -> %d [%d %d]\n", x_ / 2, y_, freqs[int(field_frequency_)], horizontal_.enable, vertical_.enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - The shifter
|
// MARK: - The shifter
|
||||||
@ -731,10 +731,13 @@ void Video::VideoStream::output_pixels(int duration) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Video::VideoStream::flush_pixels() {
|
void Video::VideoStream::flush_pixels() {
|
||||||
switch(bpp_) {
|
// Flush only if there's something to flush.
|
||||||
case OutputBpp::One: crt_.output_data(pixel_pointer_ >> 1, size_t(pixel_pointer_)); break;
|
if(pixel_pointer_) {
|
||||||
default: crt_.output_data(pixel_pointer_); break;
|
switch(bpp_) {
|
||||||
case OutputBpp::Four: crt_.output_data(pixel_pointer_ << 1, size_t(pixel_pointer_)); break;
|
case OutputBpp::One: crt_.output_data(pixel_pointer_ >> 1, size_t(pixel_pointer_)); break;
|
||||||
|
default: crt_.output_data(pixel_pointer_); break;
|
||||||
|
case OutputBpp::Four: crt_.output_data(pixel_pointer_ << 1, size_t(pixel_pointer_)); break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pixel_pointer_ = 0;
|
pixel_pointer_ = 0;
|
||||||
@ -742,8 +745,14 @@ void Video::VideoStream::flush_pixels() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Video::VideoStream::set_bpp(OutputBpp bpp) {
|
void Video::VideoStream::set_bpp(OutputBpp bpp) {
|
||||||
|
// Terminate the allocated block of memory (if any).
|
||||||
|
flush_pixels();
|
||||||
|
|
||||||
|
// Reset the shifter.
|
||||||
// TODO: is flushing like this correct?
|
// TODO: is flushing like this correct?
|
||||||
output_shifter_ = 0;
|
output_shifter_ = 0;
|
||||||
|
|
||||||
|
// Store the new BPP.
|
||||||
bpp_ = bpp;
|
bpp_ = bpp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,8 +68,8 @@
|
|||||||
</TestAction>
|
</TestAction>
|
||||||
<LaunchAction
|
<LaunchAction
|
||||||
buildConfiguration = "Release"
|
buildConfiguration = "Release"
|
||||||
selectedDebuggerIdentifier = ""
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
enableASanStackUseAfterReturn = "YES"
|
enableASanStackUseAfterReturn = "YES"
|
||||||
disableMainThreadChecker = "YES"
|
disableMainThreadChecker = "YES"
|
||||||
launchStyle = "0"
|
launchStyle = "0"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user