| 773 | /// then `fn` on the helper and an x offset once for every `xinc` pixels along that line |
| 774 | template <typename Fn> |
| 775 | static 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 | |
| 806 | void GSLocalMemoryFunctions::WriteImageX(GSLocalMemory& mem, int& tx, int& ty, const u8* src, int len, GIFRegBITBLTBUF& BITBLTBUF, GIFRegTRXPOS& TRXPOS, GIFRegTRXREG& TRXREG) |
| 807 | { |
no test coverage detected