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

Method n_fabcdheat

MicropolisCore/src/CellEngine/src/cellengine.cpp:2792–2874  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2790 frobby = -frobby;
2791
2792void CellEngine::n_fabcdheat()
2793{
2794 QUAD *front = (QUAD *)frontMem;
2795 QUAD *back = (QUAD *)(backMem +
2796 (backBorder - 1) +
2797 ((backBorder - 1) * backRowBytes));
2798 long frobby = frob;
2799 long backline = backRowBytes >> 2;
2800 long nextbackline = backline << 1;
2801 long backstride = backline - ((width >> 2) + 1);
2802 long frontstride = (screenRowBytes >> 2) - (width >> 2);
2803 long xsteps = width >> 2;
2804 long yy;
2805
2806 total = 0;
2807
2808 // flip frob with the spatio-temporal phase,
2809 // since interlaced checkerboards
2810 // exchange places each step.
2811 if ((phase ^ x ^ y) & 1) {
2812 frobby = -frobby;
2813 }
2814
2815 for (yy = height;
2816 yy > 0;
2817 back += backstride,
2818 front += frontstride,
2819 yy--) {
2820 register QUAD b1, b2;
2821 register QUAD c1, c2;
2822 register QUAD d1, d2;
2823 long error = 0;
2824 long xx;
2825
2826 // Flip frob each y line, to apply opposite frobs
2827 // to each spatial phase of the checkerboard.
2828 // This works because the width must be divisible by 4.
2829 frobby = -frobby;
2830
2831 b2 = back[0];
2832 c2 = back[backline];
2833 d2 = back[nextbackline];
2834 back++;
2835
2836 for (xx = xsteps;
2837 xx > 0;
2838 xx--) {
2839 long result, cells = 0;
2840
2841 b1 = b2; b2 = back[0];
2842 c1 = c2; c2 = back[backline];
2843 d1 = d2; d2 = back[nextbackline];
2844 back++;
2845
2846 FABCDHEAT( BYTE0(b1), BYTE1(b1), BYTE2(b1),
2847 BYTE0(c1), BYTE1(c1), BYTE2(c1),
2848 BYTE0(d1), BYTE1(d1), BYTE2(d1) );
2849 SETBYTE0(cells, result);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected