From 5600ba096beed301622dc1739dbb1fc0d167d6b8 Mon Sep 17 00:00:00 2001 From: ugetab Date: Sat, 24 Apr 2010 15:54:34 +0000 Subject: [PATCH] Added an error message to account for FDS BIOS files that aren't exactly 0x2000 bytes in size. The 40k copy floating around shouldn't cause unannounced errors anymore. --- src/drivers/win/guiconfig.cpp | 1 - src/fds.cpp | 9 +++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/drivers/win/guiconfig.cpp b/src/drivers/win/guiconfig.cpp index b3693f80..0bb6adb0 100644 --- a/src/drivers/win/guiconfig.cpp +++ b/src/drivers/win/guiconfig.cpp @@ -120,7 +120,6 @@ BOOL CALLBACK GUIConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) } GetModuleFileName(0, ManifestFilePath, 2048); - //std::string TestFilepath = tempfilepath; strcat((char*)ManifestFilePath,".manifest"); diff --git a/src/fds.cpp b/src/fds.cpp index 300fa576..e3d40f78 100644 --- a/src/fds.cpp +++ b/src/fds.cpp @@ -793,6 +793,15 @@ int FDSLoad(const char *name, FCEUFILE *fp) free(fn); + fseek( zp, 0L, SEEK_END ); + if (ftell( zp ) != 8192 ) { + fclose(zp); + FreeFDSMemory(); + FCEU_PrintError("FDS BIOS ROM image incompatible: %s", FCEU_MakeFName(FCEUMKF_FDSROM,0,0).c_str()); + return 0; + } + fseek( zp, 0L, SEEK_SET ); + if(fread(FDSBIOS,1,8192,zp)!=8192) { fclose(zp);