refactor: add Cpu6502Helper; extract Common

This commit is contained in:
Christopher Mosher
2013-12-14 21:04:57 -05:00
parent 40ba79a34d
commit ca692a6fc8
13 changed files with 283 additions and 349 deletions

View File

@@ -6,10 +6,15 @@
*/
#include "SegmentCache.h"
#include "Common.h"
#include <memory>
#include <string>
#include <map>
SegmentCache::~SegmentCache() {
delete this->c;
}
Segment* SegmentCache::getOrAdd(const std::string& id) {
if (this->cache.find(id) == this->cache.end()) {
this->cache[id] = std::make_shared<Segment>(id);
@@ -95,7 +100,7 @@ void SegmentCache::setDataSegs(const unsigned char data) {
this->c->DB7->set(x & 1);
}
void SegmentCache::addDataToRecalc(setpSeg& s) {
void SegmentCache::addDataToRecalc(setpSeg& s) const {
s.insert(this->c->DB0);
s.insert(this->c->DB1);
s.insert(this->c->DB2);