[mupen64plus-rsp-hle] 109/167: Imported Upstream version 1.99.5+8+1e306f08d231

Sven Eckelmann ecsv-guest at moszumanska.debian.org
Thu Nov 26 06:02:30 UTC 2015


This is an automated email from the git hooks/post-receive script.

ecsv-guest pushed a commit to branch armhf_test
in repository mupen64plus-rsp-hle.

commit e5d95ef15ca486f209a500bfeddf4177bb7e29fe
Author: Sven Eckelmann <sven at narfation.org>
Date:   Tue Sep 11 09:16:55 2012 +0200

    Imported Upstream version 1.99.5+8+1e306f08d231
---
 src/main.c | 130 +++++++++++++++++++++++++++++++++++++++----------------------
 1 file changed, 83 insertions(+), 47 deletions(-)

diff --git a/src/main.c b/src/main.c
index c72c342..5ec5d51 100644
--- a/src/main.c
+++ b/src/main.c
@@ -173,6 +173,70 @@ static int audio_ucode(OSTask_t *task)
     return 0;
 }
 
+static int DoGFXTask(OSTask_t *task, int sum)
+{
+    if (GraphicsHle && rsp.ProcessDlistList != NULL)
+    {
+        rsp.ProcessDlistList();
+        taskdone();
+        *rsp.DPC_STATUS_REG &= ~0x0002;
+        return 1;
+    }
+    else
+    {
+        DebugMessage(M64MSG_WARNING, "GFX ucode through rsp plugin is not implemented");
+        return 0;
+    }
+}
+
+static int DoAudioTask(OSTask_t *task, int sum)
+{
+    if (AudioHle && rsp.ProcessAlistList != NULL)
+    {
+        rsp.ProcessAlistList();
+        taskdone();
+        return 1;
+    }
+    else
+    {
+        if (audio_ucode(task) == 0)
+        {
+            taskdone();
+            return 1;
+        }
+    }
+
+    return 0;
+}
+
+static int DoJPEGTask(OSTask_t *task, int sum)
+{
+    switch(sum)
+    {
+    case 0x278: // Zelda OOT during boot
+      taskdone();
+      return 1;
+    case 0x2caa6: // Zelda OOT, Pokemon Stadium {1,2} jpg decompression
+        ps_jpg_uncompress(task);
+        taskdone();
+        return 1;
+    case 0x130de: // Ogre Battle background decompression
+        ob_jpg_uncompress(task);
+        taskdone();
+        return 1;
+    }
+
+    return 0;
+}
+
+static int DoCFBTask(OSTask_t *task, int sum)
+{
+    rsp.ShowCFB();
+    taskdone();
+    return 1;
+}
+
+
 /* Global functions */
 void DebugMessage(int level, const char *message, ...)
 {
@@ -247,10 +311,9 @@ EXPORT unsigned int CALL DoRspCycles(unsigned int Cycles)
 {
     OSTask_t *task = (OSTask_t*)(rsp.DMEM + 0xfc0);
     int run_through_task = is_run_through_task(task);
-
     unsigned int i, sum=0;
-
     char filename[256];
+    FILE *f = NULL;
 
     if (run_through_task)
     {
@@ -263,65 +326,39 @@ EXPORT unsigned int CALL DoRspCycles(unsigned int Cycles)
 
         switch(task->type)
         {
-        case 1: // GFX
+        case 0: // Not specified
             {
-                if (GraphicsHle && rsp.ProcessDlistList != NULL)
-                {
-                    rsp.ProcessDlistList();
-                    taskdone();
-                    *rsp.DPC_STATUS_REG &= ~0x0002;
-                    return Cycles;
-                }
-                else
+                switch(sum)
                 {
-                    DebugMessage(M64MSG_WARNING, "GFX ucode through rsp plugin is not implemented");
+                case 0x212ee: // Twintris (task type is in fact GFX)
+                    {
+                        if (DoGFXTask(task, sum)) return Cycles;
+                        break;
+                    }
                 }
                 break;
             }
+        case 1: // GFX
+            {
+                if (DoGFXTask(task, sum)) return Cycles;
+                break;
+            }
 
         case 2: // AUDIO
             {
-                if (AudioHle && rsp.ProcessAlistList != NULL)
-                {
-                    rsp.ProcessAlistList();
-                    taskdone();
-                    return Cycles;
-                }
-                else
-                {
-                    if (audio_ucode(task) == 0)
-                    {
-                        taskdone();
-                        return Cycles;
-                    }
-                }
+                if (DoAudioTask(task, sum)) return Cycles;
                 break;
             }
 
         case 4: // JPEG
             {
-                switch(sum)
-                {
-                case 0x278: // Zelda OOT during boot
-                  taskdone();
-                  return Cycles;
-                case 0x2caa6: // Zelda OOT, Pokemon Stadium {1,2} jpg decompression
-                    ps_jpg_uncompress(task);
-                    taskdone();
-                    return Cycles;
-                case 0x130de: // Ogre Battle background decompression
-                    ob_jpg_uncompress(task);
-                    taskdone();
-                    return Cycles;
-                }
+                if (DoJPEGTask(task, sum)) return Cycles;
                 break;
             }
 
         case 7: // CFB
             {
-                rsp.ShowCFB();
-                taskdone();
-                return Cycles;
+                if (DoCFBTask(task, sum)) return Cycles;
                 break;
             }
         }
@@ -330,9 +367,8 @@ EXPORT unsigned int CALL DoRspCycles(unsigned int Cycles)
 
         sprintf(&filename[0], "task_%x.log", sum);
 
-
         // dump task
-        FILE *f = fopen(filename, "r");
+        f = fopen(filename, "r");
         if (f == NULL)
         {
             f = fopen(filename, "w");
@@ -401,8 +437,8 @@ EXPORT unsigned int CALL DoRspCycles(unsigned int Cycles)
         // We only emulate the part that modify RDRAM
         //
         // It is used for instance in Banjo Tooie, Zelda, Perfect Dark...
-        case 0x9E2: // banjo tooie (U)
-        case 0x9F2: // banjo tooie (E)
+        case 0x9e2: // banjo tooie (U)
+        case 0x9f2: // banjo tooie (E)
             {
             int i,j;
             memcpy(rsp.IMEM + 0x120, rsp.RDRAM + 0x1e8, 0x1f0);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/mupen64plus-rsp-hle.git



More information about the Pkg-games-commits mailing list