| View previous topic :: View next topic |
| Author |
Message |
AnonymousTipster
Joined: 01 Jul 2005 Posts: 197
|
Posted: Fri Jul 01, 2005 2:58 am Post subject: 24bit - PSP screen? Help Please |
|
|
Ok, I am writing a small library in which I want to take an RGB value from a function (255,255,255 format) and blit that pixel to the screen.
I think that ATM, with our knowledge of the PSP, we can only acheive 16bit colour. What I would like to know is how to display an RGB value on screen in 24bit colour, or how to convert it in-app to 16bit, and then blit that pixel.
Thanks for your help. |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Fri Jul 01, 2005 3:55 am Post subject: |
|
|
As far as I know there is only 4 colour modes you can use on the PSP, 3 16bit mode variants and 1 32bit colour mode.
If you want to use 32bit mode (which is as close as you are going to get to 24bit) you need to called sceDisplaySetFrameBuf with 3 as the 3rd parameter. |
|
| Back to top |
|
 |
AnonymousTipster
Joined: 01 Jul 2005 Posts: 197
|
Posted: Sat Jul 02, 2005 1:22 am Post subject: |
|
|
Well, I'm using Nem's HelloWorld app, and i've set the startup.S file to load all needed kernel and display functions. I am setting the displayBuf's 3rd param to 3, but the image that is being drawn (I'm just using the sec logo) is in pink and is repeated 4 times on the screen.
Now that I am in 32bit mode (I think), how can I draw a single pixel to the screen from an RGB value?
Thank you for your patience, it is tricky to find your feet on a new OS. |
|
| Back to top |
|
 |
jboldiga
Joined: 20 Jun 2005 Posts: 27
|
Posted: Sat Jul 02, 2005 3:27 am Post subject: |
|
|
| convert it to an rgb value...if you are using nems code his images are all 16bit so instead of doing 5 5 5 you have to convert to 8 8 8 8 or even easier to make 32 bit images yourself. The only thing that really changes is your shifts. |
|
| Back to top |
|
 |
AnonymousTipster
Joined: 01 Jul 2005 Posts: 197
|
Posted: Sat Jul 02, 2005 4:15 am Post subject: |
|
|
Erm, still have a little bit of a problem, when accessing the vram, what format should you use, what is the line of code that the vram needs to take?
ATM, my xmain code looks like this:
| Code: | SetupCallbacks();
pgInit();
pgScreenFrame(2,0);
while (1) {
pgFillvram(0);
//pgBitBlt(1,4,1,1,2,0xFF00);
unsigned char *vptr; //pointer to vram
vptr=pgGetVramAddr(10,10);
vptr[1+1*512] = 0xFF00FF;
pgScreenFlipV();
pgWaitVn(1);
} |
I have also tried "vptr[1+1*512] = 255,255,255;" and "vptr[1+1*512] = 255|255|255;" but they all display a turqoise pixel on the screen.
Sorry for the noobishness, but i'm used to DirectX. |
|
| Back to top |
|
 |
pcostabel
Joined: 25 Jun 2005 Posts: 11
|
Posted: Sat Jul 02, 2005 5:45 am Post subject: |
|
|
| Change PIXELSIZE to 2 |
|
| Back to top |
|
 |
AnonymousTipster
Joined: 01 Jul 2005 Posts: 197
|
Posted: Sat Jul 02, 2005 7:04 am Post subject: |
|
|
Ah, excellent, that fixes it!
Just for other users reference, I used
| Code: | | sceDisplaySetFrameBuf(pg_vramtop+(pg_showframe?FRAMESIZE:0),LINESIZE,2,1); |
Thank you all for your understanding help. |
|
| Back to top |
|
 |
|