Shop OBEX P1 Docs P2 Docs Learn Events
QuadView 4-in1 artifact color driver — Parallax Forums

QuadView 4-in1 artifact color driver

This discussion was created from comments split from: P2 Arc8de Project.
«1

Comments

  • Wuerfel_21Wuerfel_21 Posts: 5,053
    edited 2021-09-25 16:43

    Here we go, I present the QuadView video driver. Runs 4 composite video displays at 704x240 resolution in monochrome or artifact color. Can also do 8 monitors with 2 cogs. The example program I included will run up to 8 displays, but the second four are just repeats because I'm lazy. Just set the VIDEO_X constants to the pins you want, it will try to map them onto the available DAC channels.

    I've also included a little script that will convert PNGs into raw artifact color buffers.

    I'll write some more about this later, but too lazy right now.

  • That's cool @Wuerfel_21 :D

    Not sure if you can interleave the CPU with interrupts, if it's using xcode. I'm sure Chip could chime in, as he'd know best if it could be done.

  • There's some spare time in the video cogs during VBLANK, that could be used to some good. But really, the point is to be able to have the other cogs do the rendering and logic without being interrupted / prevented from using the FIFO/hubexec.

    Also, I just noticed I bungled the pin%4==1 channel, here's that fixed.

  • Wuerfel_21Wuerfel_21 Posts: 5,053
    edited 2021-09-25 22:22

    Here's a slight modification that uses 4bpp instead of 8bpp. Slightly less-than ideal because only nibbles 5 throug F are actually useful values, but the quality is pretty OK still. This can of course fit 6 stills in RAM, so hey, this demo actually does 8 distinct displays! Obviously not very useful if one is rendering real-time graphics, but interesting still.

  • roglohrogloh Posts: 5,786
    edited 2021-09-26 02:28

    @Wuerfel_21
    Hoping to try this out but what toolchain are you using to build your code? It failed when I first tried with flexspin (an older version) but then even the lastest flexspin doesn't seem to like it...was this only for PropTool?

    RLs-MacBook-Pro:quadview_preview1_hotfix roger$ ~/Code/spin2cpp/build/flexspin -2 quadview_test.spin2 
    Propeller Spin/PASM Compiler 'FlexSpin' (c) 2011-2021 Total Spectrum Software Inc.
    Version 5.9.3-beta-v5.9.2-33-g35412c83 Compiled on: Sep 26 2021
    quadview_test.spin2
    |-QuadView.spin2
    quadview_test.spin2:192: error: syntax error, unexpected '[', expecting end of line or ','
    quadview_test.spin2:194: error: syntax error, unexpected '[', expecting end of line or ','
    

    I can get it to compile by hardcoding with 72 instead of qv.LEVEL_BLANKING on the offending lines.
    Interesting flickering video effect I'm seeing on the 4th channel BTW. Not sure how much is by design or an artifact. It's very impressive out of a single COG.

  • @rogloh said:
    @Wuerfel_21
    Hoping to try this out but what toolchain are you using to build your code? It failed when I first tried with flexspin (an older version) but then even the lastest flexspin doesn't seem to like it...was this only for PropTool?

    RLs-MacBook-Pro:quadview_preview1_hotfix roger$ ~/Code/spin2cpp/build/flexspin -2 quadview_test.spin2 
    Propeller Spin/PASM Compiler 'FlexSpin' (c) 2011-2021 Total Spectrum Software Inc.
    Version 5.9.3-beta-v5.9.2-33-g35412c83 Compiled on: Sep 26 2021
    quadview_test.spin2
    |-QuadView.spin2
    quadview_test.spin2:192: error: syntax error, unexpected '[', expecting end of line or ','
    quadview_test.spin2:194: error: syntax error, unexpected '[', expecting end of line or ','
    

    I can get it to compile by hardcoding with 72 instead of qv.LEVEL_BLANKING on the offending lines.
    Interesting flickering video effect I'm seeing on the 4th channel BTW. Not sure how much is by design or an artifact. It's very impressive out of a single COG.

    I've only really tried it in PropTool, flexspin is currently just crashing for me. There shouldn't be any flickering, just some still images and some effects rendered by other cogs.

  • roglohrogloh Posts: 5,786
    edited 2021-09-26 07:57

    No there is some serious flickering when compiled with flexspin - seems like sync issues or something picky with my Dell monitor NTSC input although the first 3 channel outputs are stable. When I fire up my Windows machine next time I'll try it with PropTool.

  • Wuerfel_21Wuerfel_21 Posts: 5,053
    edited 2021-09-26 08:27

    @rogloh said:
    No there is some serious flickering when compiled with flexspin - seems like sync issues or something picky with my Dell monitor NTSC input although the first 3 channel outputs are stable. When I fire up my Windows machine next time I'll try it with PropTool.

    Reverted to the latest flex release binaries and yeah, the alpha blending thing isn't properly synchronizing with the video cog. Odd, since that's just plain assembly.

  • ColeyColey Posts: 1,110

    That's really neat @Wuerfel_21, nice work!

  • @Coley said:
    That's really neat @Wuerfel_21, nice work!

    Cool. Have you tried plugging into the other slots? And the 4bpp variant?

    Also, that's some dank black crushing on those displays. Should probably adjust brightness/contrast a bit.

  • @rogloh said:

    quadview_test.spin2:192: error: syntax error, unexpected '[', expecting end of line or ','
    quadview_test.spin2:194: error: syntax error, unexpected '[', expecting end of line or ','
    

    This is a rather fundamental misfeature (IMO) of Spin2 syntax: something like qv.LEVEL_BLANKING[N] may be parsed either as (qv.LEVEL_BLANKING)[N] or as qv.(LEVEL_BLANKING[N]). The former is the appropriate parse if LEVEL_BLANKING is a constant and we're compiling an assembly statement, but the latter is what is desired for arrays, labels, and variables, and hence it's what FlexSpin picks. For now the work-around is to insert explicit parentheses.

  • @ersmith said:

    @rogloh said:

    quadview_test.spin2:192: error: syntax error, unexpected '[', expecting end of line or ','
    quadview_test.spin2:194: error: syntax error, unexpected '[', expecting end of line or ','
    

    This is a rather fundamental misfeature (IMO) of Spin2 syntax: something like qv.LEVEL_BLANKING[N] may be parsed either as (qv.LEVEL_BLANKING)[N] or as qv.(LEVEL_BLANKING[N]). The former is the appropriate parse if LEVEL_BLANKING is a constant and we're compiling an assembly statement, but the latter is what is desired for arrays, labels, and variables, and hence it's what FlexSpin picks. For now the work-around is to insert explicit parentheses.

    Ye, that's an old known issue. Though I don't think array syntax is ever valid in a DAT section, so I think that could be solved.

    The broken synchronization between the video cog and the alpha blend cog is weird though.

  • ColeyColey Posts: 1,110

    @Wuerfel_21 can you start another thread for this please?

    @"Moderator Monkey" Can you move the posts relating to Wuerfel_21's driver to another thread please?

  • Wuerfel_21Wuerfel_21 Posts: 5,053
    edited 2021-09-26 15:06

    @Coley said:
    @Wuerfel_21 can you start another thread for this please?

    @"Moderator Monkey" Can you move the posts relating to Wuerfel_21's driver to another thread please?

    Yeah, probably preferrable.

    Call it "QuadView 4-in-1 artifact color driver" or something

  • What are the thread post numbers that you wish me to move?

  • @Publison said:
    What are the thread post numbers that you wish me to move?

    Everything from #122 onwards, I guess

  • ColeyColey Posts: 1,110

    @Wuerfel_21 said:

    @Publison said:
    What are the thread post numbers that you wish me to move?

    Everything from #122 onwards, I guess

    Yes, that's right. Thank you.

  • PublisonPublison Posts: 12,366
    edited 2021-09-26 19:11

    Done!

  • Great display!

    What was done to stabilize artifact color?

  • Wuerfel_21Wuerfel_21 Posts: 5,053
    edited 2021-09-26 17:27

    @potatohead said:
    Great display!

    What was done to stabilize artifact color?

    Nothing in particular. The color burst has to be generated in software, so there's full-ish control over its phase.

  • Got it. The same ended up being true for P1.

    That's a great way to do it though. Will be very stable.

    Thanks for this Wuerfel_21! Will be fun and enlightening to look through.

  • Currently seeing if I can get it to do an indexed mode. Will probably need 350MHz unless I get a really good idea.

  • Yep, 8bpp paletted/indexed mode works, needs 343MHz.

  • Wuerfel_21Wuerfel_21 Posts: 5,053
    edited 2021-09-30 18:44

    Working on artifact color VJET.

    Still need to rewrite text drawing to be in color and make it handle multiple independent screens (not a big issue, since basically no state is kept in cog RAM between lines)

  • I may have gotten just a bit sidetracked...

    @Ahle2 well, now P2 really is the Amiga of microcontrollers, I guess :P

  • Wuerfel_21Wuerfel_21 Posts: 5,053
    edited 2021-10-01 00:14

    Here's the code for that - 8 screen simultaneous VJET vector graphics mayhem (though the other 7 aren't that interesting)

  • LOL, it really is. Not sure which of us said it first, but I believe it's true. (Amiga of Microcontrollers)

  • I think it was Ahle, that's why I pinged him.

    Also, this ball really is made of filled quads (the actual Amiga demo just does bitplane tricks and color cycling), so if I wanted to, I could make it squish, add a second ball, rotate it differently, change the light source, etc.

  • Oh cool!

    Well, I have my P2 setup and a nice PVM I have let sit idle for too long. Will give this a go.

    TV Video is still my favorite. Looks like you have it sorted nicely! I saw the option to alternate phase. Very nice work.

  • @potatohead said:
    Oh cool!

    Well, I have my P2 setup and a nice PVM I have let sit idle for too long. Will give this a go.

    TV Video is still my favorite. Looks like you have it sorted nicely! I saw the option to alternate phase. Very nice work.

    Oddly enough, I haven't gotten satisfactory composite video from the actual video hardware yet, neither from @rogloh's code nor Chips. Satisfactory as-in "at least as good as P1 composite".
    Part of that is an issue with the hardware design - it's really missing a low-pass filter for IQ and a notch filter for Y. Then again, P1 didn't have those either and it looks loads better. Maybe I should try re-figuring-out the CSC parameters from scratch or smth...

    S-Video is fine, oddly enough...

Sign In or Register to comment.