[Blindapple] Mess apple2ee emulator bash script

Kyle kyle at gmx.ca
Sat Nov 9 13:26:08 EST 2013


I'm attaching the Bash script that I use to make the apple2ee emulator
easier to use on Linux systems. At the moment, it doesn't like spaces in
image names, even though I've tried all kinds of escaping and quoting. I
hope to eventually have that fixed. It does, however, take 1 to 2 disk
image names, optionally proceeded by -s and a state character on the
command line. Also, it looks for an executable called sdlmess, whereas
some distros may simply call it mess. That should be rather trivial to
fix, and it won't matter once I get around to building a mess executable
that just runs whether or not a package is available from the package
repositories.

At this point the script can be run as

~/apple disks/talkinggame.dsk

or

~/apple talkingdisk.dsk games/nontalkinggame.dsk

or it can do something like

~/apple BEXBOOT.dsk

Get the starting menu running and then save the state using delete,
shift f7, 1, escape. Then run

~/apple -s 1 BEXMAIN.dsk data.dsk

All these examples assume that the "apple" script is running from the
home directory. It could happily run from any location at this point,
and doesn't need to reside in the same directory as either the mess
executable or the disk images. Have fun.
~Kyle
http://kyle.tk/
-- 
"Kyle? ... She calls her cake, Kyle?"
Out of This World, season 2 episode 21 - "The Amazing Evie"
-------------- next part --------------
#!/bin/sh
# Apple //e Launcher
# Written by Kyle
# This little piece of code is dedicated to the public domain.
# Kyle waives any copyright associated with this shell code.
#
# This humble little script will load either 1 or 2 disks into an emulated Apple//e.
# Requires the Mess emulator, usually packaged as sdlmess.
# tested on Linux with Kyle's modified Apple emulator configuration files.
# Floppy disk images can be run from any directory.
# This script allows relative paths to be specified, which seems not to work in the Linux version of Mess.

# Allow starting from a saved state with -s option
if [ "$1" = "-s" ]; then
  state=$2
  shift;shift
fi
# set the floppy disks to be inserted
flop1="$1"
flop2="$2"
# Start building the command line
command="$(which sdlmess) " || (echo You need sdlmess installed to boot this apple.; exit 1)
command="${command}apple2ee "
if [ -n "$flop1" ]; then
  command="${command}-flop1 $(readlink -f "$flop1")"
  if [ ! -e "$flop1" ]; then
    if [ -n "$state" ]; then
      echo Creating $flop1 and inserting it into drive 1...
    sleep 2
    else
      echo "Your boot disk doesn't exist. Please try booting with a valid disk."
      exit 2
    fi
  fi
else
  echo Please insert a boot disk in drive 1 and try booting your Apple again.
  exit 2
fi
if [ -n "$flop2" ]; then
  command="${command} -flop2 $(readlink -f "$flop2")"
    if [ ! -e "$flop2" ]; then
    echo Creating $flop2 and inserting it into drive 2...
    sleep 2
  fi
fi
if [ -n "$state" ]; then
  command="${command} -state $state"
fi
exec $command
exit 0


More information about the BlindApple mailing list