1
/***************************************************************************
4
begin : Wed May 15 2002
5
copyright : (C) 2002 by Pete Bernert
6
email : BlackDove@addcom.de
7
***************************************************************************/
9
/***************************************************************************
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. See also the license.txt file for *
15
* additional informations. *
17
***************************************************************************/
19
//*************************************************************************//
20
// History of changes:
23
// - generic cleanup for the Peops release
25
//*************************************************************************//
27
#include "../peops/stdafx.h"
31
extern uint32 psx_ram[(2*1024*1024)/4];
33
//#include "externals.h"
34
////////////////////////////////////////////////////////////////////////
35
// READ DMA (many values)
36
////////////////////////////////////////////////////////////////////////
38
void SPUreadDMAMem(u32 usPSXMem,int iSize)
41
u16 *ram16 = (u16 *)&psx_ram[0];
45
ram16[usPSXMem>>1]=spuMem[spuAddr>>1]; // spu addr got by writeregister
47
spuAddr+=2; // inc spu addr
48
if(spuAddr>0x7ffff) spuAddr=0; // wrap
52
////////////////////////////////////////////////////////////////////////
53
////////////////////////////////////////////////////////////////////////
54
////////////////////////////////////////////////////////////////////////
56
// to investigate: do sound data updates by writedma affect spu
57
// irqs? Will an irq be triggered, if new data is written to
58
// the memory irq address?
60
////////////////////////////////////////////////////////////////////////
61
// WRITE DMA (many values)
62
////////////////////////////////////////////////////////////////////////
64
void SPUwriteDMAMem(u32 usPSXMem,int iSize)
67
u16 *ram16 = (u16 *)&psx_ram[0];
71
// printf("main RAM %x => SPU %x\n", usPSXMem, spuAddr);
72
spuMem[spuAddr>>1] = ram16[usPSXMem>>1];
73
usPSXMem+=2; // spu addr got by writeregister
74
spuAddr+=2; // inc spu addr
75
if(spuAddr>0x7ffff) spuAddr=0; // wrap
79
////////////////////////////////////////////////////////////////////////