On Sat, 31 Jul 2010 17:03:04 +0100 (GMT Daylight Time), Jeffrey Lee wrote:

> I doubt I'll be looking at ArcEm much more in the near future, so I'll 
> leave it to you to decide what (if anything) to do with these changes. I 
> haven't tried them on anything other than RISC OS, so it wouldn't surprise 
> me if some of the other platforms fail to compile or are fundamentally 
> broken.

I had to fix up the sound support to get it working here (diffs
attached, nothing major).

Well, I say working, there's something wrong as although it appears to
work and initialises the display, the ROM either doesn't get executed
or at least doesn't get as far as even clearing the pointer, let alone
printing anything on the screen.

The emulator hasn't crashed as I can still send commands to it, it's
just the emulation which has apparently frozen.

Chris
diff -upr arcem-fast/amiga/DispKbd.c arcem-fast-fixed/amiga/DispKbd.c
--- arcem-fast/amiga/DispKbd.c  2008-05-02 20:32:34 
+++ arcem-fast-fixed/amiga/DispKbd.c    2010-07-31 21:33:44 
@@ -255,7 +255,7 @@ void cleanup(void)
        exit(0);
 }
 
-void MouseMoved(int xdiff,int ydiff)
+void MouseMoved(ARMul_State *state, int xdiff, int ydiff)
 {
                                if (xdiff > 63)
                                xdiff=63;
@@ -361,7 +361,7 @@ DisplayKbd_PollHost(ARMul_State *state)
                break;
 
                        case IDCMP_MOUSEMOVE:
-                               MouseMoved(msg->MouseX,msg->MouseY);
+                               MouseMoved(state, msg->MouseX, msg->MouseY);
                        break;
                }
 
@@ -608,7 +608,7 @@ RefreshDisplay(ARMul_State *state)
   DC.AutoRefresh=AUTOREFRESHPOLL;
   ioc.IRQStatus|=8; /* VSync */
   ioc.IRQStatus |= 0x20; /* Sound - just an experiment */
-  IO_UpdateNirq();
+  IO_UpdateNirq(state);
 
   DC.miny=DisplayHeight-1;
   DC.maxy=0;
diff -upr arcem-fast/amiga/sound.c arcem-fast-fixed/amiga/sound.c
--- arcem-fast/amiga/sound.c    2006-09-16 23:00:56 
+++ arcem-fast-fixed/amiga/sound.c      2010-07-31 22:28:26 
@@ -21,14 +21,14 @@ static unsigned long delayProgress = 0;
 static SoundData *buffer = NULL;
 
 void
-sound_poll(void)
+sound_poll(ARMul_State *state)
 {
   delayProgress++;
   if (delayProgress >= delayTotal)
        {
            delayProgress = 0;
 
-             if (SoundDMAFetch(buffer) == 1)
+             if (SoundDMAFetch(buffer, state) == 1)
                        {
                        return;
                }
@@ -53,8 +53,11 @@ int openaudio(void)
        }
        else
        {
+               fprintf(stderr, "sound_init(): Out of memory\n");
                return -1;
        }
+
+       return 0;
 }
 
 int
@@ -68,6 +71,7 @@ sound_init(void)
        }
        else
        {
+       fprintf(stderr, "sound_init(): Could not open utility.library v51\n");
                return -1;
        }
 
diff -upr arcem-fast/arch/armarc.c arcem-fast-fixed/arch/armarc.c
--- arcem-fast/arch/armarc.c    2010-07-23 22:08:46 
+++ arcem-fast-fixed/arch/armarc.c      2010-07-31 21:44:38 
@@ -835,7 +835,7 @@ static void ARMul_RebuildFastMap(void)
  * @returns 0 if the fetch was done, 1 if sound dma is disabled and so no 
fetch was done.
  */
 int
-SoundDMAFetch(SoundData *buffer)
+SoundDMAFetch(SoundData *buffer, ARMul_State *state)
 {
   int i;
   if ((MEMC.ControlReg & (1 << 11)) == 0) {
@@ -843,7 +843,7 @@ SoundDMAFetch(SoundData *buffer)
   }
 
   if(numberOfChannels==0)
-    SoundUpdateStereoImage();
+    SoundUpdateStereoImage(state);
 
   for (i = 0; i < 16; i += numberOfChannels) {
     int j;
@@ -877,7 +877,7 @@ SoundDMAFetch(SoundData *buffer)
       MEMC.SendN = swap;
 
       ioc.IRQStatus |= IRQB_SIRQ; /* Take sound interrupt on */
-      IO_UpdateNirq();
+      IO_UpdateNirq(state);
 
       MEMC.NextSoundBufferValid = 0;
       return 1;
@@ -969,7 +969,7 @@ SoundInitTable(void)
  * meaning depending on the number of channels in use.
  */
 void
-SoundUpdateStereoImage(void)
+SoundUpdateStereoImage(ARMul_State *state)
 {
   int i = 0;
 
@@ -1049,11 +1049,11 @@ SoundUpdateStereoImage(void)
     channelAmount[i][1] /= numberOfChannels;
   }
 
-  SoundUpdateSampleRate();
+  SoundUpdateSampleRate(state);
 }
 
 void
-SoundUpdateSampleRate(void)
+SoundUpdateSampleRate(ARMul_State *state)
 {
   /* SFR = (N - 2) where N is sample period in microseconds. */
   if (numberOfChannels != 8) {
diff -upr arcem-fast/arch/armarc.h arcem-fast-fixed/arch/armarc.h
--- arcem-fast/arch/armarc.h    2010-07-24 00:09:02 
+++ arcem-fast-fixed/arch/armarc.h      2010-07-31 21:48:36 
@@ -242,9 +242,9 @@ int ArmArc_ReadKbdTx(ARMul_State *state)
 int ArmArc_WriteKbdRx(ARMul_State *state, unsigned char value);
 
 #ifdef SOUND_SUPPORT
-int SoundDMAFetch(SoundData *buffer);
-void SoundUpdateStereoImage(void);
-void SoundUpdateSampleRate(void);
+int SoundDMAFetch(SoundData *buffer, ARMul_State *state);
+void SoundUpdateStereoImage(ARMul_State *state);
+void SoundUpdateSampleRate(ARMul_State *state);
 #endif
 
 
diff -upr arcem-fast/arch/DispKbdShared.c arcem-fast-fixed/arch/DispKbdShared.c
--- arcem-fast/arch/DispKbdShared.c     2010-07-23 07:58:52 
+++ arcem-fast-fixed/arch/DispKbdShared.c       2010-07-31 21:46:23 
@@ -219,7 +219,7 @@ DisplayKbd_Poll(void *data)
   static int discconttog = 0;
 
 #ifdef SOUND_SUPPORT
-  sound_poll();
+  sound_poll(state);
 #endif
 
 #ifndef SYSTEM_gp2x
diff -upr arcem-fast/arch/sound.h arcem-fast-fixed/arch/sound.h
--- arcem-fast/arch/sound.h     2005-01-22 03:04:56 
+++ arcem-fast-fixed/arch/sound.h       2010-07-31 21:47:05 
@@ -6,7 +6,7 @@ typedef unsigned short int SoundData;
 
 int sound_init(void);
 
-void sound_poll(void);
+void sound_poll(ARMul_State *state);
 
 void sound_setSampleRate(unsigned long period);
 
diff -upr arcem-fast/armemu.c arcem-fast-fixed/armemu.c
--- arcem-fast/armemu.c 2010-07-23 22:35:50 
+++ arcem-fast-fixed/armemu.c   2010-07-31 21:23:36 
@@ -20,8 +20,10 @@
 #include "armdefs.h"
 #include "armemu.h"
 
+#ifdef SYSTEM_riscos
 #include "kernel.h"
 #include "swis.h"
+#endif
 
 ARMul_State statestr;
 
diff -upr arcem-fast/dagstandalone.c arcem-fast-fixed/dagstandalone.c
--- arcem-fast/dagstandalone.c  2010-07-23 07:48:34 
+++ arcem-fast-fixed/dagstandalone.c    2010-07-31 21:26:04 
@@ -104,8 +104,10 @@ static char *mygets(void *arg, char *buf
  void dagstandalone(void) {
   int i;
 #ifndef WIN32
+#ifndef AMIGA
   struct sigaction action;
 #endif
+#endif
   PointHandle point;
   Dbg_ConfigBlock config;
   Dbg_HostosInterface hostif;
------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
arcem-devel mailing list
arcem-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/arcem-devel

Reply via email to