mirror of
https://github.com/TomHarte/CLK.git
synced 2024-10-04 01:57:54 +00:00
Further reduces lines to one access per slot, max.
This commit is contained in:
parent
867769f6e7
commit
d4b7d73fc4
@ -292,25 +292,39 @@ bool Blitter<record_bus>::advance_dma() {
|
|||||||
// at https://github.com/niklasekstrom/blitter-subpixel-line/blob/master/Drawing%20lines%20using%20the%20Amiga%20blitter.pdf
|
// at https://github.com/niklasekstrom/blitter-subpixel-line/blob/master/Drawing%20lines%20using%20the%20Amiga%20blitter.pdf
|
||||||
//
|
//
|
||||||
|
|
||||||
|
//
|
||||||
|
// Caveat: I've no idea how the DMA access slots should be laid out for
|
||||||
|
// line drawing.
|
||||||
|
//
|
||||||
|
|
||||||
if(!busy_) {
|
if(!busy_) {
|
||||||
error_ = int16_t(pointer_[0] << 1) >> 1; // TODO: what happens if line_sign_ doesn't agree with this?
|
error_ = int16_t(pointer_[0] << 1) >> 1; // TODO: what happens if line_sign_ doesn't agree with this?
|
||||||
draw_ = true;
|
draw_ = true;
|
||||||
busy_ = true;
|
busy_ = true;
|
||||||
|
has_c_data_ = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool did_output = false;
|
||||||
if(draw_) {
|
if(draw_) {
|
||||||
// TODO: patterned lines. Unclear what to do with the bit that comes out of b.
|
// TODO: patterned lines. Unclear what to do with the bit that comes out of b.
|
||||||
// Probably extend it to a full word?
|
// Probably extend it to a full word?
|
||||||
|
|
||||||
|
if(!has_c_data_) {
|
||||||
|
has_c_data_ = true;
|
||||||
c_data_ = ram_[pointer_[3] & ram_mask_];
|
c_data_ = ram_[pointer_[3] & ram_mask_];
|
||||||
if constexpr (record_bus) {
|
if constexpr (record_bus) {
|
||||||
transactions_.emplace_back(Transaction::Type::ReadC, pointer_[3], c_data_);
|
transactions_.emplace_back(Transaction::Type::ReadC, pointer_[3], c_data_);
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
const uint16_t output =
|
const uint16_t output =
|
||||||
apply_minterm<uint16_t>(a_data_ >> shifts_[0], b_data_, c_data_, minterms_);
|
apply_minterm<uint16_t>(a_data_ >> shifts_[0], b_data_, c_data_, minterms_);
|
||||||
ram_[pointer_[3] & ram_mask_] = output;
|
ram_[pointer_[3] & ram_mask_] = output;
|
||||||
not_zero_flag_ |= output;
|
not_zero_flag_ |= output;
|
||||||
draw_ &= !one_dot_;
|
draw_ &= !one_dot_;
|
||||||
|
has_c_data_ = false;
|
||||||
|
did_output = true;
|
||||||
if constexpr (record_bus) {
|
if constexpr (record_bus) {
|
||||||
transactions_.emplace_back(Transaction::Type::WriteFromPipeline, pointer_[3], output);
|
transactions_.emplace_back(Transaction::Type::WriteFromPipeline, pointer_[3], output);
|
||||||
}
|
}
|
||||||
@ -361,6 +375,8 @@ bool Blitter<record_bus>::advance_dma() {
|
|||||||
busy_ = false;
|
busy_ = false;
|
||||||
posit_interrupt(InterruptFlag::Blitter);
|
posit_interrupt(InterruptFlag::Blitter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return did_output;
|
||||||
} else {
|
} else {
|
||||||
// Copy mode.
|
// Copy mode.
|
||||||
if(!busy_) {
|
if(!busy_) {
|
||||||
|
@ -263,6 +263,7 @@ template <bool record_bus = false> class Blitter: public DMADevice<4, 4> {
|
|||||||
|
|
||||||
int error_ = 0;
|
int error_ = 0;
|
||||||
bool draw_ = false;
|
bool draw_ = false;
|
||||||
|
bool has_c_data_ = false;
|
||||||
|
|
||||||
void add_modulos();
|
void add_modulos();
|
||||||
std::vector<Transaction> transactions_;
|
std::vector<Transaction> transactions_;
|
||||||
|
Loading…
Reference in New Issue
Block a user