#!/usr/bin/env bash # Format: NeXT 3.5in DSED 2.88MB # gw diskdef: ibm.2880 # External tools: ditool # https://github.com/itomato/Previous # Only ditool is needed (make ditool) # Get project name name="$1" # Include parent script if [[ -f "./gw-raw" ]] then parent="./gw-raw" else parent="$(which gw-raw)" fi source "$parent" "$name" "source" # Output file names img="$name.img" # Overloaded function from gw-raw # Converts Kryoflux raw files to IMG using gw built in format function decode # 1-Nothing { echo "Decoding for NeXT 2.88MB" gw convert --format ibm.2880 "$raw" "$img" 2>&1 | tee -a $log_decode if [[ "$(which hxcfe)" == "" ]] then echo "Put hxcfe in your path to enable disk flux map images" return 1 fi if [[ -f "$name".png ]] then echo "Image exists" return 0 fi cd "$(dirname "$(which hxcfe)")" hxcfe -script:"$hxc" -finput:"$project_dir/$img" -foutput:"$project_dir/$name.bmp" -conv:BMP_DISK_IMAGE cd "$project_dir" convert "$name".bmp "$name".png rm "$name".bmp } # Overloaded function from gw-raw # Extracts files from FAT12 filesystem using mtools function extract { # Get list of files ditool -im "$img" -ls 2>&1 | tee -a $log_extract # Create destination mkdir -p "$name-files" # Extract recursively ditool -im "$img" -out "$name-files" 2>&1 | tee -a $log_extract } # Overloaded function from gw-raw # Creates an image of the sector map using HxC Floppy tools function map { # Deleted because we are moving this logic into the decode step return 0 } # Create dir based on name and rip within it mkdir -p "$name" cd "$name" rip A cd ..