1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 15:38:11 +00:00

core: simplify emu.sh runner

This commit is contained in:
Pavol Rusnak 2019-05-03 21:28:24 +02:00
parent 6a3d6b15a9
commit eb1192bc2c
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
2 changed files with 8 additions and 9 deletions

View File

@ -135,10 +135,10 @@ void display_init(void) {
#endif
// TODO: find better way how to embed/distribute background image
#ifdef TREZOR_EMULATOR_RASPI
BACKGROUND = IMG_LoadTexture(RENDERER, "../embed/unix/background_raspi.jpg");
BACKGROUND = IMG_LoadTexture(RENDERER, "embed/unix/background_raspi.jpg");
#else
BACKGROUND = IMG_LoadTexture(
RENDERER, "../embed/unix/background_" XSTR(TREZOR_MODEL) ".jpg");
RENDERER, "embed/unix/background_" XSTR(TREZOR_MODEL) ".jpg");
#endif
if (BACKGROUND) {
SDL_SetTextureBlendMode(BACKGROUND, SDL_BLENDMODE_NONE);

View File

@ -4,28 +4,27 @@ source emu.config 2>/dev/null
EXE=build/unix/micropython
PYOPT="${PYOPT:-1}"
MAIN="${MAIN:-${PWD}/src/main.py}"
MAIN="${MAIN:-src/main.py}"
HEAPSIZE="${HEAPSIZE:-50M}"
SOURCE_PY_DIR="${SOURCE_PY_DIR:-src}"
ARGS="-O${PYOPT} -X heapsize=${HEAPSIZE}"
cd `dirname $0`/$SOURCE_PY_DIR
cd `dirname $0`
case "$1" in
"-d")
shift
OPERATING_SYSTEM=$(uname)
if [ $OPERATING_SYSTEM == "Darwin" ]; then
PATH=/usr/bin /usr/bin/lldb -f ../$EXE -- $ARGS $* $MAIN
PATH=/usr/bin /usr/bin/lldb -f $EXE -- $ARGS $* $MAIN
else
gdb --args ../$EXE $ARGS $* $MAIN
gdb --args $EXE $ARGS $* $MAIN
fi
;;
"-r")
shift
while true; do
../$EXE $ARGS $* $MAIN &
$EXE $ARGS $* $MAIN &
UPY_PID=$!
find -name '*.py' | inotifywait -q -e close_write --fromfile -
echo Restarting ...
@ -33,5 +32,5 @@ case "$1" in
done
;;
*)
../$EXE $ARGS $* $MAIN
$EXE $ARGS $* $MAIN
esac