@echo off

SETLOCAL

SET EMULATOR_BIN_PATH=%~dp0

rem set environment variables
rem for SDL display
SET SDL_STDIO_REDIRECT=0
rem for VIGS
SET VIGS_SYNC_READ_PIXELS=1

set WITH_GDB="no"
IF "%1"=="--with-gdb" (
	set WITH_GDB="yes"
	SHIFT
)

rem run emulator
IF %WITH_GDB%=="yes" (
	gdb --args "%EMULATOR_BIN_PATH%\emulator-x86_64" %*
) ELSE (
	"%EMULATOR_BIN_PATH%\emulator-x86_64" %*
)
