Increased array size of LoadedRomFName buffer to allow for max unix filepath length. Remove duplicate extern definitions in cpp and instead include ines.h header which contains official extern definition.

This commit is contained in:
harry 2023-01-16 08:42:33 -05:00
parent 600588910f
commit 4c9a0ad7cf
7 changed files with 11 additions and 14 deletions

View File

@ -23,6 +23,7 @@
#include "debuggersp.h"
#include "window.h"
#include "../../fceu.h"
#include "../../ines.h"
#include "../../debug.h"
#include "../../conddebug.h"
@ -54,7 +55,6 @@ int pageNumbersLoaded[32] = {
Name* ramBankNames = 0;
bool ramBankNamesLoaded = false;
extern char LoadedRomFName[2048];
char NLfilename[2048];
bool symbDebugEnabled = true;
bool symbRegNames = true;

View File

@ -44,6 +44,7 @@ extern "C" { FILE __iob_func[3] = { *stdin,*stdout,*stderr }; }
#include "../../version.h"
#include "../../types.h"
#include "../../fceu.h"
#include "../../ines.h"
#include "../../state.h"
#include "../../debug.h"
#include "../../movie.h"
@ -544,7 +545,6 @@ void DoFCEUExit()
closeGame = true;//mbg 6/30/06 - for housekeeping purposes we need to exit after the emulation cycle finishes
// remember the ROM name
extern char LoadedRomFName[2048];
if (GameInfo)
strcpy(romNameWhenClosingEmulator, LoadedRomFName);
else
@ -1174,7 +1174,7 @@ std::string GetRomName(bool force)
//The purpose of this function is to format the ROM name stored in LoadedRomFName
//And return a char array with just the name with path or extension
//The purpose of this function is to populate a save as dialog with the ROM name as a default filename
extern char LoadedRomFName[2048]; //Contains full path of ROM
// LoadedRomFName; //Contains full path of ROM
std::string Rom; //Will contain the formatted path
if(GameInfo || force) //If ROM is loaded
{
@ -1193,7 +1193,7 @@ std::string GetRomPath(bool force)
//The purpose of this function is to format the ROM name stored in LoadedRomFName
//And return a char array with just the name with path or extension
//The purpose of this function is to populate a save as dialog with the ROM name as a default filename
extern char LoadedRomFName[2048]; //Contains full path of ROM
// LoadedRomFName; //Contains full path of ROM
std::string Rom; //Will contain the formatted path
if(GameInfo || force) //If ROM is loaded
{
@ -1205,4 +1205,4 @@ std::string GetRomPath(bool force)
else
Rom = "";
return Rom;
}
}

View File

@ -181,7 +181,6 @@ static void FCEU_CloseGame(void)
}
#ifdef __WIN_DRIVER__
extern char LoadedRomFName[2048];
if (storePreferences(mass_replace(LoadedRomFName, "|", ".").c_str()))
FCEUD_PrintError("Couldn't store debugging data");
CDLoggerROMClosed();
@ -505,7 +504,6 @@ FCEUGI *FCEUI_LoadGameVirtual(const char *name, int OverwriteVidMode, bool silen
#ifdef __WIN_DRIVER__
// ################################## Start of SP CODE ###########################
extern char LoadedRomFName[2048];
extern int loadDebugDataFailed;
if ((loadDebugDataFailed = loadPreferences(mass_replace(LoadedRomFName, "|", ".").c_str())))

View File

@ -29,6 +29,7 @@
#include "state.h"
#include "file.h"
#include "cart.h"
#include "ines.h"
#include "netplay.h"
#include "driver.h"
#include "movie.h"
@ -852,7 +853,6 @@ int FDSLoad(const char *name, FCEUFILE *fp) {
free(fn);
}
extern char LoadedRomFName[2048];
strcpy(LoadedRomFName, name); //For the debugger list
GameInfo->type = GIT_FDS;

View File

@ -58,8 +58,8 @@ uint8 Mirroring = 0;
uint8 MirroringAs2bits = 0;
uint32 ROM_size = 0;
uint32 VROM_size = 0;
char LoadedRomFName[2048]; //mbg merge 7/17/06 added
char LoadedRomFNamePatchToUse[2048];
char LoadedRomFName[4096]; //mbg merge 7/17/06 added
char LoadedRomFNamePatchToUse[4096];
static int CHRRAMSize = -1;
static int iNES_Init(int num);

View File

@ -46,8 +46,8 @@ extern uint8 *ExtraNTARAM;
extern uint8 **VPageR;
extern int iNesSave(void); //bbit Edited: line added
extern int iNesSaveAs(const char* name);
extern char LoadedRomFName[2048]; //bbit Edited: line added
extern char LoadedRomFNamePatchToUse[2048];
extern char LoadedRomFName[4096]; //bbit Edited: line added
extern char LoadedRomFNamePatchToUse[4096];
extern char *iNesShortFName(void);
extern const TMasterRomInfo* MasterRomInfo;
extern TMasterRomInfoParams MasterRomInfoParams;

View File

@ -32,6 +32,7 @@
#include "file.h"
#include "fds.h"
#include "cart.h"
#include "ines.h"
#include "input.h"
#include "state.h"
#include "driver.h"
@ -123,8 +124,6 @@ static uint16 PlayAddr; //configuration
static uint16 InitAddr; //configuration
static uint16 LoadAddr; //configuration
extern char LoadedRomFName[2048];
NSF_HEADER NSFHeader; //mbg merge 6/29/06 - needs to be global
void NSFMMC5_Close(void);