rfancella

Daphne.ahk

Jun 8th, 2014
1,138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.58 KB | None | 0 0
  1. MEmu = Daphne
  2. MEmuV = v1.0.12
  3. MURL = http://www.daphne-emu.com/
  4. MAuthor = djvj
  5. MVersion = 2.0.8
  6. MCRC = F8545233
  7. iCRC = 7FCE1920
  8. MID = 635038268879753802
  9. MSystem = "Daphne","LaserDisc"
  10. ;----------------------------------------------------------------------------
  11. ; Notes:
  12. ; Executable should be Daphne.exe NOT Daphneloader.exe
  13. ; You need the module's ini from GIT, remove the (Example) from the filename. It has settings for each game so they work properly.
  14. ; If you want to define custom controls for each game, follow this process:
  15. ; 1) Manually run DaphneLoader.exe
  16. ; 2) Select each game you want to configure and click the Configure button. Select the Input tab and define your controls and hit OK and repeat for each game.
  17. ; 3) Create a folder in your emu directory called "controls" and copy your current dapinput.ini into it. This will be your default controls used for all games that a custom one was not created.
  18. ; 4) Launch each game you defined controls for through DaphneLoader. DaphneLoader will set your custom controls in the dapinput.ini. Now exit the game.
  19. ; 5) After each game you launch, copy the dapinput.ini into the controls folder and name it after the rom name you use in your xml: Example: lair.ini
  20. ;
  21. ; First time users, please follow the guide found @ http://www.hyperspin-fe.com/forum/showthread.php?29410-Complete-Guide-for-Daphne-in-HyperSpin-and-HL3
  22. ;----------------------------------------------------------------------------
  23. StartModule()
  24. BezelGUI()
  25. FadeInStart()
  26.  
  27. settingsFile := modulePath . "\" . moduleName . ".ini"
  28. globalParams := IniReadCheck(settingsFile,"settings","globalParams","vldp -blank_searches -prefer_samples -noissues -fastboot",,1)
  29. fullscreen := IniReadCheck(settingsFile, "Settings", "Fullscreen","true",,1)
  30. screenWidth := IniReadCheck(settingsFile, "Settings", "ScreenWidth",A_ScreenWidth,,1)
  31. screenHeight := IniReadCheck(settingsFile, "Settings", "ScreenHeight",A_ScreenHeight,,1)
  32. pauseOnExit := IniReadCheck(settingsFile,"settings","pauseOnExit","false",,1)
  33. hwAccel := IniReadCheck(settingsFile,"settings","hwAccel","true",,1)
  34. keepAspect := IniReadCheck(settingsFile,"settings" . "|" . romName,"KeepAspect","true",,1)
  35. min_seek_delay := IniReadCheck(settingsFile,romName,"min_seek_delay",A_Space,,1)
  36. seek_frames_per_ms := IniReadCheck(settingsFile,romName,"seek_frames_per_ms",A_Space,,1)
  37. homedir := IniReadCheck(settingsFile,romName,"homedir",".",,1)
  38. bank0 := IniReadCheck(settingsFile,romName,"bank0",A_Space,,1)
  39. bank1 := IniReadCheck(settingsFile,romName,"bank1",A_Space,,1)
  40. bank2 := IniReadCheck(settingsFile,romName,"bank2",A_Space,,1)
  41. bank3 := IniReadCheck(settingsFile,romName,"bank3",A_Space,,1)
  42. sound_buffer := IniReadCheck(settingsFile,romName,"sound_buffer",A_Space,,1)
  43. params := IniReadCheck(settingsFile,romName,"params",A_Space,,1)
  44. version := IniReadCheck(settingsFile,romName,"version",romName,,1)
  45.  
  46. frameFile = %romName% ; storing parent romName to send as the framefile name so we don't send wrong name when using an alternate version of a game
  47.  
  48. BezelStart()
  49. fullscreen := If fullscreen = "true" ? " -fullscreen" : ""
  50.  
  51. If (keepAspect = "false")
  52. params:= params . " -ignore_aspect_ratio"
  53.  
  54. If bezelPath ; this variable is only filled if bezel is enabled and a valid bezel image is found
  55. { screenWidth := " -x " . Round(bezelScreenWidth) ;bezelScreenWidth variable is defined on the BezelStart function and it gives the desired width that your game screen should have while using this bezel
  56. screenHeight := " -y " . Round(bezelScreenHeight) ;idem above
  57. } Else {
  58. screenWidth := " -x " . screenWidth
  59. screenHeight := " -y " . screenHeight
  60. }
  61.  
  62. min_seek_delay := If min_seek_delay ? " -min_seek_delay " . min_seek_delay : ""
  63. seek_frames_per_ms := If seek_frames_per_ms ? " -seek_frames_per_ms " . seek_frames_per_ms : ""
  64. homedir := If homedir ? " -homedir " . homedir : ""
  65. bank0 := If bank0 ? " -bank 0 " . bank0 : ""
  66. bank1 := If bank1 ? " -bank 1 " . bank1 : ""
  67. bank2 := If bank2 ? " -bank 2 " . bank2 : ""
  68. bank3 := If bank3 ? " -bank 3 " . bank3 : ""
  69. sound_buffer := If sound_buffer ? " -sound_buffer " . sound_buffer : ""
  70. hwAccel := If hwAccel = "true" ? " -opengl" : " -nohwaccel"
  71. params := globalParams . " " . params
  72.  
  73. hideEmuObj := Object("ahk_class SDL_app",1) ; Hide_Emu will hide these windows. 0 = will never unhide, 1 = will unhide later
  74. 7z(romPath, romName, romExtension, 7zExtractPath)
  75.  
  76. ; If you have alternate controls for a specific game, this will overwrite the current dapinput.ini with your custom one
  77. romControlIni := emuPath . "\controls\" . romName . ".ini"
  78. defaultControlIni := emuPath . "\controls\dapinput.ini"
  79. daphneControlIni := emuPath . "\dapinput.ini"
  80. If FileExist(romControlIni) { ; if a romName control ini exists
  81. Log("Module - Found a romName input ini and will overwrite the existing dapinput.ini: " . romControlIni)
  82. FileCopy, %romControlIni%, %daphneControlIni%, 1 ; copy rom dapinput, overwriting working one
  83. } Else If FileExist(defaultControlIni) { ; if a default control ini exists
  84. Log("Module - No romName input ini found, overwriting the current dapinput.ini with a default one: " . defaultControlIni)
  85. FileCopy, %defaultControlIni%, %daphneControlIni%, 1 ; copy default dapinput, overwriting working one in case a rom one was set from previous launch
  86. } Else
  87. Log("Module - No romName or default inis found, leaving the current dapinput.ini alone")
  88.  
  89. ; If launched game is an alternate version of a parent, this will send the alternate's name to daphne.
  90. romName = %version%
  91.  
  92. HideEmuStart() ; This fully ensures windows are completely hidden even faster than winwait
  93.  
  94. ; This allows us to send variables, that when empty, are not sent to the Run command
  95. ; msgbox % executable . A_Space . romName . A_Space . params . fullscreen . screenWidth . screenHeight . min_seek_delay . seek_frames_per_ms . homedir . bank0 . bank1 . bank2 . bank3 . sound_buffer . " -framefile """ . romPath . "\" . frameFile . romExtension . """"
  96. Run(executable . A_Space . romName . A_Space . params . hwAccel . fullscreen . screenWidth . screenHeight . min_seek_delay . seek_frames_per_ms . homedir . bank0 . bank1 . bank2 . bank3 . sound_buffer . " -framefile """ . romPath . "\" . frameFile . romExtension . """", emuPath)
  97.  
  98. WinWait("ahk_class SDL_app")
  99. WinWaitActive("ahk_class SDL_app")
  100.  
  101. BezelDraw()
  102. HideEmuEnd()
  103. FadeInExit()
  104. Process("WaitClose", executable)
  105. 7zCleanUp()
  106. FadeOutExit()
  107. ExitModule()
  108.  
  109.  
  110. HaltEmu:
  111. Send, {P}
  112. Return
  113. RestoreEmu:
  114. Winrestore, AHK_class %EmulatorClass%
  115. Send, {P}
  116. Return
  117.  
  118. CloseProcess:
  119. FadeOutStart()
  120. BezelExit()
  121. If pauseOnExit = true
  122. { Send, {P}
  123. Sleep, 100
  124. }
  125. WinClose("ahk_class SDL_app")
  126. Return
Advertisement
Add Comment
Please, Sign In to add comment