Mercurial > audlegacy
comparison Plugins/Input/sexypsf/PsxDma.c @ 857:e1f9f03f9fbe trunk
[svn] - revert (commit 2/2)
author | nenolod |
---|---|
date | Sun, 19 Mar 2006 13:21:35 -0800 |
parents | 42cdc99e395a |
children | 61e7332e0652 f12d7e208b43 |
comparison
equal
deleted
inserted
replaced
856:6deb4d133032 | 857:e1f9f03f9fbe |
---|---|
1 /* Pcsx - Pc Psx Emulator | |
2 * Copyright (C) 1999-2002 Pcsx Team | |
3 * | |
4 * This program is free software; you can redistribute it and/or modify | |
5 * it under the terms of the GNU General Public License as published by | |
6 * the Free Software Foundation; either version 2 of the License, or | |
7 * (at your option) any later version. | |
8 * | |
9 * This program is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 * GNU General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU General Public License | |
15 * along with this program; if not, write to the Free Software | |
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
17 */ | |
18 | |
19 #include "PsxCommon.h" | |
20 | |
21 void psxDma4(u32 madr, u32 bcr, u32 chcr) { // SPU | |
22 switch (chcr) { | |
23 case 0x01000201: //cpu to spu transfer | |
24 { | |
25 bcr= (bcr>>16) * (bcr&0xffff) * 2; | |
26 | |
27 //printf("%08x, %08x\n",madr,bcr); | |
28 SPUwriteDMAMem(madr, bcr); | |
29 } | |
30 break; | |
31 case 0x01000200: //spu to cpu transfer | |
32 { | |
33 //printf("%08x\n",madr); | |
34 SPUreadDMAMem (madr, (bcr >> 16) * (bcr & 0xffff) * 2); | |
35 } | |
36 break; | |
37 } | |
38 } | |
39 | |
40 void psxDma6(u32 madr, u32 bcr, u32 chcr) { | |
41 u32 *mem = (u32 *)PSXM(madr); | |
42 | |
43 #ifdef PSXDMA_LOG | |
44 PSXDMA_LOG("*** DMA 6 - OT *** %lx addr = %lx size = %lx\n", chcr, madr, bcr); | |
45 #endif | |
46 | |
47 if (chcr == 0x11000002) { | |
48 while (bcr--) { | |
49 *mem-- = (madr - 4) & 0xffffff; | |
50 madr -= 4; | |
51 } | |
52 mem++; *mem = 0xffffff; | |
53 } else { | |
54 // Unknown option | |
55 #ifdef PSXDMA_LOG | |
56 PSXDMA_LOG("*** DMA 6 - OT unknown *** %lx addr = %lx size = %lx\n", chcr, madr, bcr); | |
57 #endif | |
58 } | |
59 } |