mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-19 07:31:15 +00:00
Use simplified control lines when appropriate.
This commit is contained in:
parent
fd0fe66851
commit
26343148ae
@ -32,7 +32,9 @@ struct BusHandler: public CPU::MOS6502Esque::BusHandlerT<type> {
|
|||||||
// Record the basics of the operation.
|
// Record the basics of the operation.
|
||||||
auto &cycle = cycles.emplace_back();
|
auto &cycle = cycles.emplace_back();
|
||||||
cycle.operation = operation;
|
cycle.operation = operation;
|
||||||
cycle.extended_bus = processor.get_extended_bus_output();
|
if constexpr (has_extended_bus_output(type)) {
|
||||||
|
cycle.extended_bus = processor.get_extended_bus_output();
|
||||||
|
}
|
||||||
|
|
||||||
// Perform the operation, and fill in the cycle's value.
|
// Perform the operation, and fill in the cycle's value.
|
||||||
using BusOperation = CPU::MOS6502Esque::BusOperation;
|
using BusOperation = CPU::MOS6502Esque::BusOperation;
|
||||||
@ -113,7 +115,7 @@ struct BusHandler: public CPU::MOS6502Esque::BusHandlerT<type> {
|
|||||||
CPU::MOS6502Esque::BusOperation operation;
|
CPU::MOS6502Esque::BusOperation operation;
|
||||||
std::optional<AddressType> address;
|
std::optional<AddressType> address;
|
||||||
std::optional<uint8_t> value;
|
std::optional<uint8_t> value;
|
||||||
int extended_bus;
|
int extended_bus = 0;
|
||||||
};
|
};
|
||||||
std::vector<Cycle> cycles;
|
std::vector<Cycle> cycles;
|
||||||
|
|
||||||
@ -263,12 +265,6 @@ template <CPU::MOS6502Esque::Type type> void generate() {
|
|||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
using ExtendedBusOutput = CPU::WDC65816::ExtendedBusOutput;
|
|
||||||
const bool emulation = cycle.extended_bus & ExtendedBusOutput::Emulation;
|
|
||||||
const bool memory_size = cycle.extended_bus & ExtendedBusOutput::MemorySize;
|
|
||||||
const bool index_size = cycle.extended_bus & ExtendedBusOutput::IndexSize;
|
|
||||||
const bool memory_lock = cycle.extended_bus & ExtendedBusOutput::MemoryLock;
|
|
||||||
|
|
||||||
fprintf(target, "[");
|
fprintf(target, "[");
|
||||||
if(cycle.address) {
|
if(cycle.address) {
|
||||||
fprintf(target, "%d, ", *cycle.address);
|
fprintf(target, "%d, ", *cycle.address);
|
||||||
@ -280,16 +276,31 @@ template <CPU::MOS6502Esque::Type type> void generate() {
|
|||||||
} else {
|
} else {
|
||||||
fprintf(target, "null, ");
|
fprintf(target, "null, ");
|
||||||
}
|
}
|
||||||
fprintf(target, "\"%c%c%c%c%c%c%c%c\"]",
|
|
||||||
vda ? 'd' : '-',
|
if(has_emulation) {
|
||||||
vpa ? 'p' : '-',
|
using ExtendedBusOutput = CPU::WDC65816::ExtendedBusOutput;
|
||||||
vpb ? 'v' : '-',
|
const bool emulation = cycle.extended_bus & ExtendedBusOutput::Emulation;
|
||||||
wait ? '-' : (read ? 'r' : 'w'),
|
const bool memory_size = cycle.extended_bus & ExtendedBusOutput::MemorySize;
|
||||||
wait ? '-' : (emulation ? 'e' : '-'),
|
const bool index_size = cycle.extended_bus & ExtendedBusOutput::IndexSize;
|
||||||
wait ? '-' : (memory_size ? 'm' : '-'),
|
const bool memory_lock = cycle.extended_bus & ExtendedBusOutput::MemoryLock;
|
||||||
wait ? '-' : (index_size ? 'x' : '-'),
|
|
||||||
wait ? '-' : (memory_lock ? 'l' : '-')
|
fprintf(target, "\"%c%c%c%c%c%c%c%c\"]",
|
||||||
);
|
vda ? 'd' : '-',
|
||||||
|
vpa ? 'p' : '-',
|
||||||
|
vpb ? 'v' : '-',
|
||||||
|
wait ? '-' : (read ? 'r' : 'w'),
|
||||||
|
wait ? '-' : (emulation ? 'e' : '-'),
|
||||||
|
wait ? '-' : (memory_size ? 'm' : '-'),
|
||||||
|
wait ? '-' : (index_size ? 'x' : '-'),
|
||||||
|
wait ? '-' : (memory_lock ? 'l' : '-')
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
if(read) {
|
||||||
|
fprintf(target, "\"read\"]");
|
||||||
|
} else {
|
||||||
|
fprintf(target, "\"write\"]");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Terminate object.
|
// Terminate object.
|
||||||
|
@ -68,6 +68,10 @@ constexpr bool has(Type processor_type, Register r) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr bool has_extended_bus_output(Type processor_type) {
|
||||||
|
return processor_type == Type::TWDC65816;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* _502Selector_h */
|
#endif /* _502Selector_h */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user