Skip to content

Commit

Permalink
Update build.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Ismael-VC committed Sep 8, 2024
1 parent bb57e89 commit b030d05
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

OS_TYPE=$(uname)
ROM=rom/talos.rom
HOST=`uname -a`
echo "Host: $HOST"

# Start
# Save TTY settings.
Expand Down Expand Up @@ -51,11 +53,16 @@ if [ -z "$EMU_PATH" ]; then
fi

# Pre-process
if [ "$1" = "--debug" ]; then
echo "Debugging Enabled."
DEBUG="DBG"
else
echo "Debugging Disabled."
for arg in "$@"; do
case "$arg" in
"--debug")
echo "Debugging enabled."
DEBUG="DBG"
;;
esac
done

if [ -z "$DEBUG" ]; then
DEBUG="NO_DBG"
fi

Expand Down Expand Up @@ -101,15 +108,18 @@ $ASM talos/includes.tal ../rom/talos.rom || exit 127
cd ..

# Install
if [ "$1" = "--install" ]; then
echo "Installing ./{bin,rom} at ~/{bin,roms}"
cp bin/* ~/bin
cp rom/talos.rom ~/roms
fi
for arg in "$@"; do
case "$arg" in
"--install")
echo "Installing ./{bin,rom} at ~/{.local/bin,roms}"
mkdir -p ~/roms
cp bin/* ~/.local/bin
cp rom/talos.rom ~/roms
;;
esac
done

# Run
HOST=`uname -a`
echo "Host: $HOST"
if echo "$OS_TYPE" | grep -qi "mingw"; then
# Does not support -xcase
stty -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl \
Expand All @@ -123,7 +133,7 @@ fi
echo "Using emulator: $EMU_PATH"
$EMU $ROM
EXIT=`echo $?`
echo "Exit Code: $EXIT"
echo "Exit code: $EXIT"


# Exit
Expand Down

0 comments on commit b030d05

Please sign in to comment.