;----------------------------------------------------------------------------
; Sega Dreamcast
; Makaron T12-5, NullDC v1.0.4 r135, Demul v0.5.6
; by djvj/brolly
; 1.6
;
; 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" onclick="window.open(this.href);return false;
;
; ** 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.
;
; ** nullDC **
; If you want to use specific configs per game, create a folder called Cfg inside nullDC folder and copy your nullDC.cfg
; config files into it naming them to match the database names. Make sure you keep a copy of nullDC.cfg on the Cfg folder as well.
;
; If you want to convert your roms from gdi to chd, see here:
http://www.emutalk.net/showthread.php?t=51502" onclick="window.open(this.href);return false;
; 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/showp ... tcount=138" onclick="window.open(this.href);return false;
;----------------------------------------------------------------------------
;Settings
loadingScreen=1
fullscreenWidth = 1920
fullscreenHeight = 1200
addsounds=0
nomousy=1
if(nomousy){
Run, D:\Frontend\nomousy\nomousy.exe /hide
}
if(loadingScreen){
Gui +AlwaysOnTop -Caption +ToolWindow
Gui, Color, Black
logoXPos := A_ScreenWidth/2 - 900 /2
Gui, Add, Picture,x%logoXPos% y120, %A_ScriptDir%\Media\Fade\%systemName%\_Default\Layer 2.png
loadXPos := A_ScreenWidth/2 - 500 /2
loadYPos := A_ScreenHeight - 120
Gui, Add, Picture,x%loadXPos% y%loadYPos%, %A_ScriptDir%\Media\Fade\%systemName%\_Default\Layer 3.png
Gui Show, x0 y0 h%A_ScreenHeight% w%A_ScreenWidth%
}
if(addsounds)
{
;sounds specify a directory of sounds for "romname"
soundplay, %A_ScriptDir%\Media\Sounds\%systemName%\%systemName%.mp3
Sleep, 2000
}
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%, Makaron, useVJoy ; makaron only
IniRead, emulator, %settingsFile%, %romName%, Emulator, NullDC
IniRead, winCE, %settingsFile%, %romName%, WinCE, false ; makaron only
IniRead, cable, %settingsFile%, %romName%, Cable, 0 ; makaron only
IniRead, keyboard, %settingsFile%, %romName%, Keyboard, false ; makaron only
IniRead, disableplayertwo, %settingsFile%, %romName%, DisablePlayerTwo, false ; makaron only
If ( emulator = "Demul" ) {
IniRead, useGlobalShaderEffects, %settingsFile%, Demul, useGlobalShaderEffects
} Else If ( emulator = "Makaron" && useVJoy = "true" ) {
IniRead, vJoyPath, %settingsFile%, Makaron, vJoyPath
IniRead, vJoyExe, %settingsFile%, Makaron, vJoyExe
IniRead, vJoyIni, %settingsFile%, Makaron, vJoyIni
CheckFile(vJoyIni)
} Else If emulator not in Demul,Makaron
{
IniRead, dualMonitors, %settingsFile%, nulldc, DualMonitors
IniRead, autoStart, %settingsFile%, nulldc, autoStart
IniRead, autoHideMenu, %settingsFile%, nulldc, autoHideMenu
IniRead, alwaysOnTop, %settingsFile%, nulldc, alwaysOnTop
IniRead, showVMU, %settingsFile%, nulldc, showVMU
IniRead, loadDefaultImage, %settingsFile%, nulldc, loadDefaultImage
IniRead, patchRegion, %settingsFile%, nulldc, patchRegion
}
If ( WinCE = "true" && emulator != "Makaron" )
ScriptError("You have WinCE set but Makaron is not your emulator. WinCE games only work on Makaron")
GUI_ID := FadeInStart()
7z1 := 7z(romPath, romName, romExtension, 7zExtractDir)
If ( emulator = "Makaron" ) {
If (romExtension = ".gdi")
CheckForSpaces(romName)
makIni := checkFile(pathToMakaron . "Makaron.ini")
mapleFile := checkFile(pathToMakaron . "Maple.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/off because WinCE games require this
If ( MMU != 1 && winCE = "true" )
IniWrite, 1, %makIni%, SH4, MMU
Else If ( MMU != 0 && winCE = "false" )
IniWrite, 0, %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
;Read Maple.ini into memory and plug/unplug the keyboard as necessary
FileRead, mapleCFG, %mapleFile%
currentKeyboard := (InStr(mapleCFG, "#Adres0x20 = MakaronKEY.dll") ? ("true") : ("false"))
If ( keyboard = "true" And currentKeyboard = "true" ) {
StringReplace, mapleCFG, mapleCFG, #Adres0x20 = MakaronKEY.dll, Adres0x20 = MakaronKEY.dll
Save = 1
} Else If ( keyboard = "false" And currentKeyboard = "false" ) {
StringReplace, mapleCFG, mapleCFG, Adres0x20 = MakaronKEY.dll, #Adres0x20 = MakaronKEY.dll
Save = 1
}
If Save
SaveFile(mapleCFG,mapleFile)
;Unplug controller from port 2 if needed
padFile := checkFile(pathToMakaron . "MakaronPAD.ini")
IniRead, isPortBDisabled, %padFile%, Urzadzenia, PortB, %A_Space%
isPortBDisabled := isPortBDisabled ? "false" : "true"
If (isPortBDisabled = "true" && disableplayertwo = "false") {
IfExist, %pathToMakaron%MakaronPAD_2P.ini
FileCopy, %pathToMakaron%MakaronPAD_2P.ini, %pathToMakaron%MakaronPAD.ini, 1
} Else If (isPortBDisabled = "false" && disableplayertwo = "true") {
IfExist, %pathToMakaron%MakaronPAD_1P.ini
FileCopy, %pathToMakaron%MakaronPAD_1P.ini, %pathToMakaron%MakaronPAD.ini, 1
}
Run, %makaronExe% "%romPath%%romName%%romExtension%", %pathToMakaron%
Sleep, 4000 ; adjust to your liking for how long you want to see the black screen
GUI_ID2 := 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
}
IniWrite, 1, %pathToDemul%Demul.ini, main, region ; Set BIOS to Auto Region
Sleep, 250
Run, %demulExe% -run=dc -image="%romPath%%romName%%romExtension%", %pathToDemul%
Sleep, 1000 ; adjust to your liking for how long you want to see the black screen
;Si vous n'avez pas mis plein ecran dans demul alors enleve les 2 poniy virgule des lignes suivantes
;If ( Fullscreen = "true" )
; Send !{Enter} ; fullscreen
GUI_ID2 := FadeInExit()
Process, WaitClose, %demulExe%
} Else { ; This will run NullDC and is the default for any game not defined in Settings.ini
specialCfg = %pathToNullDC%cfg\%romName%.cfg
defaultCfg = %pathToNullDC%cfg\nullDC.cfg
If ( FileExist(specialCfg) && FileExist(defaultCfg))
FileCopy, %specialCfg%, %pathToNullDC%nullDC.cfg, 1
Else If (FileExist(defaultCfg))
FileCopy, %defaultCfg%, %pathToNullDC%nullDC.cfg, 1
nullDCcfg := checkFile(pathToNullDC . "nullDC.cfg")
;Detect game region based on rom name
region = 1
IfInString, romName, (Europe)
region = 2
IfInString, romName, (Japan)
region = 0
IfInString, romName, (World)
region = 2
;Write Settings
If (Fullscreen = "true" )
IniWrite, 1, %nullDCcfg%, nullDC_GUI, Fullscreen
Else
IniWrite, 0, %nullDCcfg%, nullDC_GUI, Fullscreen
IniWrite, %autoStart%, %nullDCcfg%, nullDC, Emulator.AutoStart
IniWrite, %noConsole%, %nullDCcfg%, nullDC, Emulator.NoConsole
IniWrite, %autoHideMenu%, %nullDCcfg%, nullDC_GUI, AutoHideMenu
IniWrite, %alwaysOnTop%, %nullDCcfg%, nullDC_GUI, AlwaysOnTop
IniWrite, %showVMU%, %nullDCcfg%, drkMaple, VMU.Show
IniWrite, %loadDefaultImage%, %nullDCcfg%, ImageReader, LoadDefaultImage
IniWrite, %patchRegion%, %nullDCcfg%, ImageReader, PatchRegion
IniWrite, %region%, %nullDCcfg%, nullDC, Dreamcast.Region
IniWrite, %romPath%%romname%%RomExtension%, %nullDCcfg%, ImageReader, DefaultImage
;Fixes hanging previous nullDC on bad exits or loads
Process, Exist, %nullDCExe%
If !ErrorLevel = 0
Process, Close, %nullDCExe%
; This hides nullDC's menu when running dual screens
If ( dualMonitors = "true" ) {
MouseGetPos X, Y
SetDefaultMouseSpeed, 0
MouseMove %A_ScreenWidth%,%A_ScreenHeight%
}
Run, %nullDCExe%, %pathToNullDC%, Hide
Sleep, 2000 ; Enough to hide the startup logo
WinWait, nullDC ahk_class ndc_main_window
WinWaitActive, nullDC ahk_class ndc_main_window
DllCall("SetMenu", uint, WinActive( "A" ), uint, 0) ; Removes the MenuBar
;Let's completely hide the menu by slighly moving the window off screen
;nullDC will self adjust once the menu autohides
If ( fullScreen = "true" ) {
yOffset = -20
winHeight := A_ScreenHeight - yOffset
WinMove, nullDC,, 0, %yOffset%, %A_ScreenWidth%, %winHeight%
}
WinShow, nullDC ; without these, nullDC may stay hidden behind HS
WinActivate, nullDC
GUI_ID2 := FadeInExit()
Process, WaitClose, %nullDCExe%
}
; Closing VJoy
If ( emulator = "Makaron" && useVJoy = "true" )
Run, %vJoyExe% -exit, %vJoyPath%
7z2 := 7zCleanUp()
GUI_ID4 := 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
}
}
SaveFile(text,file) {
FileDelete, %file%
FileAppend, %text%, %file%
}
CloseProcess:
GUI_ID3 := FadeOutStart()
Process, Close, nomousy.exe
If ( emulator = "NullDC" )
WinClose, nullDC ahk_class ndc_main_window
Else If ( emulator = "Demul" )
Process, Close, %demulExe% ; 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