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(__gamecube__) || defined (__wii__)
45  #include <gctypes.h>
46  #include <ogc/disc_io.h>
47  #include <gccore.h>
48 #elif defined(NDS)
49  #include <nds/ndstypes.h>
50  #include <nds/system.h>
51  #include <nds/disc_io.h>
52 #elif defined(GBA)
53  #include <gba_types.h>
54  #include <disc_io.h>
55 #endif
56 
57 // Platform specific options
58 #if defined (__wii__)
59  #define DEFAULT_CACHE_PAGES 4
60  #define DEFAULT_SECTORS_PAGE 64
61  #define USE_LWP_LOCK
62  #define USE_RTC_TIME
63 #elif defined (__gamecube__)
64  #define DEFAULT_CACHE_PAGES 4
65  #define DEFAULT_SECTORS_PAGE 64
66  #define USE_LWP_LOCK
67  #define USE_RTC_TIME
68 #elif defined (NDS)
69  #define DEFAULT_CACHE_PAGES 16
70  #define DEFAULT_SECTORS_PAGE 8
71  #define USE_RTC_TIME
72 #elif defined (GBA)
73  #define DEFAULT_CACHE_PAGES 2
74  #define DEFAULT_SECTORS_PAGE 8
75  #define LIMIT_SECTORS 128
76 #endif
77 
78 #endif // _COMMON_H
Core header which includes all subsequent subsystem headers.
Data type definitions.