fix x86 build
[pcsx_rearmed.git] / libpcsxcore / sio.h
1 /***************************************************************************
2  *   Copyright (C) 2007 Ryan Schultz, PCSX-df Team, PCSX team              *
3  *                                                                         *
4  *   This program is free software; you can redistribute it and/or modify  *
5  *   it under the terms of the GNU General Public License as published by  *
6  *   the Free Software Foundation; either version 2 of the License, or     *
7  *   (at your option) any later version.                                   *
8  *                                                                         *
9  *   This program is distributed in the hope that it will be useful,       *
10  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12  *   GNU General Public License for more details.                          *
13  *                                                                         *
14  *   You should have received a copy of the GNU General Public License     *
15  *   along with this program; if not, write to the                         *
16  *   Free Software Foundation, Inc.,                                       *
17  *   51 Franklin Street, Fifth Floor, Boston, MA 02111-1307 USA.           *
18  ***************************************************************************/
19
20
21 #ifndef _SIO_H_
22 #define _SIO_H_
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 #include "psxcommon.h"
29 #include "r3000a.h"
30 #include "psxmem.h"
31 #include "plugins.h"
32 #include "psemu_plugin_defs.h"
33
34 #define MCD_SIZE        (1024 * 8 * 16)
35
36 extern char Mcd1Data[MCD_SIZE], Mcd2Data[MCD_SIZE];
37 extern char McdDisable[2];
38
39 void sioWrite8(unsigned char value);
40 void sioWriteStat16(unsigned short value);
41 void sioWriteMode16(unsigned short value);
42 void sioWriteCtrl16(unsigned short value);
43 void sioWriteBaud16(unsigned short value);
44
45 unsigned char sioRead8();
46 unsigned short sioReadStat16();
47 unsigned short sioReadMode16();
48 unsigned short sioReadCtrl16();
49 unsigned short sioReadBaud16();
50
51 void netError();
52
53 void sioInterrupt();
54 int sioFreeze(void *f, int Mode);
55
56 void LoadMcd(int mcd, char *str);
57 void LoadMcds(char *mcd1, char *mcd2);
58 void SaveMcd(char *mcd, char *data, uint32_t adr, int size);
59 void CreateMcd(char *mcd);
60 void ConvertMcd(char *mcd, char *data);
61
62 typedef struct {
63         char Title[48 + 1]; // Title in ASCII
64         char sTitle[48 * 2 + 1]; // Title in Shift-JIS
65         char ID[12 + 1];
66         char Name[16 + 1];
67         int IconCount;
68         short Icon[16 * 16 * 3];
69         unsigned char Flags;
70 } McdBlock;
71
72 void GetMcdBlockInfo(int mcd, int block, McdBlock *info);
73
74 #ifdef __cplusplus
75 }
76 #endif
77 #endif