[Coco] CoCo2, a speed demon?

Arthur Flexser flexser at fiu.edu
Wed Apr 13 03:54:56 EDT 2005


On Tue, 12 Apr 2005, Robert Gault wrote:

> Yes, there used to be a routine (Basic 1.2) which poled the keyboard and 
> skipped the Keyin routine if no key was pressed. This was removed in the 
> Basic 2.0 code.
> 
> I'm not aware of the reason for the change.
> 

In Color Basic 1.2, the idea of the change was to streamline the keyboard check
that is done between Basic statements (to check for break and shift-@) in order
to speed up the running of Basic programs--the thought was to bypass a slow poll
of the keyboard columns to identify which key was down in cases where a fast
check inserted at the outset of the routine indicated that there was no key
down. The time savings in a long program could be quite significant.  But, it
was then discovered that some Basic programs (especially games) wouldn't run
right with this change on account of the fact that they used PEEKs to check the
keyboard rollover table (at $152-158) to see if a particular key was currently
being held down.  The new streamlined key input routine didn't update (clear)
the rollover table if no key was down, so key releases were not detected.  So
your little game guy whose motion was controlled with the arrow keys would just
keep on heading in the same direction instead of stopping when you released the
arrow key you were pressing.  (A workaround for this problem was to insert a
statement containing a dummy INKEY$ check, which accomplished updating the
rollover table.)  Tandy fixed this with a change to Disk Basic, with Disk Basic
1.1 essentially restoring the keyboard check to the way it had been in Color
Basic 1.1, regardless of which Color Basic version you had.  Which of course
sacrificed the speedup that had previously been obtained.

Art





More information about the Coco mailing list