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?
Cant get any input to work on the 83-plus. Any help would be great ^^
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?
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?
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
Looking at the code it looks I chose the direct-input way:
http://z88dk.cvs.sourceforge.net/viewvc ... iew=markup