Skip to content

Instantly share code, notes, and snippets.

@squidrpi
Last active May 30, 2024 05:21
Show Gist options
  • Select an option

  • Save squidrpi/4ce3ea61cbbfa3900e116f9565d45e74 to your computer and use it in GitHub Desktop.

Select an option

Save squidrpi/4ce3ea61cbbfa3900e116f9565d45e74 to your computer and use it in GitHub Desktop.

Revisions

  1. squidrpi revised this gist Oct 25, 2023. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions update_jtcores
    Original file line number Diff line number Diff line change
    @@ -10,6 +10,11 @@ SRCDIR=$BASEDIR/git/jtbin
    ZIPDIR=$BASEDIR/mame
    MRABIN=./mra

    if [[ ! -f $MRABIN ]]; then
    echo "mra executable required"
    exit 1
    fi

    FLAGFILE=update_jtcores.flag
    if [[ ! -f $FLAGFILE ]]; then
    touch -t 197201010000 $FLAGFILE
  2. squidrpi revised this gist Oct 25, 2023. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion update_jtcores
    Original file line number Diff line number Diff line change
    @@ -65,6 +65,11 @@ do
    # continue
    #fi

    # Need qsound for audio
    if [[ ! -f "${ZIPDIR}/qsound.zip" ]]; then
    (cd "$ZIPDIR"; wget -nc -nv https://archive.org/download/mame-merged/mame-merged/qsound.zip)
    fi

    #echo $ZIPFILE
    basename "$MRAFILE" .mra
    if [[ ! -f "${ZIPDIR}/${ZIPFILE}" ]]; then
    @@ -85,7 +90,8 @@ do
    echo "RBF $RBF is missing for MRA `basename "${MRAFILE}"`, probably BETA"
    else
    RBFBASE=$(basename "$RBFFILE" | sed 's/_[0-9]\+.rbf//')
    cp -pvu "$SRCDIR/mist/${RBF}.rbf" $DESTDIR/${RBF}.rbf
    rsync -ut "$SRCDIR/mist/${RBF}.rbf" $DESTDIR/${RBF}.rbf
    echo ${RBF}.rbf
    fi

    done
  3. squidrpi revised this gist May 5, 2023. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions linux_sync
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,9 @@
    #!/bin/bash
    # Pass directory to sync to SD card as parameter 1
    # Mounts & syncs any directory in current directory
    # to an SD card that is named the same as the directory.
    # Also sets special file settings on the SD card so that
    # MIST displays them correctly.

    if [ $USER != root ]; then
    echo "Must be run as root!"
    @@ -30,9 +35,6 @@ rsync -uvtr --modify-window=1 --delete --exclude='*.ini' --exclude='*.CFG' --ex
    --exclude='.DS_Store' \
    $VOLUME/ /mnt/MIST

    #Remove BETA arc files as no RBF exists


    #Hide RBFs
    if [ "$VOLUME" = "Arcade" ]; then
    cd /mnt/MIST
  4. squidrpi revised this gist May 5, 2023. 1 changed file with 12 additions and 7 deletions.
    19 changes: 12 additions & 7 deletions update_jtcores
    Original file line number Diff line number Diff line change
    @@ -40,8 +40,8 @@ do

    # Exclude what I'm not interested in
    [[ $MRAFILE == *_alternatives* ]] && continue
    [[ $MRAFILE == *Tokio* ]] && continue
    [[ $MRAFILE == *Trojan* ]] && continue
    #[[ $MRAFILE == *Tokio* ]] && continue
    #[[ $MRAFILE == *Trojan* ]] && continue

    RBF=$($MRABIN -l "$MRAFILE" | grep 'rbf name:' | sed 's/rbf name: //')

    @@ -54,20 +54,27 @@ do
    mkdir -p $DESTDIR

    # Check ROM exists
    # Get First ROM section only
    #ZIPFILE=`$MRABIN -l "$MRAFILE" | sed -n '/rom\[0\]/,/^$/p' | grep 'zip\[0\]' | awk '{print $2}'`
    # Get First ROM section only, some MRAs reference two possible ROM options
    ZIPFILE=""
    ZIPFILE2=""
    ZIPFILE=`$MRABIN -l "$MRAFILE" | grep 'zip\[0\]' | head -1 | awk '{print $2}'`
    ZIPFILE2=`$MRABIN -l "$MRAFILE" | grep 'zip\[1\]' | head -1 | awk '{print $2}'`

    # Skip roms not interested in
    #if [[ $ZIPFILE = "qtono2j.zip" ]]; then
    # continue
    #fi

    echo $ZIPFILE
    #echo $ZIPFILE
    basename "$MRAFILE" .mra
    if [[ ! -f "${ZIPDIR}/${ZIPFILE}" ]]; then
    echo Downloading ROM $ZIPFILE
    (cd "$ZIPDIR"; wget -nc -nv https://archive.org/download/mame-merged/mame-merged/${ZIPFILE})
    fi
    if [[ -n "$ZIPFILE2" && ! -f "${ZIPDIR}/${ZIPFILE2}" ]]; then
    echo Downloading ROM $ZIPFILE2
    (cd "$ZIPDIR"; wget -nc -nv https://archive.org/download/mame-merged/mame-merged/${ZIPFILE2})
    fi

    $MRABIN -A -O $DESTDIR/ -z "$ZIPDIR" "$MRAFILE" | grep -v 'expected: None'

    @@ -119,7 +126,5 @@ do
    cp -p $SRCDIR/$RBF "$FILE"
    fi
    done



    touch $FLAGFILE
  5. squidrpi revised this gist May 3, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion update_jtcores
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    # Updates and gets jt cores
    # Retrieves new game ROMS if needed from archive.org
    # Don't forget to set the SYSTEM attribute for any subdirectories
    # on the SD card. Needs to be done in Windows "attrib +s JT-SYSTEM16"
    # on the SD card - Linux "fatattr" or Windows "attrib +s JT-SYSTEM16".

    BASEDIR=_temp
    SRCDIR=$BASEDIR/git/jtbin
  6. squidrpi revised this gist May 2, 2023. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions linux_sync
    Original file line number Diff line number Diff line change
    @@ -38,16 +38,18 @@ if [ "$VOLUME" = "Arcade" ]; then
    cd /mnt/MIST
    fatattr +h JT-*/jt*.rbf
    #Make directories visible
    fatattr +s JT-CPS* JT-SYSTEM16 JT-OTHER
    fatattr +s JT-CPS* JT-SYSTEM16 JT-OTHER Gehstock/IremM72 Gehstock/IremM92 Gehstock/Williams Gehstock/Sega-System-1 Gehstock/Midway-MCR

    cd Gehstock
    fatattr +h Scramble.rbf Galaxian.rbf
    fatattr +h DKong.rbf GBeret.rbf
    fatattr +h Druaga.rbf
    fatattr +h Williams/Robotron.rbf Williams/Defender.rbf
    fatattr +h Williams/*.rbf
    fatattr +h Sega-System-1/Segasys1.rbf
    fatattr +h Midway-MCR/mcr*.rbf
    fatattr +h Jailbrek.rbf
    fatattr +h IremM72/*.rbf
    fatattr +h IremM92/*.rbf

    #Remove 64MB games from CPS2
    cd /mnt/MIST/JT-CPS2/
  7. squidrpi revised this gist May 2, 2023. 1 changed file with 15 additions and 2 deletions.
    17 changes: 15 additions & 2 deletions update_jtcores
    Original file line number Diff line number Diff line change
    @@ -66,8 +66,7 @@ do
    echo $ZIPFILE
    if [[ ! -f "${ZIPDIR}/${ZIPFILE}" ]]; then
    echo Downloading ROM $ZIPFILE
    (cd "$ZIPDIR"; wget -nc -nv https://archive.org/download/MAME223RomsOnlyMerged/${ZIPFILE})
    #(cd "$ZIPDIR"; wget -nc -nv -O $ZIPFILE https://archive.org/download/mame0.220romssplit.7z/MAME%200.220%20ROMs%20%28split%29.7z/0.220%20ROMs%20%28split%29%2F${ZIPFILE})
    (cd "$ZIPDIR"; wget -nc -nv https://archive.org/download/mame-merged/mame-merged/${ZIPFILE})
    fi

    $MRABIN -A -O $DESTDIR/ -z "$ZIPDIR" "$MRAFILE" | grep -v 'expected: None'
    @@ -109,4 +108,18 @@ do
    fi
    done

    #Check for any updated RBFs with no updated MRA
    find Arcade/JT* -name '*.rbf' -print0 |
    while IFS= read -r -d '' FILE
    do
    RBF=`basename "$FILE"`

    if [[ $SRCDIR/$RBF -nt "$FILE" ]]; then
    echo Updated $RBF
    cp -p $SRCDIR/$RBF "$FILE"
    fi
    done



    touch $FLAGFILE
  8. squidrpi revised this gist May 2, 2023. 1 changed file with 0 additions and 34 deletions.
    34 changes: 0 additions & 34 deletions rsynctosd
    Original file line number Diff line number Diff line change
    @@ -1,34 +0,0 @@
    #!/bin/bash

    # copy from $1 parameter which is the subdirectory from here
    # $2 is the Volume to copy to.

    if [ -z "$1" ]; then
    echo "Usage: rsynctosd Arcade /Volumes/ARCADE"
    exit 1
    fi

    rsync -uvtr --modify-window=1 --delete --exclude='*.ini' --exclude='*.CFG' --exclude='*.RAM' --exclude='*.sav' \
    --exclude='QXL.WIN' \
    --exclude='.Trashes' --exclude='.fseventsd' --exclude='.Spotlight-V100' --exclude='System Volume Information' \
    --exclude='.DS_Store' \
    $1/ $2

    #Hide RBFs
    if [ -d /Volumes/ARCADE ]; then
    cd /Volumes/ARCADE/
    chflags hidden JT-CPS[012]*/jt*.rbf JT-OTHER/jtdd2.rbf JT-OTHER/jtcomsc.rbf JT-SYSTEM16/jt*rbf
    cd Gehstock
    chflags hidden Scramble.rbf Galaxian.rbf
    chflags hidden DKong.rbf GBeret.rbf
    chflags hidden Druaga.rbf
    chflags hidden Williams/Robotron.rbf Williams/Defender.rbf
    chflags hidden Sega-System-1/Segasys1.rbf
    chflags hidden Midway-MCR/mcr*.rbf

    #Remove 64MB games from CPS2
    cd /Volumes/ARCADE/JT-CPS2/
    rm -f 'Dungeons & Dragons_ Shadow over Mystara (Euro 960619).arc' "Night Warriors_ Darkstalkers' Revenge (Euro 950316).arc" 'Street Fighter Alpha 3 (Euro 980904).arc' 'X-Men_ Children of the Atom (Euro 950331).arc' 'Cyberbots_ Fullmetal Madness (Euro 950424).arc' 'X-Men Vs. Street Fighter (Euro 961004).arc' 'X-Men_ Children of the Atom (Euro 950331).arc' 'Vampire Hunter 2_ Darkstalkers Revenge (Japan 970929).arc' ' Vampire Savior 2_ The Lord of Vampire (Japan 970913).arc' 'Vampire Savior_ The Lord of Vampire (Euro 970519).arc' 'Street Fighter Alpha 2 (Euro 960229).arc' "Street Fighter Zero 2 Alpha (Japan 960805).arc" "Hyper Street Fighter II_ The Anniversary Edition (USA 040202).arc" "Mars Matrix_ Hyper Solid Shooting (USA 000412).arc" "Marvel Super Heroes (Euro 951024).arc" "Marvel Super Heroes Vs. Street Fighter (Euro 970625).arc" "Marvel Vs. Capcom_ Clash of Super Heroes (Euro 980123).arc" "Vampire Savior 2_ The Lord of Vampire (Japan 970913).arc"


    fi
  9. squidrpi revised this gist Jun 23, 2022. 2 changed files with 87 additions and 34 deletions.
    61 changes: 61 additions & 0 deletions linux_sync
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,61 @@
    #!/bin/bash

    if [ $USER != root ]; then
    echo "Must be run as root!"
    exit 1
    fi

    # copy from $1 parameter which is the subdirectory from here
    # $2 is the Volume to copy to.

    if [ -z "$1" ]; then
    echo "Usage: linux_sync Arcade"
    exit 1
    fi

    VOLUME=${1%/}

    mkdir -p /mnt/MIST
    #mount /dev/disk/by-uuid/3E42-111B /mnt/MIST
    mount -L ${VOLUME@U} /mnt/MIST
    if [ ! -f /mnt/MIST/mist.ini ]; then
    echo ERROR Not Mounted!!!
    exit 1
    fi

    rsync -uvtr --modify-window=1 --delete --exclude='*.ini' --exclude='*.CFG' --exclude='*.RAM' --exclude='*.sav' \
    --exclude='QXL.WIN' \
    --exclude='Next186.vhd' \
    --exclude='.Trashes' --exclude='.fseventsd' --exclude='.Spotlight-V100' --exclude='System Volume Information' \
    --exclude='.DS_Store' \
    $VOLUME/ /mnt/MIST

    #Remove BETA arc files as no RBF exists


    #Hide RBFs
    if [ "$VOLUME" = "Arcade" ]; then
    cd /mnt/MIST
    fatattr +h JT-*/jt*.rbf
    #Make directories visible
    fatattr +s JT-CPS* JT-SYSTEM16 JT-OTHER

    cd Gehstock
    fatattr +h Scramble.rbf Galaxian.rbf
    fatattr +h DKong.rbf GBeret.rbf
    fatattr +h Druaga.rbf
    fatattr +h Williams/Robotron.rbf Williams/Defender.rbf
    fatattr +h Sega-System-1/Segasys1.rbf
    fatattr +h Midway-MCR/mcr*.rbf
    fatattr +h Jailbrek.rbf

    #Remove 64MB games from CPS2
    cd /mnt/MIST/JT-CPS2/
    rm -f 'Dungeons & Dragons_ Shadow over Mystara (Euro 960619).arc' "Night Warriors_ Darkstalkers' Revenge (Euro 950316).arc" 'Street Fighter Alpha 3 (Euro 980904).arc' 'X-Men_ Children of the Atom (Euro 950331).arc' 'Cyberbots_ Fullmetal Madness (Euro 950424).arc' 'X-Men Vs. Street Fighter (Euro 961004).arc' 'X-Men_ Children of the Atom (Euro 950331).arc' 'Vampire Hunter 2_ Darkstalkers Revenge (Japan 970929).arc' ' Vampire Savior 2_ The Lord of Vampire (Japan 970913).arc' 'Vampire Savior_ The Lord of Vampire (Euro 970519).arc' 'Street Fighter Alpha 2 (Euro 960229).arc' "Street Fighter Zero 2 Alpha (Japan 960805).arc" "Hyper Street Fighter II_ The Anniversary Edition (USA 040202).arc" "Mars Matrix_ Hyper Solid Shooting (USA 000412).arc" "Marvel Super Heroes (Euro 951024).arc" "Marvel Super Heroes Vs. Street Fighter (Euro 970625).arc" "Marvel Vs. Capcom_ Clash of Super Heroes (Euro 980123).arc" "Vampire Savior 2_ The Lord of Vampire (Japan 970913).arc"

    cd /tmp

    fi

    sleep 5s
    umount /mnt/MIST
    60 changes: 26 additions & 34 deletions update_jtcores
    Original file line number Diff line number Diff line change
    @@ -43,12 +43,14 @@ do
    [[ $MRAFILE == *Tokio* ]] && continue
    [[ $MRAFILE == *Trojan* ]] && continue

    RBF=$($MRABIN -l "$MRAFILE" | grep 'rbf name:' | sed 's/rbf name: //')

    DESTDIR=Arcade/JT-OTHER
    [[ $MRAFILE == *CPS0/* ]] && DESTDIR=Arcade/JT-CPS0
    [[ $MRAFILE == *CPS1/* ]] && DESTDIR=Arcade/JT-CPS1
    [[ $MRAFILE == *CPS15/* ]] && DESTDIR=Arcade/JT-CPS15
    [[ $MRAFILE == *CPS2/* ]] && DESTDIR=Arcade/JT-CPS2
    [[ $MRAFILE == *s16/* ]] && DESTDIR=Arcade/JT-SYSTEM16
    [[ $RBF == *CPS0/* ]] && DESTDIR=Arcade/JT-CPS0
    [[ $RBF == jtcps1 ]] && DESTDIR=Arcade/JT-CPS1
    [[ $RBF == jtcps15 ]] && DESTDIR=Arcade/JT-CPS15
    [[ $RBF == jtcps2 ]] && DESTDIR=Arcade/JT-CPS2
    [[ $RBF == jts16* ]] && DESTDIR=Arcade/JT-SYSTEM16
    mkdir -p $DESTDIR

    # Check ROM exists
    @@ -70,51 +72,41 @@ do

    $MRABIN -A -O $DESTDIR/ -z "$ZIPDIR" "$MRAFILE" | grep -v 'expected: None'

    #Copy over the related RBF
    RBF=$($MRABIN -l "$MRAFILE" | grep 'rbf name:' | sed 's/rbf name: //')

    # Fix wrong named RBFs
    RBF=$(echo $RBF | sed 's/jtcommando/jtcom/')
    RBF=$(echo $RBF | sed 's/jtgunsmoke/jtgun/')
    RBF=$(echo $RBF | sed 's/jtsectionz/jtsz/')
    RBF=$(echo $RBF | sed 's/jtf1dream/jtf1drm/')
    #RBF=$(echo $RBF | sed 's/jtcommando/jtcom/')

    if [[ ! -f $SRCDIR/mist/${RBF}.rbf ]]; then
    echo "RBF $RBF is missing for MRA `basename "${MRAFILE}"`, probably BETA"
    else
    RBFBASE=$(basename "$RBFFILE" | sed 's/_[0-9]\+.rbf//')
    # cp -pvu "$RBFFILE" $DESTDIR/${RBFBASE}.rbf
    cp -pvu "$SRCDIR/mist/${RBF}.rbf" $DESTDIR/${RBF}.rbf
    fi

    done

    #Check for updated RBF cores
    #Check for beta RBF cores becoming release, i.e. they would be missed
    SRCDIR=$SRCDIR/mist

    find Arcade -name '*.rbf' -print0 |
    find $SRCDIR -name '*.rbf' -print0 |
    while IFS= read -r -d '' FILE
    do

    DST="$FILE"
    DSTBASE=`basename "$FILE"`
    # DSTBASE="${DSTBASE/.rbf/}"
    # SRC=""

    # SRC=$(find "$SRCDIR" -name "${DSTBASE}_*rbf" -newer "$FILE" -print0 | xargs -0 -r ls -t | head -1)
    SRC=$SRCDIR/$DSTBASE

    if [[ -z $SRC || -z $DST ]]; then
    continue
    fi

    if [[ $SRC -nt $DST ]]; then
    cp -p "$SRC" "$DST"
    echo cp -p "$SRC" "$DST"
    echo Update CORE $DST
    echo
    RBF=`basename "$FILE"`
    DST="Arcade/$FILE"

    SRC=$SRCDIR/$DSTFILE

    if [[ ! $(find Arcade/JT* -name $RBF | grep .) ]]; then
    # Found missing rbf so find out where it belongs
    DESTDIR=Arcade/JT-OTHER
    [[ $RBF == *CPS0/* ]] && DESTDIR=Arcade/JT-CPS0
    [[ $RBF == jtcps1 ]] && DESTDIR=Arcade/JT-CPS1
    [[ $RBF == jtcps15 ]] && DESTDIR=Arcade/JT-CPS15
    [[ $RBF == jtcps2 ]] && DESTDIR=Arcade/JT-CPS2
    [[ $RBF == jts16* ]] && DESTDIR=Arcade/JT-SYSTEM16

    cp -pv $FILE $DESTDIR/

    fi

    done

    touch $FLAGFILE
  10. squidrpi revised this gist Jul 16, 2021. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions update_cores
    Original file line number Diff line number Diff line change
    @@ -107,6 +107,7 @@ do
    [[ $DIR = "spectrum" ]] && cp -pvu ${SRCDIR}/${DIR}/spectrum.rom ${DIR}/
    [[ $DIR = "ti994a" ]] && cp -pvu ${SRCDIR}/${DIR}/TI994A.ROM ${DIR}/
    [[ $DIR = "vic20" ]] && cp -pvu ${SRCDIR}/${DIR}/vic20.rom ${DIR}/
    [[ $DIR = "next186" ]] && cp -pvu ${SRCDIR}/${DIR}/Next186.ROM ${DIR}/

    #Move ZXN to spectrum
    [[ $DIR = "zxn" ]] && cp -pvu zxn/core.rbf spectrum/
  11. squidrpi revised this gist Jul 15, 2021. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion rsynctosd
    Original file line number Diff line number Diff line change
    @@ -9,6 +9,7 @@ if [ -z "$1" ]; then
    fi

    rsync -uvtr --modify-window=1 --delete --exclude='*.ini' --exclude='*.CFG' --exclude='*.RAM' --exclude='*.sav' \
    --exclude='QXL.WIN' \
    --exclude='.Trashes' --exclude='.fseventsd' --exclude='.Spotlight-V100' --exclude='System Volume Information' \
    --exclude='.DS_Store' \
    $1/ $2
    @@ -27,7 +28,7 @@ if [ -d /Volumes/ARCADE ]; then

    #Remove 64MB games from CPS2
    cd /Volumes/ARCADE/JT-CPS2/
    rm -f 'Dungeons & Dragons_ Shadow over Mystara (Euro 960619).arc' "Night Warriors_ Darkstalkers' Revenge (Euro 950316).arc" 'Street Fighter Alpha 3 (Euro 980904).arc' 'X-Men_ Children of the Atom (Euro 950331).arc' 'Cyberbots_ Fullmetal Madness (Euro 950424).arc' 'X-Men Vs. Street Fighter (Euro 961004).arc' 'X-Men_ Children of the Atom (Euro 950331).arc' 'Vampire Hunter 2_ Darkstalkers Revenge (Japan 970929).arc' ' Vampire Savior 2_ The Lord of Vampire (Japan 970913).arc' 'Vampire Savior_ The Lord of Vampire (Euro 970519).arc' 'Street Fighter Alpha 2 (Euro 960229).arc' "Street Fighter Zero 2 Alpha (Japan 960805).arc"
    rm -f 'Dungeons & Dragons_ Shadow over Mystara (Euro 960619).arc' "Night Warriors_ Darkstalkers' Revenge (Euro 950316).arc" 'Street Fighter Alpha 3 (Euro 980904).arc' 'X-Men_ Children of the Atom (Euro 950331).arc' 'Cyberbots_ Fullmetal Madness (Euro 950424).arc' 'X-Men Vs. Street Fighter (Euro 961004).arc' 'X-Men_ Children of the Atom (Euro 950331).arc' 'Vampire Hunter 2_ Darkstalkers Revenge (Japan 970929).arc' ' Vampire Savior 2_ The Lord of Vampire (Japan 970913).arc' 'Vampire Savior_ The Lord of Vampire (Euro 970519).arc' 'Street Fighter Alpha 2 (Euro 960229).arc' "Street Fighter Zero 2 Alpha (Japan 960805).arc" "Hyper Street Fighter II_ The Anniversary Edition (USA 040202).arc" "Mars Matrix_ Hyper Solid Shooting (USA 000412).arc" "Marvel Super Heroes (Euro 951024).arc" "Marvel Super Heroes Vs. Street Fighter (Euro 970625).arc" "Marvel Vs. Capcom_ Clash of Super Heroes (Euro 980123).arc" "Vampire Savior 2_ The Lord of Vampire (Japan 970913).arc"


    fi
  12. squidrpi revised this gist Jul 15, 2021. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions update_jtcores
    Original file line number Diff line number Diff line change
    @@ -34,7 +34,7 @@ echo

    #Process MRA files first
    #Get new MRAs and updated ones since the last run
    find $SRCDIR/mra -type f -name '*.mra' -newer $FLAGFILE -print0 |
    find $SRCDIR/mra -type f -name '*.mra' -newer $FLAGFILE -print0 |
    while IFS= read -r -d '' MRAFILE
    do

    @@ -53,7 +53,8 @@ do

    # Check ROM exists
    # Get First ROM section only
    ZIPFILE=`$MRABIN -l "$MRAFILE" | sed -n '/rom\[0\]/,/^$/p' | grep 'zip\[0\]' | awk '{print $2}'`
    #ZIPFILE=`$MRABIN -l "$MRAFILE" | sed -n '/rom\[0\]/,/^$/p' | grep 'zip\[0\]' | awk '{print $2}'`
    ZIPFILE=`$MRABIN -l "$MRAFILE" | grep 'zip\[0\]' | head -1 | awk '{print $2}'`

    # Skip roms not interested in
    #if [[ $ZIPFILE = "qtono2j.zip" ]]; then
    @@ -105,7 +106,7 @@ do

    if [[ -z $SRC || -z $DST ]]; then
    continue
    fi
    fi

    if [[ $SRC -nt $DST ]]; then
    cp -p "$SRC" "$DST"
  13. squidrpi revised this gist Jul 10, 2021. 1 changed file with 18 additions and 8 deletions.
    26 changes: 18 additions & 8 deletions update_jtcores
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,8 @@

    # Updates and gets jt cores
    # Retrieves new game ROMS if needed from archive.org
    # Don't forget to set the SYSTEM attribute for any subdirectories
    # on the SD card. Needs to be done in Windows "attrib +s JT-SYSTEM16"

    BASEDIR=_temp
    SRCDIR=$BASEDIR/git/jtbin
    @@ -32,7 +34,7 @@ echo

    #Process MRA files first
    #Get new MRAs and updated ones since the last run
    find $SRCDIR/mra -type f -name '*.mra' -newer $FLAGFILE -print0 |
    find $SRCDIR/mra -type f -name '*.mra' -newer $FLAGFILE -print0 |
    while IFS= read -r -d '' MRAFILE
    do

    @@ -69,12 +71,19 @@ do

    #Copy over the related RBF
    RBF=$($MRABIN -l "$MRAFILE" | grep 'rbf name:' | sed 's/rbf name: //')
    RBFFILE=$(find $SRCDIR/mist/ -name "${RBF}_*.rbf" -type f -exec stat -c $'%Y\t%n' {} + | sort -nr | cut -f2- | head -1)
    if [[ -z $RBFFILE ]]; then

    # Fix wrong named RBFs
    RBF=$(echo $RBF | sed 's/jtcommando/jtcom/')
    RBF=$(echo $RBF | sed 's/jtgunsmoke/jtgun/')
    RBF=$(echo $RBF | sed 's/jtsectionz/jtsz/')
    RBF=$(echo $RBF | sed 's/jtf1dream/jtf1drm/')

    if [[ ! -f $SRCDIR/mist/${RBF}.rbf ]]; then
    echo "RBF $RBF is missing for MRA `basename "${MRAFILE}"`, probably BETA"
    else
    RBFBASE=$(basename "$RBFFILE" | sed 's/_[0-9]\+.rbf//')
    cp -pvu "$RBFFILE" $DESTDIR/${RBFBASE}.rbf
    # cp -pvu "$RBFFILE" $DESTDIR/${RBFBASE}.rbf
    cp -pvu "$SRCDIR/mist/${RBF}.rbf" $DESTDIR/${RBF}.rbf
    fi

    done
    @@ -88,14 +97,15 @@ do

    DST="$FILE"
    DSTBASE=`basename "$FILE"`
    DSTBASE="${DSTBASE/.rbf/}"
    SRC=""
    # DSTBASE="${DSTBASE/.rbf/}"
    # SRC=""

    SRC=$(find "$SRCDIR" -name "${DSTBASE}_*rbf" -newer "$FILE" -print0 | xargs -0 -r ls -t | head -1)
    # SRC=$(find "$SRCDIR" -name "${DSTBASE}_*rbf" -newer "$FILE" -print0 | xargs -0 -r ls -t | head -1)
    SRC=$SRCDIR/$DSTBASE

    if [[ -z $SRC || -z $DST ]]; then
    continue
    fi
    fi

    if [[ $SRC -nt $DST ]]; then
    cp -p "$SRC" "$DST"
  14. squidrpi revised this gist Jun 11, 2021. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion rsynctosd
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    #!/bin/bash

    # copy from $1 parameter which is the subdirectory from here
    # $2 is the Volume to copy to.

    @@ -14,7 +16,7 @@ rsync -uvtr --modify-window=1 --delete --exclude='*.ini' --exclude='*.CFG' --ex
    #Hide RBFs
    if [ -d /Volumes/ARCADE ]; then
    cd /Volumes/ARCADE/
    chflags hidden JT-CPS[012]*/jt*.rbf JT-OTHER/jtdd2.rbf JT-OTHER/jtcomsc.rbf
    chflags hidden JT-CPS[012]*/jt*.rbf JT-OTHER/jtdd2.rbf JT-OTHER/jtcomsc.rbf JT-SYSTEM16/jt*rbf
    cd Gehstock
    chflags hidden Scramble.rbf Galaxian.rbf
    chflags hidden DKong.rbf GBeret.rbf
  15. squidrpi revised this gist Jun 11, 2021. 1 changed file with 26 additions and 14 deletions.
    40 changes: 26 additions & 14 deletions update_jtcores
    Original file line number Diff line number Diff line change
    @@ -23,27 +23,35 @@ if [[ ! -d $SRCDIR ]]; then
    (cd $SRCDIR; git ls-files | sed "s/'/\\\'/g" | xargs -I{} bash -c 'touch "{}" --date=@$(git log -n1 --pretty=format:%ct -- "{}")')
    fi

    echo $SRCDIR

    # Update the cores and mra from jtbin
    (cd $SRCDIR; git pull)

    echo

    #Process MRA files first
    #Get new MRAs and updated ones since the last run
    find $SRCDIR/mra -type f -name '*.mra' -newer $FLAGFILE -print0 |
    while IFS= read -r -d '' FILE
    find $SRCDIR/mra -type f -name '*.mra' -newer $FLAGFILE -print0 |
    while IFS= read -r -d '' MRAFILE
    do

    MRAFILE="$FILE"

    # Exclude what I'm not interested in
    [[ $FILE == *_alternatives* ]] && continue
    [[ $FILE == *Tokio* ]] && continue
    [[ $FILE == *'Hyper Fighting'* ]] && continue
    [[ $FILE == *Trojan* ]] && continue
    [[ $MRAFILE == *_alternatives* ]] && continue
    [[ $MRAFILE == *Tokio* ]] && continue
    [[ $MRAFILE == *Trojan* ]] && continue

    DESTDIR=Arcade/JT-OTHER
    [[ $MRAFILE == *CPS0/* ]] && DESTDIR=Arcade/JT-CPS0
    [[ $MRAFILE == *CPS1/* ]] && DESTDIR=Arcade/JT-CPS1
    [[ $MRAFILE == *CPS15/* ]] && DESTDIR=Arcade/JT-CPS15
    [[ $MRAFILE == *CPS2/* ]] && DESTDIR=Arcade/JT-CPS2
    [[ $MRAFILE == *s16/* ]] && DESTDIR=Arcade/JT-SYSTEM16
    mkdir -p $DESTDIR

    # Check ROM exists
    ZIPFILE=`$MRABIN -l "$MRAFILE" | grep 'zip\[0\]' | awk '{print $2}'`
    # Get First ROM section only
    ZIPFILE=`$MRABIN -l "$MRAFILE" | sed -n '/rom\[0\]/,/^$/p' | grep 'zip\[0\]' | awk '{print $2}'`

    # Skip roms not interested in
    #if [[ $ZIPFILE = "qtono2j.zip" ]]; then
    @@ -54,16 +62,20 @@ do
    if [[ ! -f "${ZIPDIR}/${ZIPFILE}" ]]; then
    echo Downloading ROM $ZIPFILE
    (cd "$ZIPDIR"; wget -nc -nv https://archive.org/download/MAME223RomsOnlyMerged/${ZIPFILE})
    #(cd "$ZIPDIR"; wget -nc -nv -O $ZIPFILE https://archive.org/download/mame0.220romssplit.7z/MAME%200.220%20ROMs%20%28split%29.7z/0.220%20ROMs%20%28split%29%2F${ZIPFILE})
    fi

    $MRABIN -A -O Arcade/ -z "$ZIPDIR" "$MRAFILE" | grep -v 'expected: None'
    $MRABIN -A -O $DESTDIR/ -z "$ZIPDIR" "$MRAFILE" | grep -v 'expected: None'

    #Copy over the related RBF
    RBF=$($MRABIN -l "$MRAFILE" | grep 'rbf name:' | sed 's/rbf name: //')
    RBFFILE=$(find $SRCDIR/mist/ -name "${RBF}_*.rbf" -type f -exec stat -c $'%Y\t%n' {} + | sort -nr | cut -f2- | head -1)

    RBFBASE=$(basename "$RBFFILE" | sed 's/_[0-9]\+.rbf//')
    cp -pvu "$RBFFILE" Arcade/${RBFBASE}.rbf
    if [[ -z $RBFFILE ]]; then
    echo "RBF $RBF is missing for MRA `basename "${MRAFILE}"`, probably BETA"
    else
    RBFBASE=$(basename "$RBFFILE" | sed 's/_[0-9]\+.rbf//')
    cp -pvu "$RBFFILE" $DESTDIR/${RBFBASE}.rbf
    fi

    done

    @@ -83,7 +95,7 @@ do

    if [[ -z $SRC || -z $DST ]]; then
    continue
    fi
    fi

    if [[ $SRC -nt $DST ]]; then
    cp -p "$SRC" "$DST"
  16. squidrpi revised this gist Jun 4, 2021. 1 changed file with 31 additions and 0 deletions.
    31 changes: 31 additions & 0 deletions rsynctosd
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    # copy from $1 parameter which is the subdirectory from here
    # $2 is the Volume to copy to.

    if [ -z "$1" ]; then
    echo "Usage: rsynctosd Arcade /Volumes/ARCADE"
    exit 1
    fi

    rsync -uvtr --modify-window=1 --delete --exclude='*.ini' --exclude='*.CFG' --exclude='*.RAM' --exclude='*.sav' \
    --exclude='.Trashes' --exclude='.fseventsd' --exclude='.Spotlight-V100' --exclude='System Volume Information' \
    --exclude='.DS_Store' \
    $1/ $2

    #Hide RBFs
    if [ -d /Volumes/ARCADE ]; then
    cd /Volumes/ARCADE/
    chflags hidden JT-CPS[012]*/jt*.rbf JT-OTHER/jtdd2.rbf JT-OTHER/jtcomsc.rbf
    cd Gehstock
    chflags hidden Scramble.rbf Galaxian.rbf
    chflags hidden DKong.rbf GBeret.rbf
    chflags hidden Druaga.rbf
    chflags hidden Williams/Robotron.rbf Williams/Defender.rbf
    chflags hidden Sega-System-1/Segasys1.rbf
    chflags hidden Midway-MCR/mcr*.rbf

    #Remove 64MB games from CPS2
    cd /Volumes/ARCADE/JT-CPS2/
    rm -f 'Dungeons & Dragons_ Shadow over Mystara (Euro 960619).arc' "Night Warriors_ Darkstalkers' Revenge (Euro 950316).arc" 'Street Fighter Alpha 3 (Euro 980904).arc' 'X-Men_ Children of the Atom (Euro 950331).arc' 'Cyberbots_ Fullmetal Madness (Euro 950424).arc' 'X-Men Vs. Street Fighter (Euro 961004).arc' 'X-Men_ Children of the Atom (Euro 950331).arc' 'Vampire Hunter 2_ Darkstalkers Revenge (Japan 970929).arc' ' Vampire Savior 2_ The Lord of Vampire (Japan 970913).arc' 'Vampire Savior_ The Lord of Vampire (Euro 970519).arc' 'Street Fighter Alpha 2 (Euro 960229).arc' "Street Fighter Zero 2 Alpha (Japan 960805).arc"


    fi
  17. squidrpi revised this gist Mar 31, 2021. 1 changed file with 21 additions and 3 deletions.
    24 changes: 21 additions & 3 deletions update_cores
    Original file line number Diff line number Diff line change
    @@ -24,6 +24,8 @@ if [[ ! -d $SRCDIR ]]; then
    (cd $SRCDIR; git ls-files | sed "s/'/\\\'/g" | xargs -I{} bash -c 'touch "{}" --date=@$(git log -n1 --pretty=format:%ct -- "{}")')
    fi

    echo $SRCDIR

    # Update the cores from github
    (cd $SRCDIR; git pull)

    @@ -48,12 +50,25 @@ do
    DIR=${FILE:2}

    DST="${DIR}/core.rbf"
    if [[ $DIR = "spectrum" ]];then
    DST="${DIR}/zxspectrum.rbf"
    fi

    SRC=`ls -Lt ${SRCDIR}/$DIR/*.rbf 2>/dev/null | head -1`

    # Mistica currently has core specific SNES
    if [[ $DIR = "snes" && ! -z "$MISTICA" ]]; then
    SRC=`ls -Lt ${SRCDIR}/$DIR/*mistica*.rbf 2>/dev/null | head -1`
    else
    SRC=`ls -Lt ${SRCDIR}/$DIR/*.rbf 2>/dev/null | head -1`
    SRC=`ls -Lt ${SRCDIR}/$DIR/snes_mist_*.rbf 2>/dev/null | head -1`
    if [[ ! -z "$MISTICA" ]]; then
    SRC=`ls -Lt ${SRCDIR}/$DIR/snes_mistica*.rbf 2>/dev/null | head -1`
    fi
    fi

    if [[ $DIR = "plus_too" ]]; then
    SRC=`ls -Lt ${SRCDIR}/$DIR/plusToo_*.rbf 2>/dev/null | head -1`
    fi
    if [[ $DIR = "zxn" ]]; then
    SRC=`ls -Lt ${SRCDIR}/$DIR/ZXN_*.rbf 2>/dev/null | head -1`
    fi

    if [[ -z $SRC || -z $DST ]]; then
    @@ -93,4 +108,7 @@ do
    [[ $DIR = "ti994a" ]] && cp -pvu ${SRCDIR}/${DIR}/TI994A.ROM ${DIR}/
    [[ $DIR = "vic20" ]] && cp -pvu ${SRCDIR}/${DIR}/vic20.rom ${DIR}/

    #Move ZXN to spectrum
    [[ $DIR = "zxn" ]] && cp -pvu zxn/core.rbf spectrum/

    done
  18. squidrpi revised this gist Feb 17, 2021. 1 changed file with 14 additions and 6 deletions.
    20 changes: 14 additions & 6 deletions update_cores
    Original file line number Diff line number Diff line change
    @@ -5,6 +5,9 @@
    # The directories MUST match the ones in the mist-binaries/cores so just create
    # the directories of the cores you want.

    #Define this if using Mistica for specific cores
    #MISTICA=Y

    LOGFILE=update_cores.log

    date >$LOGFILE
    @@ -33,24 +36,29 @@ if [[ ! -f $DST ]]; then
    echo ==================
    echo FIRMWARE UPDATED!!! $DST | tee -a $LOGFILE
    echo ==================
    echo
    echo
    fi

    echo

    #Check all the cores in git with current matching directories
    #Check all the cores in git with current matching directories
    for FILE in `find . -maxdepth 1 -type d | egrep -v '_temp'`
    do

    DIR=${FILE:2}

    DST="${DIR}/core.rbf"

    SRC=`ls -Lt ${SRCDIR}/$DIR/*.rbf 2>/dev/null | head -1`
    # Mistica currently has core specific SNES
    if [[ $DIR = "snes" && ! -z "$MISTICA" ]]; then
    SRC=`ls -Lt ${SRCDIR}/$DIR/*mistica*.rbf 2>/dev/null | head -1`
    else
    SRC=`ls -Lt ${SRCDIR}/$DIR/*.rbf 2>/dev/null | head -1`
    fi

    if [[ -z $SRC || -z $DST ]]; then
    continue
    fi
    fi

    if [[ -f $SRC && ! -f $DST ]]; then
    cp -p "$SRC" "$DST"
    @@ -64,7 +72,7 @@ do
    #Check checksum
    MD5SRC=`md5sum "$SRC" | awk '{print $1}'`
    MD5DST=`md5sum "$DST" | awk '{print $1}'`

    if [[ $MD5SRC != $MD5DST ]]; then
    cp -p "$SRC" "$DST"
    echo Update CORE $DST | tee -a $LOGFILE
    @@ -77,7 +85,7 @@ do
    [[ $DIR = "atari800" ]] && cp -pvu ${SRCDIR}/${DIR}/*.ROM ${DIR}/
    [[ $DIR = "bbc" ]] && cp -pvu ${SRCDIR}/${DIR}/bbc.rom ${DIR}/
    [[ $DIR = "c16" ]] && cp -pvu ${SRCDIR}/${DIR}/c16.rom ${DIR}/
    [[ $DIR = "fpga64" ]] && cp -pvu ${SRCDIR}/${DIR}/*.rom ${SRCDIR}/${DIR}/C64GS.ARC ${DIR}/
    [[ $DIR = "fpga64" ]] && cp -pvu ${SRCDIR}/${DIR}/*.rom ${SRCDIR}/${DIR}/C64GS.ARC ${DIR}/
    [[ $DIR = "ht1080z" ]] && cp -pvu ${SRCDIR}/${DIR}/HT1080Z.ROM ${DIR}/
    [[ $DIR = "ql" ]] && cp -pvu ${SRCDIR}/${DIR}/ql.rom ${DIR}/
    [[ $DIR = "samcoupe" ]] && cp -pvu ${SRCDIR}/${DIR}/samcoupe.rom ${DIR}/
  19. squidrpi revised this gist Feb 8, 2021. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions update_cores
    Original file line number Diff line number Diff line change
    @@ -80,6 +80,7 @@ do
    [[ $DIR = "fpga64" ]] && cp -pvu ${SRCDIR}/${DIR}/*.rom ${SRCDIR}/${DIR}/C64GS.ARC ${DIR}/
    [[ $DIR = "ht1080z" ]] && cp -pvu ${SRCDIR}/${DIR}/HT1080Z.ROM ${DIR}/
    [[ $DIR = "ql" ]] && cp -pvu ${SRCDIR}/${DIR}/ql.rom ${DIR}/
    [[ $DIR = "samcoupe" ]] && cp -pvu ${SRCDIR}/${DIR}/samcoupe.rom ${DIR}/
    [[ $DIR = "spectrum" ]] && cp -pvu ${SRCDIR}/${DIR}/spectrum.rom ${DIR}/
    [[ $DIR = "ti994a" ]] && cp -pvu ${SRCDIR}/${DIR}/TI994A.ROM ${DIR}/
    [[ $DIR = "vic20" ]] && cp -pvu ${SRCDIR}/${DIR}/vic20.rom ${DIR}/
  20. squidrpi revised this gist Feb 5, 2021. 3 changed files with 54 additions and 46 deletions.
    53 changes: 26 additions & 27 deletions update_cores
    Original file line number Diff line number Diff line change
    @@ -13,9 +13,8 @@ echo >>$LOGFILE
    BASEDIR=_temp
    SRCDIR=${BASEDIR}/git/mist-binaries/cores


    # clone git repo if it doesn't exist
    if [ ! -d "$SRCDIR" ]; then
    if [[ ! -d $SRCDIR ]]; then
    mkdir -p ${BASEDIR}/git
    (cd ${BASEDIR}/git; git clone https://github.com/mist-devel/mist-binaries.git)
    #Set timestamps on git files to match repository commit dates
    @@ -29,14 +28,16 @@ fi
    SRC=`ls -Lt "${SRCDIR}"/../firmware/*.upg 2>/dev/null | head -1`
    DST=_firmware/`basename "$SRC"`
    mkdir -p _firmware
    if [ ! -f "$DST" ]; then
    if [[ ! -f $DST ]]; then
    cp -p "$SRC" "$DST"
    echo ==================
    echo FIRMWARE UPDATED!!! $DST | tee -a $LOGFILE
    echo ==================
    echo
    fi

    echo

    #Check all the cores in git with current matching directories
    for FILE in `find . -maxdepth 1 -type d | egrep -v '_temp'`
    do
    @@ -47,42 +48,40 @@ do

    SRC=`ls -Lt ${SRCDIR}/$DIR/*.rbf 2>/dev/null | head -1`

    if [ -z "$SRC" -o -z "$DST" ]; then
    if [[ -z $SRC || -z $DST ]]; then
    continue
    fi

    if [ -f "$SRC" -a ! -f "$DST" ]; then
    if [[ -f $SRC && ! -f $DST ]]; then
    cp -p "$SRC" "$DST"
    echo Update CORE $DST | tee -a $LOGFILE
    continue
    fi

    if [ $SRC -nt $DST ]; then
    cp -p "$SRC" "$DST"
    echo Update CORE $DST | tee -a $LOGFILE
    echo
    else
    #Check checksum
    MD5SRC=`md5sum "$SRC" | awk '{print $1}'`
    MD5DST=`md5sum "$DST" | awk '{print $1}'`

    if [ $MD5SRC != $MD5DST ]; then
    if [[ $SRC -nt $DST ]]; then
    cp -p "$SRC" "$DST"
    echo Update CORE $DST | tee -a $LOGFILE
    echo
    else
    #Check checksum
    MD5SRC=`md5sum "$SRC" | awk '{print $1}'`
    MD5DST=`md5sum "$DST" | awk '{print $1}'`

    if [[ $MD5SRC != $MD5DST ]]; then
    cp -p "$SRC" "$DST"
    echo Update CORE $DST | tee -a $LOGFILE
    echo
    fi
    fi

    fi

    #Copy special ROMS
    [[ $DIR = "atari800" ]] && cp -u ${SRCDIR}/$DIR/*.ROM atari800/
    [[ $DIR = "bbc" ]] && cp -u ${SRCDIR}/$DIR/bbc.rom bbc/
    [[ $DIR = "c16" ]] && cp -u ${SRCDIR}/$DIR/c16.rom c16/
    [[ $DIR = "fpga64" ]] && cp -u ${SRCDIR}/$DIR/*.rom ${SRCDIR}/$DIR/C64GS.ARC fpga64/
    [[ $DIR = "ht1080z" ]] && cp -u ${SRCDIR}/$DIR/HT1080Z.ROM ht1080z/
    [[ $DIR = "ql" ]] && cp -u ${SRCDIR}/$DIR/ql.rom ql/
    [[ $DIR = "spectrum" ]] && cp -u ${SRCDIR}/$DIR/spectrum.rom spectrum/
    [[ $DIR = "ti994a" ]] && cp -u ${SRCDIR}/$DIR/TI994A.ROM ti994a/
    [[ $DIR = "vic20" ]] && cp -u ${SRCDIR}/$DIR/vic20.rom vic20/
    [[ $DIR = "atari800" ]] && cp -pvu ${SRCDIR}/${DIR}/*.ROM ${DIR}/
    [[ $DIR = "bbc" ]] && cp -pvu ${SRCDIR}/${DIR}/bbc.rom ${DIR}/
    [[ $DIR = "c16" ]] && cp -pvu ${SRCDIR}/${DIR}/c16.rom ${DIR}/
    [[ $DIR = "fpga64" ]] && cp -pvu ${SRCDIR}/${DIR}/*.rom ${SRCDIR}/${DIR}/C64GS.ARC ${DIR}/
    [[ $DIR = "ht1080z" ]] && cp -pvu ${SRCDIR}/${DIR}/HT1080Z.ROM ${DIR}/
    [[ $DIR = "ql" ]] && cp -pvu ${SRCDIR}/${DIR}/ql.rom ${DIR}/
    [[ $DIR = "spectrum" ]] && cp -pvu ${SRCDIR}/${DIR}/spectrum.rom ${DIR}/
    [[ $DIR = "ti994a" ]] && cp -pvu ${SRCDIR}/${DIR}/TI994A.ROM ${DIR}/
    [[ $DIR = "vic20" ]] && cp -pvu ${SRCDIR}/${DIR}/vic20.rom ${DIR}/

    done
    11 changes: 6 additions & 5 deletions update_gehstock
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,7 @@

    # Only updates the cores that we have in the Arcade directory
    # updated from Gehstock github directory.
    # Doesn't add newly added cores from from github, add these manually.
    # Names also need to match the Gehstock name

    LOGFILE=update_gehstock.log
    @@ -12,7 +13,7 @@ BASEDIR=_temp
    SRCDIR=$BASEDIR/git/Mist_FPGA_Cores/Arcade_MiST

    # clone git repo if it doesn't exist
    if [ ! -d "$SRCDIR" ]; then
    if [[ ! -d $SRCDIR ]]; then
    mkdir -p $BASEDIR/git
    (cd ${BASEDIR}/git; git clone https://github.com/Gehstock/Mist_FPGA_Cores.git)
    #Set timestamps on git files to match repository commit dates
    @@ -30,11 +31,11 @@ do

    SRC=`find "$SRCDIR" -name $DSTBASE`

    if [ -z "$SRC" -o -z "$DST" ]; then
    if [[ -z $SRC || -z $DST ]]; then
    continue
    fi

    if [ "$SRC" -nt "$DST" ]; then
    if [[ $SRC -nt $DST ]]; then
    cp -p "$SRC" "$DST"
    echo Update CORE $DST | tee -a $LOGFILE
    echo
    @@ -43,12 +44,12 @@ do
    MD5SRC=`md5sum "$SRC" | awk '{print $1}'`
    MD5DST=`md5sum "$DST" | awk '{print $1}'`

    if [ $MD5SRC != $MD5DST ]; then
    if [[ $MD5SRC != $MD5DST ]]; then
    cp -p "$SRC" "$DST"
    echo Update CORE $DST | tee -a $LOGFILE
    echo
    fi

    fi

    done
    done
    36 changes: 22 additions & 14 deletions update_jtcores
    Original file line number Diff line number Diff line change
    @@ -9,14 +9,14 @@ ZIPDIR=$BASEDIR/mame
    MRABIN=./mra

    FLAGFILE=update_jtcores.flag
    if [ ! -f $FLAGFILE ]; then
    if [[ ! -f $FLAGFILE ]]; then
    touch -t 197201010000 $FLAGFILE
    fi

    mkdir -p $ZIPDIR

    # clone git repo if it doesn't exist
    if [ ! -d "$SRCDIR" ]; then
    if [[ ! -d $SRCDIR ]]; then
    mkdir -p $BASEDIR/git
    (cd $BASEDIR/git; git clone https://github.com/jotego/jtbin.git)
    #Set timestamps on git files to match repository commit dates
    @@ -29,37 +29,45 @@ fi
    echo

    #Process MRA files first
    #Get new MRAs and updated ones since the last run
    find $SRCDIR/mra -type f -name '*.mra' -newer $FLAGFILE -print0 |
    while IFS= read -r -d '' FILE
    do

    MRAFILE="$FILE"

    # Exclude what I'm not interested in
    [[ "$FILE" == *_alternatives* ]] && continue
    [[ "$FILE" == *Tokio* ]] && continue
    [[ "$FILE" == *'Hyper Fighting'* ]] && continue
    [[ "$FILE" == *Trojan* ]] && continue
    [[ $FILE == *_alternatives* ]] && continue
    [[ $FILE == *Tokio* ]] && continue
    [[ $FILE == *'Hyper Fighting'* ]] && continue
    [[ $FILE == *Trojan* ]] && continue

    # Check ROM exists
    # Check ROM exists
    ZIPFILE=`$MRABIN -l "$MRAFILE" | grep 'zip\[0\]' | awk '{print $2}'`

    # Skip roms not interested in
    if [ $ZIPFILE = "qtono2j.zip" ]; then
    continue
    fi
    #if [[ $ZIPFILE = "qtono2j.zip" ]]; then
    # continue
    #fi

    echo $ZIPFILE
    if [ ! -f "${ZIPDIR}/${ZIPFILE}" ]; then
    if [[ ! -f "${ZIPDIR}/${ZIPFILE}" ]]; then
    echo Downloading ROM $ZIPFILE
    (cd "$ZIPDIR"; wget -nc -nv https://archive.org/download/MAME223RomsOnlyMerged/${ZIPFILE})
    fi

    $MRABIN -A -O Arcade/ -z "$ZIPDIR" "$MRAFILE" | grep -v 'expected: None'

    #Copy over the related RBF
    RBF=$($MRABIN -l "$MRAFILE" | grep 'rbf name:' | sed 's/rbf name: //')
    RBFFILE=$(find $SRCDIR/mist/ -name "${RBF}_*.rbf" -type f -exec stat -c $'%Y\t%n' {} + | sort -nr | cut -f2- | head -1)

    RBFBASE=$(basename "$RBFFILE" | sed 's/_[0-9]\+.rbf//')
    cp -pvu "$RBFFILE" Arcade/${RBFBASE}.rbf

    done

    #Check for new RBF cores
    #Check for updated RBF cores
    SRCDIR=$SRCDIR/mist

    find Arcade -name '*.rbf' -print0 |
    @@ -73,11 +81,11 @@ do

    SRC=$(find "$SRCDIR" -name "${DSTBASE}_*rbf" -newer "$FILE" -print0 | xargs -0 -r ls -t | head -1)

    if [ -z "$SRC" -o -z "$DST" ]; then
    if [[ -z $SRC || -z $DST ]]; then
    continue
    fi

    if [ "$SRC" -nt "$DST" ]; then
    if [[ $SRC -nt $DST ]]; then
    cp -p "$SRC" "$DST"
    echo cp -p "$SRC" "$DST"
    echo Update CORE $DST
  21. squidrpi revised this gist Feb 4, 2021. 1 changed file with 11 additions and 0 deletions.
    11 changes: 11 additions & 0 deletions update_cores
    Original file line number Diff line number Diff line change
    @@ -74,4 +74,15 @@ do

    fi

    #Copy special ROMS
    [[ $DIR = "atari800" ]] && cp -u ${SRCDIR}/$DIR/*.ROM atari800/
    [[ $DIR = "bbc" ]] && cp -u ${SRCDIR}/$DIR/bbc.rom bbc/
    [[ $DIR = "c16" ]] && cp -u ${SRCDIR}/$DIR/c16.rom c16/
    [[ $DIR = "fpga64" ]] && cp -u ${SRCDIR}/$DIR/*.rom ${SRCDIR}/$DIR/C64GS.ARC fpga64/
    [[ $DIR = "ht1080z" ]] && cp -u ${SRCDIR}/$DIR/HT1080Z.ROM ht1080z/
    [[ $DIR = "ql" ]] && cp -u ${SRCDIR}/$DIR/ql.rom ql/
    [[ $DIR = "spectrum" ]] && cp -u ${SRCDIR}/$DIR/spectrum.rom spectrum/
    [[ $DIR = "ti994a" ]] && cp -u ${SRCDIR}/$DIR/TI994A.ROM ti994a/
    [[ $DIR = "vic20" ]] && cp -u ${SRCDIR}/$DIR/vic20.rom vic20/

    done
  22. squidrpi revised this gist Feb 4, 2021. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions update_cores
    Original file line number Diff line number Diff line change
    @@ -32,10 +32,9 @@ mkdir -p _firmware
    if [ ! -f "$DST" ]; then
    cp -p "$SRC" "$DST"
    echo ==================
    echo FIRMWARE UPDATED!!! `basename $SRC`
    echo FIRMWARE UPDATED!!! $DST | tee -a $LOGFILE
    echo ==================
    echo
    echo FIRMWARE UPDATED!!! `basename $SRC` >>$LOGFILE
    fi

    #Check all the cores in git with current matching directories
  23. squidrpi revised this gist Feb 4, 2021. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion update_jtcores
    Original file line number Diff line number Diff line change
    @@ -13,6 +13,8 @@ if [ ! -f $FLAGFILE ]; then
    touch -t 197201010000 $FLAGFILE
    fi

    mkdir -p $ZIPDIR

    # clone git repo if it doesn't exist
    if [ ! -d "$SRCDIR" ]; then
    mkdir -p $BASEDIR/git
    @@ -84,4 +86,4 @@ do

    done

    touch $FLAGFILE
    touch $FLAGFILE
  24. squidrpi created this gist Feb 4, 2021.
    78 changes: 78 additions & 0 deletions update_cores
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,78 @@
    #!/bin/bash

    # Gets the latest cores and checks all the directories
    # in the current for any changes to the cores.
    # The directories MUST match the ones in the mist-binaries/cores so just create
    # the directories of the cores you want.

    LOGFILE=update_cores.log

    date >$LOGFILE
    echo >>$LOGFILE

    BASEDIR=_temp
    SRCDIR=${BASEDIR}/git/mist-binaries/cores


    # clone git repo if it doesn't exist
    if [ ! -d "$SRCDIR" ]; then
    mkdir -p ${BASEDIR}/git
    (cd ${BASEDIR}/git; git clone https://github.com/mist-devel/mist-binaries.git)
    #Set timestamps on git files to match repository commit dates
    (cd $SRCDIR; git ls-files | sed "s/'/\\\'/g" | xargs -I{} bash -c 'touch "{}" --date=@$(git log -n1 --pretty=format:%ct -- "{}")')
    fi

    # Update the cores from github
    (cd $SRCDIR; git pull)

    #Check for firmware updates
    SRC=`ls -Lt "${SRCDIR}"/../firmware/*.upg 2>/dev/null | head -1`
    DST=_firmware/`basename "$SRC"`
    mkdir -p _firmware
    if [ ! -f "$DST" ]; then
    cp -p "$SRC" "$DST"
    echo ==================
    echo FIRMWARE UPDATED!!! `basename $SRC`
    echo ==================
    echo
    echo FIRMWARE UPDATED!!! `basename $SRC` >>$LOGFILE
    fi

    #Check all the cores in git with current matching directories
    for FILE in `find . -maxdepth 1 -type d | egrep -v '_temp'`
    do

    DIR=${FILE:2}

    DST="${DIR}/core.rbf"

    SRC=`ls -Lt ${SRCDIR}/$DIR/*.rbf 2>/dev/null | head -1`

    if [ -z "$SRC" -o -z "$DST" ]; then
    continue
    fi

    if [ -f "$SRC" -a ! -f "$DST" ]; then
    cp -p "$SRC" "$DST"
    echo Update CORE $DST | tee -a $LOGFILE
    continue
    fi

    if [ $SRC -nt $DST ]; then
    cp -p "$SRC" "$DST"
    echo Update CORE $DST | tee -a $LOGFILE
    echo
    else
    #Check checksum
    MD5SRC=`md5sum "$SRC" | awk '{print $1}'`
    MD5DST=`md5sum "$DST" | awk '{print $1}'`

    if [ $MD5SRC != $MD5DST ]; then
    cp -p "$SRC" "$DST"
    echo Update CORE $DST | tee -a $LOGFILE
    echo
    fi

    fi

    done
    54 changes: 54 additions & 0 deletions update_gehstock
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,54 @@
    #!/bin/bash

    # Only updates the cores that we have in the Arcade directory
    # updated from Gehstock github directory.
    # Names also need to match the Gehstock name

    LOGFILE=update_gehstock.log
    date >$LOGFILE
    echo >$LOGFILE

    BASEDIR=_temp
    SRCDIR=$BASEDIR/git/Mist_FPGA_Cores/Arcade_MiST

    # clone git repo if it doesn't exist
    if [ ! -d "$SRCDIR" ]; then
    mkdir -p $BASEDIR/git
    (cd ${BASEDIR}/git; git clone https://github.com/Gehstock/Mist_FPGA_Cores.git)
    #Set timestamps on git files to match repository commit dates
    (cd $SRCDIR; git ls-files | sed "s/'/\\\'/g" | xargs -I{} bash -c 'touch "{}" --date=@$(git log -n1 --pretty=format:%ct -- "{}")')
    fi

    # Update the cores from github
    (cd $SRCDIR/..; git pull)

    for FILE in `find Arcade -name '*.rbf'`
    do

    DST="$FILE"
    DSTBASE=`basename "$FILE"`

    SRC=`find "$SRCDIR" -name $DSTBASE`

    if [ -z "$SRC" -o -z "$DST" ]; then
    continue
    fi

    if [ "$SRC" -nt "$DST" ]; then
    cp -p "$SRC" "$DST"
    echo Update CORE $DST | tee -a $LOGFILE
    echo
    else
    #Check checksum
    MD5SRC=`md5sum "$SRC" | awk '{print $1}'`
    MD5DST=`md5sum "$DST" | awk '{print $1}'`

    if [ $MD5SRC != $MD5DST ]; then
    cp -p "$SRC" "$DST"
    echo Update CORE $DST | tee -a $LOGFILE
    echo
    fi

    fi

    done
    87 changes: 87 additions & 0 deletions update_jtcores
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,87 @@
    #!/bin/bash

    # Updates and gets jt cores
    # Retrieves new game ROMS if needed from archive.org

    BASEDIR=_temp
    SRCDIR=$BASEDIR/git/jtbin
    ZIPDIR=$BASEDIR/mame
    MRABIN=./mra

    FLAGFILE=update_jtcores.flag
    if [ ! -f $FLAGFILE ]; then
    touch -t 197201010000 $FLAGFILE
    fi

    # clone git repo if it doesn't exist
    if [ ! -d "$SRCDIR" ]; then
    mkdir -p $BASEDIR/git
    (cd $BASEDIR/git; git clone https://github.com/jotego/jtbin.git)
    #Set timestamps on git files to match repository commit dates
    (cd $SRCDIR; git ls-files | sed "s/'/\\\'/g" | xargs -I{} bash -c 'touch "{}" --date=@$(git log -n1 --pretty=format:%ct -- "{}")')
    fi

    # Update the cores and mra from jtbin
    (cd $SRCDIR; git pull)

    echo

    #Process MRA files first
    find $SRCDIR/mra -type f -name '*.mra' -newer $FLAGFILE -print0 |
    while IFS= read -r -d '' FILE
    do

    MRAFILE="$FILE"

    # Exclude what I'm not interested in
    [[ "$FILE" == *_alternatives* ]] && continue
    [[ "$FILE" == *Tokio* ]] && continue
    [[ "$FILE" == *'Hyper Fighting'* ]] && continue
    [[ "$FILE" == *Trojan* ]] && continue

    # Check ROM exists
    ZIPFILE=`$MRABIN -l "$MRAFILE" | grep 'zip\[0\]' | awk '{print $2}'`

    # Skip roms not interested in
    if [ $ZIPFILE = "qtono2j.zip" ]; then
    continue
    fi

    echo $ZIPFILE
    if [ ! -f "${ZIPDIR}/${ZIPFILE}" ]; then
    echo Downloading ROM $ZIPFILE
    (cd "$ZIPDIR"; wget -nc -nv https://archive.org/download/MAME223RomsOnlyMerged/${ZIPFILE})
    fi

    $MRABIN -A -O Arcade/ -z "$ZIPDIR" "$MRAFILE" | grep -v 'expected: None'

    done

    #Check for new RBF cores
    SRCDIR=$SRCDIR/mist

    find Arcade -name '*.rbf' -print0 |
    while IFS= read -r -d '' FILE
    do

    DST="$FILE"
    DSTBASE=`basename "$FILE"`
    DSTBASE="${DSTBASE/.rbf/}"
    SRC=""

    SRC=$(find "$SRCDIR" -name "${DSTBASE}_*rbf" -newer "$FILE" -print0 | xargs -0 -r ls -t | head -1)

    if [ -z "$SRC" -o -z "$DST" ]; then
    continue
    fi

    if [ "$SRC" -nt "$DST" ]; then
    cp -p "$SRC" "$DST"
    echo cp -p "$SRC" "$DST"
    echo Update CORE $DST
    echo
    fi

    done

    touch $FLAGFILE