mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-11 08:30:55 +00:00
Take a guess at reintroducing a special case for end-of-blank.
This commit is contained in:
parent
57186c3c14
commit
89abf7faeb
@ -614,7 +614,7 @@ template <int cycle, bool stop_if_cpu> bool Chipset::perform_cycle() {
|
|||||||
constexpr auto sprite_id = (cycle - 0x16) >> 2;
|
constexpr auto sprite_id = (cycle - 0x16) >> 2;
|
||||||
static_assert(sprite_id >= 0 && sprite_id < std::tuple_size<decltype(sprites_)>::value);
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ void Sprite::set_image_data(int slot, uint16_t value) {
|
|||||||
visible |= slot == 0;
|
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);
|
assert(offset == 0 || offset == 1);
|
||||||
|
|
||||||
// Determine which word would be fetched, if DMA occurs.
|
// 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
|
// value in the sprite control words, the next two words fetched from the
|
||||||
// sprite data structure are written into the sprite control registers
|
// sprite data structure are written into the sprite control registers
|
||||||
// instead of being sent to the color 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) {
|
if(offset) {
|
||||||
// Second control word: stop position (mostly).
|
// Second control word: stop position (mostly).
|
||||||
set_stop_and_control(next_word);
|
set_stop_and_control(next_word);
|
||||||
|
@ -23,7 +23,7 @@ class Sprite: public DMADevice<1> {
|
|||||||
void set_stop_and_control(uint16_t value);
|
void set_stop_and_control(uint16_t value);
|
||||||
void set_image_data(int slot, 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]{};
|
uint16_t data[2]{};
|
||||||
bool attached = false;
|
bool attached = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user