- Unicorn's C Help and Explorations [TI 84+ CE] [PC] [Arduino]
- 26 Apr 2016 02:23:25 pm
- Last edited by Unicorn on 19 Jul 2016 10:58:57 am; edited 3 times in total
Hi everyone! As you may know, I have been delving into C for the CE and for the PC/Arduino, but I've been having some questions. So instead of asking on IRC, I decided to create a topic so I have something to go back to and I don't have to ask the same question over and over again when I forget something 🙂
I've also decided to post about the programs I've made just experimenting here. If I start an actual one, I will make a topic
How to set up Debug Mode for CEmu
How to Store and Retrieve Highscores or Variables from an AppVar
Thanks in advance 🙂
I've also decided to post about the programs I've made just experimenting here. If I start an actual one, I will make a topic
How to set up Debug Mode for CEmu
- 1) Enable it in the makefile DEBUGMODE ?= DEBUG
2) Add #include <debug.h> to the source files
3) Use this code for variables. dbg_sprintf(dbgout, "%d\n", variableName);
4) Use this code for text. dbg_sprintf(dbgout, "Hi\n");
How to Store and Retrieve Highscores or Variables from an AppVar
- 1) Declare file as a ti_var_t variable, and highscore as an uint8_t
2) When you want to store a value to the appvar, use this code. Interchange highscore with the name of your variable getting stored, and scorevar with the name of your appvar.
Code:
ti_CloseAll();
file = ti_Open("scorevar", "w");
if (file)
ti_Write(&highscore, sizeof(highscore), 1, file);
}Code:
ti_CloseAll();
file = ti_Open("scorevar", "r");
if (file) {
ti_Read(&highscore, sizeof(highscore), 1, file);
}Thanks in advance 🙂





