Page 1 of 1

Re: Just a little head-scratcher

Posted: Thu Jan 10, 2019 3:07 pm
by stupidget
dfzx wrote: Thu Jan 10, 2019 2:52 pm Clearly the clever people can see how it works, but can someone post a dumbed down explanation of how it's doing it for the rest of us? :?
Yep +1 vote from me for this info as well please. I'm as thick as a plank me is :lol:

Re: Just a little head-scratcher

Posted: Thu Jan 10, 2019 3:25 pm
by Ast A. Moore
dfzx wrote: Thu Jan 10, 2019 2:52 pm Clearly the clever people can see how it works, but can someone post a dumbed down explanation of how it's doing it for the rest of us? :?
Just a note that each 8x8 cell still contains no more that one INK and one PAPER color at any one time; so no ULA timing tomfoolery here.

It’s kind of easier to draw on a piece of paper than to put into writing, but I’ll try.

Imagine the following pattern:

Code: Select all

xxxxxxxo|ooooooox|xxxxxxxo| . . .
Here, xs represent the set screen bits (or pixels) and os the reset bits.

Now, let’s shift the whole thing one pixel to the left:

Code: Select all

xxxxxxoo|ooooooxx|xxxxxxoo| . . .
The attribute pattern looks something like this:

Code: Select all

BLUE/YELLOW|YELLOW/MAGENTA|MAGENTA/RED| . . .
At a pixel level, the colors will be as follows:

Code: Select all

BBBBBBYY|YYYYYYMM|MMMMMMRR| . . .
And so on.

Once we’ve shifted our pixel pattern eight times, we need to shift our attributes one cell to the left, and start shifting the pixels again.

The vertical shifting is done in a similar manner.

Hope this clears things up a bit.

Re: Just a little head-scratcher

Posted: Thu Jan 10, 2019 3:29 pm
by dfzx
Ast A. Moore wrote: Thu Jan 10, 2019 3:25 pm Hope this clears things up a bit.
Yes, thanks! Kind of obvious when you put it like that, but I wouldn't have worked it out from looking at the code. :)

Re: Just a little head-scratcher

Posted: Thu Jan 10, 2019 3:32 pm
by Joefish
Each character cell starts off empty of pixels so it's showing its PAPER colour. What you can't see (because it's empty) is that the INK of that square is set to the colour of its neighbour.

So then you start filling in pixels on the right-hand-side of that character cell, and it looks like it's neighbouring character square is moving into it one pixel at a time.

As I say, knowing this you can paint a big 'PlaySchool' style (child's drawing) house and road using only PAPER attributes, then make the whole thing pixel-scroll to the left.

Re: Just a little head-scratcher

Posted: Thu Jan 10, 2019 9:29 pm
by Bizzley
If you start the code from 32771 instead of 32768 (or zero out the first three bytes) you'll remove the Call to the routine that initially draws the attributes, then you can see the raw pixel data being redrawn behind the scenes every loop.

Re: Just a little head-scratcher

Posted: Thu Jan 10, 2019 10:57 pm
by R-Tape
Bizzley wrote: Thu Jan 10, 2019 9:29 pm ...then you can see the raw pixel data being redrawn behind the scenes every loop.
Image
:)