Remove some stdio file I/O stuff

This commit is contained in:
twinaphex 2021-09-17 16:46:37 +02:00
parent 290763fa64
commit e9e7a79761
6 changed files with 0 additions and 103 deletions

View File

@ -79,7 +79,6 @@ endif
ifneq ($(HAVE_GRIFFIN), 1)
SOURCES_CXX += \
$(MEDNAFEN_DIR)/mednafen.cpp \
$(MEDNAFEN_DIR)/settings.cpp \
$(MEDNAFEN_DIR)/state.cpp \
$(MEDNAFEN_DIR)/mempatcher.cpp \

View File

@ -762,19 +762,3 @@ void MDFN_PrintError(const char *format, ...)
va_end(ap);
}
void MDFN_DebugPrintReal(const char *file, const int line, const char *format, ...)
{
char *temp;
va_list ap;
va_start(ap, format);
temp = new char[4096];
vsnprintf(temp, 4096, format, ap);
fprintf(stderr, "%s:%d %s\n", file, line, temp);
delete[] temp;
va_end(ap);
}

View File

@ -199,47 +199,3 @@ void Endian_V_NE_to_LE(void *src, uint32 bytesize)
FlipByteOrder((uint8 *)src, bytesize);
#endif
}
int write16le(uint16 b, FILE *fp)
{
uint8 s[2];
s[0]=b;
s[1]=b>>8;
return((fwrite(s,1,2,fp)<2)?0:2);
}
int write32le(uint32 b, FILE *fp)
{
uint8 s[4];
s[0]=b;
s[1]=b>>8;
s[2]=b>>16;
s[3]=b>>24;
return((fwrite(s,1,4,fp)<4)?0:4);
}
int read32le(uint32 *Bufo, FILE *fp)
{
uint32 buf;
if(fread(&buf,1,4,fp)<4)
return 0;
#ifdef MSB_FIRST
*(uint32*)Bufo=((buf&0xFF)<<24)|((buf&0xFF00)<<8)|((buf&0xFF0000)>>8)|((buf&0xFF000000)>>24);
#else
*(uint32*)Bufo=buf;
#endif
return 1;
}
int read16le(char *d, FILE *fp)
{
#ifdef MSB_FIRST
int ret;
ret=fread(d+1,1,1,fp);
ret+=fread(d,1,1,fp);
return ret<2?0:2;
#else
return((fread(d,1,2,fp)<2)?0:2);
#endif
}

View File

@ -29,10 +29,6 @@
#define htole16 le16toh
#endif
int write16le(uint16 b, FILE *fp);
int write32le(uint32 b, FILE *fp);
int read32le(uint32 *Bufo, FILE *fp);
void Endian_A16_Swap(void *src, uint32 nelements);
void Endian_A32_Swap(void *src, uint32 nelements);
void Endian_A64_Swap(void *src, uint32 nelements);

View File

@ -1,36 +0,0 @@
/* Mednafen - Multi-system Emulator
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "mednafen.h"
#include <string.h>
#include <stdarg.h>
#include <errno.h>
#include <list>
#include <algorithm>
#include "general.h"
#include "state.h"
#include "video/surface.h"
#include "file.h"
#include "mempatcher.h"
#ifdef _MSC_VER
#include "msvc_compat.h"
#endif

View File

@ -19,8 +19,6 @@ extern MDFNGI *MDFNGameInfo;
void MDFN_PrintError(const char *format, ...);
void MDFN_printf(const char *format, ...);
void MDFN_DebugPrintReal(const char *file, const int line, const char *format, ...);
void MDFN_LoadGameCheats(void *override);
void MDFN_FlushGameCheats(int nosave);