diff --git a/src/cart.h b/src/cart.h index 2723b28..80430dd 100644 --- a/src/cart.h +++ b/src/cart.h @@ -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 diff --git a/src/cheat.h b/src/cheat.h index c951d82..b612888 100644 --- a/src/cheat.h +++ b/src/cheat.h @@ -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 diff --git a/src/crc32.h b/src/crc32.h index 892dac2..c035968 100644 --- a/src/crc32.h +++ b/src/crc32.h @@ -1 +1,6 @@ +#ifndef _FCEU_CRC32_H +#define _FCEU_CRC32_H + uint32 CalcCRC32(uint32 crc, uint8 *buf, uint32 len); + +#endif diff --git a/src/debug.h b/src/debug.h index 3826d0f..bfb481a 100644 --- a/src/debug.h +++ b/src/debug.h @@ -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 diff --git a/src/drawing.h b/src/drawing.h index 5b6772e..6a8a4f4 100644 --- a/src/drawing.h +++ b/src/drawing.h @@ -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 diff --git a/src/driver.h b/src/driver.h index de1ff96..ebb7387 100644 --- a/src/driver.h +++ b/src/driver.h @@ -1,3 +1,6 @@ +#ifndef _FCEU_DRIVER_H +#define _FCEU_DRIVER_H + #include #ifdef __cplusplus @@ -248,3 +251,5 @@ int FCEUI_DatachSet(const uint8 *rcode); } #endif + +#endif diff --git a/src/drivers/libretro/libretro.c b/src/drivers/libretro/libretro.c index 84184fd..ac671c0 100644 --- a/src/drivers/libretro/libretro.c +++ b/src/drivers/libretro/libretro.c @@ -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; } diff --git a/src/fceu-types.h b/src/fceu-types.h index 4f914df..8283605 100644 --- a/src/fceu-types.h +++ b/src/fceu-types.h @@ -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 typedef int8_t int8; diff --git a/src/fceu.h b/src/fceu.h index 1f2f2c2..6d4f2d8 100644 --- a/src/fceu.h +++ b/src/fceu.h @@ -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 diff --git a/src/fceustr.h b/src/fceustr.h index aedb289..cebf441 100644 --- a/src/fceustr.h +++ b/src/fceustr.h @@ -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 diff --git a/src/fcoeffs.h b/src/fcoeffs.h index d4b9ddc..c5f4199 100644 --- a/src/fcoeffs.h +++ b/src/fcoeffs.h @@ -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 diff --git a/src/fds.h b/src/fds.h index 2f9744d..a07dbba 100644 --- a/src/fds.h +++ b/src/fds.h @@ -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 diff --git a/src/file.h b/src/file.h index 4196327..b0c0aec 100644 --- a/src/file.h +++ b/src/file.h @@ -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 diff --git a/src/filter.h b/src/filter.h index 90a7cd7..ca31e7e 100644 --- a/src/filter.h +++ b/src/filter.h @@ -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 diff --git a/src/general.h b/src/general.h index 880623c..4225b4f 100644 --- a/src/general.h +++ b/src/general.h @@ -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 diff --git a/src/git.h b/src/git.h index 8b9bdd4..3645168 100644 --- a/src/git.h +++ b/src/git.h @@ -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 diff --git a/src/ines-bad.h b/src/ines-bad.h index 179ab01..a27b8dc 100644 --- a/src/ines-bad.h +++ b/src/ines-bad.h @@ -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 diff --git a/src/ines-correct.h b/src/ines-correct.h index 15931f8..2a6898d 100644 --- a/src/ines-correct.h +++ b/src/ines-correct.h @@ -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 diff --git a/src/ines.c b/src/ines.c index fbe2691..672be0a 100644 --- a/src/ines.c +++ b/src/ines.c @@ -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) diff --git a/src/ines.h b/src/ines.h index 3862657..1c9ca00 100644 --- a/src/ines.h +++ b/src/ines.h @@ -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 diff --git a/src/input.h b/src/input.h index 1c80afc..0dcaa06 100644 --- a/src/input.h +++ b/src/input.h @@ -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 diff --git a/src/movie.h b/src/movie.h index 5742d0d..2976468 100644 --- a/src/movie.h +++ b/src/movie.h @@ -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 diff --git a/src/netplay.h b/src/netplay.h index 5c319a9..3837ede 100644 --- a/src/netplay.h +++ b/src/netplay.h @@ -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 diff --git a/src/nsf.h b/src/nsf.h index 37af219..17b65d4 100644 --- a/src/nsf.h +++ b/src/nsf.h @@ -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 diff --git a/src/ops.h b/src/ops.h index 7f30c60..cdba4f4 100644 --- a/src/ops.h +++ b/src/ops.h @@ -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 diff --git a/src/palette.h b/src/palette.h index a6b16d2..2dbda31 100644 --- a/src/palette.h +++ b/src/palette.h @@ -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 diff --git a/src/ppu.h b/src/ppu.h index 42f112c..03b51b7 100644 --- a/src/ppu.h +++ b/src/ppu.h @@ -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 diff --git a/src/pputile.h b/src/pputile.h index b31c3ba..ce68aa6 100644 --- a/src/pputile.h +++ b/src/pputile.h @@ -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 diff --git a/src/ppuview.h b/src/ppuview.h index f072e30..e905060 100644 --- a/src/ppuview.h +++ b/src/ppuview.h @@ -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 diff --git a/src/sound.h b/src/sound.h index 70183f1..3183540 100644 --- a/src/sound.h +++ b/src/sound.h @@ -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 diff --git a/src/unif.h b/src/unif.h index 7f53983..b64f06d 100644 --- a/src/unif.h +++ b/src/unif.h @@ -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 diff --git a/src/video.h b/src/video.h index 5e74910..7b042bd 100644 --- a/src/video.h +++ b/src/video.h @@ -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 diff --git a/src/vsuni.h b/src/vsuni.h index 28e89ae..8457bb7 100644 --- a/src/vsuni.h +++ b/src/vsuni.h @@ -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 diff --git a/src/wave.h b/src/wave.h index 791b407..b8afc09 100644 --- a/src/wave.h +++ b/src/wave.h @@ -1 +1,6 @@ +#ifndef _FCEU_WAVE_H +#define _FCEU_WAVE_H + void FCEU_WriteWaveData(int32 *Buffer, int Count); + +#endif diff --git a/src/x6502.h b/src/x6502.h index a259ac2..0e9813f 100644 --- a/src/x6502.h +++ b/src/x6502.h @@ -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 diff --git a/src/x6502struct.h b/src/x6502struct.h index e8a3094..fec3003 100644 --- a/src/x6502struct.h +++ b/src/x6502struct.h @@ -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