Page 1 of 1

[SCPH-70004] Built-in IR sensor

Posted: Thu Jun 15, 2006 12:16 pm
by xcc666
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: Select all

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. =:)

Posted: Thu Jun 15, 2006 5:32 pm
by EEUG
...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...

Posted: Fri Jun 16, 2006 6:59 pm
by sneeze
Sounds cool. One question, will it work only for PS2s with builtin IR?

Posted: Sat Jun 17, 2006 4:08 am
by EEUG
...currently I've got a test program which works with both RC types, so, I hope it will work also in SMS...

woa!

Posted: Wed Jun 28, 2006 7:52 am
by ayub_zar
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 :(

:(