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

Method n_daft

MicropolisCore/src/CellEngine/src/cellengine.cpp:4014–4108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4012#define OPERAND(x) ((x) & OPERAND_MASK)
4013
4014void CellEngine::n_daft()
4015{
4016 Byte *front = frontMem;
4017 Byte *back = backMem +
4018 backBorder +
4019 (backBorder * backRowBytes);
4020 Byte *f = front, *b = back;
4021 long xx, yy;
4022
4023 Byte nw, n, ne;
4024 Byte ww, w, c, e, ee;
4025 Byte sw, s, se;
4026 for (yy = 0;
4027 yy < height;
4028 f += screenRowBytes,
4029 b += backRowBytes,
4030 yy++) {
4031
4032 // .. __ .. .. ..
4033 // __ n ne .. ..
4034 // w c e ee ..
4035 // __ s se .. ..
4036 // .. __ .. .. ..
4037
4038 n = b[-1 + -backRowBytes];
4039 ne = b[-backRowBytes];
4040 w = b[-2];
4041 c = b[-1];
4042 e = b[0];
4043 ee = b[1];
4044 s = b[-1 + backRowBytes];
4045 se = b[backRowBytes];
4046
4047 for (xx = 0;
4048 xx < width;
4049 xx++) {
4050 // .. .. NN .. ..
4051 // .. nw n NE ..
4052 // ww w c e EE
4053 // .. sw s SE ..
4054 // .. .. SS .. ..
4055
4056 nw = n;
4057 n = ne;
4058 ne = b[xx + 1 + -backRowBytes];
4059 ww = w;
4060 w = c;
4061 c = e;
4062 e = ee;
4063 ee = b[xx + 2];
4064 sw = s;
4065 s = se;
4066 se = b[xx + 1 + backRowBytes];
4067
4068 switch (OPCODE(c)) {
4069 case OPCODE_NORTH:
4070 break;
4071 case OPCODE_EAST:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected