summaryrefslogtreecommitdiffstats
path: root/src/devices/pic/base
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/pic/base')
-rw-r--r--src/devices/pic/base/pic.cpp32
-rw-r--r--src/devices/pic/base/pic_config.cpp36
-rw-r--r--src/devices/pic/base/pic_config.h10
-rw-r--r--src/devices/pic/base/pic_protection.cpp8
-rw-r--r--src/devices/pic/base/pic_protection.h2
5 files changed, 44 insertions, 44 deletions
diff --git a/src/devices/pic/base/pic.cpp b/src/devices/pic/base/pic.cpp
index b58f480..fd8622b 100644
--- a/src/devices/pic/base/pic.cpp
+++ b/src/devices/pic/base/pic.cpp
@@ -175,23 +175,23 @@ bool Pic::Data::matchId(BitValue rawId, Device::IdData &idata) const
case Architecture::P18F:
case Architecture::P18J:
nid = rawId.clearMaskBits(0x1F);
- idata.revision = rawId.tqmaskWith(0x1F);
+ idata.revision = rawId.maskWith(0x1F);
break;
case Architecture::P24F:
- nid = (rawId >> 16).tqmaskWith(0x3FFF);
- idata.revision = (rawId >> 6).tqmaskWith(0x7);
- idata.minorRevision = rawId.tqmaskWith(0x7);
+ nid = (rawId >> 16).maskWith(0x3FFF);
+ idata.revision = (rawId >> 6).maskWith(0x7);
+ idata.minorRevision = rawId.maskWith(0x7);
break;
case Architecture::P30F:
- nid = (rawId >> 16).tqmaskWith(0xFFFF);
- idata.revision = (rawId >> 6).tqmaskWith(0x3F);
- idata.minorRevision = rawId.tqmaskWith(0x3F);
- idata.process = (rawId >> 12).tqmaskWith(0xF);
+ nid = (rawId >> 16).maskWith(0xFFFF);
+ idata.revision = (rawId >> 6).maskWith(0x3F);
+ idata.minorRevision = rawId.maskWith(0x3F);
+ idata.process = (rawId >> 12).maskWith(0xF);
break;
case Architecture::P24H:
case Architecture::P33F:
- nid = (rawId >> 16).tqmaskWith(0xFFFF);
- idata.revision = rawId.tqmaskWith(0xFFFF); // ??
+ nid = (rawId >> 16).maskWith(0xFFFF);
+ idata.revision = rawId.maskWith(0xFFFF); // ??
break;
case Architecture::Nb_Types: Q_ASSERT(false); break;
}
@@ -241,7 +241,7 @@ bool Pic::Data::checkCalibration(const Device::Array &data, TQString *message) c
}
}
if ( data.count()==1 ) {
- if ( data[0].tqmaskWith(_calibration.opcodeMask)!=_calibration.opcode ) {
+ if ( data[0].maskWith(_calibration.opcodeMask)!=_calibration.opcode ) {
if (message) *message = i18n("Calibration word is not a compatible opcode (%2).")
.tqarg(toHexLabel(_calibration.opcode, nbCharsWord(MemoryRangeType::Code)));
return false;
@@ -326,16 +326,16 @@ Device::Array Pic::Data::gotoInstruction(Address address, bool withPageSelection
bool Pic::Data::isGotoInstruction(BitValue instruction) const
{
switch (_architecture.type()) {
- case Architecture::P10X: return ( instruction.tqmaskWith(0xE00)==0xA00 );
- case Architecture::P16X: return ( instruction.tqmaskWith(0xF800)==0x2800 );
- case Architecture::P17C: return ( instruction.tqmaskWith(0xE000)==0xC000 );
+ case Architecture::P10X: return ( instruction.maskWith(0xE00)==0xA00 );
+ case Architecture::P16X: return ( instruction.maskWith(0xF800)==0x2800 );
+ case Architecture::P17C: return ( instruction.maskWith(0xE000)==0xC000 );
case Architecture::P18C:
case Architecture::P18F:
- case Architecture::P18J: return ( instruction.tqmaskWith(0xFF00)==0xEF00 );
+ case Architecture::P18J: return ( instruction.maskWith(0xFF00)==0xEF00 );
case Architecture::P24F:
case Architecture::P24H:
case Architecture::P30F:
- case Architecture::P33F: return ( instruction.tqmaskWith(0xFF0000)==0x040000 );
+ case Architecture::P33F: return ( instruction.maskWith(0xFF0000)==0x040000 );
case Architecture::Nb_Types: Q_ASSERT(false); break;
}
return false;
diff --git a/src/devices/pic/base/pic_config.cpp b/src/devices/pic/base/pic_config.cpp
index 811a38e..6e59d90 100644
--- a/src/devices/pic/base/pic_config.cpp
+++ b/src/devices/pic/base/pic_config.cpp
@@ -280,30 +280,30 @@ const Pic::Config::Data Pic::Config::DATA[] = {
{ { 0, 0 }, Fixed, { { 0, 0 } } }
};
-TQMap<TQString, Pic::Config::MapData> *Pic::Config::_tqmasks = 0;
-TQMap<TQString, Pic::Config::MapData> &Pic::Config::tqmasks()
+TQMap<TQString, Pic::Config::MapData> *Pic::Config::_masks = 0;
+TQMap<TQString, Pic::Config::MapData> &Pic::Config::masks()
{
- if ( _tqmasks==0 ) {
- _tqmasks = new TQMap<TQString, MapData>;
+ if ( _masks==0 ) {
+ _masks = new TQMap<TQString, MapData>;
for (uint i=0; DATA[i].tqmask.name; i++) {
- (*_tqmasks)[DATA[i].tqmask.name] = MapData(i, -1);
+ (*_masks)[DATA[i].tqmask.name] = MapData(i, -1);
if ( DATA[i].type==MemoryRange ) {
for (uint k=0; k<Protection::MAX_NB_BLOCKS; k++)
- (*_tqmasks)[TQString("%1_%2").tqarg(DATA[i].tqmask.name).tqarg(k)] = MapData(i, k);
+ (*_masks)[TQString("%1_%2").tqarg(DATA[i].tqmask.name).tqarg(k)] = MapData(i, k);
}
}
}
- return *_tqmasks;
+ return *_masks;
}
bool Pic::Config::hasMaskName(const TQString &tqmask)
{
- return tqmasks().tqcontains(tqmask);
+ return masks().tqcontains(tqmask);
}
-TQString Pic::Config::tqmaskLabel(const TQString &tqmask)
+TQString Pic::Config::maskLabel(const TQString &tqmask)
{
- const MapData &mp = tqmasks()[tqmask];
+ const MapData &mp = masks()[tqmask];
TQString s = i18n(DATA[mp.index].tqmask.label);
if ( mp.block>=0 ) return i18n("%1 for block %2").tqarg(s).tqarg(mp.block);
return s;
@@ -312,10 +312,10 @@ TQString Pic::Config::tqmaskLabel(const TQString &tqmask)
const Pic::Config::Mask *Pic::Config::findMask(const TQString &tqmask, uint *wordIndex) const
{
for (uint i=0; i<uint(_words.count()); i++)
- for (uint k=0; k<uint(_words[i].tqmasks.count()); k++) {
- if ( _words[i].tqmasks[k].name==tqmask ) {
+ for (uint k=0; k<uint(_words[i].masks.count()); k++) {
+ if ( _words[i].masks[k].name==tqmask ) {
if (wordIndex) *wordIndex = i;
- return &_words[i].tqmasks[k];
+ return &_words[i].masks[k];
}
}
return 0;
@@ -332,7 +332,7 @@ const Pic::Config::Value *Pic::Config::findValue(const TQString &tqmask, const T
bool Pic::Config::checkValueName(const TQString &tqmask, const TQString &name) const
{
- const Data &data = DATA[tqmasks()[tqmask].index];
+ const Data &data = DATA[masks()[tqmask].index];
TQString pinRegexp = "[A-Z]+\\d*(/[A-Z]+\\d*)?";
switch (data.type) {
case Fixed: break;
@@ -381,7 +381,7 @@ bool Pic::Config::checkValueName(const TQString &tqmask, const TQString &name) c
TQString Pic::Config::valueLabel(const TQString &tqmask, const TQString &name)
{
- const Data &data = DATA[tqmasks()[tqmask].index];
+ const Data &data = DATA[masks()[tqmask].index];
switch (data.type) {
case Fixed:
case ValueDouble:
@@ -406,7 +406,7 @@ TQString Pic::Config::valueLabel(const TQString &tqmask, const TQString &name)
BitValue Pic::Config::Word::usedMask() const
{
BitValue tqmask = 0x0;
- for (uint i=0; i<uint(tqmasks.count()); i++) tqmask |= tqmasks[i].value;
+ for (uint i=0; i<uint(masks.count()); i++) tqmask |= masks[i].value;
return tqmask;
}
@@ -435,12 +435,12 @@ TQDataStream &Pic::operator >>(TQDataStream &s, Config::Mask &tqmask)
TQDataStream &Pic::operator <<(TQDataStream &s, const Config::Word &word)
{
- s << word.name << word.ignoredCNames << word.wtqmask << word.ptqmask << word.ctqmask << word.bvalue << word.tqmasks;
+ s << word.name << word.ignoredCNames << word.wtqmask << word.ptqmask << word.ctqmask << word.bvalue << word.masks;
return s;
}
TQDataStream &Pic::operator >>(TQDataStream &s, Config::Word &word)
{
- s >> word.name >> word.ignoredCNames >> word.wtqmask >> word.ptqmask >> word.ctqmask >> word.bvalue >> word.tqmasks;
+ s >> word.name >> word.ignoredCNames >> word.wtqmask >> word.ptqmask >> word.ctqmask >> word.bvalue >> word.masks;
return s;
}
diff --git a/src/devices/pic/base/pic_config.h b/src/devices/pic/base/pic_config.h
index 67c0b1c..6e13210 100644
--- a/src/devices/pic/base/pic_config.h
+++ b/src/devices/pic/base/pic_config.h
@@ -48,9 +48,9 @@ public:
public:
TQString name;
TQStringList ignoredCNames;
- BitValue wtqmask, ptqmask, ctqmask; // write, protected, and checksum bits tqmasks
+ BitValue wtqmask, ptqmask, ctqmask; // write, protected, and checksum bits masks
BitValue bvalue; // blank value
- TQValueVector<Mask> tqmasks; // ordered from lower to higher
+ TQValueVector<Mask> masks; // ordered from lower to higher
BitValue usedMask() const;
};
@@ -62,7 +62,7 @@ public:
const Value *findValue(const TQString &tqmask, const TQString &value) const;
const Mask *findMask(const TQString &tqmask, uint *wordIndex = 0) const;
static bool hasMaskName(const TQString &tqmask);
- static TQString tqmaskLabel(const TQString &tqmask);
+ static TQString maskLabel(const TQString &tqmask);
bool checkValueName(const TQString &tqmask, const TQString &name) const;
static TQString valueLabel(const TQString &tqmask, const TQString &name);
@@ -73,8 +73,8 @@ private:
MapData(int i, int b) : index(i), block(b) {}
int index, block;
};
- static TQMap<TQString, MapData> &tqmasks();
- static TQMap<TQString, MapData> *_tqmasks; // tqmask name -> index in DATA
+ static TQMap<TQString, MapData> &masks();
+ static TQMap<TQString, MapData> *_masks; // tqmask name -> index in DATA
struct NameData {
const char *name, *label;
diff --git a/src/devices/pic/base/pic_protection.cpp b/src/devices/pic/base/pic_protection.cpp
index 7af925c..4c08c45 100644
--- a/src/devices/pic/base/pic_protection.cpp
+++ b/src/devices/pic/base/pic_protection.cpp
@@ -29,7 +29,7 @@ bool Pic::Protection::isAllProtectedValueName(const TQString &name) const
Pic::Protection::Family Pic::Protection::family() const
{
if ( _config.findMask("WRTBS") ) return CodeGuard;
- TQString tqmask = tqmaskName(ProgramProtected, MemoryRangeType::Code);
+ TQString tqmask = maskName(ProgramProtected, MemoryRangeType::Code);
if ( _config.findMask(TQString("%1_%2").tqarg(tqmask).tqarg(0)) ) return BlockProtection;
if ( _config.findMask(tqmask) ) return BasicProtection;
return NoProtection;
@@ -79,10 +79,10 @@ TQString Pic::Protection::blockMaskName(Type type, uint block) const
if ( type==StandardSecurity || type==HighSecurity ) return (block==0 ? "SSSEC" : "GSSEC");
return TQString();
}
- return TQString("%1_%2").tqarg(tqmaskName(type, MemoryRangeType::Code)).tqarg(block);
+ return TQString("%1_%2").tqarg(maskName(type, MemoryRangeType::Code)).tqarg(block);
}
-TQString Pic::Protection::tqmaskName(Type type, MemoryRangeType mtype) const
+TQString Pic::Protection::maskName(Type type, MemoryRangeType mtype) const
{
Q_ASSERT( type!=Nb_Types );
switch (mtype.type()) {
@@ -215,7 +215,7 @@ Pic::Protection::ProtectedRange Pic::Protection::extractRange(const TQString &tq
for (MemoryRangeType type; type<=MemoryRangeType::Nb_Types; ++type) { // #### danger: <=
isBootBlock = ( type==MemoryRangeType::Nb_Types );
for (uint k=0; k<Nb_Types; k++) {
- TQString mname = (isBootBlock ? bootMaskName(Type(k)) : tqmaskName(Type(k), type));
+ TQString mname = (isBootBlock ? bootMaskName(Type(k)) : maskName(Type(k), type));
if ( rexp.cap(1)!=mname ) continue;
rtype = (isBootBlock ? MemoryRangeType(MemoryRangeType::Code) : type);
ptype = Type(k);
diff --git a/src/devices/pic/base/pic_protection.h b/src/devices/pic/base/pic_protection.h
index a10a8a6..86712f9 100644
--- a/src/devices/pic/base/pic_protection.h
+++ b/src/devices/pic/base/pic_protection.h
@@ -38,7 +38,7 @@ public:
TQString blockLabel(uint i) const;
AddressRangeVector extractRanges(const TQString &name, MemoryRangeType type) const;
bool checkRange(const TQString &tqmask, const TQString &name) const;
- TQString tqmaskName(Type type, MemoryRangeType mtype) const;
+ TQString maskName(Type type, MemoryRangeType mtype) const;
bool isAllProtectedValueName(const TQString &valueName) const;
bool isNoneProtectedValueName(const TQString &valueName) const;