1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-25 03:32:01 +00:00

Enshrined a terminology switch, albeit without any flow change behind it.

This commit is contained in:
Thomas Harte 2017-02-22 07:29:48 -05:00
parent 144d6b70d9
commit 21abf4e9fc
2 changed files with 13 additions and 9 deletions

View File

@ -718,7 +718,11 @@ template<class T> void TIA::draw_object_visible(T &object, const uint8_t collisi
// the decision is to progress by length // the decision is to progress by length
const int length = next_event_time - start; const int length = next_event_time - start;
object.draw_pixels(&collision_buffer_[start], length, collision_identity); // TODO: the problem with this is that it uses the enabled/pixel state of each object four cycles early;
// an appropriate solution would probably be to capture the drawing request into a queue and honour them outside
// this loop, clipped to the real output parameters. Assuming all state consumed by draw_pixels is captured,
// and mutated now then also queueing resets and skips shouldn't be necessary.
object.enqueue_pixels(&collision_buffer_[start], length, collision_identity);
// the next interesting event is after next_event_time cycles, so progress // the next interesting event is after next_event_time cycles, so progress
object.position = (object.position + length) % 160; object.position = (object.position + length) % 160;

View File

@ -158,7 +158,7 @@ class TIA {
int pixel_position; int pixel_position;
inline void skip_pixels(int count) inline void skip_pixels(const int count)
{ {
pixel_position = std::min(32, pixel_position + count * adder); pixel_position = std::min(32, pixel_position + count * adder);
} }
@ -168,7 +168,7 @@ class TIA {
pixel_position = 0; pixel_position = 0;
} }
inline void draw_pixels(uint8_t *const target, const int count, const uint8_t collision_identity) inline void enqueue_pixels(uint8_t *const target, const int count, const uint8_t collision_identity)
{ {
if(pixel_position == 32) return; if(pixel_position == 32) return;
if(graphic[graphic_index]) if(graphic[graphic_index])
@ -196,7 +196,7 @@ class TIA {
int pixel_position; int pixel_position;
int size; int size;
inline void skip_pixels(int count) inline void skip_pixels(const int count)
{ {
pixel_position = std::max(0, pixel_position - count); pixel_position = std::max(0, pixel_position - count);
} }
@ -206,7 +206,7 @@ class TIA {
pixel_position = size; pixel_position = size;
} }
inline void draw_pixels(uint8_t *const target, const int count, const uint8_t collision_identity) inline void enqueue_pixels(uint8_t *const target, const int count, const uint8_t collision_identity)
{ {
int output_cursor = 0; int output_cursor = 0;
while(pixel_position && output_cursor < count) while(pixel_position && output_cursor < count)
@ -227,12 +227,12 @@ class TIA {
bool locked_to_player; bool locked_to_player;
int copy_flags; int copy_flags;
inline void draw_pixels(uint8_t *const target, const int count, const uint8_t collision_identity) inline void enqueue_pixels(uint8_t *const target, const int count, const uint8_t collision_identity)
{ {
if(!pixel_position) return; if(!pixel_position) return;
if(enabled && !locked_to_player) if(enabled && !locked_to_player)
{ {
HorizontalRun::draw_pixels(target, count, collision_identity); HorizontalRun::enqueue_pixels(target, count, collision_identity);
} }
else else
{ {
@ -249,12 +249,12 @@ class TIA {
int enabled_index; int enabled_index;
const int copy_flags = 0; const int copy_flags = 0;
inline void draw_pixels(uint8_t *const target, const int count, const uint8_t collision_identity) inline void enqueue_pixels(uint8_t *const target, const int count, const uint8_t collision_identity)
{ {
if(!pixel_position) return; if(!pixel_position) return;
if(enabled[enabled_index]) if(enabled[enabled_index])
{ {
HorizontalRun::draw_pixels(target, count, collision_identity); HorizontalRun::enqueue_pixels(target, count, collision_identity);
} }
else else
{ {