Shop Learn P1 Docs P2 Docs
P2 Video Driver for a coco 3 emulator? — Parallax Forums

P2 Video Driver for a coco 3 emulator?

Hi, perhaps somebody wants to give me some hints?
For my project https://forums.parallax.com/discussion/174794/towards-os9-operating-system-on-p2#latest
I want to start with an emulator, which works with a serial terminal connection.
But when I read about OS9, then the most used implementation by far was Tandy Color Computer 3. It's Screen could be switched with a keystroke to a different application. Software uses simple windows. So it would be very attractive to have video output. Unfortunately video output for P2 and for coco-3 are big additional learning fields for me....
The best description of the data format, that I have found up to now is here, chapter 4: https://colorcomputerarchive.com/repo/Documents/Books/Assembly%20Language%20Programming%20for%20the%20CoCo3%20(1987)%20(Laurence%20A%20Tepolt).pdf

As far as I understand, maximum Ram requirement is 2 colorbits640256=40k for graphics. I am using no external Ram. I would need an approach for a simple mind using FlexProp.... P2 is running at 200MHz. Output is a VGA-Monitor.

So my question is: Which of the video-drivers for P2 can output text and graphics data, that is given by coco-3 software? Will I need a translation-cog that reads the data and outputs with an own second video buffer?
Of course the register settings have to be translated to driver settings, so I must be able to understand things. Start shall be with a subset of modes.

Any hints appreciated! Christof

Comments

  • roglohrogloh Posts: 4,522

    After skimming through the attached pdf I suspect you will need your own custom video driver COG, so unless one has already been developed for the CoCo-3 by someone or you can get someone to make you one, you will need to make your own. It will have to deal with text/graphics modes, character attributes, colour palette selection, borders, source data format and video timing etc. It's not a simple task to do but will be very interactive and educational along the way, and if you do it yourself from scratch will be highly rewarding once you complete it.

  • evanhevanh Posts: 13,628

    Huh, I always assumed the TRS-80 was an 8080 based system. I never saw one in a shop so never tried to look them up.

  • RaymanRayman Posts: 12,818
    edited 2022-09-17 14:13

    I’m sure P2 can do the video, it’s just a lot of work to support all those various modes.

    Also, do you want to output VGA or composite ?
    Ok, I see vga. Good choice.

  • Christof Eb.Christof Eb. Posts: 695
    edited 2022-09-17 14:22

    @rogloh said:
    After skimming through the attached pdf I suspect you will need your own custom video driver COG, so unless one has already been developed for the CoCo-3 by someone or you can get someone to make you one, you will need to make your own. It will have to deal with text/graphics modes, character attributes, colour palette selection, borders, source data format and video timing etc. It's not a simple task to do but will be very interactive and educational along the way, and if you do it yourself from scratch will be highly rewarding once you complete it.

    Ohoh.
    Thanks for your input! Perhaps an existing driver could do the 4 colors graphics mode? At least the driver of Taqoz seems to go in that direction. I don't think, that all of these very many modes are needed....

  • RaymanRayman Posts: 12,818

    I have a driver for 2-bit color that works up to 1080p. Uses something similar to P1 graphics. Uses a tiled approach where graphics are done using memory as a tile array.

    That may be too complex for this though…

  • @evanh said:
    Huh, I always assumed the TRS-80 was an 8080 based system. I never saw one in a shop so never tried to look them up.

    Yes that was astonishing for me too. For their color computers, they switched over to 6809 but the name was still trs-80. Marketing...

  • RaymanRayman Posts: 12,818

    If you just want to support 640x256 at 2bpp, should be fairly easy. But, getting the aspect ratio right would be a trick.

    If actual output is 640x480, you’d either have a vertically squished display or double the lines and cut off the bottom…

  • RaymanRayman Posts: 12,818

    I might try to get the monitor to think it’s seeing the vesa 1280x1024 mode.

    Output each line 4 times and drop the actual pixel clock to 1/4 of the usual 108 MHz

  • @Rayman said:
    I might try to get the monitor to think it’s seeing the vesa 1280x1024 mode.

    Output each line 4 times and drop the actual pixel clock to 1/4 of the usual 108 MHz

    Thanks for your thougts!
    I have to learn more about these drivers and how graphics or tile drivers work. Did not worry about aspect ratio up to now...

  • evanhevanh Posts: 13,628

    @"Christof Eb." said:

    @evanh said:
    Huh, I always assumed the TRS-80 was an 8080 based system. I never saw one in a shop so never tried to look them up.

    Yes that was astonishing for me too. For their color computers, they switched over to 6809 but the name was still trs-80. Marketing...

    Ah, right, I see - https://en.wikipedia.org/wiki/TRS-80_Color_Computer
    Interesting, it was also basis of Motorola's VideoTex terminal.

  • RaymanRayman Posts: 12,818

    Here's a QVGA image driver that is signaled at VGA.
    Might be easy to change to 1280x1024?

  • RaymanRayman Posts: 12,818

    Here's 640x256x4bpp. Wanted to do 2bpp here but turns out that isn't a .bmp option from Photoshop...

    Also, it's more stable at 216 MHz on TV, but looks good on monitor at 200 MHz.

  • RaymanRayman Posts: 12,818
    edited 2022-09-17 17:13

    Here's 640x256x2bpp signaled at VESA 1280x1024 at 60 Hz

    Just does 4 color bars. Notes may actually match what it does in this one :)

  • roglohrogloh Posts: 4,522

    @"Christof Eb." said:

    @rogloh said:
    After skimming through the attached pdf I suspect you will need your own custom video driver COG, so unless one has already been developed for the CoCo-3 by someone or you can get someone to make you one, you will need to make your own. It will have to deal with text/graphics modes, character attributes, colour palette selection, borders, source data format and video timing etc. It's not a simple task to do but will be very interactive and educational along the way, and if you do it yourself from scratch will be highly rewarding once you complete it.

    Ohoh.
    Thanks for your input! Perhaps an existing driver could do the 4 colors graphics mode? At least the driver of Taqoz seems to go in that direction. I don't think, that all of these very many modes are needed....

    If you just want a single static graphics mode without all the fancy features and register controls, then yes you can potentially use a variety of drivers with some customization. You will likely need line doubling enabled to get the timing close to what a typical VGA monitor can accept.
    However if you want the register controls to match what the CoCo-3 does and something that can support multiple modes including text and scan line replication and CRTC stuff dynamically, then that adds a lot more complexity but could likely be done with a single video COG IMO. The P2 will support 1/2/4bpp quite easily at lower clock speeds. 200MHz is plenty for analog VGA.

  • @Rayman said:
    Here's 640x256x2bpp signaled at VESA 1280x1024 at 60 Hz

    Just does 4 color bars. Notes may actually match what it does in this one :)

    Thank you very much!
    I will have to try this, no excuses. (At the moment I was trying to find out, how the clock interupt for task switch in Os9 works. I did not find a clear description, there are several possibilities....)
    Christof

  • @Rayman said:
    Here's 640x256x2bpp signaled at VESA 1280x1024 at 60 Hz

    Just does 4 color bars. Notes may actually match what it does in this one :)

    Great!!!!
    1. It works fine on my Monitor, even with 200MHz.
    2. Even better: It is so clearly laid out and small, that I will be able to understand it. (At the very moment, I don't, because I have to look up things like xcont.)
    Less is more!

    Christof

  • hinvhinv Posts: 1,190

    @Rayman said:
    I have a driver for 2-bit color that works up to 1080p. Uses something similar to P1 graphics. Uses a tiled approach where graphics are done using memory as a tile array.

    That may be too complex for this though…

    Please refresh my memory. What was the advantage of a "tiled approach"?

    Thanks,
    Doug

  • hinvhinv Posts: 1,190
    edited 2022-09-18 09:37

    @evanh said:

    @"Christof Eb." said:

    @evanh said:
    Huh, I always assumed the TRS-80 was an 8080 based system. I never saw one in a shop so never tried to look them up.

    Yes that was astonishing for me too. For their color computers, they switched over to 6809 but the name was still trs-80. Marketing...

    Ah, right, I see - https://en.wikipedia.org/wiki/TRS-80_Color_Computer
    Interesting, it was also basis of Motorola's VideoTex terminal.

    And the first TRS-80s (before the "Color Computer" was added) had a Z-80 processor, not an 8080. The "TRS-80 Color Computer" line had the 6809 with the CoCo3 having either a 6809E or Hitachi 6309 processor...which brings up the question @"Christof Eb." do you plan on supporting some of the features of the 6309?

  • evanhevanh Posts: 13,628

    Same thing to me. Yes I know the Z80 had extensions over the 8080.

  • @hinv said:

    @Rayman said:
    I have a driver for 2-bit color that works up to 1080p. Uses something similar to P1 graphics. Uses a tiled approach where graphics are done using memory as a tile array.

    That may be too complex for this though…

    Please refresh my memory. What was the advantage of a "tiled approach"?

    Thanks,
    Doug

    It can have a subset of colors in each tile and therefore might need less memory.

  • hinvhinv Posts: 1,190
    edited 2022-09-18 09:43

    @"Christof Eb." said:

    As far as I understand, maximum Ram requirement is 2 colorbits640256=40k for graphics. I am using no external Ram. I would need an approach for a simple mind using FlexProp.... P2 is running at 200MHz. Output is a VGA-Monitor.

    Wikipedia says that the GIME chip in the CoCo3 supports a 640x192 resolution, not a 640x256...and then there is mention of a 225 rows (instead of 192) as well, but doesn't mention specifically any resolutions in the list using 225 rows. I'm confused... or the writers of that page are confused too.

  • @hinv said:

    @"Christof Eb." do you plan on supporting some of the features of the 6309?

    At the moment the status is, that in Vcc there is C-source code for HC6803 too and I think, that the emulation in C is fast enough after just smaller tweaking. Then it would be not too difficult to switch over to all of these features. The features are only usable, if there is code for them. As far as I know, the real HC6309 needs less cycles for some operations. But this does not apply for the emulation.

  • Just learned, that the format in the vga tile driver of FlexProps examples with 2 bytes per character seems to be quite similar to some modes of coco-3. So perhaps the video cog can just be restarted depending on the registers either with a direct graphics driver or with a tile driver. Things are becoming feasible... Thanks to all of you!

Sign In or Register to comment.