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 

[SCPH-70004] Built-in IR sensor

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



Joined: 11 Jun 2006
Posts: 1
Location: Duisburg, Germany

PostPosted: Thu Jun 15, 2006 12:16 pm    Post subject: [SCPH-70004] Built-in IR sensor Reply with quote

How can I access the built-in IR in my app, so I can recognize the RC "special" keys? I tried the code snippet I found in the forum, but it doesnt function properly, neither with rom1:sio2man and rom1:rmman nor with rom0:xrmman2.

Code:
SifInitRpc(0);
   init_scr();
   struct remote_data * datarem;
   datarem = (struct remote_data *) malloc(sizeof(struct remote_data));
   SifExitIopHeap ();
   SifLoadFileExit();
   SifExitRpc     ();
   SifIopReset ( "rom0:UDNL rom0:EELOADCNF", 0 );
   while (  SifIopSync ()  );
   SifInitRpc ( 0 );
   SifLoadModule("rom0:ADDDRV", 0, NULL);
   SifLoadModule("rom1:SIO2MAN", 0, NULL);
   SifLoadModule("rom1:RMMAN", 0, NULL);
   scr_printf("RMMan_Init()...                             ");
   int ret = 0;
   ret = RMMan_Init(); // stops here with loaded anything other than rom1 stuff =(
   if (ret == 1) scr_printf("[  OK  ]\n");
   else scr_printf("[FAILED]\n\tRMMan_Init() returned %d (bad).\n", ret);
   scr_printf("RMMan_GetModuleVersion()...                 ");
   ret = RMMan_GetModuleVersion();
   scr_printf("[ v%d ]\n", ret);
   scr_printf("RMMan_Open()...                             ");
   ret = RMMan_Open(0, 0, paddata);
   if (ret == 1) scr_printf("[  OK  ]\n");
   else scr_printf("[FAILED]\n\tRMMan_Open() returned %d (bad).\n", ret);
   scr_printf("INITIALISATION COMPLETE\n");
   scr_printf("\nPress the remote buttons now:\n");
   while(1)
   {

      RMMan_Read(0, 0,datarem);
      //check returns and print if new things appened :)
      //scr_printf("data_status = %x, data_button = %x, paddata: %s\n",datarem->status,datarem->button,paddata);
      if(datarem->status == RM_KEYPRESSED)
      {
         scr_printf("return of the remote : %x\n", datarem->button);
      }
   }
   return 0;


When I use the modules from rom1 it rans in the loop, but doesnt show me any keypress. When I try to use any other module i.e. rom0:xrmman2, it "crashes" at RMMan_Init. =(

(I believe my english is the biggest worst you ever seen, but the most of my time i spend at developing apps rather than learning perfect english. =:)
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
EEUG



Joined: 13 May 2005
Posts: 136
Location: The Netherlands

PostPosted: Thu Jun 15, 2006 5:32 pm    Post subject: Reply with quote

...ps2sdk does not support it. Just wait for some time till I'll release next SMS update, there will be code for built-in IR...
Back to top
View user's profile Send private message
sneeze



Joined: 03 Mar 2006
Posts: 15

PostPosted: Fri Jun 16, 2006 6:59 pm    Post subject: Reply with quote

Sounds cool. One question, will it work only for PS2s with builtin IR?
Back to top
View user's profile Send private message
EEUG



Joined: 13 May 2005
Posts: 136
Location: The Netherlands

PostPosted: Sat Jun 17, 2006 4:08 am    Post subject: Reply with quote

...currently I've got a test program which works with both RC types, so, I hope it will work also in SMS...
Back to top
View user's profile Send private message
ayub_zar



Joined: 02 Jun 2006
Posts: 36
Location: Pakistan

PostPosted: Wed Jun 28, 2006 7:52 am    Post subject: woa! Reply with quote

you guys are way too ahead.....i mean , right now i am trying to run some "HELLO WORLD" application on ps2 and you are here , talking about Remote control programming :) , good for you, please do help beginners like us :(

:(
_________________
WE NEED TO TAME PS2
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 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