Re: Looking for a really good PET zero-page map

From: Rhialto (
Date: 2008-06-14 13:13:20

On Sat 14 Jun 2008 at 01:09:01 +0000, Ethan Dicks wrote:
> is a CR ($0D).  On the C-64 and VIC-20, this always seems to
> return what the player typed and no more.  On a BASIC 2.0
> PET (2001-32N or 3032, for example), for the first few input
> attempts *before the cursor is on the bottom line*, it works as
> expected.  Once the cursor reaches the bottom line, the input
> loop grabs what the player typed, all the spaces to the right of
> what the player typed, *and* all of the memory garbage
> between $83E8 and $83FF (which tends to be stuff that's
> scrolled off the screen) *and* the first couple of dozen bytes
> of the top line of the screen (presumably from $8400-$8410 or
> so), typically to a total of 76 bytes.

Do you mean that this happens before the user types 40 characters in the
last line? What you describe sounds like the screen editor thinks that
the bottom line is a 80-character line, and that it connects the next 40
bytes in memory to it to form the full 80-character line.

Obviously the last line can't really be the first of a double line, so I
would look in the area of either the line continuation table, or in
handling the edge cases of that table. I'm not sure if the last line
actually has an entry in that table, or not, since in theory it could do
without (but handling the edge case may be easier if it does exist).

> Does anyone know of any writeups on the behavior, especially
> differences in behavior across the C= 8-bit line, of calls to CHRIN?
> I've traced through the code a bit, of course, and nothing is leaping
> out at me yet.

I can't say I have ever seen this behaviour. Logically it should also
happen in BASIC programs, unless BASIC contains a special workaround or
some such. Maybe comparing the different screen editor and/or BASIC
versions (which should otherwise be fairly similar if not identical)
would provide a hint.

> Does anyone here know of any BASIC-centric 'gotchas' with CHRIN
> on PETs vs C-64s?  I've probably done 50 times as much assembly

I have used a trick of opening files with the screen or keyboard as
input device, and INPUT#ing from them has some useful properties. I
can't recall all details though.

> -ethan
___ Olaf 'Rhialto' Seibert      -- You author it, and I'll reader it.
\X/ rhialto/at/        -- Cetero censeo "authored" delendum esse.

       Message was sent through the cbm-hackers mailing list

Archive generated by hypermail pre-2.1.8.