Shop OBEX P1 Docs P2 Docs Learn Events
Has the Apple IIe video format ever been emulated with the prop? — Parallax Forums

Has the Apple IIe video format ever been emulated with the prop?

cbmeekscbmeeks Posts: 634
edited 2015-06-28 19:18 in Propeller 1
Has anyone ever attempted to emulate the strange NTSC video format of the Apple IIe?

From what I read, it was basically a monochrome signal that are combined in quadrature with the colorburst signal (whatever that means...lol).

(loose quote ripped from WikiPedia).

Anyway, basically if you take 2 bits per colorburst cycle, you can get two colors (one bit on, one off), black (none on) or white (both on). Then by shifting the bits 90 degrees, you could get other colors.

So I was wondering if anyone ever tackled this.

Just thinking out-loud here, but what would it take to make the Propeddle computer a fully working Apple IIe clone? :-D (day dreaming a little...lol).

Comments

  • potatoheadpotatohead Posts: 10,261
    edited 2015-06-25 15:06
    Eric made a driver that is close. The signal is right, but it needs to be written to scan memory like an apple does, and it needs to do 7 bits per byte.

    I'll have to go looking for it. I think it is NTSC 4x2 or something like that.

    Because Apples use artifact color, colorburst needed to be in software to be consiatent. The Prop color generator can't be used.

    The Nyan Cat driver also has the right signal, but will need to be hacked on to do it more like the Apple computers.
  • cbmeekscbmeeks Posts: 634
    edited 2015-06-25 19:25
    I was wondering if the artifact colors could be faked. Like if the bits were 1111 then switch to white, etc.

    I don't remember the details about the 7 bits though. What's that about?
  • potatoheadpotatohead Posts: 10,261
    edited 2015-06-25 20:11
    Apple 8 bit computers display 7 pixels per byte. In the high resolution mode, the other bit phase shifts the pixels to deliver different colors for that byte.
    In the double high resolution mode they are just ignored.

    The 7 pixels makes substitutes hard as color bit patterns cross byte boundaries.

    Even bytes deliver one set of colors per bit pattern, odd bytes do another.

    Artifacts are generally 2 bit patterns across the scanline.
    https://en.m.wikipedia.org/wiki/Apple_II_graphics
  • ericballericball Posts: 774
    edited 2015-06-26 06:01
    http://forums.parallax.com/showthread.php/128015-NTSC-4x-driver and http://forums.parallax.com/entry.php/60-NTSC-4x2 are the closest I ever came to making something like the Apple ][ Hi-Res mode.

    The Apple ][ Hi-Res mode is pretty funky, starting with the X,Y to address mapping (which created the "Venetian blind" effect):
    Address = BaseAddress + (Y & $07)<<10 + (Y & $38)<<4 + (Y & $40) + (Y & $C0)>>2 + (Y & $C0) >> 4 + X/7

    Pixels are displayed MSB first with the MSB adding a phase shift. I believe the signal generation is fairly simple, but I can't recall offhand how it works.

    I suspect you could create a Apple ][ hires graphics driver for the Propeller although it probably would require multiple cogs. One cog to fetch the bytes from memory in A2 order and translate the bytes to pixels and a second cog which would push the pixels out the WAITVID.
  • cbmeekscbmeeks Posts: 634
    edited 2015-06-26 06:24
    Wow. Thanks guys. I will check those out. I did, however, already read the Wiki entry on it. Very interesting stuff. Especially how Woz was able to pull it off with almost no hardware (relatively speaking).

    I was brainstorming some ideas and I was thinking something like this:

    https://gist.github.com/cbmeeks/6482001471cf74573621

    That would take all 8 cogs which I would be OK with (another propeller would be for audio)

    The II family never had sprites but in my "vision" of an emulated IIe, it would be able to run legacy software (with near perfect video emulation...a pipe dream maybe...) and have some upgrades like a few sprites, re-definable colors, etc.
  • ericballericball Posts: 774
    edited 2015-06-26 07:17
    From Chapter 8 in http://mirrors.apple2.org.za/Apple%20II%20Documentation%20Project/Books/W.%20Gayler%20-%20The%20Apple%20II%20Circuit%20Description.pdf

    Each bit is shifted out at 2x colorburst (7.159MHz). If the MSB is set, the bit is delayed by 1/4 colorburst and the whole output is delayed by 1/8 colorburst. The Propeller video generator should be able to generate the same output - just use VGA mode at 8x colorburst.
  • potatoheadpotatohead Posts: 10,261
    edited 2015-06-26 08:56
    If you've got more than one COG, "perfect" video emulation makes sense. Another way to think of the video is it runs at a resolution of 560x192. Everything happens on that grid, which is the double high res screen resolution.

    And isn't that screen memory layout nuts?? :) IMHO, that's one of the few gaffes in the machine. A nice linear map would have been easier for people. One of the first hard 6502 programs I wrote was a screen blitter. PITA. When I got an Atari machine, it was bliss by comparison.
  • cbmeekscbmeeks Posts: 634
    edited 2015-06-26 10:34
    Yeah, I would devote the entire propeller to the display. :-) All cogs.

    Good point on the 560x192. I was readying that basically you have 560 pixel positions per scanline in HIRES mode. And with B/W and 7 pixel wide fonts gives you your 80 column display. Pretty slick.

    But yeah, that color scheme is bizarre. So basically you have 280 "slots" per scanline and a color pixel can take up an entire slot or half of two slots (overlap). And that positions determines the color.

    The more I read that book on the Apple IIe the more respect I have for the machine.
  • ericballericball Posts: 774
    edited 2015-06-26 12:06
    I recall reading that Woz created the funky screen memory layout to save costs.

    My NTSC 4x driver could probably handle the output duties with some minor tweaks (i.e. only outputting 28 bits/pixels per long to make the memory byte to output bit conversion easier), and converting it to a line-RAM rather than full bitmap.

    Converting the Apple ][ bytes to pixels could be mostly handled via a lookup table (i.e. 0abcdefg -> ggffeeddccbbaa & 1abcdefg -> gffeeddccbba0). The only quirk is MSB=1 means the first bit/pixel is the same as the last bit/pixel from the previous byte.
  • potatoheadpotatohead Posts: 10,261
    edited 2015-06-26 16:41
    That is what I read too.
  • Cluso99Cluso99 Posts: 18,069
    edited 2015-06-26 17:08
    Didn't a lot of Apple //e users have video cards like the Zofary (cannot recall it's precise name)?
  • potatoheadpotatohead Posts: 10,261
    edited 2015-06-26 17:14
    Few add on video cards saw mass use, unless they were 80 column add ons.
  • Cluso99Cluso99 Posts: 18,069
    edited 2015-06-28 19:18
    Yes, it was an80 column card and it did see mass use. At the time, I met the guy who made it.. Harry Zofary.
Sign In or Register to comment.