From e154706586d523dbd33f8793872d4c7a013bfaf0 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 5 Jun 2021 20:56:49 +0200 Subject: [PATCH] Some cleanups + we don't need a non-libretro codepath --- src/driver.h | 7 ------- src/drivers/libretro/libretro.c | 11 +---------- src/fceu-types.h | 4 ---- src/fceu.h | 1 - src/file.h | 10 ---------- src/ppu.c | 2 -- src/ppuview.h | 13 ------------- 7 files changed, 1 insertion(+), 47 deletions(-) delete mode 100644 src/ppuview.h diff --git a/src/driver.h b/src/driver.h index 196c733..6c83d97 100644 --- a/src/driver.h +++ b/src/driver.h @@ -101,12 +101,7 @@ void FCEUI_DisableSpriteLimitation(int a); /* -1 = no change, 0 = show, 1 = hide, 2 = internal toggle */ void FCEUI_SetRenderDisable(int sprites, int bg); -#ifdef __LIBRETRO__ FCEUGI *FCEUI_LoadGame(const char *name, uint8_t *buf, size_t bufsize); -#else -/* name=path and file to load. returns 0 on failure, 1 on success */ -FCEUGI *FCEUI_LoadGame(const char *name); -#endif #ifdef COPYFAMI /* Fake UNIF board to start new CFHI instance */ @@ -149,9 +144,7 @@ void FCEUI_SetRenderedLines(int ntscf, int ntscl, int palf, int pall); below this directory. */ void FCEUI_SetBaseDirectory(char *dir); -#ifdef __LIBRETRO__ void FCEUI_SetSaveDirectory(char *sav_dir); -#endif /* Tells FCE Ultra to copy the palette data pointed to by pal and use it. diff --git a/src/drivers/libretro/libretro.c b/src/drivers/libretro/libretro.c index 39263fc..8c606fd 100644 --- a/src/drivers/libretro/libretro.c +++ b/src/drivers/libretro/libretro.c @@ -188,9 +188,6 @@ 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; @@ -201,8 +198,6 @@ extern int option_ramstate; /* emulator-specific callback functions */ -void UpdatePPUView(int refreshchr) { } - const char * GetKeyboard(void) { return ""; @@ -288,9 +283,6 @@ void FCEUD_DispMessage(char *m) environ_cb(RETRO_ENVIRONMENT_SET_MESSAGE, &msg); } -void FCEUD_NetworkClose(void) -{ } - void FCEUD_SoundToggle (void) { FCEUI_SetSoundVolume(sndvolume); @@ -300,8 +292,7 @@ FILE *FCEUD_UTF8fopen(const char *n, const char *m) { if (n) return fopen(n, m); - else - return NULL; + return NULL; } /*palette for FCEU*/ diff --git a/src/fceu-types.h b/src/fceu-types.h index 86def23..9327c9b 100644 --- a/src/fceu-types.h +++ b/src/fceu-types.h @@ -22,11 +22,7 @@ #ifndef __FCEU_TYPES_H #define __FCEU_TYPES_H -#ifdef __LIBRETRO__ #include -#else -#include -#endif typedef int8_t int8; typedef int16_t int16; typedef int32_t int32; diff --git a/src/fceu.h b/src/fceu.h index f97b425..2831997 100644 --- a/src/fceu.h +++ b/src/fceu.h @@ -81,7 +81,6 @@ extern uint8 PAL; typedef struct { int PAL; - int NetworkPlay; int SoundVolume; int TriangleVolume; int SquareVolume[2]; diff --git a/src/file.h b/src/file.h index a992a66..7035e8f 100644 --- a/src/file.h +++ b/src/file.h @@ -1,28 +1,18 @@ #ifndef _FCEU_FILE_H #define _FCEU_FILE_H -#ifdef __LIBRETRO__ typedef struct { uint8 *data; uint32 size; uint32 location; } MEMWRAP; -#endif typedef struct { -#ifdef __LIBRETRO__ MEMWRAP *fp; -#else - void *fp; /* FILE* or ptr to ZIPWRAP */ -#endif uint32 type; /* 0=normal file, 1=gzip, 2=zip */ } FCEUFILE; -#ifdef __LIBRETRO__ FCEUFILE *FCEU_fopen(const char *path, const char *ipsfn, char *mode, char *ext, uint8 *buffer, size_t bufsize); -#else -FCEUFILE *FCEU_fopen(const char *path, const char *ipsfn, char *mode, char *ext); -#endif int FCEU_fclose(FCEUFILE*); uint64 FCEU_fread(void *ptr, size_t size, size_t nmemb, FCEUFILE*); uint64 FCEU_fwrite(void *ptr, size_t size, size_t nmemb, FCEUFILE*); diff --git a/src/ppu.c b/src/ppu.c index 45ccc7f..f3ea2a1 100644 --- a/src/ppu.c +++ b/src/ppu.c @@ -32,7 +32,6 @@ #include "general.h" #include "fceu-endian.h" #include "fceu-memory.h" -#include "ppuview.h" #include "cart.h" #include "palette.h" @@ -1241,7 +1240,6 @@ int FCEUPPU_Loop(int skip) { for (scanline = 0; scanline < totalscanlines; ) { /* scanline is incremented in DoLine. Evil. :/ */ deempcnt[deemp]++; - /* if ((PPUViewer) && (scanline == PPUViewScanline)) UpdatePPUView(1); */ DoLine(); if (scanline < normal_scanlines || scanline == totalscanlines) overclocked = 0; diff --git a/src/ppuview.h b/src/ppuview.h deleted file mode 100644 index 740a183..0000000 --- a/src/ppuview.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef _FCEU_PPUVIEW_H -#define _FCEU_PPUVIEW_H - -extern int PPUViewScanline; -extern int PPUViewer; -extern int scanline; - -void PPUViewDoBlit(); -void DoPPUView(); -void UpdatePPUView(int refreshchr); - - -#endif