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

Method n_marble

MicropolisCore/src/CellEngine/src/cellengine.cpp:3094–3161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3092 error &= 0x0f;
3093
3094void CellEngine::n_marble()
3095{
3096 QUAD *front = (QUAD *)frontMem;
3097 QUAD *back = (QUAD *)(backMem +
3098 (backBorder - 1) +
3099 ((backBorder - 1) * backRowBytes));
3100 long backline = backRowBytes >> 2;
3101 long backstride = backline - ((width >> 2) + 1);
3102 long frontstride = (screenRowBytes >> 2) - (width >> 2);
3103 long xsteps = width >> 2;
3104 long yy;
3105
3106 total = 0;
3107
3108 for (yy = height; yy > 0;
3109 back += backstride,
3110 front += frontstride,
3111 yy--) {
3112 register QUAD b1, b2;
3113 register QUAD c1, c2;
3114 register QUAD d1, d2;
3115 long error = 0;
3116 long xx;
3117
3118 b2 = back[0];
3119 c2 = back[backline];
3120 d2 = back[backline << 1];
3121 back++;
3122
3123 for (xx = xsteps;
3124 xx > 0;
3125 xx--) {
3126 long result, cells = 0;
3127
3128 b1 = b2; b2 = back[0];
3129 c1 = c2; c2 = back[backline];
3130 d1 = d2; d2 = back[backline << 1];
3131 back++;
3132
3133 MARBLE( BYTE0(b1), BYTE1(b1), BYTE2(b1),
3134 BYTE0(c1), BYTE1(c1), BYTE2(c1),
3135 BYTE0(d1), BYTE1(d1), BYTE2(d1) );
3136 total += result;
3137 SETBYTE0(cells, result);
3138
3139 MARBLE( BYTE1(b1), BYTE2(b1), BYTE3(b1),
3140 BYTE1(c1), BYTE2(c1), BYTE3(c1),
3141 BYTE1(d1), BYTE2(d1), BYTE3(d1) );
3142 total += result;
3143 SETBYTE1(cells, result);
3144
3145 MARBLE( BYTE2(b1), BYTE3(b1), BYTE0(b2),
3146 BYTE2(c1), BYTE3(c1), BYTE0(c2),
3147 BYTE2(d1), BYTE3(d1), BYTE0(d2) );
3148 total += result;
3149 SETBYTE2(cells, result);
3150
3151 MARBLE( BYTE3(b1), BYTE0(b2), BYTE1(b2),

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected