2006-07-18 02:53:36 +00:00
|
|
|
/* FCE Ultra - NES/Famicom Emulator
|
|
|
|
*
|
|
|
|
* Copyright notice for this file:
|
|
|
|
* Copyright (C) 2001 Aaron Oneal
|
|
|
|
* Copyright (C) 2002 Xodnizel
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2006-07-18 03:58:09 +00:00
|
|
|
*/
|
2006-07-18 02:53:36 +00:00
|
|
|
|
|
|
|
#ifndef __FCEU_TYPES
|
|
|
|
#define __FCEU_TYPES
|
|
|
|
|
2006-07-24 00:26:07 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
2006-07-18 06:35:48 +00:00
|
|
|
#define FCEU_VERSION_NUMERIC 9816
|
2006-07-20 02:02:10 +00:00
|
|
|
#define FCEU_NAME "FCEUX"
|
2006-07-18 03:58:09 +00:00
|
|
|
#define FCEU_VERSION_STRING "1.07"
|
2006-07-20 02:02:10 +00:00
|
|
|
#define FCEU_NAME_AND_VERSION FCEU_NAME " " FCEU_VERSION_STRING
|
2006-07-18 06:35:48 +00:00
|
|
|
//#define FCEU_VERSION_STRING "1.07"
|
|
|
|
//#define FCEU_VERSION "0.98.17"
|
|
|
|
//#define FCEUXD_VERSION_STRING "1.0a"
|
|
|
|
//#define FCEUXDSP_VERSION_STRING "1.07"
|
2006-07-18 03:58:09 +00:00
|
|
|
|
2006-07-24 05:34:50 +00:00
|
|
|
//causes the code fragment argument to be compiled in if the build includes debugging
|
|
|
|
#ifdef FCEUDEF_DEBUGGER
|
|
|
|
#define DEBUG(X) X;
|
|
|
|
#else
|
|
|
|
#define DEBUG(X)
|
|
|
|
#endif
|
|
|
|
|
2006-07-18 03:58:09 +00:00
|
|
|
#ifdef MSVC
|
|
|
|
typedef unsigned char uint8;
|
|
|
|
typedef unsigned short uint16;
|
2006-07-18 06:35:48 +00:00
|
|
|
typedef unsigned int uint32;
|
2006-07-18 03:58:09 +00:00
|
|
|
typedef signed char int8;
|
|
|
|
typedef signed short int16;
|
2006-07-18 06:35:48 +00:00
|
|
|
typedef signed int int32;
|
2006-07-18 03:58:09 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <io.h>
|
2006-07-18 06:35:48 +00:00
|
|
|
#include <direct.h>
|
|
|
|
#include <malloc.h>
|
2006-07-18 03:58:09 +00:00
|
|
|
#define dup _dup
|
|
|
|
#define stat _stat
|
|
|
|
#define fstat _fstat
|
2006-07-18 06:35:48 +00:00
|
|
|
#define mkdir _mkdir
|
2006-07-24 00:26:07 +00:00
|
|
|
#define alloca _alloca
|
2006-07-18 03:58:09 +00:00
|
|
|
#define W_OK 2
|
|
|
|
#define R_OK 2
|
|
|
|
#define X_OK 1
|
|
|
|
#define F_OK 0
|
|
|
|
#else
|
2006-07-24 00:26:07 +00:00
|
|
|
|
|
|
|
//mingw32 doesnt prototype this for some reason
|
|
|
|
#ifdef __MINGW32__
|
|
|
|
void *alloca(size_t);
|
|
|
|
#endif
|
|
|
|
|
2006-07-18 03:58:09 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <unistd.h>
|
2006-07-18 02:53:36 +00:00
|
|
|
#include <inttypes.h>
|
|
|
|
typedef int8_t int8;
|
|
|
|
typedef int16_t int16;
|
2006-07-18 03:58:09 +00:00
|
|
|
typedef int32_t int32;
|
2006-07-18 02:53:36 +00:00
|
|
|
|
2006-07-18 03:58:09 +00:00
|
|
|
typedef uint8_t uint8;
|
2006-07-18 02:53:36 +00:00
|
|
|
typedef uint16_t uint16;
|
|
|
|
typedef uint32_t uint32;
|
2006-07-18 03:58:09 +00:00
|
|
|
#endif
|
2006-07-18 02:53:36 +00:00
|
|
|
|
|
|
|
#ifdef __GNUC__
|
|
|
|
typedef unsigned long long uint64;
|
|
|
|
typedef long long int64;
|
|
|
|
#define INLINE inline
|
|
|
|
#define GINLINE inline
|
|
|
|
#elif MSVC
|
|
|
|
typedef __int64 int64;
|
|
|
|
typedef unsigned __int64 uint64;
|
2006-07-18 03:58:09 +00:00
|
|
|
#define __restrict__
|
2006-07-18 02:53:36 +00:00
|
|
|
#define INLINE __inline
|
2006-07-18 03:58:09 +00:00
|
|
|
#define GINLINE /* Can't declare a function INLINE
|
2006-07-18 02:53:36 +00:00
|
|
|
and global in MSVC. Bummer.
|
|
|
|
*/
|
2006-07-18 03:58:09 +00:00
|
|
|
#define PSS_STYLE 2 /* Does MSVC compile for anything
|
2006-07-18 02:53:36 +00:00
|
|
|
other than Windows/DOS targets?
|
|
|
|
*/
|
2006-07-18 03:58:09 +00:00
|
|
|
|
|
|
|
#if _MSC_VER >= 1300
|
|
|
|
#pragma warning(disable:4244) //warning C4244: '=' : conversion from 'uint32' to 'uint8', possible loss of data
|
|
|
|
#pragma warning(disable:4996) //'strdup' was declared deprecated
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if _MSC_VER < 1400
|
|
|
|
#define vsnprintf _vsnprintf
|
|
|
|
#endif
|
2006-07-18 02:53:36 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if PSS_STYLE==2
|
|
|
|
|
|
|
|
#define PSS "\\"
|
|
|
|
#define PS '\\'
|
|
|
|
|
|
|
|
#elif PSS_STYLE==1
|
|
|
|
|
|
|
|
#define PSS "/"
|
|
|
|
#define PS '/'
|
|
|
|
|
|
|
|
#elif PSS_STYLE==3
|
|
|
|
|
|
|
|
#define PSS "\\"
|
|
|
|
#define PS '\\'
|
|
|
|
|
|
|
|
#elif PSS_STYLE==4
|
|
|
|
|
2006-07-18 03:58:09 +00:00
|
|
|
#define PSS ":"
|
2006-07-18 02:53:36 +00:00
|
|
|
#define PS ':'
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __GNUC__
|
|
|
|
#ifdef C80x86
|
|
|
|
#define FASTAPASS(x) __attribute__((regparm(x)))
|
|
|
|
#define FP_FASTAPASS FASTAPASS
|
|
|
|
#else
|
2006-07-18 03:58:09 +00:00
|
|
|
#define FASTAPASS(x)
|
|
|
|
#define FP_FASTAPASS(x)
|
2006-07-18 02:53:36 +00:00
|
|
|
#endif
|
|
|
|
#elif MSVC
|
|
|
|
#define FP_FASTAPASS(x)
|
2006-07-18 06:35:48 +00:00
|
|
|
#define FASTAPASS(x)
|
2006-07-18 02:53:36 +00:00
|
|
|
#else
|
|
|
|
#define FP_FASTAPASS(x)
|
|
|
|
#define FASTAPASS(x)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef void (FP_FASTAPASS(2) *writefunc)(uint32 A, uint8 V);
|
|
|
|
typedef uint8 (FP_FASTAPASS(1) *readfunc)(uint32 A);
|
|
|
|
#endif
|