changeset 855:89df4358d522 trunk

[svn] - no longer explodes. still no audio output.
author nenolod
date Sun, 19 Mar 2006 13:12:44 -0800
parents 61e7332e0652
children 6deb4d133032
files Plugins/Input/sexypsf/Misc.c Plugins/Input/sexypsf/PsxCounters.c Plugins/Input/sexypsf/PsxDma.c Plugins/Input/sexypsf/PsxInterpreter.c Plugins/Input/sexypsf/R3000A.c Plugins/Input/sexypsf/xmms.c
diffstat 6 files changed, 99 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/Plugins/Input/sexypsf/Misc.c	Sun Mar 19 12:51:03 2006 -0800
+++ b/Plugins/Input/sexypsf/Misc.c	Sun Mar 19 13:12:44 2006 -0800
@@ -452,6 +452,7 @@
 
 	if(!(ret=LoadPSF(path,0,0)))
 	{
+	 puts("PSFload fail");
 	 psxShutdown();
 	 return(0);
 	}
--- a/Plugins/Input/sexypsf/PsxCounters.c	Sun Mar 19 12:51:03 2006 -0800
+++ b/Plugins/Input/sexypsf/PsxCounters.c	Sun Mar 19 13:12:44 2006 -0800
@@ -103,7 +103,7 @@
 
  if(cycles>=16)
  {
-  if(!SPU2async(cycles)) return(0);
+  SPU2async(cycles);
   last=psxRegs.cycle;
  }
  return(1);
--- a/Plugins/Input/sexypsf/PsxDma.c	Sun Mar 19 12:51:03 2006 -0800
+++ b/Plugins/Input/sexypsf/PsxDma.c	Sun Mar 19 13:12:44 2006 -0800
@@ -1,5 +1,5 @@
-/*  Pcsx - Pc Psx Emulator
- *  Copyright (C) 1999-2002  Pcsx Team
+/*  Pcsx2 - Pc Ps2 Emulator
+ *  Copyright (C) 2002-2004  Pcsx2 Team
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -13,28 +13,57 @@
  *
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  
+USA
  */
 
+#include <string.h>
+
 #include "PsxCommon.h"
 
+// Dma0/1   in Mdec.c
+// Dma3     in CdRom.c
+// Dma8     in PsxSpd.c
+// Dma11/12 in PsxSio2.c
+
 void psxDma4(u32 madr, u32 bcr, u32 chcr) { // SPU
+	int size;
+
 	switch (chcr) {
 		case 0x01000201: //cpu to spu transfer
-		{
-		 bcr= (bcr>>16) * (bcr&0xffff) * 2;
+#ifdef PSXDMA_LOG
+			PSXDMA_LOG("*** DMA 4 - SPU mem2spu *** %lx addr = %lx size = %lx\n", chcr, madr, bcr);
+#endif
+			size = (bcr >> 16) * (bcr & 0xffff) * 2;
+			SPU2writeDMA4Mem((u16 *)PSXM(madr), size);
+#if 0
+			PSX_INT(4, (size * 80) / BIAS);
+#endif
+			break;
+		case 0x01000200: //spu to cpu transfer
+#ifdef PSXDMA_LOG
+			PSXDMA_LOG("*** DMA 4 - SPU spu2mem *** %lx addr = %lx size = %lx\n", chcr, madr, bcr);
+#endif
+			size = (bcr >> 16) * (bcr & 0xffff) * 2;
+    		SPU2readDMA4Mem((u16 *)PSXM(madr), size);
+#if 0
+			PSX_INT(4, (size * 80) / BIAS);
+#endif
+			break;
+#ifdef PSXDMA_LOG
+		default:
+			PSXDMA_LOG("*** DMA 4 - SPU unknown *** %lx addr = %lx size = %lx\n", chcr, madr, bcr);
+			break;
+#endif
+	}
+}
 
-		 //printf("%08x, %08x\n",madr,bcr);
-		 SPU2writeDMA4Mem(madr, bcr);		
-		}
-		break;
-		case 0x01000200: //spu to cpu transfer
-		{
-		 //printf("%08x\n",madr);
-	  	 SPU2readDMA4Mem (madr, (bcr >> 16) * (bcr & 0xffff) * 2);
-		}
-		break;
-	}
+void psxDma4Interrupt() {
+#if 0
+	HW_DMA4_CHCR &= ~0x01000000;
+	DMA_INTERRUPT(4);
+#endif
+	SPU2interruptDMA4();
 }
 
 void psxDma6(u32 madr, u32 bcr, u32 chcr) {
@@ -56,4 +85,49 @@
 		PSXDMA_LOG("*** DMA 6 - OT unknown *** %lx addr = %lx size = %lx\n", chcr, madr, bcr);
 #endif
 	}
+#if 0
+	HW_DMA6_CHCR &= ~0x01000000;
+	DMA_INTERRUPT(6);
+#endif
 }
+
+void psxDma7(u32 madr, u32 bcr, u32 chcr) {
+	int size;
+
+	switch (chcr) {
+		case 0x01000201: //cpu to spu2 transfer
+#ifdef PSXDMA_LOG
+			PSXDMA_LOG("*** DMA 7 - SPU2 mem2spu *** %lx addr = %lx size = %lx\n", chcr, madr, bcr);
+#endif
+			size = (bcr >> 16) * (bcr & 0xffff) * 2;
+			SPU2writeDMA7Mem((u16 *)PSXM(madr), size);
+#if 0
+			PSX_INT(7, (size * 80) / BIAS);
+#endif
+			break;
+		case 0x01000200: //spu2 to cpu transfer
+#ifdef PSXDMA_LOG
+			PSXDMA_LOG("*** DMA 7 - SPU2 spu2mem *** %lx addr = %lx size = %lx\n", chcr, madr, bcr);
+#endif
+			size = (bcr >> 16) * (bcr & 0xffff) * 2;
+    		SPU2readDMA7Mem((u16 *)PSXM(madr), size);
+#if 0
+			PSX_INT(7, (size * 80) / BIAS);
+#endif
+			break;
+#ifdef PSXDMA_LOG
+		default:
+			PSXDMA_LOG("*** DMA 7 - SPU2 unknown *** %lx addr = %lx size = %lx\n", chcr, madr, bcr);
+			break;
+#endif
+	}
+}
+
+void psxDma7Interrupt() {
+#if 0
+	HW_DMA7_CHCR &= ~0x01000000;
+	DMA_INTERRUPT2(0);
+	SPU2interruptDMA7();
+#endif
+}
+
--- a/Plugins/Input/sexypsf/PsxInterpreter.c	Sun Mar 19 12:51:03 2006 -0800
+++ b/Plugins/Input/sexypsf/PsxInterpreter.c	Sun Mar 19 13:12:44 2006 -0800
@@ -718,6 +718,7 @@
 	{
 	 if(!CounterSPURun()) 
 	 {
+	  puts("CounterSPURun fail");
 	  psxShutdown();
 	  return;
 	 }
--- a/Plugins/Input/sexypsf/R3000A.c	Sun Mar 19 12:51:03 2006 -0800
+++ b/Plugins/Input/sexypsf/R3000A.c	Sun Mar 19 13:12:44 2006 -0800
@@ -46,6 +46,8 @@
 }
 
 void psxShutdown() {
+	puts("PsxShutdown()");
+
 	psxMemShutdown();
 	psxBiosShutdown();
 
--- a/Plugins/Input/sexypsf/xmms.c	Sun Mar 19 12:51:03 2006 -0800
+++ b/Plugins/Input/sexypsf/xmms.c	Sun Mar 19 13:12:44 2006 -0800
@@ -91,6 +91,8 @@
 {
 	int mask = ~((((16 / 8) * 2)) - 1);
 
+	g_print("sexypsf_update(%p, %d)", Buffer, count);
+
 	while(count>0)
 	{
 		int t=sexypsf_ip.output->buffer_free() & mask;
@@ -134,6 +136,8 @@
 
 	while(!(command&CMD_STOP)) 
 	{
+		g_print("playloop iterate\n");
+
 		if(command&CMD_SEEK)
 			{
 			int t=(command&~(CMD_SEEK|CMD_STOP))*1000;