[Coco] Example basic code for screen grid

Andrew keeper63 at cox.net
Sat Feb 25 00:58:19 EST 2012


> Message: 8
> Date: Sat, 25 Feb 2012 00:14:17 -0500 (EST)
> From: haywire666 at aol.com
> Subject: Re: [Coco] Example basic code for screen grid
> To: coco at maltedmedia.com
> Message-ID:<8CEC19374D15C28-1010-41E9 at webmail-d149.sysops.aol.com>
> Content-Type: text/plain; charset="us-ascii"
>
> Thats almost perfect, but can you tell me how I can make the border around the sides of the screen black not white, and make the grid  8x8 squares?
>
> And is there a way to remove the white border of the squares so that its only active when the block is colored white?
>
> Thanks for your help, I'll try modifying some values to see If I can do this things. I have to dig through my old stuff
> and find those getting started and going ahead books, I'm sure I have a set some where, its very frustrating forgetting more
> than I remember about this stuff. Thanks for your help!

Here's 8 x 8, alternating checkerboard (not a "grid"):

10 PMODE 4,1
20 PCLS
30 SCREEN 1,1
35 I=0
40 FOR Y=0 TO 191 STEP 24
50 FOR X=0 TO 255 STEP 32
60 IF I=0 THEN LINE(X,Y)-(X+8,Y+8),PSET,BF: REM FILLED WITH WHITE
70 IF I=1 THEN LINE(X,Y)-(X+8,Y+8),PRESET,BF: REM FILLED WITH BLACK
80 REM LINE(X,Y)-(X+8,Y+8),PSET,B: REM UNFILLED (WHITE GRID)
85 I=1-I
90 NEXT X
100 NEXT Y
110 GOTO 110

Again, I am not sure what to do about the large border around the sides; 
on the CoCo 3, IIRC, it can be altered via a PALETTE statement (I 
think?) - but on the CoCo 1/2, it is a function of the VDG/SAM chip - I 
seem to recall it being possible to alter it via a POKE, but I am not 
absolutely certain there...?

Andrew L. Ayers
Glendale, Arizona



More information about the Coco mailing list