# HG changeset patch # User nenolod # Date 1142802764 28800 # Node ID 89df4358d522686c3a110959d77a877ebce24fa7 # Parent 61e7332e06522da10d9c1ac450950b1dd4bb7f87 [svn] - no longer explodes. still no audio output. diff -r 61e7332e0652 -r 89df4358d522 Plugins/Input/sexypsf/Misc.c --- 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); } diff -r 61e7332e0652 -r 89df4358d522 Plugins/Input/sexypsf/PsxCounters.c --- 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); diff -r 61e7332e0652 -r 89df4358d522 Plugins/Input/sexypsf/PsxDma.c --- 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 + #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 +} + diff -r 61e7332e0652 -r 89df4358d522 Plugins/Input/sexypsf/PsxInterpreter.c --- 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; } diff -r 61e7332e0652 -r 89df4358d522 Plugins/Input/sexypsf/R3000A.c --- 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(); diff -r 61e7332e0652 -r 89df4358d522 Plugins/Input/sexypsf/xmms.c --- 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;