Advertisement
djvj

Untitled

Jan 22nd, 2015
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.74 KB | None | 0 0
  1. MEmu = Nestopia
  2. MEmuV = v1.42
  3. MURL = http://www.emucr.com/2011/09/nestopia-unofficial-v1420.html
  4. MAuthor = djvj
  5. MVersion = 2.0.2
  6. MCRC = 89EE8369
  7. iCRC = F9662CA1
  8. MID = 635038268908287546
  9. MSystem = "Nintendo Entertainment System","Nintendo Famicom","Nintendo Famicom Disk System"
  10. ;----------------------------------------------------------------------------
  11. ; Notes:
  12. ; If using this for Nintendo Famicom Disk System, make sure you place an FDS bios in your bios subfolder for your emu. You will have to select it on first launch of any FDS game.
  13. ; Set your fullscreen key to Alt+Enter if it is not already for HyperPause support
  14. ;----------------------------------------------------------------------------
  15. StartModule()
  16. BezelGUI()
  17. FadeInStart()
  18.  
  19. settingsFile := modulePath . "\" . moduleName . ".ini"
  20. Fullscreen := IniReadCheck(settingsFile, "settings", "Fullscreen","true",,1)
  21. ExitKey := IniReadCheck(settingsFile, "settings", "ExitKey","Esc",,1)
  22. ToggleMenuKey := IniReadCheck(settingsFile, "settings", "ToggleMenuKey","Alt+M",,1)
  23. bezelTopOffset := IniReadCheck(settingsFile, "Settings", "bezelTopOffset",16,,1)
  24. bezelBottomOffset := IniReadCheck(settingsFile, "Settings", "bezelBottomOffset",26,,1)
  25. bezelLeftOffset := IniReadCheck(settingsFile, "Settings", "bezelLeftOffset",7,,1)
  26. bezelRightOffset := IniReadCheck(settingsFile, "Settings", "bezelRightOffset",7,,1)
  27. force4players := IniReadCheck(settingsFile, romName, "force4players","False",,1)
  28.  
  29. BezelStart()
  30.  
  31. emuSettingsFile := emuPath . "\" . "nestopia.xml"
  32. FileRead, nesXML, %emuSettingsFile%
  33.  
  34. IfInString, nesXML, % "<confirm-exit>yes</confirm-exit>" ; find if this setting is not the desired value
  35. StringReplace, nesXML, nesXML, % "<confirm-exit>yes</confirm-exit>", % "<confirm-exit>no</confirm-exit>" ; turning off confirmation on exit
  36. IfNotInString, nesXML, % "<exit>" . ExitKey . "</exit>" ; find if this setting is not the desired value
  37. { currentExitKey := StrX(nesXML,"<exit>" ,0,0,"</exit>",0,0) ; trim confirm-exit to what it's current setting is
  38. StringReplace, nesXML, nesXML, % currentExitKey, % "<exit>" . ExitKey . "</exit>" ; replacing the current exit key to the desired one from above
  39. }
  40. IfNotInString, nesXML, % "<toggle-menu>" . ToggleMenuKey . "</toggle-menu>" ; find if this setting is not the desired value
  41. { currentMenuKey := StrX(nesXML,"<toggle-menu>" ,0,0,"</toggle-menu>",0,0) ; trim toggle-menu to what it's current setting is
  42. StringReplace, nesXML, nesXML, % currentMenuKey, % "<toggle-menu>" . ToggleMenuKey . "</toggle-menu>" ; replacing the current toggle-menu key to the desired one from above
  43. }
  44.  
  45. If force4players = true
  46. { IfInString, nesXML, % "<auto-select-controllers>yes</auto-select-controllers>" ; find if this setting is not the desired value
  47. StringReplace, nesXML, nesXML, % "<auto-select-controllers>yes</auto-select-controllers>", % "<auto-select-controllers>no</auto-select-controllers>" ; replacing the current toggle-menu key to the desired one from above
  48. StringReplace, nesXML, nesXML, % "<port-3>unconnected</port-3>", % "<port-3>pad3</port-3>"
  49. StringReplace, nesXML, nesXML, % "<port-4>unconnected</port-4", % "<port-4>pad4</port-4>"
  50. } Else
  51. IfInString, nesXML, % "<auto-select-controllers>no</auto-select-controllers>" ; find if this setting is not the desired value
  52. StringReplace, nesXML, nesXML, % "<auto-select-controllers>no</auto-select-controllers>", % "<auto-select-controllers>yes</auto-select-controllers>" ; replacing the current toggle-menu key to the desired one from above
  53.  
  54. ; Enable Fullscreen
  55. currentFS := StrX(nesXML,"<start-fullscreen>" ,0,0,"</start-fullscreen>",0,0) ; trim start-fullscreen to what it's current setting is
  56. StringReplace, nesXML, nesXML, % currentFS, % "<start-fullscreen>" . ((If Fullscreen = "true")?"yes":"no") . "</start-fullscreen>" ; setting start-fullscreen to the desired setting from above
  57.  
  58. SaveFile()
  59.  
  60. hideEmuObj := Object("Nestopia ahk_class Nestopia",1) ; Hide_Emu will hide these windows. 0 = will never unhide, 1 = will unhide later
  61. 7z(romPath, romName, romExtension, 7zExtractPath)
  62.  
  63. HideEmuStart() ; This fully ensures windows are completely hidden even faster than winwait
  64.  
  65. Run(executable . " """ . romPath . "\" . romName . romExtension . """", emuPath)
  66.  
  67. WinWait("Nestopia ahk_class Nestopia")
  68. WinWaitActive("Nestopia ahk_class Nestopia")
  69.  
  70. BezelDraw()
  71. HideEmuEnd()
  72. FadeInExit()
  73. Process("WaitClose", executable)
  74. 7zCleanUp()
  75. BezelExit()
  76. FadeOutExit()
  77. ExitModule()
  78.  
  79.  
  80. SaveFile() {
  81. Global emuSettingsFile
  82. Global nesXML
  83. FileDelete, %emuSettingsFile%
  84. FileAppend, %nesXML%, %emuSettingsFile%, UTF-8
  85. }
  86.  
  87. HaltEmu:
  88. ; Send, !{Enter}
  89. Sleep, 200
  90. Return
  91. RestoreEmu:
  92. WinActivate, ahk_id %emulatorID%
  93. ; Send, !{Enter}
  94. Return
  95.  
  96. CloseProcess:
  97. FadeOutStart()
  98. WinClose("Nestopia ahk_class Nestopia")
  99. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement