remove some unused functions

This commit is contained in:
aliaspider 2014-11-23 02:13:27 +01:00
parent a5c0106e91
commit 5b670aa012
5 changed files with 1 additions and 243 deletions

View File

@ -107,23 +107,6 @@ void Endian_A16_LE_to_NE(void *src, uint32 nelements)
#endif
}
void Endian_A16_BE_to_NE(void *src, uint32 nelements)
{
#ifdef LSB_FIRST
uint32 i;
uint8 *nsrc = (uint8 *)src;
for(i = 0; i < nelements; i++)
{
uint8 tmp = nsrc[i * 2];
nsrc[i * 2] = nsrc[i * 2 + 1];
nsrc[i * 2 + 1] = tmp;
}
#endif
}
void Endian_A32_LE_to_NE(void *src, uint32 nelements)
{
#ifdef MSB_FIRST
@ -200,46 +183,4 @@ void Endian_V_NE_to_LE(void *src, uint32 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 LSB_FIRST
*(uint32*)Bufo=buf;
#else
*(uint32*)Bufo=((buf&0xFF)<<24)|((buf&0xFF00)<<8)|((buf&0xFF0000)>>8)|((buf&0xFF000000)>>24);
#endif
return 1;
}
int read16le(char *d, FILE *fp)
{
#ifdef LSB_FIRST
return((fread(d,1,2,fp)<2)?0:2);
#else
int ret;
ret=fread(d+1,1,1,fp);
ret+=fread(d,1,1,fp);
return ret<2?0:2;
#endif
}

View File

@ -126,30 +126,6 @@ int MDFNFILE_fseek(MDFNFILE *fp, int64 offset, int whence)
return 0;
}
int MDFNFILE_read16le(MDFNFILE *fp, uint16 *val)
{
if ((fp->location + 2) > fp->f_size)
return 0;
*val = MDFN_de16lsb(fp->f_data + fp->location);
fp->location += 2;
return 1;
}
int MDFNFILE_read32le(MDFNFILE *fp, uint32 *val)
{
if ((fp->location + 4) > fp->f_size)
return 0;
*val = MDFN_de32lsb(fp->f_data + fp->location);
fp->location += 4;
return 1;
}
char *MDFNFILE_fgets(MDFNFILE *fp, char *s, int buffer_size)
{
int pos = 0;

View File

@ -18,8 +18,6 @@ bool MDFNFILE_Open(MDFNFILE* fp, const char* path);
bool MDFNFILE_Close(MDFNFILE* fp);
uint64 MDFNFILE_fread(MDFNFILE* fp, void* ptr, size_t size, size_t nmemb);
int MDFNFILE_fseek(MDFNFILE* fp, int64 offset, int whence);
int MDFNFILE_read32le(MDFNFILE* fp, uint32* Bufo);
int MDFNFILE_read16le(MDFNFILE* fp, uint16* Bufo);
char* MDFNFILE_fgets(MDFNFILE *fp, char* s, int size);
bool MDFNFILE_MakeMemWrapAndClose(MDFNFILE *fp, void* tz);

View File

@ -1,27 +1,6 @@
#ifndef __MDFN_ENDIAN_H
#define __MDFN_ENDIAN_H
#ifdef MSB_FIRST
#ifdef LSB_FIRST
#error Only define one of LSB_FIRST and MSB_FIRST
#endif
#ifndef le32toh
#define le32toh(l) ((((l)>>24) & 0xff) | (((l)>>8) & 0xff00) \
| (((l)<<8) & 0xff0000) | (((l)<<24) & 0xff000000))
#endif
#ifndef le16toh
#define le16toh(l) ((((l)>>8) & 0xff) | (((l)<<8) & 0xff00))
#endif
#else
#ifndef le32toh
#define le32toh(l) (l)
#endif
#ifndef le16toh
#define le16toh(l) (l)
#endif
#endif
#ifndef htole32
#define htole32 le32toh
#endif
@ -30,10 +9,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);
@ -43,7 +18,6 @@ void Endian_A32_NE_to_LE(void *src, uint32 nelements);
void Endian_A64_NE_to_LE(void *src, uint32 nelements);
void Endian_A16_LE_to_NE(void *src, uint32 nelements);
void Endian_A16_BE_to_NE(void *src, uint32 nelements);
void Endian_A32_LE_to_NE(void *src, uint32 nelements);
void Endian_A64_LE_to_NE(void *src, uint32 nelements);
@ -54,20 +28,6 @@ void FlipByteOrder(uint8 *src, uint32 count);
// The following functions can encode/decode to unaligned addresses.
static inline void MDFN_en16lsb(uint8 *buf, uint16 morp)
{
buf[0]=morp;
buf[1]=morp>>8;
}
static inline void MDFN_en24lsb(uint8 *buf, uint32 morp)
{
buf[0]=morp;
buf[1]=morp>>8;
buf[2]=morp>>16;
}
static inline void MDFN_en32lsb(uint8 *buf, uint32 morp)
{
buf[0]=morp;
@ -76,131 +36,14 @@ static inline void MDFN_en32lsb(uint8 *buf, uint32 morp)
buf[3]=morp>>24;
}
static inline void MDFN_en64lsb(uint8 *buf, uint64 morp)
{
buf[0]=morp >> 0;
buf[1]=morp >> 8;
buf[2]=morp >> 16;
buf[3]=morp >> 24;
buf[4]=morp >> 32;
buf[5]=morp >> 40;
buf[6]=morp >> 48;
buf[7]=morp >> 56;
}
static inline void MDFN_en16msb(uint8 *buf, uint16 morp)
{
buf[0] = morp >> 8;
buf[1] = morp;
}
static inline void MDFN_en24msb(uint8 *buf, uint32 morp)
{
buf[0] = morp >> 16;
buf[1] = morp >> 8;
buf[2] = morp;
}
static inline void MDFN_en32msb(uint8 *buf, uint32 morp)
{
buf[0] = morp >> 24;
buf[1] = morp >> 16;
buf[2] = morp >> 8;
buf[3] = morp;
}
static inline void MDFN_en64msb(uint8 *buf, uint64 morp)
{
buf[0] = morp >> 56;
buf[1] = morp >> 48;
buf[2] = morp >> 40;
buf[3] = morp >> 32;
buf[4] = morp >> 24;
buf[5] = morp >> 16;
buf[6] = morp >> 8;
buf[7] = morp >> 0;
}
// Overloaded functions, yay.
static inline void MDFN_enlsb(uint16 * buf, uint16 value)
{
MDFN_en16lsb((uint8 *)buf, value);
}
static inline void MDFN_enlsb(uint32 * buf, uint32 value)
{
MDFN_en32lsb((uint8 *)buf, value);
}
static inline void MDFN_enlsb(uint64 * buf, uint64 value)
{
MDFN_en64lsb((uint8 *)buf, value);
}
static inline uint16 MDFN_de16lsb(const uint8 *morp)
{
return(morp[0] | (morp[1] << 8));
}
static inline uint32 MDFN_de24lsb(const uint8 *morp)
{
return(morp[0]|(morp[1]<<8)|(morp[2]<<16));
}
static inline uint32 MDFN_de32lsb(const uint8 *morp)
{
return(morp[0]|(morp[1]<<8)|(morp[2]<<16)|(morp[3]<<24));
}
static inline uint64 MDFN_de64lsb(const uint8 *morp)
{
uint64 ret = 0;
ret |= (uint64)morp[0];
ret |= (uint64)morp[1] << 8;
ret |= (uint64)morp[2] << 16;
ret |= (uint64)morp[3] << 24;
ret |= (uint64)morp[4] << 32;
ret |= (uint64)morp[5] << 40;
ret |= (uint64)morp[6] << 48;
ret |= (uint64)morp[7] << 56;
return(ret);
}
static inline uint16 MDFN_delsb(const uint16 *buf)
{
return(MDFN_de16lsb((uint8 *)buf));
}
static inline uint32 MDFN_delsb(const uint32 *buf)
{
return(MDFN_de32lsb((uint8 *)buf));
}
static inline uint64 MDFN_delsb(const uint64 *buf)
{
return(MDFN_de64lsb((uint8 *)buf));
}
static inline uint16 MDFN_de16msb(const uint8 *morp)
{
return(morp[1] | (morp[0] << 8));
}
static inline uint32 MDFN_de24msb(const uint8 *morp)
{
return((morp[2]<<0)|(morp[1]<<8)|(morp[0]<<16));
}
static inline uint32 MDFN_de32msb(const uint8 *morp)
{
return(morp[3]|(morp[2]<<8)|(morp[1]<<16)|(morp[0]<<24));
}
#endif

View File

@ -63,7 +63,7 @@ extern struct retro_perf_callback perf_cb;
#endif
#ifdef PSP_PROFILER
#if defined(PSP_PROFILER) && defined(PSP)
#include <psptypes.h>
#include <pspkerneltypes.h>
#include <pspdebug.h>