1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-25 16:31:42 +00:00

Take ownership of test choice.

This commit is contained in:
Thomas Harte 2023-04-05 23:33:42 -04:00
parent 20c1c6fdcd
commit 278e7ba9b0
4 changed files with 13 additions and 8 deletions

View File

@ -137,9 +137,9 @@ void Base<personality>::posit_sprite(int sprite_number, int sprite_position, uin
fetch_sprite_buffer_->reset_sprite_collection(); fetch_sprite_buffer_->reset_sprite_collection();
fetch_sprite_buffer_->sprite_terminator = mode_timing_.sprite_terminator(fetch_line_buffer_->screen_mode); fetch_sprite_buffer_->sprite_terminator = mode_timing_.sprite_terminator(fetch_line_buffer_->screen_mode);
#ifndef NDEBUG if constexpr (SpriteBuffer::test_is_filling) {
fetch_sprite_buffer_->is_filling = true; fetch_sprite_buffer_->is_filling = true;
#endif }
} }
if(!(status_ & StatusSpriteOverflow)) { if(!(status_ & StatusSpriteOverflow)) {

View File

@ -78,7 +78,9 @@ void Base<personality>::draw_sprites(uint8_t y, int start, int end, const std::a
return; return;
} }
assert(!buffer.is_filling); if constexpr (SpriteBuffer::test_is_filling) {
assert(!buffer.is_filling);
}
constexpr uint32_t sprite_colour_selection_masks[2] = {0x00000000, 0xffffffff}; constexpr uint32_t sprite_colour_selection_masks[2] = {0x00000000, 0xffffffff};
constexpr int colour_masks[16] = {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; constexpr int colour_masks[16] = {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};

View File

@ -282,11 +282,11 @@ class SpriteFetcher {
sprite.image[0] = base->ram_[graphic_location]; sprite.image[0] = base->ram_[graphic_location];
sprite.image[1] = base->ram_[graphic_location+16]; sprite.image[1] = base->ram_[graphic_location+16];
#ifndef NDEBUG if constexpr (SpriteBuffer::test_is_filling) {
if(slot == ((mode == SpriteMode::Mode2) ? 7 : 3)) { if(slot == ((mode == SpriteMode::Mode2) ? 7 : 3)) {
base->fetch_sprite_buffer_->is_filling = false; base->fetch_sprite_buffer_->is_filling = false;
}
} }
#endif
} }
Base<personality> *const base; Base<personality> *const base;

View File

@ -113,7 +113,10 @@ struct SpriteBuffer {
uint8_t sprite_terminator = 0; uint8_t sprite_terminator = 0;
#ifndef NDEBUG #ifndef NDEBUG
static constexpr bool test_is_filling = true;
bool is_filling = false; bool is_filling = false;
#else
static constexpr bool test_is_filling = false;
#endif #endif
void reset_sprite_collection(); void reset_sprite_collection();