mirror of
https://github.com/cmosher01/v6502cpp.git
synced 2026-01-26 08:16:21 +00:00
fixed inconsistent breaking; other refactoring
the sets of Segment* 's needed to be sorted consistently
This commit is contained in:
20
Cpu6502.cpp
20
Cpu6502.cpp
@@ -29,7 +29,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef TRACESEG
|
||||
#define dumpSegs() dumpSegments()
|
||||
#define dumpSegs() this->trace.dumpSegments()
|
||||
#else
|
||||
#define dumpSegs()
|
||||
#endif
|
||||
@@ -59,7 +59,7 @@ void Cpu6502::powerOn() {
|
||||
initPins();
|
||||
|
||||
std::cout << "initial full calculation..." << std::endl;
|
||||
recalc(segs.all());
|
||||
StateCalculator::recalc(segs.all());
|
||||
dumpRegs();
|
||||
dumpSegs();
|
||||
}
|
||||
@@ -68,14 +68,6 @@ void Cpu6502::setSeg(Segment* s, bool on) {
|
||||
s->set(on);
|
||||
}
|
||||
|
||||
void Cpu6502::recalc(Segment* s) {
|
||||
StateCalculator::recalc(s);
|
||||
}
|
||||
|
||||
void Cpu6502::recalc(std::set<Segment*> s) {
|
||||
StateCalculator::recalc(s);
|
||||
}
|
||||
|
||||
void Cpu6502::initPins() {
|
||||
// set voltage supply and ground.
|
||||
setSeg(n->VCC, true);
|
||||
@@ -108,7 +100,7 @@ void Cpu6502::initPins() {
|
||||
|
||||
void Cpu6502::reset() {
|
||||
setSeg(n->RES, true);
|
||||
recalc(n->RES);
|
||||
StateCalculator::recalc(n->RES);
|
||||
}
|
||||
|
||||
void Cpu6502::tick() {
|
||||
@@ -138,7 +130,7 @@ void Cpu6502::step() {
|
||||
|
||||
void Cpu6502::clock(bool phase) {
|
||||
setSeg(n->CLK0, phase);
|
||||
recalc(n->CLK0);
|
||||
StateCalculator::recalc(n->CLK0);
|
||||
}
|
||||
|
||||
void Cpu6502::rw() {
|
||||
@@ -146,9 +138,9 @@ void Cpu6502::rw() {
|
||||
if (n->CLK2OUT->on) {
|
||||
readBus();
|
||||
|
||||
std::set<Segment*> s;
|
||||
setpSeg s;
|
||||
segs.addDataToRecalc(s);
|
||||
recalc(s);
|
||||
StateCalculator::recalc(s);
|
||||
|
||||
writeBus();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user