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

Method Update

pcsx2/GS/GSState.cpp:6894–6917  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6892}
6893
6894bool GSState::GSTransferBuffer::Update(int tw, int th, int bpp, int& len)
6895{
6896 int tex_size = (((tw * th * bpp) + 7) >> 3); // Round to nearest byte
6897 int packet_size = (tex_size + 15) & ~0xF; // Round up to the nearest quadword
6898
6899 if (total == 0)
6900 total = std::min<int>(tex_size, 1024 * 1024 * 4);
6901
6902 const int remaining = total - end;
6903
6904 if (len > remaining)
6905 {
6906 if (len > packet_size)
6907 {
6908#if defined(_DEBUG)
6909 Console.Warning("GS transfer buffer overflow len %d remaining %d, tex_size %d tw %d th %d bpp %d", len, remaining, tex_size, tw, th, bpp);
6910#endif
6911 }
6912
6913 len = remaining;
6914 }
6915
6916 return len > 0;
6917}
6918
6919// The horizontal offset values (under z) for PAL and NTSC have been tweaked
6920// they should be apparently 632 and 652 respectively, but that causes a thick black line on the left

Callers 5

FlushPrimMethod · 0.45
WriteMethod · 0.45
InitReadFIFOMethod · 0.45
ReadMethod · 0.45
ReadLocalMemoryUnsyncMethod · 0.45

Calls 1

WarningMethod · 0.45

Tested by

no test coverage detected