pcsx2: Ok, take 3.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3571 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
arcum42 2010-07-26 11:40:30 +00:00
parent 545165b405
commit 9d0a191a00
1 changed files with 2 additions and 9 deletions

View File

@ -27,6 +27,7 @@
#include "Vif.h"
#include "Gif.h"
#include "Vif_Dma.h"
#include <limits.h>
// Zero cycle IRQ schedules aren't really good, but the IPU uses them.
// Better to throw the IRQ inline:
@ -949,14 +950,6 @@ u16 __fastcall FillInternalBuffer(u32 * pointer, u32 advance, u32 size)
return (g_BP.FP >= 1) ? g_BP.FP * 128 - (*(int*)pointer) : 0;
}
#ifdef __LINUX__
// Tell the compiler that a constant too large to be 32 bits, is, in fact, 64 bits.
#define U64_MASK 0xFFFFFFFFFFFFFFFFLLU
#else
#define U64_MASK 0xFFFFFFFFFFFFFFFF
#endif
// whenever reading fractions of bytes. The low bits always come from the next byte
// while the high bits come from the current byte
u8 __fastcall getBits128(u8 *address, u32 advance)
@ -983,7 +976,7 @@ u8 __fastcall getBits128(u8 *address, u32 advance)
notMask.lo = ~mask.lo & data.lo;
notMask.hi = ~mask.hi & data.hi;
notMask.lo >>= 8 - shift;
notMask.lo |= (notMask.hi & (U64_MASK >> (64 - shift))) << (64 - shift);
notMask.lo |= (notMask.hi & (ULLONG_MAX >> (64 - shift))) << (64 - shift);
notMask.hi >>= 8 - shift;
mask.hi = (((*(u128*)readpos).hi & mask.hi) << shift) | (((*(u128*)readpos).lo & mask.lo) >> (64 - shift));