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

Spin Tools IDE

1679111214

Comments

  • Macca I have a trouble with CONSTANT in P1

    sock.Send(@nbNameQueryReq, constant(@enbNameQueryReq - @nbNameQueryReq))

  • Wuerfel_21Wuerfel_21 Posts: 4,522
    edited 2023-06-15 20:59

    I don't think that normally works (except in flexspin which has a specific hack for this exact thing).

    (It should be easy to add though)

  • JonnyMacJonnyMac Posts: 8,937
    edited 2023-06-16 14:11

    I just checked -- that syntax does work in Propeller Tool. Honestly, I didn't think it would.

    Update: that syntax only works with addresses from a DAT table.

  • evanhevanh Posts: 15,202

    Huh, I didn't know constant was even a keyword.

  • maccamacca Posts: 725
    edited 2023-06-16 05:52

    @Ltech said:
    Macca I have a trouble with CONSTANT in P1

    sock.Send(@nbNameQueryReq, constant(@enbNameQueryReq - @nbNameQueryReq))

    Ok... maybe elaborate a bit ?
    What's wrong ? Maybe one of those variables is not a constant ? How are declared ?

    BTW, the constant keyword, while supported, is not needed with Spin Tools, constants are automatically folded when possible.
    Actually, not in all cases, complete constant folding will be in the next release.

  • I see, this was an old P1 code.
    Wen I remove the constant key words in the files, and flash with spin tools it works.
    So forget about this, if spin tools fold those automatically

    Thank-you

    And I still love spin tools. On Windows 11 at work, and OSX at home, it feels like BST long time ago

  • JonnyMacJonnyMac Posts: 8,937
    edited 2023-06-16 14:11

    What's wrong? Maybe one of those variables is not a constant? How are declared?

    I did a test in Propeller Tool. If the addresses are for elements of a DAT table, CONSTANT works in an expression; if the addresses are for variables, it does not.

  • @Ltech said:
    I see, this was an old P1 code.
    Wen I remove the constant key words in the files, and flash with spin tools it works.
    So forget about this, if spin tools fold those automatically

    @JonnyMac said:
    I did a test in Propeller Tool. If the addresses are for elements of a DAT table, CONSTANT works in an expression; if the addresses are for variables, it does not.

    I suspected that was the case.

    I found that the results are a bit different when using the constant keyword:

    @label is the memory address resulting from adding the PBASE to the object-relative address, since PBASE is not known, it can't be a constant.
    constant(@label) is the object-relative address (no PBASE is added), this may be considered a constant.

    So @label is different from constant(@label). If used to calculate the size of a DAT block @end - @start is equal to constant(@end - @start), I have changed the compiler to handle that. Still the @end - @start expression is not constant and not automatically folded.

    One day I'll review all these address expressions and turn them to constants since the compiler knows the absolute hub address at compile time.

  • Released version 0.30.0

    Introducing the dark mode theme:

    This is a first implementation to support custom themes, for now it is all hardcoded because I found that despide the years of "dark mode everywhere" hype, the OS support is still a bit limited on this matter (and with SWT some things are not easy to change), and more or less everything must be done at the application level on its own. Linux is a bit of an exception because is smart enough to propagate the system-wide setting to the application (not Windows).

    Anyway, in the preferences dialog there is a theme setting with System (uses the system-selected theme), Dark (dark mode, regardless of the OS setting), Light (light mode, regardless of the OS setting).
    When changing the theme you can see a sort of preview but it requires to restart the application because some things are activated at startup and can't be changed (SWT or OS limitation, not sure).

    I'm sure there are few spots where the theme is not applied correctly, and as usual I don't how it will work on MacOS, hope it isn't too bad.
    Let me know what you think.

    Oter things:

    • Implemented the "align" edit mode, similar to Propeller Tools. Hope to have implemented it correctly.
    • Implemented the DEBUG_DISABLE constant to disable the debug statement for selected objects.
    • Spin1 constants are automatically folded when possible, no need to use the constant keyword
    • Implemented default method parameters (borrowed from flexspin :* )
    • Few other fixes
  • Wuerfel_21Wuerfel_21 Posts: 4,522
    edited 2023-06-19 13:48

    @macca said:
    This is a first implementation to support custom themes, for now it is all hardcoded because I found that despide the years of "dark mode everywhere" hype, the OS support is still a bit limited on this matter (and with SWT some things are not easy to change), and more or less everything must be done at the application level on its own. Linux is a bit of an exception because is smart enough to propagate the system-wide setting to the application (not Windows).

    Indeed, is smart enough to pull in the system theme and everything.

    However, if you change it while the program is running... (some people like their themes to auto-switch depending on time of day. Not me though, so don't take this as an explicit request :) ).

    (EDIT: To clarify, changing the system theme. Changing the theme in the actual application preferences actually seems to work decently well)


    Also, there's two issues I've noticed related to opening files:
    - Drag 'n Drop doesn't work
    - The file chooser defaults to "C Files" every time, such that you can't see Spin files. (This is with GTK_USE_PORTAL=1 set to avoid ever having my door darkened by the awful GTK built-in chooser. It "works" when I disable portals.)

  • @Wuerfel_21 said:
    Indeed, is smart enough to pull in the system theme and everything.
    However, if you change it while the program is running... (some people like their themes to auto-switch depending on time of day. Not me though, so don't take this as an explicit request :) ).

    Yes, because some things are set at startup by SWT and can't be changed. It doesn't even gets notified when the system theme changes (despite there is a notification that should work for that...).

    Also, there's two issues I've noticed related to opening files:
    - Drag 'n Drop doesn't work
    - The file chooser defaults to "C Files" every time, such that you can't see Spin files. (This is with GTK_USE_PORTAL=1 set to avoid ever having my door darkened by the awful GTK built-in chooser. It "works" when I disable portals.)

    That's weird, the dialog is set to "All Source Files" by default and the setting is not saved.
    Maybe an inconsistency with a specific desktop environment ?
    I'm using Ubuntu 22.04 LTS with Gnome and all GTK_USE_PORTAL does is open a fullscreen file selector dialog instead of the usual.

  • GTK_USE_PORTAL is supposed to bring up the system's native file chooser. If you're on a Gnome system, yeah you probably don't see a big difference. I'm on Kubuntu 23.04, the land of the KDE/Dolphin file chooser. If you want to play with it and have some disk space you should be able to apt install kde-plasma-desktop xdg-desktop-portal-kde and log into a minimal KDE session on any Ubuntu flavor (in theory, in practice it probably uninstalls your kernel or something). Or just install in a VM or something sane like that.

    My best guess is that setFilterIndex gets lost somewhere and it uses the first filter defined instead, so the all files filter might need to be moved to the first position.

  • Dark mode on OSX High sierra works

    On windows 11 the version number don't follow on about screen inside the program It stick on 0.23

  • JonnyMacJonnyMac Posts: 8,937
    edited 2023-06-19 17:27

    The line highlight color seems to be the dark version of that section type, but I sometimes shake my head when clicking on a warning because the highlighted line can be the same color as the previous section:

    Would it be possible for the line highlight to be the darker of the two choices for the section type so that the line always stands out?

  • @Ltech said:
    Dark mode on OSX High sierra works

    Very good!

    On windows 11 the version number don't follow on about screen inside the program It stick on 0.23

    I'm fairly sure that the version number is correct, all builds are generated from the same source. Make sure you are not starting an old version, if you upgrade by overwriting an existing folder you may have several spin-tools-0.xx.x.jar files for each version and it is possible that the java runtime picks the wrong one, delete the old files, or unpack to a new folder.

  • @JonnyMac said:
    The line highlight color seems to be the dark version of that section type, but I sometimes shake my head when clicking on a warning because the highlighted line can be the same color as the previous section:
    Would it be possible for the line highlight to be the darker of the two choices for the section type so that the line always stands out?

    Ah... I think I never realized that the row highlight is the same as one of the sections... the highlight is calculated by darkening a bit the section background and incidentally I have used the same amount for the alternating sections... I'll fix it.

  • JonnyMacJonnyMac Posts: 8,937
    edited 2023-07-10 17:09

    I may have reported this earlier, but it just popped up again in another program, so I don't know if it's been corrected. I am running version 0.30.0.

  • JonnyMacJonnyMac Posts: 8,937
    edited 2023-07-10 20:25

    I have several files that include comments using the special characters of the Parallax font, so I decided to switch the editor to that font and give it a try. Things went sideways when it encountered a special character.

    This certainly isn't a game-stopper, but with the # of files out there using those special characters, it would be nice if using Parallax font in Spin Tools allowed us to see them.

  • This may be an encoding issue. I see this a lot when opening files created in propeller tool on my mac.

  • Would it be possible to add a Clear button to the terminal window (like in PST)?

  • When the terminal is in PST mode, the CLEAR EOL (11) and CLEAR DOWN (12) don't work as they do in PST.

  • @JonnyMac said:
    I have several files that include comments using the special characters of the Parallax font, so I decided to switch the editor to that font and give it a try. Things went sideways when it encountered a special character.
    This certainly isn't a game-stopper, but with the # of files out there using those special characters, it would be nice if using Parallax font in Spin Tools allowed us to see them.

    Looks an encoding issue with Windows, it defaults to Windows-1252 or something, instead of UTF-8), the following is (I think) the same file with Linux and the default font:

    When the terminal is in PST mode, the CLEAR EOL (11) and CLEAR DOWN (12) don't work as they do in PST.

    Ops... those are not implemented at all... will fix soon.

  • JonnyMacJonnyMac Posts: 8,937
    edited 2023-07-11 16:34

    Hmmm... If I set the font in Windows Notepad to Parallax and open a file, it will display correctly. That said, the Open dialog has an encoding option, though Auto Detect always seems to work.

    Follow-up: I enabled the status bar in Notepad to show the encoding.

    I did a Save As to change the file to UTF-8. It still displays correctly in Notepad, but not in Propeller Tool nor Spin Tools.

    Again, this is not a show-stopper, but it would be nice to have it working across all platforms.

  • @JonnyMac said:
    Hmmm... If I set the font in Windows Notepad to Parallax and open a file, it will display correctly. That said, the Open dialog has an encoding option, though Auto Detect always seems to work.

    Follow-up: I enabled the status bar in Notepad to show the encoding.

    I did a Save As to change the file to UTF-8. It still displays correctly in Notepad, but not in Propeller Tool nor Spin Tools.

    The editor should already convert from UTF-16 to UTF-8, however Java on Windows defaults to Windows-1252 so the result doesn't display correctly.
    I have fixed that by setting the default encoding to UTF-8. Will do a release tomorrow.

  • Thank you, Marco. As you can probably tell, I'm doing a lot of work with ST getting ready for my presentation next week. I hope these comments are helpful.

  • Released version 0.30.1

    • Fixed characters encoding on Windows (UTF-8).
    • Added missing PST codes and clear button
    • Fixed @CLKFREQ and @CLKMODE pointer variables
    • Slightly darkened the cursor line background
  • JonnyMacJonnyMac Posts: 8,937
    edited 2023-07-12 14:53

    Thank you, Marco.

    Would you consider adding the File browser visible paths

    ...to the middle section of the Open From... flyout menu?

    I find it easier to locate a specific file from the Open dialog than from the file browser, especially when I can use the Date Modified attribute.

  • I never considered using @clkfreq before, so I'm not sure what you intended.

  • @JonnyMac said:
    I never considered using @clkfreq before, so I'm not sure what you intended.

    This most likely is for the issue I reported on Github Issues where I accessed CLKFREQ from PASM2 and an update broke it. E.g. the following would resolve into an error:

    rdlong r0, #@clkfreq
    

    Though looks like it is resolved for PASM2 but the address isn't resolvable from Spin 2. Not sure why you'd need the address in that context but eh... some people do things... strange (like me).

    Macca,
    I've been keeping my issues simple and not responding unnecessarily, but thanks for helping out with the issues reported. I've really been enjoying the updates as of late, between all the IRL distractions.

  • Though looks like it is resolved for PASM2 but the address isn't resolvable from Spin 2

    Okay, that makes sense, and no need to deal with that in Spin2.

Sign In or Register to comment.