Add header guards

This commit is contained in:
twinaphex
2014-03-30 22:50:28 +02:00
parent 73bf72aa6c
commit d4a3125c44
36 changed files with 152 additions and 8 deletions

View File

@@ -1,3 +1,6 @@
#ifndef _FCEU_CART_H
#define _FCEU_CART_H
typedef struct {
// Set by mapper/board code:
void (*Power)(void);
@@ -88,3 +91,5 @@ void FCEU_GeniePower(void);
void FCEU_OpenGenie(void);
void FCEU_CloseGenie(void);
void FCEU_KillGenie(void);
#endif

View File

@@ -1,3 +1,6 @@
#ifndef _FCEU_CHEAT_H
#define _FCEU_CHEAT_H
void FCEU_CheatResetRAM(void);
void FCEU_CheatAddRAM(int s, uint32 A, uint8 *p);
@@ -5,3 +8,5 @@ void FCEU_LoadGameCheats(FILE *override);
void FCEU_FlushGameCheats(FILE *override, int nosave);
void FCEU_ApplyPeriodicCheats(void);
void FCEU_PowerCheats(void);
#endif

View File

@@ -1 +1,6 @@
#ifndef _FCEU_CRC32_H
#define _FCEU_CRC32_H
uint32 CalcCRC32(uint32 crc, uint8 *buf, uint32 len);
#endif

View File

@@ -1,3 +1,6 @@
#ifndef _FCEU_DEBUG_H
#define _FCEU_DEBUG_H
void FCEUI_DumpMem(const char *fname, uint32 start, uint32 end);
void FCEUI_DumpVid(const char *fname, uint32 start, uint32 end);
void FCEUI_LoadMem(const char *fname, uint32 start, int hl);
@@ -23,3 +26,5 @@ int FCEUI_SetBreakPoint(uint32 w, int type, unsigned int A1, unsigned int A2,
int FCEUI_AddBreakPoint(int type, unsigned int A1, unsigned int A2,
void (*Handler)(X6502 *, int type, unsigned int A));
#endif
#endif

View File

@@ -1,3 +1,6 @@
#ifndef _FCEU_DRAWING_H
#define _FCEU_DRAWING_H
void DrawTextLineBG(uint8 *dest) {
int x, y;
static int otable[7] = { 81, 49, 30, 17, 8, 3, 0 };
@@ -220,3 +223,5 @@ void FCEU_DrawNumberRow(uint8 *XBuf, int *nstatus, int cur) {
}
}
#endif

View File

@@ -1,3 +1,6 @@
#ifndef _FCEU_DRIVER_H
#define _FCEU_DRIVER_H
#include <stdio.h>
#ifdef __cplusplus
@@ -248,3 +251,5 @@ int FCEUI_DatachSet(const uint8 *rcode);
}
#endif
#endif

View File

@@ -429,7 +429,7 @@ void retro_get_system_info(struct retro_system_info *info)
{
info->need_fullpath = true;
info->valid_extensions = "fds|nes|unif";
info->library_version = "98.13mm (SVN)";
info->library_version = "(SVN)";
info->library_name = "FCEUmm";
info->block_extract = false;
}

View File

@@ -19,8 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __FCEU_TYPES
#define __FCEU_TYPES
#ifndef __FCEU_TYPES_H
#define __FCEU_TYPES_H
#include <inttypes.h>
typedef int8_t int8;

View File

@@ -1,4 +1,5 @@
#ifndef _FCEUH
#define _FCEUH
#include "fceu-types.h"
@@ -103,6 +104,5 @@ extern uint8 vsdip;
#define JOY_DOWN 0x20
#define JOY_LEFT 0x40
#define JOY_RIGHT 0x80
#else
#define _FCEUH
#endif

View File

@@ -1,4 +1,9 @@
#ifndef _FCEU_STR_H
#define _FCEU_STR_H
typedef struct {
uint8 *data;
uint32 len; /* Not including extra NULL character. */
} fceustr;
#endif

View File

@@ -1,3 +1,6 @@
#ifndef _FCEU_FCOEFFS_H
#define _FCEU_FCOEFFS_H
#define SQ2NCOEFFS 1024
static int32 sq2coeffs[SQ2NCOEFFS];
@@ -1587,3 +1590,5 @@ static int32 C44100PAL[NCOEFFS / 2] =
/*240*/, 65536 * 16 * 0.02024878178965319
/*241*/, 65536 * 16 * 0.020277449712345474
};
#endif

View File

@@ -1,3 +1,6 @@
#ifndef _FCEU_FDS_H
#define _FCEU_FDS_H
void FDSSoundReset(void);
void FCEU_FDSInsert(int oride);
@@ -5,3 +8,5 @@ void FCEU_FDSEject(void);
void FCEU_FDSSelect(void);
extern uint32 lastDiskPtrRead, lastDiskPtrWrite;
#endif

View File

@@ -1,3 +1,6 @@
#ifndef _FCEU_FILE_H
#define _FCEU_FILE_H
typedef struct {
void *fp; // FILE* or ptr to ZIPWRAP
uint32 type; // 0=normal file, 1=gzip, 2=zip
@@ -16,3 +19,4 @@ int FCEU_fgetc(FCEUFILE*);
uint64 FCEU_fgetsize(FCEUFILE*);
int FCEU_fisarchive(FCEUFILE*);
#endif

View File

@@ -1,3 +1,8 @@
#ifndef _FCEU_FILTER_H
#define _FCEU_FILTER_H
int32 NeoFilterSound(int32 *in, int32 *out, uint32 inlen, int32 *leftover);
void MakeFilters(int32 rate);
void SexyFilter(int32 *in, int32 *out, int32 count);
#endif

View File

@@ -1,3 +1,6 @@
#ifndef _FCEU_GENERAL_H
#define _FCEU_GENERAL_H
void GetFileBase(const char *f);
extern uint32 uppow2(uint32 n);
@@ -15,3 +18,5 @@ char *FCEU_MakeFName(int type, int id1, char *cd1);
#define FCEUMKF_MOVIE 10
#define FCEUMKF_NPTEMP 11
#define FCEUCOPY_FAMI 12
#endif

View File

@@ -1,5 +1,6 @@
#ifndef __FCEU_GIT
#define __FCEU_GIT
/* Mmm...git. Almost as funny as "gimp". */
#define GIT_CART 0 /* Cart. */
#define GIT_VSUNI 1 /* VS Unisystem. */
@@ -25,4 +26,5 @@ typedef struct {
int soundrate; /* For Ogg Vorbis expansion sound wacky support. 0 for default. */
int soundchan; /* Number of sound channels. */
} FCEUGI;
#endif

View File

@@ -1,3 +1,6 @@
#ifndef _FCEU_INES_BAD_H
#define _FCEU_INES_BAD_H
{ 0xecf78d8a13a030a6LL, "Ai Sensei no Oshiete", INESB_HACKED },
{ 0x4712856d3e12f21fLL, "Akumajou Densetsu", INESB_HACKED },
{ 0x10f90ba5bd55c22eLL, "Alien Syndrome", INESB_HACKED },
@@ -38,3 +41,5 @@
{ 0x7979dc51da86f19fLL, "110-in-1", INESB_CORRUPT },
{ 0x001c0bb9c358252aLL, "110-in-1", INESB_CORRUPT },
{ 0, 0, 0 }
#endif

View File

@@ -1,3 +1,5 @@
#ifndef _FCEU_INES_CORRECT_H
#define _FCEU_INES_CORRECT_H
{0xaf5d7aa2, -1, 0}, /* Clu Clu Land */
{0xcfb224e6, -1, 1}, /* Dragon Ninja (J) [p1][!].nes */
@@ -258,3 +260,5 @@
{0x57514c6c, 245, -1}, /* Yong Zhe Dou E Long - Dragon Quest VI (Ch) */
{0x00000000, -1, -1}
#endif

View File

@@ -654,7 +654,7 @@ static BMAPPINGLocal bmap[] = {
{"", 0, NULL}
};
int iNESLoad(const uint8 *name, FCEUFILE *fp) {
int iNESLoad(const char *name, FCEUFILE *fp) {
struct md5_context md5;
if (FCEU_fread(&head, 1, 16, fp) != 16)

View File

@@ -19,6 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _FCEU_INES_H
#define _FCEU_INES_H
typedef struct {
char ID[4]; /*NES^Z*/
uint8 ROM_size;
@@ -209,3 +212,5 @@ void Mapper250_Init(CartInfo *);
void Mapper252_Init(CartInfo *);
void Mapper253_Init(CartInfo *);
void Mapper254_Init(CartInfo *);
#endif

View File

@@ -1,3 +1,6 @@
#ifndef _FCEU_INPUT_H
#define _FCEU_INPUT_H
typedef struct {
uint8 FP_FASTAPASS(1) (*Read)(int w);
void FP_FASTAPASS(1) (*Write)(uint8 v);
@@ -24,3 +27,4 @@ extern void (*InputScanlineHook)(uint8 *bg, uint8 *spr, uint32 linets, int final
void FCEU_DoSimpleCommand(int cmd);
#endif

View File

@@ -1,3 +1,6 @@
#ifndef _FCEU_MOVIE_H
#define _FCEU_MOVIE_H
void FCEUMOV_AddJoy(uint8 *);
void FCEUMOV_CheckMovies(void);
void FCEUMOV_Stop(void);
@@ -5,3 +8,4 @@ void FCEUMOV_AddCommand(int cmd);
void FCEU_DrawMovies(uint8 *);
int FCEUMOV_IsPlaying(void);
#endif

View File

@@ -1,3 +1,6 @@
#ifndef _FCEU_NETPLAY_H
#define _FCEU_NETPLAY_H
int InitNetplay(void);
void NetplayUpdate(uint8 *joyp);
extern int FCEUnetplay;
@@ -21,3 +24,5 @@ extern int FCEUnetplay;
int FCEUNET_SendCommand(uint8, uint32);
int FCEUNET_SendFile(uint8 cmd, char *);
#endif

View File

@@ -18,6 +18,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _FCEU_NSF_H
#define _FCEU_NSF_H
typedef struct {
char ID[5]; // NESM^Z
uint8 Version;
@@ -45,3 +48,5 @@ void DrawNSF(uint8 *XBuf);
void NSFDealloc(void);
void NSFDodo(void);
void DoNSFFrame(void);
#endif

View File

@@ -18,6 +18,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _FCEU_OPS_H
#define _FCEU_OPS_H
case 0x00: /* BRK */
_PC++;
PUSH(_PC>>8);
@@ -483,3 +486,5 @@ case 0xFC: LD_ABX(;);
/* XAA - BIG QUESTION MARK HERE */
case 0x8B: _A|=0xEE; _A&=_X; LD_IM(AND);
//endif
//
#endif

View File

@@ -1,3 +1,6 @@
#ifndef _FCEU_PALETTE_H
#define _FCEU_PALETTE_H
typedef struct {
uint8 r, g, b;
} pal;
@@ -9,3 +12,5 @@ void FCEU_ResetPalette(void);
void FCEU_ResetMessages();
void FCEU_LoadGamePalette(void);
void FCEU_DrawNTSCControlBars(uint8 *XBuf);
#endif

View File

@@ -1,3 +1,6 @@
#ifndef _FCEU_PPU_H
#define _FCEU_PPU_H
void FCEUPPU_Init(void);
void FCEUPPU_Reset(void);
void FCEUPPU_Power(void);
@@ -18,3 +21,5 @@ void FCEUPPU_SaveState(void);
void FCEUPPU_LoadState(int version);
extern int scanline;
#endif

View File

@@ -1,3 +1,6 @@
#ifndef _FCEU_PPU_TILE_H
#define _FCEU_PPU_TILE_H
uint8 *C;
register uint8 cc;
uint32 vadr;
@@ -107,3 +110,5 @@ else
PPU_hook(0x2000 | (RefreshAddr & 0xfff));
#endif
#endif

View File

@@ -1,3 +1,6 @@
#ifndef _FCEU_PPUVIEW_H
#define _FCEU_PPUVIEW_H
extern int PPUViewScanline;
extern int PPUViewer;
extern int scanline;
@@ -6,3 +9,5 @@ void PPUViewDoBlit();
void DoPPUView();
void UpdatePPUView(int refreshchr);
#endif

View File

@@ -18,6 +18,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _FCEU_SOUND_H
#define _FCEU_SOUND_H
typedef struct {
void (*Fill)(int Count); /* Low quality ext sound. */
@@ -60,3 +63,5 @@ void FCEUSND_SaveState(void);
void FCEUSND_LoadState(int version);
void FASTAPASS(1) FCEU_SoundCPUHook(int);
#endif

View File

@@ -18,6 +18,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _FCEU_UNIF_H
#define _FCEU_UNIF_H
void AC08_Init(CartInfo *info);
void ANROM_Init(CartInfo *info);
void BMC11160_Init(CartInfo *info);
@@ -150,3 +153,5 @@ void MapperCopyFami_Init(CartInfo *info);
extern uint8 *UNIFchrrama; // Meh. So I can stop CHR RAM
// bank switcherooing with certain boards...
#endif

View File

@@ -1,5 +1,10 @@
#ifndef _FCEU_VIDEO_H
#define _FCEU_VIDEO_H
int FCEU_InitVirtualVideo(void);
void FCEU_KillVirtualVideo(void);
int SaveSnapshot(void);
extern uint8 *XBuf;
void FCEU_DrawNumberRow(uint8 *XBuf, int *nstatus, int cur);
#endif

View File

@@ -1,3 +1,6 @@
#ifndef _FCEU_VSUNI_H
#define _FCEU_VSUNI_H
void FCEU_VSUniPower(void);
void FCEU_VSUniCheck(uint64 md5partial, int *, uint8 *);
void FCEU_VSUniDraw(uint8 *XBuf);
@@ -5,3 +8,5 @@ void FCEU_VSUniDraw(uint8 *XBuf);
void FCEU_VSUniToggleDIP(int); /* For movies and netplay */
void FCEU_VSUniCoin(void);
void FCEU_VSUniSwap(uint8 *j0, uint8 *j1);
#endif

View File

@@ -1 +1,6 @@
#ifndef _FCEU_WAVE_H
#define _FCEU_WAVE_H
void FCEU_WriteWaveData(int32 *Buffer, int Count);
#endif

View File

@@ -19,6 +19,7 @@
*/
#ifndef _X6502H
#define _X6502H
#include "x6502struct.h"
@@ -72,5 +73,4 @@ void FASTAPASS(2) X6502_DMW(uint32 A, uint8 V);
void FASTAPASS(1) X6502_IRQBegin(int w);
void FASTAPASS(1) X6502_IRQEnd(int w);
#define _X6502H
#endif

View File

@@ -1,4 +1,5 @@
#ifndef _X6502STRUCTH
#define _X6502STRUCTH
typedef struct __X6502 {
int32 tcount; /* Temporary cycle counter */
@@ -21,5 +22,5 @@ typedef struct __X6502 {
void (*WriteHook)(struct __X6502 *, uint32, uint8);
#endif
} X6502;
#define _X6502STRUCTH
#endif