What's wrong with the %RomName% variable?

badflame

New member
RL Member
I have some systems using this variable %RomName% in the PAUSE - SAVES to automatically enter the name of the ROM, for example WinAPE or WinUAE.

I did not use RL from a year ago, and a few days ago I put it into operation. It has been updated with all the UPDATES of the last year.

The result is that the %RomName% variable no longer works. Now literally writes "%RomName%" in the imput box instead of the name of the ROM.

Obviously this is fatal since it prevents you from recording custom games and recovering those already recorded automatically.

Has been eliminated the possibility of using a variable to retrieve the name of the ROM, or simply now has another name or another way of being called?

This is very important for configure SAVES in RL.
 

badflame

New member
RL Member
For example, in Amstrad:

Pause_Save_State_Keys={F6}{Enter}%romName%{Enter}{ LAlt down}{s down}{s up}{LAlt up}
Pause_Load_State_Keys={F5}%romName%{Enter}

It has always worked for me (I have saved games). But now, whether I save or load, in the input box puts "%RomName%" instead of the name of the rom.
 

badflame

New member
RL Member
The problem is obviously some update.

I have created an alternative installation of RL, with version 1.0.1.5, and works well. When the emulator requires the name of the file to record, the name of the rom is written.

After, I applied the automatic updates and it stopped working.
 
Last edited:

brolly

Administrator
Developer
You didn't make it clear you were using the variable name in the ini files so I assumed you were talking about AHK code, I wasn't even aware that worked at all. Not sure if it was actually ever intended to work that way, only bleasby can tell that for sure I think. I don't know what could have changed to cause this different behavior.
 

badflame

New member
RL Member
You didn't make it clear you were using the variable name in the ini files so I assumed you were talking about AHK code, I wasn't even aware that worked at all. Not sure if it was actually ever intended to work that way, only bleasby can tell that for sure I think. I don't know what could have changed to cause this different behavior.

Yes, I was talking about the .ini that configure the load/save states.

It would be very important to recover that function since otherwise it is impossible to configure the automatic load / save function in some systems.

Please report this request.

Thanks a lot.
 

brolly

Administrator
Developer
I was taking a quick look at the code and unless something drastically changed I'm not even seeing how that used to work, please post your old Pause.ahk file so I can compare it with the current one.
Unless this was a side effect of upgrading to a newer AHK version which could very likely be the reason, don't think this has anything to do with the RL code, but will need the Pause.ahk to verify.
 

badflame

New member
RL Member
First of all, thanks for take care of my request, brolly.

RL 1.0.1.5 have MCRC := "732CDD1F" MVersion := "1.1.8" of the "Pause.ahk" module

RL 1.2.0.1 have MCRC := "CB993981" MVersion := "1.2.18"

I have replaced the module of version "1.2.18" with that of version "1.1.8" on RL 1.2.0.1. RL not crashes and accept this version of the module, but not return the value of the %romName% when execute the save/load code (the same thing that with the "1.2.18" version).

Therefore, I do not think it is a problem of this module in particular :(

In fact, if I replace the "Lib" and "Module Extensions" folders and AutoHotkey.dll from RL 1.2.0.1 to RL 1.0.1.5 (the opposite is not possible since RL crashes), this old version of RL continues working and using the variable correctly (writing the name of the rom). So, neither is none of these modules or dll.

I have continued copying files (from the 1.2.0.1 to 1.0.1.5) and it has continued working well until I have replaced the "RocketLauncher.exe", then the variable "%romName%" has stopped working correctly. So the problem is in the same .exe

Regardless of which script of RL is the cause of this variable no longer working, I think it would be relatively easy to solve this problem if, in the Function that reads from the file "emulator.ini" the parameters of "Pause_Save_State_Keys =" and "Pause_Load_State_Keys = " we apply to StringReplace with the name of the rom.

What do you think about this solution?

What is the module and Function that reads the value of the "emulator.ini" parameters?

Thanks again.
 
Last edited:

brolly

Administrator
Developer
If the problem is in the RL exe then my assumption of being related with the AHK version seems correct, because this exe is compiled against a certain AHK version which changed from RL 1.2.0.1 to 1.0.1.5. This actually makes sense.

The fix should be simple enough though, edit Pause.ahk and go to line 3906, might be a slightly different line on your end though since I'm looking at the current dev Pause.ahk, anyway there should be a section like:
Code:
Sleep, %Pause_DelaytoSendKeys%
                Loop, parse, KeySelected,;, 
                {
                    If InStr(A_LoopField,"Sleep"){
                        StringReplace, SleepPeriod, A_LoopField, Sleep, , all
                        Sleep, %SleepPeriod%
                    } Else {
                        Send, , %A_LoopField%
                    }
                }

Replace with:
Code:
Sleep, %Pause_DelaytoSendKeys%
                Loop, parse, KeySelected,;, 
                {
                    If InStr(A_LoopField,"Sleep"){
                        StringReplace, SleepPeriod, A_LoopField, Sleep, , all
                        Sleep, %SleepPeriod%
                    } Else {
						KeyToSend := A_LoopField
						If StringUtils.Contains(KeyToSend, "%RomName%") {
							KeyToSend := StringUtils.Replace(KeyToSend, "%RomName%", RomName, "All")
						}
						Send, , %KeyToSend%
                    }
                }

This is untested, but it should work.
 
Top