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

Method n_harble

MicropolisCore/src/CellEngine/src/cellengine.cpp:4577–4645  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4575 error &= 0x0f;
4576
4577void CellEngine::n_harble()
4578{
4579 QUAD *front = (QUAD *)frontMem;
4580 QUAD *back = (QUAD *)(backMem +
4581 (backBorder - 1) +
4582 ((backBorder - 1) * backRowBytes));
4583 long backline = backRowBytes >> 2;
4584 long backstride = backline - ((width >> 2) + 1);
4585 long frontstride = (screenRowBytes >> 2) - (width >> 2);
4586 long xsteps = width >> 2;
4587 long yy;
4588
4589 total = 0;
4590
4591 for (yy = height;
4592 yy > 0;
4593 back += backstride,
4594 front += frontstride,
4595 yy--) {
4596 register QUAD b1, b2;
4597 register QUAD c1, c2;
4598 register QUAD d1, d2;
4599 long error = 0;
4600 long xx;
4601
4602 b2 = back[0];
4603 c2 = back[backline];
4604 d2 = back[backline << 1];
4605 back++;
4606
4607 for (xx = xsteps;
4608 xx > 0;
4609 xx--) {
4610 long result, cells = 0;
4611
4612 b1 = b2; b2 = back[0];
4613 c1 = c2; c2 = back[backline];
4614 d1 = d2; d2 = back[backline << 1];
4615 back++;
4616
4617 HARBLE( BYTE0(b1), BYTE1(b1), BYTE2(b1),
4618 BYTE0(c1), BYTE1(c1), BYTE2(c1),
4619 BYTE0(d1), BYTE1(d1), BYTE2(d1) );
4620 total += result;
4621 SETBYTE0(cells, result);
4622
4623 HARBLE( BYTE1(b1), BYTE2(b1), BYTE3(b1),
4624 BYTE1(c1), BYTE2(c1), BYTE3(c1),
4625 BYTE1(d1), BYTE2(d1), BYTE3(d1) );
4626 total += result;
4627 SETBYTE1(cells, result);
4628
4629 HARBLE( BYTE2(b1), BYTE3(b1), BYTE0(b2),
4630 BYTE2(c1), BYTE3(c1), BYTE0(c2),
4631 BYTE2(d1), BYTE3(d1), BYTE0(d2) );
4632 total += result;
4633 SETBYTE2(cells, result);
4634

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected