annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
333
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
1 /* Pcsx - Pc Psx Emulator
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
2 * Copyright (C) 1999-2002 Pcsx Team
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
3 *
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
4 * This program is free software; you can redistribute it and/or modify
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
5 * it under the terms of the GNU General Public License as published by
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
7 * (at your option) any later version.
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
8 *
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
9 * This program is distributed in the hope that it will be useful,
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
12 * GNU General Public License for more details.
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
13 *
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
14 * You should have received a copy of the GNU General Public License
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
15 * along with this program; if not, write to the Free Software
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
17 */
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
18
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
19 #include "PsxCommon.h"
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
20
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
21 void psxDma4(u32 madr, u32 bcr, u32 chcr) { // SPU
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
22 switch (chcr) {
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
23 case 0x01000201: //cpu to spu transfer
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
24 {
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
25 bcr= (bcr>>16) * (bcr&0xffff) * 2;
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
26
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
27 //printf("%08x, %08x\n",madr,bcr);
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
28 SPUwriteDMAMem(madr, bcr);
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
29 }
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
30 break;
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
31 case 0x01000200: //spu to cpu transfer
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
32 {
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
33 //printf("%08x\n",madr);
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
34 SPUreadDMAMem (madr, (bcr >> 16) * (bcr & 0xffff) * 2);
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
35 }
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
36 break;
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
37 }
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
38 }
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
39
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
40 void psxDma6(u32 madr, u32 bcr, u32 chcr) {
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
41 u32 *mem = (u32 *)PSXM(madr);
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
42
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
43 #ifdef PSXDMA_LOG
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
44 PSXDMA_LOG("*** DMA 6 - OT *** %lx addr = %lx size = %lx\n", chcr, madr, bcr);
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
45 #endif
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
46
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
47 if (chcr == 0x11000002) {
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
48 while (bcr--) {
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
49 *mem-- = (madr - 4) & 0xffffff;
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
50 madr -= 4;
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
51 }
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
52 mem++; *mem = 0xffffff;
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
53 } else {
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
54 // Unknown option
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
55 #ifdef PSXDMA_LOG
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
56 PSXDMA_LOG("*** DMA 6 - OT unknown *** %lx addr = %lx size = %lx\n", chcr, madr, bcr);
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
57 #endif
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
58 }
42cdc99e395a [svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff changeset
59 }