Announcement

Collapse
No announcement yet.

Porting Tetris to uOLED-32028-P1_GFX2

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Porting Tetris to uOLED-32028-P1_GFX2

    I'm trying to start learning about this display. So I decided to try the tetris game from the download area.
    So far, my attempts to build it have failed.
    The first problem is that the compiler (Workshop 3) chokes on the block comment at the beginning of the file. It seems to never find the "*/" to end the comment.
    So I changed it to a bunch of one line comments using "//".

    Next, it chokes on this line in the "find_full_lines" function:

    while (x= 0)

    I haven't the faintest idea what this line is supposed to be doing. All I can guess is that it somehow got mangled when uploaded.
    Does anyone have this working?

  • #2


    Hmmmm.......if I go here......http://4d.websitetoolbox.com/post?id=3879805and open the attached 4dg file, I can view the following in Wordpad......

    [HTML]////////////////////////////////////////////////////////////////////////////////////////////////////
    // find_full_lines
    // Finds up to 4 full lines ... returns the number of full lines found. The array of lines is
    // updated with the lines found in the lines array passed to this function
    ////////////////////////////////////////////////////////////////////////////////////////////////////func find_full_lines (var lines) var found_lines;//int var line, x;
    found_lines := 0;
    line := TET_MAX_BLOCKS_Y - 1; while ( line >= 0) x := 0; while (x
    _______________
    Best Regards,
    Howard

    Comment


    • #3


      OK, the code block didn't seem to work too well, let's try a direct paste....////////////////////////////////////////////////////////////////////////////////////////////////////
      // find_full_lines
      // Finds up to 4 full lines ... returns the number of full lines found. The array of lines is
      // updated with the lines found in the lines array passed to this function
      ////////////////////////////////////////////////////////////////////////////////////////////////////func find_full_lines (var lines) var found_lines;//int var line, x;
      found_lines := 0;
      line := TET_MAX_BLOCKS_Y - 1; while ( line >= 0) x := 0; while (x
      _______________
      Best Regards,
      Howard

      Comment


      • #4


        Interesting, I had gotten the code from: http://www.4dsystems.com.au/code/index.php?node=28&id=62
        Which has the "bad" code.

        I'll try the version from the site you gave.

        Comment


        • #5


          Well, at least that one ALMOST compiles.
          It seems that Workshop 3 can't handle lines like this one:

          print("(c) 2009");

          It complains "Error: string not terminated"
          If you remove the (c) it works.

          The other problem is that that version of Tetris doesn't seem to be compatible with the 32028-P1_GFX2 display.

          Comment


          • #6
            The print("(c) 2009"); bug is fixed in the next release that will be available in the next day or so.

            Why not look in the C:\Documents and Settings\All Users\Documents\4D Labs\PICASO GFX2 folder for some demo code to try. In the \PICASO - DEMO folder you will even find a Tetris, that I believe is ready to go and is also the best version yet.
            Mark

            Comment


            • #7


              Because I didn't know there WERE any example there.
              And in Win 7, they are actually in: Desktop/Libraries/Public Documents/4D Labs

              Note: You probably need more/better README.txt files in those directories, so the newbie (like me) can actually build individual programs. Finding the dependencies was a bit of a PITA.

              Comment

              Working...
              X