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

Method n_twoheats

MicropolisCore/src/CellEngine/src/cellengine.cpp:3542–3610  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3540 error &= 7;
3541
3542void CellEngine::n_twoheats()
3543{
3544 QUAD *front = (QUAD *)frontMem;
3545 QUAD *back = (QUAD *)(backMem +
3546 (backBorder - 1) +
3547 ((backBorder - 1) * backRowBytes));
3548 long backline = backRowBytes >> 2;
3549 long backstride = backline - ((width >> 2) + 1);
3550 long frontstride = (screenRowBytes >> 2) - (width >> 2);
3551 long xsteps = width >> 2;
3552 long yy;
3553
3554 total = 0;
3555
3556 for (yy = height;
3557 yy > 0;
3558 back += backstride,
3559 front += frontstride,
3560 yy--) {
3561 register QUAD b1, b2;
3562 register QUAD c1, c2;
3563 register QUAD d1, d2;
3564 long error = 0;
3565 long xx;
3566
3567 b2 = back[0];
3568 c2 = back[backline];
3569 d2 = back[backline << 1];
3570 back++;
3571
3572 for (xx = xsteps;
3573 xx > 0;
3574 xx--) {
3575 long result, cells = 0;
3576
3577 b1 = b2; b2 = back[0];
3578 c1 = c2; c2 = back[backline];
3579 d1 = d2; d2 = back[backline << 1];
3580 back++;
3581
3582 TWOHEATS( BYTE0(b1), BYTE1(b1), BYTE2(b1),
3583 BYTE0(c1), BYTE1(c1), BYTE2(c1),
3584 BYTE0(d1), BYTE1(d1), BYTE2(d1) );
3585 total += result;
3586 SETBYTE0(cells, result);
3587
3588 TWOHEATS( BYTE1(b1), BYTE2(b1), BYTE3(b1),
3589 BYTE1(c1), BYTE2(c1), BYTE3(c1),
3590 BYTE1(d1), BYTE2(d1), BYTE3(d1) );
3591 total += result;
3592 SETBYTE1(cells, result);
3593
3594 TWOHEATS( BYTE2(b1), BYTE3(b1), BYTE0(b2),
3595 BYTE2(c1), BYTE3(c1), BYTE0(c2),
3596 BYTE2(d1), BYTE3(d1), BYTE0(d2) );
3597 total += result;
3598 SETBYTE2(cells, result);
3599

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected