Shop OBEX P1 Docs P2 Docs Learn Events
Spin Tools IDE - Page 25 — Parallax Forums

Spin Tools IDE

12021222325

Comments

  • JonnyMacJonnyMac Posts: 9,408
    edited 2025-06-21 18:43

    My mistake, Marco -- I didn't look closely enough to see that "on" was part of a string, not a command. Sorry.

  • ersmithersmith Posts: 6,197

    @Rayman said:
    @macca That looks interesting... The debug terminal thing doesn't work with flexprop, all debug seems to go to same window, so must be some magic to make it work in Spin Tools IDE...

    The debug terminal is one of the few debug windows that does work with flexprop, see for example the flexprop/samples/debug/debug_tex.spin2 example. The magic that all of the IDEs use to redirect output is the backtick TERM command. WIthout that everything just goes to the default serial window.

    (You have to be using one of the flexprop internal terminal emulators for this to work; the external terminal emulators do their own thing and it's up to them how they handle backtick debug commands, but I have yet to see one that parses them :) ).

  • RaymanRayman Posts: 15,454

    Ok @ersmith guess should try that out.
    But don’t really have a problem with either of these gui. It’s just prop tool that doesn’t have an automatic terminal window…

  • wummiwummi Posts: 103

    @macca said:
    Released version 0.48.0

    I tested the new version and all the problems disappeared.
    Now I can compile all my projects and run them all.
    Thank you macca for your work.

    On MacOS I found some GUI issues:

  • maccamacca Posts: 902

    @wummi said:
    I tested the new version and all the problems disappeared.
    Now I can compile all my projects and run them all.

    Excellent!

    On MacOS I found some GUI issues:

    Yes, white on light-gray isn't much readable... I'll try to fix these issue for the next release.

  • JonnyMacJonnyMac Posts: 9,408
    edited 2025-06-23 18:21

    I updated my jm_debug_term object to allow the use of arbitrary colors that are available in Spin Tools 0.48.1. Note that when changing the foreground or background you modify color set 0, though it's not likely that a practical app would mix the use of the default color sets with arbitrary colors.

    If we could load the old IBM character font we could have text output like on the early IBM PCs and clones! :D

    Hopefully, @cgracey will add the ability to change the foreground and background colors in PNut. Would also be nice if zstr() worked in the debug terminal window, too.

  • RaymanRayman Posts: 15,454
    edited 2025-08-05 19:52

    @macca Just downloaded latest version to see if could compile with FlexProp as compiler...

    But, there's no "Tools" option. Is that gone in Windows, or does something need to be done to enable it?

    Oops, did old version by accident..

  • RaymanRayman Posts: 15,454
    edited 2025-08-05 20:02

    Ok, I can compile with FlexSpin from inside, but can't actually change what the "Upload to Ram" button does, right?
    Guess need to also add loadp2 as an external tool so can upload what FlexSpin makes, right?

  • JonnyMacJonnyMac Posts: 9,408
    edited 2025-08-05 21:11

    but can't actually change what the "Upload to Ram" button does, right?

    ATM, there is no way to modify the F10 and F11 buttons (they use the internal compiler and loader). I asked.

    Guess need to also add loadp2 as an external tool so can upload what FlexSpin makes, right?

    Yes. I did that with PNut.

  • maccamacca Posts: 902

    @Rayman said:
    Ok, I can compile with FlexSpin from inside, but can't actually change what the "Upload to Ram" button does, right?
    Guess need to also add loadp2 as an external tool so can upload what FlexSpin makes, right?

    Right.

    The external tools are not really meant to replace the internal compiler and uploader, and I don't have plans to allow to replace them with external programs, there are already other IDEs for that like VisualStudio.
    External tools are meant to run custom tools/scripts needed by the project. Using PNut or flexspin or whatever other compiler is meant as a "failsafe" in case the internal compiler doesn't produce the correct binary (in which case it would be better to report the issue) or some features are not yet implemented. Also may be a way to test compatibility with other compilers (Spin Tools may compile sources that other compilers don't accept).

    The internal compiler seems to be quite good at the moment, other than the above reasons, I don't see the need to use an external compiler.
    If there are issues, or suspects that something doesn't work right, please report them and I'll check and fix them as soon as possible.

  • @macca said:
    Does anyone uses or expects to use the IDE with Windows versions older than 10 (like Windows 7 or 8) ?
    The current version works on Windows 7 (hopefully also on 8 but never tested) however the latest updates to SWT breaks the compatibility and supports only Windows 10/11.

    My main PC for development has W10 but I also have a lot of older PCs for the test benches and production. For example, the software for my P&P machine requires XP. It is essential that those PCs are still able to load code to propeller boards. But that can always be done with some DOS script. I don't need to write and compile code with the IDE, there.

  • RaymanRayman Posts: 15,454

    @macca thanks. My problem is that spin2 with pasm2 doesn’t do pasm2 calls to hubexec pasm2 correctly. Appears that only Flexprop can get the addressing right…

  • maccamacca Posts: 902

    @ManAtWork said:

    @macca said:
    Does anyone uses or expects to use the IDE with Windows versions older than 10 (like Windows 7 or 8) ?
    The current version works on Windows 7 (hopefully also on 8 but never tested) however the latest updates to SWT breaks the compatibility and supports only Windows 10/11.

    My main PC for development has W10 but I also have a lot of older PCs for the test benches and production. For example, the software for my P&P machine requires XP. It is essential that those PCs are still able to load code to propeller boards. But that can always be done with some DOS script. I don't need to write and compile code with the IDE, there.

    Spin Tools has a command-line compiler (spinc) that doesn't use the UI so it will be compatible to any operating system that supports the Java runtime, however since it is 64-bits only, it won't work on any OS that is still 32-bit. To only load code from older OS I think it is better to use a stand-alone loader like loadp2 or propeller-load that can be compiled to native executable.

  • maccamacca Posts: 902

    @Rayman said:
    @macca thanks. My problem is that spin2 with pasm2 doesn’t do pasm2 calls to hubexec pasm2 correctly. Appears that only Flexprop can get the addressing right…

    A short example ?

    If a new feature or a fix is needed I can work on it.

  • RaymanRayman Posts: 15,454

    @macca there’s a long example at end of 90s 3d thread posted yesterday.

  • maccamacca Posts: 902

    @Rayman said:
    @macca there’s a long example at end of 90s 3d thread posted yesterday.

    This short example should work:

    PUB start()
    
        coginit(COGEXEC_NEW, @MainEntry, 0)
    
        repeat
    
    DAT
    
                    org     $000
    
    MainEntry
    
    MainLoop
                   'Fill offscreen buffer
                    'debug("B")
                    'call    #@Wait1msSub
                    loc     pb, #@Wait1msSub - @MainEntry
                    add     pb, ptrb
                    call    pb
                    'debug("A")
                    jmp     #MainLoop
    
    tx_cnt          long    0
    
                    orgh
    
    Wait1msSub      'wait one milli second
    
                    drvnot  #56
                    getct   tx_cnt                                  'get initial CNT
                    addct1  tx_cnt, ##_CLKFREQ/2                    'make initial CT1 target
                    waitct1                                         'wait for CT1 target
                    ret
    

    I have increased the delay to see the led blinking.
    It is a bit annoying and you need to preserve the initial value of ptrb somewhere, but the use of loc is the standard way to do these things.

    With Spin Tools IDE, also this syntax should work:

                    call    #\@@Wait1msSub
    

    The @@ prefix takes the hub-absolute address. Not sure if it is compatible with PNut or flexspin.

    BTW, seems there is an issue with the trunc operator, will look at it.

  • @macca said:
    With Spin Tools IDE, also this syntax should work:

                    call    #\@@Wait1msSub
    

    The @@ prefix takes the hub-absolute address. Not sure if it is compatible with PNut or flexspin.

    >

    Flexspin would use the triple @@@ for this, PNut doesn't have it

  • ersmithersmith Posts: 6,197

    @macca said:
    With Spin Tools IDE, also this syntax should work:

                    call    #\@@Wait1msSub
    

    The @@ prefix takes the hub-absolute address. Not sure if it is compatible with PNut or flexspin.

    @@ has a meaning already in Spin and Spin2, so in flexspin I used @@@ for absolute address (similar to bstc and some other P1 compilers).

  • maccamacca Posts: 902

    @Wuerfel_21 said:

    @macca said:
    With Spin Tools IDE, also this syntax should work:

                    call    #\@@Wait1msSub
    

    The @@ prefix takes the hub-absolute address. Not sure if it is compatible with PNut or flexspin.

    >

    Flexspin would use the triple @@@ for this, PNut doesn't have it

    Actually, the documentation say this:

    Symbols that precede data and PASM instructions resolve to addresses

    • In Spin2+PASM programs, hub addresses are relative to the start of the object and can be referenced as follows:
      • 'SymbolName' will return the data at the symbol, in accordance with its size (byte/word/long).
      • '@SymbolName' will return the address of the data.
      • '@@SymbolName' will convert an '@Symbol' in the data to an absolute address (see "DAT Data Pointers")

    Maybe I have misinterpreted it, I think the actual use by PNut is a bit different, but at the moment I don't remember.

  • The @@ operator adds the runtime PBASE offset to an object-relative address. It is only available at runtime and @@AnActualLabel is not ever a useful thing (unless defined like AnActualLabel long @SomewhereElse)

  • RaymanRayman Posts: 15,454

    Thanks @macca
    Think remember this ptrb thing now.

    Maybe one could use #define to make it work for both flexspin and spin tools ide?

    That would be convenient…

    Have to see if there’s an easy solution.
    Don’t really want to add two extra instructions to every call…

  • RaymanRayman Posts: 15,454

    @macca Think seeing something else that may have tripped me up...

    Seems that FlexProp knows if the currently open file has been modified by another app and will reload it before compiling.
    Doesn't seems that Spin Tools IDE does that. Or, maybe that's an option somewhere?

  • RaymanRayman Posts: 15,454
    edited 2025-08-06 18:10

    @macca It appears that "\@@@" works in both FlexProp and Spin Tools IDE.
    Can that be?

    It shows as an error, but seems to compile and run anyway...

    Wrong about that. Seems need to save sub object files for them to take effect. That's different from Prop Tool...

  • RaymanRayman Posts: 15,454

    @macca A related issue is how to address data of a table stored in HUB RAM from hubexec and/or cogexec.

    Guessing that this isn't going to work here, right?

                    subs    f1,fPlayerY
                    mov     ptra,castarc
                    shl     ptra,#2
                    add     ptra,##@fITanTable
                    rdlong  f2,ptra
    
  • maccamacca Posts: 902

    @Rayman said:
    @macca Think seeing something else that may have tripped me up...

    Seems that FlexProp knows if the currently open file has been modified by another app and will reload it before compiling.
    Doesn't seems that Spin Tools IDE does that. Or, maybe that's an option somewhere?

    No that feature it not yet implemented, changes from external tools are not read back in the editor.

    @macca It appears that "\@@@" works in both FlexProp and Spin Tools IDE.
    Can that be?
    Wrong about that. Seems need to save sub object files for them to take effect. That's different from Prop Tool...

    Files don't need to be saved to compile, the compiler uses the loaded source before the looking for a file on disk.
    Don't know why it compiled for your, maybe some issues with the files names (case sensitivity maybe ?).

    @Rayman said:
    @macca A related issue is how to address data of a table stored in HUB RAM from hubexec and/or cogexec.

    Guessing that this isn't going to work here, right?

                    subs    f1,fPlayerY
                    mov     ptra,castarc
                    shl     ptra,#2
                    add     ptra,##@fITanTable
                    rdlong  f2,ptra
    

    The concept is the same, use loc pa, #@fITanTable - @cogbegin, then add pa, ptrb to get the hub address, then you can do all offset-related things.
    You can use pa, pb, ptra and ptrb with loc, but not "regular" registers, it is really a pain but it is the only compatible way, unless you want to use the @@ syntax.

  • ke4pjwke4pjw Posts: 1,201

    I just got a new computer. Downloaded Spin Tools IDE and didn't have to install Java. I'm in! Thanks @macca !

  • maccamacca Posts: 902

    @Wuerfel_21 said:
    The @@ operator adds the runtime PBASE offset to an object-relative address. It is only available at runtime and @@AnActualLabel is not ever a useful thing (unless defined like AnActualLabel long @SomewhereElse)

    Do you have examples that uses the @@ syntax ? The only source I found is parser.spin2 in the PNut package and seems that it compiles fine.
    PBASE+object address is the hub address, if I'm not wrong is exactly what I did, I think I only allowed to use in places where PNut doesn't allow.

    I can add @@@ to be compatible with flexspin.

  • Check the Spin1 manual, it's a feature carried over.

  • RaymanRayman Posts: 15,454

    I can add @@@ to be compatible with flexspin.

    That sounds great! Also makes it painfully obvious what it means…

  • ersmithersmith Posts: 6,197

    @Rayman said:

    I can add @@@ to be compatible with flexspin.

    That sounds great! Also makes it painfully obvious what it means…

    Yeah, Brad of bst fame conceived of it as being @@ + @, which is what you need in Spin1 to get an absolute address (@@ for the object base and @ as the offset within the object).

    Thanks for adding this @macca. Now if we can just get @cgracey and @"Stephen Moraco" to sign up for it too :).

Sign In or Register to comment.