[mupen64plus-rsp-z64] 68/140: Imported Upstream version 1.99.4+29+61f0779c9b15

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


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

ecsv-guest pushed a commit to branch master
in repository mupen64plus-rsp-z64.

commit 8230b6cdaf3547606c4251d29a67969417d6e692
Author: Sven Eckelmann <sven at narfation.org>
Date:   Fri Sep 9 10:00:46 2011 +0200

    Imported Upstream version 1.99.4+29+61f0779c9b15
---
 projects/unix/Makefile | 13 ++++++++++---
 src/main_rsp.cpp       | 41 ++++++++++++++++++++++++-----------------
 src/rsp.cpp            | 29 ++++++++++++-----------------
 3 files changed, 46 insertions(+), 37 deletions(-)

diff --git a/projects/unix/Makefile b/projects/unix/Makefile
index 76f1c1c..ba776a0 100755
--- a/projects/unix/Makefile
+++ b/projects/unix/Makefile
@@ -115,6 +115,12 @@ ifeq ($(PIC), 1)
   LDFLAGS += -fPIC
 endif
 
+HLE=
+ifeq ($(HLEVIDEO), 1)
+  CFLAGS += -DVIDEO_HLE_ALLOWED
+  HLE = -hlevideo
+endif
+
 ifeq ($(BIG_ENDIAN), 1)
   CFLAGS += -DM64P_BIG_ENDIAN
 endif
@@ -212,7 +218,7 @@ ifeq ($(PLUGINDIR),)
 endif
 
 SRCDIR = ../../src
-OBJDIR = _obj
+OBJDIR = _obj$(HLE)
 
 # list of source files to compile
 SOURCE = \
@@ -229,7 +235,7 @@ OBJDIRS = $(dir $(OBJECTS))
 $(shell $(MKDIR) $(OBJDIRS))
 
 # build targets
-TARGET = mupen64plus-rsp-z64.$(SO_EXTENSION)
+TARGET = mupen64plus-rsp-z64$(HLE).$(SO_EXTENSION)
 
 targets:
 	@echo "Mupen64Plus-rsp-z64 makefile. "
@@ -244,6 +250,7 @@ targets:
 	@echo "    APIDIR=path   == path to find Mupen64Plus Core headers"
 	@echo "    OPTFLAGS=flag == compiler optimization (default: -O3)"
 	@echo "    PIC=(1|0)     == Force enable/disable of position independent code"
+	@echo "    HLEVIDEO=(1|0) == Move task of gfx emulation to a HLE video plugins"
 	@echo "  Install Options:"
 	@echo "    PREFIX=path   == install/uninstall prefix (default: /usr/local)"
 	@echo "    LIBDIR=path   == library prefix (default: PREFIX/lib)"
@@ -263,7 +270,7 @@ uninstall:
 	$(RM) "$(DESTDIR)$(PLUGINDIR)/$(TARGET)"
 
 clean:
-	$(RM) -r ./_obj $(TARGET)
+	$(RM) -r ./_obj$(HLE) $(TARGET)
 
 rebuild: clean all
 
diff --git a/src/main_rsp.cpp b/src/main_rsp.cpp
index 8f47939..e73f777 100644
--- a/src/main_rsp.cpp
+++ b/src/main_rsp.cpp
@@ -135,10 +135,14 @@ extern "C" {
 
     EXPORT unsigned int CALL DoRspCycles(unsigned int Cycles)
     {
+        //#define VIDEO_HLE_ALLOWED
         //#define AUDIO_HLE_ALLOWED
-#ifdef AUDIO_HLE_ALLOWED
-        DWORD TaskType = *(DWORD*)(z64_rspinfo.DMEM + 0xFC0);
 
+#if defined (AUDIO_HLE_ALLOWED) || defined (VIDEO_HLE_ALLOWED)
+        unsigned int TaskType = *(unsigned int *)(z64_rspinfo.DMEM + 0xFC0);
+#endif
+
+#ifdef VIDEO_HLE_ALLOWED
 #if 0
         if (TaskType == 1) {
             SDL_Event event;
@@ -157,25 +161,27 @@ extern "C" {
         }
 #endif
 
-        // if (TaskType == 1) {
-        //   if (z64_rspinfo.ProcessDList != NULL) {
-        //     z64_rspinfo.ProcessDList();
-        //   }
-        //   *z64_rspinfo.SP_STATUS_REG |= (0x0203 );
-        //   if ((*z64_rspinfo.SP_STATUS_REG & SP_STATUS_INTR_BREAK) != 0 ) {
-        //     *z64_rspinfo.MI_INTR_REG |= R4300i_SP_Intr;
-        //     z64_rspinfo.CheckInterrupts();
-        //   }
+        if (TaskType == 1) {
+            if (z64_rspinfo.ProcessDlistList != NULL) {
+                z64_rspinfo.ProcessDlistList();
+            }
+            *z64_rspinfo.SP_STATUS_REG |= (0x0203);
+            if ((*z64_rspinfo.SP_STATUS_REG & SP_STATUS_INTR_BREAK) != 0 ) {
+                *z64_rspinfo.MI_INTR_REG |= R4300i_SP_Intr;
+                z64_rspinfo.CheckInterrupts();
+            }
 
-        // *z64_rspinfo.DPC_STATUS_REG &= ~0x0002;
-        // return Cycles;
-        //   }
+            *z64_rspinfo.DPC_STATUS_REG &= ~0x0002;
+            return Cycles;
+        }
+#endif
 
+#ifdef AUDIO_HLE_ALLOWED
         if (TaskType == 2) {
-            if (z64_rspinfo.ProcessAList != NULL) {
-                z64_rspinfo.ProcessAList();
+            if (z64_rspinfo.ProcessAlistList != NULL) {
+                z64_rspinfo.ProcessAlistList();
             }
-            *z64_rspinfo.SP_STATUS_REG |= (0x0203 );
+            *z64_rspinfo.SP_STATUS_REG |= (0x0203);
             if ((*z64_rspinfo.SP_STATUS_REG & SP_STATUS_INTR_BREAK) != 0 ) {
                 *z64_rspinfo.MI_INTR_REG |= R4300i_SP_Intr;
                 z64_rspinfo.CheckInterrupts();
@@ -183,6 +189,7 @@ extern "C" {
             return Cycles;
         }  
 #endif
+
         if (z64_rspinfo.CheckInterrupts==NULL)
             log(M64MSG_WARNING, "Emulator doesn't provide CheckInterrupts routine");
         return rsp_execute(0x100000);
diff --git a/src/rsp.cpp b/src/rsp.cpp
index 2822d12..04e65ec 100644
--- a/src/rsp.cpp
+++ b/src/rsp.cpp
@@ -2836,9 +2836,13 @@ int rsp_execute(int cycles)
 /*****************************************************************************/
 
 
+enum sp_dma_direction
+{
+	SP_DMA_RDRAM_TO_IDMEM,
+	SP_DMA_IDMEM_TO_RDRAM
+};
 
-
-static void sp_dma(int direction)
+static void sp_dma(enum sp_dma_direction direction)
 {
     UINT8 *src, *dst;
     int i, j;
@@ -2847,21 +2851,12 @@ static void sp_dma(int direction)
     int skip;
 
 
-    INT32 l = sp_dma_length;
-
-    if (direction)
-    {
-        length = ((l & 0xfff) | 3) + 1;
-    }
-    else
-    {
-        length = ((l & 0xfff) | 7) + 1;
-    }
-
+    UINT32 l = sp_dma_length;
+    length = ((l & 0xfff) | 7) + 1;
     skip = (l >> 20) + length;
     count = ((l >> 12) & 0xff) + 1;
 
-    if (direction == 0)             // RDRAM -> I/DMEM
+    if (direction == SP_DMA_RDRAM_TO_IDMEM) // RDRAM -> I/DMEM
     {
         //UINT32 src_address = sp_dram_addr & ~7;
         //UINT32 dst_address = (sp_mem_addr & 0x1000) ? 0x4001000 : 0x4000000;
@@ -2884,7 +2879,7 @@ static void sp_dma(int direction)
         *z64_rspinfo.SP_DMA_BUSY_REG = 0;
         *z64_rspinfo.SP_STATUS_REG  &= ~SP_STATUS_DMABUSY;
     }
-    else                                    // I/DMEM -> RDRAM
+    else if (direction == SP_DMA_IDMEM_TO_RDRAM) // I/DMEM -> RDRAM
     {
         //UINT32 dst_address = sp_dram_addr & ~7;
         //UINT32 src_address = (sp_mem_addr & 0x1000) ? 0x4001000 : 0x4000000;
@@ -2969,7 +2964,7 @@ void n64_sp_reg_w(UINT32 offset, UINT32 data, UINT32 dummy)
             //                              sp_dma_count = (data >> 12) & 0xff;
             //                              sp_dma_skip = (data >> 20) & 0xfff;
             sp_dma_length=data;
-            sp_dma(0);
+            sp_dma(SP_DMA_RDRAM_TO_IDMEM);
             break;
 
         case 0x0c/4:            // SP_WR_LEN_REG
@@ -2977,7 +2972,7 @@ void n64_sp_reg_w(UINT32 offset, UINT32 data, UINT32 dummy)
             //                              sp_dma_count = (data >> 12) & 0xff;
             //                              sp_dma_skip = (data >> 20) & 0xfff;
             sp_dma_length=data;
-            sp_dma(1);
+            sp_dma(SP_DMA_IDMEM_TO_RDRAM);
             break;
 
         case 0x10/4:            // SP_STATUS_REG

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



More information about the Pkg-games-commits mailing list