1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-24 12:30:17 +00:00

The Copper can now skip Chipset::perform.

This commit is contained in:
Thomas Harte 2021-12-18 17:53:11 -05:00
parent 54aa211f56
commit bd69948d37
3 changed files with 4 additions and 9 deletions

View File

@ -808,7 +808,7 @@ void Chipset::update_interrupts() {
void Chipset::perform(const CPU::MC68000::Microcycle &cycle) { void Chipset::perform(const CPU::MC68000::Microcycle &cycle) {
using Microcycle = CPU::MC68000::Microcycle; using Microcycle = CPU::MC68000::Microcycle;
const uint32_t register_address = *cycle.address & 0x1fe; const uint32_t register_address = *cycle.address & ChipsetAddressMask;
if(cycle.operation & Microcycle::Read) { if(cycle.operation & Microcycle::Read) {
cycle.set_value16(read<true>(register_address)); cycle.set_value16(read<true>(register_address));
} else { } else {

View File

@ -110,6 +110,8 @@ class Chipset: private ClockingHint::Observer {
// MARK: - Register read/write functions. // MARK: - Register read/write functions.
template <bool allow_conversion> uint16_t read(uint32_t address); template <bool allow_conversion> uint16_t read(uint32_t address);
template <bool allow_conversion> void write(uint32_t address, uint16_t value); template <bool allow_conversion> void write(uint32_t address, uint16_t value);
static constexpr uint32_t ChipsetAddressMask = 0x1fe;
friend class Copper;
// MARK: - E Clock and keyboard dividers. // MARK: - E Clock and keyboard dividers.

View File

@ -114,14 +114,7 @@ bool Copper::advance_dma(uint16_t position, uint16_t blitter_status) {
break; break;
} }
// Construct a 68000-esque Microcycle in order to be able to perform the access. chipset_.write<true>(instruction_[0] & Chipset::ChipsetAddressMask, instruction_[1]);
CPU::MC68000::Microcycle cycle;
cycle.operation = CPU::MC68000::Microcycle::SelectWord;
uint32_t full_address = instruction_[0];
CPU::RegisterPair16 data = instruction_[1];
cycle.address = &full_address;
cycle.value = &data;
chipset_.perform(cycle);
} }
// Roll onto the next command. // Roll onto the next command.