Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;----------------------------------------------------------------------------
- ; Sega Dreamcast
- ; Makaron T12-5, NullDC v1.0.4 r135, Demul v0.5.6
- ; by djvj/brolly
- ; 1.2
- ;
- ; Notes:
- ; ** Makaron **
- ; Extract all your DC bios bins into the ROM subdir of your emu
- ; Open the Makaron.ini and set your resolution and remove the # in front of the lines you want enabled, including fullscreen.
- ; This script supports the following DC images: GDI, CDI
- ; vJoy is required for joystick input for Makaron DC games: http://headsoft.com.au/index.php?category=vjoy
- ;
- ; ** Demul **
- ; This script supports the following DC images: GDI, CDI, CHD, MDS, CCD, NRG, CUE
- ; Place your dc.zip bios in the roms subdir of your emu
- ; Run demul manually and goto Config->Plugins->GD-ROM Plugin and set it to gdrImage
- ; Set your Video Plugin to gpuOglv3
- ; On first run of a game, demul will ask you to setup all your plugin choices if you haven't already.
- ;
- ; If you want to convert your roms from gdi to chd, see here: http://www.emutalk.net/showthread.php?t=51502
- ; FileDelete(s) are in the script because sometimes demul will corrupt the ini and make it crash. The script recreates a clean ini for you.
- ;
- ; Setup the user settings below to your liking
- ;
- ; For additional setup steps prior to running, see this link: http://www.hyperspin-fe.com/forum/showpost.php?p=99852&postcount=138
- ; ToDo:
- ; brolly: and some deal with some of the ini keys for makaron like keyboard
- ;----------------------------------------------------------------------------
- settingsFile := checkFile(A_WorkingDir . "\Modules\" . systemName . "\Settings.ini")
- IniRead, pathToNullDC, %settingsFile%, Settings, PathToNullDC
- IniRead, pathToMakaron, %settingsFile%, Settings, PathToMakaron
- IniRead, pathToDemul, %settingsFile%, Settings, PathToDemul
- IniRead, NullDCExe, %settingsFile%, Settings, NullDCExe
- IniRead, MakaronExe, %settingsFile%, Settings, MakaronExe
- IniRead, DemulExe, %settingsFile%, Settings, DemulExe
- IniRead, fullscreen, %settingsFile%, Settings, Fullscreen
- IniRead, useVJoy, %settingsFile%, Settings, useVJoy
- IniRead, emulator, %settingsFile%, %romName%, Emulator
- IniRead, winCE, %settingsFile%, %romName%, WinCE
- IniRead, cable, %settingsFile%, %romName%, Cable
- IniRead, keyboard, %settingsFile%, %romName%, Keyboard
- If ( emulator = "Demul" ) {
- IniRead, useGlobalShaderEffects, %settingsFile%, Demul, useGlobalShaderEffects
- IniRead, shaderMode, %settingsFile%, Demul, shaderMode
- IniRead, shaderPath, %settingsFile%, Demul, shaderPath
- IniRead, shaderName, %settingsFile%, Demul, shaderName
- }
- If ( useVJoy = "true" ) {
- IniRead, vJoyPath, %settingsFile%, Settings, vJoyPath
- IniRead, vJoyExe, %settingsFile%, Settings, vJoyExe
- IniRead, vJoyIni, %settingsFile%, Settings, vJoyIni
- checkFile(vJoyIni)
- }
- If ( WinCE = "true" && emulator != "Makaron" )
- ScriptError("You have WinCE set but Makaron is not your emulator. WinCE games only work on Makaron")
- FadeInStart()
- 7z(romPath, romName, romExtension, 7zExtractDir)
- If ( emulator = "Makaron" ) {
- CheckForSpaces(romName)
- makIni := checkFile(pathToMakaron . "Makaron.ini")
- IniRead, MMU, %makIni%, SH4, MMU
- IniRead, makFS, %makIni%, Settings, fullscreen
- IniRead, currentCable, %makIni%, Settings, cable
- ; Running VJoy & checking to make sure it actually ran
- If ( useVJoy = "true" ) {
- Run, %vJoyExe% -file "%vJoyIni%", %vJoyPath%
- CheckForVJoy(ByRef vJoyExe)
- }
- ; Turning MMU on because WinCE games require this
- If ( MMU != 1 $$ winCE = "true" )
- IniWrite, 1, %makIni%, SH4, MMU
- ; Changing cable if it doesn't match current setting
- If ( currentCable != cable )
- IniWrite, %cable%, %makIni%, Settings, cable
- ; Setting fullscreen on or off
- If ( makFS != 1 && Fullscreen = "true" )
- IniWrite, 1, %makIni%, Settings, fullscreen
- Else If ( makFS = 1 && Fullscreen != "true" )
- IniWrite, 0, %makIni%, Settings, fullscreen
- Run, %MakaronExe% "%romPath%%romName%%romExtension%", %pathToMakaron%
- Sleep, 4000 ; adjust to your liking for how long you want to see the black screen
- FadeInExit()
- Process, WaitClose, %MakaronExe%
- } Else If ( emulator = "Demul" ) {
- If ( romExtension = ".cdi" || romExtension = ".mds" || romExtension = ".ccd" || romExtension = ".nrg" || romExtension = ".gdi" || romExtension = ".cue" )
- {
- FileDelete, %pathToDemul%gdrImage.ini
- Sleep, 500
- IniWrite, gdrImage.dll, %pathToDemul%Demul.ini, plugins, gdr
- IniWrite, false, %pathToDemul%gdrImage.ini, Main, openDialog
- IniWrite, %romPath%%romName%%romExtension%, %pathToDemul%gdrImage.ini, Main, imagefilename
- }
- Else If ( romExtension = ".chd" )
- {
- FileDelete, %pathToDemul%gdrCHD.ini
- Sleep, 500
- IniWrite, false, %pathToDemul%gdrCHD.ini, Main, openDialog
- IniWrite, gdrCHD.dll, %pathToDemul%Demul.ini, plugins, gdr
- IniWrite, %romPath%%romName%%romExtension%, %pathToDemul%gdrCHD.ini, Main, imagefilename
- }
- ; Shader Effects
- IniRead, currentShaderValue, %pathToDemul%gpuOglv3.ini, shader, effects
- If ( useGlobalShaderEffects = "true" ){
- If ( currentShaderValue = "false" ){
- IniWrite, true, %pathToDemul%gpuOglv3.ini, shader, effects
- }
- IniWrite, %shaderMode%, %pathToDemul%gpuOglv3.ini, shader, mode
- IniWrite, %shaderPath%, %pathToDemul%gpuOglv3.ini, shader, path
- IniWrite, %shaderName%, %pathToDemul%gpuOglv3.ini, shader, name
- }
- Else If ( useGlobalShaderEffects = "false" and currentShaderValue = "true" ){
- IniWrite, false, %pathToDemul%gpuOglv3.ini, shader, effects
- }
- Sleep, 250
- Run, %executable% -run=dc, %pathToDemul%
- Sleep, 4000 ; adjust to your liking for how long you want to see the black screen
- If ( fullscreen = "true" )
- Send !{Enter} ; fullscreen
- FadeInExit()
- Process, WaitClose, %DemulExe%
- } Else { ; This will run NullDC and is the default for any game not defined in Settings.ini
- ;Settings ** MOVE THESE TO SETTINGS.INI **
- autoStart = 1
- noConsole = 1
- autoHideMenu = 1
- ;fullScreen = 1
- showVMU = 0
- loadDefaultImage = 1
- patchRegion = 1
- nullDCcfg := checkFile(pathToNullDC . "nullDC.cfg")
- ;Write Settings
- IniWrite, %autoStart%, %nullDCcfg%, nullDC, Emulator.AutoStart
- IniWrite, %noConsole%, %nullDCcfg%, nullDC, Emulator.NoConsole
- IniWrite, %autoHideMenu%, %nullDCcfg%, nullDC_GUI, AutoHideMenu
- IniWrite, %fullScreen%, %nullDCcfg%, nullDC_GUI, Fullscreen
- IniWrite, %showVMU%, %nullDCcfg%, drkMaple, VMU.Show
- IniWrite, %loadDefaultImage%, %nullDCcfg%, ImageReader, LoadDefaultImage
- IniWrite, %patchRegion%, %nullDCcfg%, ImageReader, PatchRegion
- IniWrite, %romPath%%romname%%RomExtension%, %nullDCcfg%, ImageReader, DefaultImage
- ;Fixes hanging previous nullDC on bad exits or loads
- Process, Exist, %executable%
- if !ErrorLevel = 0
- Process, Close, %executable%
- Run, %executable%, %pathToNullDC%, Hide
- Sleep, 2000 ; Enough to hide the startup logo
- ;Let's completely hide the menu by slighly moving the window off screen
- ;nullDC will self adjust once the menu autohides
- If ( fullScreen = 1 ){
- yOffset = -20
- winHeight := A_ScreenHeight - yOffset
- WinMove, nullDC,, 0, %yOffset%, %A_ScreenWidth%, %winHeight%
- }
- WinShow, nullDC
- FadeInExit()
- Process, WaitClose, %NullDCExe%
- }
- ; Closing VJoy
- If ( useVJoy = "true" )
- Run, %vJoyExe% -exit, %vJoyPath%
- 7zCleanUp()
- FadeOutExit()
- WinActivate, Hyperspin
- ExitApp
- ;(¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯)
- ; Functions - DO NOT EDIT
- ;(_.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._)
- CheckForVJoy(ByRef exe) {
- Process, Wait, %exe%, 5
- NewPID = %ErrorLevel%
- If NewPID = 0
- {
- ScriptError("VJoy did not start. Check your VJoy path and Exe")
- ExitApp
- }
- }
- CheckForSpaces(name) {
- IfInString, name, %A_Space%
- {
- ScriptError("Rom name contains a space.`nMakaron will not run games with spaces in their names")
- ExitApp
- }
- }
- CloseProcess:
- FadeOutStart()
- If ( emulator = "NullDC" )
- WinClose, nullDC ahk_class ndc_main_window
- Else If ( emulator = "Demul" )
- Process, Close, %executable% ; we have to close this way otherwise demul crashes with WinClose
- Else If ( emulator = "Makaron" ) {
- Send, {F8}
- Sleep, 1000
- Send, !{F4}
- Sleep, 500
- Process, Close, %MakaronExe% ; Makaron doesn't end the exe sometimes, we must manually do it
- }
- Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement