22 size_t tileTypeDbCount = tileTypeDbs.size();
23 for (
size_t i = 0; i < tileTypeDbCount; ++i)
27 decodeTileType(extractor, tileTypeDb, tiles);
39 size_t tileCount = tiles.size();
40 for (
size_t i = 0; i < tileCount; ++i)
43 const Tile& tile = tiles[i];
45 unsigned tileRow = tile.
row();
46 unsigned tileColumn = tile.
column();
50 if (0 == dataWordCount)
continue;
53 if (m_buffer.size() < dataWordCount) m_buffer.resize(dataWordCount);
54 extractor.
getDataWords(tileRow, tileColumn, &(m_buffer[0]), dataWordCount);
57 decodeTilePIPs(pipControlSets, i);
62 void CfgDecoder::decodeTilePIPs(
const PIPControlSets& pipControlSets,
66 size_t pipControlSetCount = pipControlSets.size();
67 for (
size_t i = 0; i < pipControlSetCount; ++i)
75 boost::uint32_t cfgValue = 0;
76 size_t bitPositionCount = bitPositions.size();
77 for (
size_t j = bitPositionCount; j-- > 0;)
80 size_t bitPosition = bitPositions[j];
83 size_t wordIndex = bitPosition >> 5;
84 boost::uint32_t wordBits = m_buffer.at(wordIndex);
85 size_t wordBitIndex = bitPosition & 0x1f;
86 wordBits = (wordBits >> wordBitIndex) & 1;
89 cfgValue = (cfgValue << 1) | wordBits;
93 if (0 == cfgValue)
continue;
96 size_t pipBitValuesCount = pipBitValues.size();
97 for (
size_t j = 0; j < pipBitValuesCount; ++j)
103 boost::uint32_t value = pipBitValue.
bitValue();
104 if (cfgValue < value)
break;
105 if (cfgValue != value)
continue;
109 size_t count = m_pipRefs.size();
110 m_pipRefs.push_back(
PIPRef());
111 PIPRef& pipRef = m_pipRefs[count];