#!/bin/sh #mmc-lmc - Launch the Little Man Computer MMC targeting with a sh wrapper under POSIX systems. #Copyright 2020 by Prince Trippy . #This program is free software: you can redistribute it and/or modify it under the terms of the #GNU Affero General Public License version 3 as published by the Free Software Foundation. #This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without #even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #See the GNU Affero General Public License for more details. #You should have received a copy of the GNU Affero General Public Licensealong with this program. #If not, see . set -e; t=$(stty -g); trap 'stty "$t" > /dev/null' EXIT; stty raw -echo; q=""; c=""; g="" f=$(echo "$0" | sed "s/\/mmc-lmc$//"); s="$f/shut-it-down.lisp"; e="$f/cl-ecma-48.lisp"; atc="$f/acute-terminal-control.lisp"; mmc="$f/mmc-lmc.lisp"; d="$f/d.lisp" #g="(pushnew :delete *features*)" printf '\x1B[?9;1006;1007h\x1B]0;Meta-Machine Code targeted at Little Man Computer\x1B\\' if [ "qwerty" = "$1" ]; then q="(pushnew :qwerty *features*)"; fi if [ "qwerty" = "$2" ]; then q="(pushnew :qwerty *features*)"; fi if [ "colorless" = "$1" ]; then c="(pushnew :no-color *features*)"; fi if [ "colorless" = "$2" ]; then c="(pushnew :no-color *features*)"; fi if [ -x $(which ecl) ]; then ecl --norc -q --load "$s" --load "$e" --load "$atc" --load "$d" --eval "(progn $g$c$q)" \ --load "$mmc"; exit; fi if [ -x $(which clisp) ]; then clisp -disable-readline -norc -ansi -q -q -i "$s" -i "$e" -i "$atc" -i "$d" \ -x "(progn $g$c$q)" -i "$mmc"; exit; fi #if [ -x $(which ccl) ]; then # ccl -n -l $s -l $e -l $atc -l $mmc -e "(mmc-chip-8:prime)"; exit; fi #if [ -x $(which sbcl) ]; then # sbcl --no-sysinit --no-userinit --load $s --load $e --load $atc --load $mmc \ # --eval "(mmc-chip-8:prime)"; exit; fi .