memory indexing

BlitzMax Forums/BlitzMax Beginners Area/memory indexing

Hi!

I've just started with blitzmax, i have alot of years behind me with development in C and the demoscene. What i have not figured out yet, is how to index a memory area.

This is a sample code of genereating linear perspective of a 2d tunnell.
void calclineartbl(int xsize, int ysize, char *dest)
{
	int	x, y, col;

    for (y = 0; y < ysize / 2; y++)
	{
        for (x = 0; x < xsize / 2; x++)
		{
            col = atan2((ysize / 2) - y, (xsize / 2) - x) * (128 / PI);
            dest[y * 320 + x] = col;
            dest[y * 320 + (xsize - x - 1)] = 127 - col;
            dest[(ysize - y - 1) * 320 +(xsize - x - 1)] = 128 + col;
            dest[(ysize - y - 1) * 320 + x] = 255 - col;
		}
	}
}

Does anyone know how to replicate this to blitzmax? Like, how to use a memory area like this

memory (which is allocated ) [someusefullstuff*x] = x + y;

Thank you in advance!

- pixlor