1 /***************************************************************************
\r
4 begin : Wed May 15 2002
\r
5 copyright : (C) 2002 by Pete Bernert
\r
6 email : BlackDove@addcom.de
\r
7 ***************************************************************************/
\r
8 /***************************************************************************
\r
10 * This program is free software; you can redistribute it and/or modify *
\r
11 * it under the terms of the GNU General Public License as published by *
\r
12 * the Free Software Foundation; either version 2 of the License, or *
\r
13 * (at your option) any later version. See also the license.txt file for *
\r
14 * additional informations. *
\r
16 ***************************************************************************/
\r
22 #include "externals.h"
\r
24 ////////////////////////////////////////////////////////////////////////
\r
25 // READ DMA (one value)
\r
26 ////////////////////////////////////////////////////////////////////////
\r
28 unsigned short CALLBACK SPUreadDMA(void)
\r
30 unsigned short s=spuMem[spuAddr>>1];
\r
32 if(spuAddr>0x7ffff) spuAddr=0;
\r
39 ////////////////////////////////////////////////////////////////////////
\r
40 // READ DMA (many values)
\r
41 ////////////////////////////////////////////////////////////////////////
\r
43 void CALLBACK SPUreadDMAMem(unsigned short * pusPSXMem,int iSize)
\r
47 for(i=0;i<iSize;i++)
\r
49 *pusPSXMem++=spuMem[spuAddr>>1]; // spu addr got by writeregister
\r
50 spuAddr+=2; // inc spu addr
\r
51 if(spuAddr>0x7ffff) spuAddr=0; // wrap
\r
57 ////////////////////////////////////////////////////////////////////////
\r
58 ////////////////////////////////////////////////////////////////////////
\r
59 ////////////////////////////////////////////////////////////////////////
\r
61 // to investigate: do sound data updates by writedma affect spu
\r
62 // irqs? Will an irq be triggered, if new data is written to
\r
63 // the memory irq address?
\r
65 ////////////////////////////////////////////////////////////////////////
\r
66 // WRITE DMA (one value)
\r
67 ////////////////////////////////////////////////////////////////////////
\r
69 void CALLBACK SPUwriteDMA(unsigned short val)
\r
71 spuMem[spuAddr>>1] = val; // spu addr got by writeregister
\r
73 spuAddr+=2; // inc spu addr
\r
74 if(spuAddr>0x7ffff) spuAddr=0; // wrap
\r
79 ////////////////////////////////////////////////////////////////////////
\r
80 // WRITE DMA (many values)
\r
81 ////////////////////////////////////////////////////////////////////////
\r
83 void CALLBACK SPUwriteDMAMem(unsigned short * pusPSXMem,int iSize)
\r
87 for(i=0;i<iSize;i++)
\r
89 spuMem[spuAddr>>1] = *pusPSXMem++; // spu addr got by writeregister
\r
90 spuAddr+=2; // inc spu addr
\r
91 if(spuAddr>0x7ffff) spuAddr=0; // wrap
\r
97 ////////////////////////////////////////////////////////////////////////
\r