this is what i do:
Code: Select all
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;
}
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: Select all
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);
}
thanks in advance of the help :)