/[pcsx2_0.9.7]/trunk/pcsx2/Sio.h
ViewVC logotype

Annotation of /trunk/pcsx2/Sio.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 31 - (hide annotations) (download)
Tue Sep 7 03:24:11 2010 UTC (9 years, 5 months ago) by william
File MIME type: text/plain
File size: 1808 byte(s)
committing r3113 initial commit again...
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     #pragma once
17    
18     // Let's enable this to free the IOP event handler of some considerable load.
19     // Games are highly unlikely to need timed IRQ's for PAD and MemoryCard handling anyway (rama).
20     #define SIO_INLINE_IRQS
21    
22     struct _sio
23     {
24     u16 StatReg;
25     u16 ModeReg;
26     u16 CtrlReg;
27     u16 BaudReg;
28    
29     u8 buf[256];
30     u32 bufcount;
31     u32 parp;
32     u32 mcdst,rdwr;
33     u8 adrH,adrL;
34     u32 padst;
35     u32 mtapst;
36     u32 packetsize;
37    
38     u8 terminator;
39     u8 mode;
40     u8 mc_command;
41     u32 lastsector;
42     u32 sector;
43     u32 k;
44     u32 count;
45    
46     // Active pad slot for each port. Not sure if these automatically reset after each read or not.
47     u8 activePadSlot[2];
48     // Active memcard slot for each port. Not sure if these automatically reset after each read or not.
49     u8 activeMemcardSlot[2];
50    
51     int GetMemcardIndex() const
52     {
53     return (CtrlReg&0x2000) >> 13;
54     }
55    
56     int GetMultitapPort() const
57     {
58     return (CtrlReg&0x2000) >> 13;
59     }
60     };
61    
62     extern _sio sio;
63    
64     extern void sioInit();
65     extern u8 sioRead8();
66     extern void sioWrite8(u8 value);
67     extern void sioWriteCtrl16(u16 value);
68     extern void sioInterrupt();
69     extern void InitializeSIO(u8 value);
70    

  ViewVC Help
Powered by ViewVC 1.1.22