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 

PRX plugin breaks video and browser

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



Joined: 18 Jul 2007
Posts: 5

PostPosted: Sun Aug 26, 2007 7:13 pm    Post subject: PRX plugin breaks video and browser Reply with quote

I'm working on prx plugin for psp, but when I allow the plugin in recovery it breaks video player and browser. I'm using modified graphics.c graphics.h files(i removed all unnecessary functions from them).
Here is the prx source code:
Code:
#include <pspkernel.h>
#include <pspdisplay.h>
#include <pspgu.h>
#include <time.h>
#include "graphics.h"

PSP_MODULE_INFO("bnr", 0, 1, 0);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);

int binary(int arg){
   int vysledok = 0;
   int jan = 1;
   while(arg>0){
      if(arg %2 == 1)
         vysledok += jan;
      arg /= 2;
      jan *= 10;
   }
   return vysledok;
}


int main(){
   sceKernelDelayThread(4000000);
   time_t cas;
   initGraphics();
   int minuty, hodiny, i;
   while(1){
      cas = time(NULL);
      minuty = binary((cas/60)%60);
      hodiny = binary((cas/60/60+2)%24);
      for(i=0; i<6; i++){
         if(hodiny%10 == 1)
            fillScreenRect(0xffffffff, 330, 35 - 6 * i, 5, 5);
         hodiny /= 10;
      }
      for(i=0; i<6; i++){
         if(minuty%10 == 1)
            fillScreenRect(0xffffffff, 336, 35 - 6 * i, 5, 5);
         minuty /= 10;
      }
      flipScreen();
      sceDisplayWaitVblankStart();
      sceKernelDelayThread(10000);
   }
   return 0;
}

Back to top
View user's profile Send private message
moonlight



Joined: 26 Oct 2005
Posts: 567

PostPosted: Sun Aug 26, 2007 7:17 pm    Post subject: Reply with quote

Video player and browser probably need all possible user memory... and your module is an user one, so you are probably eating them space.
Back to top
View user's profile Send private message
borix



Joined: 18 Jul 2007
Posts: 5

PostPosted: Sun Aug 26, 2007 7:43 pm    Post subject: Reply with quote

So is there a way how to solve it?
In kernel mode(with kernel libs) can I use time() function?
Back to top
View user's profile Send private message
moonlight



Joined: 26 Oct 2005
Posts: 567

PostPosted: Sun Aug 26, 2007 7:56 pm    Post subject: Reply with quote

borix wrote:
So is their a way how to solve it?
In kernel mode(with kernel libs) can I use time() function?


I doubt, but anyways you can use the sony functions for time purposes (look at psprtc.h) and add -lpsprtc_driver in that case to the library list.
Back to top
View user's profile Send private message
KickinAezz



Joined: 03 Jun 2007
Posts: 328

PostPosted: Mon Aug 27, 2007 12:29 am    Post subject: Reply with quote

oops.
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