Shop OBEX P1 Docs P2 Docs Learn Events
Anyone got a Spin compiler writtin in C or Spin? — Parallax Forums

Anyone got a Spin compiler writtin in C or Spin?

Dr_AculaDr_Acula Posts: 5,484
edited 2012-02-04 00:48 in Propeller 1
I've got the beginnings of this little text editor working on the propeller. Now it needs an engine behind the scenes to do the compilation.

The simplest idea is a Spin compiler written in Spin. Or maybe a Spin to C converter written in C and then compile that with C? Brainstorming thoughts most appreciated!

[video=youtube_share;GYidYwdOqPQ]

Oh, yes, the fine print. The text is slow as you can see, but on the other hand, with the new design coming through soon with a wider bus, it will be faster.

The bold and colored text is fake as it is hand coded. On the other hand, I have real code for doing this sort of processing written in vb.net so it is just a matter of porting it over to Spin. Search for a " if found, change the foreground color to red. Change back when find the next " Turn on bold if VAR or PUB or OBJ found etc. Not very hard.

The good news - only one font is in memory at any one time, and with the new board with two memory chips there will be enough room for multiple fonts so the screen refresh will be faster again.

And the other bit of good news is this is using only around half the program space, because things like the text buffer are being stored in external memory.

Next step - working on some alternate keyboards - need one for the alternate character set for the Parallax font, and another keyboard for simple scrolling (arrows, page up, page down), and another one with all the +-&*^ etc characters. Should be easy to scroll between keyboards.

For real coding, it might be better to add a real keyboard, but again, the amazing propeller can do that with just a few more lines of code.
640 x 480 - 39K

Comments

Sign In or Register to comment.