@echo off setlocal enabledelayedexpansion set "CC65_SAMPLES=C:\Development\Commodore\cc65-snapshot-win64 (1)\samples" set "OUTDIR=%~dp0" where cl65 >nul 2>nul if errorlevel 1 ( echo cl65 was not found on PATH. echo Install cc65 or add its bin directory to PATH. exit /b 1 ) pushd "!CC65_SAMPLES!" if errorlevel 1 ( echo Could not cd to !CC65_SAMPLES! exit /b 1 ) cl65 -t c64 -DMOUSE_DRIVER=c64_1351_mou -O -o "%OUTDIR%mousedemo-upstream.prg" mousedemo.c set BUILD_ERR=%errorlevel% popd if %BUILD_ERR% neq 0 ( echo build failed. exit /b 1 ) echo built mousedemo-upstream.prg successfully.