Regarding [Smooth mode] & [Reduce screen flickering]

Started by LiTTleDRAgo, November 23, 2018, 03:56:58 am

Previous topic - Next topic

LiTTleDRAgo

November 23, 2018, 03:56:58 am Last Edit: November 23, 2018, 03:58:36 am by LiTTleDRAgo
Is there any way to change smooth mode & reduce screen flickering with a script?

Spoiler: ShowHide

https://i.imgur.com/zy0Dd4s.jpg

Blizzard

I'm not 100% sure, but I think those settings are put into the registry. If you could track down where they are, you could easily use a registry modifier script to change that.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

LiTTleDRAgo

Oh, you're right!
Thanks Blizz.

Spoiler: ShowHide

https://i.imgur.com/mf0zIZy.jpg

HKEY_CURRENT_USER/Software/Enterbrain/RGSS/SmoothMode
HKEY_CURRENT_USER/Software/Enterbrain/RGSS/WaitForVsync

KK20

I've been tinkering with this for the past couple of hours and don't think it's possible.

OpenKey = Win32API.new('advapi32', 'RegOpenKeyEx', 'lpllp', 'l')
SetKey = Win32API.new('advapi32', 'RegSetValueEx', 'lpllpl', 'l')
CloseKey = Win32API.new('advapi32', 'RegCloseKey', 'l', 'l')


handle = [0].pack('L')
key = [0x80000001, # HKEY_CURRENT_USER , ref: https://www.rubydoc.info/stdlib/dl/2.0.0/Win32/Registry/Constants
       'Software\\Enterbrain\\RGSS',
       0,
       2, #KEY_SET_VALUE
       handle]
p OpenKey.call(*key) # successful = 0
hkey = handle.unpack('L').first


val = [0].pack('L')
reg = [hkey,
      'PlaySound',#'SmoothMode',
      0, # reserved, keep it 0
      0x10, #REG_DWORD
      val, # value to be set
      4] # size of value, in bytes
p SetKey.call(*reg) # successful = 0

p CloseKey.call(hkey)

I had regedit open while running the game and can observe that the registry key did change. But when I press F1 to access the window, the change is not reflected. And after closing the game, the registry key reverts back. If I were to call this on a different key (say RGSS3), then the change is permanent. Opening a RMVXA Game.exe and pressing F1 reflected the updated value.

So my guess is that Game.exe reads the registry keys and values, uses them to initialize the values in the F1 window, then runs the game. When the EXE closes, it checks the values in the F1 window and applies them directly to the registry keys/values. So any registry key modifications done in-game are ultimately ignored.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

KK20

Well there is ONE way, but would require a bit more work.
If you open up another Game.exe *before* closing the first one, you can carry over the change to the new Game.exe.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

LiTTleDRAgo

I guess it can be do it like this:

Detect if registry key SmoothMode is 0
- Change registry key SmoothMode to 1.
- Open new game instances.
- Exit old game instances.
else
- Nothing happens
end

Blizzard

December 03, 2018, 04:42:50 pm #7 Last Edit: December 03, 2018, 04:45:16 pm by Blizzard
You might wanna try call RegFlushKey before RegCloseKey. https://docs.microsoft.com/en-us/windows/desktop/api/winreg/nf-winreg-regclosekey

Quote
The RegCloseKey function does not necessarily write information to the registry before returning; it can take as much as several seconds for the cache to be flushed to the hard disk. If an application must explicitly write registry information to the hard disk, it can use the RegFlushKey function. RegFlushKey, however, uses many system resources and should be called only when necessary.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.