| 1 | /* FCE Ultra - NES/Famicom Emulator |
| 2 | * |
| 3 | * Copyright notice for this file: |
| 4 | * Copyright (C) 2001 Aaron Oneal |
| 5 | * Copyright (C) 2002 Ben Parnell |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 2 of the License, or |
| 10 | * (at your option) any later version. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this program; if not, write to the Free Software |
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 20 | */ |
| 21 | |
| 22 | #ifndef __FCEU_TYPES |
| 23 | #define __FCEU_TYPES |
| 24 | |
| 25 | #include <inttypes.h> |
| 26 | typedef int8_t int8; |
| 27 | typedef int16_t int16; |
| 28 | typedef int32_t int32; |
| 29 | |
| 30 | typedef uint8_t uint8; |
| 31 | typedef uint16_t uint16; |
| 32 | typedef uint32_t uint32; |
| 33 | |
| 34 | //typedef unsigned char uint8; |
| 35 | //typedef unsigned short uint16; |
| 36 | //typedef unsigned long uint32; |
| 37 | |
| 38 | #ifdef __GNUC__ |
| 39 | typedef unsigned long long uint64; |
| 40 | typedef long long int64; |
| 41 | #define INLINE inline |
| 42 | #define GINLINE inline |
| 43 | #elif MSVC |
| 44 | typedef __int64 int64; |
| 45 | typedef unsigned __int64 uint64; |
| 46 | #define INLINE __inline |
| 47 | #define GINLINE /* Can't declare a function INLINE |
| 48 | and global in MSVC. Bummer. |
| 49 | */ |
| 50 | #define PSS_STYLE 2 /* Does MSVC compile for anything |
| 51 | other than Windows/DOS targets? |
| 52 | */ |
| 53 | #endif |
| 54 | //typedef signed char int8; |
| 55 | //typedef signed short int16; |
| 56 | //typedef signed long int32; |
| 57 | #define byte uint8 |
| 58 | #define word uint16 |
| 59 | |
| 60 | #ifdef __GNUC__ |
| 61 | #ifdef C80x86 |
| 62 | #define FASTAPASS(x) __attribute__((regparm(x))) |
| 63 | #define FP_FASTAPASS FASTAPASS |
| 64 | #else |
| 65 | #define FASTAPASS(x) |
| 66 | #define FP_FASTAPASS(x) |
| 67 | #endif |
| 68 | #else |
| 69 | #define FP_FASTAPASS(x) |
| 70 | #define FASTAPASS(x) __fastcall |
| 71 | #endif |
| 72 | |
| 73 | typedef void FP_FASTAPASS(2) (*writefunc)(uint32 A, uint8 V); |
| 74 | typedef uint8 FP_FASTAPASS(1) (*readfunc)(uint32 A); |
| 75 | #endif |