[comp.sys.apple] Bob Bishop's APPLE-VISION

don@brillig.umd.edu.UUCP (02/17/87)

   Date: 13 Feb 87 04:02:57 GMT
   From: Christopher Schumann <puff!schumann@rsch.wisc.edu>

   jmdavis@ihlpm.UUCP (Davis) writes:
   > Just so the old folklore of the Apple doesn't die I thought I would
   > mention a program by {{Bob}} Bishop   where a living room with TV
   > is drawn and a man appears on the tiny TV screen and dances.  This
   > program used a special timing loop to flip back to the text page
   > from the graphic page so that SINGLE CHARACTERS on the text page
   > could be displayed on the graphic page.
   > 			Mike Davis

   Wrogo, Mike!

   I have studied that program in depth, and (with a little help from
   Apple's book about this and other PD programs they used to give away),
   I have determined that he uses a Hi Res Character generator.
   I have even taken out the HRCG, and made it work with other programs.
   It does not scroll the screen, which limits it, but that is a very slow
   process in hi res.  The program is in Integer BASIC, with parts in
   machine language (disguised in the program).

   If you look at the program after it runs, you will see a POKE 54,
   {something}:POKE 55,{something else}.  This makes all characters
   printed go through his HRCG routine.

   It is not possible to access the page switches fast enough to display
   the width of a single character.  The minimum width is 1/4 (maybe
   1/6) of the screen.

   On the //c and maybe //e, you can get an interrupt every screen
   refresh.  So you can wait a while then flip pages, therby making the
   border between graphic and text (or lores and hires) anywhere
   VERTICALLY on the screen you like. (But disk accesses disable
   interrupts).  This may absorb quite a bit of cpu time...

   Interrupt, wait 1/200 second, flip switch, RTI.  This could be as
   much as 3% of clock cycles if there is a lot of overhead, such as
   a //c with ProDOS (both have interrupt handlers).

   An HRCG would slow down throughput, but not computation time, and
   the screen flipper is tricky to write, anyway.

   I hope this starts some discussion......

   ---------------
   "It...  It's your hand Buckaroo." -- Akita

   Chris Schumann			schumann@puff.wisc.edu

The HRGC that "APPLE-VISION" used did however put the characters on
the text screen as well as the hires screen. 

From the "Apple Software Bank Contributed Programs Volumes 3-5 Bonus
Issue", a manual for the Contributed Program disks you could
get copies of for free from your Apple dealer, the description of
APPLE-VISION is:

	Program Name: APPLE-VISION
	Volume Number: 3
	Software Bank Number: 00106
	Submitted By: Robert J. Bishop
	Program Language: Integer BASIC
	Minimum Memory Size: 16K Bytes

	One never forgets the first time one sees Bob Bishop's
	APPLE-VISION.  While some are prone to carry away the
	impression of a light hearted vaudeville act, those of a more
	sophisticated bent will see through to the profound
	philosophical implications in the recursive theme of a
	television within a television. (This writer is not as bent
	but rather is reporting the experiences of those who are.) But
	regardless of one's position, APPLE-VISION stands out as one
	of the best computer-animations ever to have been done on the
	Apple II.

	INSTRUCTIONS

	Set HIMEM: to 16384 and LOAD the program in Integer BASIC.
	Then RUN.  If you wish to SAVE this program on a cassette or
	another disk, you must not RUN it until _after_ it has been
	SAVEd. If you LIST the program before RUNning it, do not be
	alarmed to see that it is not your usual BASIC, as the first
	section is in machine language.

	PROGRAMMER'S CORNER

	There shall be no attempt to analyze this program; it is very
	complex and the major (and most interesting) parts are done in
	machine code.  He would say, however, that this program shines
	as an example of finely polished work. It takes two or three
	time as long to write a cosmetically perfect program as it
	does to knock out one with unclear input requests, ragged
	flashes between graphics and text screens, or music scores
	with some-notes-a-little-off-but-no-one-will-notice-and-
	everybody-does. Flashiness is the mark of a clever programmer;
	perfection is the mark of a professional programmer. Bob
	Bishop's programs consistently display both.

The contributed program HIGH-RESOLUTION CHARACTER GENERATOR, written
by Chris Espinosa, is included on the same disk, Volume 3.  I don't
know if it's the same character generator as is used in APPLE-VISION,
though.

I still have the book around, but I don't seem to have any copies of
the disks left. The book of documentation, "Contributed Programs
Volumes 3-5," is Apple Product #A2L0014. It's (C) 1978. It says that
you can get copies of the disks from any Apple dealer. (Apple dealers
were a LOT different back then!) Does anyone have a complete
collection of the Apple Contributed Software Bank? Has it been
contributed to any big Apple users groups such as Washington Apple Pi?
I'd sure like to have a fresh set of copies. 

I'd really love to have a copy of one of the programs on Volume 3,
MICROLISP, the Lisp interpreter written in Applesoft BASIC, 'cause
there are a few people I'd like to show it to either becase they don't
believe me, or I want to gross them out completely. (There used to be
a BASIC interpreter written in Lisp, on MIT-ML, but I never had the
nerve to try to port either of them.)

BONE TUMOR DIAGNOSIS, on one of the other volumes, is an "AI Expert
System," written in BASIC, that's just about as good as some of the
snake oil that's being pushing today! 

Oh yeah, a neat trick to do Apple ][ page flipping is to make the last
byte (lower right) on the hires screen be $80, which is black2, and
make sure all other black bytes on the screen are $00. You can use
the "Vapor Lock" trick (because of the way the video circuitry works,
you can read the byte that was just displayed on the screen, at $C05x,
and thereabouts), wait for $80 to be scanned on the screen, and then
flip.  It is not as reliable or efficient as hardware interrupts, of
course; its use is rather tricky, but it was all you could do without
modifying the hardware. (Like putting a wire from an appropriate IC
pin to the a game paddle button input.)

	-Don