From d6824e6732521e75c7a8cac23f386c157859fc03 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Wed, 22 Nov 2023 04:57:20 -0800 Subject: [PATCH] Fixes in 2005/sykes Add PET program written in the emulator and add it to the try.sh script. The try.sh script now explicitly requires one hit 'q' (or 'Q') to quit (or else killing it or hitting interrupt); after one command is done (hitting ctrl-c) it shows the menu again which has the quit option in there. This makes it a bit easier or at least clearer (cleaner?). The Makefile DATA variable had to be updated after file rename. There were some other issues in the README.md file as well that I missed yesterday. The bugs.md file has been updated pointing out that one has to hit ctrl-c or whatever the interrupt is set to. I believe now that this entry should be complete. --- 2005/sykes/Makefile | 2 +- 2005/sykes/PET | Bin 0 -> 65 bytes 2005/sykes/README.md | 19 ++++++++++--------- 2005/sykes/try.sh | 26 +++++++++++++++++++------- thanks-for-fixes.md | 29 ++++++++++++++++++++++++++++- 5 files changed, 58 insertions(+), 18 deletions(-) create mode 100644 2005/sykes/PET diff --git a/2005/sykes/Makefile b/2005/sykes/Makefile index 98365a9ee..1de711787 100644 --- a/2005/sykes/Makefile +++ b/2005/sykes/Makefile @@ -114,7 +114,7 @@ PROG= ${ENTRY} # OBJ= ${PROG}.o ROM_DATA= basic-2-c000.901465-01.bin basic-2-d000.901465-02.bin edit-2-n.901447-24.bin \ - nullfill.bin kernal-2.901465-03.bin + nullfill.bin kernel-2.901465-03.bin DATA= ${ROM_DATA} 6502test DEMO chess TARGET= pet.rom ${PROG} # diff --git a/2005/sykes/PET b/2005/sykes/PET new file mode 100644 index 0000000000000000000000000000000000000000..9a583a2ede64d2fe25cb1759f7cb6aaa1269ca17 GIT binary patch literal 65 zcmZQzP+{R>n5m#-WME*b9<1Q$@9gZX;N%({qTuQq>f;#VAEd-!$07n!;uNV69O4?_ S;p(Rl9O>;Etf<7mzyJWXbPc`$ literal 0 HcmV?d00001 diff --git a/2005/sykes/README.md b/2005/sykes/README.md index 0100a0632..2ea83d44e 100644 --- a/2005/sykes/README.md +++ b/2005/sykes/README.md @@ -134,15 +134,15 @@ The default is 4. The control keys are as follows: ``` - ^A HOME - ^L CLR - ^R RVS - ^E OFF - ^Y INST - ^X STOP (break) - ^F cursor forward - ^B cursor back - ^N cursor down +^A HOME +^L CLR +^R RVS +^E OFF +^Y INST +^X STOP (break) +^F cursor forward +^B cursor back +^N cursor down ``` Supplied also is a short demo program written in @@ -172,6 +172,7 @@ RUN You also might try typing this to see an ancient [Easter egg][]: + ``` WAIT 6502,12 ``` diff --git a/2005/sykes/try.sh b/2005/sykes/try.sh index 357cbf1eb..fed05f111 100755 --- a/2005/sykes/try.sh +++ b/2005/sykes/try.sh @@ -15,18 +15,27 @@ make CC="$CC" all >/dev/null || exit 1 # clear screen after compilation so that only the entry is shown clear -while true; do +mode=0 +# menu - show menu and prompt for input +menu() +{ echo "(0) Run demo" 1>&2 echo "(1) Show Easter egg" 1>&2 echo "(2) Play chess" 1>&2 echo "(3) Run test-suite" 1>&2 echo "(4) Run pet.rom with -1" 1>&2 + echo "(5) Run IOCCC best emulator" 1>&2 + echo "(Q) Quit" 1>&2 echo "NOTE: you have to hit ctrl-c or whatever your interrupt combination is to" 1>&2 echo "exit the program to continue here." 1>&2 - read -rp "Make your selection (0 - 4 or any other key to exit): " mode + read -rp "Make your selection: " mode +} +while true; do + # print menu and get item to run + menu echo 1>&2 case "${mode}" in @@ -45,13 +54,16 @@ while true; do 4) # -1 ./sykes pet.rom -1 ;; - *) + 5) # best emulator of IOCCC 2005 + printf "LOAD \"PET\"\nRUN\n" | ./sykes pet.rom 6 + ;; + q|Q) exit 0 + ;; + *) continue + ;; esac - read -r -n 1 -p "Do you want to continue? " ans - if [[ "$ans" != "y" && "$ans" != "Y" ]]; then - break; - fi + # this echo is for a quirk when pressing ctrl-c and showing the menu again echo 1>&2 done diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index 345e375b2..4c3dc6598 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -3025,6 +3025,32 @@ might be some command line that will let it work that way. ## [2005/sykes](2005/sykes/sykes.c) ([README.md](2005/sykes/README.md])) +Cody added the saved (with the `SAVE` command) BASIC program `PET` which was: + +```basic +10 PRINT "2005'S IOCCC BEST EMULATOR" +20 PRINT "BY STEPHEN SYKES!" +``` + +followed by the commands: + +``` +SAVE "PET" + +READY. +NEW + +READY. +LOAD "PET" + +READY. +RUN +2005'S IOCCC BEST EMULATOR +BY STEPHEN SYKES! +``` + +to both save and test run it. + Cody added the [try.sh](2005/sykes/try.sh) script which runs in a loop with a menu of things one might wish to try, asking if they wish to continue when done. @@ -3039,7 +3065,8 @@ interrupt is set to in order to exit the program. ## [2005/timwi](2005/timwi/timwi.c) ([README.md](2005/timwi/README.md])) Cody added [try.sh](2005/timwi/try.sh). It only has one command as he doesn't -want to knacker his brain any more than it might or might not already be. +want to knacker his brain any more than it might or might not already be :-) and +he doesn't want to damage anyone else's brain either. :-) ## [2005/toledo](2005/toledo/toledo.c) ([README.md](2005/toledo/README.md))