"Populous: The Beginning" frame breakdown
github.com5 pointsby peterderivaz2 comments
>>> import numpy
>>> x=0
>>> y=numpy.int32(2*10**9)
>>> x+=y
>>> x+=y
>>> x
-294967296
In later versions of Python this gives a RuntimeWarning so this is less likely to cause problems now. uint8 in[2][16];
int16 temp[2][16];
int32 r1,r3,r5;
uint8 *r0;
do {
... code omitted
// vmul -,H(1,0),3 CLRA ACC
// vadd HX(3,0),H(0,0),2 ACC
for(x=0;x<16;x++) {
temp[x]=inb[1][x]*3+in[0][x]+2;
}
//vasr H(0++,0),HX(2++,0),2 REP 2
//vst H(0++,0),(r0+=r3) REP 2
for(y=0;y<2;y++) {
for(x=0;x<16;x++) {
in[y][x] = temp[y][x]>>2;
r0[y*r3+x] = in[y][x];
}
}
// add r0,16
// addcmpblt r5,1,r1,loopacross
r0 += 16;
r5 += 1;
} while (r5<r1);
This is code for the vector processor. This is not the same as the GPU cores which use a different architecture and instruction set (based around floating point calculations).
It has converted about 200 pages in an hour.