forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

24bit - PSP screen? Help Please

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
AnonymousTipster



Joined: 01 Jul 2005
Posts: 197

PostPosted: Fri Jul 01, 2005 2:58 am    Post subject: 24bit - PSP screen? Help Please Reply with quote

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
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Fri Jul 01, 2005 3:55 am    Post subject: Reply with quote

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
View user's profile Send private message
AnonymousTipster



Joined: 01 Jul 2005
Posts: 197

PostPosted: Sat Jul 02, 2005 1:22 am    Post subject: Reply with quote

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
View user's profile Send private message
jboldiga



Joined: 20 Jun 2005
Posts: 27

PostPosted: Sat Jul 02, 2005 3:27 am    Post subject: Reply with quote

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
View user's profile Send private message
AnonymousTipster



Joined: 01 Jul 2005
Posts: 197

PostPosted: Sat Jul 02, 2005 4:15 am    Post subject: Reply with quote

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
View user's profile Send private message
pcostabel



Joined: 25 Jun 2005
Posts: 11

PostPosted: Sat Jul 02, 2005 5:45 am    Post subject: Reply with quote

Change PIXELSIZE to 2
Back to top
View user's profile Send private message
AnonymousTipster



Joined: 01 Jul 2005
Posts: 197

PostPosted: Sat Jul 02, 2005 7:04 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group