Author Topic: Nspire C text output/input  (Read 7059 times)

0 Members and 1 Guest are viewing this topic.

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Nspire C text output/input
« on: March 12, 2010, 03:35:10 pm »
Is there any way to output/input text on the Nspire when programming in C?

Offline miotatsu

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 332
  • Rating: +11/-1
    • View Profile
Re: Nspire C text output/input
« Reply #1 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 :)

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: Nspire C text output/input
« Reply #2 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?

Offline apcalc

  • The Game
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1393
  • Rating: +120/-2
  • VGhlIEdhbWUh (Base 64 :))
    • View Profile
Re: Nspire C text output/input
« Reply #3 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?


Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Nspire C text output/input
« Reply #4 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.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Nspire C text output/input
« Reply #5 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?

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: Nspire C text output/input
« Reply #6 on: July 07, 2010, 06:22:12 pm »
Calc84maniac, can we use your ASM routine in a C function?

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: Nspire C text output/input
« Reply #7 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.
« Last Edit: July 10, 2010, 02:21:09 pm by Lionel Debroux »
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Nspire C text output/input
« Reply #8 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?

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: Nspire C text output/input
« Reply #9 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.
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.