|
|
|
@ -25,6 +25,8 @@
|
|
|
|
|
#include "GS.h"
|
|
|
|
|
#include "CDVD/CDVD.h"
|
|
|
|
|
#include "ps2/BiosTools.h"
|
|
|
|
|
#include "DebugTools/DebugInterface.h"
|
|
|
|
|
#include "DebugTools/Breakpoints.h"
|
|
|
|
|
|
|
|
|
|
GS_VideoMode gsVideoMode = GS_VideoMode::Uninitialized;
|
|
|
|
|
bool gsIsInterlaced = false;
|
|
|
|
@ -884,64 +886,73 @@ void SYSCALL()
|
|
|
|
|
{
|
|
|
|
|
case Syscall::SetGsCrt:
|
|
|
|
|
{
|
|
|
|
|
//Function "SetGsCrt(Interlace, Mode, Field)"
|
|
|
|
|
//Useful for fetching information of interlace/video/field display parameters of the Graphics Synthesizer
|
|
|
|
|
//Function "SetGsCrt(Interlace, Mode, Field)"
|
|
|
|
|
//Useful for fetching information of interlace/video/field display parameters of the Graphics Synthesizer
|
|
|
|
|
|
|
|
|
|
gsIsInterlaced = cpuRegs.GPR.n.a0.UL[0] & 1;
|
|
|
|
|
bool gsIsFrameMode = cpuRegs.GPR.n.a2.UL[0] & 1;
|
|
|
|
|
const char* inter = (gsIsInterlaced) ? "Interlaced" : "Progressive";
|
|
|
|
|
const char* field = (gsIsFrameMode) ? "FRAME" : "FIELD";
|
|
|
|
|
std::string mode;
|
|
|
|
|
// Warning info might be incorrect!
|
|
|
|
|
switch (cpuRegs.GPR.n.a1.UC[0])
|
|
|
|
|
{
|
|
|
|
|
case 0x0:
|
|
|
|
|
case 0x2:
|
|
|
|
|
mode = "NTSC 640x448 @ 59.940 (59.82)"; gsSetVideoMode(GS_VideoMode::NTSC); break;
|
|
|
|
|
gsIsInterlaced = cpuRegs.GPR.n.a0.UL[0] & 1;
|
|
|
|
|
bool gsIsFrameMode = cpuRegs.GPR.n.a2.UL[0] & 1;
|
|
|
|
|
const char* inter = (gsIsInterlaced) ? "Interlaced" : "Progressive";
|
|
|
|
|
const char* field = (gsIsFrameMode) ? "FRAME" : "FIELD";
|
|
|
|
|
std::string mode;
|
|
|
|
|
// Warning info might be incorrect!
|
|
|
|
|
switch (cpuRegs.GPR.n.a1.UC[0])
|
|
|
|
|
{
|
|
|
|
|
case 0x0:
|
|
|
|
|
case 0x2:
|
|
|
|
|
mode = "NTSC 640x448 @ 59.940 (59.82)"; gsSetVideoMode(GS_VideoMode::NTSC); break;
|
|
|
|
|
|
|
|
|
|
case 0x1:
|
|
|
|
|
case 0x3:
|
|
|
|
|
mode = "PAL 640x512 @ 50.000 (49.76)"; gsSetVideoMode(GS_VideoMode::PAL); break;
|
|
|
|
|
case 0x1:
|
|
|
|
|
case 0x3:
|
|
|
|
|
mode = "PAL 640x512 @ 50.000 (49.76)"; gsSetVideoMode(GS_VideoMode::PAL); break;
|
|
|
|
|
|
|
|
|
|
case 0x1A: mode = "VESA 640x480 @ 59.940"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
case 0x1B: mode = "VESA 640x480 @ 72.809"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
case 0x1C: mode = "VESA 640x480 @ 75.000"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
case 0x1D: mode = "VESA 640x480 @ 85.008"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
case 0x1A: mode = "VESA 640x480 @ 59.940"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
case 0x1B: mode = "VESA 640x480 @ 72.809"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
case 0x1C: mode = "VESA 640x480 @ 75.000"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
case 0x1D: mode = "VESA 640x480 @ 85.008"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
|
|
|
|
|
case 0x2A: mode = "VESA 800x600 @ 56.250"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
case 0x2B: mode = "VESA 800x600 @ 60.317"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
case 0x2C: mode = "VESA 800x600 @ 72.188"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
case 0x2D: mode = "VESA 800x600 @ 75.000"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
case 0x2E: mode = "VESA 800x600 @ 85.061"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
case 0x2A: mode = "VESA 800x600 @ 56.250"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
case 0x2B: mode = "VESA 800x600 @ 60.317"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
case 0x2C: mode = "VESA 800x600 @ 72.188"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
case 0x2D: mode = "VESA 800x600 @ 75.000"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
case 0x2E: mode = "VESA 800x600 @ 85.061"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
|
|
|
|
|
case 0x3B: mode = "VESA 1024x768 @ 60.004"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
case 0x3C: mode = "VESA 1024x768 @ 70.069"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
case 0x3D: mode = "VESA 1024x768 @ 75.029"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
case 0x3E: mode = "VESA 1024x768 @ 84.997"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
case 0x3B: mode = "VESA 1024x768 @ 60.004"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
case 0x3C: mode = "VESA 1024x768 @ 70.069"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
case 0x3D: mode = "VESA 1024x768 @ 75.029"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
case 0x3E: mode = "VESA 1024x768 @ 84.997"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
|
|
|
|
|
case 0x4A: mode = "VESA 1280x1024 @ 63.981"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
case 0x4B: mode = "VESA 1280x1024 @ 79.976"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
case 0x4A: mode = "VESA 1280x1024 @ 63.981"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
case 0x4B: mode = "VESA 1280x1024 @ 79.976"; gsSetVideoMode(GS_VideoMode::VESA); break;
|
|
|
|
|
|
|
|
|
|
case 0x50: mode = "SDTV 720x480 @ 59.94"; gsSetVideoMode(GS_VideoMode::SDTV_480P); break;
|
|
|
|
|
case 0x51: mode = "HDTV 1920x1080 @ 60.00"; gsSetVideoMode(GS_VideoMode::HDTV_1080I); break;
|
|
|
|
|
case 0x52: mode = "HDTV 1280x720 @ ??.???"; gsSetVideoMode(GS_VideoMode::HDTV_720P); break;
|
|
|
|
|
case 0x53: mode = "SDTV 768x576 @ ??.???"; gsSetVideoMode(GS_VideoMode::SDTV_576P); break;
|
|
|
|
|
case 0x54: mode = "HDTV 1920x1080 @ ??.???"; gsSetVideoMode(GS_VideoMode::HDTV_1080P); break;
|
|
|
|
|
case 0x50: mode = "SDTV 720x480 @ 59.94"; gsSetVideoMode(GS_VideoMode::SDTV_480P); break;
|
|
|
|
|
case 0x51: mode = "HDTV 1920x1080 @ 60.00"; gsSetVideoMode(GS_VideoMode::HDTV_1080I); break;
|
|
|
|
|
case 0x52: mode = "HDTV 1280x720 @ ??.???"; gsSetVideoMode(GS_VideoMode::HDTV_720P); break;
|
|
|
|
|
case 0x53: mode = "SDTV 768x576 @ ??.???"; gsSetVideoMode(GS_VideoMode::SDTV_576P); break;
|
|
|
|
|
case 0x54: mode = "HDTV 1920x1080 @ ??.???"; gsSetVideoMode(GS_VideoMode::HDTV_1080P); break;
|
|
|
|
|
|
|
|
|
|
case 0x72:
|
|
|
|
|
case 0x82:
|
|
|
|
|
mode = "DVD NTSC 640x448 @ ??.???"; gsSetVideoMode(GS_VideoMode::DVD_NTSC); break;
|
|
|
|
|
case 0x73:
|
|
|
|
|
case 0x83:
|
|
|
|
|
mode = "DVD PAL 720x480 @ ??.???"; gsSetVideoMode(GS_VideoMode::DVD_PAL); break;
|
|
|
|
|
case 0x72:
|
|
|
|
|
case 0x82:
|
|
|
|
|
mode = "DVD NTSC 640x448 @ ??.???"; gsSetVideoMode(GS_VideoMode::DVD_NTSC); break;
|
|
|
|
|
case 0x73:
|
|
|
|
|
case 0x83:
|
|
|
|
|
mode = "DVD PAL 720x480 @ ??.???"; gsSetVideoMode(GS_VideoMode::DVD_PAL); break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
DevCon.Error("Mode %x is not supported. Report me upstream", cpuRegs.GPR.n.a1.UC[0]);
|
|
|
|
|
gsSetVideoMode(GS_VideoMode::Unknown);
|
|
|
|
|
}
|
|
|
|
|
DevCon.Warning("Set GS CRTC configuration. %s %s (%s)",mode.c_str(), inter, field);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
DevCon.Error("Mode %x is not supported. Report me upstream", cpuRegs.GPR.n.a1.UC[0]);
|
|
|
|
|
gsSetVideoMode(GS_VideoMode::Unknown);
|
|
|
|
|
}
|
|
|
|
|
DevCon.Warning("Set GS CRTC configuration. %s %s (%s)",mode.c_str(), inter, field);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case Syscall::ExecPS2:
|
|
|
|
|
{
|
|
|
|
|
if (DebugInterface::getPauseOnEntry())
|
|
|
|
|
{
|
|
|
|
|
CBreakPoints::AddBreakPoint(BREAKPOINT_EE, cpuRegs.GPR.n.a0.UL[0], true);
|
|
|
|
|
DebugInterface::setPauseOnEntry(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case Syscall::SetOsdConfigParam:
|
|
|
|
|
AllowParams1 = true;
|
|
|
|
|
break;
|
|
|
|
|