~ubuntu-branches/debian/jessie/audacious-plugins/jessie

« back to all changes in this revision

Viewing changes to src/psf/peops/dma.c

  • Committer: Package Import Robot
  • Author(s): Alessio Treglia
  • Date: 2012-02-20 00:28:16 UTC
  • mfrom: (1.1.16)
  • Revision ID: package-import@ubuntu.com-20120220002816-mgn4vhn314z6mubs
Tags: 3.2.1-1
* Team upload.
* New upstream bugfix release.
* Remove correct_spelling_error.diff, applied upstream.
* Refresh ffaudio.diff.
* Reintroduce src/psf/*, it seems DFSG clean now.
* Fix and update debian/copyright.
* Update watch file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
                            dma.c  -  description
 
3
                             -------------------
 
4
    begin                : Wed May 15 2002
 
5
    copyright            : (C) 2002 by Pete Bernert
 
6
    email                : BlackDove@addcom.de
 
7
 ***************************************************************************/
 
8
 
 
9
/***************************************************************************
 
10
 *                                                                         *
 
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.                                              *
 
16
 *                                                                         *
 
17
 ***************************************************************************/
 
18
 
 
19
//*************************************************************************//
 
20
// History of changes:
 
21
//
 
22
// 2002/05/15 - Pete
 
23
// - generic cleanup for the Peops release
 
24
//
 
25
//*************************************************************************//
 
26
 
 
27
#include "../peops/stdafx.h"
 
28
 
 
29
#define _IN_DMA
 
30
 
 
31
extern uint32 psx_ram[(2*1024*1024)/4];
 
32
 
 
33
//#include "externals.h"
 
34
////////////////////////////////////////////////////////////////////////
 
35
// READ DMA (many values)
 
36
////////////////////////////////////////////////////////////////////////
 
37
 
 
38
void SPUreadDMAMem(u32 usPSXMem,int iSize)
 
39
{
 
40
 int i;
 
41
 u16 *ram16 = (u16 *)&psx_ram[0];
 
42
 
 
43
 for(i=0;i<iSize;i++)
 
44
  {
 
45
   ram16[usPSXMem>>1]=spuMem[spuAddr>>1];               // spu addr got by writeregister
 
46
   usPSXMem+=2;
 
47
   spuAddr+=2;                                         // inc spu addr
 
48
   if(spuAddr>0x7ffff) spuAddr=0;                      // wrap
 
49
  }
 
50
}
 
51
 
 
52
////////////////////////////////////////////////////////////////////////
 
53
////////////////////////////////////////////////////////////////////////
 
54
////////////////////////////////////////////////////////////////////////
 
55
 
 
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?
 
59
 
 
60
////////////////////////////////////////////////////////////////////////
 
61
// WRITE DMA (many values)
 
62
////////////////////////////////////////////////////////////////////////
 
63
 
 
64
void SPUwriteDMAMem(u32 usPSXMem,int iSize)
 
65
{
 
66
 int i;
 
67
 u16 *ram16 = (u16 *)&psx_ram[0];
 
68
 
 
69
 for(i=0;i<iSize;i++)
 
70
  {
 
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
 
76
  }
 
77
}
 
78
 
 
79
////////////////////////////////////////////////////////////////////////
 
80