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

Method GetResolution

pcsx2/GS/GSState.cpp:7030–7063  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7028}
7029
7030GSVector2i GSState::GSPCRTCRegs::GetResolution()
7031{
7032 GSVector2i resolution;
7033
7034 const GSVector4i offsets = !GSConfig.PCRTCOverscan ? VideoModeOffsets[videomode] : VideoModeOffsetsOverscan[videomode];
7035 const bool is_full_height = interlaced || (toggling_field && GSConfig.InterlaceMode != GSInterlaceMode::Off) || GSConfig.InterlaceMode == GSInterlaceMode::Off;
7036
7037 if (!GSConfig.PCRTCOffsets)
7038 {
7039 if (PCRTCDisplays[0].enabled && PCRTCDisplays[1].enabled)
7040 {
7041 const GSVector4i combined_size = PCRTCDisplays[0].displayRect.runion(PCRTCDisplays[1].displayRect);
7042 resolution = { combined_size.width(), combined_size.height() };
7043 }
7044 else if (PCRTCDisplays[0].enabled)
7045 {
7046 resolution = { PCRTCDisplays[0].displayRect.width(), PCRTCDisplays[0].displayRect.height() };
7047 }
7048 else
7049 {
7050 resolution = { PCRTCDisplays[1].displayRect.width(), PCRTCDisplays[1].displayRect.height() };
7051 }
7052 }
7053 else
7054 {
7055 const int shift = is_full_height ? 1 : 0;
7056 resolution = { offsets.x, offsets.y << shift };
7057 }
7058
7059 resolution.x = std::min(resolution.x, offsets.x);
7060 resolution.y = std::min(resolution.y, is_full_height ? offsets.y << 1 : offsets.y);
7061
7062 return resolution;
7063}
7064
7065GSVector4i GSState::GSPCRTCRegs::GetFramebufferRect(int display)
7066{

Callers 8

MergeMethod · 0.80
CalculateDrawDstRectFunction · 0.80
GSC_BlueTongueGamesMethod · 0.80
DrawMethod · 0.80
DetectDoubleHalfClearMethod · 0.80
IsScalingDrawMethod · 0.80

Calls 1

minFunction · 0.70

Tested by

no test coverage detected