Get rid of NOT_LIBRETRO ifdefs

This commit is contained in:
libretroadmin 2022-12-15 13:33:41 +01:00
parent 961d5ae1e6
commit 3827fb4bd0
3 changed files with 7 additions and 86 deletions

View File

@ -1,33 +1,6 @@
#ifndef __MDFN_TYPES_H
#define __MDFN_TYPES_H
#ifdef NOT_LIBRETRO
// Make sure this file is included BEFORE a few common standard C header files(stdio.h, errno.h, math.h, AND OTHERS, but this is not an exhaustive check, nor
// should it be), so that any defines in config.h that change header file behavior will work properly.
#if defined(EOF) || defined(EACCES) || defined(F_LOCK) || defined(NULL) || defined(O_APPEND) || defined(M_LOG2E)
#error "Wrong include order for types.h"
#endif
#endif /* NOT_LIBRETRO */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
//
//
//
#ifdef NOT_LIBRETRO
#if defined(__PIC__) || defined(__pic__) || defined(__PIE__) || defined(__pie__)
#if defined(__386__) || defined(__i386__) || defined(__i386) || defined(_M_IX86) || defined(_M_I386) //|| (SIZEOF_VOID_P <= 4)
#error "Compiling with position-independent code generation enabled is not recommended, for performance reasons."
#else
#warning "Compiling with position-independent code generation enabled is not recommended, for performance reasons."
#endif
#endif
#endif /* NOT_LIBRETRO */
#if defined(__x86_64__) && defined(__code_model_large__)
#error "Compiling with large memory model is not recommended, for performance reasons."
#endif
@ -236,26 +209,16 @@ typedef uint64_t uint64;
#error "Define only one of MSB_FIRST or LSB_FIRST, not both!"
#endif
#ifdef LSB_FIRST
#define MDFN_IS_BIGENDIAN false
#else
#ifdef MSB_FIRST
#define MDFN_IS_BIGENDIAN true
#endif
#if NOT_LIBRETRO
#ifdef __cplusplus
template<typename T> typename std::remove_all_extents<T>::type* MDAP(T* v) { return (typename std::remove_all_extents<T>::type*)v; }
#include "error.h"
#include "math_ops.h"
#include "endian.h"
#endif
#endif /* NOT_LIBRETRO */
#ifndef _MSC_VER
#define MDFN_ALIGN(n) __attribute__ ((aligned (n)))
#else
#define MDFN_IS_BIGENDIAN false
#endif
#ifdef _MSC_VER
#define MDFN_ALIGN(n) __declspec(align(n))
#else
#define MDFN_ALIGN(n) __attribute__ ((aligned (n)))
#endif
#endif

View File

@ -64,17 +64,8 @@ char PS_CPU::cache_buf[64 * 1024];
#define BIU_INVALIDATE_MODE 0x00000002 // Enable Invalidate mode(IsC must be set to 1 as well presumably?)
#define BIU_LOCK_MODE 0x00000001 // Enable Lock mode(IsC must be set to 1 as well presumably?)
#if NOT_LIBRETRO
namespace MDFN_IEN_PSX
{
#endif
PS_CPU::PS_CPU()
{
//printf("%zu\n", (size_t)((uintptr_t)ICache - (uintptr_t)this));
addr_mask[0] = 0xFFFFFFFF;
addr_mask[1] = 0xFFFFFFFF;
addr_mask[2] = 0xFFFFFFFF;
@ -718,19 +709,6 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
}
#endif
#if NOT_LIBRETRO
if(BIOSPrintMode)
{
if(PC == 0xB0)
{
if(MDFN_UNLIKELY(GPR[9] == 0x3D))
{
PSX_DBG_BIOS_PUTC(GPR[4]);
}
}
}
#endif
//
// Instruction fetch
//
@ -2759,13 +2737,6 @@ uint32 PS_CPU::GetRegister(unsigned int which, char *special, const uint32 speci
case GSREG_CAUSE:
ret = CP0.CAUSE;
#ifdef NOT_LIBRETRO
if(special)
{
trio_snprintf(special, special_len, "BD: %u, BT: %u, CE: %u, IP: 0x%02x, Sw: %u, ExcCode: 0x%01x",
(ret >> 31) & 1, (ret >> 30) & 1, (ret >> 28) & 3, (ret >> 10) & 0x3F, (ret >> 8) & 3, (ret >> 2) & 0xF);
}
#endif
break;
case GSREG_EPC:
@ -3907,7 +3878,3 @@ void PS_CPU::lightrec_plugin_shutdown(void)
}
#endif
#if NOT_LIBRETRO
}
#endif

View File

@ -64,11 +64,6 @@
#include <lightrec.h>
#endif
#if NOT_LIBRETRO
namespace MDFN_IEN_PSX
{
#endif
class PS_CPU
{
public:
@ -334,8 +329,4 @@ class PS_CPU
void (*ADDBT)(uint32 from, uint32 to, bool exception);
};
#if NOT_LIBRETRO
}
#endif
#endif