Extra colors for hires graphics wanted ?

13 posts / 0 new
Last post
Offline
Last seen: 2 days 3 hours ago
Joined: Apr 1 2020 - 16:46
Posts: 878
Extra colors for hires graphics wanted ?

As we all know, the Apple II can produce four colors in the HIRES mode, plus black and white (which are not "colors", but "shades". But what can I complain. Some computer folks are so uneducated that they pervert the meaning of words all the time. Such as "clone". Back in the day, they called knockoffs of the IBM PC "clones". Big mistake ! According to "Webster's Encylopedic Unabridged Dictionary of the English Language" of 1989, a "clone" is "a group of organisms derived from a single individual by various types of asexual reproduction". The ill educated computer morons misappropriated this word from biological sciences. And now we suffer from the confusion between what is a "clone" and what is a "replica" of a computer. All my attempts to promote a less confusing use of these words at least in the field of Apple 1 and II computer knockoffs was fruitless. Sigh.)

 

Back to "colors". So the Apple II has four in the HIRES graphics mode. Which always bothered me because with only four "colors" I can't make a "color peg" version of my "Codebreaker" game. A simulation of the colored pegs which the original "Mastermind" game set had. When I started to build hardware like my Apple-1 color graphics card, and now the "Replica 2e" (the links are at the end of this post), I finally had some development platform to investigate tricks to give the HIRES mode more colors.

 

And then one commenter on the "Replica 2e" thread named 'reifsnyderb' (post #21 there) wanted to know if the Apple II+ also could get this extra color mod. This nudged me into putting all the logic distributed over various PLDs into one GAL16V8 and to put this one GAL in my trusty Taiwanese "PC 48" clone. (Here the word "clone" is correct as far as I am concerned - the PCB is a knockoff with the same layout, the same circuit, the same type of ICs, so I could use the original Apple II fold-out schematics which came with my Apple II that, alas, does not work anymore. Oh the irony ! The Taiwanese knockoff made in 1985 still works after 38 years. My original Apple II made in 1981 does not. Most likely, due to lousy quality IC sockets. I never was able to fix it.)

 

Here is a photo of the extra color mode mod in my "PC 48":

 

 

(Follow the read wires to the GAL in the lower right corner of the motherboard --- this is all what is needed for the mod)

 

Note that these  Taiwanese copycats actually thought about what they were doing when making a ripoff copy of the original Apple II motherboard. They improved the lower right corner into a really useful "sea of vias" prototype area. In the original Apple II, there are only empty places for a DIL-16 and a DIL-14 IC socket in that corner. But APPLE (the corporation) was so cheap that they did not even cover up the vias for these sockets, so all the holes are soldered shut. Arrgh ! So if anyone wants to put my extra color mod into an original Apple II or Apple II+, they must desolder these vias and then put some pin headers in, for receiving a small PCB, which then has the required "sea of vias".

 

The mod as such is easy to do and does not require any cutting of PCB traces (only three ICs get "lifted" pins to disconnect these three outputs) and there are only a dozen flight wires to add, most of them on the solder side of the PCB, hidden from sight. The whole mod can be done in maybe 2 hours of work.

 

Now, the question is "what benefit does it bring" ?

 

Well, to be honest, so far I am disappointed with the extra four colors. They are distict from the four hires colors normally available in the Apple II, but they are not really nice looking. There is a new, real "red" and a new, clean "blue" but the other two are green-yellowish mixed colors which don't look nice. I'm still experimenting with tricks and adjustments to make these extra colors look nicer.

 

So this is the state of the work as of now. I did not write a "color bar" test program yet. Which would help much to make proper judgements and measurements on the new colors. Such measurements are done with a very expensive instrument called a "vector scope". I happen to have one because I was involved with the design of the very last TV chipsets for CRT based TV chassis, just before the LCD flat screen TVs killed the CRT. The semiconductor company I worked at for this project must have known about the demise of the CRT, because after these last chipset was developed, they sold their whole Image/Video division to a competitor, and the measurement instruments nobody wanted anymore were up for grabs (you had to pay a symbolic price equivalent to $1 per instrument, due to legal reasons, so they could give you a bill of sale, and write off the instrument as a total loss, saving taxes - don't try that as a private person).

 

This said, despite I am (or, at least, was) a TV technology professional, I'm struggling with squeezing out more colors from the old Apple II HIRES graphics concept. It is trivial to add that extra 45 degree rotation / delay of the NTSC color subcarrier but half of the the colors to be had from that just suck. So I'm still working on it. But I don't expect miracles.

 

I have a hunch that this difficulty to squeeze more colors out of the Apple II HIRES mode may have led APPLE (the corporation) to adopt the DOUBLE HIRES graphics mode which came with the Apple IIc and Apple IIe. Where a whole lot of really nice colors are available, including the real yellow I deperately seek. But DOUBLE HIRES comes at an immense extra cost in terms of added IC count. Double the RAM memory (2 x 64 kBytes) with all the complications for memory access and bank select, which APPLE (the corporation) solved with their MMU and IOU custom chips. Built with TTLs, the Apple IIc and Apple IIe simply would have been power hogging "TTL IC graveyards" and would not have been commercially viable at all (see the photo of the wire wrapped Apple IIe prototype, link below,  if you have any doubts about this statement of mine).

 

So, the extra colors are a project still in the works. Maybe I abandon it (at least it did cure the nasty color artifacts in the text mode of this PC 48, which I always wanted to fix, so I did not waste my time, and the machine is now fit for software development work, where legible text is a must).

 

If you want to know more, or are interested in putting such an "extra color mod" in your Apple II, please comment what you think about this work !

(I always need feedback to see if I'm just wasting my time on projects with no takers).

 

Comments invited !

 

- Uncle Bernie

 

Here are the links:

 

Apple-1 color graphics card thread:https://www.applefritter.com/content/glimpse-uncle-bernies-apple-1-color-graphics-card

 

Replica 2e thread:https://www.applefritter.com/content/uncle-bernies-replica-2e-ww-prototype-apple-iie-replica

 

Image of the Apple IIe wire wrapped prototype (see post #10 of this link):https://www.applefritter.com/content/question-about-weird-thing-mmu-schematics

reifsnyderb's picture
Offline
Last seen: 2 weeks 6 days ago
Joined: Jan 11 2024 - 17:06
Posts: 47
The red and clean blue sound

The red and clean blue sound like a good start and, if nothing else, that sounds like an improvement.  I like the use of the GAL16V8 as we can readily get ATF16V8's, even today, and they are pretty easy to program.  :-)

 

This looks great!  I'll be watching to see what you figure out.

CVT
CVT's picture
Offline
Last seen: 8 hours 53 min ago
Joined: Aug 9 2022 - 00:48
Posts: 1007
UncleBernie wrote:As we all
UncleBernie wrote:

As we all know, the Apple II can produce four colors in the HIRES mode, plus black and white (which are not "colors"...

 

The Apple II can produce six colors in HIRES mode, not four. Achromatic colors are colors too. And this doesn’t only apply to computers, but also in everyday life, like when buying paint.

 

From the Wikipedia entry on spectral colors:

reifsnyderb's picture
Offline
Last seen: 2 weeks 6 days ago
Joined: Jan 11 2024 - 17:06
Posts: 47
The original Apple II

The original Apple II produced 4 colors.  Black, White, Violet, and Green.  (Ok.  black and white "technically" aren't colors.)  There were mods to add 2 more colors.  The Apple II Plus added 2 extra colors.  The differences in the schematics between the Apple II and the Apple II Plus show how this change was made.

 

Also, Byte magazine, Page 60 of the June 1979 edition, explains a modification to add 2 more colors to the Apple II.

mmphosis's picture
Offline
Last seen: 1 week 1 day ago
Joined: Aug 18 2005 - 16:26
Posts: 433
I love your work.

I love your work.

I am more into software than hardware. Six colors is all you need. There are software tricks to eek out more colors on the Apple II:

  • pixel positioning on the byte boundaries
  • mixing existing colors
  • dithering
  • mixing modes using vertical blank timing, racing the beam, and vapor lock

Those are interesting hardware ideas and projects. This seems like a lot of work on the Apple II for two more colors. How would you actually use this from software? Is there more memory used to add an extra shift? Or, is there a different method to turn on these extra colors?

I type this on the 4K monitor, just one of the 3 monitors connected, with millions of colors, transparency, scaling, rotration, and lots of video RAM hidden in a GPU that I know little about. I wonder what it would take to build modern graphics into a computer. I would like to take all of the mystery out of the graphics card. PC graphics has pretty much always resided on a separate card that you need to address via I/O somehow. The original B&W Hercules and CGA and EGA seemed pretty pathetic compared to the 8-bit and 16-bit color graphics computers at the time. It wasn't until Silicon Graphics came along that the "GPU" appeared on the scene, but even today GPUs have lots of issues: proprietary blobs, digital rights management (DRM), screen tearing, broken and conflicting vendor APIs, complicated GPU compilers, etc. The Apple II allowed us to simply poke bytes in the computer's RAM and instantly the pixels would change on the TV screen. The closest I can get today seems to be installing something like SDL to get direct access to a frame buffer.

 

 

Here are links to the extra spectral colors and the Byte magazine article mentioned above:

https://en.wikipedia.org/wiki/Spectral_color#Extra-spectral_colors

https://archive.org/details/byte-magazine-1979-06/page/n61/mode/2up

 

Offline
Last seen: 1 week 16 min ago
Joined: Jul 5 2018 - 09:44
Posts: 2587
One thing I always thought

One thing I always thought about as far as adding extra colors would be to use data in the "gaps" to allow picking a different color pallate per line.  That's overall wasted bytes of memory space normally.  Some apps use that to store small bits of data, but most don't bother.

 

Having different pallates for different lines isn't a perfect solution but it can work for a lot of things.

 

 

Offline
Last seen: 3 days 22 hours ago
Joined: Apr 26 2016 - 08:36
Posts: 684
Can we all just agree that in

Can we all just agree that in vintage computers a CLONE is a reasonably faithful hardware re-creation and a REPLICA is a functional re-creation that does not share reasonably similar hardware?

 

Your Taiwanese clone is either a Unitron or a clone of a Unitron - clones of clones did exist, and Unitrons got cloned because of how good (and true to the original) they were.

 

Offline
Last seen: 2 days 3 hours ago
Joined: Apr 1 2020 - 16:46
Posts: 878
The "replica" vs. "clone" topic is heading towards a solution !

In post #7, "baldrick" wrote:

 

" Can we all just agree that in vintage computers a CLONE is a reasonably faithful hardware re-creation and a REPLICA is a functional re-creation that does not share reasonably similar hardware ? "

 

Uncle Bernie answers:

 

This is exactly what I want to promote. But we could even relax that a bit and allow the use of the word "replica" for everything which is a reproduction of a vintage (or out of production) computer, regardless how faithful that reproduction is, and regardless which IC or circuits are used, as long as it runs the original software.

 

The word "clone" would be reserved for a very faithful reproduction down to the smallest details, the same circuit, the same IC set, the same PCB layout. The same "genetics" = "clone" in the original, biological sense.

 

I think that this convention could avoid a lot of trouble and misunderstandings in the Apple-1 scene. I myself have lost countless hours with trying to "remote debug" the work of some builders, and I thought they had built an Apple-1 clone, for which my IC kits were meant, but instead they had built Vince Briel's Replica - 1 ... in which, for instance, the unmodified ACI never works. But the Gen1 and Gen2 improved ACI which I made got the mods to make them work with Vince Briel's creation. This, of course, was driven by those who asked my for help and did NOT tell me it's one of those which they built.

 

So, let's call a very faithful replica a "clone". Problem solved.

 

- Uncle Bernie

Offline
Last seen: 2 days 3 hours ago
Joined: Apr 1 2020 - 16:46
Posts: 878
First demo for extra hires colors came alive !

Here is a screen shot:

 

 

Sorry for the poor quality. I have not yet rediscovered what the trick was to make good photos from an Apple II screen where the colors don't bloom out into white (overexposure) and look correct. Maybe daylight is the solution. Maybe only in Summer at high noon ? I know I made a few photos about my Apple-1 color graphics card which looked OK. But now that skill (or luck) just got lost.

 

This is how the extended color mode works:

 

As long as soft switch AN2 is off, HIRES mode is as usual. But when AN2 is turned on, every PHASE bit (bit #7, MSB) of every even screen byte address turns into a "alternate color" phase bit which, if set, delays the pixel stream by 1/2 M14 master clock. The bit #7 / MSB of every odd screen byte address is the usual PHASE bit which, if set, delays the pixel stream by one M14 master clock. The update of both phase bit occurs simultaneously at every odd screen byte. Phase bits do no change on even screen bytes. So, essentially, after the leftmost screen byte is over, all following pairs of screen bytes have the choice of four distinct pixel delays, in the ideal case, 45 degrees of color subcarrier phase angle apart. With the usual encoding of two basic color artifact colors by alternating pixels 01010101... and 10101010... this gives a choice of eight steps of 45 degrees = 360 degrees, which is the full NTSC color circle. The shades white and black can be had anywhere, by setting more than one pixel in a of pixels to 1, or by having a run of zeros for black.

 

The make the demo program I "stole" the "bubble" from which the little hero robot in the game "Drol" emerges, and massaged it a bit with a "C" program which adds the phase bits for the extra color system. You can already guess where this is heading - a color peg version of my 'Codebreaker' game (I'm addicted to this game, very good brain training. With colors it's even more difficult than with letters.)

 

Here is another photo of the same test picture, taken with a flash:

 

 

I think the colors in the photo with the flash are closer to what I can see with my own eyes on the screen. But as you can see even in the photo, some of the eight colors are very close to each other. Maybe they are too difficult to discern, especially the green/blue tints. I'm not very happy with this outcome. But have one macrocell in the GAL16V8 left. Maybe I can add a trick to make the colors more different, by adding some white (luma, Y) or by desaturating the "new" colors, or both. This is development work still to be done.

 

Stay tuned !

 

- Uncle Bernie

 

P.S.: oh, and I found a nasty trap in the Taiwanese PC 48 clone. They somehow have wired the 74LS151 MUX at location A8 differently, they have the "H0" signal on its pin #13 while the Apple II has it on pin #14. I verified this on my real Apple II motherboard. Since I designed the circuit based on the Apple II foldout schematics, the extra color mode did not work at first.

Took me a while searching with the oscilloscope until I found that the "H0" on my GAL was something else than expected.

It would be helpful for this project if you check in whatever original Apple schematics you might have to which pin of said MUX the "H0" signal goes. Maybe these Taiwanese copycats used some other version of Apple II to knock it off ? Not sure about the Apple II+ either. Don't have the schematic for that one.

reifsnyderb's picture
Offline
Last seen: 2 weeks 6 days ago
Joined: Jan 11 2024 - 17:06
Posts: 47
This is looking great!If you

This is looking great!

If you run out of macrocells, on the 16V8, there is always the ATF22V10.

 

 

Offline
Last seen: 1 week 16 min ago
Joined: Jul 5 2018 - 09:44
Posts: 2587
It's too bad Apple didn't do

It's too bad Apple didn't do this color mod back in the day.

 

mmphosis's picture
Offline
Last seen: 1 week 1 day ago
Joined: Aug 18 2005 - 16:26
Posts: 433
You've added 4 more colors

You've added 4 more colors—impressive. And if I am not mistaken that is an effective resolution of 1120 x 192.

Offline
Last seen: 2 days 3 hours ago
Joined: Apr 1 2020 - 16:46
Posts: 878
There is no higher resolution, but only more colors !

In post #12, mmphosis wrote:

 

" You've added 4 more colors—impressive. And if I am not mistaken that is an effective resolution of 1120 x 192. "

 

Uncle Bernie clarifies:

 

There is no higher resolution involved. It's just adding another phase shift = delay to the video dots stream.

 

The first Apple II had no such phase shift and the MSB of all HIRES bytes was ignored. Then somebody at Apple had the idea to use that MSB (Most Significant Bit, bit #7) for something useful, and the 1.0 x M14 delay was added, which is yet another video dot stream that is always there, but just delayed by one cycle of the 14 MHz master clock, which is done with a 74LS74 D-Flipflop. What the MSB (often called the 'PHASE' bit) does is to select which video dot stream is  used: the original one (which gives you black, magenta, green, white) or the delayed video dot stream (which gives you black, orange, blue, white).

 

What my mod does is to add yet another PHASE select bit which can delay the video by 0.5 x M14. This is done with a trick circuit because the GAL16V8 does not support negative clock edges for their flipflops. Two PHASE bits can choose four delay configurations which together with the two possible artifact color choices give eight colors. Plus black and white. When the extra color mode is turned on (I use the AN2 soft switch) then normal PHASE bits are grouped in pairs. Now, the color palette for pairs of two adjacent HIRES screen bytes can be freely chosen from four possible sets.

 

So there is no higher resolution. But your number 1120 is right insofar as the same effect could be accomplished by having four times the dot rate (4 x 280 = 1120). This would need a 28.6363 MHz dot clock and four times the screen buffer memory. Not cheap and not efficient.

 

With that 28.6363 MHz clock and the same trick circuit, sixteen color phases could be made. But the resulting colors are too close to be easily discernable. The human eye is great in seeing a difference of adjacent colors, but not so great to tell a color if this color is presented alone with no reference. So eight colors are about the maximum which still makes sense to me.

 

To have more colors which still are easily identified, we would need to add shades of grey to the color signal. This is what could be done with the extra macrocell. I'm still experimenting with this but since yesterday I have a floppy disk emulator and can continue with my "Replica 2e" project, see here:

 

https://www.applefritter.com/content/uncle-bernies-replica-2e-ww-prototype-apple-iie-replica

 

Of course when the Replica 2e development has progressed enough to move the tested circuit ideas into my Apple-1 color graphics card project, then I will build another prototype for this one. None of my Apple-1 projects are dead - there just has been no progress with the little  flaws and quirks they still have. These are rooted in the overall quirkyness of the Apple-1 itself, and in the Replica 2e project I can explore solutions without fighting against Apple-1 quirks at the same time. To wage a two (or three) front war is always stupid.

 

But the color mod in this thread already has brought me relief from the artifact colors in pure text mode which this 'PC 48' suffered from, and it also did correct its LORES colors, which always had been wrong and could not be adjusted. I don't know if this is just a fault in my PC 48, or if all of them had the problem. It is possible that the Taiwanese copycats / knockoff artists had no idea how the Apple II video circuitry really is supposed to work.

 

- Uncle Bernie

Log in or register to post comments