Omnimaga
Omnimaga => Completed => Our Projects => Nspire I/O => Topic started by: compu on March 03, 2011, 03:21:21 pm
-
Hi, here is a collection of text input/output functions for the TI-Nspire ;D
Demo program:
(http://nspforge.unsads.com/p/nspireio/raw-attachment/wiki/WikiStart/consoledemo.PNG)
Basically these functions are included:
- Simple text output
- Formatted text output (printf-like)
- Char input
- String input
Download and more information can be found at nspforge (here (http://nspforge.unsads.com/p/nspireio)).
So if you found any bugs, got suggestions or I did any mistakes with this please let me know, because I don't have much experience with Nspire programming... :)
-
Interesting. I wonder if there will be multiple font support? Is it gonna be mostly for game dev or mostly for command line development?
-
Hehe, you're going to make one ExtendeD happy. ;)
He wants to make a small console for the Nspire and include it (??) with ndless. This could be that prgm. :D
(Of course, not a simple print/input prgm, but something like BASH)
-
A cat program for the nspires! Nice :D
I agree with DJ, multiple fonts'
-
Interesting. I wonder if there will be multiple font support? Is it gonna be mostly for game dev or mostly for command line development?
If you exchange the charmap and edit some of the defines it should work with every font size ;)
Hehe, you're going to make one ExtendeD happy. ;)
He wants to make a small console for the Nspire and include it (??) with ndless. This could be that prgm. :D
(Of course, not a simple print/input prgm, but something like BASH)
Hm, I think he could do it better than me, but thanks ;D
EDIT: oops, I read only the first part of your post DJ ::)
I don't know what I will use this for, but I thought it would be useful for me and other people :)
-
I see, that's cool, then. :D
-
Nice :)
Hehe, you're going to make one ExtendeD happy. ;)
He wants to make a small console for the Nspire and include it (??) with ndless. This could be that prgm. :D
I have unfortunately already started working on it.
-
(Necro)update :P
- Ndless 3.1 compatibility
- Included functions for RS232 that work with disabled interrupts (no clock on the screen) - CX compatible
- Grayscale support
- Support for multiple consoles
- Lot of minor improvements.
CX compatibility has not been tested for on-screen I/O.
And 2 screenshots. The first shows grayscale support, the second using two consoles at once.
Link to source and download is in the first post.
-
Looks nice. :)
That reminds me, Calc84maniac was working on some sort of DOS/command prompt for the Nspire, but sadly he lost all his work in late 2010. :(
-
Very nice :)
I'm definitely going to put it on my CX when it's done!
On a side note, can you change the baud speed of the rs232/uart (and other flags)? That would be very interesting, since you could then use your nspire to hack other devices (routers, nas, etc) if they have a serial port. I don't expect this to be included, but it's just an interesting idea :)
-
I have just looked into it, really nice, it needs more promotion :) This should be part of the toolkit of anyone beginning native programming on the TI-Nspire.
You should release it as an archive file. And I'm really expecting CX compatibility.
-
A package including source code, binaries, demo application and documentation is now available at nspforge (http://nspforge.unsads.com/p/nspireio/downloader).
On a side note, can you change the baud speed of the rs232/uart (and other flags)? That would be very interesting, since you could then use your nspire to hack other devices (routers, nas, etc) if they have a serial port. I don't expect this to be included, but it's just an interesting idea :)
In theory this would be possible, but I haven't tried anything yet ;)
-
To contribute to its promotion: nspireio is being used by OCD (On-Calc Debugger) (http://ndlessly.wordpress.com/2012/04/09/introducing-ocd-the-ti-nspire-on-calc-debugger/).
It's easy to use and really deserve trying it.
As compu told me just switch to grayscale mode for CX compatibility (if(has_colors) {clrscr(); lcd_ingray();}).
-
Thanks for the answer compu :)
ExtendeD, maybe nspireio could be eventually be integrated into Ndless?
Then it would come closer to TIGCC, as their lib includes something like this.
-
Maintenance is easier with autonomous owners and components with their own lifecycle.
And using static libraries (http://hackspire.unsads.com/wiki/index.php/Ndless_features_and_limitations#Using_static_libraries) is just a matter of dropping files in directories and adding an -l switch to the Makefile.
So I prefer the way it is today :)
-
Ah, I see :)
-
BUM BUM BUM BUMP!
I'm a rabid fan of NspireIO who is using this for a secret project (that isn't terribly secret after telling 3-5 people about it :P). However, it lacks a cursor, and the dev (compu) seemed inactive at the time, so I decided to implement it. (He seems to be active now - he has added lots of interesting features in SVN trunk!) Juju also has a need to implement it since KermMartian is using it for his LuaZM via the Prizm port of NspireIO, PrizmIO! After telling Juju that I would implement it (for his ease of porting), it's finally here... after quite a few feature additions so that NspireIO's cursor isn't "just any cursor!" ;)
Screenshot demo:
(https://dl.dropbox.com/u/1016340/PublicPictures/NSPIREIO21.GIF)
New features:
- Cursor support. (Duh.) This can be disabled at any time. Note that if drawing is disabled, cursors are disabled.
- Blinking cursor support. This can be disabled at any time as well.
- Multiple cursor types include a regular block cursor (Linux X11 terminal style), underscore cursor (Windows Command Prompt style), and vertical bar (regular text box style).
- Cursor width adjustment.
- Custom cursor support.
It's very likely that very few, if any at all, will use those extra cursor options, but it was fun developing it anyway. :)
And voila, an needed update to NspireIO! :) (Version 2.1)
(If I seem to be making a big deal about this, excuse me - I'm just excited because this is probably my first serious release!)
Downloads:
Downloads are attached in ZIP and GZIP tar archives.
Mirror:
https://dl.dropbox.com/u/1016340/NspireIO/nspireio-2.1.tar.gz
https://dl.dropbox.com/u/1016340/NspireIO/nspireio-2.1.zip
(To compu: I've made a change to the Makefile to make it more "compliant" - hopefully you won't mind :) This is based off of r37, so if you want to merge, merge from that point. Also, the code is under LGPL 2.1, like the SVN, so no worries there. :))
EDIT: As always, the API is located in the header file, nspireio2.h. New binaries need to be built, I'll update within an hour.
EDIT 2: Dropbox mirror releases are updated. Attachment archives will be fixed soon.
EDIT 3: Attachments updated. Read README.txt for installation instructions. Also a few clarifications: 1) This is MY update, not compu's. Consider it unofficial, despite the version bump. 2) You may encounter issues when linking for certain compilers. You may need to delete the Ndless SDK's version of the NspireIO header and library before things will work. The cursor is enabled automatically, so seeing it in your program after the update is a definite way of telling whether you are linking/using the new version or not.
-
Little confused, but what exactly does this do? I don't get it :P
-
Do you mean alberthrocks's update or Nspire I/O itself?
-
Little confused, but what exactly does this do? I don't get it :P
This is a library for a virtual console on the Nspire. Most people won't need it, unless they are developing a console based game of app.
Do you mean alberthrocks's update or Nspire I/O itself?
This is my update :)
-
So if I were to be making the impossible game for nspire, for example, I should use this?
-
Yay. I'll merge your changes with my copy of PrizmIO as soon as possible.
-
So if I were to be making the impossible game for example, I should use this?
Absolutely not... unless you want to use ASCII squares for the game. :P I suggest using nRGBLib (https://bitbucket.org/totorigolo/nrgblib) instead.
Yay. I'll merge your changes with my copy of PrizmIO as soon as possible.
Yippee!! And I'll take a nice long break.... :P
-
Absolutely not... unless you want to use ASCII squares for the game. :P I suggest using nRGBLib (https://bitbucket.org/totorigolo/nrgblib) instead.
Thanks :D
-
Hi Albert, thanks for this nice feature :)
Yes, I didn't work on Nspire I/O for a longer time but I was always around in the forums - If you would've sent me a PM I would've integrated your changes into the trunk directly - but no problem, I'll do it this afternoon when I have time :)
And by the way, I made a lot of syntax changes a week ago:
The functions have completely changed and have the same syntax as
their stdio-counterparts now:
(with nio_-prefix)
fflush
fgetc
fgets
fprintf
fputc
fputs
getc
getchar
gets
perror
printf
putc
putchar
puts
All functions that don't have a FILE* stream / nio_console* c
argument, use a default console specified by nio_set_default().
Using the old syntax is possible by defining NIO_KEEP_COMPATIBILITY.
It is possible to replace the stdio-functions putchar, puts, getchar,
gets, printf, perror with nspireio functions by defining
NIO_REPLACE_STDIO, so you can use nspireio as stdin/stdout (just call
nio_use_stdio() at the beginning and nio_free_stdio() at the end of
the program).
Example:
#include <os.h>
#define NIO_REPLACE_STDIO
#include <nspireio2.h>
int main(void)
{
nio_use_stdio();
puts("Hello World!");
nio_free_stdio();
wait_key_pressed();
return 0;
}
The same is possible with the UART functions (that work with disabled
interrupts) by defining UART_REPLACE_STDIO.
So, I'll merge your changes with r44 and probably release it as 3.0.
-
compu, so I'm waiting these changes to be merged before integrating it to the Ndless SDK, please tell me when it's OK for you.
-
Added to nSDK? WHy not? THat would be genious!
-
Update:
- Color support (256 colors, with 16 predefined colors like NIO_COLOR_RED)
- The cursor shows if shift/ctrl/caps is activated
More information: http://nspforge.unsads.com/p/nspireio/wiki
Source code (direct download): http://nspforge.unsads.com/p/nspireio/changeset/62/trunk?old_path=%2F&format=zip
-
Glad to see this is still updated. I thought a while ago that you left the community in response to the PTTKiller incident and I'm glad you stayed around. Looks nice btw. :)
-
Yup, lots of new features got added lately thanks to compu, Alberthrocks (cursor support) and myself (color support).
Also I now have write access to the Nspire I/O repos (hint about the next update!) :D
-
Nice work, glad to see this is still continued :) How do you record that animation btw?
-
With a program called CalcCapture ;)
-
UPDATE:
- Prizm support complete! (Not done yet I think, still have to test some more, especially the keyboard part that might or might not work...) Type "make ARCH=prizm" to compile.
- [PRIZM] New keyboard layout! (Same as MPoupe's FXTERM)
-
UPDATE:
- Added nio_get_default()
- Replacing stdin & stdout with nio_get_default() when NIO_REPLACE_STDIO is set
- nio_fgets should be ANSI C compliant now
- nio_getchar should be ANSI C compliant now
- added nio__getch() and nio__getche()
-
I tried to download the latest version, but I seems NspireIO is not up-to-date on nspforge.
-
Why do you think it's not up-to-date? It says modified 31 hours ago...
-
I used the link in his signature, and then clicked on "downloader" ( http://nspforge.unsads.com/p/nspireio/downloader ), which says it was last updated on 16/09.
Am I on the wrong link?
-
The downloader only has packages with pre-built libraries, demos and docs. You can download the latest source from the small link at the bottom of "Browse Source" or use this link: http://nspforge.unsads.com/p/nspireio/changeset/65/trunk?old_path=%2F&format=zip
-
To be precise, the trunk has been updated 31 hours ago (at the time of this post) :
http://nspforge.unsads.com/p/nspireio/browser/trunk
However, not the downloads :
http://nspforge.unsads.com/p/nspireio/downloader
Edit : ah well, compu was faster :P
-
Ok. Thanks all :).
-
How do I input integers, if that's possible?
-
Use nio_gets or nio_fgets and pass the string to atoi (http://www.cplusplus.com/reference/cstdlib/atoi/) ;)
-
And FWIW, strtol & strtoul are better than atoi for error handling :)
-
Does this support scrolling?
It just reaches the bottom and then crashes for me.
-
Are you using the latest version? The "tests" demo with Nspire I/O 3.1 works fine for me.
You can download the latest version here: http://nspforge.unsads.com/p/nspireio/downloader
-
Small update:
- Added double buffering (nio_scrbuf_* functions in nspireio-platform-nspire.h)
- Fixed a grayscale display issue (white was shown as gray)
-
Feature request derived from http://ourl.ca/19674/362209 , assuming it doesn't exist yet: add nio_getsn() and add a compiler warning upon usage of nio_gets(). gets() is insecure and was removed from the C11 standard :)
When arg is a fixed-size char array, nio_gets can be expressed in terms of nio_getsn:
#define nio_gets(arg) nio_getsn(arg, sizeof(arg))
When arg is a pointer for an allocated array, that does not work...
-
Actually, nio_gets() just calls nio_fgets() with a size argument of 100, so it's not insecure if you have a buffer of at least 100 chars, but it doesn't work like the gets function in older C standards.
If your buffer is smaller than 100 chars, you must use nio_fgets unless you want buffer overflows.
Another feature request: add nio_scanf() and nio_fscanf(). (Unfortunately, these will have to be implemented as macros, because there is no vsscanf syscall, only sscanf.)
-
I have added nio_scanf and nio_fscanf ;)
add nio_getsn() and add a compiler warning upon usage of nio_gets(). gets() is insecure and was removed from the C11 standard :)
Since we have fgets with a size argument, I don't think we need getsn.
-
Thanks. And do you have any idea of when the next version will be released?
-
Probably when I continue working on the C++ support (https://github.com/compujuckel/nspire-io/tree/cpp-support/niostream) (holidays start in some days, so maybe I'll stop being lazy and work on some Nspire stuff again :P ).
-
I can't access the repository, it seems expired :o
-
I can't access the repository, it seems expired :o
From what I can see on the network graph, it was merged into master here: https://github.com/compujuckel/nspire-io/commit/43d991c2ce0bf6384cc5b24614e317f26467a2d2
-
thanks, I will check it