Advertisement
djvj

Untitled

Jan 20th, 2016
569
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.46 KB | None | 0 0
  1. MEmu = Higan
  2. MEmuV = v0.97
  3. MURL = http://byuu.org/higan/
  4. MAuthor = djvj
  5. MVersion = 2.0.5
  6. MCRC = C38CF770
  7. iCRC = A3607D8A
  8. MID = 635038268899159961
  9. MSystem = "Nintendo Entertainment System","Nintendo Famicom","Nintendo Game Boy","Nintendo Game Boy Color","Nintendo Satellaview","Nintendo Super Famicom","Super Nintendo Entertainment System"
  10. ;----------------------------------------------------------------------------
  11. ; Notes:
  12. ; You can set your Exit key in the emu by going to Settings->Configuration Settings->Input->Hotkeys->Exit Emulator (not needed for this script)
  13. ; If you want to use xpadder, or joy2key, goto Settings->Advanced Settings and change Input to DirectInput
  14. ; Fullscreen is controlled via GUi when running the module directly
  15. ; Sram Support is controlled via GUi when running the module directly - If true, the module will backup srm files into a backup folder and copy them back to the 7z_Extract_Path so higan can load them upon launch. You really only need this if you use 7z support (and 7z_Delete_Temp is true) or your romPath is read-only.
  16. ; If you use 7z support, the games that require special roms (dsp/cx4), the roms needs to be inside the 7z with the game. Otherwise you will get an error about the missing rom.
  17. ; You can find the dsp roms needed for some games here: http://www.caitsith2.com/snes/dsp/ and a list of what games use what chip here: http://wiki.pocketheaven.com/index.php?title=SNES_games_with_special_chips
  18. ; Bezels require fixedresmode, so set the scale you want in the emu which will control the size of the bezels.
  19. ;----------------------------------------------------------------------------
  20. StartModule()
  21. BezelGUI()
  22. FadeInStart()
  23.  
  24. settingsFile := modulePath . "\" . moduleName . ".ini"
  25. fullscreen := IniReadCheck(settingsFile, "Settings", "Fullscreen","true",,1)
  26. sramSupport := IniReadCheck(settingsFile, "Settings", "SRAM_Support","true",,1)
  27. bezelTopOffset := IniReadCheck(settingsFile, "Settings", "bezelTopOffset","51",,1)
  28. bezelBottomOffset := IniReadCheck(settingsFile, "Settings", "bezelBottomOffset","31",,1)
  29. bezelLeftOffset := IniReadCheck(settingsFile, "Settings", "bezelLeftOffset","7",,1)
  30. bezelRightOffset := IniReadCheck(settingsFile, "Settings", "bezelRightOffset","7",,1)
  31.  
  32. BezelStart("FixResMode")
  33. hideEmuObj := Object("ahk_class hiroWindow",1) ; Hide_Emu will hide these windows. 0 = will never unhide, 1 = will unhide later
  34. 7z(romPath, romName, romExtension, sevenZExtractPath)
  35.  
  36. If (bezelEnabled = "true") {
  37. higanFile := CheckFile(emuPath . "\settings.bml")
  38. FileRead, higanCfg, %higanFile%
  39. currentStatusBar := InStr(higanCfg, "ShowStatusBar:true") ? "true" : "false"
  40. If (currentStatusBar = "true") {
  41. StringReplace, higanCfg, higanCfg, ShowStatusBar:true, ShowStatusBar:false
  42. SaveFile(higanCfg, higanFile)
  43. } Else If (currentStatusBar = "false") {
  44. StringReplace, higanCfg, higanCfg, ShowStatusBar:false, ShowStatusBar:true
  45. SaveFile(higanCfg, higanFile)
  46. }
  47. }
  48.  
  49. ; copy backed-up srm files to folder where rom is located
  50. If (sramSupport = "true")
  51. If FileExist(emuPath . "\srm\" . romName . ".srm")
  52. FileCopy, %emuPath%\srm\%romName%.srm, %romPath%, 1 ; overwriting existing srm with backup if it exists in destination folder
  53.  
  54. HideEmuStart()
  55. Run(executable . " """ . romPath . "\" . romName . romExtension . """", emuPath)
  56.  
  57. WinWait("higan ahk_class hiroWindow")
  58. WinWaitActive("higan ahk_class hiroWindow")
  59.  
  60. ; If (Fullscreen = "true")
  61. ; {
  62. ; WinActivate % "higan ahk_class hiroWindow"
  63. ; Send,F11
  64. ; ControlSend,,F11,higan ahk_class hiroWindow
  65. ; }
  66.  
  67. BezelDraw()
  68. HideEmuEnd()
  69. FadeInExit()
  70.  
  71. ; WinMove, 0, 0 ; when going from fullscreen to window, higan still has its menubar hidden, uncomment this to access it
  72. ; WinMenuSelectItem,ahk_class phoenix_window,,Super Famicom, Port 2, Justifier
  73. ; WinMenuSelectItem,ahk_class hiroWindow,,Super Famicom, Port 2, Justifier
  74. Process("WaitClose", executable)1
  75.  
  76. ; Back up srm file so it is available for next launch
  77. If (sramSupport = "true")
  78. { If !FileExist(emuPath . "\srm\")
  79. FileCreateDir, %emuPath%\srm\ ; create srm folder if it doesn't exist
  80. FileCopy, %romPath%\%romName%.srm, %emuPath%\srm\, 1
  81. }
  82.  
  83. 7zCleanUp()
  84. BezelExit()
  85. FadeOutExit()
  86. ExitModule()
  87.  
  88.  
  89. SaveFile(text,file) {
  90. FileDelete, %file%
  91. FileAppend, %text%, %file%
  92. }
  93.  
  94. BezelLabel:
  95. disableHideTitleBar := "true"
  96. disableHideToggleMenu := "true"
  97. disableHideBorder := "true"
  98. Return
  99.  
  100. CloseProcess:
  101. FadeOutStart()
  102. WinClose("ahk_class hiroWindow")
  103. ; WinClose("ahk_class phoenix_window")
  104. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement