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 

vram direct access and pitch

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



Joined: 05 Nov 2006
Posts: 9
Location: Argentina

PostPosted: Tue Nov 21, 2006 7:35 am    Post subject: vram direct access and pitch Reply with quote

im accessing vram directly thrugh 0x44000000, but the problem is that i dont know the pitch, so supouse i want to make a code to fill all screen with an RGB color:

Code:

sceDisplaySetMode(0, 480, 272);

int * p_vram = (int *) 0x44000000;

    sceDisplaySetFrameBuf((void *)p_vram, 480,
         PSP_DISPLAY_PIXEL_FORMAT_8888,
         PSP_DISPLAY_SETBUF_IMMEDIATE);

int color;
   
               color = RGB(0xFF,0,0);
   
   for (int i = 0; i < 272 ; i++)
   {

       for (int j = 0; j < 480; j++)
       {
          *p_vram = color;
          p_vram++;
       }
   
      p_vram += PITCH_VALUE;
   }


where:

- RGB() macro is one for creating an int rgb color passing the three bytes values.
- PITCH_VALUE should be the amout of (bytes / 4) to get the address of the next row.

I have been trying to figure out what value could be the pitch, but no results.

any help?
_________________
- Ateneo -
Back to top
View user's profile Send private message MSN Messenger
Raphael



Joined: 17 Jan 2006
Posts: 646
Location: Germany

PostPosted: Tue Nov 21, 2006 8:44 am    Post subject: Reply with quote

It should be 512. Well, 512-480 in your case actually
_________________
<Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki

Alexander Berl
Back to top
View user's profile Send private message Visit poster's website
Atenus



Joined: 05 Nov 2006
Posts: 9
Location: Argentina

PostPosted: Tue Nov 21, 2006 10:31 am    Post subject: Reply with quote

thanks a lot
_________________
- Ateneo -
Back to top
View user's profile Send private message MSN Messenger
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