I'm creating a textured ray-cast engine for the Prizm and I think this point-plot routine is a bottleneck on the speed. Would there be a significant speed boost to drawing if the plot routine below was written in assembly?
Code:
Is there any documentation about Prizm assembly or online resources I could use to try and re-write this? I don't have any knowledge about assembly, so I'm unsure where I would start with this.
Code:
inline void plot(int x0, int y0, int color) {
char* VRAM = (char*)0xA8000000;
VRAM += 2*(y0*LCD_WIDTH_PX + x0);
*(VRAM++) = (color&0x0000FF00)>>8;
*(VRAM++) = (color&0x000000FF);
return;
}
// this is used to draw scaled stripes of an image on the screen
inline void drawStripe(int x, int y1, int y2, int lineHeight, int texX) {
int i;
for(i = y1; i<y2; i++)
{
int d = i * 256 - h * 128 + lineHeight * 128;
int texY = ((d * texHeight) / lineHeight) / 256;
color_t color = tex1[texHeight * texY + texX];
plot(x,i,color);
}
}
Is there any documentation about Prizm assembly or online resources I could use to try and re-write this? I don't have any knowledge about assembly, so I'm unsure where I would start with this.