Shop OBEX P1 Docs P2 Docs Learn Events
Prop Tool issue with Mixed Cogexec and Hubexec — Parallax Forums

Prop Tool issue with Mixed Cogexec and Hubexec

Trying to figure out why this 2-bit tiles graphics code works with FlexProp but not Prop Tool.
The assembly is too big for the cog, so a lot of it is in hub.
Just figured out that one change makes some of it work, but have no idea why:

When I replace this hubexec call with the code it's calling, it seems to work.
But, it should produce the exact same outcome, as I see it:

                        'call     #setd2                   'set dx,dy from arg0,arg1
                        'Call to setd2 doesn't work because affects hub version of vars and not cog version?
                        mov     dx,xorigin              'set dx,dy from arg0,arg1
                        add     dx,arg0
                        mov     dy,yorigin
                        sub     dy,arg1

This is from 1080p_TileDriver_8a.spin2

Comments

  • RaymanRayman Posts: 14,632

    Same issue in PNut. Won't run at all in Spin Tools IDE and don't see why not...

  • It's possible that the DAT statements reset the orgh mode in PNut, whereas they don't in flexspin? I'm just guessing here, but you have a LOT of redundant DAT statements scattered through the assembly.

  • RaymanRayman Posts: 14,632

    @ersmith That might have something to do with it... The Prop Tool seems to have an issue with me starting a new Assembly DAT section after the first one.

    But the reason for all the DAT sections is so that I can use the "Summary" mode in Prop Tool and jump around in a large code...

    I added this part in between the cogexec and hubexec sections with some effect:

    PUB testing()
    DAT
    orgh
    testeing long 0[1000]
    
  • RaymanRayman Posts: 14,632

    May have to just drop this cogless graphics for use with Prop Tool. Can just use cogged version instead, that works.
    I think something is broke in Prop Tool, but who knows, it's kind of complex...

  • RaymanRayman Posts: 14,632

    On the bright side, I did figure out how to use "@@" in combination with "@", as described in the Spin2 docs in a way that works for both FlexProp and Prop Tool.
    This lets me define forms like this with pointers to strings and sub-objects. The @@ must be relatively new because last time I tried to make this code work with Prop Tool, there was no way to do it...

    DAT 'Form1 Resources
                  orgh
    
    Form1
                long    1              '0 top
                long    2              '1 left
                long    cols-4     '2 width
                long    rows-3     '3 height
                long    Navy        '4 border color
                long    Silver      '5 fill color
    pTitleForm1
                long    @sTitleForm1     '6 title string
                long    Yellow      '7 title text color
                long    0           '8 pointer to parent or 0 for main form
                'start of object pointer list
    
                'digital channels
    pForm1Members long
                long    @Form1GraphicA 'Data display
                long    @Form1GraphicB 'Data display
                long    @Form1GraphicC 'Data display
    
  • RaymanRayman Posts: 14,632
    edited 2023-12-29 21:58

    Was finally able to get this Mixed Signal Scope app with 1080p 2-bit graphics working with Prop Tool.
    But, had to switch away from using the cogless graphics.

    Something is horribly wrong with the cogless graphics when used with Prop Tool .
    Not sure if something with the use of an interrupt or jumping back and forth from cogexec to hubexec, but something is really wrong...

    Using the cogged graphics is fine. The cogless was kind of nice for when don't have enough cogs and don't need much graphics.
    Might take another look at it later...

    The attached is more or less working with FlexProp and Prop Tool.
    The play wav file button doesn't work at the moment, but that's nothing to do with the framework...

    This is rigged for SimpleP2++ board or with P2 Eval board with VGA on basepin 8 and USB on basepin 16

Sign In or Register to comment.