-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrun_cryogenic.bat
More file actions
86 lines (77 loc) · 2.56 KB
/
Copy pathrun_cryogenic.bat
File metadata and controls
86 lines (77 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
@echo off
setlocal enabledelayedexpansion
cd /d "%~dp0"
set "DUNE_DIR=.\dune"
set "MT32_DIR=.\mt32rom"
set "USER_ARGS="
set "MUSIC_FOLDER_COMMAND="
set "MUSIC_FOLDER_PATH=%~dp0assets_override\music"
:parse_args
if "%~1"=="" goto parse_args_done
if /I "%~1"=="--MusicFolder" (
set "MUSIC_FOLDER_COMMAND=--OverrideMusic \"%MUSIC_FOLDER_PATH%\""
) else (
if defined USER_ARGS (
set "USER_ARGS=!USER_ARGS! %~1"
) else (
set "USER_ARGS=%~1"
)
)
shift
goto parse_args
:parse_args_done
where dotnet >nul 2>&1
if errorlevel 1 (
echo dotnet CLI not found. Install the .NET SDK to run Cryogenic.
exit /b 1
)
if not exist "%DUNE_DIR%\" (
echo Directory %DUNE_DIR% not found.
echo Please create the directory and copy the ENTIRE contents of your Dune CD 3.7 into %DUNE_DIR%
exit /b 1
)
echo Checking Dune assets...
set "DUNE_EXE_PATH="
set "DUNE_DAT_PATH="
call :locate_asset "DNCDPRG.EXE" "%DUNE_DIR%" "dncdprg.exe" DUNE_EXE_PATH
call :locate_asset "DUNE.DAT" "%DUNE_DIR%" "dune.dat" DUNE_DAT_PATH
if not defined DUNE_EXE_PATH goto :missing_dune
if not defined DUNE_DAT_PATH goto :missing_dune
goto :dune_ok
:missing_dune
echo Please copy the entire Dune CD 3.7 into %DUNE_DIR%.
exit /b 1
:dune_ok
echo Checking MT-32 ROMs...
set "MT32_CONTROL_PATH="
set "MT32_PCM_PATH="
call :locate_asset "MT32_CONTROL.ROM" "%MT32_DIR%" "mt32_control.rom" MT32_CONTROL_PATH
call :locate_asset "MT32_PCM.ROM" "%MT32_DIR%" "mt32_pcm.rom" MT32_PCM_PATH
if not defined MT32_CONTROL_PATH goto :missing_mt32
if not defined MT32_PCM_PATH goto :missing_mt32
goto :mt32_ok
:missing_mt32
echo Extract MT-32_v1.07_legacy_ROM_files.zip into %MT32_DIR% and retry.
exit /b 1
:mt32_ok
echo Running Cryogenic with arguments: -e "%DUNE_EXE_PATH%" -a "MID330 SBP2227" -m "%MT32_DIR%" -p 4096 --UseCodeOverride true --OplMode Opl3Gold %MUSIC_FOLDER_COMMAND% %USER_ARGS%
dotnet run --project src\Cryogenic -- -e "%DUNE_EXE_PATH%" -a "MID330 SBP2227" -m "%MT32_DIR%" -p 4096 --UseCodeOverride true --OplMode Opl3Gold %MUSIC_FOLDER_COMMAND% %USER_ARGS%
exit /b %errorlevel%
:: Subroutine: locate_asset <label> <dir> <pattern> <output-var>
:: Searches <dir> for <pattern> (case-insensitive on NTFS).
:: Prints found/missing status and stores the resolved path in <output-var>.
:locate_asset
set "_la_found="
for /f "delims=" %%F in ('dir /b /s /a-d "%~2\%~3" 2^>nul') do (
set "_la_found=%%F"
goto :locate_asset_done
)
:locate_asset_done
if defined _la_found (
echo %~1 -^> found: !_la_found!
set "%~4=!_la_found!"
) else (
echo %~1 -^> missing
)
goto :eof
goto :eof