Advertisement
djvj

higan .97

Feb 7th, 2016
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.35 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 =
  7. iCRC =
  8. MID =
  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. If (Fullscreen = "true")
  50. params := " --fullscreen"
  51.  
  52. ; copy backed-up srm files to folder where rom is located
  53. If (sramSupport = "true")
  54. If FileExist(emuPath . "\srm\" . romName . ".srm")
  55. FileCopy, %emuPath%\srm\%romName%.srm, %romPath%, 1 ; overwriting existing srm with backup if it exists in destination folder
  56.  
  57. HideEmuStart()
  58. Run(executable . params . " """ . romPath . "\" . romName . romExtension . """", emuPath)
  59.  
  60. WinWait("higan ahk_class hiroWindow")
  61. WinWaitActive("higan ahk_class hiroWindow")
  62.  
  63. BezelDraw()
  64. HideEmuEnd()
  65. FadeInExit()
  66.  
  67. ; WinMove, 0, 0 ; when going from fullscreen to window, higan still has its menubar hidden, uncomment this to access it
  68. ; WinMenuSelectItem,ahk_class phoenix_window,,Super Famicom, Port 2, Justifier
  69. ; WinMenuSelectItem,ahk_class hiroWindow,,Super Famicom, Port 2, Justifier
  70. Process("WaitClose", executable)1
  71.  
  72. ; Back up srm file so it is available for next launch
  73. If (sramSupport = "true")
  74. { If !FileExist(emuPath . "\srm\")
  75. FileCreateDir, %emuPath%\srm\ ; create srm folder if it doesn't exist
  76. FileCopy, %romPath%\%romName%.srm, %emuPath%\srm\, 1
  77. }
  78.  
  79. 7zCleanUp()
  80. BezelExit()
  81. FadeOutExit()
  82. ExitModule()
  83.  
  84.  
  85. SaveFile(text,file) {
  86. FileDelete, %file%
  87. FileAppend, %text%, %file%
  88. }
  89.  
  90. BezelLabel:
  91. disableHideTitleBar := "true"
  92. disableHideToggleMenu := "true"
  93. disableHideBorder := "true"
  94. Return
  95.  
  96. CloseProcess:
  97. FadeOutStart()
  98. WinClose("ahk_class hiroWindow")
  99. ; WinClose("ahk_class phoenix_window")
  100. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement