From 403f682eb7951cba41a45c4dc618819665bfdca0 Mon Sep 17 00:00:00 2001 From: negativeExponent Date: Mon, 31 May 2021 16:55:09 +0800 Subject: [PATCH] Cleanup: Remove a few extern --- Makefile.libretro | 4 ++-- src/cart.h | 3 +++ src/drivers/libretro/libretro.c | 22 ++-------------------- src/fceu.h | 3 +++ src/input.h | 2 ++ src/ppu.h | 2 ++ 6 files changed, 14 insertions(+), 22 deletions(-) diff --git a/Makefile.libretro b/Makefile.libretro index 86563b0..2387bed 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -752,8 +752,8 @@ else WARNING_DEFINES = -Wno-write-strings endif -CFLAGS += $(fpic) $(WARNING_DEFINES) $(DEFINES) $(ENDIANNESS_DEFINES) -LDFLAGS += $(LIBM) +CFLAGS += $(fpic) $(WARNING_DEFINES) $(DEFINES) $(ENDIANNESS_DEFINES) -Werror=implicit-function-declaration +LDFLAGS += $(LIBM) -Werror=implicit-function-declaration ifeq ($(platform), psp1) INCFLAGS += -I$(shell psp-config --pspsdk-path)/include diff --git a/src/cart.h b/src/cart.h index 4573403..cd05d4b 100644 --- a/src/cart.h +++ b/src/cart.h @@ -104,4 +104,7 @@ void FCEU_OpenGenie(void); void FCEU_CloseGenie(void); void FCEU_KillGenie(void); +extern CartInfo iNESCart; +extern CartInfo UNIFCart; + #endif diff --git a/src/drivers/libretro/libretro.c b/src/drivers/libretro/libretro.c index 39263fc..b191dcd 100644 --- a/src/drivers/libretro/libretro.c +++ b/src/drivers/libretro/libretro.c @@ -67,8 +67,6 @@ void linearFree(void* mem); RETRO_HW_RENDER_INTEFACE_GSKIT_PS2 *ps2 = NULL; #endif -extern void FCEU_ZapperSetTolerance(int t); - static retro_video_refresh_t video_cb = NULL; static retro_input_poll_t poll_cb = NULL; static retro_input_state_t input_cb = NULL; @@ -95,7 +93,7 @@ static int aspect_ratio_par; #define MAX_BUTTONS 8 #define TURBO_BUTTONS 2 -unsigned char turbo_button_toggle[MAX_PLAYERS][TURBO_BUTTONS] = { {0} }; +unsigned turbo_button_toggle[MAX_PLAYERS][TURBO_BUTTONS] = { {0} }; typedef struct { @@ -145,8 +143,6 @@ static bool libretro_supports_bitmasks = false; const size_t PPU_BIT = 1ULL << 31ULL; -extern uint8 NTARAM[0x800], PALRAM[0x20], SPRAM[0x100], PPU[4]; - /* overclock the console by adding dummy scanlines to PPU loop * disables DMC DMA and WaveHi filling for these dummies * doesn't work with new PPU */ @@ -158,14 +154,13 @@ unsigned normal_scanlines = 240; unsigned extrascanlines = 0; unsigned vblankscanlines = 0; unsigned dendy = 0; +unsigned swapDuty; static unsigned systemRegion = 0; static unsigned opt_region = 0; static unsigned opt_showAdvSoundOptions = 0; static unsigned opt_showAdvSystemOptions = 0; -int FCEUnetplay; - #if defined(PSP) || defined(PS2) static __attribute__((aligned(16))) uint16_t retro_palette[256]; #else @@ -181,24 +176,12 @@ static uint16_t* fceu_video_out; static unsigned sndsamplerate; static unsigned sndquality; static unsigned sndvolume; -unsigned swapDuty; static int32_t *sound = 0; static uint32_t Dummy = 0; static uint32_t current_palette = 0; static unsigned serialize_size; -int PPUViewScanline=0; -int PPUViewer=0; - -/* extern forward decls.*/ -extern FCEUGI *GameInfo; -extern uint8 *XBuf; -extern CartInfo iNESCart; -extern CartInfo UNIFCart; -extern int show_crosshair; -extern int option_ramstate; - /* emulator-specific callback functions */ void UpdatePPUView(int refreshchr) { } @@ -311,7 +294,6 @@ FILE *FCEUD_UTF8fopen(const char *n, const char *m) #define PAL_CUSTOM (PAL_TOTAL + 3) static int external_palette_exist = 0; -extern int ipalette; /* table for currently loaded palette */ static uint8_t base_palette[192]; diff --git a/src/fceu.h b/src/fceu.h index f97b425..d3ec9a6 100644 --- a/src/fceu.h +++ b/src/fceu.h @@ -23,6 +23,9 @@ extern unsigned swapDuty; /* Swap bits 6 & 7 of $4000/$4004 to mimic bug * found on some famiclones/Dendy models. */ +extern int show_crosshair; +extern int option_ramstate; + void ResetGameLoaded(void); #define DECLFR(x) uint8 FP_FASTAPASS(1) x(uint32 A) diff --git a/src/input.h b/src/input.h index 82061bc..1ab1e39 100644 --- a/src/input.h +++ b/src/input.h @@ -29,4 +29,6 @@ extern void (*InputScanlineHook)(uint8 *bg, uint8 *spr, uint32 linets, int final void FCEU_DoSimpleCommand(int cmd); +void FCEU_ZapperSetTolerance(int t); + #endif diff --git a/src/ppu.h b/src/ppu.h index 96338a1..d9cfcec 100644 --- a/src/ppu.h +++ b/src/ppu.h @@ -16,6 +16,8 @@ extern void FP_FASTAPASS(1) (*PPU_hook)(uint32 A); extern uint8 NTARAM[0x800], *vnapage[4]; extern uint8 PPUNTARAM; extern uint8 PPUCHRRAM; +extern uint8 PALRAM[0x20]; +extern uint8 SPRAM[0x100]; void FCEUPPU_SaveState(void); void FCEUPPU_LoadState(int version);