MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / readWriteHelper

Function readWriteHelper

pcsx2/GS/GSLocalMemoryMultiISA.cpp:775–804  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

773/// then `fn` on the helper and an x offset once for every `xinc` pixels along that line
774template <typename Fn>
775static void readWriteHelper(int& tx, int& ty, int len, int xinc, int sx, int w, const GSOffset& off, Fn&& fn)
776{
777 int y = ty;
778 int ex = sx + w;
779 int remX = ex - tx;
780
781 pxAssert(remX >= 0);
782
783 GSOffset::PAHelper pa = off.paMulti(tx, y);
784
785 while (len > 0)
786 {
787 int stop = std::min(remX, len);
788 len -= stop;
789 remX -= stop;
790
791 for (int x = 0; x < stop; x += xinc)
792 fn(pa, x);
793
794 if (remX == 0)
795 {
796 y++;
797 remX = w;
798 pa = off.paMulti(sx, y);
799 }
800 }
801
802 tx = ex - remX;
803 ty = y;
804}
805
806void GSLocalMemoryFunctions::WriteImageX(GSLocalMemory& mem, int& tx, int& ty, const u8* src, int len, GIFRegBITBLTBUF& BITBLTBUF, GIFRegTRXPOS& TRXPOS, GIFRegTRXREG& TRXREG)
807{

Callers 2

WriteImageXMethod · 0.85
ReadImageXMethod · 0.85

Calls 2

paMultiMethod · 0.80
minFunction · 0.70

Tested by

no test coverage detected