Not much new on the Spin side as most of the work has been done on the C language support.
Added unused variables warnings
Implemented an experimental serial port detection, with the default being the currently selected from Tools -> Port, if a Propeller is not detected then it searches all available ports
Some general fixes (including the + unary operator)
I have dropped the version with the self-update feature. I tried to make it working for the whole distribution but it is too critical. I was already using a patched version to fix the MacOS UI thread issue, then I realized that it would be easier to make my own update framework instead of patching the existing to adapt to my needs, so for now no self updates. We will see when it is time to release the 1.0 version.
On the C language side:
Implemented P1/Spin target
Implemented P2 floating point support (with float variable type)
Initial struct type implementation
With the preprocessor it is now possible to compile the same source for P1 and P2, provided that the used objects are available for both and compatible.
For example, this source compiles and runs on both P1 and P2, thanks to @JonnyMac libraries:
Automatic update failed on OSX from 25.0
But manual works. Than-you
I don't see the beta auto update on the download site.
the error log of automatic update:
java.io.FileNotFoundException: https://www.maccasoft.com/wp-content/updates/spin-tools/spinide.xml
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1920)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:250)
at classpath//com.maccasoft.propeller.SpinTools$68.run(SpinTools.java:2388)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
Well the "ghost" error was caused by a wrong variable scope when compiling the inline pasm code for W6100drv.spin2 (was picking the local spin variable instead of the register alias in some cases). Was a surprisingly easy fix but some changes recently made to the compiler prevents these kind of errors to be properly highlighted, need some refactorings.
Some other things needed to be fixed: wrong encoding of the method call index (was not properly using the rfvar encoding) and the missing augd prefix for long literals in the DRV* instructions.
Speaking of the DRV* instructions, I see that are all using the long literal when, AFAIK, is not needed. Is that intentional ?
@ke4pjw said:
If there is an obscure way to break things, I find it! LOL.
I actually have a branch of Spin Tools with the requested feature, @JonnyMac. I'll look into getting this into a PR for @macca. I've just been meaning to refactor it since I hacked the features in. It's been 15+ years since I've done Java so it is a bit of a rough start. Really, I have an aggerate of the following features:
1. Right-Click Tab Context Menu
2. Middle-Click Close
3. Pinning as Top
I didn't put any effort into the options, I just ... gleaned off of other code editors. But it has been absolutely nice to have though.
Edit:
Catching up from being out of town for a week, looks like macca has been putting some serious work into the main branch. I'm liking the updates. Looks like close-all is added. Though I'm PR'ing a middle mouse button support and if feasible (I don't see implementation support yet), "pinning" a top file.
(and you may notice the syntax highlight is not consistent... oh well...)
As of now is not possible to add a define from preferences or command line (will add later).
Added a dialog to list the available Propeller devices.
Added toolbar
The icons and tooltips should be self-explanatory.
The bug icon allows to temporarily enable debug (P2-only), compile and upload the program, no need to toggle the debug mode.
Reviewed and fixed the command line compiler, added the option to run with PST enabled on the console.
New menu items to close editor (current or all), run with debug (like PNut), open files from configured library paths.
Editors can be closed with the middle mouse button click on the tab (thanks to @DarkInsanePyro ).
A number of other fixes (including those related to SpinnerEdge).
It seems like you added F8, F10, and F11 hotkeys -- though they're not mentioned in the menus. Could you add F5 (Preferences), too? Almost all of my Propeller Tool habits seem to be working, and the toolbar looks great and is really convenient.
On that... I could not find the files used as templates. Are you generating a blank project in code? Could you allow an external file (one for P1, one for P2) and if an external template file is not specified, generate the template as you are now? If yes, I suggest you add a template file field to the P1 and P2 sections inside Preferences (that was probably obvious, but I like to be clear).
Again, thank you for your efforts on this. Spin Tools is really coming along nicely and I encourage @"Ken Gracey" and @"Jeff Martin" to have a look and provide support where they can. Having a x-platform tool with the look and feel of Propeller Tool (only nicer), is a very big positive for Parallax.
@macca After being away from my prop for over two months I came back and noticed all that you've done. Great job!
However I have a SPIN 2 code that uses POLXY and I noticed that it is giving an incorrect result in Spin Tools. The same issue happened when @cgracey updated Pnut from v36 to v37 although he later fix it in v38. Documented here: https://forums.parallax.com/discussion/175133/pnut-proptool-2-9-2-bug-polxy
I suppose your code is based on v37 because my sample code is producing similar results as v37 of Pnut.
@jrullan said:
@macca After being away from my prop for over two months I came back and noticed all that you've done. Great job!
However I have a SPIN 2 code that uses POLXY and I noticed that it is giving an incorrect result in Spin Tools. The same issue happened when @cgracey updated Pnut from v36 to v37 although he later fix it in v38. Documented here: https://forums.parallax.com/discussion/175133/pnut-proptool-2-9-2-bug-polxy
I suppose your code is based on v37 because my sample code is producing similar results as v37 of Pnut.
The interpreter is based on PNut v38, however the source distributed with it (and v39 too) is still the old source with the immediate bug in the POLXY function, I was using that!
The P2_PNut_Public Github repository has the fixed source so I'll update it.
There is also another problem, discovered by reading the bug report, with the $80000000 constant which in my compiler is unsigned while it should be signed.
I'll fix these issues and release a patch update shortly today.
@JonnyMac said:
It seems like you added F8, F10, and F11 hotkeys -- though they're not mentioned in the menus. Could you add F5 (Preferences), too? Almost all of my Propeller Tool habits seem to be working, and the toolbar looks great and is really convenient.
This has puzzled me a bit because the hokeys are in the menus... then I checked with Windows and... hotkeys are not displayed! Now I need to figure out why!
I have used F5 to refresh the file browser as I believe it is mostly used for that also in other program (to refresh the contents).
On that... I could not find the files used as templates. Are you generating a blank project in code? Could you allow an external file (one for P1, one for P2) and if an external template file is not specified, generate the template as you are now? If yes, I suggest you add a template file field to the P1 and P2 sections inside Preferences (that was probably obvious, but I like to be clear).
The templates are internal, the source is packed with the binaries in the .jar file, I think I can add a preference to use a custom template.
Again, thank you for your efforts on this. Spin Tools is really coming along nicely and I encourage @"Ken Gracey" and @"Jeff Martin" to have a look and provide support where they can. Having a x-platform tool with the look and feel of Propeller Tool (only nicer), is a very big positive for Parallax.
@macca - Found an issue while compiling HUB75 driver code (specifically with: isp_hub75_hwGeometry.spin2)... The code compiles in flexprop.
test code:
'' enum test
''
con
#0[16], a, b, c, d
#0[16], e, f, g, h '' Spin Tools likes a space before enumeration...
#0, k, l
pub main() | i, j, m
i := a
j := e '' of course, con 'e' is not defined
m := l
@jrullan said:
This is a screenshot of the code running in Propeller Tool
Notice the problem when the same code executes in Simple Tool:
I'm not sure why this is happening.
Aside from JonnyMac's observation, I think the right-side bitfield is not setup correctly, need to do some more tests.
@dgately said:
@macca - Found an issue while compiling HUB75 driver code (specifically with: isp_hub75_hwGeometry.spin2)... The code compiles in flexprop.
test code:
'' enum test
''
con
#0[16], a, b, c, d
#0[16], e, f, g, h '' Spin Tools likes a space before enumeration...
#0, k, l
pub main() | i, j, m
i := a
j := e '' of course, con 'e' is not defined
m := l
Yes, unfortunately the enum syntax conflicts with the C-style preprocessor directives (that starts with #).
For now, the preprocessor must start at column 0 (in the CON section) and enum at column >= 1.
I was up very late last night and am a bit ragged, but I'm having a difficult time seeing what you're pointing to. I ran my version in Spin Tools and get the same results.
Yes, that works, the problem is as @macca pointed out in the right hand side of the assignment in the second block when copying the first array values into the second array, see the following screenshot:
When I opened my generic workspace program (work.spin2) in Spin Tools (0.27.1) I encountered a couple situations that are not a problem for Propeller Tool.
Published 0.27.2 with the fixes for the issues above.
The right and left side bitfields should now operate correctly, aside from using the right variable/pointer.
@JonnyMac said:
When I opened my generic workspace program (work.spin2) in Spin Tools (0.27.1) I encountered a couple situations that are not a problem for Propeller Tool.
Forgot some constant operators, this is fixed.
Note: with Spin Tools, you don't need the floating point operators in constant expressions. The standard operators +, -, *, /, etc. can operate on both integer and floating point numbers, the result is automatically promoted to floating point. You need to use round/trunc only at the final assignment, if needed.
For example:
PUB start() | a, b
a := 1.2345 * 2
b := round(a)
debug(fdec(a),udec(b))
Comments
Released version 0.26.0
Not much new on the Spin side as most of the work has been done on the C language support.
I have dropped the version with the self-update feature. I tried to make it working for the whole distribution but it is too critical. I was already using a patched version to fix the MacOS UI thread issue, then I realized that it would be easier to make my own update framework instead of patching the existing to adapt to my needs, so for now no self updates. We will see when it is time to release the 1.0 version.
On the C language side:
With the preprocessor it is now possible to compile the same source for P1 and P2, provided that the used objects are available for both and compatible.
For example, this source compiles and runs on both P1 and P2, thanks to @JonnyMac libraries:
The pragma directive defines the target processor (P1 or P2) with P2 being the default if no pragma is specified.
Automatic update failed on OSX from 25.0
But manual works. Than-you
I don't see the beta auto update on the download site.
the error log of automatic update:
java.io.FileNotFoundException: https://www.maccasoft.com/wp-content/updates/spin-tools/spinide.xml
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1920)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:250)
at classpath//com.maccasoft.propeller.SpinTools$68.run(SpinTools.java:2388)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
I use a spin file from Terry's spinneret edge board.
The main "SpinnerEdge_Top.spin2" give an error in spin tools, but no explanation why?
On propeller tool it runs fine.
https://griswoldfx.visualstudio.com/Spinner%20Edge/_git/Software?path=/SpinnerEdge_Top.spin2&version=GBmain
Agreed. I've been wanting to look at Terry's project so I download to its own folder.
In Propelller Tool
In Spin Tools
I opened all of the project files in Spin Tools and couldn't find any red marks. Zip is attached for others.
That's really weird.
I'll investigate.
If there is an obscure way to break things, I find it! LOL.
Well the "ghost" error was caused by a wrong variable scope when compiling the inline pasm code for W6100drv.spin2 (was picking the local spin variable instead of the register alias in some cases). Was a surprisingly easy fix but some changes recently made to the compiler prevents these kind of errors to be properly highlighted, need some refactorings.
Some other things needed to be fixed: wrong encoding of the method call index (was not properly using the rfvar encoding) and the missing augd prefix for long literals in the DRV* instructions.
Speaking of the DRV* instructions, I see that are all using the long literal when, AFAIK, is not needed. Is that intentional ?
And thanks for that!
Please consider adding "Close All Tabs" to the special menu and to the File menu.
I actually have a branch of Spin Tools with the requested feature, @JonnyMac. I'll look into getting this into a PR for @macca. I've just been meaning to refactor it since I hacked the features in. It's been 15+ years since I've done Java so it is a bit of a rough start. Really, I have an aggerate of the following features:
1. Right-Click Tab Context Menu
2. Middle-Click Close
3. Pinning as Top
I didn't put any effort into the options, I just ... gleaned off of other code editors. But it has been absolutely nice to have though.
Edit:
Catching up from being out of town for a week, looks like macca has been putting some serious work into the main branch. I'm liking the updates. Looks like close-all is added. Though I'm PR'ing a middle mouse button support and if feasible (I don't see implementation support yet), "pinning" a top file.
Released version 0.27
A number of changes in this release:
Implemented C-style preprocessor directives.
(and you may notice the syntax highlight is not consistent... oh well...)
As of now is not possible to add a define from preferences or command line (will add later).
Added a dialog to list the available Propeller devices.
Added toolbar
The icons and tooltips should be self-explanatory.
The bug icon allows to temporarily enable debug (P2-only), compile and upload the program, no need to toggle the debug mode.
Reviewed and fixed the command line compiler, added the option to run with PST enabled on the console.
Macca, great again!
Run nice on OSX with toolbar
Spinner-edge runs also fine now
I love this spin tool
Yes, indeed. Thank you, Marco.
It seems like you added F8, F10, and F11 hotkeys -- though they're not mentioned in the menus. Could you add F5 (Preferences), too? Almost all of my Propeller Tool habits seem to be working, and the toolbar looks great and is really convenient.
On that... I could not find the files used as templates. Are you generating a blank project in code? Could you allow an external file (one for P1, one for P2) and if an external template file is not specified, generate the template as you are now? If yes, I suggest you add a template file field to the P1 and P2 sections inside Preferences (that was probably obvious, but I like to be clear).
Again, thank you for your efforts on this. Spin Tools is really coming along nicely and I encourage @"Ken Gracey" and @"Jeff Martin" to have a look and provide support where they can. Having a x-platform tool with the look and feel of Propeller Tool (only nicer), is a very big positive for Parallax.
@macca After being away from my prop for over two months I came back and noticed all that you've done. Great job!
However I have a SPIN 2 code that uses POLXY and I noticed that it is giving an incorrect result in Spin Tools. The same issue happened when @cgracey updated Pnut from v36 to v37 although he later fix it in v38. Documented here: https://forums.parallax.com/discussion/175133/pnut-proptool-2-9-2-bug-polxy
I suppose your code is based on v37 because my sample code is producing similar results as v37 of Pnut.
The expected result should be:
The interpreter is based on PNut v38, however the source distributed with it (and v39 too) is still the old source with the immediate bug in the POLXY function, I was using that!
The P2_PNut_Public Github repository has the fixed source so I'll update it.
There is also another problem, discovered by reading the bug report, with the $80000000 constant which in my compiler is unsigned while it should be signed.
I'll fix these issues and release a patch update shortly today.
This has puzzled me a bit because the hokeys are in the menus... then I checked with Windows and... hotkeys are not displayed! Now I need to figure out why!
I have used F5 to refresh the file browser as I believe it is mostly used for that also in other program (to refresh the contents).
The templates are internal, the source is packed with the binaries in the .jar file, I think I can add a preference to use a custom template.
Thank you!
New version 0.27.1 published.
This should fix the POLXY issues and also correctly display the menu shortcut keys on Windows (hope hasn't break the MacOS menu).
Great! Thanks.
Hot-keys are visible in menus under Windows 10 Pro.
Thank you.
@macca
I found an issue testing my code.
This is a screenshot of the code running in Propeller Tool
Notice the problem when the same code executes in Simple Tool:
I'm not sure why this is happening.
@macca - Found an issue while compiling HUB75 driver code (specifically with: isp_hub75_hwGeometry.spin2)... The code compiles in flexprop.
test code:
dgately
The byte[], word[], long[] syntax expects a pointer -- you're passing the first element of the arrays instead of their addresses.
0,27,1 works on mac high sierra
I see no cosmetic changes from 0,27
And the function key's are working
Aside from JonnyMac's observation, I think the right-side bitfield is not setup correctly, need to do some more tests.
Yes, unfortunately the enum syntax conflicts with the C-style preprocessor directives (that starts with #).
For now, the preprocessor must start at column 0 (in the CON section) and enum at column >= 1.
Very good! Thanks.
@JonnyMac
Oh, my bad you are absolutely right. I forgot the syntax while creating the example to show the difference between Propeller Tool and Spin Tools.
Nonetheless Spin Tools is behaving differently:
Propeller Tool
Spin Tool
It's weird that my wrong example from before gave the same result as the correct one in Propeller Tool.
I was up very late last night and am a bit ragged, but I'm having a difficult time seeing what you're pointing to. I ran my version in Spin Tools and get the same results.
@JonnyMac
Yes, that works, the problem is as @macca pointed out in the right hand side of the assignment in the second block when copying the first array values into the second array, see the following screenshot:
When I opened my generic workspace program (work.spin2) in Spin Tools (0.27.1) I encountered a couple situations that are not a problem for Propeller Tool.
Published 0.27.2 with the fixes for the issues above.
The right and left side bitfields should now operate correctly, aside from using the right variable/pointer.
Forgot some constant operators, this is fixed.
Note: with Spin Tools, you don't need the floating point operators in constant expressions. The standard operators +, -, *, /, etc. can operate on both integer and floating point numbers, the result is automatically promoted to floating point. You need to use round/trunc only at the final assignment, if needed.
For example:
Results: