I can answer that for you
make a dummy table
put this in the table
Function GetNVramPath()
Dim WshShell
Set WshShell = CreateObject("WScript.Shell")
GetNVramPath = WshShell.RegRead("HKCU\Software\Freeware\Visual PinMame\globals\nvram_directory")
End function
Function FileExists(FileName)
DIM FSO
FileExists = False
Set FSO = CreateObject("Scripting.FileSystemObject")
FileExists = FSO.FileExists(FileName)
Set FSO = Nothing
End Function
Sub Kill(FileName)
Dim ObjFile, FSO
On Error Resume Next
Set FSO = CreateObject("Scripting.FileSystemObject")
Set ObjFile = FSO.GetFile(FileName)
ObjFile.Delete
On Error Goto 0
Set FSO = Nothing
End Sub
Sub Copy(SourceFileName, DestFileName)
Dim FSO
On Error Resume Next
Set FSO = CreateObject("Scripting.FileSystemObject")
FSO.CopyFile SourceFileName, DestFileName, True
On Error Goto 0
Set FSO = Nothing
End Sub
Sub NVramPatchLoad
NVramPatchCoinCnt = 0
If FileExists(GetNVramPath + "\" + cGameName + ".nvb")Then
Copy GetNVramPath + "\" + cGameName + ".nvb", GetNVramPath + "\" + cGameName + ".nv"
Else
Copy GetNVramPath + "\" + cGameName + ".nv", GetNVramPath + "\" + cGameName + ".nvb"
End If
End Sub
Sub NVramPatchExit
Kill GetNVramPath + "\" + cGameName + ".nvb"
End Sub
in table, set
const cgamename = "any taito rom name"
Any taito rom doesn matter which one.
give it an exit sub
Sub table1_Exit
NVramPatchExit
End Sub
Give it an init sub too, lets go full circle?
sub table1_init
NVramPatchLoad
end sub
Ok, now try and crash the test table by exiting it
Ok done editing
Edited by wiesshund, 23 September 2023 - 12:53 AM.