Page 1 of 1

Amigamod 1.1

Posted: Fri Sep 21, 2007 9:18 pm
by Expanders
Hi guys,

does anyone still have a copy of amigamod v1.1? because the only link i can find kick me to a dead thethirdcreation.

If you don't have a copy can you give me some tips to compile old version with the new ps2sdk?

Thanks in advance.

Oh, just another question, is there any way to play atari SNDHs on PS2?

Cheers.

Resolved.

Posted: Sun Sep 23, 2007 3:25 am
by Expanders
Ok, i've solved it by myself.

Here's my patch for amigamod_rpc.c

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__&#40;&#40;aligned&#40;64&#41;&#41;&#41;;
+static SifRpcClientData_t amodCd __attribute__&#40;&#40;aligned&#40;64&#41;&#41;&#41;;
 static unsigned sbuff&#91;64&#93; __attribute__&#40;&#40;aligned &#40;64&#41;&#41;&#41;;
 
 static int ammodi = 0;
@@ -19,14 +20,14 @@
     if &#40;ammodi&#41;
         return 0;
 
-    if &#40;sif_bind_rpc&#40; &amodCd, VZMOD, 0&#41; < 0&#41;
+    if &#40;SifBindRpc&#40; &amodCd, VZMOD, 0&#41; < 0&#41;
         return -1;
 
     if &#40;!nosdinit&#41;
     &#123;
         char hi&#91;16&#93; = "amigaModInit !";
         memcpy&#40;&#40;char *&#41;sbuff, hi, 16&#41;;
-        sif_call_rpc&#40; &amodCd, MOD_INIT, 0, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 16, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 64, 0, 0&#41;;
+        SifCallRpc&#40; &amodCd, MOD_INIT, 0, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 16, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 64, 0, 0&#41;;
     &#125;
 
     ammodi = 1;
@@ -38,25 +39,25 @@
 int amigaModLoad&#40; void *moddata, int size &#41;
 &#123;
     int i, x, y;
-    struct t_sif_dma_transfer sdt;
+    SifDmaTransfer_t sdt;
 
-    if &#40;_SifInitIopHeap&#40;&#41; != 0&#41;
+    if &#40;SifInitIopHeap&#40;&#41; != 0&#41;
         return -1;
 
     if &#40;iopmodimg&#41;
-        _SifFreeIopHeap&#40;iopmodimg&#41;;
-    iopmodimg = _SifAllocIopHeap&#40;size&#41;;
+        SifFreeIopHeap&#40;iopmodimg&#41;;
+    iopmodimg = SifAllocIopHeap&#40;size&#41;;
 
     // transfer the moddata via dma into spu RAM
     sdt.src = &#40;void*&#41;moddata;
     sdt.dest = iopmodimg;
     sdt.size = size;
     sdt.attr = 0;
-    i = k_sceSifSetDma&#40;&sdt, 1&#41;;
-    while &#40;k_sceSifDmaStat&#40;i&#41; >= 0&#41;; // potential for infinite loop ...
+    i = SifSetDma&#40;&sdt, 1&#41;;
+    while &#40;SifDmaStat&#40;i&#41; >= 0&#41;; // potential for infinite loop ...
 
     sbuff&#91;0&#93; = &#40;int&#41;iopmodimg;
-    sif_call_rpc&#40; &amodCd, MOD_LOAD, 0, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 4, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 64, 0, 0&#41;;
+    SifCallRpc&#40; &amodCd, MOD_LOAD, 0, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 4, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 64, 0, 0&#41;;
 
     return sbuff&#91;0&#93;;
 &#125;
@@ -65,7 +66,7 @@
 int amigaModPlay&#40;unsigned linear&#41;
 &#123;
     sbuff&#91;0&#93; = linear;
-    sif_call_rpc&#40; &amodCd, MOD_PLAY, 0, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 4, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 16, 0, 0&#41;;
+    SifCallRpc&#40; &amodCd, MOD_PLAY, 0, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 4, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 16, 0, 0&#41;;
     return sbuff&#91;0&#93;;
     //return 0;
 &#125;
@@ -74,7 +75,7 @@
 // won't pause right away; best to wait one VSync after this is called, before another amigaMod* call
 int amigaModPause&#40;&#41;
 &#123;
-    sif_call_rpc&#40; &amodCd, MOD_PAUSE, 1, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 4, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 0, 0, 0&#41;;
+    SifCallRpc&#40; &amodCd, MOD_PAUSE, 1, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 4, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 0, 0, 0&#41;;
     //return sbuff&#91;0&#93;;
     return 0;
 &#125;
@@ -83,14 +84,14 @@
 int amigaModSetVolume&#40; unsigned short volume&#41;
 &#123;
     sbuff&#91;0&#93; = volume & 0x3fff;
-    sif_call_rpc&#40; &amodCd, MOD_SETVOL, 0, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 4, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 0, 0, 0&#41;;
+    SifCallRpc&#40; &amodCd, MOD_SETVOL, 0, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 4, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 0, 0, 0&#41;;
     return 0;
 &#125;
 
 
 int amigaModGetInfo&#40; ModInfoStruct *info&#41;
 &#123;
-    sif_call_rpc&#40; &amodCd, MOD_GETINFO, 0, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 4, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 64, 0, 0&#41;;
+    SifCallRpc&#40; &amodCd, MOD_GETINFO, 0, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 4, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 64, 0, 0&#41;;
     info->curorder = sbuff&#91;1&#93;;
     info->currow = sbuff&#91;2&#93;;
     info->numchannels = sbuff&#91;3&#93;;
@@ -102,7 +103,7 @@
 
 int amigaModQuit&#40;&#41;
 &#123;
-    sif_call_rpc&#40; &amodCd, MOD_QUIT, 1, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 4, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 0, 0, 0&#41;;
+    SifCallRpc&#40; &amodCd, MOD_QUIT, 1, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 4, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 0, 0, 0&#41;;
     return 0;
 &#125;
 
@@ -110,7 +111,7 @@
 void ModPuts&#40;char *s&#41;
 &#123;
     memcpy&#40;&#40;char *&#41;sbuff, s, 252&#41;;
-    sif_call_rpc&#40; &amodCd, MOD_PUTS, 1, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 252, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 0, 0, 0&#41;;
+    SifCallRpc&#40; &amodCd, MOD_PUTS, 1, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 252, &#40;void *&#41;&#40;&sbuff&#91;0&#93;&#41;, 0, 0, 0&#41;;
 &#125;
 
Hope to be useful to someone,

My second question remain open: Atari's SNDH on ps2, there's any way?

Cheers.

Posted: Sun Sep 23, 2007 8:07 pm
by Lukasz
I dont there is a Atari SNDH player, so you would need to code one yourself :-)

Posted: Sun Sep 23, 2007 9:11 pm
by J.F.
You could probably start with one of the players linked here: http://sndh.atari.org/

I noticed at least one *nix player.

Posted: Mon Sep 24, 2007 9:17 am
by Expanders
You know what?
It's not a bad idea.

I'm asking this question to be sure i'll kickstart in the right direction: to write a sndh player i need to fully understand sndh and then use something like SjPCM to kick streams to the ps2 audio hardware, i'm right?

Thanks in adv.

Posted: Mon Sep 24, 2007 5:30 pm
by Lukasz
SjPCM uses LIBSD (rom version) / freesd.irx (ps2sdk version) to play audio.

So you can either use a module such as SjPCM as a layer between your code and libsd or use libsd directly.

I think you should be fine with just SjPCM, as you wont be playing ADPCM samples.