Skip to content

Instantly share code, notes, and snippets.

@bjoern-r
Last active May 10, 2022 07:58
Show Gist options
  • Select an option

  • Save bjoern-r/47e9f972912fd5eec1321bda8e0cd1a0 to your computer and use it in GitHub Desktop.

Select an option

Save bjoern-r/47e9f972912fd5eec1321bda8e0cd1a0 to your computer and use it in GitHub Desktop.

Revisions

  1. bjoern-r revised this gist May 10, 2022. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions joeyl.sh
    Original file line number Diff line number Diff line change
    @@ -5,6 +5,8 @@
    for drive in sd{a,b,c,d,e,f}
    do
    rdisk=$drive
    ## Warning: this will spin up the disk!
    ## TODO: just check for USB and or Vendor ID
    if dd if=/dev/$rdisk bs=512 skip=0 count=1 status=none | grep -q BENNVENN ; then
    echo Joey Jr Found at /dev/$rdisk

  2. bjoern-r revised this gist Nov 23, 2021. 1 changed file with 1 addition and 4 deletions.
    5 changes: 1 addition & 4 deletions joeyl.sh
    Original file line number Diff line number Diff line change
    @@ -2,12 +2,9 @@

    #set -x

    for drive in sd{a,b,c}
    for drive in sd{a,b,c,d,e,f}
    do
    rdisk=$drive
    #dd if=/dev/$rdisk bs=512 skip=0 count=1 status=none > check.txt

    #if grep -q BENNVENN check.txt ; then
    if dd if=/dev/$rdisk bs=512 skip=0 count=1 status=none | grep -q BENNVENN ; then
    echo Joey Jr Found at /dev/$rdisk

  3. bjoern-r created this gist Nov 23, 2021.
    49 changes: 49 additions & 0 deletions joeyl.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,49 @@
    #!/bin/bash

    #set -x

    for drive in sd{a,b,c}
    do
    rdisk=$drive
    #dd if=/dev/$rdisk bs=512 skip=0 count=1 status=none > check.txt

    #if grep -q BENNVENN check.txt ; then
    if dd if=/dev/$rdisk bs=512 skip=0 count=1 status=none | grep -q BENNVENN ; then
    echo Joey Jr Found at /dev/$rdisk

    case $1 in
    ROM)
    echo Writing Rom... This may take minutes
    dd if=$2 of=/dev/$rdisk bs=512 seek=37
    ;;
    FLASH)
    echo Writing Flash Save...
    dd if=$2 of=/dev/$rdisk bs=512 seek=65573
    ;;
    SRAM)
    echo Writing SRAM...
    dd if=$2 of=/dev/$rdisk bs=512 seek=65829
    ;;
    EEPROM)
    echo Writing EEPROM...
    dd if=$2 of=/dev/$rdisk bs=512 seek=66085
    ;;
    ROMLIST)
    dd if=$2 of=/dev/$rdisk bs=512 seek=66341
    echo ROMLIST Update Complete
    ;;
    MODE)
    echo -n $2 | dd of=/dev/$rdisk bs=512 cbs=512 seek=66725 conv=sync
    echo Mode set to $2
    sleep 1
    if [ $2 = "UPDATE" ]
    then
    dd if=$3 of=/dev/$rdisk bs=512 seek=66469
    echo Update Complete
    break
    fi
    ;;
    esac
    break
    fi
    done