Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Resolution switching through scripts and external tools (Windows 10)  (Read 1131 times)

0 Members and 1 Guest are viewing this topic.

spacorn

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 20
  • Last login:December 18, 2024, 09:26:43 am
  • I want to build my own arcade controls!
Hello everyone.

For several years, I've managed a couple of different crt_emudriver setups using AutoHotkey to change to the right resolution before launching certain applications.
Up until now, I've been using the following function I grabbed at some point from the AutoHotjey forums:

Code: [Select]
ChangeResolution( 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 )
}

In Windows 7, this works perfectly. It allows me to change to any driver-enabled resolution.
However, I recently started using Windows 10 in one of these setups, and I haven't been able to achieve the same freedom.

When using this script, I can get it to change resolutions down to a certain size (ex.: 800x480i, 640x480i). But when trying to change to the smaller end of the resolutions list (ex.: 320x240p, 256x224p), the script does nothing, even though these resolutions are available.
However, they can be enabled manually, either through Arcade OSD, or within applications that do their own resolution switching (ex.: RetroArch), or through the "Display settings" menu:



Something I noticed, and might be related to this, is that the smaller resolutions I'm unable to access through scripts are not being listed in the "List of valid modes" found in Advance Display Settings.



Any leads on how to fix this?
Something on the script I'm using, or the specific DLL calls used?
Maybe a way of adding the smaller modes to the "List of valid modes" and see if that fixes it?
Any suggestions of workarounds or external apps are also welcome. Anything I can use to continue switching resolutions through scripts.

Thanks in advance!


Edit: I found a solution, using a program called "QRes", which does screen resolution changes from the command line.
https://www.autohotkey.com/boards/viewtopic.php?style=19&p=366359#p366359
« Last Edit: September 13, 2024, 04:18:20 pm by spacorn »