[comp.sys.atari.st] DeskJet stuff & Life!

jeroen@pluto.phil.ruu.nl (Jeroen Scheerder) (10/16/90)

I have just posted the FULL version of Life (with text and samples) to
c.s.a.st.binaries as well as some utilities for the deskjet and deskjet
plus printers.

I have also uploaded them to atari.archive, filenames are:
	lifeuniv.arc	(arc 6.02 needed - subdir!)
	djstuff.arc

Included with this posting are excerpts from the accompanying text files.

Enjoy!	Jeroen. (jeroen@phil.ruu.nl)
----------Cut Here----------

This file accompanies the two accessories DJ+_SET.ACC, DJ_SET.ACC and the
program DJDUMP.PRG.

Both accessories are configuration utilities for the HP DeskJet/HP DeskJet+
printers respectively.

The DJ+ has, in combination with the ST, an ugly feature: if it's powered
ON after the ST has booted, the ST will think the printer is not available.
(:- that is, unless you buffered the STROBE line)
Before you switch on the DJ+ the ST *DOES* think it can print.
If you call the DJ+_SET accessory it detects an unavailable printer,
and - if appropriate - it resets the concerning hardware ST registers.

This means you can now switch your DJ+ on after system powerup: just call
the accessory once, and the printer will be available.

Since I had to make an accessory for the DeskJet+ anyway, I thought I might
just as well add ome functionality in it too.

Once I finished that accessory it sprung to me such an accessory might come
in handy for ordinary DeskJet too: I stripped the code down a bit and
modified the resource.

Features:
        - Release the printerport if incorrecty kept busy (DJ+ acc only);
        - Set perforation skipping on;
        - Set wrapping of long lines on;
        - Set text scaling on;
        - Choose between portrait and landscape printing (DJ+ acc only);
        - Choose between 6 lines/inch and 8 lines/inch;
        - Choose between letter and draft quality printing;
        - Choose between 10, 16.67 and 20 cpi pitch;
        - Select/disable left, right, top and bottom margins of one inch;
        - Save your setup IN THE PROGRAM ITSELF (no extra setup file is used);
	- No resource file needed (is included at compile-time);
        - Configure the printer at boot time.


The program DJDUMP is a program to print screendumps on HP printers. It is a
rewrite of a PD program I got from some ftp site; I have changed it in four
ways.
First, the original program took about 2 kB of memory, mine needs only half.
Second, the original just dumped the screen to the printer: my version compacts
the graphics data (it uses mode 2 graphics data), so most of the times the
32 kB of ST screen memory fit in the printer's buffer.
Third, my version also centers the screen dump, which the original did not.
The fourth change that I made is technical: making the program install itself
legally. The original just stole the ST's system vector 'dump_vec' at $502, the
old and illegal way. My version uses the XBRA protocol to install itself: the
XBRA-id is "hpdj". It knows if it's already installed, so it will install
itself twice. Other programs can find out if it's there too, by following
the XBRA chain at $502.


Questions, bug reports etc.:

email to        jeroen@phil.ruu.nl
----------Cut Here----------
                                  Life v. 2.4

1.   The Game of Life

Life is a 0-player game. It is played in a 2-dimensional universe,
of which the opposing edges are connected.

The rules of Life are simple; at a certain location in the universe
(called a cell) there is either life (the cell is alive) or not (the
cell is dead). The only actions a cell can take is to die if it is
alive and to be born if it's dead. These actions take place in cycli,
socalled generations. Now the two rules of Life are these:
	* Birth rule:
		A cell that is dead in generation t will be alive in generation
		t+1 if and only if it has exactly three living neigbours in
		generation t.
	* Death rule:
		A cell that is alive in generation t will be dead in generation
		t+1 if and only if either it has less than 3 (exposure) or more
		than 4 neighbours (overcrowding) in generation t.
The death rule can negatively be stated as a survival rule:
	* Survival rule:
		A cell that is alive in generation t will be alive in generation
		t+1 if and only if either it has exactly 3 or 4 neighbours in
		generation t.

You may wonder what the interest of this game is. It just happens to
be the case that Life has interesting mathematical/logical features:
I will mention these briefly (without any proofs).
	- 	Life's behaviour is chaotic; the question whether a given Life-
		configuration will stabilise or not is not decidable. In short,
		the reason for this is that Life can only determine certain
		configurations - those that do stabilise in finite time.
	-	Life is powerful: it is a system as powerful as any computer,
		since it can be shown to be equivalent to the One-Tape Turing
		Machine, which in turn is equivalent in force to lambda-calculus,
		RAM-based machines etc. etc.

2.   Manual for ST Life 2.4

ST Life interacts with the user as usual, using the mouse, menus,
windows, dialogs, and alert boxes. Printing is performed by GDOS.

You can draw in the Life-window with the mouse: pressing the left
button somewhere will force the cell at that location to be born,
the right button will kill a cell.

Features:

        Life is a full GEM-based application.

	The option "Save..." allows you to save the universe currently
	on screen to a file, for which you will have to choose a name
	using the fileselector first. Note that Life uses the extended
	fileselector if possible (TOS >= 1.4).

	The "Print"-command prints the currently shown universe using
        a GDOS printer driver.

	"Random" initializes a universe randomly.

	"Load..." loads a selected Life-universe.

	"Random Factor" selects the probability of a cell to be alive if
	a universe is initialized randomly, indicated by a percentage.

	"Cell Size" selects the cell size to use: images of the sizes you
	are allowed to choose from are selectable.

	"Birth Rules" and "Survival Rules" allow you to change Life's rules.
	You select the cases in which you want birth resp. survival to take
	place.

Questions, bugs, etc. at jeroen@phil.ruu.nl