Add alt code to 2006/toledo2

The alt code is based on the author's remarks that should allow users
with non-standard systems like DOS/Windows which have conio.h to use
this program, replacing read(2) and write(2) syscalls. It need hardly be
mentioned that I have no way of testing this so it's possible I did
something wrong but it seems not the case (whether anything has changed
since 2006 that might also break it is unknown).

The bug status has been updated both that one bug is not actually a bug
but appeared to be a typo and there also appears to be a missing file
(IMPORT.COM).
This commit is contained in:
Cody Boone Ferguson committed 2023-11-01 07:30:55 -07:00
1 parent 0c4fab88b3
commit 5ffcd2b731
4 files changed
+40 -31

No files matched your search

+5 -2
View File
@@ -116,8 +116,8 @@ OBJ= ${PROG}.o
DATA= C.BASIC C.BIOS
TARGET= ${PROG} C
#
ALT_OBJ=
ALT_TARGET=
ALT_OBJ= ${PROG}.alt.o
ALT_TARGET= ${PROG}.alt
#################
@@ -144,6 +144,9 @@ C: C.BASIC
alt: data ${ALT_TARGET}
@${TRUE}
${PROG}.alt: ${PROG}.alt.c
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
# data files
#
data: ${DATA}
+24 -14
View File
@@ -12,6 +12,10 @@ Mexico\
make
```
There is [alternate code](#alternate-code) that is based on the author's notes
for DOS/Windows. This cannot be tested by us, not even to compile, but it appears
that it should be fine, after the proper header files were added.
### Bugs and (Mis)features
@@ -19,7 +23,7 @@ The current status of this entry is:
```
STATUS: INABIAF - please **DO NOT** fix
STATUS: possible bug (possibly depending on system) - please help test and if necessary fix
STATUS: missing files - please provide them
```
For more detailed information see [2006 toledo2 in bugs.md](/bugs.md#2006-toledo2).
@@ -36,13 +40,6 @@ below section, it is supposed to crash on termination though some noted this
does not seem to happen in macOS. He asks ironically: 'if it's supposed to crash
and it does not crash is it actually a bug or is it a feature? :-)'
### INABIAF - it's not a bug it's a feature! :-)
By design this program is supposed to crash on termination.
You must type in caps (except in strings) and this program is indeed
case-sensitive.
## Try:
@@ -61,14 +58,23 @@ RUN
To end the program hit ctrl-z.
### IABINAF - it's a bug it's not a feature! :-)
## Alternate code:
Although the program does not crash when reading in `C.BIOS` it appears that the
CP/M emulator does not work as expected at least according to the author's
remarks.
This version, as noted, should work for DOS/Windows. It uses non-standard
functions in place of `read(2)` and `write(2)`.
See also [bugs.md](/bugs.md) for more details.
### Alternate build:
```sh
make alt
```
### Alternate use:
The author noted that for PC/DOS you will have to add `ANSI.SYS` to your
`CONFIG.SYS` but this is also not something we can test.
Use `toledeo2.alt` as you would `toledo2` above.
## Judges' remarks:
@@ -166,7 +172,7 @@ When the `>` prompt appears, do:
IMPORT DDT.COM
```
When it ends, do `HALT`, so the file is saved, and you can start
When it ends, do `HALT`, so the file is closed, and you can start
the same process with another file.
At this time I have tested successfully the following software
@@ -199,11 +205,15 @@ ANSI terminal:
write --> putchar(7[o])
system --> nothing
Notice that you'll have to do `#include <conio.h>` as well.
Also add the following to trap Ctrl-C:
#include <signal.h>
signal(SIGINT, SIG_IGN);
NOTE: this is what the [alternate code](#alternate-code) is for!
NOTE from the judges: in Unix like systems `getch()` is part of curses but this
is not what is needed.
+7 -15
View File
@@ -1534,28 +1534,20 @@ not crash in macOS (it appeared to work fine in fedora linux on an `x86_64`
architecture but he does not know if it crashed in macOS Ventura due to the fact
it is an `arm64` CPU - the Apple silicon chip). This fix, BTW, is a mix of a fix
by [Yusuke Endoh](/winners.html#Yusuke_Endoh) and Cody's. Nevertheless there are
two features that are not bugs and one bug (see below).
two features that are not bugs.
By design this program is supposed to crash on termination.
You must type in caps (except in strings) and this program is indeed
case-sensitive.
### STATUS: possible bug (possibly depending on system) - please help test and if necessary fix
### STATUS: missing files - please provide them
The author showed something like this in their remarks:
```sh
./toledo2 DDT.COM
A> IMPORT DDT.COM
```
but the `A>` prompt never appears; instead it's just the same as if you
specified no arg which is `>`. It seems like the `A>` might be a typo. That
being said from the description by the author, if the required files exist in
the directory, it seems you can do `HALT` 'so the file is saved, and you can
start the same process with another file'. This does not seem to work but it
might be not enough information or a misunderstanding.
A file is missing from the archive linked to by the author so we have not been
able to add it. Cody tried a few of the other zip files at the website linked to
but no luck. Do you have the proper file? The file is `IMPORT.COM`. If you do
please provide a link or make a pull request, adding it to the repo, after
testing it to make sure it works in the program.
# 2007
+4
View File
@@ -2274,6 +2274,10 @@ macOS - it did not seem to be a problem under linux, at least not fedora. The
problem was wrong variable types - implicit `int`s instead of `FILE *`s. It now
works with both macOS and linux.
Cody also added the (untested) alt code that is based on the author's remarks to
port this to systems that have the non-standard `kbhit()` and `getch()` (not the
one from curses) which is typically (always?) in `conio.h`.
## [2006/toledo3](2006/toledo3/toledo3.c) ([README.md](2006/toledo3/README.md]))