diff --git a/Makefile b/Makefile index 26b66a069..8996e5aa8 100644 --- a/Makefile +++ b/Makefile @@ -120,8 +120,8 @@ index: md asmfx asmprelaunch compress # [ -f build/index ] || ((for f in res/SS/*; do \ [ $$(echo "$$(basename $$f)" | cut -c-3) = "ACT" ] && \ - bin/buildaction.sh build/GAMES.CONF < "$$f" > "build/SS/$$(basename $$f)" || \ - bin/buildtitle.sh build/GAMES.CONF < "$$f" > "build/SS/$$(basename $$f)"; \ + bin/buildslideshow.sh -d build/GAMES.CONF < "$$f" > "build/SS/$$(basename $$f)" || \ + bin/buildslideshow.sh build/GAMES.CONF < "$$f" > "build/SS/$$(basename $$f)"; \ echo "$$(basename $$f)"; \ done) | bin/buildindexedfile.sh -p -a build/TOTAL.DATA build/SS > build/SLIDESHOW.IDX) [ -f build/index ] || ((for f in res/ATTRACT/*; do \ diff --git a/bin/buildaction.sh b/bin/buildslideshow.sh similarity index 69% rename from bin/buildaction.sh rename to bin/buildslideshow.sh index 2ebd824ac..80a11878b 100755 --- a/bin/buildaction.sh +++ b/bin/buildslideshow.sh @@ -1,5 +1,22 @@ #!/bin/bash +# flags +# -d include game display name (default off = display name will be 0-length string) + +# parameters +# stdin - input containing slideshow (e.g. some file in res/SS/) +# stdout - binary OKVS data structure +# 1 - list of games with metadata (e.g. build/GAMES.CONF) + +include_displayname=false +while getopts ":d" opt; do + case $opt in + d) include_displayname=true + ;; + esac +done +shift $((OPTIND-1)) + games=$(cat "$1") # make temp file with just the key/value pairs (strip blank lines, comments, eof marker) @@ -15,7 +32,11 @@ source=$(mktemp) line=$(echo "$games" | awk '/,'"$filename"'=/') needsjoystick=$(echo "$line" | cut -c1) # 'requires joystick' flag (0 or 1) needs128k=$(echo "$line" | cut -c2) # 'requires 128K' flag (0 or 1) - displayname=$(echo "$line" | awk -F= '{ print $2 }') + if [ "$include_displayname" = false ]; then + displayname="" + else + displayname=$(echo "$line" | awk -F= '{ print $2 }') + fi echo "!byte ${#key}+${#value}+${#displayname}+5" # OKVS record length echo "!byte ${#key}" # OKVS key length echo "!text \"$key\"" # OKVS key diff --git a/bin/buildtitle.sh b/bin/buildtitle.sh deleted file mode 100755 index 549b4b51c..000000000 --- a/bin/buildtitle.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -games=$(cat "$1") - -# make temp file with just the key/value pairs (strip blank lines, comments, eof marker) -records=$(mktemp) -awk '!/^$|^#|^\[/' > "$records" - -# make temp assembly source file that represents the binary OKVS data structure -source=$(mktemp) -(echo "*=0" # dummy program counter for assembler - echo "!le16 $(wc -l <"$records"), 0" # OKVS header - while read -r filename; do - line=$(echo "$games" | awk '/,'"$filename"'=/') - needsjoystick=$(echo "$line" | cut -c1) # 'requires joystick' flag (0 or 1) - needs128k=$(echo "$line" | cut -c2) # 'requires 128K' flag (0 or 1) - echo "!byte ${#filename}+3" # OKVS record length - echo "!byte ${#filename}" # OKVS key length - echo "!text \"$filename\"" # OKVS key - [ -z "$line" ] && \ - echo "!byte 0" || \ - echo "!byte $((needsjoystick*128))+$((needs128k*64))" - done < "$records") > "$source" - -# assemble temp source file into binary OKVS data structure, then output that -out=$(mktemp) -acme -o "$out" "$source" -cat "$out" - -# clean up -rm "$out" -rm "$source" -rm "$records" diff --git a/bin/check-attract-mode.sh b/bin/check-attract-mode.sh index 6fb71f1e3..9d36ad228 100755 --- a/bin/check-attract-mode.sh +++ b/bin/check-attract-mode.sh @@ -7,22 +7,9 @@ fatal_error() { exit 1 } -check_title_slideshow() { +check_slideshow() { [ -f "$1" ] || - fatal_error "Can't find HGR title slideshow" "$1" - cat "$1" | - grep -v "^#" | - grep -v "^\[" | - grep -v "^$" | - while read ssline; do - [ -f "$2"/"$ssline" ] || - fatal_error "Can't find title screenshot" "$ssline" - done -} - -check_action_slideshow() { - [ -f "$1" ] || - fatal_error "Can't find HGR action slideshow" "$1" + fatal_error "Can't find slideshow" "$1" cat "$1" | grep -v "^#" | grep -v "^\[" | @@ -33,9 +20,9 @@ check_action_slideshow() { gamename=$filename fi [ -f "$2"/"$filename" ] || - fatal_error "Can't find action screenshot" "$filename" + fatal_error "Can't find screenshot" "$filename" grep "^$gamename$" /tmp/games >/dev/null || - fatal_error "Action screenshot links to non-existent game" "$gamename" + fatal_error "Screenshot links to non-existent game" "$gamename" done } @@ -83,17 +70,17 @@ cat res/ATTRACT.CONF | [ "${module_name%???}" = "SPCARTOON" ] || fatal_error "Can't find demo" $module_name elif [ "$module_type" = "1" ]; then - check_title_slideshow res/SS/"$module_name" res/TITLE.HGR/ + check_slideshow res/SS/"$module_name" res/TITLE.HGR/ elif [ "$module_type" = "2" ]; then - check_action_slideshow res/SS/"$module_name" res/ACTION.HGR/ + check_slideshow res/SS/"$module_name" res/ACTION.HGR/ elif [ "$module_type" = "3" ]; then - check_title_slideshow res/SS/"$module_name" res/TITLE.DHGR/ + check_slideshow res/SS/"$module_name" res/TITLE.DHGR/ elif [ "$module_type" = "4" ]; then - check_action_slideshow res/SS/"$module_name" res/ACTION.DHGR/ + check_slideshow res/SS/"$module_name" res/ACTION.DHGR/ elif [ "$module_type" = "5" ]; then - check_title_slideshow res/SS/"$module_name" res/ARTWORK.SHR/ + check_slideshow res/SS/"$module_name" res/ARTWORK.SHR/ elif [ "$module_type" = "6" ]; then - check_action_slideshow res/SS/"$module_name" res/ACTION.GR/ + check_slideshow res/SS/"$module_name" res/ACTION.GR/ else fatal_error "Unknown module type" $module_type fi diff --git a/bin/generate-mini-attract-mode.sh b/bin/generate-mini-attract-mode.sh index c13f150d5..440139855 100755 --- a/bin/generate-mini-attract-mode.sh +++ b/bin/generate-mini-attract-mode.sh @@ -12,8 +12,12 @@ cat res/GAMES.CONF | echo -e "#\n# Attract mode for $game\n# This file is automatically generated\n#\n" > /tmp/g # add box art, if any - [ -f res/ARTWORK.SHR/"$game" ] && - echo "$game=C" >> /tmp/g + cat res/SS/SHR*.CONF | + egrep "(^|=)""$game""$" | + cut -d"=" -f1 | + sed -e "s/$/=C/g" | + sort | + uniq >> /tmp/g # add DHGR action screenshots, if any cat res/SS/ACTDHGR*.CONF | diff --git a/res/ATTRACT/PP b/res/ATTRACT/PP index 29b168ebe..30bb6bbb3 100644 --- a/res/ATTRACT/PP +++ b/res/ATTRACT/PP @@ -3,6 +3,7 @@ # This file is automatically generated # +POP.END=C PP=C POPL01AGOTSWORD=A POPL01BCAREFUL=A diff --git a/res/SS/SHR27.CONF b/res/SS/SHR27.CONF index ee2232a4b..ff2304ce2 100644 --- a/res/SS/SHR27.CONF +++ b/res/SS/SHR27.CONF @@ -4,7 +4,7 @@ H.E.R.O AIRHEART -POP.END +POP.END=PP RENEGADE GREMLINS diff --git a/src/glue.launch.a b/src/glue.launch.a index 33fc83395..5df13a20a 100644 --- a/src/glue.launch.a +++ b/src/glue.launch.a @@ -7,7 +7,6 @@ ; - AnyGameSelected ; - GetGameToLaunch ; - FindGame -; - FindGameInActionSlideshow ; - PlayGame ; - Launch ; @@ -57,7 +56,7 @@ _gameToLaunchExit rts ;------------------------------------------------------------------------------ -; FindGameInActionSlideshow +; FindGame ; check if an arbitrary game exists, for some definition of 'exists', while ; in the middle of a slideshow ; @@ -69,7 +68,7 @@ _gameToLaunchExit ; clobbers $FF, PTR ; all registers clobbered ;------------------------------------------------------------------------------ -FindGameInActionSlideshow +FindGame +ST16 gLastMegaAttractGame jsr okvs_next_field ; (PTR) -> OKVS value (filename or empty string) ; Y=0 @@ -80,7 +79,6 @@ FindGameInActionSlideshow + jsr okvs_next_field_PTR_is_already_set ; (PTR) -> game display name +LD16 PTR ; A/Y -> game display name +ST16 SAVE ; (SAVE) -> game display name -FindGame jsr okvs_next_field ; (PTR) -> game requirements bitfield ; Y=0 diff --git a/src/index/artwork.idx.a b/src/index/artwork.idx.a index 07540f23e..6271e2ba7 100644 --- a/src/index/artwork.idx.a +++ b/src/index/artwork.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9908277 + !be24 9910404 !le16 4186 diff --git a/src/index/attract.idx.a b/src/index/attract.idx.a index b23d03eb1..60eb9a294 100644 --- a/src/index/attract.idx.a +++ b/src/index/attract.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9861719 + !be24 9863846 !le16 5174 diff --git a/src/index/cache00.idx.a b/src/index/cache00.idx.a index 458dda02b..aeb47b07f 100644 --- a/src/index/cache00.idx.a +++ b/src/index/cache00.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9805095 + !be24 9807222 !le16 3580 diff --git a/src/index/cache01.idx.a b/src/index/cache01.idx.a index 0b1d7b6c3..fc751be7a 100644 --- a/src/index/cache01.idx.a +++ b/src/index/cache01.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9817427 + !be24 9819554 !le16 3940 diff --git a/src/index/cache10.idx.a b/src/index/cache10.idx.a index 9e87fddd1..f606be487 100644 --- a/src/index/cache10.idx.a +++ b/src/index/cache10.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9832788 + !be24 9834915 !le16 4615 diff --git a/src/index/cache11.idx.a b/src/index/cache11.idx.a index b17a8e50e..630bce2f0 100644 --- a/src/index/cache11.idx.a +++ b/src/index/cache11.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9850025 + !be24 9852152 !le16 5562 diff --git a/src/index/coverfade.idx.a b/src/index/coverfade.idx.a index 9ae4871cc..1ecd30d1f 100644 --- a/src/index/coverfade.idx.a +++ b/src/index/coverfade.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9912463 + !be24 9914590 !le16 410 diff --git a/src/index/credits.idx.a b/src/index/credits.idx.a index f27d4fe70..9e6b894bb 100644 --- a/src/index/credits.idx.a +++ b/src/index/credits.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9913269 + !be24 9915396 !le16 448 diff --git a/src/index/decrunch.idx.a b/src/index/decrunch.idx.a index 74576531d..9fb87f895 100644 --- a/src/index/decrunch.idx.a +++ b/src/index/decrunch.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9913717 + !be24 9915844 !le16 303 diff --git a/src/index/dfx.idx.a b/src/index/dfx.idx.a index f3588dcb8..ebe44eee4 100644 --- a/src/index/dfx.idx.a +++ b/src/index/dfx.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9869039 + !be24 9871166 !le16 1242 diff --git a/src/index/dhgr.idx.a b/src/index/dhgr.idx.a index 8ff1c1805..b7967ce62 100644 --- a/src/index/dhgr.idx.a +++ b/src/index/dhgr.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9906962 + !be24 9909089 !le16 1249 diff --git a/src/index/dtitle.idx.a b/src/index/dtitle.idx.a index 31b666ffe..4f2be8d8a 100644 --- a/src/index/dtitle.idx.a +++ b/src/index/dtitle.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9893110 + !be24 9895237 !le16 464 diff --git a/src/index/fx.idx.a b/src/index/fx.idx.a index 3d9986f09..a047f386f 100644 --- a/src/index/fx.idx.a +++ b/src/index/fx.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9866893 + !be24 9869020 !le16 2146 diff --git a/src/index/gamehelp.idx.a b/src/index/gamehelp.idx.a index 2bc6ca1e2..76f330a2c 100644 --- a/src/index/gamehelp.idx.a +++ b/src/index/gamehelp.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9870281 + !be24 9872408 !le16 6132 diff --git a/src/index/gr.fizzle.idx.a b/src/index/gr.fizzle.idx.a index 94a2e6ba7..d78ef7c84 100644 --- a/src/index/gr.fizzle.idx.a +++ b/src/index/gr.fizzle.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9912961 + !be24 9915088 !le16 107 diff --git a/src/index/gr.idx.a b/src/index/gr.idx.a index 3095d9407..8ef725df9 100644 --- a/src/index/gr.idx.a +++ b/src/index/gr.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9908211 + !be24 9910338 !le16 66 diff --git a/src/index/helptext.idx.a b/src/index/helptext.idx.a index 3d5ad1fb9..210029954 100644 --- a/src/index/helptext.idx.a +++ b/src/index/helptext.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9913068 + !be24 9915195 !le16 201 diff --git a/src/index/hgr0.idx.a b/src/index/hgr0.idx.a index e189ba7e9..8eba15436 100644 --- a/src/index/hgr0.idx.a +++ b/src/index/hgr0.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9893574 + !be24 9895701 !le16 4364 diff --git a/src/index/hgr1.idx.a b/src/index/hgr1.idx.a index d6c2d0234..36109b725 100644 --- a/src/index/hgr1.idx.a +++ b/src/index/hgr1.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9897938 + !be24 9900065 !le16 1516 diff --git a/src/index/hgr2.idx.a b/src/index/hgr2.idx.a index f2f9746f2..5fcd6f619 100644 --- a/src/index/hgr2.idx.a +++ b/src/index/hgr2.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9899454 + !be24 9901581 !le16 1031 diff --git a/src/index/hgr3.idx.a b/src/index/hgr3.idx.a index ad2f787f6..646a023ae 100644 --- a/src/index/hgr3.idx.a +++ b/src/index/hgr3.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9900485 + !be24 9902612 !le16 3237 diff --git a/src/index/hgr4.idx.a b/src/index/hgr4.idx.a index cf46e1661..6f822f8ff 100644 --- a/src/index/hgr4.idx.a +++ b/src/index/hgr4.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9903722 + !be24 9905849 !le16 2694 diff --git a/src/index/hgr5.idx.a b/src/index/hgr5.idx.a index ebb208698..152d95fef 100644 --- a/src/index/hgr5.idx.a +++ b/src/index/hgr5.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9906416 + !be24 9908543 !le16 441 diff --git a/src/index/hgr6.idx.a b/src/index/hgr6.idx.a index 99151b1c7..a93c4cd3a 100644 --- a/src/index/hgr6.idx.a +++ b/src/index/hgr6.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9906857 + !be24 9908984 !le16 105 diff --git a/src/index/joystick.idx.a b/src/index/joystick.idx.a index ac7c57392..d94394557 100644 --- a/src/index/joystick.idx.a +++ b/src/index/joystick.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9914020 + !be24 9916147 !le16 2370 diff --git a/src/index/miniattract.idx.a b/src/index/miniattract.idx.a index 9ebb28053..3ac74ef2b 100644 --- a/src/index/miniattract.idx.a +++ b/src/index/miniattract.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9881249 + !be24 9883376 !le16 6132 diff --git a/src/index/prelaunch.idx.a b/src/index/prelaunch.idx.a index 37cb3a9ab..bc253ae89 100644 --- a/src/index/prelaunch.idx.a +++ b/src/index/prelaunch.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9855587 + !be24 9857714 !le16 6132 diff --git a/src/index/search00.idx.a b/src/index/search00.idx.a index 8e6f338cb..ebbe62916 100644 --- a/src/index/search00.idx.a +++ b/src/index/search00.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9797095 + !be24 9799222 !le16 8000 diff --git a/src/index/search01.idx.a b/src/index/search01.idx.a index 8aa70aee6..7b274084a 100644 --- a/src/index/search01.idx.a +++ b/src/index/search01.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9808675 + !be24 9810802 !le16 8752 diff --git a/src/index/search10.idx.a b/src/index/search10.idx.a index 17e09c905..af145ca32 100644 --- a/src/index/search10.idx.a +++ b/src/index/search10.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9821367 + !be24 9823494 !le16 11421 diff --git a/src/index/search11.idx.a b/src/index/search11.idx.a index 4b1db85c3..4d11b24ad 100644 --- a/src/index/search11.idx.a +++ b/src/index/search11.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9837403 + !be24 9839530 !le16 12622 diff --git a/src/index/shr.fizzle.idx.a b/src/index/shr.fizzle.idx.a index 19c333096..08baa9fd2 100644 --- a/src/index/shr.fizzle.idx.a +++ b/src/index/shr.fizzle.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9912873 + !be24 9915000 !le16 88 diff --git a/src/index/slideshow.idx.a b/src/index/slideshow.idx.a index 138fe920b..329611d82 100644 --- a/src/index/slideshow.idx.a +++ b/src/index/slideshow.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9876413 + !be24 9878540 !le16 4836 diff --git a/src/index/title.idx.a b/src/index/title.idx.a index 547e8257a..b5a362721 100644 --- a/src/index/title.idx.a +++ b/src/index/title.idx.a @@ -4,5 +4,5 @@ ; This file is automatically generated ; !byte 0 - !be24 9887381 + !be24 9889508 !le16 5729 diff --git a/src/ui.attract.dhgr.a b/src/ui.attract.dhgr.a index cd19de7b9..c7c3f2ba8 100644 --- a/src/ui.attract.dhgr.a +++ b/src/ui.attract.dhgr.a @@ -219,7 +219,7 @@ DHGRActionCallback +ST16 IndexedDHGRFilename - jsr FindGameInActionSlideshow + jsr FindGame ; if game name is not found (C will be set here), it means the game ; can't be played due to memory or joystick requirements, so we hide ; it from slideshows diff --git a/src/ui.attract.gr.a b/src/ui.attract.gr.a index bdc00d4d4..6dca4f6f8 100644 --- a/src/ui.attract.gr.a +++ b/src/ui.attract.gr.a @@ -90,7 +90,7 @@ GRActionCallback +ST16 IndexedGRFilename - jsr FindGameInActionSlideshow + jsr FindGame ; if game name is not found (C will be set here), it means the game ; can't be played due to memory or joystick requirements, so we hide ; it from slideshows diff --git a/src/ui.attract.hgr.a b/src/ui.attract.hgr.a index 32ac544c4..c9267164d 100644 --- a/src/ui.attract.hgr.a +++ b/src/ui.attract.hgr.a @@ -148,7 +148,7 @@ HGRActionCallback +ST16 IndexedHGRFilename - jsr FindGameInActionSlideshow + jsr FindGame ; if game name is not found (C will be set here), it means the game ; can't be played due to memory or joystick requirements, so we hide ; it from slideshows