Omnimaga
Calculator Community => TI Calculators => Calculator C => Topic started 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?
-
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 :)
-
I wonder how calc84maniac did the menu in gbc4nspire? Did he do the text himself, or is it some sort of os call?
-
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 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.
-
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?
-
Calc84maniac, can we use your ASM routine in a C function?
-
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.
-
How would one go about writing a program loader? Would it have to be written in ASM, or can it be written in C?
-
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.