/[pcsx2_0.9.7]/trunk/pcsx2/IopHw.cpp
ViewVC logotype

Annotation of /trunk/pcsx2/IopHw.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 62 - (hide annotations) (download)
Tue Sep 7 11:08:22 2010 UTC (10 years ago) by william
File size: 2153 byte(s)
Auto Commited Import of: pcsx2-0.9.7-r3738-debug in ./trunk
1 william 31 /* 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    
17     #include "PrecompiledHeader.h"
18     #include "IopCommon.h"
19    
20     #include "iR5900.h"
21     #include "Sio.h"
22    
23     // NOTE: Any modifications to read/write fns should also go into their const counterparts
24     // found in iPsxHw.cpp.
25    
26     void psxHwReset() {
27     /* if (Config.Sio) psxHu32(0x1070) |= 0x80;
28     if (Config.SpuIrq) psxHu32(0x1070) |= 0x200;*/
29    
30     memzero_ptr<0x10000>(psxH);
31    
32     // mdecInit(); //initialize mdec decoder
33     cdrReset();
34     cdvdReset();
35     psxRcntInit();
36     sioInit();
37     //sio2Reset();
38     }
39    
40 william 62 __fi u8 psxHw4Read8(u32 add)
41 william 31 {
42     u16 mem = add & 0xFF;
43     u8 ret = cdvdRead(mem);
44     PSXHW_LOG("HwRead8 from Cdvd [segment 0x1f40], addr 0x%02x = 0x%02x", mem, ret);
45     return ret;
46     }
47    
48 william 62 __fi void psxHw4Write8(u32 add, u8 value)
49 william 31 {
50     u8 mem = (u8)add; // only lower 8 bits are relevant (cdvd regs mirror across the page)
51     cdvdWrite(mem, value);
52     PSXHW_LOG("HwWrite8 to Cdvd [segment 0x1f40], addr 0x%02x = 0x%02x", mem, value);
53     }
54    
55     void psxDmaInterrupt(int n)
56     {
57     if (HW_DMA_ICR & (1 << (16 + n)))
58     {
59     HW_DMA_ICR|= (1 << (24 + n));
60     psxRegs.CP0.n.Cause |= 1 << (9 + n);
61     iopIntcIrq( 3 );
62     }
63     }
64    
65     void psxDmaInterrupt2(int n)
66     {
67     if (HW_DMA_ICR2 & (1 << (16 + n)))
68     {
69     /* if (HW_DMA_ICR2 & (1 << (24 + n))) {
70     Console.WriteLn("*PCSX2*: HW_DMA_ICR2 n=%d already set", n);
71     }
72     if (psxHu32(0x1070) & 8) {
73     Console.WriteLn("*PCSX2*: psxHu32(0x1070) 8 already set (n=%d)", n);
74     }*/
75     HW_DMA_ICR2|= (1 << (24 + n));
76     psxRegs.CP0.n.Cause |= 1 << (16 + n);
77     iopIntcIrq( 3 );
78     }
79     }

  ViewVC Help
Powered by ViewVC 1.1.22