mirror of
https://github.com/cmosher01/v6502cpp.git
synced 2026-03-15 00:16:20 +00:00
fixed inconsistent breaking; other refactoring
the sets of Segment* 's needed to be sorted consistently
This commit is contained in:
@@ -10,16 +10,8 @@
|
||||
#include "trans.h"
|
||||
#include <set>
|
||||
|
||||
//void StateCalculator::recalcAll() {
|
||||
// std::set<int> riSeg;
|
||||
// for (int iSeg = 0; iSeg < segs.size(); ++iSeg) {
|
||||
// addRecalc(iSeg,riSeg);
|
||||
// }
|
||||
// recalc(riSeg);
|
||||
//}
|
||||
|
||||
void StateCalculator::recalc(Segment* seg) {
|
||||
std::set<Segment*> rSeg;
|
||||
setpSeg rSeg;
|
||||
rSeg.insert(seg);
|
||||
recalc(rSeg);
|
||||
}
|
||||
@@ -32,10 +24,10 @@ void StateCalculator::recalc(Segment* seg) {
|
||||
*/
|
||||
#define SANE (100)
|
||||
|
||||
void StateCalculator::recalc(const std::set<Segment*>& segs) {
|
||||
void StateCalculator::recalc(const setpSeg& segs) {
|
||||
int sanity(0);
|
||||
|
||||
std::set<Segment*> changed(segs);
|
||||
setpSeg changed(segs);
|
||||
while (!changed.empty()) {
|
||||
if (++sanity >= SANE) {
|
||||
throw "ERROR: reached maximum iteration limit while recalculating CPU state";
|
||||
@@ -45,7 +37,7 @@ void StateCalculator::recalc(const std::set<Segment*>& segs) {
|
||||
for (auto s : changed) {
|
||||
c.recalcNode(s);
|
||||
}
|
||||
changed = c.getChanged();
|
||||
changed = c.segs;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user