sync build scripts and reenable self-running demos

This commit is contained in:
4am 2022-12-19 01:20:16 -05:00
parent c6dc1a5a6b
commit 4ac2d32202
50 changed files with 76 additions and 68 deletions

View File

@ -5,7 +5,7 @@
# -p pad sizes within data file to next block size (default off) # -p pad sizes within data file to next block size (default off)
# parameters # parameters
# stdin - input containing list of effects (probably FX.CONF or DFX.CONF) # stdin - input containing list of files (e.g. FX.CONF)
# stdout - binary OKVS data structure # stdout - binary OKVS data structure
# 1 - output filename for data file # 1 - output filename for data file
# 2 - input directory of files to merge into data file # 2 - input directory of files to merge into data file
@ -49,18 +49,25 @@ tr -d "\r" | awk '!/^$|^#|^\[/' > "$records"
# make temp assembly source file that represents the binary OKVS data structure # make temp assembly source file that represents the binary OKVS data structure
source=$(mktemp) source=$(mktemp)
(echo "*=0" # dummy program counter for assembler (echo "*=0" # dummy program counter for assembler
echo "!le16 $(wc -l <"$records"), 0" # OKVS header echo "!le16 $(wc -l <"$records"), 0" # OKVS header
while IFS="=" read -r key value; do while IFS="=" read -r filename dummy; do
echo "!byte ${#key}+7" # OKVS record length key=$(echo "$filename" | awk -F'#' '{ print $1 }')
echo "!byte ${#key}" # OKVS key length addr=$(echo "$filename" | awk -F'#' '{ print $2 }')
echo "!text \"$key\"" # OKVS key if [ "${#addr}" -ne "0" ]; then # if filename is in the form 'NAME#06ADDR' then create extended index record
if [ ! -e "$2/$key" ]; then # if file does not exist, use standard offset and size addr=$(echo "$addr" | cut -c3-) # trim '06' so we get just the starting address
echo "!byte ${#key}+9" # OKVS record length
else
echo "!byte ${#key}+7" # OKVS record length
fi
echo "!byte ${#key}" # OKVS key length
echo "!text \"$key\"" # OKVS key
if [ ! -e "$2/$filename" ]; then # if file does not exist, use standard offset and size
offset="$standardoffset" offset="$standardoffset"
size="$standardsize" size="$standardsize"
else # otherwise calculate offset and size from file and options else # otherwise calculate offset and size from file and options
offset=$(wc -c < "$1") offset=$(wc -c < "$1")
size=$(wc -c < "$2/$key") size=$(wc -c < "$2/$filename")
if [ "$pad" = true ]; then if [ "$pad" = true ]; then
# If offset+size does not cross a block boundary, use file's true size. # If offset+size does not cross a block boundary, use file's true size.
# Otherwise, round up size to the next block boundary. # Otherwise, round up size to the next block boundary.
@ -70,10 +77,11 @@ source=$(mktemp)
size=$(((($offset + $size + 511) & -512) - $offset)) size=$(((($offset + $size + 511) & -512) - $offset))
fi fi
fi fi
cat "$2/$key" >> "$1" # append this file to the end of the merged data file cat "$2/$filename" >> "$1" # append this file to the end of the merged data file
fi fi
echo "!be24 $offset" echo "!be24 $offset"
echo "!le16 $size" echo "!le16 $size"
[ "${#addr}" -ne "0" ] && echo '!le16 $'"$addr"
[ "${#3}" -ne "0" ] && echo "$key,$offset,$size" >> "$3" [ "${#3}" -ne "0" ] && echo "$key,$offset,$size" >> "$3"
done < "$records") > "$source" done < "$records") > "$source"

View File

@ -35,9 +35,10 @@ source=$(mktemp)
if [ -z "$dhgrlog" ]; then if [ -z "$dhgrlog" ]; then
dhgr="0" dhgr="0"
else else
dhgr=$(echo "$key" | cut -c3) # 'has DHGR title screen' flag (0 or 1) dhgr=$(echo "$key" | cut -c3) # 'has DHGR title screen' flag (0 or 1)
fi fi
cheat=$(echo "$key" | cut -c4) # 'cheat category' (0..5) cheat=$(echo "$key" | cut -c4) # 'cheat category' (0..7)
single=$(echo "$key" | cut -c5) # 'single-load' flag (0 or 1)
key=$(echo "$key" | cut -d"," -f2) key=$(echo "$key" | cut -d"," -f2)
if [ "$dhgr" -eq "0" ]; then if [ "$dhgr" -eq "0" ]; then
offset=$hgrlog offset=$hgrlog
@ -55,7 +56,7 @@ source=$(mktemp)
echo "!byte ${#value}" # OKVS value length echo "!byte ${#value}" # OKVS value length
echo "!text \"$value\"" # OKVS value (display name) echo "!text \"$value\"" # OKVS value (display name)
echo "!byte 1" echo "!byte 1"
echo "!byte $((dhgr*128))+$cheat" echo "!byte $((dhgr*128))+$((single*64))+$cheat"
echo "!be24 $offset" echo "!be24 $offset"
echo "!le16 $size" echo "!le16 $size"
done < "$records" done < "$records"

View File

@ -47,11 +47,8 @@ cat res/GAMES.CONF |
cut -d"=" -f1 > /tmp/games cut -d"=" -f1 > /tmp/games
# warn about unused self-running demos # warn about unused self-running demos
cat res/DEMO/_FileInformation.txt | grep '^\!to' src/demo/*.a | cut -d'/' -f5-|cut -d'#' -f1 |
tr -d "\r" |
grep "Type(06)" |
grep -v "SPCARTOON" | grep -v "SPCARTOON" |
cut -d"=" -f1 |
while read f; do while read f; do
grep "$f=0" res/ATTRACT.CONF >/dev/null || echo "unused demo: $f"; grep "$f=0" res/ATTRACT.CONF >/dev/null || echo "unused demo: $f";
done done
@ -71,9 +68,9 @@ cat res/ATTRACT.CONF |
IFS="=" read -r module_name module_type <<< "$line" IFS="=" read -r module_name module_type <<< "$line"
# echo "$module_name" "$module_type" # echo "$module_name" "$module_type"
if [ "$module_type" = "0" ]; then if [ "$module_type" = "0" ]; then
[ -f res/DEMO/"$module_name" ] || [ "${module_name%???}" = "SPCARTOON" ] && continue
[ "${module_name%???}" = "SPCARTOON" ] || demo=$(grep 'to.*'"$module_name" src/demo/*.a)
fatal_error "Can't find demo" $module_name [ -n "$demo" ] || fatal_error "Can't find demo" $module_name
elif [ "$module_type" = "1" ]; then elif [ "$module_type" = "1" ]; then
check_slideshow res/SS/"$module_name" res/TITLE.HGR/ check_slideshow res/SS/"$module_name" res/TITLE.HGR/
elif [ "$module_type" = "2" ]; then elif [ "$module_type" = "2" ]; then

View File

@ -34,7 +34,7 @@
#set 1 #set 1
FAVORITES.CONF=1 FAVORITES.CONF=1
ACTCOMPIL.CONF=2 ACTCOMPIL.CONF=2
#FORMULA.1.RACER=0 FORMULA.1.RACER=0
DHGR1.CONF=3 DHGR1.CONF=3
ACTNZ.CONF=2 ACTNZ.CONF=2
CATBOXING.CONF=1 CATBOXING.CONF=1
@ -44,7 +44,7 @@ SHR1.CONF=5
#set 2 #set 2
TITLENZ.CONF=1 TITLENZ.CONF=1
ACTKARATE.CONF=2 ACTKARATE.CONF=2
#TRACK.AND.FIELD=0 TRACK.AND.FIELD=0
ACTDHGR3.CONF=4 ACTDHGR3.CONF=4
ACTWINGAM.CONF=2 ACTWINGAM.CONF=2
CATBASEB.CONF=1 CATBASEB.CONF=1

View File

@ -4,5 +4,6 @@
# #
FORMULA.1.RACER=A FORMULA.1.RACER=A
FORMULA.1.RACER=0
[eof] [eof]

View File

@ -4,5 +4,6 @@
# #
TRACK.AND.FIELD=A TRACK.AND.FIELD=A
TRACK.AND.FIELD=0
[eof] [eof]

View File

@ -2,7 +2,7 @@
# HGR title slideshow of baseball games # HGR title slideshow of baseball games
# #
BASEBALL #BASEBALL
HARDBALL HARDBALL
[eof] [eof]

View File

@ -7,7 +7,7 @@ CHAMP.BSKETBALL
BOP.N.WRESTLE BOP.N.WRESTLE
AUTOBAHN AUTOBAHN
CMPTR.FOOSBALL CMPTR.FOOSBALL
BASEBALL #BASEBALL
CHAMP.WRESTLE CHAMP.WRESTLE
[eof] [eof]

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1664778 !be24 1664703
!le16 496 !le16 496

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1653526 !be24 1653397
!le16 879 !le16 917

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1647204 !be24 1647075
!le16 214 !le16 214

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1648469 !be24 1648340
!le16 458 !le16 458

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1650006 !be24 1649877
!le16 399 !le16 399

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1652050 !be24 1651921
!le16 694 !le16 694

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1665274 !be24 1665199
!le16 306 !le16 306

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1665924 !be24 1665849
!le16 257 !le16 257

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1666181 !be24 1666106
!le16 303 !le16 303

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1449833 !be24 1449704
!le16 52 !le16 52

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1657045 !be24 1656954
!le16 1640 !le16 1640

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1665656 !be24 1665581
!le16 67 !le16 67

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1467522 !be24 1664691
!le16 12 !le16 12

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1663987 !be24 1663900
!le16 739 !le16 739

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1662327 !be24 1662236
!le16 216 !le16 216

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1654405 !be24 1654314
!le16 2640 !le16 2640

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1659043 !be24 1658952
!le16 782 !le16 782

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1665580 !be24 1665505
!le16 76 !le16 76

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1664726 !be24 1664639
!le16 52 !le16 52

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1665723 !be24 1665648
!le16 201 !le16 201

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1662543 !be24 1662452
!le16 335 !le16 335

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1662878 !be24 1662787
!le16 69 !le16 69

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1662947 !be24 1662856
!le16 81 !le16 81

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1663028 !be24 1662937
!le16 62 !le16 62

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1663090 !be24 1662999
!le16 623 !le16 623

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1663713 !be24 1663622
!le16 274 !le16 274

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1466727 !be24 1663896
!le16 4 !le16 4

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1666484 !be24 1666409
!le16 2370 !le16 2370

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1660887 !be24 1660796
!le16 381 !le16 381

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1661268 !be24 1661177
!le16 420 !le16 420

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1652744 !be24 1652615
!le16 782 !le16 782

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 423004 !be24 422955
!le16 8184 !le16 8184

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 439380 !be24 439331
!le16 8184 !le16 8184

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 431188 !be24 431139
!le16 8192 !le16 8192

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1646637 !be24 1646508
!le16 567 !le16 567

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1647418 !be24 1647289
!le16 1051 !le16 1051

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1648927 !be24 1648798
!le16 1079 !le16 1079

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1650405 !be24 1650276
!le16 1645 !le16 1645

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1658685 !be24 1658594
!le16 358 !le16 358

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1659825 !be24 1659734
!le16 1062 !le16 1062

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1661688 !be24 1661597
!le16 639 !le16 639

View File

@ -4,5 +4,5 @@
; This file is automatically generated ; This file is automatically generated
; ;
!byte 0 !byte 0
!be24 1646400 !be24 1646271
!le16 237 !le16 237