@ECHO OFF
title QEMU-FM3 + CQBB-EL

start /B java -jar FM3_CQBB-EL.jar

SET QEMUFM3_PORT_MONITOR=1200
SET QEMUFM3_PORT_GPIO=1201
SET QEMUFM3_PORT_UART0=1202
SET QEMUFM3_PORT_UART3=1203
SET QEMUFM3_PORT_UART4=1204


SET QEMUFM3_MACHINE_NAME=cq-frk-fm3
REM SET QEMUFM3_MACHINE_NAME=cq-frk-fm3-ex

SET QEMUFM3_IMAGE_FILE=CQBB-ELuart.elf

SET QEMUFM3_

.\qemu-system-arm ^
	-S -M %QEMUFM3_MACHINE_NAME% ^
	-kernel %QEMUFM3_IMAGE_FILE% ^
	-nographic ^
	-chardev socket,server,host=0.0.0.0,port=%QEMUFM3_PORT_GPIO%,id=fm3gpio,nowait ^
	-device fm3-gpio-control,chardev=fm3gpio ^
	-monitor telnet:0.0.0.0:%QEMUFM3_PORT_MONITOR%,server,nowait ^
	-serial telnet:0.0.0.0:%QEMUFM3_PORT_UART0%,server,nowait ^
	-serial telnet:0.0.0.0:%QEMUFM3_PORT_UART3%,server,nowait ^
	-serial telnet:0.0.0.0:%QEMUFM3_PORT_UART4%,server
