Merge pull request #210 from xsacha:plugin_cleanup

Some cleanup to improve readability.
This commit is contained in:
Pseudonym 2014-08-14 20:37:41 +01:00
commit cb2593f2bb
3 changed files with 8 additions and 43 deletions

View File

@ -32,8 +32,7 @@ static u32 gifqwc = 0;
static bool gifmfifoirq = false; static bool gifmfifoirq = false;
static __fi void clearFIFOstuff(bool full) { static __fi void clearFIFOstuff(bool full) {
if (full) CSRreg.FIFO = CSR_FIFO_FULL; CSRreg.FIFO = full ? CSR_FIFO_FULL : CSR_FIFO_EMPTY;
else CSRreg.FIFO = CSR_FIFO_EMPTY;
} }
void incGifChAddr(u32 qwc) { void incGifChAddr(u32 qwc) {
@ -155,7 +154,8 @@ static __fi void GIFchain() {
// qwc check now done outside this function // qwc check now done outside this function
// Voodoocycles // Voodoocycles
// >> 2 so Drakan and Tekken 5 don't mess up in some PATH3 transfer. Cycles to interrupt were getting huge.. // >> 2 so Drakan and Tekken 5 don't mess up in some PATH3 transfer. Cycles to interrupt were getting huge..
/*if (gifch.qwc)*/ gscycles+= ( _GIFchain() * BIAS); /* guessing */ /*if (gifch.qwc)*/
gscycles+= _GIFchain() * BIAS; /* guessing */
} }
static __fi bool checkTieBit(tDMA_TAG* &ptag) static __fi bool checkTieBit(tDMA_TAG* &ptag)
@ -185,7 +185,7 @@ static __fi tDMA_TAG* ReadTag2()
{ {
tDMA_TAG* ptag = dmaGetAddr(gifch.tadr, false); //Set memory pointer to TADR tDMA_TAG* ptag = dmaGetAddr(gifch.tadr, false); //Set memory pointer to TADR
gifch.unsafeTransfer(ptag); gifch.unsafeTransfer(ptag);
gifch.madr = ptag[1]._u32; gifch.madr = ptag[1]._u32;
gspath3done = hwDmacSrcChainWithStack(gifch, ptag->ID); gspath3done = hwDmacSrcChainWithStack(gifch, ptag->ID);

View File

@ -89,23 +89,7 @@ typedef uint32 uptr;
using namespace std; using namespace std;
#ifdef _MSC_VER #include <memory>
#if _MSC_VER >= 1500
#include <memory>
#if _MSC_VER < 1600
using namespace std::tr1;
#else
using namespace std;
#endif
#endif
#endif
#ifdef __GNUC__
#include <memory>
#endif
#ifdef _WINDOWS #ifdef _WINDOWS
@ -126,11 +110,7 @@ using namespace std;
template<> class hash_compare<uint32> template<> class hash_compare<uint32>
{ {
public: public:
#if _MSC_VER >= 1500 && _MSC_VER < 1600
enum {bucket_size = 4, min_buckets = 8};
#else
enum {bucket_size = 1}; enum {bucket_size = 1};
#endif
size_t operator()(uint32 key) const size_t operator()(uint32 key) const
{ {
@ -153,11 +133,7 @@ using namespace std;
template<> class hash_compare<uint64> template<> class hash_compare<uint64>
{ {
public: public:
#if _MSC_VER >= 1500 && _MSC_VER < 1600
enum {bucket_size = 4, min_buckets = 8};
#else
enum {bucket_size = 1}; enum {bucket_size = 1};
#endif
size_t operator()(uint64 key) const size_t operator()(uint64 key) const
{ {
@ -253,11 +229,11 @@ struct aligned_free_second {template<class T> void operator()(T& p) {_aligned_fr
#define RESTRICT restrict #define RESTRICT restrict
#elif _MSC_VER >= 1400 #elif defined(_MSC_VER)
#define RESTRICT __restrict #define RESTRICT __restrict
#elif defined(__GNUC__) #elif defined(__GNUC__)
#define RESTRICT __restrict__ #define RESTRICT __restrict__
@ -305,17 +281,6 @@ struct aligned_free_second {template<class T> void operator()(T& p) {_aligned_fr
#define MXCSR (_MM_DENORMALS_ARE_ZERO | _MM_MASK_MASK | _MM_ROUND_NEAREST | _MM_FLUSH_ZERO_ON) #define MXCSR (_MM_DENORMALS_ARE_ZERO | _MM_MASK_MASK | _MM_ROUND_NEAREST | _MM_FLUSH_ZERO_ON)
#if defined(_MSC_VER) && _MSC_VER < 1500
__forceinline __m128i _mm_castps_si128(__m128 a) {return *(__m128i*)&a;}
__forceinline __m128 _mm_castsi128_ps(__m128i a) {return *(__m128*)&a;}
__forceinline __m128i _mm_castpd_si128(__m128d a) {return *(__m128i*)&a;}
__forceinline __m128d _mm_castsi128_pd(__m128i a) {return *(__m128d*)&a;}
__forceinline __m128d _mm_castps_pd(__m128 a) {return *(__m128d*)&a;}
__forceinline __m128 _mm_castpd_ps(__m128d a) {return *(__m128*)&a;}
#endif
#define _MM_TRANSPOSE4_SI128(row0, row1, row2, row3) \ #define _MM_TRANSPOSE4_SI128(row0, row1, row2, row3) \
{ \ { \
__m128 tmp0 = _mm_shuffle_ps(_mm_castsi128_ps(row0), _mm_castsi128_ps(row1), 0x44); \ __m128 tmp0 = _mm_shuffle_ps(_mm_castsi128_ps(row0), _mm_castsi128_ps(row1), 0x44); \

View File

@ -117,7 +117,7 @@
#define CALLBACK #define CALLBACK
#endif #endif
#define Sleep(x) sleep((x)*1000) #define Sleep(x) usleep((x)*1000)
#endif #endif
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////