..:: PCSX2 Forums ::..

Full Version: Can I make it so the window fits the games resolution?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
For example, if a game is running at 512x448, is there a way to make it so the game doesn't stretch to match the window, but instead the window changes to match the game's resolution so it appears crisp? Or would I have to set the resolution manually for each game?
In order to help you please post your spec, games are you tring to play, are you playing from iso or original disc. Smile
(06-24-2013, 10:56 AM)billyash Wrote: [ -> ]In order to help you please post your spec, games are you tring to play, are you playing from iso or original disc. Smile

That has absolutely NOTHING to do with what he asked. Try reading the post next time?

@OP: As far as i know, you can just set a display aspect ratio and the game will try to preserve that, but for an exact size, you won't exactly notice a difference if upscaling is used.
Setting the window size to the game default resolution,can make the window too small to see the game correctly.

Are you taking about the game native resolution or the resolution YOU set?
If you want to set the window size to the game native resolution...there is no other way to do that except by using something external
Here is an AutoHotkey script that run pcsx2,wait for the GSdx window to appear,wait to the game native resolution info to appear in the GSdx window and then resize the window to that size.

Code:
#SingleInstance,Force
#NoTrayIcon
Run,set the pcsx2 path here
Loop
{
WinWaitActive,GSdx |
Sleep,1000
WinGetTitle,GSdx,A
Size := SubStr(GSdx,8,3)
If Size is Digit
Break
}
Loop,Parse,GSdx,|
If A_Index = 2
{
Size := SubStr(A_LoopField,2,7)
StringSplit,Size,Size,x
Break
}
WinMove,A,,,,%Size1%,%Size2%
ExitApp

There is a way to set the window depending in the scaling mode you choose but it requires extra steps to be added to the code
If you do not mind black bars on either the left or right you can set the aspect ratio under GS Window under Emulation settings to 4:3 and it won't stretch the game out sideways. If you are not running the game in hardware mode you should be and untick native and set the scaling to 3x-4x and things won't look so low res
I've wanted something like this for a long time. The most I have is just something that sets a specific resolution and positions it on the screen.

(06-24-2013, 11:12 AM)vsub Wrote: [ -> ]snip

There is a way to set the window depending in the scaling mode you choose but it requires extra steps to be added to the code

That's great, thanks for writing it.

Though, it only seems to set it once, shortly after the window is opened. It doesn't re-adjust as the 'console'/game changes resolutions.

One that sets it to our scaled resolutions would be great. One that dynamically adjusts based on said resolutions would be incredible.
Well the script was maded to meet the OP requirements,I didn't add any extras and the script is closed when it set the window size

Tell me exactly how you want the script to work...I need to know all kind of conditions(when the resizing the be triggered)
And what you want to resize...only game game window or the console too(and to what size if you want the console too)?
May be he trying to make pcsx2 window size like in media player classic when we play video at 640x480 then window will automate to that size.
The code already does that...it get the native resolution and set the window to that size.
Like playing 640x448 size game,it will resize the window to 640x448

I almost finish rewriting the code to support scaling and custom resolution and to check if you are running another game after the last resizing.
I'm still checking some things.
Looks like it will be a lot more complicated to automatically resize the window(there are way too many conditions to be added so the code to always work and plus,it has to constantly get info(every 5 seconds)

So I made the code to work in a different way
1.Run the script(it doesn't matter when,before or after starting pcsx2)
2.Make the GSdx window active(he becomes active automatically anyway),wait the title to contains the native resolution in the title and right click on the window(inside the window,not the title)
3.The window will be resided according to your settings.

Native on - Will resize the window to the game native resolution

Native off and custom resolution is set - the code will get the info from the GSdx.ini file and resize the window to the custom resolution you set

Native off and scaling mode used - The code get the scaling mode,get the native resolution,multiply the width and height by the scaling mode and resize the window using the result.

Also along with resized,the window is also centered

Code:
#SingleInstance,Force
WinWaitActive,GSdx |
WinGet,GSdxW,ID,A
WinGet,PCSX2Path,ProcessPath,AHK_id %GSdxW%
SplitPath,PCSX2Path,,Dir

IfExist,%Dir%\inis\GSdx.ini
GSdx_ini = %Dir%\inis\GSdx.ini
Else
GSdx_ini = %A_MyDocuments%\pcsx2\inis\GSdx.ini

#IfWinActive,GSdx |
~RButton::
KeyWait,RButton
Critical
IfWinNotExist,ahk_id %GSdxW%
WinGet,GSdxW,ID,A
WinGet,WMode,MinMax,A
WinGetPos,X,Y
If (WMode != 0) or (X = 0 && Y = 0)
Return
MouseGetPos,,,,Control
If Control not in wxWindowClassNR1
Return

; ++++++++++++++Get Native Resolution+++++++++++++++++++

Loop
{
WinGetTitle,GSdx,ahk_id %GSdxW%
Size := SubStr(GSdx,8,3)
If Size is Digit
Break
}
Loop,Parse,GSdx,|
If A_Index = 2
{
Size := SubStr(A_LoopField,2,7)
StringSplit,Size,Size,x
Break
}

; ++++++++++++Read GSdx Settings++++++++++++

FileRead,GSdx_s,%GSdx_ini%
If GSdx_s contains nativeres=0
{
Native = off
If GSdx_s contains upscale_multiplier=1
{
Upscale = Custom
IniRead,resx,%GSdx_ini%,Settings,resx
IniRead,resy,%GSdx_ini%,Settings,resy
}
Else
IniRead,Upscale,%GSdx_ini%,Settings,upscale_multiplier
}
Else
{
Native = on
}

; +++++++++++++++Resize Window+++++++++++++++++++++++++


If ((Native = "off") && (Upscale = "Custom"))
{
WinMove,ahk_id %GSdxW%,,% (A_ScreenWidth/2)-(resx/2),% (A_ScreenHeight/2)-(resy/2),%resx%,%resy%

Return
}
If ((Native = "off") && (Upscale != "Custom"))
{
resx := Size1 * Upscale
resy := Size2 * Upscale
WinMove,ahk_id %GSdxW%,,% (A_ScreenWidth/2)-(resx/2),% (A_ScreenHeight/2)-(resy/2),%resx%,%resy%
Return
}
If Native = on
WinMove,ahk_id %GSdxW%,,% (A_ScreenWidth/2)-(Size1/2),% (A_ScreenHeight/2)-(Size2/2),%Size1%,%Size2%
Return
Pages: 1 2