1

Hi,

I'm not sure if people are still active on this forum, so thank you very much if you happen to see this. I need some help on two things, OSdequeue and kbd_queue().

In the latest version of GCC4TI, OSdequeue is documented as such:
cFmgDqR.png

This made me think OSdequeue was a C function and that I could simply use it like any other C function. Even the documentation shows an example of using it that way:
3iXFGMD.png

However, when I wrote the exact same code in the IDE that came with GCC4TI, the code failed to build. It threw one warning and one error:
Warning: Implicit declaration of function 'OSdequeue'.
Error: Unresolved reference to 'OSdequeue'.

I checked that I included <tigcclib.h> as well, so there should be no reason why OSdequeue is not resolved. To find out why, I cloned the latest GCC4TI repository from github, and looked in file system.h and found this line:
#define OSdequeue _rom_call(short,(__pushort,void*),3AA)

So OSdequeue is not a C function but a macro? That would explain why I get the errors in the IDE, but then how am I supposed to use OSdequeue as it is intended?

My second question is about the function kbd_queue(). The documentation says that it "returns a pointer to the queue used in TIOS for keyboard handling," but never mentions what that pointer exactly is. This means that I can't use OSdequeue to read in key inputs in assembly code, since I need to pass the keyboard queue pointer to OSdequeue. Again, I tried looking in the GCC4TI repository, but I couldn't find the implementation for kbd_queue(). I understand that a queue pointer would obviously change, but is there a pointer to the queue pointer anywhere in memory? Or is there a ROM call equivalent to kbd_queue() that I can use in assembly code?

I would love to be able to use both OSdequeue and kbd_queue together to achieve fast key reading, but the documentation's way is simply not possible for me right now because OSdequeue is broken in C and I don't know the keyboard queue pointer required for OSdequeue, so I can't write my program in assembly either.
avatar