Cant get any input to work on the 83-plus. Any help would be great ^^

TI-82, TI-83 (plus, silver..), TI-84, TI-85 and TI-86
Post Reply
ellipsis
New member
Posts: 5
Joined: Sat Dec 17, 2011 11:33 pm

Cant get any input to work on the 83-plus. Any help would be great ^^

Post by ellipsis »

So I decided to have a go at trying to write a few programs for my calculator so as to learn more about low(er)-level coding, as normally I only do C++.
I have a TI-83-plus and therefore this is what I'm trying to code for.
I've managed to compile hello world and I am using this command:
"zcc +ti8xansi -startup=2 -create-app -o test test.c".
I wall really happy with that, however next I'd like to try and make a simple game.
So I've been trying to get input.h to do something but with no luck.
This was my attempt:
#include <stdio.h>
#include <input.h>

extern char in_KeyDebounce(50000);
extern char in_KeyStartRepeat(50001);
extern char in_KeyRepeatPeriod(50002);
extern int in_KbdState(50003);

int main()
{
in_GetKeyReset();
//int test;
//scanf("%d",&test);
printf("Hello!");
return 0;
}

This gives "Module 'TEST', Symbol not defined Error in expression IN_GETKEYRESET"


I also tried:
#include <stdio.h>
#include <input.h>

uchar in_KeyDebounce = 1; // no debouncing
uchar in_KeyStartRepeat = 20; // wait 20/50s before key starts repeating
uchar in_KeyRepeatPeriod = 10; // repeat every 10/50s
uint in_KbdState; // reserved

int main()
{
in_GetKeyReset();
//int test;
//scanf("%d",&test);
printf("Hello!");
return 0;
}
But I get the same error.

I'm really not sure about alot of this and I can't find many example of how to do this.
If someone could fix this code, post some example code or even just give me some pointers that would be great.
Thank you.

Also a little unrelated, but when I use "extern char in_KeyDebounce(50000);" is this actually declared in another file? Where am I externing it from? And the number in () is the memory location right? And it has to be at the start of a block?
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

It is quickly explained, I'm afraid input.h has never been ported to the TI calculators, as well as the whole 'sprite pack'. There are few other functions available..
ellipsis
New member
Posts: 5
Joined: Sat Dec 17, 2011 11:33 pm

Post by ellipsis »

Oh, sorry. I never realised it wasn't ported. That makes me feel a little better for not getting it to work.
Has anyone else made libraries for it?
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

The much simpler 'games.h' should work. Try compiling 'dstar.c' or the examples in the 'graphics' folder.
ellipsis
New member
Posts: 5
Joined: Sat Dec 17, 2011 11:33 pm

Post by ellipsis »

That's really helpful, I never noticed those examples or games.h.
Esh, I feel silly now.
Thank you.
ellipsis
New member
Posts: 5
Joined: Sat Dec 17, 2011 11:33 pm

Post by ellipsis »

Sorry, I'm back. Games.h and the examples were very helpful, however I can't seem to find a way to check for input without causing a pause.
Stdio.h talkings about a difference between getk() and getkey(), where getk shouldn't cause a pause, however from my testing it does.
It doesn't seem possible to find out what is being pressed without pausing the game? (None of the examples are real-time so I haven't been able to find out from those).
Is this possible?
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

You could be right, to get the most portable way between all the shells could have had this kind of drawbacks. I'll google around and see if there is a way.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

If you are thinking at a simple game I see there could be a way: have you tried the 'joystick()' function ?
Looking at the code it looks I chose the direct-input way:

http://z88dk.cvs.sourceforge.net/viewvc ... iew=markup
ellipsis
New member
Posts: 5
Joined: Sat Dec 17, 2011 11:33 pm

Post by ellipsis »

Thanks. I'll try that when I get the chance.
Post Reply