summaryrefslogtreecommitdiffstats
path: root/src/devices/pic/pic/pic_memory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/pic/pic/pic_memory.cpp')
-rw-r--r--src/devices/pic/pic/pic_memory.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/devices/pic/pic/pic_memory.cpp b/src/devices/pic/pic/pic_memory.cpp
index 5ffb663..c7071be 100644
--- a/src/devices/pic/pic/pic_memory.cpp
+++ b/src/devices/pic/pic/pic_memory.cpp
@@ -85,7 +85,7 @@ BitValue Pic::Memory::normalizedWord(MemoryRangeType type, uint offset) const
void Pic::Memory::setWord(MemoryRangeType type, uint offset, BitValue value)
{
- if ( offset>=_ranges[type].size() ) qDebug("Memory::setWord: type=%s offset=%s size=%s value=%s", type.key(), toHexLabelAbs(offset).latin1(), toHexLabelAbs(_ranges[type].size()).latin1(), toHexLabelAbs(value).latin1());
+ if ( offset>=_ranges[type].size() ) tqDebug("Memory::setWord: type=%s offset=%s size=%s value=%s", type.key(), toHexLabelAbs(offset).latin1(), toHexLabelAbs(_ranges[type].size()).latin1(), toHexLabelAbs(value).latin1());
CRASH_ASSERT( offset<_ranges[type].size() );
_ranges[type][offset] = value;
}
@@ -204,7 +204,7 @@ AddressRangeVector Pic::Memory::protectedRanges(Protection::Type ptype, MemoryRa
if ( protection.family()!=Protection::CodeGuard ) {
TQString maskName = protection.maskName(ptype, type);
TQString value = findValue(maskName);
- //qDebug("%s %s", maskName.latin1(), value.latin1());
+ //tqDebug("%s %s", maskName.latin1(), value.latin1());
if ( !value.isEmpty() ) {
AddressRangeVector tmp = protection.extractRanges(value, type);
Q_ASSERT( tmp.count()==1 );
@@ -336,9 +336,9 @@ BitValue Pic::Memory::checksum() const
bool isProtected = !rv.isEmpty();
uint inc = device().addressIncrement(MemoryRangeType::Code);
//uint nbChars = device().nbCharsWord(MemoryRangeType::Code);
- //qDebug("protected: %i nb: %s (%s)", isProtected, toHexLabelAbs(inc*device().nbWords(MemoryRangeType::Code)).latin1(), toHexLabel(mask, nbChars).latin1());
+ //tqDebug("protected: %i nb: %s (%s)", isProtected, toHexLabelAbs(inc*device().nbWords(MemoryRangeType::Code)).latin1(), toHexLabel(mask, nbChars).latin1());
//for (uint i=0; i<rv.count(); i++)
- // qDebug("protected: %s:%s", toHex(rv[i].start, nbChars).latin1(), toHex(rv[i].end, nbChars).latin1());
+ // tqDebug("protected: %s:%s", toHex(rv[i].start, nbChars).latin1(), toHex(rv[i].end, nbChars).latin1());
if ( isProtected && (device().architecture()==Pic::Architecture::P18J || device().architecture()==Pic::Architecture::P24F) )
return 0x0000;
Checksum::Algorithm algorithm = Checksum::Algorithm::Normal;
@@ -353,12 +353,12 @@ BitValue Pic::Memory::checksum() const
cs = checksums[valueName].constant;
}
}
- //qDebug("constant: %s", toHexLabelAbs(cs).data());
- //qDebug("algo: %s", Checksum::ALGORITHM_DATA[algorithm].name);
+ //tqDebug("constant: %s", toHexLabelAbs(cs).data());
+ //tqDebug("algo: %s", Checksum::ALGORITHM_DATA[algorithm].name);
for (uint i=0; i<device().nbWords(MemoryRangeType::Code); i++) {
if ( algorithm==Checksum::Algorithm::Normal && rv.contains(inc*i) ) continue;
BitValue v = word(MemoryRangeType::Code, i).maskWith(mask);
- //if ( i==0 || i==device().nbWords(MemoryRangeType::Code)-1 ) qDebug("%s %s", toHexLabel(i, 4).latin1(), toHexLabel(v, 4).latin1());
+ //if ( i==0 || i==device().nbWords(MemoryRangeType::Code)-1 ) tqDebug("%s %s", toHexLabel(i, 4).latin1(), toHexLabel(v, 4).latin1());
switch (device().architecture().type()) {
case Architecture::P10X:
case Architecture::P16X:
@@ -387,19 +387,19 @@ BitValue Pic::Memory::checksum() const
case Architecture::Nb_Types: Q_ASSERT(false); break;
}
}
- //qDebug("after code: %s", toHexLabelAbs(cs).latin1());
+ //tqDebug("after code: %s", toHexLabelAbs(cs).latin1());
// config
const Config &config = device().config();
for (uint i=0; i<uint(config._words.count()); i++) {
const Config::Word &cword = config._words[i];
BitValue v = word(MemoryRangeType::Config, i).maskWith(cword.cmask);
//uint nbChars = device().nbCharsWord(MemoryRangeType::Config);
- // qDebug("%i: %s %s", i, toHex(word(MemoryRangeType::Config, i), nbChars).latin1(), toHex(cword.cmask, nbChars).latin1());
+ // tqDebug("%i: %s %s", i, toHex(word(MemoryRangeType::Config, i), nbChars).latin1(), toHex(cword.cmask, nbChars).latin1());
if ( ( device().name()=="16C61" || device().name()=="16C71" ) && isProtected ) cs += v | 0x0060;
else if ( device().is16bitFamily() ) cs += v.byte(0) + v.byte(1);
else cs += v;
}
- //qDebug("after config: %s", toHexLabelAbs(cs).latin1());
+ //tqDebug("after config: %s", toHexLabelAbs(cs).latin1());
// user ids
if ( isProtected && device().isPresent(MemoryRangeType::UserId) && !device().is16bitFamily() && algorithm==Checksum::Algorithm::Normal ) {
BitValue id = 0x0;
@@ -408,14 +408,14 @@ BitValue Pic::Memory::checksum() const
BitValue v = word(MemoryRangeType::UserId, nb-i-1).maskWith(0xF);
if ( device().is18Family() ) id += v;
else {
- // qDebug("id %i (%i): %s %s", i, nbb, toHex(v, 4).latin1(), toHex(v << (nbb*i), 9).latin1());
+ // tqDebug("id %i (%i): %s %s", i, nbb, toHex(v, 4).latin1(), toHex(v << (nbb*i), 9).latin1());
id += v << (4*i);
}
}
- //qDebug("id %s", toHexLabelAbs(id).latin1());
+ //tqDebug("id %s", toHexLabelAbs(id).latin1());
cs += id;
}
- //qDebug("checksum: %s %s", toHexLabelAbs(cs).latin1(), toHex(cs & 0xFFFF, 4).latin1());
+ //tqDebug("checksum: %s %s", toHexLabelAbs(cs).latin1(), toHex(cs & 0xFFFF, 4).latin1());
return cs.maskWith(0xFFFF);
}
@@ -471,11 +471,11 @@ void Pic::Memory::toHexBuffer(MemoryRangeType type, HexBuffer &hb) const
uint byte = 0;
uint wOffset = 0;
uint wByte = 0;
- //qDebug("%s wnb=%i snb=%i div=%i", MEMORY_RANGE_TYPE_DATA[type].label, wNbBytes, sNbBytes, div);
+ //tqDebug("%s wnb=%i snb=%i div=%i", MEMORY_RANGE_TYPE_DATA[type].label, wNbBytes, sNbBytes, div);
for (uint k=0; k<wNbBytes*device().nbWords(type); k++) {
// set byte
BitValue s = _ranges[type][wOffset].maskWith(mask);
- //if ( k<4 ) qDebug("s=%s so=%s sb=%i wo=%i wb=%i", toHex(s, 8).data(), toHex(sOffset, 8).data(), sByte, wOffset, wByte);
+ //if ( k<4 ) tqDebug("s=%s so=%s sb=%i wo=%i wb=%i", toHex(s, 8).data(), toHex(sOffset, 8).data(), sByte, wOffset, wByte);
s = s.byte(wByte);
if ( (byte%2)==0 ) hb.insert(offset, s);
else hb.insert(offset, hb[offset] | (s << ((byte%2)*8)));
@@ -517,11 +517,11 @@ void Pic::Memory::fromHexBuffer(MemoryRangeType type, const HexBuffer &hb, Warni
uint byte = 0;
uint wOffset = 0;
uint wByte = 0;
- //qDebug("%s wnb=%i snb=%i", MEMORY_RANGE_TYPE_DATA[type].label, wNbBytes, nbBytes);
+ //tqDebug("%s wnb=%i snb=%i", MEMORY_RANGE_TYPE_DATA[type].label, wNbBytes, nbBytes);
for (uint k=0; k<wNbBytes*device().nbWords(type); k++) {
// set byte
BitValue s = hb[offset];
- //if ( k<4 ) qDebug("s=%s so=%s sb=%i wo=%i wb=%i", toHex(s, 8).data(), toHex(offset, 8).data(), byte, wOffset, wByte);
+ //if ( k<4 ) tqDebug("s=%s so=%s sb=%i wo=%i wb=%i", toHex(s, 8).data(), toHex(offset, 8).data(), byte, wOffset, wByte);
if ( !s.isInitialized() ) {
if ( type==MemoryRangeType::Config ) _ranges[type][wOffset] = mask;
else _ranges[type][wOffset] = BitValue();