MCPcopy Create free account
hub / github.com/diasurgical/devilution / GenAscTabs

Function GenAscTabs

3rdParty/PKWare/explode.cpp:151–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151static void PKWAREAPI GenAscTabs(TDcmpStruct * pWork)
152{
153 unsigned short * pChCodeAsc = &ChCodeAsc[0xFF];
154 unsigned int acc, add;
155 unsigned short count;
156
157 for(count = 0x00FF; pChCodeAsc >= ChCodeAsc; pChCodeAsc--, count--)
158 {
159 unsigned char * pChBitsAsc = pWork->ChBitsAsc + count;
160 unsigned char bits_asc = *pChBitsAsc;
161
162 if(bits_asc <= 8)
163 {
164 add = (1 << bits_asc);
165 acc = *pChCodeAsc;
166
167 do
168 {
169 pWork->offs2C34[acc] = (unsigned char)count;
170 acc += add;
171 }
172 while(acc < 0x100);
173 }
174 else if((acc = (*pChCodeAsc & 0xFF)) != 0)
175 {
176 pWork->offs2C34[acc] = 0xFF;
177
178 if(*pChCodeAsc & 0x3F)
179 {
180 bits_asc -= 4;
181 *pChBitsAsc = bits_asc;
182
183 add = (1 << bits_asc);
184 acc = *pChCodeAsc >> 4;
185 do
186 {
187 pWork->offs2D34[acc] = (unsigned char)count;
188 acc += add;
189 }
190 while(acc < 0x100);
191 }
192 else
193 {
194 bits_asc -= 6;
195 *pChBitsAsc = bits_asc;
196
197 add = (1 << bits_asc);
198 acc = *pChCodeAsc >> 6;
199 do
200 {
201 pWork->offs2E34[acc] = (unsigned char)count;
202 acc += add;
203 }
204 while(acc < 0x80);
205 }
206 }
207 else
208 {

Callers 1

explodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected