1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 23:48:12 +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 #endif
// TODO: find better way how to embed/distribute background image // TODO: find better way how to embed/distribute background image
#ifdef TREZOR_EMULATOR_RASPI #ifdef TREZOR_EMULATOR_RASPI
BACKGROUND = IMG_LoadTexture(RENDERER, "../embed/unix/background_raspi.jpg"); BACKGROUND = IMG_LoadTexture(RENDERER, "embed/unix/background_raspi.jpg");
#else #else
BACKGROUND = IMG_LoadTexture( BACKGROUND = IMG_LoadTexture(
RENDERER, "../embed/unix/background_" XSTR(TREZOR_MODEL) ".jpg"); RENDERER, "embed/unix/background_" XSTR(TREZOR_MODEL) ".jpg");
#endif #endif
if (BACKGROUND) { if (BACKGROUND) {
SDL_SetTextureBlendMode(BACKGROUND, SDL_BLENDMODE_NONE); SDL_SetTextureBlendMode(BACKGROUND, SDL_BLENDMODE_NONE);

View File

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