Omnimaga
Calculator Community => Other Calc-Related Projects and Ideas => TI-Nspire => Topic started by: shrear on January 09, 2011, 04:42:28 am
-
"Very" long ago I wrote a program in basic with which you could write letters on the graphscreen.
Since I had not to much to do the last week, I ported it to C.
Even with all what I added to the C version there are still some limits for the moment:
-I have just defined the "symbols" for upper-case letters an numbers
-you can only write 53*26 letters
But this you can already:
-deleting the last symbol written
-saving temporary
-saving to a file (for now only to "writer.txt.tns", also writer.tns and the file need to be at the root of your file system (/My Documents) to work as they should)
-reloading from this file (which can as well be written on a Pc, you have only to append a null character and the .tns extension at a regular .txt file)
I will add asap these features:
-code the rest of the characters (lowercase+punctuation)
-saving and reloading from/to different files
-add the possibility to reverse the screen colour
-make it possible to write more than what fits on one screen
and to navigate with the arrow keys (or even mouse pointer if it gets accessible)
And if that all goes I may try to add the possibility to format the text a bit, but that could take a while...
So here it is (Source included) what do you think?
-
Great! Nice to see you are using some features of Ndless 2.0 successfully.
-
thx ExtendeD
-
Hum. So this is a text editor on-calc for the NSpire? Nice, all we need now is a C Compiler ;D
-
Nice, all we need now is a C Compiler ;D
yea :)
-
We could then do on-calc programming, but it's not easy to make a C Compiler on-calc.
-
Porting an ANSI-compliant one shouldn't be too difficult.
I don't use my own calculator much, I wonder how easy it is to type in text with the keypad.
-
Excellent work! :)
Coding directly on the Nspire would be absolutely great! (I personally find the keypad easy to use, especially compared to an 83+, and I guess it's even more easy on the Touchpad version...)
-
Excellent work! :)
Coding directly on the Nspire would be absolutely great! (I personally find the keypad easy to use, especially compared to an 83+, and I guess it's even more easy on the Touchpad version...)
I can type quite fast in the touchpad version ;)
-
I just tried it on my Nspire, but it didn't load the included sample, even though creating and opening a new file worked prefectly.
-
I think I forgot to say that you may need (for now) to have both files at the root and not in a folder to get them work properly
-
nice! So, is this an actual text file (ANSI?) or is it a special format?
-
its normal ansi, if you remove the .tns you can open it with the real notepad or some similar program on your PC
-
We could then do on-calc programming, but it's not easy to make a C Compiler on-calc.
You just use a C compiler to compile the C compiler.
Funny how that works, isnt it? :P
-
We could then do on-calc programming, but it's not easy to make a C Compiler on-calc.
You just use a C compiler to compile the C compiler.
Funny how that works, isnt it? :P
XD That's impossible.
My question now is: Screenie of the notepad please?
-
No, it's not. gcc was made in c, I believe, though the worlds first compiler would have to be in asm, of course.
-
but fortunately gcc doesn't have to be :)
what we need, as far as I understand, is a library that works with the nspire to compile it, though, so.... this might be worth looking into (http://www.gnu.org/software/libc/libc.html) since it's the library gcc uses. There are ARM ports, but I'm not sure how useful they really are.
-
Nice, Shrear!
-
Version alpha-two:
-added lower-case letters and punctuation ( everything under 0x80 ansi is defined even if there is no possibility yet to write it on calc )
-added carriage return and tab
next thing will be something like alt codes for characters for whom there are no "logical" keys;
,that nwriter.tns and the .txt file will not to have be directly under /Documents to work
and that he doesn't react strange to \n after \r.
I have added also a picture of my calc while running nwriter. ( it's a bit blurry I know...)
-
Nice Screenshot. Is there a way to make screenshots using software run by Ndless? That would be a nice new addition
-
Aww, no 1.4 support? I really prefer OS 1.4 myself.
Oh, happy new year :P
-
Aww, no 1.4 support? I really prefer OS 1.4 myself.
It may go on OS 1.4 but I won't check that ;)
Oh, happy new year :P
thx
-
Nice Screenshot. Is there a way to make screenshots using software run by Ndless? That would be a nice new addition
That would be cool. It is quite straightforward to make a c library to generate a bmp in the middle of a program, which people can add to their programs.
-
But isn't taking a screenshot from nspire_emu easier?
-
But isn't taking a screenshot from nspire_emu easier?
Yeah, why a picture?
I mean, I can't use nspire_emu, so maybe he can't too.
-
I can use nspire-emu, but sometimes it's just plain incovenient to do so. Sometimes, using the calc is just quicker than setting up the emu correctly :P
-
I can use nspire-emu, but sometimes it's just plain incovenient to do so. Sometimes, using the calc is just quicker than setting up the emu correctly :P
I can't use NCubate, so a screenshot would be much faster for me too.
-
I can use nspire-emu, but sometimes it's just plain incovenient to do so. Sometimes, using the calc is just quicker than setting up the emu correctly :P
I don't like setting up the emu either. I just test my programs on physical hardware.
I can't use NCubate, so a screenshot would be much faster for me too.
-
I wish there was an nspire dev environment made for linux.
-
Isn't there a GTK+ port of nspire_emu?
-
I can use nspire-emu, but sometimes it's just plain incovenient to do so. Sometimes, using the calc is just quicker than setting up the emu correctly :P
I don't like setting up the emu either. I just test my programs on physical hardware.
I can't use NCubate, so a screenshot would be much faster for me too.
Why are you always answering inside quotes? :P
-
On my iPod i sometimes forget to scroll all the way to the bottom of th text boxes, so sometimes it happens:P
-
Nice, just saw the screenshot, and it looks great! And glad to know it's ANSI. So basically, you can open it up on any comp too?
As for the GTK+ emu, I think it's this: http://www.unitedti.org/forum/index.php?showtopic=8191&st=720
-
Nice, just saw the screenshot, and it looks great! And glad to know it's ANSI. So basically, you can open it up on any comp too?
As for the GTK+ emu, I think it's this: http://www.unitedti.org/forum/index.php?showtopic=8191&st=720
The GTK+ emu doesn't support file transfer with OSes 2.0 and 2.1 because it was based on the v0.26 :
http://ti.bank.free.fr/index.php?mod=archives&ac=voir&id=1730
Don't forget that nspire_emu 0.41 works both on linux (with wine) and windows with all OSes.
I you're lasy to open a terminal, don't forget that I've made a pack here (in french and english) :
http://ti.bank.free.fr/index.php?mod=archives&ac=voir&id=2099
-
Ok I think I have it far enough now to call it beta.
to summarise:
-every character of Windows-1252(ansi) (http://en.wikipedia.org/wiki/Windows-1252) is defined and may (if there is no key for it) be written per entering his hex-value while pressing ENTER.
-exeption are control characters, only \t \r \n are defined. (I'm not sure if the others are needed actually)
-you can store up to 900 characters. (if you write more than fits on the screen it's going to look as if he would overwrite the first characters but that doesn't really happen)
-speaking of storing, you can either store it temporary or in a file called "nwriter.txt.tns".
-this file, you can also write on your Pc. Then you have to save it in the same directory as nwriter.tns (hasn't any more to be the root directory)
-by pressing CAT (the key with the book on it) you can invert the color of the screen.
If you write a .txt file on your Pc make sure that your text editor uses \r\n for "enter". (the ones on windows do it "most" of the time)
Tomorrow I will see if my screen recorder still works but for today I'm to tired.
-
Well here is the promised screen record
Ok I'm not good at recording...
-
Nice :D I just noticed this updated and good job so far. :D
-
Cool!
An idea that might make multiple names easier: Keep using the nwriter.txt.tns name internally, but a small loop during opening and closing the program copies and renames the program. Opening copies the chosen txt file to nwriter.txt, closing copies nwriter.txt to another txt file.
Not sure how hard that is in pure c though :P
-
Cool!
An idea that might make multiple names easier: Keep using the nwriter.txt.tns name internally, but a small loop during opening and closing the program copies and renames the program. Opening copies the chosen txt file to nwriter.txt, closing copies nwriter.txt to another txt file.
Thanks for the advice.
Not sure how hard that is in pure c though :P
There is a single problem with it: internally I use a variable called "path" already, since using the "name string" would require, as far as my C goes(that doesn't mean much...) to hard code it every time I use it, witch would not allow any dynamic naming, witch is the opposite of what I want.
But again thanks for trying to help :)
-
I didn't notice that it's for ndless 2.0... So i always get reboot when i run it under ndless 1.7...
-
OK that's strange, could you try with os 2.0 please, since what runs on 2.0 or 2.1 should also run on 1.7...
EDIT: is your ndless binary 115kb or 113kb big?
-
nwriter is now on nspforge: http://nspforge.unsads.com/p/nwriter :)
-
New version.
what's new:
-executable is about 20 times smaller :o
-font data is in a separate file so one could use another without recompiling
-you can change the file which is written to or from which you load existing text
(default one is still "nwriter.txt.tns" which is set always when you start the program)
-fixed the little issue that you had to press two times delete to delete a "return"
-maximum of characters is now 0xFFFF
(but it you can still not navigate in the text so that isn't going to make much difference)
Now I hope that there is no bug I didn't see.
Constructive critic is always welcome.
download nwriter here (http://nspforge.unsads.com/p/nwriter/raw-attachment/wiki/WikiStart/nwriter_beta_0.1.2.zip)
the source is available at nspireforge (http://nspforge.unsads.com/p/nwriter/browser/trunk)
EDIT: forgot to add the font file to the download... well fixed now.
-
Well here is the promised screen record
Ok I'm not good at recording...
Looks pretty cool! ;D
-
Nice to see this is still being updated. :)
-
(Necro)update:
I'm happy to announce that, after a long time of nothing, I'm now releasing beta-V0.2 of nwriter.
It mainly adds the possibility to navigate freely through your text, even if it doesn't fit on one page.
(I admit it's still a bit buggy if your line breaks are natural ones and not \n )
The size is limited for now ( mainly because I'm to lazy to check what the max would be ) at:
0x600 lines and 0x4000 characters. ( If you need more, simply change line 122 and 138 of nwriter.c )
This now are my current Milestones:
0.2 full navigation (this version)
0.3 default font hardcoded; remember settings
0.4 file browser(+extensions check); general code clean-up
0.5 syntax highlighting (lua+c); key remapping
If you want to lookup my current progress, just have a look at the SVN at the NspireForge (http://nspforge.unsads.com/p/nwriter/browser/trunk),
there also you can find the binary of v0.2 (http://nspforge.unsads.com/p/nwriter/downloader/download/file/1) or somewhen a later version.
Just in case you want to know, nwriter is released under the gpl license (v.3+).
I hope there are no bugs, but if there are please post them, and any other feedback is even more welcome.
-
Does this program read .txt files?
-
Yes, it reads any plain text format, and thats what .txt is. For now it uses CP-1252 (http://en.wikipedia.org/wiki/Windows-1252) encoding (the default one of Windows)
-
My first post :)
This program is really nice. Especially that it reads plain txt files. But there is one problem: backspace doesn't work :o I have a clickpad non-cas, tried every button, but no backspace, which can't be missed in a text editor of course. Other than that, keep up the good work. :thumbsup:
-
Heya and welcome to the forums ElementCoder. :D
-
(Necro)update:
There we go v0.4.
-added a small hardcoded font
-you can now browse for your files
-fixed missing keys for the clickpads (some keys on the touchpad don't exist on Clickpad and the other way around, therefore there is now a separate mapping for clickpads.)
the zip-file can be downloaded from here (http://nspforge.unsads.com/p/nwriter/raw-attachment/wiki/WikiStart/nwriter%20v0.4.zip), "more" details are available here (http://nspforge.unsads.com/p/nwriter/wiki/WikiStart?version=8).
But there's also a surprise for me here, someone posted :crazy: and me didn't see it :banghead: ...
-
Cool to see a new version and nice to still see you around. :)
-
Wow, Lua syntax highlighting !
This will be great when ndless 3 get released :)
-
syntax highlighting works :), now but I need just another few hours to polish it up for release.
-
Good ;)
-
Cool to hear. :)
-
As announced, here is a version with :hyper: syntax highlighting :hyper:
Currently lua and C syntax "rules" ( does one say that so? ) are provided.
you can download v0.5 here (http://nspforge.unsads.com/p/nwriter/raw-attachment/wiki/WikiStart/nwriter.v0%2C5beta.zip) or have a look on the source (http://nspforge.unsads.com/p/nwriter/browser) at NspForge
As usual, any feedback and bug reports are welcome :) .
-
Excellent! Any screenshot?
-
I should stop doing stuff I'm not good at <--recording
Also there are some screenshots ( You may want to download then as the quality seems to be "bad" else )
the first two are the readme ( the style there is what will be added for the next release )
the last two are a c and a lua file.
As you've seen the menu seems to be not exactly bug free :(
-
Really nice :)
-
Those who watched the video probably saw that there was a serious bug in the menu :-[
Well it's fixed now ( at least I hope so... ), you can download the fixed version 5.1 here (http://nspforge.unsads.com/p/nwriter/raw-attachment/wiki/WikiStart/nwriter_v5.1beta.zip).
-
ty
-
This looks great but im wondering about the possibility of C++
-
Thx, but why C++? you can't really do more in it than in C, it's just structured otherwise and has a few shortcuts, that's all.
While I'm writing here something I may as well tell that I'm still working on it; despite not having released a new version for months.
-
I would gladly add a default .txt file association for it if you are planning to support it.
-
Well I know C and C++ are sort of implemented together but I dont think I can cram another programming language in my head...
*Not wanting too xD*
C++ Is a language I know very well and dont want to stray away from D:
-
Something that would be nice, although maybe a bit hard to implement, is if Notepad is installed and the user runs a Lua game where the first tab is the game readme, it simply asks the user if he wants to read the readme in notepad, skip directly to the game tab or open the game+readme normally? Because many Lua games has the readme opening by default every launch, which is annoying, especially when you're using an emulator and you forgot the key combination to switch between tabs.
-
Well I know C and C++ are sort of implemented together but I dont think I can cram another programming language in my head...
*Not wanting too xD*
C++ Is a language I know very well and dont want to stray away from D:
C++ is a direct superset of C, meaning that you could compile every C code with a C++ compiler. ( Actually you may have to add 'using namespace std ;' in some cases)
So if you ever have to write C instead of C++, all you have to learn what you can't do any more with a single keyword etc.
It also happens that I know the feeling of having a preferred language, and not wanting to write in any other myself.
But I have observed on myself that simply by knowing other languages (not necessarily using them), my skill in my favoured language has improved significantly.
So if you wouldn't mind an advise, learn some preferably completely different languages, and if for no other reason than to improve your C++.
I would gladly add a default .txt file association for it if you are planning to support it.
I kind of expect from myself to have "1.0" out before summertime, then I think I'll come back to your generous offer :).
-
meaning that you could compile every C code with a C++ compiler. ( Actually you may have to add 'using namespace std ;' in some cases)
Well, it's not just a matter of adding 'using namespace std;': due to the stricter type-checking of C++, C++ compilers reject a number of statements that are valid C. Many C code snippets cannot be compiled with a C++ compiler without prior modification :)
Granted, some C constructs rejected by C++ compilers are highly dubious even in C: for instance, casting const types to non-const types, and then using them as non-const, is rightfully a hard error in C++. However,
char * ptr = malloc(123456);
is an error with both g++ 4.6 and clang++ 3.1 (SVN), while it's hard to consider it strange C code.
-
@ephan
you are a doubter
-
Is there any chance you could update this for ndless 3? That'd be great! :D
-
This should work on a regular ( not CX ) Nspire, with ndless3,
in case you meant a CX compatible version then you have to be a bit patient,
I'm right now working on that but since I'm in my last school year.
Therefore my free time is limited, but as said some post ago, I expect to have the final release done before summer.
(note that the attached copy has the same bugs as the last release, as I'm developing in a different tree since then, which has more features but is significantly more unstable...)
-
you could be able to get nwriter to edit the ndless.cfg so you can easily change the File associations of ndless3 on-calc.
-
Thanks for updating, but frankly I have a CX. I'll just have to wait though. :)
-
you could be able to get nwriter to edit the ndless.cfg so you can easily change the File associations of ndless3 on-calc.
You already can do that. ndless.cfg.tns is nothing but a plaintextfile, therefore open it with nwriter change it, save it and you should be fine.
Note that I don't know how ndless handles this file, may be that you have to reboot your calculator for changes to take effect.
Also the default ndless.cfg.tns seems to use windows EOL while nwriter uses Unix style ones. This again may or may not be problematic depending on how ndless parses this file, in the worst case scenario you have to fix the EOLs via hexadecimal-input.
-
An idea: maybe you could make the menu's similar to the ones in the notes editor.
-
CX compatibility? :D That would be really nice.
-
Are you still working on this?
-
I hope he is. Isn't there an easy way to make programs compatible with OS 3.1 to be compatible with the CX? If so, I could try doing that myself...
-
Seeing as he hasn't logged in since June.. :/
I'm not sure what's different, maybe it's just that it doesn't put the cx in the grayscale mode (or whatever it is)? If something as busy as ndoom was possible to update than something like this should be possible as well methinks.
-
You'd just have to add an "lcd_ingray();" to the beginning of main() and recompile with ndless3.1.
-
Now that school's starting, I'm going to be programming on calc more. So could somebody who already has the Ndless SDK set up just recompile this program for the CX? Thanks a billion to the person who does. :)
-
Now that school's starting, I'm going to be programming on calc more. So could somebody who already has the Ndless SDK set up just recompile this program for the CX? Thanks a billion to the person who does. :)
Done! Recompiled with ndless r632, and added this snipplet somewhere inside main():
if(has_colors)
lcd_ingray();
Enjoy! Please let me know if the build fails/does not work.
EDIT: This uses his latest SVN trunk source code, so it may be less stable. Also, you still need his other resource/conf files, if you don't already have them.
-
Thank yous so much! Right now, the only problem is that the first time I run it, it can't seem to find the conf file, which I have put there, and then it can't find the font file, which is also there. and then it works using the hardcoded file.
The next time I launch it, it has an endless loop of "Invalid Font" and then I have to hit the reset button in the back.
And I can't really figure out how to save...
-
Thank yous so much! Right now, the only problem is that the first time I run it, it can't seem to find the conf file, which I have put there, and then it can't find the font file, which is also there. and then it works using the hardcoded file.
The next time I launch it, it has an endless loop of "Invalid Font" and then I have to hit the reset button in the back.
And I can't really figure out how to save...
Yeah, my glass ball predictions were correct... SVN trunk is not stable! (At least the latest revision!)
So, I took instead r30 of the SVN trunk (which is labeled as v0.5 stable release), added the CX code in, and rebuilt it. Hopefully this will work better this time. :)
This build is also located on my server (where it was built):
http://www.withg.org/buildbot/nwriter-0.5-CX.tns