AppleWin / AppleWin

Apple II emulator for Windows
GNU General Public License v2.0
713 stars 163 forks source link

Request: Full support for AppleColor extended 80-column card/Video-7 RGB-SL7 card's "obscure" modes (color 40 column text and monochrome 280x192 hires with foreground/background color support). #819

Open skaratso opened 4 years ago

skaratso commented 4 years ago

Now that AppleWin supports the double-hires graphics modes of the AppleColor Extended 80 Column card/Video-7 RGB-SL7 card/Chat Mauve card, what would it take to support the other, more "obscure" modes that the AppleColor Extended 80 Column card/Video-7 RGB-SL7 card supports?

I'm talking about the ability to set the foreground and background colors of 40 column text (each individual character can have it's own foreground/background color) and the ability of the card to apply the foreground and background color to individual pixels of a monochrome single hi-res image in RGB mode to support a sort of "16 color single hi-res." There are a couple of other modes as well, I believe. It would be nice to preserve the full functionality of this card, even if not a whole lot of software used those capabilities.

The Video-7 manual describes how these modes are implemented and I have a IIe with an AppleColor Extended 80 Column card and an AppleColor Monitor 100 RGB monitor. In addition I have a spare AppleColor Extended 80 Column Card that I would be willing to loan someone to get this to work.

tomcw commented 4 years ago

even if not a whole lot of software used those capabilities.

Perhaps you can start by listing all the software that supports this RGB card mode?

In addition I have a spare AppleColor Extended 80 Column Card that I would be willing to loan someone to get this to work.

That's very generous. What monitor / TV can this card be used with? NB. Including modern monitors with modern adapters.

skaratso commented 4 years ago

Well, after looking around, it doesn't look like there is a whole lot of software that supports either the color 40 column text mode (where each character can have a foreground and a background color much like the Commodore 64) or the monochrome 280x192 hi-res with foreground/background colors besides the demo software that came with the card.

However, aside from the AppleColor Monitor 100, if one does the "Marcorlandi" modification to the card and adapts a monitor cable, the AppleColor RGB Monitor for the IIgs can also be used. If someone were to take me up on the offer to loan the card I would permit the Marcorlandi modification to be made. The modification is described in the following document:

https://ia800702.us.archive.org/11/items/Using_Apple_II_AppleColor_RGB_Card_with_an_Apple_Analog_Monitor/Using_Apple_II_AppleColor_RGB_Card_with_an_Apple_Analog_Monitor.pdf

fenarinarsa commented 4 years ago

As far as I know, only 1 or 2 software use those modes. The Apple RGB Card is not the only card that have the capability of showing this color TEXT mode. I found at least two others : Le Chat Mauve and another US one (can't remember the name). There's also the Video-7 cards - The Apple RGB uses Video-7 modes under licence.

Video-7 and EVE also have the nice HGR duochrome mode which is basically a monochrome HGR with FG/BG color definition in AUX, like the color TEXT mode.

Video-7 and Apple RGB have an additional RGB mode: 160x192. It's a regular "chunky" mode where 4 bits = 1 color pixel (at least!!).

EVE also have many more extended modes. You can also define the color of future printed characters in TEXT (every write to $400 will make the card write the default colors to AUX).

So, there' a lot of interesting modes. Why haven't they been more used? IMO two reasons: in the US most people used only the composite output, which fit perfectly all usages. On the opposite, in France a lot of people bought Le Chat Mauve RGB cards so here it's not uncommon to find Apple II's for sale with RGB cards. The second reason is that every card uses its own softswitches to enable similar modes. The color TEXT is a good example: different softswitches on every card! Compatibility nightmare. It's a shame because it's very nice, basically on EVE you can make the IIe boot with IIgs colors.

The only mode that have been "standardized" is the mixed DHGR (color/B&W), starting in Video7.

So now for the technical data:

US Patent that describes precisely how the DHGR modes are enabled on AppleRGB/Video7/LeChatMauve: http://www.freepatentsonline.com/4631692.html Note the F1/F2 hidden registers that are programmed by using 80COL and AN3 - flip 80COL to the desired value, then switch AN3 OFF/ON to push this value in a 2 bits FIFO queue that represents F2 and F1. This is compatible with external IIc RGB adapters. Code snippets are at the end of this article: https://www.fenarinarsa.com/?p=1440 The extra 160x192 chuncky mode is enabled with one extra F1/F2 combination.

Color TEXT on Video7/AppleRGB is described in the Video-7 manual, page 41: https://drive.google.com/file/d/1mladW9J6FnJwM5Nx7RVN_JVSJOzXzYFy/view?usp=sharing

Extra modes on EVE are described in the manual, pages 117 to 119: https://mirrors.apple2.org.za/Apple%20II%20Documentation%20Project/Interface%20Cards/Apple%20IIe/Le%20chat%20mauve%20Eve/Manuals/ Color TEXT mode is enabled with $C0B9 All extra HGR modes are enabled with the described HR1,2,3 registers. LOCKCPREG is the register used to lock/unlock the default TEXT color.

I think I found at least one other card that handles TEXT color with, again, different softswitches (Taxan?).

The Video-7 demo disk works only on Apple RGB and Video-7 cards.

IMO it would be interesting to implement those modes - at least the TEXT & duochrome HGR, then implement the various softswitches depending on the card the user selects for emulation.

fenarinarsa commented 4 years ago

Testing ;) image

The rendering itself needs only a few modifications in NTSC and RGBMonitor. The mode detection is not done yet but on Video7 cards the text color mode is simply enabled by disabling AN3. By default it shows black on black (since AUX memory is populated with 0s), so that's why a "driver" was provided to modify the firmware print functions. Since the IIe resets with AN3 on, it's backward compatible.

The function that I added can also be used to generate duochrome HGR.

fenarinarsa commented 4 years ago

And here's the duochrome HGR mode

image

tomcw commented 4 years ago

The rendering itself needs only a few modifications in NTSC and RGBMonitor.

@fenarinarsa - these results look good, and hopefully as you say only a few mods to those 2 files. Please share via a PR.

Thanks.

fenarinarsa commented 4 years ago

The only issue, as I see it, is how to handle those modes.

For instance on Video-7 the HGR duochrome is enabled when AN3 is off. Which is, on later RGB cards, how you disable color output in HGR.

So there is some work to do to support various card features. I don't know where to put this configuration setup... Maybe enable each feature with toggles in RGBMonitor, depending on the emulated card? Some cards also use additional softswitches, so that means also handling I/O and a "RGB card type" setup in user configuration. The EVE card even spies on the bus and writes default colors to AUX when it detects a write to a TEXT page.

tomcw commented 4 years ago

So there is some work to do to support various card features. I don't know where to put this configuration setup... Maybe enable each feature with toggles in RGBMonitor, depending on the emulated card?

A simple first step could be to just support these various card features via AppleWin command line switches. I appreciate these aren't great from a UI nor discoverability point of view, but the current Configuration property sheet pages are already overloaded.

TBH, the entire Config UI needs an overhaul, (IMO) based around a per-slot configuration model... but this is a fair bit of work, especially as there's a lot of hardcoded cards in slots.

So simpler to start with cmd-line switches.

fenarinarsa commented 4 years ago

Good idea! I will use this approach.

tomcw commented 4 years ago

Extra modes on EVE are described in the manual, pages 117 to 119: https://mirrors.apple2.org.za/Apple%20II%20Documentation%20Project/Interface%20Cards/Apple%20IIe/Le%20chat%20mauve%20Eve/Manuals/ Color TEXT mode is enabled with $C0B9 All extra HGR modes are enabled with the described HR1,2,3 registers. LOCKCPREG is the register used to lock/unlock the default TEXT color.

btw, $C0Bn = Slot-3's DEVICE SELECT I/O, and AppleWin has the Uthernet card hardcoded into slot-3. See: Memory.cpp, MemInitializeIO().

fenarinarsa commented 4 years ago

I'm going to start with the Video-7 RGB card anyway. It uses only AN3 to enable extra modes. One step at a time :)

tomcw commented 4 years ago

Sounds good.

btw, the specific cmd line "-s3 empty" currently does nothing - I'll get this fixed soon. (But the other "-sN empty" switches do work though!)

tomcw commented 4 years ago

Remaining things to do for this issue:

NB. Uthernet card (in slot-3) also uses $C0Bx I/O regs. Even though the cmd line switch "-s3 empty" doesn't yet work, you can still disable the card from AppleWin's Configuration GUI (ie. "Ethernet Settings..." -> Disabled).

tomcw commented 3 years ago

FYI, there's a new release of AppleWin 1.29.15.0 containing this update: here with lots of RGB card support from @fenarinarsa. But I'm leaving this open as there's still some extra work for LCM's EVE RGB card.