;----------------------------------------------------------------------------
; Super Nintendo Entertainment System
; zsnesw v1.51
; by djvj
; 1.1
;
; Notes:
; Be sure to set the settings you want below
;----------------------------------------------------------------------------
Fullscreen = true
Stretch = false
resX = 1024
resY = 768
DisplayRomInfo = false ; Display rom info on load along bottom of screen
;----------------------------------------------------------------------------
xLine := TF_Find(zsnesCfg,"","","CustomResX=") ; find location in zsnes cfg where it stores its custom X res
yLine := TF_Find(zsnesCfg,"","","CustomResY=") ; find location in zsnes cfg where it stores its custom Y res
modeLine := TF_Find(zsnesCfg,"","","cvidmode=") ; find location in zsnes cfg where it stores its custom vid mode
zsnesCfg := TF_ReplaceLine(zsnesCfg,xLine,xLine,"CustomResX=" . resX) ; update custom X res in zsnes cfg file
zsnesCfg := TF_ReplaceLine(zsnesCfg,yLine,yLine,"CustomResY=" . resY) ; update custom Yres in zsnes cfg file
If ( Fullscreen = "true" && Stretch = "true" ) ; sets fullscreen, stretch, and filter support
vidMode = 39
Else If ( Fullscreen = "true" && Stretch != "true" ) ; sets fullscreen, correct aspect ratio, and filter support
vidMode = 42
Else ; sets windowed mode with filter support
vidMode = 38
zsnesCfg := TF_ReplaceLine(zsnesCfg,modeLine,modeLine,"cvidmode=" . vidMode) ; update custom vid mode in zsnes cfg file
; Setting DisplayRomInfo setting in cfg if it doesn't match what user wants above
currentDRI := (InStr(zsnesCfg, "DisplayInfo=1") ? ("true") : ("false"))
If ( DisplayRomInfo != "true" And currentDRI = "true" ) {
StringReplace, zsnesCfg, zsnesCfg, DisplayInfo=1, DisplayInfo=0
} Else If ( DisplayRomInfo = "true" And currentDRI = "false" ) {
StringReplace, zsnesCfg, zsnesCfg, DisplayInfo=0, DisplayInfo=1
}
SaveFile(zsnesCfg, zsnesFile) ; save changes to zsnesw.cfg
TF_GetData(byref OW, byref Text, byref FileName)
{
OW=0 ; default setting: asume it is a file and create file_copy
IfNotInString, Text, `n ; it can be a file as the Text doesn't contact a newline character
{
If (SubStr(Text,1,1)="!") ; first we check for "overwrite"
{
Text:=SubStr(Text,2)
OW=1 ; overwrite file (if it is a file)
}
IfNotExist, %Text% ; now we can check if the file exists, it doesn't so it is a var
{
If (OW=1) ; the variable started with a ! so we need to put it back because it is variable/text not a file
Text:= "!" . Text
OW=2 ; no file, so it is a var or Text passed on directly to TF
}
}
Else ; there is a newline character in Text so it has to be a variable
{
OW=2
}
If (OW = 0) or (OW = 1) ; it is a file, so we have to read into var Text
{
Text := (SubStr(Text,1,1)="!") ? (SubStr(Text,2)) : Text
FileName=%Text% ; Store FileName
FileRead, Text, %Text% ; Read file and return as var Text
If (ErrorLevel > 0)
{
MsgBox, 48, TF Lib Error, % "Can not read " FileName
ExitApp
}
}
Return
}
TF_ReturnOutPut(OW, Text, FileName, TrimTrailing = 1, CreateNewFile = 0) { ; HugoV
If (OW = 0) ; input was file, file_copy will be created, if it already exist file_copy will be overwritten
{
IfNotExist, % FileName ; check if file Exist, if not return otherwise it would create an empty file. Thanks for the idea Murp|e
{
If (CreateNewFile = 1) ; CreateNewFile used for TF_SplitFileBy* and others
{
OW = 1
Goto CreateNewFile
}
Else
Return
}
If (TrimTrailing = 1)
StringTrimRight, Text, Text, 1 ; remove trailing `n
SplitPath, FileName,, Dir, Ext, Name
If (Dir = "") ; if Dir is empty Text & script are in same directory
Dir := A_ScriptDir
IfExist, % Dir "\backup" ; if there is a backup dir, copy original file there
FileCopy, % Dir "\" Name "_copy." Ext, % Dir "\backup\" Name "_copy.bak", 1
FileDelete, % Dir "\" Name "_copy." Ext
FileAppend, %Text%, % Dir "\" Name "_copy." Ext
Return Errorlevel ? False : True
}
CreateNewFile:
If (OW = 1) ; input was file, will be overwritten by output
{
IfNotExist, % FileName ; check if file Exist, if not return otherwise it would create an empty file. Thanks for the idea Murp|e
{
If (CreateNewFile = 0) ; CreateNewFile used for TF_SplitFileBy* and others
Return
}
If (TrimTrailing = 1)
StringTrimRight, Text, Text, 1 ; remove trailing `n
SplitPath, FileName,, Dir, Ext, Name
If (Dir = "") ; if Dir is empty Text & script are in same directory
Dir := A_ScriptDir
IfExist, % Dir "\backup" ; if there is a backup dir, copy original file there
FileCopy, % Dir "\" Name "." Ext, % Dir "\backup\" Name ".bak", 1
FileDelete, % Dir "\" Name "." Ext
FileAppend, %Text%, % Dir "\" Name "." Ext
Return Errorlevel ? False : True
}
If (OW = 2) ; input was var, return variable
{
If (TrimTrailing = 1)
StringTrimRight, Text, Text, 1 ; remove trailing `n
Return Text
}
}
edit: Ah oui pardon, excusez moi, j'ai lu le message d'ozone en diagonale
edit 2: Sachant que j'ai le ahk de la heavybox et qu'Il ne me semble pas l'avoir modifié, j'imagine donc qu'il n'y a pas de soucis avec le fichier. Ce serait plutôt mon windows dans ce cas qui execute mal le ahk ou qui galère à fermer le processus?
edit 3: Au cas ou, j'ai vu sur le forum que quelqu'un avait le même problème (viewtopic.php?f=35&t=7519&start=0" onclick="window.open(this.href);return false;). La dernière réponse ne donne rien chez moi (j'avais déjà modifié la touche de sortie et ce n'est pas échap).
Edit Final: Ca y'est j'ai enfin compris d'ou venait mon problème. En fait, mon windows n'est pas activé. Du coup, j'ai l'info bulle d'activation qui pop de temps en temps. Si je suis en train de jouer à un jeu supernes et que l'info bulle pop, alors le bug apparaît (le processus znes ne se ferme pas quand je quitte le jeu ou quitte hyperspin). Donc moralité, il faut bien activer son windows avant de faire des tests, sinon on se retrouve devant des problèmes à la con et on perd son après midi
Merci bien pour l'aide en tout cas.