Advertisement
djvj

Untitled

Jan 10th, 2016
934
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.58 KB | None | 0 0
  1. MEmu = BizHawk
  2. MEmuV = v1.9.4
  3. MURL = http://tasvideos.org/Bizhawk.html
  4. MAuthor = djvj
  5. MVersion = 2.0.6
  6. MCRC = 573A594F
  7. iCRC = 12C7D203
  8. MID = 635146140449648195
  9. MSystem = "Atari 2600","Atari 7800","Atari Lynx","Bandai Wonderswan","Bandai Wonderswan Color","ColecoVision","NEC PC Engine","NEC PC Engine-CD","NEC SuperGrafx","NEC TurboGrafx-16","NEC TurboGrafx-CD","Nintendo 64","Nintendo Entertainment System","Nintendo Famicom","Nintendo Famicom Disk System","Nintendo Game Boy","Nintendo Game Boy Advance","Nintendo Game Boy Color","Nintendo Super Game Boy","Samsung Gam Boy","Sega CD","Sega Game Gear","Sega Genesis","Sega SG-1000","Sega Master System","Sega Saturn","Super Nintendo Entertainment System","Texas Instruments TI-83"
  10. ;----------------------------------------------------------------------------
  11. ; Notes:
  12. ; When not using bezels, in order for Fullscreen to resume from Pause, Bizhawk must be set to its default fullscreen key of Alt+Enter
  13. ; Available CLI commands can be found @ http://tasvideos.org/Bizhawk/CommandLine.html
  14. ; Many systems require the firmware to exist in the emu's Firmware subfolder. If one of these system's cannot find the firmware, Bizhawk will error out telling you so.
  15. ;----------------------------------------------------------------------------
  16. StartModule()
  17. BezelGUI()
  18. FadeInStart()
  19.  
  20. ; This object controls how the module reacts to different systems. BizHawk can play a lot of systems, and each system changes the window title. Without knowing this title, the module doesn't know when the emu finished loading
  21. mType := Object("Atari 2600","Atari 2600","Atari 7800","Atari 7800","Atari Lynx","Lynx","Bandai Wonderswan","WonderSwan","Bandai Wonderswan Color","WonderSwan","ColecoVision","ColecoVision","NEC PC Engine","TurboGrafx-16","NEC PC Engine-CD","TurboGrafx-16 (CD)","NEC SuperGrafx","SuperGrafx","NEC TurboGrafx-16","TurboGrafx-16","NEC TurboGrafx-CD","TurboGrafx-16 (CD)","Nintendo 64","Nintendo 64","Nintendo Entertainment System","NES","Nintendo Famicom","NES","Nintendo Famicom Disk System","NES","Nintendo Game Boy","Gameboy","Nintendo Game Boy Advance","Gameboy Advance","Nintendo Game Boy Color","Gameboy Color","Nintendo Super Game Boy","Gameboy","Samsung Gam Boy","Sega Master System","Sega CD","Genesis","Sega Game Gear","Game Gear","Sega Genesis","Genesis","Sega Master System","Sega Master System","Sega Mega Drive","Genesis","Sega Saturn","Saturn","Sega SG-1000","SG-1000","Super Nintendo Entertainment System","SNES","Texas Instruments TI-83","TI-83")
  22. ident := mType[systemName] ; search object for the systemName identifier MESS uses
  23. If !ident
  24. ScriptError("Your systemName is: " . systemName . "`nIt is not one of the known supported systems for this " . moduleName . " module")
  25.  
  26. hideEmuObj := Object(ident,1) ; Hide_Emu will hide these windows. 0 = will never unhide, 1 = will unhide later
  27. 7z(romPath, romName, romExtension, sevenZExtractPath)
  28.  
  29. If (romExtension != ".cue" && (systemName = "Sega Saturn" || systemName = "NEC PC Engine-CD" || systemName = "NEC PC Engine-CD"))
  30. ScriptError("You are trying to send a """ . romExtension . """ to " . MEmu . " when it only supports ""cue"" extensions")
  31.  
  32. defaultsgbMode := If SystemName = "Nintendo Super Game Boy" ? "true" : "false"
  33.  
  34. settingsFile := modulePath . "\" . moduleName . ".ini"
  35. fullscreen := IniReadCheck(settingsFile, "Settings", "Fullscreen","true",,1)
  36. bezelTopOffset := IniReadCheck(settingsFile, "Settings", "bezelTopOffset",54,,1)
  37. bezelBottomOffset := IniReadCheck(settingsFile, "Settings", "bezelBottomOffset",8,,1)
  38. bezelLeftOffset := IniReadCheck(settingsFile, "Settings", "bezelLeftOffset",8,,1)
  39. bezelRightOffset := IniReadCheck(settingsFile, "Settings", "bezelRightOffset",8,,1)
  40. sgbMode := IniReadCheck(settingsFile, systemName . "|" . romName, "SuperGameBoyMode",defaultsgbMode,,1)
  41. BarcodeReaderHotkey := IniReadCheck(settingsFile, systemName, "BarcodeReaderHotkey","",,1)
  42.  
  43. If (ident = "NES" && BarcodeReaderHotkey) {
  44. BarcodeReaderHotkey := xHotKeyVarEdit(BarcodeReaderHotkey,"BarcodeReaderHotkey","~","Add")
  45. xHotKeywrapper(BarcodeReaderHotkey,"BarcodeReader")
  46. }
  47.  
  48. BezelStart()
  49.  
  50. bizFullscreen := If fullscreen = "true" ? " --fullscreen" : "" ;" --chromeless" ; chromeless makes it impossible for ahk to detect a title from the emu and therefore cannot be used
  51.  
  52. bizhawkFile := CheckFile(emuPath . "\config.ini")
  53. bizHawkCfg := LoadProperties(bizhawkFile)
  54. currentDisplayStatusBar := ReadProperty(bizHawkCfg,"""DisplayStatusBar""",":")
  55. If (bezelEnabled = "true" && currentDisplayStatusBar = "true,") {
  56. WriteProperty(bizHawkCfg,"""DisplayStatusBar""","false,",,,":") ; turn status bar off, this only covers the bottom bar though
  57. saveBizhawkCfg := 1
  58. }
  59.  
  60. If (systemName = "Nintendo Super Game Boy" || systemName = "Nintendo Game Boy")
  61. { currentSGBMode := ReadProperty(bizHawkCfg,"""GB_AsSGB""",":")
  62. If (sgbMode != "true" And currentSGBMode = "true,") {
  63. WriteProperty(bizHawkCfg,"""GB_AsSGB""","false,",,,":") ; turn SGBMode off
  64. saveBizhawkCfg := 1
  65. } Else If (sgbMode = "true" And currentSGBMode = "false,") {
  66. WriteProperty(bizHawkCfg,"""GB_AsSGB""","true,",,,":") ; turn SGBMode on
  67. saveBizhawkCfg := 1
  68. }
  69. If (sgbMode = "true") ; When SGB is enabled, BizHawk uses "SNES" in the win title instead of "Game Boy"
  70. ident := "SNES"
  71. }
  72.  
  73. If saveBizhawkCfg
  74. SaveProperties(bizhawkFile,bizHawkCfg)
  75.  
  76. HideEmuStart()
  77. Run(executable . " """ . romPath . "\" . romName . romExtension . """" . bizFullscreen, emuPath)
  78.  
  79. WinWait(ident)
  80.  
  81. If (systemName := "Nintendo 64") ; for some reason this system doesn't activate correctly and causes Fade to get hung up, forcing activation prevents this
  82. WinActivate, %ident%
  83.  
  84. WinWaitActive(ident)
  85.  
  86. BezelDraw()
  87. HideEmuEnd()
  88. FadeInExit()
  89.  
  90. Process("WaitClose", executable)
  91.  
  92. 7zCleanUp()
  93. BezelExit()
  94. FadeOutExit()
  95. ExitModule()
  96.  
  97.  
  98. SaveBizHawkFile(text,file) {
  99. FileDelete, %file%
  100. FileAppend, %text%, %file%
  101. }
  102.  
  103. BarcodeReader:
  104. Log("Module - Enabling Barcode Reader Dialog")
  105. ;WinMenuSelectItem, %ident%,, NES, Barcode Reader ;This doesn't seem to work
  106. SendCommand("{Alt Down}n{Alt Up}b")
  107. Return
  108.  
  109. BezelLabel:
  110. disableHideTitleBar = true
  111. disableHideToggleMenu = true
  112. disableHideBorder = true
  113. Return
  114.  
  115. RestoreEmu:
  116. ; WinMenuSelectItem does not work and & Winspector Spy msgs do not give any sign of WM_COMMAND used in this emu
  117. WinSet, Transparent, On, %ident% ; helps eliminate flashing of emu window when resuming, not 100% of the time though, but good enough
  118. WinActivate, %ident%
  119. If (Fullscreen = "true")
  120. { Send, !{Enter}
  121. Sleep, 100
  122. Send, !{Enter}
  123. }
  124. WinSet, Transparent, Off, %ident%
  125. Return
  126.  
  127. CloseProcess:
  128. FadeOutStart()
  129. WinClose(ident)
  130. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement