mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-26 00:08:10 +00:00
core: simplify emu.sh runner
This commit is contained in:
parent
6a3d6b15a9
commit
eb1192bc2c
@ -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);
|
||||
|
13
core/emu.sh
13
core/emu.sh
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user