Hacker News new | ask | show | jobs
by BlackFingolfin 1199 days ago
That is pretty amazing. Kudos to the authors, I never would have believed emulating an Apple II on an 8088 in a way that is actually usable would be remotely possible.

The story in the README is also worth reading! E.g.

> At the time we wrote Appler we of course knew that the colors are supposed to be purple, blue, green, and orange, but we had never seen them displayed by an actual physical computer, because the Apple ][ displays that were available in Bulgaria were all monochrome-green. Alex looked at the schematics, and he used the actual resistor values of the DAC to calculate what the 4 primary colors should be.

WHAT??? Awesome

2 comments

That's more or less equivalent to reading out the RGB values of the colors[1]. As far as I know (never had one), the Apple II's output was composite NTSC, so what colors the values actually correspond to is also standardized. Of course, different monitors will still have different color output, but that's basically a choice, and for emulators a reasonable one is to just go with what the NTSC standard says.

[1] Might not actually be RGB, did not look at the schematic. But having RGB before modulating into NTSC's color difference signals is not uncommon.

> Might not actually be RGB, did not look at the schematic. But having RGB before modulating into NTSC's color difference signals is not uncommon

The standard NTSC Apple II does not generate color this way, but the European PAL models do.

The native Apple II video signal is 560x192 1-bit monochrome pixels. The PAL video circuit converts video signal into a digital stream of color pixels, 4 bits per pixel. It then converts the digital pixels into analog YPbPr signals by attaching various resistors to each of the 4 bits. The YPbPr signals are then fed into a PAL encoder chip.

Presumably, the original authors used these YPbPr resistor values to determine the colors sent to their Bulgarian PAL/SECAM encoder.

This is a schematic of the PAL color encoder for the Apple IIe: https://imgur.com/CQH7vNS

1. The native monochrome video signal is SEROUT in the top-left of the schematic. It is fed into the LS164 shift register.

2. The LS175 buffer captures each 4-bit color pixel from the shift register.

3. The output of the LS175 is then fed through a various resistors to generate the YPbPr signal which are fed into the TCA650 PAL encoder.

Thanks, that's great context. Do I read it right that the NTSC Apple II generated "artifact colors" (heard that before, but did not know if it applies to the Apple II) through effectively monochrome pixels that just work out to the desired color in NTSC, but since that would not work for PAL (because of the phase flip each line, and because the colors would be different), PAL Apple IIs have some extra circuit to convert artifact color pixels into YPbPr and then modulate that using the TCA650?
Yes, that's right. This page has more info: https://nerdlypleasures.blogspot.com/2021/10/apple-ii-compos...

The PAL color circuit was initially an expansion card for the Apple II+ in 1979. The same circuit was built-in to the later Apple IIe and IIc models.

A novel part of the design is that the TCA650 is actually a PAL decoder chip that is meant to split a composite video signal into YPbPr components. The Apple II drives the TCA650 in reverse to generate the composite signal.

Some what related: Ben Eater's video series on building a VGA graphics card. In there he calculates the resistors to show colors.

https://youtu.be/l7rce6IQDWs