Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Zerbob

Pages: [1]
1
Introduce Yourself! / Greetings, fellow programmers
« on: January 14, 2012, 12:27:06 pm »
Hello!
My name is not Zerbob (who would've guessed it ?), I'm from Paris and I study mathematics (I'm in MPSI for those who know about the freench school system).
I discovered omnimaga around March 2011 when I got my TI-Nspire cas (I previously owned a TI82 Stats) and installed ndless, gbc4nspire and a few cool game boy games (zelda, tetris, bomberman...). I created an account at that time but it's only been a few weeks since I really started looking into it.
I've got some experience (little) with PC-programming (mostly C++ and OCaml) and I'd like to develop something for the Nspire (in C), though I'm not quite sure what (possibly a strategy game like advance wars). I've already made some experiments with input handling and scrolling.
That's a nice website you have, by the way. :thumbsup:

2
Calculator C / Re: A few questions about Nspire C programming
« on: January 07, 2012, 12:52:14 pm »
Thank you. I didn't know you could use argv.
Well I think I'll just play around now and stop annoying you.
I'll come back if I have other questions or if I program anything worthwhile (not quite sure what I want to do for now).

3
Calculator C / Re: A few questions about Nspire C programming
« on: January 07, 2012, 12:14:41 pm »
* Memory leaks shouldn't provoke crashes.
Well I don't know what the problem was then... likely a seg fault but I can't see why.
* Ticks are set to 32 kHz, the timer divider to 10, and the timer value to 32, that makes a 100Hz timer.
Oh ok I hadn't understood the way the os uses it.
* Computer Link does modify the file content, just make sure the extension is .tns and you can transfer program data.
I suppose you mean "does not"... I made a test program to display the content of a file created on the computer and it worked fine on both my ti and nspire_emu (I took a display routine from some other board, I think it was made by bwang).
The default working directory seems to be Documents. How can I get the program's directory to open files using relative paths ?

4
Calculator C / Re: A few questions about Nspire C programming
« on: January 07, 2012, 10:34:31 am »
I'm back...
* Use Wine to run nspire_emu on Linux
I followed the tutorial on hackspire (prefacing all comands with "wine"), the program starts but when I press I to load the os image it hangs. The same binaries work fine on Windows.

Apart from that I managed to use the real time clock and to write on the screen using a buffer (i made square that moves every second and bounces on the edges of the screen while fading away and then back, impressing isn't it ?). I think the crashes I got were caused by a memory leak (I accidentally deleted the code...).

I still have questions concerning time handling : if I program a slow paced game (board game or something like that) or a menu I understand I should call the idle function in the main loop to save power, is that the use of it ? Hackspire says "Changing the timer frequency have effects on the latency of this function. " : which timer is that, 0x900D0000 ?
I'd like to use one of the other timers as a more precise real-time clock (I don't care if it loops back to 0 at some point, the purpose is to handle framerate and keypad input with a more precise unit than "iterations").
I gather from hackspire I should : set 0x900D0014 to 0b11111, 0x900D0010 to 31, and read volatile uint16s from 0x900D000C. Does that work ?
Besides, it's written on hackspire that the timer is set to 100Hz but 10 ticks of 32kHz is 3200Hz, is the number false or didn't I understand something ?

Finally, are there any text drawing routines available ? Or should I just use a few dozen sprites ?
Also, does ti nspire computer link modify files or can a program read them just like it works on a pc ? (not that I plan to use it right now but it's worth knowing)

That's it, and thank you for all the answers which I don't doubt will come.

5
Calculator C / Re: A few questions about Nspire C programming
« on: January 06, 2012, 04:15:27 pm »
Thank you very much for your answers, I don't have much time tonight but I'll probably have some more questions tomorrow.
Just click to "Profile" button in the top bar, and use the left side menu to navigate to different settings pages :)
I saw it just after posting but it wasn't here before (there were only account settings). I suppose you need one post before editing your profile, or you can't do it on your first session (I had created this account quite a while ago but I don't think I had ever used it).

6
Calculator C / A few questions about Nspire C programming
« on: January 05, 2012, 06:02:55 pm »
Hello, I've just started programming on TI-Nspire and I'd like to ask a few questions. I know there's documentation on hackspire but it's not always clear (such as, does this particular piece of information refer to ndless 1,2 or 3 etc), besides I don't know much about hardware and direct access to memory (I usually program in OCaml ;D ).
So, here are my questions (for some of them I could just check the source code, I know):
  • os.h seems to be the only necessary file to include. Is there anything else I might want to use or is the whole of libndls and the stdlib in os.h? A lot of programs have an "utils.h" include directive, but it isn't in the sdk - is it replaced by something else?
  • Do you need to do something particular when entering/exiting the program (saving and restoring the screen, disabling some os function...)? All my test programs trigger a reboot in nspire_emu at exit...
  • When should I use TCT_Local_Control_Interrupts (or anything related to interrupts)?
  • Is there any graphics library available? or some project I could contribute to?
  • (if the answer to last question is no) How to actually write on the screen? I suppose it is something like that (adding an extra pointer and a memcpy for double buffering):
    unsigned char * scr = (unsigned char*)SCREEN_BASE_ADDRESS;
    *(scr + /*some operation with ints x and y*/) = (unsigned char) color; //how are color coded, by the way?
  • How do you get the time? I gather that you can get the time in seconds with:
    int time = *((volatile int*)0x90090000); //not sure about the types though
    Can you get a more precise value?
  • Are ints 32 or 16 bits?
  • Is there anything to do to have float support? I tried to compile a program with floats using yagarto and I got "undefined reference to __arm__addf" or something like that (I'm on Linux right now I can't check).
  • Unimportant: Did anyone get nspire_emu or ncubate working on 64bits Linux? It crashes when you press I to load the os for me (but i have a dual boot, I don't really need it. Btw, the nspire-gcc script doesn't work out of the box on Ubuntu because packaged versions of gcc have a version number: the script looks for arm-linux-gnueabi-gcc (or ld etc) but it's arm-linux-gnueabi-gcc-4.5 (or 4.6), you've got to edit it manually.).
  • Really unimportant: how do you change your profile with this forum? ???
That's about it, I know those are quite noobish questions but being noobish is my nature, I can't help it. :-[

Pages: [1]