RetroArch
common.h
Go to the documentation of this file.
1 /*
2  common.h
3  Common definitions and included files for the FATlib
4 
5  Copyright (c) 2006 Michael "Chishm" Chisholm
6 
7  Redistribution and use in source and binary forms, with or without modification,
8  are permitted provided that the following conditions are met:
9 
10  1. Redistributions of source code must retain the above copyright notice,
11  this list of conditions and the following disclaimer.
12  2. Redistributions in binary form must reproduce the above copyright notice,
13  this list of conditions and the following disclaimer in the documentation and/or
14  other materials provided with the distribution.
15  3. The name of the author may not be used to endorse or promote products derived
16  from this software without specific prior written permission.
17 
18  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
19  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
20  AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
21  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28 
29 #ifndef _COMMON_H
30 #define _COMMON_H
31 
32 #include <fat.h>
33 #include <stddef.h>
34 #include <stdint.h>
35 
36 /* When compiling for NDS, make sure NDS is defined */
37 #ifndef NDS
38  #if defined ARM9 || defined ARM7
39  #define NDS
40  #endif
41 #endif
42 
43 /* Platform specific includes */
44 #if defined (__wiiu__)
45  #include <iosuhax_disc_interface.h>
46  typedef uint8_t u8;
47  typedef uint16_t u16;
48  typedef int32_t s32;
49  typedef uint32_t u32;
50  typedef int mutex_t;
51 #elif defined(__gamecube__) || defined (__wii__)
52  #include <gctypes.h>
53  #include <ogc/disc_io.h>
54  #include <gccore.h>
55 #elif defined(NDS)
56  #include <nds/ndstypes.h>
57  #include <nds/system.h>
58  #include <nds/disc_io.h>
59 #elif defined(GBA)
60  #include <gba_types.h>
61  #include <disc_io.h>
62 #endif
63 
64 /* Platform specific options */
65 #if defined (__wiiu__)
66  #define DEFAULT_CACHE_PAGES 4
67  #define DEFAULT_SECTORS_PAGE 64
68 #if 0
69 #define USE_LWP_LOCK
70 #define USE_RTC_TIME
71 #endif
72 #elif defined (__wii__)
73  #define DEFAULT_CACHE_PAGES 4
74  #define DEFAULT_SECTORS_PAGE 64
75  #define USE_LWP_LOCK
76  #define USE_RTC_TIME
77 #elif defined (__gamecube__)
78  #define DEFAULT_CACHE_PAGES 4
79  #define DEFAULT_SECTORS_PAGE 64
80  #define USE_LWP_LOCK
81  #define USE_RTC_TIME
82 #elif defined (NDS)
83  #define DEFAULT_CACHE_PAGES 16
84  #define DEFAULT_SECTORS_PAGE 8
85  #define USE_RTC_TIME
86 #elif defined (GBA)
87  #define DEFAULT_CACHE_PAGES 2
88  #define DEFAULT_SECTORS_PAGE 8
89  #define LIMIT_SECTORS 128
90 #endif
91 
92 #endif /* _COMMON_H */
int32_t s32
32bit signed integer
Definition: gctypes.h:24
int mutex_t
typedef for the mutex handle
Definition: lock.c:6
Data type definitions.
Core header which includes all subsequent subsystem headers.
uint16_t u16
16bit unsigned integer
Definition: gctypes.h:18
signed int int32_t
Definition: stdint.h:123
uint8_t u8
8bit unsigned integer
Definition: gctypes.h:17
uint32_t u32
32bit unsigned integer
Definition: gctypes.h:19
unsigned short uint16_t
Definition: stdint.h:125
unsigned char uint8_t
Definition: stdint.h:124
unsigned int uint32_t
Definition: stdint.h:126