Ok, i've solved it by myself.
Code: Select all
--- amigamod_rpc.c 2002-06-09 05:13:28.000000000 +0200
+++ amigamod_rpc.c 2007-09-22 19:19:02.750000000 +0200
@@ -1,13 +1,14 @@
-// amigamod_rpc.cpp
+// amigamod_rpc.c Updated 2007 September 22
-#include "tamtypes.h"
-#include "kernel.h"
+#include <tamtypes.h>
+#include <kernel.h>
+#include <string.h>
#include "amigamod.h"
-#include "sifcmd.h"
-#include "sifrpc.h"
-#include "iopheap.h"
+#include <sifcmd.h>
+#include <sifrpc.h>
+#include <iopheap.h>
-static struct t_rpc_client_data amodCd __attribute__((aligned(64)));
+static SifRpcClientData_t amodCd __attribute__((aligned(64)));
static unsigned sbuff[64] __attribute__((aligned (64)));
static int ammodi = 0;
@@ -19,14 +20,14 @@
if (ammodi)
return 0;
- if (sif_bind_rpc( &amodCd, VZMOD, 0) < 0)
+ if (SifBindRpc( &amodCd, VZMOD, 0) < 0)
return -1;
if (!nosdinit)
{
char hi[16] = "amigaModInit !";
memcpy((char *)sbuff, hi, 16);
- sif_call_rpc( &amodCd, MOD_INIT, 0, (void *)(&sbuff[0]), 16, (void *)(&sbuff[0]), 64, 0, 0);
+ SifCallRpc( &amodCd, MOD_INIT, 0, (void *)(&sbuff[0]), 16, (void *)(&sbuff[0]), 64, 0, 0);
}
ammodi = 1;
@@ -38,25 +39,25 @@
int amigaModLoad( void *moddata, int size )
{
int i, x, y;
- struct t_sif_dma_transfer sdt;
+ SifDmaTransfer_t sdt;
- if (_SifInitIopHeap() != 0)
+ if (SifInitIopHeap() != 0)
return -1;
if (iopmodimg)
- _SifFreeIopHeap(iopmodimg);
- iopmodimg = _SifAllocIopHeap(size);
+ SifFreeIopHeap(iopmodimg);
+ iopmodimg = SifAllocIopHeap(size);
// transfer the moddata via dma into spu RAM
sdt.src = (void*)moddata;
sdt.dest = iopmodimg;
sdt.size = size;
sdt.attr = 0;
- i = k_sceSifSetDma(&sdt, 1);
- while (k_sceSifDmaStat(i) >= 0); // potential for infinite loop ...
+ i = SifSetDma(&sdt, 1);
+ while (SifDmaStat(i) >= 0); // potential for infinite loop ...
sbuff[0] = (int)iopmodimg;
- sif_call_rpc( &amodCd, MOD_LOAD, 0, (void *)(&sbuff[0]), 4, (void *)(&sbuff[0]), 64, 0, 0);
+ SifCallRpc( &amodCd, MOD_LOAD, 0, (void *)(&sbuff[0]), 4, (void *)(&sbuff[0]), 64, 0, 0);
return sbuff[0];
}
@@ -65,7 +66,7 @@
int amigaModPlay(unsigned linear)
{
sbuff[0] = linear;
- sif_call_rpc( &amodCd, MOD_PLAY, 0, (void *)(&sbuff[0]), 4, (void *)(&sbuff[0]), 16, 0, 0);
+ SifCallRpc( &amodCd, MOD_PLAY, 0, (void *)(&sbuff[0]), 4, (void *)(&sbuff[0]), 16, 0, 0);
return sbuff[0];
//return 0;
}
@@ -74,7 +75,7 @@
// won't pause right away; best to wait one VSync after this is called, before another amigaMod* call
int amigaModPause()
{
- sif_call_rpc( &amodCd, MOD_PAUSE, 1, (void *)(&sbuff[0]), 4, (void *)(&sbuff[0]), 0, 0, 0);
+ SifCallRpc( &amodCd, MOD_PAUSE, 1, (void *)(&sbuff[0]), 4, (void *)(&sbuff[0]), 0, 0, 0);
//return sbuff[0];
return 0;
}
@@ -83,14 +84,14 @@
int amigaModSetVolume( unsigned short volume)
{
sbuff[0] = volume & 0x3fff;
- sif_call_rpc( &amodCd, MOD_SETVOL, 0, (void *)(&sbuff[0]), 4, (void *)(&sbuff[0]), 0, 0, 0);
+ SifCallRpc( &amodCd, MOD_SETVOL, 0, (void *)(&sbuff[0]), 4, (void *)(&sbuff[0]), 0, 0, 0);
return 0;
}
int amigaModGetInfo( ModInfoStruct *info)
{
- sif_call_rpc( &amodCd, MOD_GETINFO, 0, (void *)(&sbuff[0]), 4, (void *)(&sbuff[0]), 64, 0, 0);
+ SifCallRpc( &amodCd, MOD_GETINFO, 0, (void *)(&sbuff[0]), 4, (void *)(&sbuff[0]), 64, 0, 0);
info->curorder = sbuff[1];
info->currow = sbuff[2];
info->numchannels = sbuff[3];
@@ -102,7 +103,7 @@
int amigaModQuit()
{
- sif_call_rpc( &amodCd, MOD_QUIT, 1, (void *)(&sbuff[0]), 4, (void *)(&sbuff[0]), 0, 0, 0);
+ SifCallRpc( &amodCd, MOD_QUIT, 1, (void *)(&sbuff[0]), 4, (void *)(&sbuff[0]), 0, 0, 0);
return 0;
}
@@ -110,7 +111,7 @@
void ModPuts(char *s)
{
memcpy((char *)sbuff, s, 252);
- sif_call_rpc( &amodCd, MOD_PUTS, 1, (void *)(&sbuff[0]), 252, (void *)(&sbuff[0]), 0, 0, 0);
+ SifCallRpc( &amodCd, MOD_PUTS, 1, (void *)(&sbuff[0]), 252, (void *)(&sbuff[0]), 0, 0, 0);
}
Cheers.