#!/bin/sh #mmc-chip8 - Launch the MMC-CHIP-8 reimplementation with a sh wrapper under POSIX systems. #Copyright 2020 by Prince Trippy programmer@verisimilitudes.net. #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="" d=$(echo "$0" | sed "s/\/mmc-chip8$//"); s="$d/shut-it-down.lisp"; e="$d/cl-ecma-48.lisp"; atc="$d/acute-terminal-control.lisp"; mmc="$d/mmc-chip8.lisp" printf '\x1B[?9;1006;1007h\x1B]0;Meta-Machine Code targeted at CHIP-8\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 :avoid-color *features*)"; fi if [ "colorless" = "$2" ]; then c="(pushnew :avoid-color *features*)"; fi if [ -x $(which ecl) ]; then ecl --norc -q --load "$s" --load "$e" --load "$atc" --eval "(progn $c$q)" --load "$mmc"; exit; fi if [ -x $(which clisp) ]; then clisp -disable-readline -norc -ansi -q -q -i "$s" -i "$e" -i "$atc" -x "(progn $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 .