mirror of
https://github.com/TomHarte/CLK.git
synced 2024-07-09 06:29:33 +00:00
Adds sprite DMA windows.
This commit is contained in:
parent
c5e8b547af
commit
b489ba3d0d
@ -231,6 +231,7 @@ template <int cycle, bool stop_if_cpu> bool Chipset::perform_cycle() {
|
|||||||
constexpr auto BitplaneFlag = DMAMask<DMAFlag::Bitplane, DMAFlag::AllBelow>::value;
|
constexpr auto BitplaneFlag = DMAMask<DMAFlag::Bitplane, DMAFlag::AllBelow>::value;
|
||||||
constexpr auto CopperFlag = DMAMask<DMAFlag::Copper, DMAFlag::AllBelow>::value;
|
constexpr auto CopperFlag = DMAMask<DMAFlag::Copper, DMAFlag::AllBelow>::value;
|
||||||
constexpr auto DiskFlag = DMAMask<DMAFlag::Disk, DMAFlag::AllBelow>::value;
|
constexpr auto DiskFlag = DMAMask<DMAFlag::Disk, DMAFlag::AllBelow>::value;
|
||||||
|
constexpr auto SpritesFlag = DMAMask<DMAFlag::Sprites, DMAFlag::AllBelow>::value;
|
||||||
|
|
||||||
// Update state as to whether bitplane fetching should happen now.
|
// Update state as to whether bitplane fetching should happen now.
|
||||||
//
|
//
|
||||||
@ -257,13 +258,22 @@ template <int cycle, bool stop_if_cpu> bool Chipset::perform_cycle() {
|
|||||||
// 2. Refresh, disk, audio, or sprites. Depending on region.
|
// 2. Refresh, disk, audio, or sprites. Depending on region.
|
||||||
//
|
//
|
||||||
// Blitter and CPU priority is dealt with below.
|
// Blitter and CPU priority is dealt with below.
|
||||||
if constexpr (cycle >= 7 && cycle < 13) {
|
if constexpr (cycle >= 0x07 && cycle < 0x0d) {
|
||||||
if((dma_control_ & DiskFlag) == DiskFlag) {
|
if((dma_control_ & DiskFlag) == DiskFlag) {
|
||||||
if(disk_.advance()) {
|
if(disk_.advance()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if constexpr(cycle >= 0x15 && cycle < 0x35) {
|
||||||
|
if((dma_control_ & SpritesFlag) == SpritesFlag) {
|
||||||
|
constexpr auto sprite_id = (cycle - 0x15) >> 2;
|
||||||
|
if(sprites_[sprite_id].advance(sprite_id)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Bitplanes being dealt with, specific odd-cycle responsibility
|
// Bitplanes being dealt with, specific odd-cycle responsibility
|
||||||
// is just possibly to pass to the Copper.
|
// is just possibly to pass to the Copper.
|
||||||
@ -926,6 +936,10 @@ void Chipset::Sprite::set_image_data(int slot, uint16_t value) {
|
|||||||
active_ |= slot == 0;
|
active_ |= slot == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Chipset::Sprite::advance([[maybe_unused]] int sprite_id) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: - Disk.
|
// MARK: - Disk.
|
||||||
|
|
||||||
void Chipset::DiskDMA::enqueue(uint16_t value, bool matches_sync) {
|
void Chipset::DiskDMA::enqueue(uint16_t value, bool matches_sync) {
|
||||||
|
@ -132,7 +132,7 @@ class Chipset: private ClockingHint::Observer {
|
|||||||
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(int slot);
|
bool advance(int sprite_id);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint16_t v_start_ = 0, h_start_ = 0, v_stop_ = 0;
|
uint16_t v_start_ = 0, h_start_ = 0, v_stop_ = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user