[SCPH-70004] Built-in IR sensor

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
xcc666
Posts: 1
Joined: Sun Jun 11, 2006 7:28 am
Location: Duisburg, Germany
Contact:

[SCPH-70004] Built-in IR sensor

Post 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. =:)
EEUG
Posts: 136
Joined: Fri May 13, 2005 4:49 am
Location: The Netherlands

Post 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...
sneeze
Posts: 15
Joined: Fri Mar 03, 2006 4:31 am

Post by sneeze »

Sounds cool. One question, will it work only for PS2s with builtin IR?
EEUG
Posts: 136
Joined: Fri May 13, 2005 4:49 am
Location: The Netherlands

Post by EEUG »

...currently I've got a test program which works with both RC types, so, I hope it will work also in SMS...
ayub_zar
Posts: 36
Joined: Fri Jun 02, 2006 5:11 am
Location: Pakistan
Contact:

woa!

Post 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 :(

:(
WE NEED TO TAME PS2
Post Reply