Code: Select all
void pgBitBlt32(unsigned int x,unsigned int y,unsigned int w,unsigned int h,unsigned int mag,const unsigned int *d)
{
unsigned char *vptr0; //pointer to vram
unsigned char *vptr; //pointer to vram
unsigned long xx,yy,mx,my;
const unsigned char *ddr, *ddg, *ddb;
vptr0=pgGetVramAddr(x,y);
ddr=(const unsigned char*)d;
ddg=ddr+(w*h);
ddb=ddg+(w*h);
for (yy=0; yy<h; yy++) {
for (my=0; my<mag; my++) {
vptr=vptr0;
for (xx=0; xx<w; xx++) {
for (mx=0; mx<mag; mx++) {
unsigned short pixel;
unsigned char r, g, b;
r = ((*ddr) >> 3); ddr++;
g = ((*ddg) >> 3); ddg++;
b = ((*ddb) >> 3); ddb++;
pixel = ((r) | (g << 5) | (b << 10)); //| (1 << 15));
*(unsigned short *)vptr=pixel;
vptr+=PIXELSIZE*2;
}
}
vptr0+=LINESIZE*2;
}
}
}
Code: Select all
ddg=ddr+(w*h);
ddb=ddg+(w*h);
Code: Select all
pgBitBlt32(0,0,300,170,1,image_seclogo);
Note: I am using the ps2 tool chain with the elf patch for psp.
Thanks in advance.