summaryrefslogtreecommitdiff
path: root/Source/DSPSpy/dsp_interface.h
blob: 03ce9c4f60b6f1de04f7cd84378d1dd98d1dd5bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright (C) 2003 Dolphin Project.

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License 2.0 for more details.

// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/

// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/

#ifndef _DSP_INTERFACE_H
#define _DSP_INTERFACE_H

#include <gccore.h>

// DSPCR bits
#define DSPCR_DSPRESET      0x0800        // Reset DSP
#define DSPCR_ARDMA         0x0200        // ARAM dma in progress, if set
#define DSPCR_DSPINTMSK     0x0100        // * interrupt mask   (RW)
#define DSPCR_DSPINT        0x0080        // * interrupt active (RWC)
#define DSPCR_ARINTMSK      0x0040
#define DSPCR_ARINT         0x0020
#define DSPCR_AIINTMSK      0x0010
#define DSPCR_AIINT         0x0008
#define DSPCR_HALT          0x0004        // halt DSP
#define DSPCR_PIINT         0x0002        // assert DSP PI interrupt
#define DSPCR_RES           0x0001        // reset DSP

class IDSP {
public:
	virtual ~IDSP() {}
	
	virtual void Init() = 0;
	virtual void Reset() = 0;
	virtual u32 CheckMailTo() = 0;
	virtual void SendMailTo(u32 mail) = 0;

	// Yeah, yeah, having a method here makes this not a pure interface - but
	// the implementation does nothing but calling the virtual methods above.
	void SendTask(void *addr, u16 iram_addr, u16 len, u16 start);
};

#endif  // _DSP_INTERFACE_H