/[pcsx2_0.9.7]/trunk/pcsx2/IPU/IPUdma.h
ViewVC logotype

Annotation of /trunk/pcsx2/IPU/IPUdma.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 280 - (hide annotations) (download)
Thu Dec 23 12:02:12 2010 UTC (9 years, 1 month ago) by william
File MIME type: text/plain
File size: 2221 byte(s)
re-commit (had local access denied errors when committing)
1 william 62 /* PCSX2 - PS2 Emulator for PCs
2     * Copyright (C) 2002-2010 PCSX2 Dev Team
3     *
4     * PCSX2 is free software: you can redistribute it and/or modify it under the terms
5     * of the GNU Lesser General Public License as published by the Free Software Found-
6     * ation, either version 3 of the License, or (at your option) any later version.
7     *
8     * PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9     * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10     * PURPOSE. See the GNU General Public License for more details.
11     *
12     * You should have received a copy of the GNU General Public License along with PCSX2.
13     * If not, see <http://www.gnu.org/licenses/>.
14     */
15    
16     #pragma once
17    
18     #include "IPU.h"
19    
20     static DMACh& ipu0dma = (DMACh&)eeHw[0xb000];
21     static DMACh& ipu1dma = (DMACh&)eeHw[0xb400];
22    
23     struct IPUStatus {
24     bool InProgress;
25     u8 DMAMode;
26     bool DMAFinished;
27     bool IRQTriggered;
28     u8 TagFollow;
29     u32 TagAddr;
30     bool stalled;
31     u8 ChainMode;
32     u32 NextMem;
33     };
34    
35     #define DMA_MODE_NORMAL 0
36     #define DMA_MODE_CHAIN 1
37    
38     #define IPU1_TAG_FOLLOW 0
39     #define IPU1_TAG_QWC 1
40     #define IPU1_TAG_ADDR 2
41     #define IPU1_TAG_NONE 3
42    
43     union tIPU_DMA
44     {
45     struct
46     {
47     bool GIFSTALL : 1;
48     bool TIE0 :1;
49     bool TIE1 : 1;
50     bool ACTV1 : 1;
51     bool DOTIE1 : 1;
52     bool FIREINT0 : 1;
53     bool FIREINT1 : 1;
54     bool VIFSTALL : 1;
55     bool SIFSTALL : 1;
56     };
57     u32 _u32;
58    
59     tIPU_DMA( u32 val ){ _u32 = val; }
60     tIPU_DMA() { }
61    
62     bool test(u32 flags) const { return !!(_u32 & flags); }
63     void set_flags(u32 flags) { _u32 |= flags; }
64     void clear_flags(u32 flags) { _u32 &= ~flags; }
65     void reset() { _u32 = 0; }
66     wxString desc() const
67     {
68     wxString temp(L"g_nDMATransfer[");
69    
70     if (GIFSTALL) temp += L" GIFSTALL ";
71     if (TIE0) temp += L" TIE0 ";
72     if (TIE1) temp += L" TIE1 ";
73     if (ACTV1) temp += L" ACTV1 ";
74     if (DOTIE1) temp += L" DOTIE1 ";
75     if (FIREINT0) temp += L" FIREINT0 ";
76     if (FIREINT1) temp += L" FIREINT1 ";
77     if (VIFSTALL) temp += L" VIFSTALL ";
78     if (SIFSTALL) temp += L" SIFSTALL ";
79    
80     temp += L"]";
81     return temp;
82     }
83     };
84    
85     extern void ipu0Interrupt();
86     extern void ipu1Interrupt();
87    
88     extern void dmaIPU0();
89     extern void dmaIPU1();
90 william 280 extern void IPU0dma();
91 william 62 extern int IPU1dma();
92    
93     extern void ipuDmaReset();

  ViewVC Help
Powered by ViewVC 1.1.22