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

Method n_garble

MicropolisCore/src/CellEngine/src/cellengine.cpp:3463–3531  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3461 error &= 0x0f;
3462
3463void CellEngine::n_garble()
3464{
3465 QUAD *front = (QUAD *)frontMem;
3466 QUAD *back = (QUAD *)(backMem +
3467 (backBorder - 1) +
3468 ((backBorder - 1) * backRowBytes));
3469 long backline = backRowBytes >> 2;
3470 long backstride = backline - ((width >> 2) + 1);
3471 long frontstride = (screenRowBytes >> 2) - (width >> 2);
3472 long xsteps = width >> 2;
3473 long yy;
3474
3475 total = 0;
3476
3477 for (yy = height;
3478 yy > 0;
3479 back += backstride,
3480 front += frontstride,
3481 yy--) {
3482 register QUAD b1, b2;
3483 register QUAD c1, c2;
3484 register QUAD d1, d2;
3485 long error = 0;
3486 long xx;
3487
3488 b2 = back[0];
3489 c2 = back[backline];
3490 d2 = back[backline << 1];
3491 back++;
3492
3493 for (xx = xsteps;
3494 xx > 0;
3495 xx--) {
3496 long result, cells = 0;
3497
3498 b1 = b2; b2 = back[0];
3499 c1 = c2; c2 = back[backline];
3500 d1 = d2; d2 = back[backline << 1];
3501 back++;
3502
3503 GARBLE( BYTE0(b1), BYTE1(b1), BYTE2(b1),
3504 BYTE0(c1), BYTE1(c1), BYTE2(c1),
3505 BYTE0(d1), BYTE1(d1), BYTE2(d1) );
3506 total += result;
3507 SETBYTE0(cells, result);
3508
3509 GARBLE( BYTE1(b1), BYTE2(b1), BYTE3(b1),
3510 BYTE1(c1), BYTE2(c1), BYTE3(c1),
3511 BYTE1(d1), BYTE2(d1), BYTE3(d1) );
3512 total += result;
3513 SETBYTE1(cells, result);
3514
3515 GARBLE( BYTE2(b1), BYTE3(b1), BYTE0(b2),
3516 BYTE2(c1), BYTE3(c1), BYTE0(c2),
3517 BYTE2(d1), BYTE3(d1), BYTE0(d2) );
3518 total += result;
3519 SETBYTE2(cells, result);
3520

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected