MCPcopy Create free account
hub / github.com/SimHacker/micropolis / n_fdheat

Method n_fdheat

MicropolisCore/src/CellEngine/src/cellengine.cpp:2193–2261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2191
2192
2193void CellEngine::n_fdheat()
2194{
2195 QUAD *front = (QUAD *)frontMem;
2196 QUAD *back = (QUAD *)(backMem +
2197 (backBorder - 1) +
2198 ((backBorder - 1) * backRowBytes));
2199 long backline = backRowBytes >> 2;
2200 long backstride = backline - ((width >> 2) + 1);
2201 long frontstride = (screenRowBytes >> 2) - (width >> 2);
2202 long xsteps = width >> 2;
2203 long yy;
2204
2205 total = 0;
2206
2207 for (yy = height;
2208 yy > 0;
2209 back += backstride,
2210 front += frontstride,
2211 yy--) {
2212 register QUAD b1, b2;
2213 register QUAD c1, c2;
2214 register QUAD d1, d2;
2215 long error = 0;
2216 long xx;
2217
2218 b2 = back[0];
2219 c2 = back[backline];
2220 d2 = back[backline << 1];
2221 back++;
2222
2223 for (xx = xsteps;
2224 xx > 0;
2225 xx--) {
2226 long result, cells = 0;
2227
2228 b1 = b2; b2 = back[0];
2229 c1 = c2; c2 = back[backline];
2230 d1 = d2; d2 = back[backline << 1];
2231 back++;
2232
2233 FDHEAT( BYTE0(b1), BYTE1(b1), BYTE2(b1),
2234 BYTE0(c1), BYTE1(c1), BYTE2(c1),
2235 BYTE0(d1), BYTE1(d1), BYTE2(d1) );
2236 total += result;
2237 SETBYTE0(cells, result);
2238
2239 FDHEAT( BYTE1(b1), BYTE2(b1), BYTE3(b1),
2240 BYTE1(c1), BYTE2(c1), BYTE3(c1),
2241 BYTE1(d1), BYTE2(d1), BYTE3(d1) );
2242 total += result;
2243 SETBYTE1(cells, result);
2244
2245 FDHEAT( BYTE2(b1), BYTE3(b1), BYTE0(b2),
2246 BYTE2(c1), BYTE3(c1), BYTE0(c2),
2247 BYTE2(d1), BYTE3(d1), BYTE0(d2) );
2248 total += result;
2249 SETBYTE2(cells, result);
2250

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected