[comp.sys.apple2] Stripes

gt0t+@andrew.cmu.edu (Gregory Ross Thompson) (02/05/91)

  Rudy, I tries sending this to you, but it kept bouncing back to
me...

orn@picard (Rudy Moore) writes:
>   That was pretty impressive.  I wasn't at all aware that we could do
> different colors on the text screen, and I wasn't aware that we could
> put ANYTHING outside the boarders.  How much precise control do we have
> over this sort of thing?  Yeah, I'll play with your routines, if I can 
> get APW to crunch into Merlin Code. :)

  I'm glad you liked it.  It's great to hear that people like these
little things...

>   Do you think there's enough control or perhaps I should say speed to
> use this to color certain amounts of text.  <Envisioning a completely
> different approach to this ANSI term program I'm writing.>

  Well, the horizontal beam register really flies.  You can't do much
at all with it, and what you can do is VERY CMU intensive.  So, having
different colored text would be really hard.  In fact, I think the
best you'd be able to do is maybe, MAYBE have it change the color
every 7 characters or so.  That horizontal counter flies like a bat
out of hell.  To use it at all, you have to put the GS in slow mode,
read the register, execute a bunch of NOP's depending on what the
value of the register is, and then change the color.  Kinda rough.
  The verticle counter, on the other hand, is a lot slower than the
horizontal.  If all you wanted to do was to make different lines on
the screen different colors, you'd have no problem.  You'd only have
to act every 8 scan lines, so you'd only need to read the high 6 bits
of the register.  When those bits are between %000000 and %010111,
they correspond to the lines of text on the screen, so all you'd have
to do is watch those 6 bits, and change the text color whenever the
beam reached the line you wanted.

  Now, I don't know if you'd have enough time to do that inside of a
term program...  You'd be able to do a little processing between
lines, but I don't know exactly how much.

  Good luck with hacking the code out, and lemme know if you get
anything interesting.

> Rudy Moore.
> orn@picard.cs.wisc.edu

		-Greg T.
		 gt0t+@andrew.cmu.edu
		 R746GT0T@CMCCVB

toddpw@nntp-server.caltech.edu (Todd P. Whitesel) (02/05/91)

gt0t+@andrew.cmu.edu (Gregory Ross Thompson) writes:

>  Well, the horizontal beam register really flies.  You can't do much
>at all with it, and what you can do is VERY CPU intensive.  So, having
>different colored text would be really hard.  In fact, I think the
>best you'd be able to do is maybe, MAYBE have it change the color
>every 7 characters or so.

It's 3 40-column characters. 2 is possible, but you can't get stable
positioning because of a logic hack in the FPI chip. When the CPU is
in fast mode, the refresh counter for the main DRAMs runs independently
and does not take advantage of I/O accesses when it could. I've verified
that this is the case by testing code that would produce a stable display
if this weren't true -- but it wiggled.

> That horizontal counter flies like a bat
>out of hell.  To use it at all, you have to put the GS in slow mode,
>read the register, execute a bunch of NOP's depending on what the
>value of the register is, and then change the color.  Kinda rough.

Nah, it's not too bad. I've figured out how to install a task in the
heartbeat queue that maintains a display at the bottom of the screen
in the border during normal system operation -- this is subject to
interrupt conditions, however, so disk, AppleTalk, and usually mouse
activity near the bottom of the screen can cause it to flicker.
But it NEVER moves. It either appears where it's supposed to or it doesn't.

Eventually I will be making this into a border clock NDA or something
like that -- it does affect system performance somewhat so I wouldn't
expect anybody to keep it up all the time. But it does impress the Mac
people who know anything about programming.

Actually, I've been thinking about writing a generic display facility for
border color hacks -- say, a sort of bordercolor character driver? Reroute
12/ to .BORDER and everything pumped to stderr zooms by in the border...

Todd Whitesel
toddpw @ tybalt.caltech.edu