Code: Select all
void InitializeGraphics(int mode)
{
    sceDisplayGetFrameBuf((void**)&VRAM32, &BUF_WIDTH, &PIXEL_FORMAT, &UNKNOWN);
    VRAM16 = (u16*) VRAM32;
    sceDisplaySetMode(mode,SCR_WIDTH,SCR_HEIGHT); // Sets the display mode.
    if(mode==PSP_DISPLAY_PIXEL_FORMAT_8888)
    {
      sceDisplaySetFrameBuf(VRAM32,BUF_WIDTH,mode,PSP_DISPLAY_SETBUF_NEXTFRAME); // Sets the address of the frame buffer.
    }
    else
    {
      sceDisplaySetFrameBuf(VRAM16,BUF_WIDTH,mode,PSP_DISPLAY_SETBUF_NEXTFRAME); // Sets the address of the frame buffer.
    }
    sceDisplayGetFrameBuf((void**)&VRAM32, &BUF_WIDTH, &PIXEL_FORMAT, &UNKNOWN);
}Here is my code for plotting 5551 format pixels
Code: Select all
int color=((b>>3)<<10) | ((g>>3)<<5) | (r>>3) | 0x8000; // Creates and stores color.
    u16 *address=VRAM+((((512)*PIXEL_SIZE)*y)+x); // Caculates address of pixel.
    *address=color; // Writes color code into address of the pixel.What I would like to know is, how do I translate this over to the different video modes? Most importantly, to the 32bit 8888 video mode.
I looked at the screenshot code shine put on here earlier, and worked off that, but I didn't get anything going.
Also, in 5551 pixel format mode, the rgb color values range from 0-255, what is the range in 8888 pixel format mode?
Thanks for everyone's help.