notaz.gp2x.de
/
pcsx_rearmed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add missing files
[pcsx_rearmed.git]
/
plugins
/
dfsound
/
dma.c
diff --git
a/plugins/dfsound/dma.c
b/plugins/dfsound/dma.c
index
f92d066
..
43019f1
100644
(file)
--- a/
plugins/dfsound/dma.c
+++ b/
plugins/dfsound/dma.c
@@
-27,11
+27,9
@@
\r
unsigned short CALLBACK SPUreadDMA(void)
\r
{
\r
\r
unsigned short CALLBACK SPUreadDMA(void)
\r
{
\r
- unsigned short s=spuMem[spuAddr>>1];
\r
- spuAddr+=2;
\r
- if(spuAddr>0x7ffff) spuAddr=0;
\r
-
\r
- iSpuAsyncWait=0;
\r
+ unsigned short s = *(unsigned short *)(spu.spuMemC + spu.spuAddr);
\r
+ spu.spuAddr += 2;
\r
+ spu.spuAddr &= 0x7fffe;
\r
\r
return s;
\r
}
\r
\r
return s;
\r
}
\r
@@
-40,18
+38,19
@@
unsigned short CALLBACK SPUreadDMA(void)
// READ DMA (many values)
\r
////////////////////////////////////////////////////////////////////////
\r
\r
// READ DMA (many values)
\r
////////////////////////////////////////////////////////////////////////
\r
\r
-void CALLBACK SPUreadDMAMem(unsigned short * pusPSXMem,int iSize)
\r
+void CALLBACK SPUreadDMAMem(unsigned short *pusPSXMem, int iSize,
\r
+ unsigned int cycles)
\r
{
\r
int i;
\r
\r
{
\r
int i;
\r
\r
+ do_samples_if_needed(cycles, 1);
\r
+
\r
for(i=0;i<iSize;i++)
\r
{
\r
for(i=0;i<iSize;i++)
\r
{
\r
- *pusPSXMem++
=spuMem[spuAddr>>1]; // spu addr got by writeregister
\r
- spu
Addr+=2; // inc spu addr
\r
- if(spuAddr>0x7ffff) spuAddr=0; // wrap
\r
+ *pusPSXMem++
= *(unsigned short *)(spu.spuMemC + spu.spuAddr);
\r
+ spu
.spuAddr += 2;
\r
+ spu.spuAddr &= 0x7fffe;
\r
}
\r
}
\r
-
\r
- iSpuAsyncWait=0;
\r
}
\r
\r
////////////////////////////////////////////////////////////////////////
\r
}
\r
\r
////////////////////////////////////////////////////////////////////////
\r
@@
-68,30
+67,38
@@
void CALLBACK SPUreadDMAMem(unsigned short * pusPSXMem,int iSize)
\r
void CALLBACK SPUwriteDMA(unsigned short val)
\r
{
\r
\r
void CALLBACK SPUwriteDMA(unsigned short val)
\r
{
\r
- spuMem[spuAddr>>1] = val; // spu addr got by writeregister
\r
+ *(unsigned short *)(spu.spuMemC + spu.spuAddr) = val;
\r
\r
\r
- spuAddr+=2; // inc spu addr
\r
- if(spuAddr>0x7ffff) spuAddr=0; // wrap
\r
-
\r
- iSpuAsyncWait=0;
\r
+ spu.spuAddr += 2;
\r
+ spu.spuAddr &= 0x7fffe;
\r
+ spu.bMemDirty = 1;
\r
}
\r
\r
////////////////////////////////////////////////////////////////////////
\r
// WRITE DMA (many values)
\r
////////////////////////////////////////////////////////////////////////
\r
\r
}
\r
\r
////////////////////////////////////////////////////////////////////////
\r
// WRITE DMA (many values)
\r
////////////////////////////////////////////////////////////////////////
\r
\r
-void CALLBACK SPUwriteDMAMem(unsigned short * pusPSXMem,int iSize)
\r
+void CALLBACK SPUwriteDMAMem(unsigned short *pusPSXMem, int iSize,
\r
+ unsigned int cycles)
\r
{
\r
int i;
\r
{
\r
int i;
\r
+
\r
+ do_samples_if_needed(cycles, 1);
\r
+ spu.bMemDirty = 1;
\r
+
\r
+ if(spu.spuAddr + iSize*2 < 0x80000)
\r
+ {
\r
+ memcpy(spu.spuMemC + spu.spuAddr, pusPSXMem, iSize*2);
\r
+ spu.spuAddr += iSize*2;
\r
+ return;
\r
+ }
\r
\r
for(i=0;i<iSize;i++)
\r
{
\r
\r
for(i=0;i<iSize;i++)
\r
{
\r
- spuMem[spuAddr>>1] = *pusPSXMem++; // spu addr got by writeregister
\r
- spu
Addr+=2; // inc spu addr
\r
- if(spuAddr>0x7ffff) spuAddr=0; // wrap
\r
+ *(unsigned short *)(spu.spuMemC + spu.spuAddr) = *pusPSXMem++;
\r
+ spu
.spuAddr += 2;
\r
+ spu.spuAddr &= 0x7fffe;
\r
}
\r
}
\r
-
\r
- iSpuAsyncWait=0;
\r
}
\r
\r
////////////////////////////////////////////////////////////////////////
\r
}
\r
\r
////////////////////////////////////////////////////////////////////////
\r