@echo off
set HOME=%~dp0
set LIB="%HOME%lib"
set CP=%LIB%\scala-library-2.13.16.jar;%LIB%\rsyntaxtextarea-3.6.0.jar;%LIB%\jsoup-1.21.2.jar;%LIB%\scala-parser-combinators_2.13-2.4.0.jar;%LIB%\commons-net-3.12.0.jar;%LIB%\flatlaf-3.6.1.jar;%LIB%\commons-io-2.20.0.jar;%LIB%\jinput.jar;%LIB%\kernal64.jar
set CLASS=ucesoft.cbm.c64.C64
if "%1" == "--shell" goto shift_shell
if "%1" == "--help" goto help_shell
start javaw -server -Xms64M -Xmx128M -cp %CP% -Djava.library.path=%LIB% %CLASS% %*
goto end
:shift_shell

set Args=
:Parse
shift
set First=%1
if not defined First goto :EndParse
  set Args=%Args% %First%
  goto :Parse
:EndParse
goto shell

:help_shell
set Args=%*

:shell
java -server -Xms64M -Xmx128M -cp %CP% -Djava.library.path=%LIB% %CLASS% %Args%
:end