1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-09-30 22:56:03 +00:00

Take a guess at reintroducing a special case for end-of-blank.

This commit is contained in:
Thomas Harte 2022-07-19 21:25:34 -04:00
parent 57186c3c14
commit 89abf7faeb
3 changed files with 7 additions and 4 deletions

View File

@ -614,7 +614,7 @@ template <int cycle, bool stop_if_cpu> bool Chipset::perform_cycle() {
constexpr auto sprite_id = (cycle - 0x16) >> 2;
static_assert(sprite_id >= 0 && sprite_id < std::tuple_size<decltype(sprites_)>::value);
if(sprites_[sprite_id].advance_dma((~cycle&2) >> 1, y_)) {
if(sprites_[sprite_id].advance_dma((~cycle&2) >> 1, y_, y_ == vertical_blank_height_)) {
return false;
}
}

View File

@ -62,7 +62,7 @@ void Sprite::set_image_data(int slot, uint16_t value) {
visible |= slot == 0;
}
bool Sprite::advance_dma(int offset, int y) {
bool Sprite::advance_dma(int offset, int y, bool is_first_line) {
assert(offset == 0 || offset == 1);
// Determine which word would be fetched, if DMA occurs.
@ -73,7 +73,10 @@ bool Sprite::advance_dma(int offset, int y) {
// value in the sprite control words, the next two words fetched from the
// sprite data structure are written into the sprite control registers
// instead of being sent to the color registers"
if(y == v_stop_) {
//
// Guesswork, primarily from observing Spindizzy Worlds: the first line after
// vertical blank also triggers a control reload. Seek to verify.
if(y == v_stop_ || is_first_line) {
if(offset) {
// Second control word: stop position (mostly).
set_stop_and_control(next_word);

View File

@ -23,7 +23,7 @@ class Sprite: public DMADevice<1> {
void set_stop_and_control(uint16_t value);
void set_image_data(int slot, uint16_t value);
bool advance_dma(int offset, int y);
bool advance_dma(int offset, int y, bool is_first_line);
uint16_t data[2]{};
bool attached = false;