Jump to content
LaunchBox Community Forums

Is there a way to have my pc resolution change automatically when launching a game in lb/bb?


jimbone007
 Share

Recommended Posts

Certain games Require different resolutions to make them playable ( sega model 3) or just so they are full screen (luigis mansion arcade)  and I was wondering if there's a way to change my pc's resolution automatically upon launching a game and then for It to switch back to what Its default is when closing the game? For example my resolution is 3840x2160 but in order to play sega model 3 games I need to have it set at 1024x768 or they are unplayable with my gun4ir guns. So When I launch the game in 3840x2160 I'd like it to change to 1024x768 to play the game then when I exit the game the res would go back to 3840x2160. I was thinking ahk but I'm not that great at creating my own ahk. Any help would be great.

Link to comment
Share on other sites

I dont know where the topic is, but one user of the LB community create a bat file to launch BigBox in a different resolution, maybe you can use ore modify the bat

 

REM Force script to run minimized
if not "%minimized%"=="" goto :minimized
set minimized=true
start /min cmd /C "%~dpnx0"
goto :EOF
:minimized

REM Change resolution for BigBox
.\QRes.exe /x 1920 /y 1080

REM Launch BigBox
.\BigBox.exe

REM Wait for BigBox processs to terminate
:repeat
::### ??? need to wait on BigBox.exe to close before executing next command
tasklist /fi "imagename eq BigBox.exe"|find /i "=========================" >nul 2>nul &&(
   w32tm /stripchart /computer:localhost /period:10 /dataonly /samples:2  1>nul
   goto :repeat
)

REM Change resolution back
.\QRes.exe /x 3440 /y 1440

 

Link to comment
Share on other sites

8 hours ago, jimbone007 said:

Certain games Require different resolutions to make them playable ( sega model 3) or just so they are full screen (luigis mansion arcade)  and I was wondering if there's a way to change my pc's resolution automatically upon launching a game and then for It to switch back to what Its default is when closing the game? For example my resolution is 3840x2160 but in order to play sega model 3 games I need to have it set at 1024x768 or they are unplayable with my gun4ir guns. So When I launch the game in 3840x2160 I'd like it to change to 1024x768 to play the game then when I exit the game the res would go back to 3840x2160. I was thinking ahk but I'm not that great at creating my own ahk. Any help would be great.

Supermodel3 emulator supports per game settings including resolution and should switch automatically. If you start the emulator from a command prompt and pass the resolution as a parameter does it no switch?

If you have to switch to 1024x768 to use Gun4IR, you still don't have it configured right yet. Are you using the right content mode in Gun4IR? You aren't stretching the game in the emulator to 16:9 resolution are you?

Link to comment
Share on other sites

11 hours ago, DerSchlachter said:

I dont know where the topic is, but one user of the LB community create a bat file to launch BigBox in a different resolution, maybe you can use ore modify the bat

 

REM Force script to run minimized
if not "%minimized%"=="" goto :minimized
set minimized=true
start /min cmd /C "%~dpnx0"
goto :EOF
:minimized

REM Change resolution for BigBox
.\QRes.exe /x 1920 /y 1080

REM Launch BigBox
.\BigBox.exe

REM Wait for BigBox processs to terminate
:repeat
::### ??? need to wait on BigBox.exe to close before executing next command
tasklist /fi "imagename eq BigBox.exe"|find /i "=========================" >nul 2>nul &&(
   w32tm /stripchart /computer:localhost /period:10 /dataonly /samples:2  1>nul
   goto :repeat
)

REM Change resolution back
.\QRes.exe /x 3440 /y 1440

 

Thanks, I'll try playing around with this.

Link to comment
Share on other sites

4 hours ago, Headrush69 said:

Supermodel3 emulator supports per game settings including resolution and should switch automatically. If you start the emulator from a command prompt and pass the resolution as a parameter does it no switch?

If you have to switch to 1024x768 to use Gun4IR, you still don't have it configured right yet. Are you using the right content mode in Gun4IR? You aren't stretching the game in the emulator to 16:9 resolution are you?

Its only sega model 3 that I need to change my pc res to match the emulators res of 1024x768 for the guns to be accurate. I have most of the other emulators/games working on 3840x2160. I have the gun4ir set to 4:3. Its not the gun4ir that's the issue its sm3. I'm running a older version of SM3 because the newer ones didn't change the accuracy problem at all and it runs the games way to fast. I stuck with the version of model 3 I got running the best but I have to change the resolution of my pc to match the res of the emulator to get any kind of accuracy in the game after calibration. 

Link to comment
Share on other sites

I also want this for other games besides SM3 though. Luige's Mansion arcade needs to run at 1920x1080 to be full screen. I'd rather not have to exit bb to change my res so I can play this 1 game full screen. If I could force it to either change resolution when games launched or to go full screen through command prompt or ahk I'd prefer to do that but I don't Know what I need to type in to make that happen.

Link to comment
Share on other sites

4 hours ago, Headrush69 said:

Supermodel3 emulator supports per game settings including resolution and should switch automatically. If you start the emulator from a command prompt and pass the resolution as a parameter does it no switch?

I'm not sure how to try doing this?I have sm3 as the emulator in lb. Are you saying I need to I need to put the resolution in where it says Defualt command line parameters in the edit emulator settings of lb? 

Link to comment
Share on other sites

5 hours ago, jimbone007 said:

 I'm running a older version of SM3 because the newer ones didn't change the accuracy problem at all and it runs the games way to fast. I stuck with the version of model 3 I got running the best but I have to change the resolution of my pc to match the res of the emulator to get any kind of accuracy in the game after calibration. 

Well it's hard to say much since we have no idea what version you are actually using then. Have you played with the powerpc frequency option to try to correct the playing speed?

I can only say that on the newer versions, they all run fine for me but a few I do have the powepc frequency set appropriately. 

5 hours ago, jimbone007 said:

I'm not sure how to try doing this?I have sm3 as the emulator in lb. Are you saying I need to I need to put the resolution in where it says Defualt command line parameters in the edit emulator settings of lb? 

You could pass the resolution as a command line option, but I was referring to setting per game options in the supermodel.ini config file. Depending on how old your version is, I can't say what options are supported and work, just know the newer ones do.

Link to comment
Share on other sites

Its version 795. I have tried messing with the powerpc frequency and if I remember correctly it was way to fast or way to slow and I couldn't find a medium ground which is why I went back to using the older version I'm currently using. I have the res in the supermodel.ini config set to 1024x768. If  I change it it changes the size of the emulated screen and wont fit my monitor (tv).  If I leave it where it fits my tv but don't change my monitors (tv) res to the same as sega model 3 it will still fit my screen but then the accuracy is so bad that I can't even calibrate the guns. If I change my monitors res to 1024x768 then it all works properly. fits full screen and the accuracy of the guns works close to perfect however I don't want my screen res to be this way as it will affect other emulators and games and I don't want to keep switching it back and forth every time I want to play sega model 3 which is why I'm looking for a way for my lb to just automatically change my pc's res to match the game I'm playing because I told it what it needs to be through command line or by whatever means will work. My problem is I don't know how to do that lol. To be clear I'm using a tv as my monitor but I am not changing any settings on my tv just my pc as far as res.

Link to comment
Share on other sites

In the properties for supermodel.exe, you do not have any high DPI scaling options enabled do you?

When the game ran too fast, when you were adjusting the powerpc frequency, did you also include the throttle option?

Do your other emulators change resolution automatically? It's strange supermodel.exe would be different? There aren't any application specific options in your video card utility settings? (NVIDIA settings for example)

Can you post your supermodel.log file after trying to run without changing your resolution to 1024x768 manually?

I understand what you want, but it seems something isn't right and having to use 1024x768 to make your Gun4IRs accurate is working around the real issue.

If you just want to just continue working around it, if you google there are many simple and free resolution changing apps. You just need to add them as an additional app in LB and select the option to run before main application. I can't speak to which app is best as I don't need one, so I'll leave it to you to decide.

 

Link to comment
Share on other sites

Any PC program that requires a different resolution than the current in use one should change the resolution itself, this is the same for emulators and media players especially. Going to ask the obvious but you are running in exclusive fullscreen right? Windowed fullscreen programs will always run at the currently selected PC resolution as they are what they say, windows but at full size, and not "Exclusive fullscreen".

Link to comment
Share on other sites

7 hours ago, Headrush69 said:

In the properties for supermodel.exe, you do not have any high DPI scaling options enabled do you?

When the game ran too fast, when you were adjusting the powerpc frequency, did you also include the throttle option?

Do your other emulators change resolution automatically? It's strange supermodel.exe would be different? There aren't any application specific options in your video card utility settings? (NVIDIA settings for example)

Can you post your supermodel.log file after trying to run without changing your resolution to 1024x768 manually?

I understand what you want, but it seems something isn't right and having to use 1024x768 to make your Gun4IRs accurate is working around the real issue.

If you just want to just continue working around it, if you google there are many simple and free resolution changing apps. You just need to add them as an additional app in LB and select the option to run before main application. I can't speak to which app is best as I don't need one, so I'll leave it to you to decide.

 

1. No I don't

2. Yes I tried the throttle settings also

3. Yes they all do with the exception of luigis mansion arcade on teknoparrot unless I manually switch to 1920x1080 the game isn't full screen.

I just played around with the settings again and got the same results. If I change the res in sm3 to 3840x2160 or 1920x1080 Its way to big and doesn't fit the 4:3 aspect ratio of the screen.  I only see the corner of the game in the center of my tv. If I leave the sm3 res at 1024x768 and the pc res at 3840x2160 the game is sized properly and is in 4:3 aspect ratio ( same as my guns are set to) but the guns are way off even after in game calibration. If I set my pc to 1024x768 and keep the sm3 on 1024x768 then it properly fits the screen and the guns are accurate. I know something doesn't seem right but after days of messing with it the best solution I found was to just switch my pc res to match the sm3 res and make it playable that way which is why I was looking for a simple way to just change the pc res automatically back and forth when games launch. I'd prefer to have it all run properly and with most current versions but when I tried that It just created more problems for some reason. I tried multiple versions of the emulator including the latest build from the forum. I followed tutorials along with messing with the power pc/ throttle settings. multiple roms from different download collections. Messed around with the gun4ir settings also. Maybe it is the gun4ir software but I've got probably half a dozen other emulators working with them with very little issues remaining. 

 

Link to comment
Share on other sites

First, I don't own any lightguns so I don't know anything about setting them up.

37 minutes ago, jimbone007 said:

If I change the res in sm3 to 3840x2160 or 1920x1080 Its way to big and doesn't fit the 4:3 aspect ratio of the screen.  I only see the corner of the game in the center of my tv. If I leave the sm3 res at 1024x768 and the pc res at 3840x2160 the game is sized properly and is in 4:3 aspect ratio ( same as my guns are set to) but the guns are way off even after in game calibration

Have you set DPI scaling in the supermodel.exe to 'Application'? Right click supermodel.exe --> Properties --> Go to the 'Compatibility' tab --> Tick 'Override high DPI scaling behavior' and select 'Application'. Games should now run fullscreen when rendered in 2160p on a 2160p screen.

 

Like Headrush69 said, in LaunchBox you can pass per game command-line parameters to Supermodel. More on Supermodel's command-line parameters on the Supermodel forum. (You need to register first to access the Supermodel forum.)

Or you can edit Supermodel.ini in the Supermodel\Config folder.

WideScreen=1
VSync=1
XResolution=3840
YResolution=2160

1 = on

0 = off

You can also add per game setting to Supermodel.ini. Add the rom name between square brackets. Then underneath add settings like this:

[srally2]
PowerPCFrequency=100
[lemans24]
WideScreen=0

Examples are for Sega Rally 2 and Le Mans 24.

Link to comment
Share on other sites

57 minutes ago, jimbone007 said:

3. Yes they all do with the exception of luigis mansion arcade on teknoparrot unless I manually switch to 1920x1080 the game isn't full screen.

Teknoparrot games are a whole different different thing so it makes sense,

59 minutes ago, jimbone007 said:

I just played around with the settings again and got the same results. If I change the res in sm3 to 3840x2160 or 1920x1080 Its way to big and doesn't fit the 4:3 aspect ratio of the screen.  I only see the corner of the game in the center of my tv. If I leave the sm3 res at 1024x768 and the pc res at 3840x2160 the game is sized properly and is in 4:3 aspect ratio ( same as my guns are set to) but the guns are way off even after in game calibration. If I set my pc to 1024x768 and keep the sm3 on 1024x768 then it properly fits the screen and the guns are accurate. 

Without a log file even though you say the games run or don't run, we don't know if the resolution was changed or not and to what resolution. You mention that that this is a TV monitor? If so I have a suspicion that the TV (like most) has a scaling feature and that somehow it is involved in your issues. You need to go into your TV menu system and turn those options off. I think this might explain some of the issues.

Link to comment
Share on other sites

Where do I find the log file? the resolution does change in the emulator for the emulated game but not for my pc. My pc stays 2160 and the game runs 1024x764. Which is fine for games other than light gun games which is what I want running the most.

Link to comment
Share on other sites

Thanks for the help everyone. I ended up asking over on the ahk forum and got what I needed. Link includes a download link for the software needed and ahk script to make everything work along with instructions on how to install the software. Just plug in your emulator/game and resolutions. Here's the link for anyone else trying to do this :

https://www.autohotkey.com/boards/viewtopic.php?f=18&t=81921&p=459348#p459348

Link to comment
Share on other sites

  • 1 month later...
Posted (edited)

if anyone wants to do exactly what you're after without installing other stuff like qres, you can actually do this all in AHK without additional programs/software

here is an example I what I am doing. I also got this from the AHK forums, the actual bit on how to adjust all the display parameters that is. I am using this because I have a 120Hz display and wanted to play the Super Mario 64 PC Port and it kinda sorta freaks out when you enable the 60FPS mod but are on a 120Hz. So I needed to change my refresh rate to 60Hz when game launches and then back to 120Hz when it exits. The concept is the same, but I would think this is more elegant due to not needing additional resources like qres

Apologies, the AHK script I originally included seemed to only work with the AHK version included with RocketLauncher but NOT the AHK version included with LaunchBox. I have cleaned up this script and edited my post to include this version that is much more compact but now actually works with LaunchBox. Apparently some things I was using were deprecated so the actual bits that were supposed to change display properties was not working. Here is updated script code.

 

WinWait, ahk_exe Super Mario 64 PC.exe
ChangeDisplaySettings(32, 3840, 2160, 60) 

WinWaitClose, ahk_exe Super Mario 64 PC.exe
ChangeDisplaySettings(32, 3840, 2160, 120) 

ChangeDisplaySettings(cD, sW, sH, rR) 
	{
		VarSetCapacity(dM,156,0), NumPut(156,2,&dM,36)
		DllCall("EnumDisplaySettingsA", UInt,0, UInt,-1, UInt,&dM), NumPut(0x5c0000,dM,40)
		NumPut(cD,dM,104), NumPut(sW,dM,108), NumPut(sH,dM,112), NumPut(rR,dM,120)
		Return DllCall("ChangeDisplaySettingsA", UInt,&dM, UInt,0)
	}

 

 

Edited by skizzosjt
updating AHK code to work with LaunchBox
Link to comment
Share on other sites

  • 1 month later...

@skizzosjt Where do you put this? Is it also possible to change scaling? My default resolution is 3240x2160 with 175% scale. Using Launchbox and managing your collections is excellent with so much screen space. But I would like to change the resolution to 1920x1080 at 100% whenever an emulator/game is run or BigBox itself. Reason is because I'm also going to output on my TV which has this ratio so I can make sure things work/output the same way, like bezels.

Link to comment
Share on other sites

4 hours ago, X1pheR said:

@skizzosjt Where do you put this? Is it also possible to change scaling? My default resolution is 3240x2160 with 175% scale. Using Launchbox and managing your collections is excellent with so much screen space. But I would like to change the resolution to 1920x1080 at 100% whenever an emulator/game is run or BigBox itself. Reason is because I'm also going to output on my TV which has this ratio so I can make sure things work/output the same way, like bezels.

Hi @X1pheR I think best way would be to put it into the "Running Script" field for EVERY emulator you have for that script to run for any game launching from LaunchBox

 

For the script to run if BigBox was launched would require more steps. What I personally would do is setup a Window Task Scheduler event to run this script anytime BigBox is launched. If you're not familiar with using Windows Task Scheduler fret not, this task is pretty straight forward. It's not long, or hard (insert Michael Scott saying "THAT'S WHAT SHE SAID!" here), it only takes a couple mins to configure something like that. If you  need help with that, I can give more advice if you need it!

 

Now I had no idea how to help with the resolution scaling but did some quick googling, and then did some quick testing on my own system. So....I figured it out in like 15mins. With that said....you are now going to be a recipient of some friendly ribbing, and get a "google is your friend" line from me......I have yet to not find a solution to any problem that AHK doesn't resolve one way or the other. You just gotta look!

 

This is not a copy and paste kind of script. It uses values that will be specific to your systems display(s). You will need to get into the registry editor and take note of which entry is your display. I have a Samsung QN90A as my display but had several SAMblahblahblabh entries so I didn't know which was which at first. So, I took note of what the DPI values where....then in Windows Display Settings page adjusted the DPI scaling and took note of which entry changed it's DPI value. So I now know which reg entry I need to use. Once I figured that out I tried running the code and it worked but wasn't changing right away.....I would have to log out and back in and that isn't what we want this to do. You actually need to pair it with that script from my previous post to get it to work immediately. It seems that using the script to change a resolution, even if you enter in all the same values you're currently using, THEN, the scaling changes occur immediately. For example....

 

image.thumb.png.e73cb204f26235c01579b47959e27dde.png

I run 4K - 3840x2160 @ 120hz and 100% scaling. To get this to change to 175% scaling I used the script I previously posted, looking just like this

RegWrite, REG_DWORD, HKEY_CURRENT_USER\Control Panel\Desktop\PerMonitorSettings\SAM713F16780800_01_07E5_37^19B9AEE5A23135D262721FA060719964, DpiValue, -4
ChangeDisplaySettings(32, 3840, 2160, 120)
ChangeDisplaySettings(cD, sW, sH, rR) 
	{
		VarSetCapacity(dM,156,0), NumPut(156,2,&dM,36)
		DllCall("EnumDisplaySettingsA", UInt,0, UInt,-1, UInt,&dM), NumPut(0x5c0000,dM,40)
		NumPut(cD,dM,104), NumPut(sW,dM,108), NumPut(sH,dM,112), NumPut(rR,dM,120)
		Return DllCall("ChangeDisplaySettingsA", UInt,&dM, UInt,0)
	}

 

Please note because I have 4K screen, the "recommend" scaling from Windows is 300%. This means if my DPI value was set to 0 it would go to 300% scaling. Since Windows uses this in same increments as the drop down menus means 100% scaling would be -7, 125% is -6, 150% is -5, and 175% is -4 and so on. You can use positive numbers too. For me I could only go to 1 since there is only 1 selection above default (0) which is 350%

image.thumb.png.306b8019026b54cb16d932de5c3a477e.png

 

So my above example shows how to only change the scaling while keeping all other display settings the same. You would simply adjust the other display settings accordingly if you wanted to change additional parameters. For example, if I wanted to change to 1080p like you've described. Take note I used -2 due to 150% is the default scaling when I switch to 1920x1080....however....I did try leaving -7 in there and it worked fine. So I bet how this works is if you were to "overextend" the value beyond the options that are available it just goes to the max or min value that is available. You can also use the hexadecimal or decimal values if you really wanted.....but that seems sorta unnecessary to me when this selection # relative to the recommended scaling option is possible.

RegWrite, REG_DWORD, HKEY_CURRENT_USER\Control Panel\Desktop\PerMonitorSettings\SAM713F16780800_01_07E5_37^19B9AEE5A23135D262721FA060719964, DpiValue, -2
ChangeDisplaySettings(32, 1920, 1080, 120)
ChangeDisplaySettings(cD, sW, sH, rR) 
	{
		VarSetCapacity(dM,156,0), NumPut(156,2,&dM,36)
		DllCall("EnumDisplaySettingsA", UInt,0, UInt,-1, UInt,&dM), NumPut(0x5c0000,dM,40)
		NumPut(cD,dM,104), NumPut(sW,dM,108), NumPut(sH,dM,112), NumPut(rR,dM,120)
		Return DllCall("ChangeDisplaySettingsA", UInt,&dM, UInt,0)
	}

 

OK so again, you cannot copy and paste this, it won't work for you! Gotta change out the appropriate values per how your system is setup. Here is links to what I found that got me educated on this script ability. All I did was google "change resolution scaling with AHK script" lol so hence the friendly ribbing. With that said.....I should thank you at the same time because I learned something new! Will I ever use this....probably not lol I always use 100% scaling

https://www.autohotkey.com/boards/viewtopic.php?t=65908

https://www.tenforums.com/graphic-cards/171539-hotkey-scaling-windows-10-a.html

https://sindenlightgun.miraheze.org/wiki/DPI

https://www.reddit.com/r/AutoHotkey/comments/ad6muo/change_screen_scaling_with_immediate_effect/

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...