Mercurial > audlegacy
annotate Plugins/Input/sexypsf/spu/dma.c @ 410:548073bede0b trunk
[svn] Experimental fix for the 56 warnings emitted by GCC4 when it encounters PsxBios.c; by an anonymous contributor. Stability to be assessed in the coming weeks.
author | chainsaw |
---|---|
date | Sun, 08 Jan 2006 16:49:05 -0800 |
parents | 42cdc99e395a |
children | 61e7332e0652 |
rev | line source |
---|---|
333
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
1 /*************************************************************************** |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
2 dma.c - description |
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 begin : Wed May 15 2002 |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
5 copyright : (C) 2002 by Pete Bernert |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
6 email : BlackDove@addcom.de |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
7 ***************************************************************************/ |
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 /*************************************************************************** |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
10 * * |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
11 * 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
|
12 * 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
|
13 * 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
|
14 * (at your option) any later version. See also the license.txt file for * |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
15 * additional informations. * |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
16 * * |
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 //*************************************************************************// |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
20 // History of changes: |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
21 // |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
22 // 2002/05/15 - Pete |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
23 // - generic cleanup for the Peops release |
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 //*************************************************************************// |
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 #include "stdafx.h" |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
28 |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
29 #define _IN_DMA |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
30 |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
31 //#include "externals.h" |
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 // READ DMA (many values) |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
34 //////////////////////////////////////////////////////////////////////// |
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 void SPUreadDMAMem(u32 usPSXMem,int iSize) |
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 int i; |
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 for(i=0;i<iSize;i++) |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
41 { |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
42 *(u16 *)PSXM(usPSXMem)=spuMem[spuAddr>>1]; // spu addr got by writeregister |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
43 usPSXMem+=2; |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
44 spuAddr+=2; // inc spu addr |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
45 if(spuAddr>0x7ffff) spuAddr=0; // wrap |
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 } |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
48 |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
49 //////////////////////////////////////////////////////////////////////// |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
50 //////////////////////////////////////////////////////////////////////// |
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 |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
53 // to investigate: do sound data updates by writedma affect spu |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
54 // irqs? Will an irq be triggered, if new data is written to |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
55 // the memory irq address? |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
56 |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
57 //////////////////////////////////////////////////////////////////////// |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
58 // WRITE DMA (many values) |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
59 //////////////////////////////////////////////////////////////////////// |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
60 |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
61 void SPUwriteDMAMem(u32 usPSXMem,int iSize) |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
62 { |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
63 int i; |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
64 |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
65 for(i=0;i<iSize;i++) |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
66 { |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
67 spuMem[spuAddr>>1] = *(u16 *)PSXM(usPSXMem); |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
68 usPSXMem+=2; // spu addr got by writeregister |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
69 spuAddr+=2; // inc spu addr |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
70 if(spuAddr>0x7ffff) spuAddr=0; // wrap |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
71 } |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
72 } |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
73 |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
74 //////////////////////////////////////////////////////////////////////// |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
75 |