Omnimaga

Calculator Community => TI Calculators => Calculator C => Topic started by: bwang on March 12, 2010, 03:35:10 pm

Title: Nspire C text output/input
Post by: bwang on March 12, 2010, 03:35:10 pm
Is there any way to output/input text on the Nspire when programming in C?
Title: Re: Nspire C text output/input
Post by: miotatsu on March 12, 2010, 05:39:16 pm
I have not tried to do any programming for the nspire yet, but i would bet on it, check out the documentation that came with ndless/ your compiler/ any libraries for the nspire and see what is and is not included, also see what is supported library wise - that would be the number one thing to worry about, because you will need to know what you have to work with. when you know that just check the documentation for the libraries to see what is and is not included in them, as well as the syntax as how to use them. I hope this helps :)
Title: Re: Nspire C text output/input
Post by: fb39ca4 on July 07, 2010, 02:59:36 pm
I wonder how calc84maniac did the menu in gbc4nspire? Did he do the text himself, or is it some sort of os call?
Title: Re: Nspire C text output/input
Post by: apcalc on July 07, 2010, 04:31:28 pm
I wonder how calc84maniac did the menu in gbc4nspire? Did he do the text himself, or is it some sort of os call?

I don't think calc84maniac wrote his emulators in C.  I think they are in ARM9 Assembly.  When you look in the header file os.h there is a definition for a function named "printf".  I wonder if this could be used for text, or maybe it just has not been written yet, just defined there?
Title: Re: Nspire C text output/input
Post by: calc84maniac on July 07, 2010, 05:22:52 pm
I wonder how calc84maniac did the menu in gbc4nspire? Did he do the text himself, or is it some sort of os call?

I don't think calc84maniac wrote his emulators in C.  I think they are in ARM9 Assembly.  When you look in the header file os.h there is a definition for a function named "printf".  I wonder if this could be used for text, or maybe it just has not been written yet, just defined there?
I grabbed a bunch of font bitmap data and wrote my own display routine. It's very console-like.

And the "printf" function is in the OS, but it prints through the RS232 cable, not anywhere on the screen.
Title: Re: Nspire C text output/input
Post by: bwang on July 07, 2010, 05:47:39 pm
Yeah, it seems like we'll need our own display routines.
Armael PM'd me with his font data and display routines on UTI, but we need a program loader for it to work (there are workarounds, though).
It turns out that drawing strings onto the screen is not all that hard, but having a proper text output routine (with scrolling, line-wrapping, etc.) is a bit harder. And I don't even want to think about input...so many getKeys! Is there an efficient way to do input, using a table or something?
Title: Re: Nspire C text output/input
Post by: fb39ca4 on July 07, 2010, 06:22:12 pm
Calc84maniac, can we use your ASM routine in a C function?
Title: Re: Nspire C text output/input
Post by: Lionel Debroux on July 10, 2010, 02:19:59 pm
I guess I shall remind about the graphical functions in the HPGCC library ;)
I mentioned them (and their genericity and moddability) in my post about making a demo for the Nspire platform, as a concrete goal for improving the toolchain and libraries: http://www.unitedti.org/forum/index.php?showtopic=9384
I'm not _sure_ they would work without a program loader, though.
Title: Re: Nspire C text output/input
Post by: bwang on July 10, 2010, 06:15:12 pm
How would one go about writing a program loader? Would it have to be written in ASM, or can it be written in C?
Title: Re: Nspire C text output/input
Post by: Lionel Debroux on July 11, 2010, 01:39:38 am
There's a BFLT program loader, in C, in the Linux kernel's sources. Needs adaptations, and probably an integration with Ndless for best results.