Parse Posted November 10, 2023 Posted November 10, 2023 This core: https://forums.libretro.com/t/official-release-thread-for-windowcast-core/40464 So basically it allows any standalone game and emulators to work within RA, so you can use its shaders. In my setup on LB, I used RA on emulator, path to .txt and the game as an addition app to start before RA. It kind of works, but the game window starts on top of RA and I cound't find a way to exit both by pressing esc. I think it would be ideal to have a bit of delay to start RA. So, any suggestions? Quote
Nocta Posted April 29, 2024 Posted April 29, 2024 I'm very much interested if you found a fix in the meantime. Quote
skizzosjt Posted May 3, 2024 Posted May 3, 2024 I've been playing with this a couple times now and it's rather experimental as the dev says. Awesome idea, but still very much a WIP. They have mostly great notes on how to setup and use it, but for the life of me why the hell they didn't include the oh so mandatory setting of making Retroarch not pause when the window is not active in these notes is beyond me! I had to read through the libretro thread to find others talking about it. Makes sense, obviously, that it is req, but that was something that slipped through the cracks. My main gripe is it doesn't seem to work with putting Retroarch in fullscreen. Doesn't matter if it's exclusive or windowed fullscreen or if I used the software or vulkan version. When you use the CTRL+ALT+T shortcut it plops the game window ON TOP of Retroarch. When in fullscreen if the game window is not on top, inputs will not be detected at all. So I must resort to only using Retroarch in a window and this is not desirable, at all. You are stuck seeing the title menu and file menu and Windows system tray on the display. Started farting around with an AHK script tonight to change the window style of Retoarch, removing the title and file menu, it's borders, resizing the window , and hiding the system tray. This works as I hoped it would and doesn't mess up behavior with this core! But I'm just not getting how some other users say fullscreen works fine.....seems "YMMV" kinda thing. I'm one of the unlucky ones who cannot use fullscreen. They are aware of the issue, but seem to think it's just a Nvidia issue as they advise on changing a setting in the Nvidia control panel. I'm on an AMD card so not sure if that is why I have the problem. There is no equivalent setting in Radeon Settings for me to change.....or so I thought. (as I type this....I search for the equivalent setting with google) I found this thread and seemed hopeful but I didn't find any difference when toggling this setting "OpenGL Triple Buffering" and thought I was out of luck.....or so I thought again! I found a workaround thanks to this response from one of the AMD team Quote "Currently, DXGI support for Vulkan is enabled by default for specific features. However, end-users are not allowed to control this functionality. It will be enabled by default eventually. Users can turn it on by enabling the OS HDR mode with a HDR capable display." https://community.amd.com/t5/opengl-vulkan/dxgi-swapchain-on-opengl-and-vulkan-games/m-p/578792 LMAO holy cow! TURNING ON HDR ALLOWS ME TO USE FULLSCREEN PROPERLY WITH THIS CORE! This must be one of the weirdest workarounds I've stumbled onto. I know this will not help users without a HDR capable display but it's an option to try if you have the means. Little weird it's working like this as another post from them implies these settings about "DXGI support" should be enabled by default, but it sure isn't working for me without enabling HDR. Though I see their post date is from 12/7/23 and my AMD GPU drivers are v23.8.2 so I will need to update to the latest 24.4.1 version and see if that makes a difference! Fingers crossed!🤞 Then I just need to automate the LB/BB launching process. Once I iron it all out, I can share my experience and methods to get all this working. Quote
skizzosjt Posted May 6, 2024 Posted May 6, 2024 (edited) Gloomy rainy Sunday here in my neck of the woods. Perfect time to tackle this project. Unfortunately updating to latest AMD GPU drivers did not help me one way or the other. I still cannot use WindowCast core and put Retroarch in fullscreen unless I have HDR enabled in Windows Display Settings. So I played with a script that can handle launching it both ways, with or w/o HDR enabled Since I assume users would be like me and already have games imported, I wanted to design a script to work with everything configured as it currently is. No need to edit game entries and the like. I tested mainly with native Windows games, those being Streets of Rage 4, Raiden III, Dead Cells, Ninja Gaiden Sigma 2, Andro Dunos II, and Natsuki Chronicles. Tried some other emulators like Dolphin and Yuzu and didn't find a different experience there. Same things went good or poor. The bad part is more I use this the more I run into random issues. Stuff that results in it just booting to white screen and do nothing. Or maybe Retoarch opens to the point you see its taskbar icon but then no window appears. Playing a video in VLC or just having Firefox open results in funny business like that. I know that is not a normal use case, but I usually have other stuff going on as I test stuff like this so that's how that came about. Randomly I'll get some weird artifacting and inputs will not be recognized. But this all seems on par with something experimental and in progress. I didn't really notice any lag or stuttering or FPS loss. That stuff only seems to get introduced depending on how crazy you go with implementing Mega Bezels which I assume is why anyone would want to use this core in the first place. And that's really the shader's fault, not the core. On the good side, when it works, it works well. Every game and emulator I tried worked. A couple games needed additional means to work well and I'll mention that later. Lots of great shader options out there to use, I didn't run into issue trying any certain one. They all seemed to work as expected. Some bits I notice is the text file is interpreted as case insensitive and I did test every game I tried with both their window title and exe file name. Only one did not work with the exe file name, that was Streets of Rage 4. Booted, but just a white screen (made sure it was not due to above bug of having other stuff open). If I use its window title it works fine. So that was an outlier. With that in mind I thought I would design my scripts to be case insensitive too in order for it to properly use this file for window or exe file names. Here is what I come up for me launching with HDR enabled. This will launch Retroarch into fullscreen. Users copying this will need to adjust RetroarchEXE and WindowCastFile variables to the correct path where they are stored on your system. Optionally you could also adjust TimeOutDelay, RunRetroarchDelay, and FocusHotkeyDelay if needed. It's going to make use of the file you put the window title or game exe name in. When the script starts it's looking for one of these windows or processes to exist before continuing. If it takes too long (10 secs), it will timeout and a message box will pop up to tell you script is terminating. Once the window is found it's going to launch Retroarch and then use the CTRL+ALT+T hotkey to push focus to the game so inputs are detected. Then it's going to wait for the game/emulator to close before closing Retroarch and exiting the script. Escape is also a hotkey to close Retroarch. Spoiler SetWorkingDir, % A_ScriptDir SetTitleMatchMode, RegEx ; seems to work like mode 2 (partial match) but allows for use of expressions RetroarchWinTitle := "ahk_exe retroarch.exe" RetroarchEXE := "..\..\..\Emulators\Retroarch\retroarch.exe" WindowCastFile := "..\..\..\ROMS\WindowCast\WindowCast.txt" WindowCastListArray := [] TimeOutDelay := 10000 ; close script if game/emulator window is not found in X seconds RunRetroarchDelay := 1500 ; delay between finding game/emulator window and then opening Retroarch FocusHotkeyDelay := 2000 ; delay between launching Retroarch and sending hotkey to grab focus of game/emulator window. *HDR/Fullscreen method ONLY* ; Read WindowCast window list file and parse into array FileRead, WindowCastList, %WindowCastFile% Loop, Parse, WindowCastList, `r, `r`n { If (InStr(A_LoopField, "#")) Continue WindowCastListArray.Push(A_LoopField) } ; Loop through list to check which window exists InitialTime := A_TickCount WindowCheck: Loop, % WindowCastListArray.Count() { ; Check if entry is an exe If (InStr(WindowCastListArray[A_Index], ".exe")) { If (WinExist("ahk_exe " . "i)" . WindowCastListArray[A_Index])) { ExistingWindow := WindowCastListArray[A_Index] Break } } ; If entry is not an exe, it is a window title Else If (WinExist("i)" . WindowCastListArray[A_Index])) { ExistingWindow := WindowCastListArray[A_Index] Break } DurationTime := A_TickCount - InitialTime If (DurationTime >= TimeOutDelay) { MsgBox, 4096, Window Check Timeout, Couldn't find existing window. Exiting script! ExitApp } } If (ExistingWindow = "") Goto, WindowCheck Sleep, RunRetroarchDelay Run, %RetroarchEXE% -L wgc_libretro.dll %WindowCastFile% -f WinWait, % RetroarchWinTitle Sleep, % FocusHotkeyDelay ; Sends hotkey to give focus to game window so inputs are detected Send {LCtrl down}{LAlt down}{t down}{t up}{LAlt up}{LCtrl up} If (InStr(ExistingWindow, ".exe")) WinWaitClose, % "ahk_exe" . "i)" . ExistingWindow Else WinWaitClose, % "i)" . ExistingWindow WinClose, % RetroarchWinTitle ExitApp ; Hotkey to exit Retroarch and terminate script $Esc:: ; keyboard modifier ($) is needed so input isn't "eaten" by the game WinClose, % RetroarchWinTitle ExitApp Same thing but this is how I first had to think about stuff if I am in SDR mode. If you have issues like me with putting Retroarch into fullscreen with this core and do not have the option of using HDR then you will want to use this version. What is different here is changing window style of Retroarch so it takes up your whole screen without the system thinking it's in fullscreen mode. Spoiler SetWorkingDir, % A_ScriptDir SetTitleMatchMode, RegEx ; seems to work like mode 2 (partial match) but allows for use of expressions RetroarchWinTitle := "ahk_exe retroarch.exe" RetroarchEXE := "..\..\..\Emulators\Retroarch\retroarch.exe" WindowCastFile := "..\..\..\ROMS\WindowCast\WindowCast.txt" WindowCastListArray := [] TimeOutDelay := 10000 ; close script if game/emulator window is not found in X seconds RunRetroarchDelay := 1500 ; delay between finding game/emulator window and then opening Retroarch ; Read WindowCast window list file and parse into array FileRead, WindowCastList, %WindowCastFile% Loop, Parse, WindowCastList, `r, `r`n { If (InStr(A_LoopField, "#")) Continue WindowCastListArray.Push(A_LoopField) } ; Loop through list to check which window exists InitialTime := A_TickCount WindowCheck: Loop, % WindowCastListArray.Count() { ; Check if entry is an exe If (InStr(WindowCastListArray[A_Index], ".exe")) { If (WinExist("ahk_exe " . "i)" . WindowCastListArray[A_Index])) { ExistingWindow := WindowCastListArray[A_Index] Break } } ; If entry is not an exe, it is a window title Else If (WinExist("i)" . WindowCastListArray[A_Index])) { ExistingWindow := WindowCastListArray[A_Index] Break } DurationTime := A_TickCount - InitialTime If (DurationTime >= TimeOutDelay) { MsgBox, 4096, Window Check Timeout, Couldn't find existing window. Exiting script! ExitApp } } If (ExistingWindow = "") Goto, WindowCheck Else { Sleep, % RunRetroarchDelay Run, %RetroarchEXE% -L wgc_libretro.dll %WindowCastFile% WinWait, % RetroarchWinTitle WinSet, Style, -0x40000, %RetroarchWinTitle% ; removes sizing borders WinSet, Style, -0xC00000, %RetroarchWinTitle% ; removes title bar DllCall("SetMenu", uint, WinActive(RetroarchWinTitle), uint, 0) ; removes file menu bar WinHide, ahk_class Shell_TrayWnd ; hides system tray ; cannot use exact screen dimensions or else it acts just like normal fullscreen ; normal fullscreen can make the game image freeze in Retroarch ; add +1 to width so it is not considered true fullscreen WinMove, %RetroarchWinTitle%, , 0, 0, % A_ScreenWidth + 1, %A_ScreenHeight% } ; Sends hotkey to give focus to game window so inputs are detected Send {LCtrl down}{LAlt down}{t down}{t up}{LAlt up}{LCtrl up} If (InStr(ExistingWindow, ".exe")) WinWaitClose, % "ahk_exe" . "i)" . ExistingWindow Else WinWaitClose, % "i)" . ExistingWindow WinClose, % RetroarchWinTitle WinShow, ahk_class Shell_TrayWnd ExitApp ; Hotkey to exit Retroarch, show Windows system tray, and terminate script $Esc:: ; keyboard modifier ($) is needed so input isn't "eaten" by the game WinClose, % RetroarchWinTitle WinShow, ahk_class Shell_TrayWnd ExitApp For anyone who wants to automate that, here is what I'm employing in a single script. It's detecting if HDR is enabled or not. You will need to get the proper registry address yourself which is going to be specific to your system's display. I have a main system in my computer room and a HTPC in the living room so this is why I have a line checking which computer is running but I haven't bothered to get the address for the other display yet. Spoiler SetWorkingDir, % A_ScriptDir SetTitleMatchMode, RegEx ; seems to work like mode 2 (partial match) but allows for use of expressions RetroarchWinTitle := "ahk_exe retroarch.exe" RetroarchEXE := "..\..\..\Emulators\Retroarch\retroarch.exe" WindowCastFile := "..\..\..\ROMS\WindowCast\WindowCast.txt" WindowCastListArray := [] TimeOutDelay := 10000 ; close script if game/emulator window is not found in X seconds RunRetroarchDelay := 1500 ; delay between finding game/emulator window and then opening Retroarch FocusHotkeyDelay := 2000 ; delay between launching Retroarch and sending hotkey to grab focus of game/emulator window. *HDR/Fullscreen method ONLY* ; Read WindowCast window list file and parse into array FileRead, WindowCastList, %WindowCastFile% Loop, Parse, WindowCastList, `r, `r`n { If (InStr(A_LoopField, "#")) Continue WindowCastListArray.Push(A_LoopField) } ; Loop through list to check which window exists InitialTime := A_TickCount WindowCheck: Loop, % WindowCastListArray.Count() { ; Check if entry is an exe If (InStr(WindowCastListArray[A_Index], ".exe")) { If (WinExist("ahk_exe " . "i)" . WindowCastListArray[A_Index])) { ExistingWindow := WindowCastListArray[A_Index] Break } } ; If entry is not an exe, it is a window title Else If (WinExist("i)" . WindowCastListArray[A_Index])) { ExistingWindow := WindowCastListArray[A_Index] Break } DurationTime := A_TickCount - InitialTime If (DurationTime >= TimeOutDelay) { MsgBox, 4096, Window Check Timeout, Couldn't find existing window. Exiting script! ExitApp } } If (ExistingWindow = "") Goto, WindowCheck ; Check if HDR is enabled ; Read HDR status in registry If (A_ComputerName = "DESKTOP-Z390") { RegRead, REG_DWORD, HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\MonitorDataStore\SAM713F16780800_01_07E5_37, AdvancedColorEnabled } Else If (A_ComputerName = "DESKTOP-B760") { ; NEED TO GET PROPER REGISTRY ADDRESS FOR HTPC DISPLAY! ; RegRead, REG_DWORD, HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\MonitorDataStore\SAM713F16780800_01_07E5_37, AdvancedColorEnabled } ; ######################################################################################### ; HDR VERSION: Runs in Retroarch fullscreen mode ; ######################################################################################### If (REG_DWORD = 1) { Sleep, RunRetroarchDelay Run, %RetroarchEXE% -L wgc_libretro.dll %WindowCastFile% -f WinWait, % RetroarchWinTitle Sleep, % FocusHotkeyDelay } ; ######################################################################################### ; SDR VERSION: Runs Retroarch in window mode, change its window style, and hide system tray ; ######################################################################################### Else { Sleep, % RunRetroarchDelay Run, %RetroarchEXE% -L wgc_libretro.dll %WindowCastFile% WinWait, % RetroarchWinTitle WinSet, Style, -0x40000, %RetroarchWinTitle% ; removes sizing borders WinSet, Style, -0xC00000, %RetroarchWinTitle% ; removes title bar DllCall("SetMenu", uint, WinActive(RetroarchWinTitle), uint, 0) ; removes file menu bar WinHide, ahk_class Shell_TrayWnd ; hides system tray ; cannot use exact screen dimensions or else it acts just like normal fullscreen ; normal fullscreen can make the game image freeze in Retroarch ; add +1 to width so it is not considered true fullscreen WinMove, %RetroarchWinTitle%, , 0, 0, % A_ScreenWidth + 1, %A_ScreenHeight% } ; Sends hotkey to give focus to game window so inputs are detected Send {LCtrl down}{LAlt down}{t down}{t up}{LAlt up}{LCtrl up} If (InStr(ExistingWindow, ".exe")) WinWaitClose, % "ahk_exe" . "i)" . ExistingWindow Else WinWaitClose, % "i)" . ExistingWindow WinClose, % RetroarchWinTitle WinShow, ahk_class Shell_TrayWnd ExitApp ; Hotkey to exit Retroarch, show Windows system tray, and terminate script $Esc:: ; keyboard modifier ($) is needed so input isn't "eaten" by the game WinClose, % RetroarchWinTitle WinShow, ahk_class Shell_TrayWnd ExitApp For emulators I put in the Running Script field a Run command for this WindowCast script. For ex Run, ..\..\Utilities\Scripts\WindowCast\WindowCast.ahk For native Windows games I mainly use scripts to launch them, so in those scripts I can add a line to run the WindowCast script (basically same as above) or you can add the WindowCast script as an Additional Application and check Automatically Run Before Main Application When testing Andro Dunos II this game forcefully runs in fullscreen mode much like a game from it's original era, ya know the 90's. So I just used DxWnd for the first time to force it into a window mode and that was a super easy experience. The included help files by means of a local html files helps explained how to use it perfectly. I had to use this program in order to make use of WindowCast with Andro Dunos II. Another one that needed (maybe subjective) unique care was Streets of Rage 4. When in window mode it defaults to a small window and does not remember its window size between launches. It looks way too pixelated at this small window size all scaled up to 4K so I had to get a better image quality here. Simply maximizing the game window still leaves letter boxing because for whatever reason they didn't make window size default to a 16:9 aspect ratio but the game itself maintains aspect ratio...hence black bars will appear if it's not exact 16:9. I figure using WinMove commands would help and they do move and resize it just fine, but the game doesn't seem to actually update it's render output unless you adjust the window via its borders. As in you must grab the borders via the mouse to get resolution to change. So I had to add a bit for this game to make the game window always on top and then automate moving the mouse to click and drag the window size to be bigger, then immediately tell it to not always be on top. So the launching looks a little goofy seeing the window for a split sec and it grows at that too but the end result is a much better looking game! In the end I had to make a special script with a few extra lines in it just for this one game due to this. Here is that extra bit Spoiler ; Resize game window via mouse grabbing the border ; Using maximize button still leaves letter boxing ; Using WinMove commands or WinMaximize commands does not update rendering resolution Sleep, % ResizeDelay WinHide, ahk_class Shell_TrayWnd ; hides system tray WinSet, Style, -0xC00000, % "i)" . ExistingWindow ; removes title bar WinMove, % "i)" . ExistingWindow, , 0, 0 ; moves game window to top left corner WinSet, AlwaysOnTop, On, % "i)" . ExistingWindow ; put game window on top in order to resize with the mouse MouseClickDrag, Left, 810, 515, 3760, 2115 ; resize for higher resolution and specific coordinates are to maintain 16:9 aspect ratio WinSet, AlwaysOnTop, Off, % "i)" . ExistingWindow One thing I left less than optimized was I couldn't get rid of all the file menu and bottom message center in Yuzu's UI. So I instead opt to crop that portion off with the shader used in Retroarch. I will try and play with stuff like this more to see if I cannot get that removed. Title bar (yellow highlight) removes OK, as do the borders, but file menu doesn't and who knows about the bottom one. Here are some examples of the final result in action! I got some mods going in in NGS2 so it works more like the original version with dismembering limbs and all the bloody gore that was taken out so it could run on the PS3. I'm running the Master Collection version on Steam. You have no idea how hard it is to take a screen shot in a shoot 'em up and not die lol Edited May 6, 2024 by skizzosjt Quote
SiriusVI Posted Saturday at 08:47 AM Posted Saturday at 08:47 AM (edited) Hey man, I'm trying to get this ahk working in Launchbox. I copied your script in a txt document and saved it as WindowCast.ahk. I added my paths like so: RetroarchEXE := "M:\Launchbox\Emulators\RetroArch - WindowCast\retroarch.exe" WindowCastFile := "M:\WindowCast\WindowCast.txt" I put the file in M:\Launchbox\Utilities\Scripts\WindowCast and in Manage Emulators for Xemu I added in the running script section: Run, M:\Launchbox\Utilities\Scripts\WindowCast\WindowCast.ahk However when I launch a game, Xemu starts like normal, but Retroarch never launches. So Am I doing something wrong here? (I of course tried WindowCast before from Retroarch and it works fine there.) Can you help me? EDIT: When first trying this, Windows asked me which program I wanted to use for .ahk files. I chose M:\Launchbox\ThirdParty\AutoHotkey\AutoHotkey.exe I assume this was correct? Edited Saturday at 09:18 AM by SiriusVI Quote
skizzosjt Posted Saturday at 05:23 PM Posted Saturday at 05:23 PM 8 hours ago, SiriusVI said: Hey man, I'm trying to get this ahk working in Launchbox. I copied your script in a txt document and saved it as WindowCast.ahk. I added my paths like so: RetroarchEXE := "M:\Launchbox\Emulators\RetroArch - WindowCast\retroarch.exe" WindowCastFile := "M:\WindowCast\WindowCast.txt" I put the file in M:\Launchbox\Utilities\Scripts\WindowCast and in Manage Emulators for Xemu I added in the running script section: Run, M:\Launchbox\Utilities\Scripts\WindowCast\WindowCast.ahk However when I launch a game, Xemu starts like normal, but Retroarch never launches. So Am I doing something wrong here? (I of course tried WindowCast before from Retroarch and it works fine there.) Can you help me? EDIT: When first trying this, Windows asked me which program I wanted to use for .ahk files. I chose M:\Launchbox\ThirdParty\AutoHotkey\AutoHotkey.exe I assume this was correct? sure thing mang Xemu might be some funny business here. I didn't previously test it. I did get it to work right now but it wasn't very automated. I had to use keyboard/mouse to ALT+TAB to the actual emulator window, mouse click into the emulator window, and then ALT+TAB back to the Retroarch window, and THEN use the CTRL+ALT+T hotkey (the WindowCast specific hotkey to change window/control focus) to get the darn window to focus for controls to work. Also seems how this emulator renders affects how a shader would be applied. for ex, I'm not sure why the heck there are black bars on the side here. It's effectively cropping the image used for the shader as this image is 16:9 ratio so should cover edge to edge. aspect ratio is correct, but it's getting cropped. First emulator I've seen do this to me. *further testing proves the keyboard is not sufficient to get proper window and controls focus. for ex, I can launch the game/emulator and then the script and I get no controls in game. I can still see the mouse cursor so I do a normal left mouse click where I know the actually emulator window is and now I have controls. so, seems like Xemu doesn't give controls unless it is first put into focus that way.....would require different methods to make this wholly automated Doesn't sound like you did any redflag wrong moves. for the AHK question that is what Windows calls file extension association. You must have never opened an .ahk straight from Windows Explorer so it didn't know what program to use to open it. It needed to be directed to the main AutoHotkey.exe file in order to run .ahk files. You got that right. Doesn't matter if you use the exe included with LB or if you setup AHK yourself and placed it wherever you wanted. It will remember that going forward so should be a set it and forget it thing clarify for me, this works for you if you launch an Xemu game manually, and then launch Retroarch manually and load the WindowCast core manually? if so, we at least know you got the WindowCast.txt file with proper name in there Note the game/emulator window should be a window rather than fullscreen. Actual window, not a borderless fullscreen window. I do not have the full screen command used for Xemu here. Running the script should be first line in the running script field to make sure it executes. if you put it below something like a hotkey or a WinWait command it may never make it to the Run command line. I wonder if this is the issue for you? further testing if you're still getting stuck..... launch Xemu manually. from what I can tell the last loaded game should boot up automatically. so at this point you should be running Xemu and booted into a game and it should be in a window mode next, manually run the WindowCast.ahk script from Windows Explorer. it should work fine like this. if it doesn't it could be something is not configured right in the script for you if it's not working at this point you should check the AHK tray icon and review the lines of code that have been executed. I would suspect either the script is exiting too soon for some currently unknown reason or some configuration or typo kinda issue. reviewing the lines executed will let us know what ran and where it's stuck if it is stuck. post an image of that window if needed come back with how you make out and we'll go from there! Quote
SiriusVI Posted Saturday at 07:39 PM Posted Saturday at 07:39 PM (edited) 4 hours ago, skizzosjt said: sure thing mang Xemu might be some funny business here. I didn't previously test it. I did get it to work right now but it wasn't very automated. I had to use keyboard/mouse to ALT+TAB to the actual emulator window, mouse click into the emulator window, and then ALT+TAB back to the Retroarch window, and THEN use the CTRL+ALT+T hotkey (the WindowCast specific hotkey to change window/control focus) to get the darn window to focus for controls to work. Also seems how this emulator renders affects how a shader would be applied. for ex, I'm not sure why the heck there are black bars on the side here. It's effectively cropping the image used for the shader as this image is 16:9 ratio so should cover edge to edge. aspect ratio is correct, but it's getting cropped. First emulator I've seen do this to me. *further testing proves the keyboard is not sufficient to get proper window and controls focus. for ex, I can launch the game/emulator and then the script and I get no controls in game. I can still see the mouse cursor so I do a normal left mouse click where I know the actually emulator window is and now I have controls. so, seems like Xemu doesn't give controls unless it is first put into focus that way.....would require different methods to make this wholly automated Doesn't sound like you did any redflag wrong moves. for the AHK question that is what Windows calls file extension association. You must have never opened an .ahk straight from Windows Explorer so it didn't know what program to use to open it. It needed to be directed to the main AutoHotkey.exe file in order to run .ahk files. You got that right. Doesn't matter if you use the exe included with LB or if you setup AHK yourself and placed it wherever you wanted. It will remember that going forward so should be a set it and forget it thing clarify for me, this works for you if you launch an Xemu game manually, and then launch Retroarch manually and load the WindowCast core manually? if so, we at least know you got the WindowCast.txt file with proper name in there Note the game/emulator window should be a window rather than fullscreen. Actual window, not a borderless fullscreen window. I do not have the full screen command used for Xemu here. Running the script should be first line in the running script field to make sure it executes. if you put it below something like a hotkey or a WinWait command it may never make it to the Run command line. I wonder if this is the issue for you? further testing if you're still getting stuck..... launch Xemu manually. from what I can tell the last loaded game should boot up automatically. so at this point you should be running Xemu and booted into a game and it should be in a window mode next, manually run the WindowCast.ahk script from Windows Explorer. it should work fine like this. if it doesn't it could be something is not configured right in the script for you if it's not working at this point you should check the AHK tray icon and review the lines of code that have been executed. I would suspect either the script is exiting too soon for some currently unknown reason or some configuration or typo kinda issue. reviewing the lines executed will let us know what ran and where it's stuck if it is stuck. post an image of that window if needed come back with how you make out and we'll go from there! Hey thx for replying. Did some further testing: Manually starting Xemu and then manually launching WindowCast works. Launching this ahk script also launches retroarch: Run, "M:\Launchbox\Emulators\RetroArch - WindowCast\retroarch.exe" This ahk script just freezes retroarch and I have to terminate the process: Run, "M:\Launchbox\Emulators\RetroArch - WindowCast\retroarch.exe" -L wgc_libretro.dll "M:\WindowCast\WindowCast.txt" I also get the freeze when just trying to launch this via CMD. I can see that WindowCast is trying to capture the Xemu window (yellow outlines aroundthe game window), but Retroarch crashes. Same behavior with Dolphin. Again, running windowcast manually works perfectly. EDIT: I think I got it. It's Gsync. If Gsync is enabled in RetroArch, CMD and AHK crash Retroarch during the window capture. If it's disabled it works. But again, when manaully starting WindowCast, it works fine, even wuth Gsync enabled. Edited Saturday at 09:30 PM by SiriusVI 1 Quote
skizzosjt Posted yesterday at 01:03 AM Posted yesterday at 01:03 AM 5 hours ago, SiriusVI said: Hey thx for replying. Did some further testing: Manually starting Xemu and then manually launching WindowCast works. Launching this ahk script also launches retroarch: Run, "M:\Launchbox\Emulators\RetroArch - WindowCast\retroarch.exe" This ahk script just freezes retroarch and I have to terminate the process: Run, "M:\Launchbox\Emulators\RetroArch - WindowCast\retroarch.exe" -L wgc_libretro.dll "M:\WindowCast\WindowCast.txt" I also get the freeze when just trying to launch this via CMD. I can see that WindowCast is trying to capture the Xemu window (yellow outlines aroundthe game window), but Retroarch crashes. Same behavior with Dolphin. Again, running windowcast manually works perfectly. EDIT: I think I got it. It's Gsync. If Gsync is enabled in RetroArch, CMD and AHK crash Retroarch during the window capture. If it's disabled it works. But again, when manaully starting WindowCast, it works fine, even wuth Gsync enabled. Ahh ok so that's good news, and bad news lol Good news is the script "works", it is finding the emulator window, it is launching Retroarch. So good so far Bad news is the core is buggy and finicky. For ex, I am now launching Ninja Gaiden Black again and.....it works perfectly. Every. Single. Time. didn't change a damn thing from this morning lol. The window is getting focused appropriately via the script making it all automated as intended. I guess I'd rather be lucky than good because I have no idea why it wasn't working earlier, and why it is now I'm on an AMD GPU but I had found many scenarios of weird with this core. No windows with "windowcast" in its title can exist.....I find that out from testing with this thread open. If minimized it can capture Firefox's minimized window and makes it look like Retroarch launched but froze before a window even appears. In reality what happened is it literally captured a minimized window lol. I then restore the Firefox window and that gets captured in Retroarch🤦♂️. Doesn't make much sense given there is nothing in the WindowCast.txt file that would make that window get captured hence why I think it is some bug with the core. There is some discussion about GPU settings scattered in that link in the first post. There might be some hidden hints in there for you. Alternatively, if you are using that very first version of the script I posted, you might be having challenges like I did for some scenarios where launching Retroarch into fullscreen was the issue. If you're using the first one, try the 2nd version instead, the "SDR" version. It will make Retroarch more of less a borderless fullscreen window and I found this as a workaround. It is always consistent unlike directly launching into fullscreen. YMMV though So overall sounds like the script is doing what it was set out to do but something specific is causing a challenge on your system. And sounds like you found the potential culprit as Gsync. I'd believe it, there have been weirder things impacting my experience with this core! Quote
SiriusVI Posted 12 hours ago Posted 12 hours ago (edited) 12 hours ago, skizzosjt said: Ahh ok so that's good news, and bad news lol Good news is the script "works", it is finding the emulator window, it is launching Retroarch. So good so far Bad news is the core is buggy and finicky. For ex, I am now launching Ninja Gaiden Black again and.....it works perfectly. Every. Single. Time. didn't change a damn thing from this morning lol. The window is getting focused appropriately via the script making it all automated as intended. I guess I'd rather be lucky than good because I have no idea why it wasn't working earlier, and why it is now I'm on an AMD GPU but I had found many scenarios of weird with this core. No windows with "windowcast" in its title can exist.....I find that out from testing with this thread open. If minimized it can capture Firefox's minimized window and makes it look like Retroarch launched but froze before a window even appears. In reality what happened is it literally captured a minimized window lol. I then restore the Firefox window and that gets captured in Retroarch🤦♂️. Doesn't make much sense given there is nothing in the WindowCast.txt file that would make that window get captured hence why I think it is some bug with the core. There is some discussion about GPU settings scattered in that link in the first post. There might be some hidden hints in there for you. Alternatively, if you are using that very first version of the script I posted, you might be having challenges like I did for some scenarios where launching Retroarch into fullscreen was the issue. If you're using the first one, try the 2nd version instead, the "SDR" version. It will make Retroarch more of less a borderless fullscreen window and I found this as a workaround. It is always consistent unlike directly launching into fullscreen. YMMV though So overall sounds like the script is doing what it was set out to do but something specific is causing a challenge on your system. And sounds like you found the potential culprit as Gsync. I'd believe it, there have been weirder things impacting my experience with this core! Well it's not working , yet sadly. This ahk script now works, as in it launches WindowCast and successfully captures Xemu: Run, "M:\Launchbox\Emulators\RetroArch - WindowCast\retroarch.exe" -L wgc_libretro.dll "M:\WindowCast\WindowCast.txt" However, the rest of the script does not work. In fact it does nothing, when I try to launch it. Retroarch doesn't even launch =/ EDIT: I tried some stuff and shortening the script to just this now also works: SetWorkingDir, % A_ScriptDir SetTitleMatchMode, RegEx ; seems to work like mode 2 (partial match) but allows for use of expressions RetroarchWinTitle := "ahk_exe retroarch.exe" RetroarchEXE := "M:\Launchbox\Emulators\RetroArch - WindowCast\retroarch.exe" WindowCastFile := "M:\WindowCast\WindowCast.txt" WindowCastListArray := [] Run, %RetroarchEXE% -L wgc_libretro.dll %WindowCastFile% However, this does of course not send CTRL + ALT + T which is needed for the inputs to work. I'm at a loss as to why the whole script won't work for me. Edited 12 hours ago by SiriusVI Quote
skizzosjt Posted 9 hours ago Posted 9 hours ago Will need you to provide the info I asked for and then some more. There is some unknown challenge on your end we're trying to figure out. 22 hours ago, skizzosjt said: if it's not working at this point you should check the AHK tray icon and review the lines of code that have been executed. I would suspect either the script is exiting too soon for some currently unknown reason or some configuration or typo kinda issue. reviewing the lines executed will let us know what ran and where it's stuck if it is stuck. post an image of that window if needed so, you need to post an image of the most recent executed lines when the script is allegedly stuck. for ex, here is what it should look like once you're fully booted into a game. use the full version rather than the shorter version you posted just now. click on the AHK script's tray icon to bring up this window and post a screen shot, for ex I'll need the whole script you're using. So, you need to post the script you are using with your edits in its entirety (the full version rather than what you posted just now that is shorter). use the code tag button (<>) when posting code. Additionally lets cover all bases here, please post (upload the file - do NOT just paste the contents) the WindowCast.txt file you are using. When you say the full script doesn't work, do you consistently get this message box? Quote
SiriusVI Posted 8 hours ago Posted 8 hours ago (edited) OK got it, so this is how it starts: Once I scroll down to the end, it looks like this: Again for reference, I use this script now: SetWorkingDir, % A_ScriptDir SetTitleMatchMode, RegEx ; seems to work like mode 2 (partial match) but allows for use of expressions RetroarchWinTitle := "ahk_exe retroarch.exe" RetroarchEXE := "M:\Launchbox\Emulators\RetroArch - WindowCast\retroarch.exe" WindowCastFile := "M:\WindowCast\WindowCast.txt" WindowCastListArray := [] TimeOutDelay := 10000 ; close script if game/emulator window is not found in X seconds RunRetroarchDelay := 1500 ; delay between finding game/emulator window and then opening Retroarch FocusHotkeyDelay := 2000 ; delay between launching Retroarch and sending hotkey to grab focus of game/emulator window. *HDR/Fullscreen method ONLY* ; Read WindowCast window list file and parse into array FileRead, WindowCastList, %WindowCastFile% Loop, Parse, WindowCastList, `r, `r`n { If (InStr(A_LoopField, "#")) Continue WindowCastListArray.Push(A_LoopField) } ; Loop through list to check which window exists InitialTime := A_TickCount WindowCheck: Loop, % WindowCastListArray.Count() { ; Check if entry is an exe If (InStr(WindowCastListArray[A_Index], ".exe")) { If (WinExist("ahk_exe " . "i)" . WindowCastListArray[A_Index])) { ExistingWindow := WindowCastListArray[A_Index] Break } } ; If entry is not an exe, it is a window title Else If (WinExist("i)" . WindowCastListArray[A_Index])) { ExistingWindow := WindowCastListArray[A_Index] Break } DurationTime := A_TickCount - InitialTime If (DurationTime >= TimeOutDelay) { MsgBox, 4096, Window Check Timeout, Couldn't find existing window. Exiting script! ExitApp } } If (ExistingWindow = "") Goto, WindowCheck Sleep, RunRetroarchDelay Run, %RetroarchEXE% -L wgc_libretro.dll %WindowCastFile% -f WinWait, % RetroarchWinTitle Sleep, % FocusHotkeyDelay ; Sends hotkey to give focus to game window so inputs are detected Send {LCtrl down}{LAlt down}{t down}{t up}{LAlt up}{LCtrl up} If (InStr(ExistingWindow, ".exe")) WinWaitClose, % "ahk_exe" . "i)" . ExistingWindow Else WinWaitClose, % "i)" . ExistingWindow WinClose, % RetroarchWinTitle ExitApp ; Hotkey to exit Retroarch and terminate script $Esc:: ; keyboard modifier ($) is needed so input isn't "eaten" by the game WinClose, % RetroarchWinTitle ExitApp I'll attach the file here as well. I do not get the message box you mentionied. It's just that nothing happens when I double click the script. Except that AutoHotKey appears in my task bar with the contents that I uploaded above. WindowCast.ahk Edited 6 hours ago by SiriusVI Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.