mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-12 00:30:31 +00:00
Switched back to the collision_buffer_ being part of the TIA object, added one more assert.
This commit is contained in:
parent
7019d396d0
commit
b769f22ca0
@ -128,8 +128,6 @@ TIA::TIA(bool create_crt) :
|
||||
colour_mask_by_mode_collision_flags_[(int)ColourMode::OnTop][c] = (uint8_t)ColourIndex::PlayfieldBall;
|
||||
}
|
||||
}
|
||||
|
||||
collision_buffer_.resize(160);
|
||||
}
|
||||
|
||||
TIA::TIA() : TIA(true) {}
|
||||
@ -237,6 +235,7 @@ void TIA::set_background_colour(uint8_t colour)
|
||||
|
||||
void TIA::set_playfield(uint16_t offset, uint8_t value)
|
||||
{
|
||||
assert(offset >= 0 && offset < 3);
|
||||
switch(offset)
|
||||
{
|
||||
case 0:
|
||||
@ -443,8 +442,8 @@ void TIA::output_for_cycles(int number_of_cycles)
|
||||
|
||||
if(!output_cursor)
|
||||
{
|
||||
if(line_end_function_) line_end_function_(collision_buffer_.data());
|
||||
memset(collision_buffer_.data(), 0, 160); // sizeof(collision_buffer_)
|
||||
if(line_end_function_) line_end_function_(collision_buffer_);
|
||||
memset(collision_buffer_, 0, sizeof(collision_buffer_));
|
||||
horizontal_blank_extend_ = false;
|
||||
|
||||
ball_.motion_time %= 228;
|
||||
|
@ -89,8 +89,7 @@ class TIA {
|
||||
int output_mode_;
|
||||
|
||||
// keeps track of the target pixel buffer for this line and when it was acquired, and a corresponding collision buffer
|
||||
// alignas(alignof(uint32_t)) uint8_t collision_buffer_[160];
|
||||
std::vector<uint8_t> collision_buffer_;
|
||||
alignas(alignof(uint32_t)) uint8_t collision_buffer_[160];
|
||||
enum class CollisionType : uint8_t {
|
||||
Playfield = (1 << 0),
|
||||
Ball = (1 << 1),
|
||||
|
Loading…
x
Reference in New Issue
Block a user