diff --git a/pcsx2/MTGS.cpp b/pcsx2/MTGS.cpp index 5ab38c52ad..a61ecc1481 100644 --- a/pcsx2/MTGS.cpp +++ b/pcsx2/MTGS.cpp @@ -607,9 +607,9 @@ static u32 ringtx_inf[32][32]; static u32 ringtx_inf_s[32]; #endif -// returns the amount of giftag data not processed (in simd128 values). -// Return value is used by VU1 XGKICK to hack-fix data packets which are too -// large for VU1 memory. +// Returns the amount of giftag data processed (in simd128 values). +// Return value is used by VU1's XGKICK instruction to wrap the data +// around VU memory instead of having buffer overflow... // Parameters: // size - size of the packet data, in smd128's int SysMtgsThread::PrepDataPacket( GIF_PATH pathidx, const u8* srcdata, u32 size ) diff --git a/pcsx2/ps2/GIFpath.cpp b/pcsx2/ps2/GIFpath.cpp index 87b7eb76ac..be749e0986 100644 --- a/pcsx2/ps2/GIFpath.cpp +++ b/pcsx2/ps2/GIFpath.cpp @@ -293,8 +293,7 @@ static __forceinline void gsHandler(const u8* pMem) if (pMem>=vuMemEnd) pMem -= 0x4000; \ } while(false) -#define aMin(x, y) std::min( x, y ) -#define subVal(x, y) ((x > y) ? (x-y) : 0 ) +#define aMin(x, y) std::min(x, y) // Parameters: // size (path1) - difference between the end of VU memory and pMem. @@ -342,8 +341,8 @@ __forceinline int GIFPath::ParseTag(GIF_PATH pathidx, const u8* pMem, u32 size) case GIF_FLG_IMAGE2: { int len = aMin(size, nloop); - incTag((len * 16), len); - nloop -= len; + incTag(( len * 16 ), len); + nloop -= len; } break; }