mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-13 07:30:21 +00:00
Fixes horizontal counter wrapping.
This commit is contained in:
parent
52e02db5c8
commit
82b7944599
@ -548,7 +548,7 @@ uint8_t TMS9918::get_latched_horizontal_counter() {
|
|||||||
// which makes the 256 pixels the first 256 spots, but starts
|
// which makes the 256 pixels the first 256 spots, but starts
|
||||||
// counting at -48, and returns only the top 8 bits of the number.
|
// counting at -48, and returns only the top 8 bits of the number.
|
||||||
int public_counter = latched_column_ - 86;
|
int public_counter = latched_column_ - 86;
|
||||||
if(public_counter < -48) public_counter += 342;
|
if(public_counter < -46) public_counter += 342;
|
||||||
return uint8_t(public_counter >> 1);
|
return uint8_t(public_counter >> 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user