Announcement

Collapse
No announcement yet.

typo for txt_Wrap Page 31 Diablo16 Serial Environment

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

  • typo for txt_Wrap Page 31 Diablo16 Serial Environment

    The manual says the command is 0xFF0E BUT it should be 0xFFE0,

  • #2
    Thanks, for that, we will get it fixed.

    Are you typing these values in? Why not use some of the constant definitions supplied in various formats beneath the C:\Users\Public\Documents\4D Labs\Diablo Serial folder
    Mark

    Comment


    • #3
      well I'm driving this in python from a pc / uart,

      Comment


      • #4
        Right, Surely one of the files in that folder can be used?

        A quick google gives me http://code.activestate.com/recipes/...?in=user-97991

        Which suggests all you need to do is remove the ';' off the end of the line to use the Delphi constants here

        C:\Users\Public\Documents\4D Labs\Diablo Serial\Pascal\Include\Diablo_Const4DSerial.INC
        Mark

        Comment


        • #5
          ok thanks for the suggestion, but its not too bad, I am using a subset and I test each function as I go along, I also use the serial commander thingie to check everything is ok.
          ​While were on the subject is it likely more functionality will be exposed over the serial link, eg roundrects etc etc

          Comment


          • #6
            Hmm, you are the first to ask... in just over 2 years... So I guess it is not a high priority.

            I can show you how to do it yourself, at least for some 'simple' commands of which rounded rectangle would be one.

            That wont get it in Serial commander, though
            Mark

            Comment


            • #7
              Not worried about SerialCommander I have everything I need in python , but round rect would be nice, I think everybody today wants the windows metro look rather than the 3d win 95 look

              Comment


              • #8
                OK
                1. Run the code below replacing 'gfx_RoundRect' with the name of the function you are after (not you can only do functions with word/integer args) and note the values
                2. Note the number of parameters for the function and whether it has a return value (you can get this in Workshop using Ctrl-Space, or using the manual)
                3. Get a copy of the source to SPE by loading SPE and copying the program placed in C:\Users\your userid\AppData\Local\Temp called temp4D.4dg, or adding to your existing customised SPE
                4. Find the 'funcArgs' array (about line 35) and change the '255' in the line and column returned above to one higher than the number of arguments (eg for roundrec 6+1 = 7)
                5. If there is a return value change the equivalent '0' in 'funcRet' to 1.
                6. Build and load the new SPE (make sure Destination is Flash in the project tab)
                7. Test the new function, I use Terminal and 'Send Hex', eg enter ff5300100010004000400003f81f to test roundRect.
                Mark

                Comment


                • #9
                  OK Ill give it a go, I suppose I could also write a file with commands on the sd card and call the file execute technique

                  Comment


                  • #10
                    Yep, you could do it that way as well
                    Mark

                    Comment


                    • #11
                      mmm having a bit of bother here, you say run the code below, what code are you referring to?
                      I cant find out the index of the functions I want to add in the table but I have sussed that for example
                      F_gfx_TriangleFilled is -167 so at position 167 (a7) there is an 8 corresponding to the args +1. (Also from your note round rect is ff53)
                      btw the functions I would add are the round rect and gradient, so wouldn't be too much work for you guys and I'm sure they would be appreciated.
                      Last edited by Peter Kenyon; 13th February 2016, 10:05 PM.

                      Comment


                      • #12
                        WOW I managed to get round rect to work OK, now all I need is to find the magic numbers for the other commands I want

                        Comment


                        • #13
                          Even more progress, I added print(gfx_Gradient) in my spe and lo and behold a magic number appeared, we move on

                          Comment


                          • #14
                            I cant get gfx_Gradient to do anything BUT I discovered gfx_FillPattern which is very useful for graying out a screen when showing a popup, the fun continues

                            Comment


                            • #15
                              Ooops, Here's the missing code.
                              Code:
                              #platform "uLCD-35DT"
                              
                              #inherit "4DGL_16bitColours.fnc"
                              
                              func main()
                                  var i, j ;
                                  i := gfx_RoundRect ;
                                  j := ABS(i) ;
                                  print("cmd     ", [HEX4] i, "\n0 relative Line ", j / 16, "\n0 relative Col(0rel) ", j % 16) ;          // ("x1", "y1", "x2", "y2", "rad", "color");
                              
                                  repeat                      // maybe replace
                                  forever                     // this as well
                              
                              endfunc
                              Mark

                              Comment

                              Working...
                              X