Toxicshadow
02-26-2011, 07:21 AM
Hi all,
Not sure if this is any use to anyone but I have modifed the HyperLaunch.ahk script to allow roms to be located in sub folders of individual letters as follows:
e.g
snes-->
----> 0-9
----> a
----> b
----> c
I prefer to store my roms this way becuase it is easier to find the rom you require. In the above example you just configure hyperspin to point to the snes folder and the script will automatically determine the sub folder based upon the first letter in the rom name.
Here is the modified section of the script (items in bold have been added):
if(systemName != "zinc")
{
If (romExtensions = "")
{
MsgBox,48,Error, Missing rom extension in %systemName%.ini ,6
Goto ExitScript
}
Loop, parse, romExtensions, `,
{
inputVar = %A_LoopField%
romVar = %RomName%
StringLeft, charToCheck, inputVar, 1
StringLeft, firstRomChar, romVar, 1
If(firstRomChar = "0" || firstRomChar = "1" || firstRomChar = "2" || firstRomChar = "3" || firstRomChar = "4" || firstRomChar = "5" || firstRomChar = "6" || firstRomChar = "7" || firstRomChar = "8" || firstRomChar = "9")
{
subfolderVar = 0-9
}else{
subfolderVar = %firstRomChar%
}
If(charToCheck = ".")
{
MsgBox,48,Error, Make sure your rom extensions do not contain a ".",6
Goto ExitScript
}
IfExist %RomPath%%RomName%.%A_LoopField%
{
romExtension = .%A_LoopField%
romFound = true
break
}else{
IfExist %RomPath%%RomName%\%RomName%.%A_LoopField%
{
RomPath = %RomPath%%RomName%\
romExtension = .%A_LoopField%
romFound = true
break
}else{
IfExist %RomPath%%subfolderVar%\%RomName%.%A_LoopField%
{
RomPath = %RomPath%%subfolderVar%\
romExtension = .%A_LoopField%
romFound = true
break
}else{
romFound = false
}
}
}
}
}
if (romFound = "false")
{
if(systemName != "daphne"){
MsgBox,48,Error,Cannot find Rom - %RomPath%%RomName% with any provided extension,6
Goto ExitScript
}else{
MsgBox,48,Error,Cannot find Daphne framefile - %RomPath%%RomName% with any provided extension,6
Goto ExitScript
}
}
return
Not sure if this is any use to anyone but I have modifed the HyperLaunch.ahk script to allow roms to be located in sub folders of individual letters as follows:
e.g
snes-->
----> 0-9
----> a
----> b
----> c
I prefer to store my roms this way becuase it is easier to find the rom you require. In the above example you just configure hyperspin to point to the snes folder and the script will automatically determine the sub folder based upon the first letter in the rom name.
Here is the modified section of the script (items in bold have been added):
if(systemName != "zinc")
{
If (romExtensions = "")
{
MsgBox,48,Error, Missing rom extension in %systemName%.ini ,6
Goto ExitScript
}
Loop, parse, romExtensions, `,
{
inputVar = %A_LoopField%
romVar = %RomName%
StringLeft, charToCheck, inputVar, 1
StringLeft, firstRomChar, romVar, 1
If(firstRomChar = "0" || firstRomChar = "1" || firstRomChar = "2" || firstRomChar = "3" || firstRomChar = "4" || firstRomChar = "5" || firstRomChar = "6" || firstRomChar = "7" || firstRomChar = "8" || firstRomChar = "9")
{
subfolderVar = 0-9
}else{
subfolderVar = %firstRomChar%
}
If(charToCheck = ".")
{
MsgBox,48,Error, Make sure your rom extensions do not contain a ".",6
Goto ExitScript
}
IfExist %RomPath%%RomName%.%A_LoopField%
{
romExtension = .%A_LoopField%
romFound = true
break
}else{
IfExist %RomPath%%RomName%\%RomName%.%A_LoopField%
{
RomPath = %RomPath%%RomName%\
romExtension = .%A_LoopField%
romFound = true
break
}else{
IfExist %RomPath%%subfolderVar%\%RomName%.%A_LoopField%
{
RomPath = %RomPath%%subfolderVar%\
romExtension = .%A_LoopField%
romFound = true
break
}else{
romFound = false
}
}
}
}
}
if (romFound = "false")
{
if(systemName != "daphne"){
MsgBox,48,Error,Cannot find Rom - %RomPath%%RomName% with any provided extension,6
Goto ExitScript
}else{
MsgBox,48,Error,Cannot find Daphne framefile - %RomPath%%RomName% with any provided extension,6
Goto ExitScript
}
}
return