COPY ~torment.exe~ ~torment.exe~
READ_SHORT "0x432300" 4CDx
READ_SHORT "0x432307" 4CDy
READ_SHORT 0x00293a96 4CDver
READ_SHORT "0x432f60" 2CDx
READ_SHORT "0x432f67" 2CDy
READ_SHORT 0x0056da27 2CDver

SET fail = 0
PATCH_IF (4CDx < 1279 AND 4CDver = 20992) OR (2CDx < 1279 AND 2CDver = 20992) THEN BEGIN
SET UI = 1
SET Xold = 640
SET Yold = 480

END ELSE BEGIN
PATCH_IF (4CDx > 1279 AND 4CDy < 799 AND 4CDver = 20992) OR (2CDx > 1279 AND 2CDy < 799 AND 2CDver = 20992) THEN BEGIN
SET UI = 2
SET Xold = 1280
SET Yold = 720

END ELSE BEGIN
PATCH_IF (4CDy > 1023 AND 4CDver = 20992) OR (2CDy > 1023 AND 2CDver = 20992) THEN BEGIN
SET UI = 4
SET Xold = 1280
SET Yold = 1024

END ELSE BEGIN
PATCH_IF (4CDy < 1022 AND 4CDver = 20992) OR (2CDy < 1022 AND 2CDver = 20992) THEN BEGIN
SET UI = 3
SET Xold = 1280
SET Yold = 800

END ELSE BEGIN
PATCH_IF (4CDx > 2561 AND 4CDver = 20992) OR (2CDx > 2561 AND 2CDver = 20992) THEN BEGIN
SET UI = 5
SET Xold = 1280
SET Yold = 1024

END ELSE BEGIN
SET fail = 1
END END END END END
ACTION_IF fail = 1 BEGIN
FAIL ~An appropriate resolution has not been detected.~ END