#!/bin/sh
# Ch416: full native-12.4 scene fixture and runtime assets.
set -eu
DEST="${1:-terasic@192.168.50.161:~}"
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
DATA="$ROOT/sim/data/top_psmct32_raster_demo"
EPOCHS="$DATA/sh3_zsrt139f17_epochs.txt"

FILES="$ROOT/tools/ps2_sh3_sched.c $EPOCHS"
add_file() {
    case " $FILES " in
        *" $1 "*) ;;
        *) FILES="$FILES $1" ;;
    esac
}

while read -r k idx tbp cbp tex lpddr size crc list words records reuse pal palsum rest; do
    case "$k" in ''|'#'*) continue ;; META) continue ;; esac
    add_file "$DATA/$tex"
    add_file "$DATA/$list"
    add_file "$DATA/$pal"
done < "$EPOCHS"

for f in $FILES; do
    [ -f "$f" ] || { echo "MISSING: $f" >&2; exit 1; }
done
exec scp $FILES "$DEST"
