 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
weltall
Joined: 20 Feb 2004 Posts: 310
|
Posted: Thu Jun 16, 2005 4:20 pm Post subject: rmman problem |
|
|
i'm trying to use librm to read returns from my remote but i couldn't get anything just zeroes, i tried also inserting a printf inside the library to see what it get and i get only this: 10a580 either by pressing and not pressing buttons
this is what i do:
| Code: |
char paddata[256] __attribute__((aligned(64))); //the controller buffer
int main()
{
SifInitRpc(0);
init_scr();
struct remote_data * datarem;
datarem = malloc(sizeof(struct remote_data));
SifLoadModule("rom0:ADDDRV", 0, NULL);
SifLoadModule("rom1:SIO2MAN", 0, NULL);
SifLoadModule("rom1:RMMAN", 0, NULL);
RMMan_Init();
RMMan_Open(0, 0, paddata);
while(1)
{
RMMan_Read(0, 0,datarem);
//check returns and print if new things appened :)
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;
}
|
all the irxs are loaded successfully, rmman is initialized successfully (ret = 1) and it get version 265.
rmmanopen also returns 1
but in the struct datarem i get only zeroes and if i do this in the source of the lib:
| Code: |
void RMMan_Read(int port, int slot, struct remote_data *data)
{
struct rm_data *pdata;
if((port < 0) || (port > 1) || (slot != 0))
{
printf("Error, port must be 0 or 1 and slot set to 0\n");
return;
}
pdata = rmGetDmaStr(port, slot);
printf("%x\n",pdata->data); //what i added
memcpy(data, pdata->data, 8);
}
|
i get only 10a580 from that printf.
thanks in advance of the help :) |
|
| Back to top |
|
 |
weltall
Joined: 20 Feb 2004 Posts: 310
|
Posted: Sat Jun 18, 2005 4:10 am Post subject: |
|
|
thanks to TyRaNiD i got it to work.
but while testing i found some problem in the header file, two values in the defines was repeated.
These are the changes, i added also the reset and eject button:
| Code: |
51c51
< #define RM_TIME 0x0080D049
---
> #define RM_TIME 0x0080D249
69c69
< #define RM_RIGHT 0x0040D5DA
---
> #define RM_RIGHT 0x0050D5DA
78a79,80
> #define RM_EJECT 0x0060D1DA
> #define RM_RESET 0x0050D1DA
|
|
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Sat Jun 18, 2005 3:16 pm Post subject: |
|
|
| Cool, I have put those updates into cvs. |
|
| Back to top |
|
 |
dave_t
Joined: 30 Nov 2005 Posts: 4 Location: United Kingdom
|
Posted: Tue Dec 13, 2005 5:35 am Post subject: |
|
|
I seem to have gone down the same path as weltall above, and have almost exactly the same responses from my hardware.
I too get RMMan loaded with version 265 showing.
Struct datarem only has zeros again, and if i do the same addition to the source of the lib, i get 10a180 from the printf.
What needs doing here to get it working? Thanks in advance,
Dave |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Tue Dec 13, 2005 6:50 am Post subject: |
|
|
| You need to reset the IOP before loading SIO2MAN and RMMAN as the rom1 version is not compatible with the rom0 version of SIO2MAN. |
|
| Back to top |
|
 |
weltall
Joined: 20 Feb 2004 Posts: 310
|
Posted: Tue Dec 13, 2005 3:58 pm Post subject: |
|
|
| from my test i have to add that strangely it doesn't response to signal received throught ir integrated port on v9+ (at least with the use ingame option enabled, now that i think about this i should try this...) but it work well also on v9+ if you insert the ir recevitor into one game port |
|
| Back to top |
|
 |
dave_t
Joined: 30 Nov 2005 Posts: 4 Location: United Kingdom
|
Posted: Sun Dec 18, 2005 9:57 pm Post subject: |
|
|
Thanks for the help. Just in case anyone has the same problems as me, here's the working code once i finally got it working.
| Code: |
char paddata[256] __attribute__((aligned(64))); //the controller buffer
int main()
{
int ret = 0;
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()... ");
ret = RMMan_Init();
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");
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 :)
//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;
} |
All that was needed were the additional lines to reset the IOP before loading SIO2MAN and RMMAN. I've no idea what version my console is - how do i find out? It says SCPH-39003 PAL on the back. What's v9?. Surely there must be some way of handling all types of remote/console with the same piece of software - perhaps something that would load a slightly different group of roms depending on which console version was detected.
I'm guessing the reason this hasn't been done yet is because to develop such a driver would require several different PS2 models and most people only have 1.
Dave |
|
| Back to top |
|
 |
misfire
Joined: 06 Sep 2004 Posts: 120 Location: Germany
|
Posted: Tue Dec 20, 2005 7:28 pm Post subject: |
|
|
| dave_t wrote: | | [...] I've no idea what version my console is - how do i find out? It says SCPH-39003 PAL on the back. What's v9?. [...] |
Referring to a mod chip site, this must be V7. |
|
| Back to top |
|
 |
|
|
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
|