[comp.sys.amiga] Extra-Half-Brite Tutorial and Demo

ewhac@well.UUCP (06/17/87)

[ REPLACE THIS LINE WITH YOU~r LIN_{E No~rIS^?{E~r# ]

	Recently, there has been a lot of discussion about EXTRA_HALFBRITE
mode, whether or not a given machine has it, and how to detect if it's
there.

	I found out about EHB about 1.5 years ago, and I thought figuring
out if it was there was "obvious."  Apparently, it isn't.  So I whipped up
this program to help people discover if their machine has it, and if so, how
to make use of it.

	The below shar file contains C source and executable, and a
description of how EHB works.

	I hope people find this helpful.  If not, it will at least keep you
occupied until Craig Norborg gets around to sending out 'Viacom' (hint,
hint)....

					Schwab

_-_-_-_-_-_-_-_-_-_ Cut here.  Ask your parents for help. _-_-_-_-_-_-_-_-_-_
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create:
#	README
#	ehbtext
#	ehb.c
#	ehb.uue
# This archive created: Tue Jun 16 23:36:55 1987
# By:	Leo 'Bols Ewhac' Schwab ()
export PATH; PATH=/bin:/usr/bin:$PATH
if test -f 'README'
then
	echo shar: "will not over-write existing file 'README'"
else
cat << \SHAR_EOF > 'README'
	The enclosed files describe the Extra-Half-Bright feature in the
Amiga.  The narrative file 'ehbtext' was pulled off the Technical Support
computer over a year and a half ago.  I didn't remove any copyright
restrictions; there weren't any (I don't think).  If there's a problem with
this, someone at CATS let me know before you send the lawyers after me.

	The demonstration program that went with the narrative file was
rather strange, and you had to know what to look for if you weren't sure you
had extra-halfbright in your machine, which struck me as rather useless.  So
I wrote a new test program that more vividly makes you aware of the fact
that you have extra-halfbright or not.

	Run the program.  The screen will fill with concentric rectangles.
At this point, the program will inform you if you have extra-halfbright by
way of a message on the screen.  If you don't see the message immediately,
your machine doesn't have extra-halfbright.  To exit the program, click on
the invisible close gadget in the upper left corner.

MANUFACTURE:
	The program compiles and links under Manx 3.4b (should work under
other versions, too).  To create it, you say:

1> cc ehb.c
1> ln ehb.o -lc

	Hope this proves helpful.

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Leo L. Schwab -- The Guy in The Cape	ihnp4!ptsfa -\
 \_ -_	 Bike shrunk by popular demand,	      dual ---> !{well,unicom}!ewhac
O----^o	 But it's still the only way to fly.  hplabs / (pronounced "AE-wack")
"Work FOR?  I don't work FOR anybody!  I'm just having fun."  -- The Doctor
SHAR_EOF
fi
if test -f 'ehbtext'
then
	echo shar: "will not over-write existing file 'ehbtext'"
else
cat << \SHAR_EOF > 'ehbtext'
From unicom!ewhac Tue Jun 16 23:20:54 1987
Received: by well.UUCP (4.12/4.7)
	id AA26669; Tue, 16 Jun 87 23:20:37 pdt
Received: by unicom.UUCP (5.51/5.17)
	id AA10467; Tue, 16 Jun 87 23:03:12 PDT
Date: Tue, 16 Jun 87 23:03:12 PDT
From: unicom!ewhac (Bols 'Leo Schwab' Ewhac)
Message-Id: <8706170603.AA10467@unicom.UUCP>
To: well!ewhac
Subject: EHB piece
Status: R

	 *************************************************************
	 *							     *
	 *							     *
	 *			 Welcome To The			     *
	 *							     *
	 *     Technical Support Service for The Commodore AMIGA     *
	 *							     *
	 *							     *
	 *			  A Service Of			     *
	 *							     *
	 *		      Commodore AMIGA, Inc.		     *
	 *							     *
	 *   AMIGA is a trademark licensed to Commodore AMIGA, Inc.  *
	 *							     *
	 *   NOTE NEW  PHONE NUMBER IS : (408) 434-0620		     *
	 *************************************************************


					 <Press any key to continue>

Technical Support for the Commodore AMIGA
* Main Menu *
1) Message Center
2) Research Center
3) News Center
4) Info Center
5) Documentation Center
6) Download Center
0) Exit
Selection:
-----------------------
TITLE:  Fun With 6 Bit Planes (SOURCE)

There are lots of fun things you can do in 6 bit planes on the Amiga,
including Hold and Modify color displays and dual-playfield mode
with two separately scroll-able, completely independent, 8 color
playfields with overlay and transparency.

But tonight I'm going to discuss something you don't already know about
your Amiga -- even if you've read all the tech manuals cover to cover.

The specs for the Amiga say that in a completely static, low-resolution
display, with nothing fancy going on (like Hold and Modify), you can
display up to 32 colors simultaneously out of a pallette of 4096.

Well not quite.

You can actually display up to 64 distinct colors out of that pallette
of 4096!  Yes, an unlimited choice of any of 64 colors at each pixel
in the screen!

Have I got your attention?

Welcome to Extra-Half-Brite mode.

The Amiga display hardware automatically enters Extra-Half-Brite mode
whenever you select a 6 plane display (which must be low res due to
the hardware) and have NOT selected either Hold and Modify or Dual
Playfield mode.

The graphics kernel software further enforces the rule that you must
set the EXTRA_HALFBRITE flag in the ViewModes for the ViewPort (Screen
in Intution lingo) or it will automatically trim your screen down to
5 planes.  This is done both for backward compatability and to insure
support in future Amiga architectures.

Consider the playfield data bits for a given pixel.  The bits from the
first five planes form a color register selector for that pixel,
allowing you to choose among the 32 color registers in the Amiga.  The
bit from the sixth plane is interpreted as follows:
  0 -- Use the color in the selected color register just as specified.

  1 -- Take the color in the selected color register, shift each of
       its R, G, and B components right one bit, and use the new
       color value thus formed.

The net result is as if you had 64 color registers where the colors
in the top 32 were "half-intensity" counterparts of the colors in the
bottom 32!

Of course, that means there is a dependency between the choice of
colors in the 32 real registers and the resulting colors in the
32 psuedo-registers.  Nevertheless, I assert we have as much right
to claim 64 colors on screen as IBM has to claim 16 colors from a
monitor that is physically capable of producing only 8 colors at
2 intensities!  At least we can select our 32 colors out of a
pallatte of 4096!

Note also that, since fractional color components have no meaning
in the hardware, there are several distinct real colors that produce
the same extra color.  For instance (in hex):
  888 --> 444,    988 --> 444,   898 --> 444,   999 --> 444,  etc.

Despite all this quibbling, with a little thought it's easy to see
how you can choose a set of 32 real colors to make sure all 64 real
plus extra colors are distinct.  And they are every-pixel-addressable!

Why have we kept this little jewel a secret?  No, it's not that we
were planning to lull the competition into complacency and then
spring an instant double of the Amiga's color capacity on them.

Actually, the rev of the custom chips in which this worked was the
last rev before we went into production.  Thus the info was too
late to make it into the current version of the Amiga Hardware
Manual.

Some caveats.  Although ALL the consumer machines have the necessary
chip rev, there are some older developer's machines out there which
can't do this trick.  BEWARE!  Some of the store demo units come out
of that older developer's stock and won't contain the Extra-Half-Brite
hardware.  Note that you can't hur  BPE')__PI3X!J+'@ !"E.@&Y(YX" ""X ! $I9Q!+^@ (3J[_
MXF &0J?S7TYS0_H ($ZN_F@I0(!R9@PN/  #@ =.KO^48 1.N@ :4$].=61O
M<RYL:6)R87)Y $GY  !__DYU3E4  "\*2'D  0  ,"R 5L'\  8O $ZZ!< I
M0(!V4$]F%$*G2'D  0  3KH%A%!/+FR :DYU(&R =D)H  0@;(!V,7P  0 0
M(&R =C%\  $ "B!L@&H@+(!JD*@ !%" *4" >B!L@'H@O$U!3EA"ITZZ!70D
M0$JJ *Q83V<N+RT #"\M  @O"DZZ *XY?  !@'X@;(!V &B    $(&R =@!H
M@   "D_O  Q@0DAJ %Q.N@6,2&H 7$ZZ!50I0(" (&R @$JH "103V<0(&R 
M@")H "0O$4ZZ!)A83R\L@( O"DZZ F(I;(" @(103TZZ!(P@;(!V((!.N@2<
M(&R =B%   9G%DAX ^U(>@ J3KH$="!L@'8A0  ,4$\O+("$/RR B$ZZ]^Q"
M9TZZ N!03R1?3EU.=2H 3E4  $CG## D;0 0(&T "" H *SE@"@ ($0@*  0
MY8 F0! 32(!(P-"M  Q4@#E @(I"IS L@(I(P"\ 3KH$8BE @(Q03V8(3-\,
M,$Y=3G40$TB .@ _!2!+4H@O""\L@(Q.N@%.2'H!2# %2,#0K(",+P!.N@&(
M/RT #B\*+RR C$ZZ 58@;(",0C!0 #E\  & B# %2,#0K(",)D!2BR1+3^\ 
M'! 32( Z +!\ "!G&+I\  EG$KI\  QG#+I\  UG!KI\  IF!%*+8-@,$P @
M;7H,$P B9BY2BR!+4HL0$$B .@!G'B!*4HH0A;I\ ")F$ P3 ")F!%*+8 9"
M*O__8 )@UF X($M2BQ 02( Z &<FNGP (&<@NGP "6<:NGP #&<4NGP #6<.
MNGP "F<(($I2BA"%8,X@2E**0A!*168"4XM2;("(8 #_6D(20J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PL
M;(!N3J[_E$S?((!.=4[Z  (B;P $+&R ;D[N_F),[P #  0L;(!N3N[_.B)O
M  0L;(!N3N[^VBQL@&Y.[O]\(F\ !" O  @L;(!N3N[_+D[Z  (@;P $+&R 
M;D[N_HQ.^@ "+&R ;B)O  0@+P (3N[]V$[Z  (B;P $+&R ;D[N_H8@;P $
M+&R ;D[N_H B;P $3.\  P (+&R 8D[N_Q B;P $3.\ #P (+&R 8D[N_LXB
M;P $("\ ""QL@&).[OZJ(F\ !" O  @L;(!B3N[^GB)O  0@+P (+&R 8D[N
M_Q8@;P $3.\ #P (+&R 8D[N_N B;P $(&\ "" O  PL;(!B+P=.KO_$+A].
M=2)O  0@;P (("\ #"QL@&).[O_*+&R 8D[N_O),[P,   0L;("03N[_H"!O
M  0L;("03N[_IB!O  0L;("03N[_LB!O  0L;(!F3N[_OB!O  0L;(!F3N[_
MN"!O  0L;(!F3N[_.B!O  0L;(!F3N[_-"QL@&).[OZ       /L     0  
M  $   ;L         _(   /J    %@     !0 #(  8  0"   \         
M                  %  ,C__P   @     (                        
D               /       4      /R   #ZP    $   /R
 
end
SHAR_EOF
fi
exit 0
#	End of shell archive

kim@amdahl.amdahl.com (Kim DeVaughn) (06/17/87)

In article <3333@well.UUCP>, ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) writes:
>
>         I found out about EHB about 1.5 years ago, and I thought figuring
> out if it was there was "obvious."  Apparently, it isn't.  So I whipped up
> this program to help people discover if their machine has it, and if so, how
> to make use of it.

Another nifty hack, Leo, though not as perverse as usual :-)!


>         I hope people find this helpful.  If not, it will at least keep you
> occupied until Craig Norborg gets around to sending out 'Viacom' (hint,
> hint)....

Hmmmm ... and by my count, two versions of "munching squares", Matt's
DME v1.27, and some stuff I've submitted (ushow, scnsizer, etc.)
Hello doc ... are you there ...


And now to the real point of this posting ...

> MANUFACTURE:
>         The program compiles and links under Manx 3.4b (should work under
> other versions, too).                        ^^^^^^^^^

3.4b?  b?  Has Jim released the new version?  The Manx support BBS has not
been answering for several weeks now, so I am not up on 3.4b's progress or
availability.  How's it look, Leo?

BTW, dunno if this is a compiler problem or a "feature" of EHB, but if
the "dancing square" is at the top of the screen when you click the RIGHT
mouse button, it'll take a bite out of one of the upper rectangles ... can
sorta make a game out of it!  Hmmm ... maybe EHB *is* as perverse as your
other stuff ... :-)

/kim


-- 
UUCP:  kim@amdahl.amdahl.com
  or:  {sun,decwrl,hplabs,pyramid,ihnp4,seismo,oliveb,cbosgd}!amdahl!kim
DDD:   408-746-8462
USPS:  Amdahl Corp.  M/S 249,  1250 E. Arques Av,  Sunnyvale, CA 94086
CIS:   76535,25

michael@stb.UUCP (06/20/87)

> all consumer machines have this

Not true; mine does not have 1/2 brite, nor does my friend, nor ....

<Sigh> When will we be able to order a replacement chip?
-- 
: Michael Gersten		seismo!scgvaxd!stb!michael
: Ground floor, comming up -- 1-3-7

ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) (06/22/87)

In article <1594@stb.UUCP> michael@stb.UUCP (Michael) writes:
>
>> all consumer machines have this
>
>Not true; mine does not have 1/2 brite, nor does my friend, nor ....
>
><Sigh> When will we be able to order a replacement chip?
>-- 
>: Michael Gersten		seismo!scgvaxd!stb!michael

	After encountering three machines without EHB, I asked Dale Luck at
the last BADGE meeting what his estimates were on how many Amiga 1000's have
EHB capability.

	He guessed that the current percentage of Amigas with EHB is about
10%.  I suspect it's a bit higher.  His explanation was that there was
indeed a new rev. of the chip which made it into the first thousand or so
production machines.  Then Commodore started using an older rev. because they
had about 50K of them laying around and didn't want them to go to waste.

	Assuming 50K machines without EHB, and 150K machines in place, I
suspect that percetange is more like 66%.  Hmmm.  Oh well, that's why I
cooked up the 'ehb' program - so you could find out.

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Leo L. Schwab -- The Guy in The Cape	ihnp4!ptsfa -\
 \_ -_	 Bike shrunk by popular demand,	      dual ---> !{well,unicom}!ewhac
O----^o	 But it's still the only way to fly.  hplabs / (pronounced "AE-wack")
"Work FOR?  I don't work FOR anybody!  I'm just having fun."  -- The Doctor