Commit graph

18 commits

Author SHA1 Message Date
David Given dea8e6f334 Make the Pascal example look the same as the other hilo examples. 2020-02-05 23:05:10 +01:00
George Koehler 43458df777 Build a smaller startrek for CP/M.
The game was larger than the 64K address space.  I remove the intro
and replace part of libc.  Now I can play startrek in YAZE-AG.
2018-05-04 18:32:24 -04:00
George Koehler b4be612832 Change readstring() to use buffered input.
Change from `uread(0, c, 1)` to `read(c)`, so input goes through
libpc's buffer.  If input is a tty in Unix, this reduces the number of
read(2) system calls from one per character to one per line.

This change will become necessary in CP/M when I enable the line
editor.
2018-05-04 18:06:51 -04:00
George Koehler 4a3b7be795 Use ack -mcpm -fp for mandelbrot.c, startrek.c
Add a variable %{ackldflags} so I can pass `-fp`.  This change seems
to cause the build to relink every ackprogram, because the link now
needs to use %{ackldflags} even if the flags are empty.

mandelbrot_c_cpm runs in YAZE-AG; startrek_c_cpm doesn't run because
it doesn't fit in the 16-bit address space.
2018-04-28 13:18:27 -04:00
David Given e460adc923 Add a B version of the hilo program. 2016-12-29 17:20:51 +00:00
David Given 5bce5fc4da Change the extension used by Basic files for .b to .bas, to avoid conflicts
with B.
2016-11-27 20:38:33 +01:00
David Given ed181a8d20 Ansify Paranoia, because I was getting annoyed by all the compiler warnings on
every build.
2016-11-25 20:01:43 +01:00
George Koehler 82c2d18482 Edit startrek.c so I can compile it with gcc and OpenBSD libc.
Rename our getline() to get_line() to prevent a conflict with POSIX
getline() declared in stdio.h.

Remove dangerous call to gets().  OpenBSD does not have gets(), C99
deprecated it and C11 removed it.

Also change spelling "sheild" to "shield".
2016-11-06 20:21:48 -05:00
George Koehler e4ce7da0a2 Fix hilo.p for big-endian platforms.
Unless it is packed, a Pascal char is a C int.  Using C types, hilo.p
passed an int *buf to uread(), which expected a char *buf.  Then
uread() wrote the char on the end of the int.  This worked on
little-endian platforms.  This failed on big-endian platforms, as
writing the value to the big end of an int multiplied it by 16777216.

The fix is to use a packed array [0..0] of char in Pascal.  I also
change 'string' to a packed array, though this is not a necessary part
of the fix.
2016-09-18 00:07:30 -04:00
David Given f67c98e239 Distributions are a pain --- let's not bother any more. Instead, we just tag
the repository and download a complete snapshot, old and ancient stuff and all.
2016-09-02 23:00:38 +02:00
David Given 1a7b4f8729 Build the examples when doing a normal build; this exercises the compiler as a
whole and is one step further towards a proper test suite.
2016-08-20 14:05:24 +02:00
dtrg 293f34fa9b Flush stdout before prompting the user for input. 2010-08-06 17:02:16 +00:00
dtrg da6111328d Flush output stream before waiting for user input. 2010-08-05 22:23:34 +00:00
dtrg 3a4147a37d Added the Mandelbrot generator. 2007-04-28 22:34:05 +00:00
dtrg 24ea8aee3d Updated for the 6.0pre2 release. 2007-04-24 20:45:58 +00:00
dtrg 9710c14c93 Added the 'Star Trek' example game. 2007-04-21 23:20:11 +00:00
dtrg 921c55968c Adapted to tell the user what language they were written in (because they're too similar!). Modified the Pascal implementation to work with our new syscall model. 2007-04-21 23:19:32 +00:00
dtrg 681e2e0432 Added example programs. 2007-02-25 00:30:07 +00:00