here's some stuff from the gba dev'rs site - pretty cool if you don't know how to write a m7 caster, with this you've just gotta plug the values
into your own affine scanline renderer:
Tepples Code:
You'll have to know about vector math (use Google). You'll have to know a bit about fixed point math (use Google). You'll have to know how to change the affine parameters by scanline, using hblank DMA from an array of structs into the GBA registers.
First create a 2D unit vector that points in the direction of the camera. Call this 'out'.
Multiply the height of the camera by a constant and divide it by y to get z. Similar triangles help you see the reasoning behind this.
Now fixed-point multiply this by the 'out' to get a vector 'zout'. Rotate 'zout' right by 90 degrees (trivial) and shift it right by 8 (divide by 256) to create 'right'.
For each scanline, set the hardware's per-pixel vector (pa, pc) to 'right' and scanline origin to 'zout' - 120 * 'right'.