Shop OBEX P1 Docs P2 Docs Learn Events
Tetris in 1080p VGA with music and sound - Page 2 — Parallax Forums

Tetris in 1080p VGA with music and sound

2»

Comments

  • Ahle2Ahle2 Posts: 1,178

    Ok, I see...

  • pik33pik33 Posts: 2,350

    A good piece of code :)

  • pik33pik33 Posts: 2,350
    edited 2021-10-20 18:20

    As I can remember, I run this Tetris several months ago. Now I cannot. I have a serial terminal with text mode tetris working, but no VGA video and no audio. What has changed? or what I forgot? ....

    Edit: something has changed in Flexprop. It is SimpleSound which doesn't work when compiled using new Flexprop. I found Flexprop 5.3.1 and compiled the SimpleSound: it works. It also works in Propeller Tool but this cannot compile C code.
    So now I will try to compile all Tetris using 5.3.1 and check if it works.

  • RaymanRayman Posts: 13,894

    Looks like the clock is not being set right...
    Staying at 160 MHz instead of going to 297 MHz...

    This use to be how to set the clock (in platform.h):
    enum { _clkfreq= 297000000};

  • RaymanRayman Posts: 13,894

    Tried setting the clock a different way in the attached and seems to work...

    c
    c
    14K
  • pik33pik33 Posts: 2,350
    edited 2021-10-20 20:17

    No success at this moment. I managed to get audio out of this tetris, using 5.3.1 compiler, but video tells "unsupported" on both my monitors
    Also, compiling with 5.9.3 gives no audio... 5.9.3 cannot compile SimpleSound
    And I remember Tetris worked ...

    Can you upload a full source zip?

    Which version of Flexprop did you use to compile?


    I wanted to show this to my friend, a new P2 user and... he has bad and good luck: bad was the HDMI accesory board had shorted HDMI pins (too much solder). Good: As I also received (earlier) a HDMI board with pins shorted, I know this may be a problem and after several minutes we repaired this and we could run the spiral demo (which caused instant wow effect)

    Parallax: check the quality of these boards! 2 of 3 HDMI boards we bought (Mouser Poland) were bad - or do they sell fake boards instead of original?

    Then, after this HDMI spiral wow effect, I wanted to show him Tetris... no luck. Maybe tomorrow :)

  • RaymanRayman Posts: 13,894

    @pik33 Can you try this with the original version?

    In platform.h, move the clkfreq enum up to before the heap enum, like this:

    #include "propeller2.h"
    enum { _clkfreq= 297000000};
    
    //override the default heapsize
    enum { heapsize = 8000 };
    

    The terminal window should flash the clock frequency when it starts...

  • pik33pik33 Posts: 2,350

    Yes, this solved the video problem and I have a picture now. But for audio to work I still had to use old Flexprop.

    Now I have the game working.

  • RaymanRayman Posts: 13,894
    edited 2021-10-20 21:02

    Ok, maybe we need to do something like this:

    enum { _clkfreq= 297000000, heapsize = 8000 };

    Looks like only one line of enum works with new versions... I imagine this will be fixed in next FlexProp release.

  • pik33pik33 Posts: 2,350

    Simple Sound doesn't work with Flexprop 5.5.1 or higher even if compiled standalone, without any C code, pure spin, pasm and clkfreq in con section. The code is not so simple to find what construction/operator/etc is compiled differently. Maybe I will try to compile it using both versions anc compare the assembly output.

  • RaymanRayman Posts: 13,894

    I'm seeing this too... Works with 5.5.0 but not above...

  • Ahle2Ahle2 Posts: 1,178

    I did a comparison between 5.5.0 and 5.5.1 and much of the generated code is identical between them. There are 3 different objects in the simpleSound suite, but all generated differencies are found in the small top wrapper object (simpleSound.spin2). It seems like the pointer arithmetic goes "haywire" and the "objptr" pointer gets incremented/decremented completely different between the version. Very interesting that this only affects the top object and nothing else.

    Btw, it still works perfectly in the latest version of Propeller Tool after making sure that no identifier is more than 30 characters in length.

  • @Ahle2 said:
    I did a comparison between 5.5.0 and 5.5.1 and much of the generated code is identical between them. There are 3 different objects in the simpleSound suite, but all generated differencies are found in the small top wrapper object (simpleSound.spin2). It seems like the pointer arithmetic goes "haywire" and the "objptr" pointer gets incremented/decremented completely different between the version. Very interesting that this only affects the top object and nothing else.

    Btw, it still works perfectly in the latest version of Propeller Tool after making sure that no identifier is more than 30 characters in length.

    Well yeah, when the variable order changes the instructions modifying objptr will. IIRC the codegen emits sequences like

    add objptr,#123
    call #some_instance_method ' Or member variable R/W
    sub objptr,#123
    

    and then the optimizer folds away redundant instructions. Not sure how that could go so awry.

    I'd look deeper into it but I'm currently busy procrastinating on other things >.<

  • Ahle2Ahle2 Posts: 1,178
    edited 2021-10-26 20:01

    Lol, I'm so off that I didn't even know that the real discussion was in the FlexProp thread! :lol:
    As usual these days I don't have a clue whats going on here in Propeller-land and the world keeps spinning anyway. I feel like a little ant in a haystack.

    I wish I could be as active and dedicated as before, because the P2 is fantastic. :disappointed: But I love seeing that things I made still gets appriciated; That really warms my heart! :smiley:

  • Wuerfel_21Wuerfel_21 Posts: 4,501
    edited 2021-10-27 11:42

    Seems a new flexspin commit has landed that presumably fixes the variable order thing properly?


    @Ahle2 said:
    As usual these days I don't have a clue whats going on here in Propeller-land and the world keeps spinning anyway. I feel like a little ant in a haystack.

    Don't worry, my game still isn't done (currently it's the story writing again. Dang writing. Is hard.) :P which means you're still in the present and haven't slipped into far-future land yet.

Sign In or Register to comment.