[Coco] Example basic code for screen grid

Wayne Campbell asa.rand at gmail.com
Fri Feb 24 13:35:24 EST 2012


I am assuming that DECB or whatever basic you're using has the ; character 
for holding the screen cursor position. If it is a differenc character I 
leave to you to determine. In Basic09, you can print to the lower-right 
corner of the display without scrolling by using the ; character:

RUN GFX2("CURXY",78,23) \!lower right corner, screen coordinates are 0,0 to 
79,23 for a 24 line, 80 char screen
PRINT " "; \!Prints a space, same as CHR$(32)

In Basic09, I can use GFX2("REVON") to reverse the colors so the position 
shows as black (or whatever the current background color is) instead of 
green (or whatever the current foreground color is), and GFX2("REVOFF") to 
set it back. I'm not sure what the DECB/HDBDOS or other basics use for these 
commands. Also, the GFX2 subroutine only works under OS-9 L2, so I don't 
know offhand what the GFX equivalents are for L1.

Wayne

----- Original Message ----- 
From: "mike delyea" <mdelyea at gmail.com>
To: "CoCoList for Color Computer Enthusiasts" <coco at maltedmedia.com>
Sent: Friday, February 24, 2012 10:07 AM
Subject: Re: [Coco] Example basic code for screen grid


> The print@ grid is numbered from 0 to 511. So, print at 0 would be the upper
> left hand corner of the screen.  Print at 31 would be the upper right of the
> screen.  Print at 480 would be the lower left and print at 511 is the lower
> right.  I think if you print anything in 511 it will scroll the screen so
> I'd avoid using that position - 510 is ok though.  I believe all of the
> coco manuals have a map of the grid in the back few pages but its easy
> enough to figure out or mark on graph paper.
> Thanks to Darren for the screen memory location.  Poking a 32 (32 is a
> space) into location 1024 would put a green character in the upper left,
> poking 32 into location 1535 would give you the same thing in the lower
> right.
>
> 10 cls0
> 20 poke 1024,32: rem space character
> 30 poke 1535,32: rem space character
> 40 goto 40: rem keep screen from scrolling
>
> is essentially the same as:
>
> 10 cls0
> 20 print at 0,chr$(32);: rem space character
> 30 print at 511,chr$(32);: rem space character
> 40 goto 40: rem hopefully this will keep the screen from scrolling - maybe
> not though
>
> Note the use of the semicolon in the second example - this is absolutely
> essential for what you want.  try it without the semicolon to see what I
> mean.  You can use any of the chr$() characters to light up the screen. 
> To
> see what they are type this in.
>
> 10 cls
> 20 for x=32 to 255
> 30 print x;" ";chr$(x),
> 40 next x
>
> You should avoid using characters below 32 as some of them will make your
> computer do funny things.
>
> On Fri, Feb 24, 2012 at 8:25 AM, Darren A <mechacoco at gmail.com> wrote:
>
>> On Fri, Feb 24, 2012 at 12:43 AM, mike del yea wrote:
>> >
>> > ...
>> >
>> > I'd use the text screen rather than a semigraphics screen because the
>> coco
>> > 3 can't use the semigraphics screen.
>> >
>>
>> By semigraphics screen, I meant the text screen.  Any byte value
>> greater than 127 poked into the text screen uses the semigraphics4
>> mode.  And yes, this does work on a CoCo 3.
>>
>> The screen addresses range from 1024 to 1535.  Poke values of 128 for
>> black or 207 for white.  You can also construct larger "graphic"
>> strings with CHR$ and/or STRING$ and print them to the screen much
>> faster.
>>
>> Darren
>>
>> --
>> Coco mailing list
>> Coco at maltedmedia.com
>> http://five.pairlist.net/mailman/listinfo/coco
>>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco 




More information about the Coco mailing list