- Offline neural worker based on llama.cpp (fortune-engine.exe) with local Qwen3-4B model support - Native assembly Tarot 3-card spread divination and teacher grade divination mode - Text input dialog in MODE_FORTUNE communicating over anonymous pipes - Clean process lifecycle management, WM_CHAR dispatch and fallback handling - Test suites and packaging tools for offline release
68 lines
2.4 KiB
Batchfile
68 lines
2.4 KiB
Batchfile
@echo off
|
|
setlocal
|
|
|
|
rem Check Visual Studio / MSVC 18 Community first (fast 64-bit hosted toolchain)
|
|
set "VS_COMM_BIN=C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.51.36231\bin\Hostx64\x86"
|
|
set "SDK_LIB=C:\Program Files (x86)\Windows Kits\10\Lib\10.0.26100.0\um\x86"
|
|
set "UCRT_LIB=C:\Program Files (x86)\Windows Kits\10\Lib\10.0.26100.0\ucrt\x86"
|
|
set "VC_COMM_LIB=C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.51.36231\lib\x86"
|
|
|
|
if exist "%VS_COMM_BIN%\ml.exe" (
|
|
set "ML_EXE=%VS_COMM_BIN%\ml.exe"
|
|
set "LINK_EXE=%VS_COMM_BIN%\link.exe"
|
|
set LIB_PATHS=/LIBPATH:"%SDK_LIB%" /LIBPATH:"%UCRT_LIB%" /LIBPATH:"%VC_COMM_LIB%"
|
|
set "EXTRA_FLAGS=/NOLOGO /SUBSYSTEM:WINDOWS"
|
|
goto do_build
|
|
)
|
|
|
|
rem Check standard MASM32 paths
|
|
if exist "F:\MASM32\masm32\bin\ml.exe" (
|
|
set "ML_EXE=F:\MASM32\masm32\bin\ml.exe"
|
|
set "LINK_EXE=F:\MASM32\masm32\bin\link.exe"
|
|
set "LIB_PATHS=/LIBPATH:F:\MASM32\masm32\lib"
|
|
set "EXTRA_FLAGS=/SUBSYSTEM:WINDOWS /RELEASE /VERSION:4.0"
|
|
goto do_build
|
|
)
|
|
if exist "D:\MASM32\masm32\bin\ml.exe" (
|
|
set "ML_EXE=D:\MASM32\masm32\bin\ml.exe"
|
|
set "LINK_EXE=D:\MASM32\masm32\bin\link.exe"
|
|
set "LIB_PATHS=/LIBPATH:D:\MASM32\masm32\lib"
|
|
set "EXTRA_FLAGS=/SUBSYSTEM:WINDOWS /RELEASE /VERSION:4.0"
|
|
goto do_build
|
|
)
|
|
if exist "C:\masm32\bin\ml.exe" (
|
|
set "ML_EXE=C:\masm32\bin\ml.exe"
|
|
set "LINK_EXE=C:\masm32\bin\link.exe"
|
|
set "LIB_PATHS=/LIBPATH:C:\masm32\lib"
|
|
set "EXTRA_FLAGS=/SUBSYSTEM:WINDOWS /RELEASE /VERSION:4.0"
|
|
goto do_build
|
|
)
|
|
|
|
echo [ERROR] No compatible MASM/MSVC assembler found!
|
|
goto err
|
|
|
|
:do_build
|
|
rem Prefer SDK imports for modern APIs missing from older MASM32 libraries.
|
|
if exist "%ProgramFiles(x86)%\Windows Kits\10\Lib\10.0.26100.0\um\x86\kernel32.lib" (
|
|
set LIB_PATHS=/LIBPATH:"%ProgramFiles(x86)%\Windows Kits\10\Lib\10.0.26100.0\um\x86" %LIB_PATHS%
|
|
)
|
|
set "ICON_RESOURCE="
|
|
if exist "build\casino_icon.res" set "ICON_RESOURCE=build\casino_icon.res"
|
|
echo Assembling poker.asm...
|
|
"%ML_EXE%" /c /coff /Cp /nologo /I. poker.asm
|
|
if errorlevel 1 goto err
|
|
|
|
echo Linking poker.obj...
|
|
"%LINK_EXE%" %EXTRA_FLAGS% %LIB_PATHS% /OUT:poker.exe poker.obj %ICON_RESOURCE% kernel32.lib winmm.lib user32.lib ws2_32.lib gdi32.lib
|
|
if errorlevel 1 goto err
|
|
|
|
copy /y poker.exe build\graphics\poker.exe >nul 2>&1
|
|
echo [SUCCESS] poker.exe built successfully!
|
|
goto end
|
|
|
|
:err
|
|
echo [ERROR] Build failed!
|
|
exit /b 1
|
|
|
|
:end
|
|
endlocal
|