Chapter 22 in the Extended Color BASIC book deals with some very powerful commands, GET, and PUT. These are commands that effectively create a copy and paste function of graphics on the screen, allowing you to GET an area, which is essentially a square or rectangle shape area of the screen, store that in a variable ARRAY, and then later, PUT that image somewhere else on the screen.
This is the best way to create animation, by moving an object around the screen, and it’s the closest thing the CoCo has in BASIC to create what most 80’s systems referred to as SPRITES which were objects that could be moved around the foreground without disrupting the background screen.
The coco doesn’t have true sprite hardware, so the illusion of sprites can be created with software trickery. There are a few ways to PUT images on the screen to do various forms of “paste” options, from a true bit-per-bit method called PSET, a reverse of that calle PRESET, and then some hybrid options which are AND, OR, and NOT.
As I’m going through the chapter getting ready to record the video, I noticed the demo code has several flaws in it. The PMODE was set to a monochrome mode, yet it was trying to paint using multiple colors. It tried painting two different colors in the same area, effectively erasing one of the colors, and the X,Y coordinates to capture the “box” area around the circle were way off, so it was producing garbage on the screen.
I took time to debug and fix their example, which I will show off, but I’m currently working on a much more elaborate demo that will show off all the options, but utilizing different colored objects, and PUTting them against different colored backgrounds to fully appreciate the results.
Here is the intro screen to that demo showing the objects I’ll be getting and putting:
I have incorporated my font routine to provide on-screen annotations to what each phase of the demo is doing, and for starters, I have drawn boxes around each circle to visualize the area that the program will GET, I will then take these different color objects, and PUT them in a scrolling fashion across a screen of different color bars to show how some colors “blend” or get “lost” against other colors depending on the PUT options of AND, OR, NOT, etc.
It’s taking a while, but I think the results will be worth it, this is an important chapter, these are important commands, and what the book gives us, doesn’t do them enough justice.
535total visits,4visits today