[Coco] Example basic code for screen grid

haywire666 at aol.com haywire666 at aol.com
Sat Feb 25 07:12:05 EST 2012


> Sounds like the semi graphics screen should fit your needs.
>
> CLS0 will black out the screen and keep the black border.
>
> SET(X,Y,5)  where X ranges from 0 to 63 and Y ranges from 0 to 31 will
> make pixels white.  RESET(X,Y) will revert them to black.
>
> You could also use POKE with addresses ranging from 1024 to 1535 to
> control a four pixel block (2x2) in one operation.
>
> Darren


I want to thank everyone for their help with this.
After lots of different things I have tried, it turns out the above method is best for my needs.
I used set commands to generate a good size dot  and some for next loops to make the dot flash on and off.
I tested this with my photocell sensors by attaching it (duct tape works wonders) to that area of the screen.
Motors, relays, lights,whatever I want will turn on and off, controlled by the coco.
5 cls0
10 set (0,5,5)
15  set (0,6,5)
20 set (1,5,5)
25 set (1,6,5)
30 for x = 1 to 300 
40 next x
50 cls0
60 for x = 1 to 1000
70 next x
80 goto 5
Much more work to do but this is proof of concept. THANKS GUYS! 
Can't tell you how happy I am this works or will work. I have alot more work to do on this, but just knowing the idea will work
makes me feel fantastic! Coco home automation and a coco powered mobile robot here I come...

Best regards and a big thanks to all who helped!
Steven







-----Original Message-----
From: Arthur Flexser <flexser at fiu.edu>
To: CoCoList for Color Computer Enthusiasts <coco at maltedmedia.com>
Sent: Sat, Feb 25, 2012 4:42 am
Subject: Re: [Coco] Example basic code for screen grid


I don't think that the PMODE graphics screen border is changeable on a
CoCo 1/2 (as it may be on a CoCo 3, though this might only apply to
the 40/80 column text screen and HMODE graphics).  I recall writing a
patch to Telewriter-64 long ago that made it print white on a black
background instead of the reverse, but I was stuck with the white
border, which somewhat ruined the effect.

If the text screen is used rather than the PMODE graphics screen, you
can change the border color to be either green or black if it is a
CoCo 2 equipped with real lowercase (as indicated by a model number
ending in 'B').  My memory is a bit hazy on this, but I think you can
also get something like red text with a white background and border if
you use SCREEN 0,1 or something like that.

Art

On Sat, Feb 25, 2012 at 12:58 AM, Andrew <keeper63 at cox.net> wrote:
>> 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
>
> --
> 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