Skip to content

Free games for graphing calculators: NumWorks, TI-Nspire CX, Casio fx-CG50 and soon TI-84 Plus CE. Balatro, Celeste, Hollow Knight, Minecraft and more.

TI-84 CE: Doodle Jump, Suika Game, Tower Blocks and Flappy Dunk keep their saves

Mason3634226c1806456
diff --git a/games/doodlejump/src/main.c b/games/doodlejump/src/main.c
index 4cfdf571..f565d718 100644
--- a/games/doodlejump/src/main.c
+++ b/games/doodlejump/src/main.c
@@ -71,7 +71,7 @@ typedef struct {
} mon_t;
/* doodlejump.sav: the best, and the climb in progress (kept when you leave) */
-static struct {
+static struct __attribute__((aligned(4))) { /* whole words, as the sum reads them (a TI-84 CE packs structs) */
uint8_t magic, version, flags, face; /* flags: 1 a climb to go on with, 2 the guide was read, 4 dead */
uint32_t sum; /* of the words after it: a damaged file starts afresh */
uint32_t best, score, rng;
diff --git a/games/flappydunk/src/main.c b/games/flappydunk/src/main.c
index 90397e15..380a9151 100644
--- a/games/flappydunk/src/main.c
+++ b/games/flappydunk/src/main.c
@@ -66,7 +66,7 @@ typedef struct {
} hoop_t;
/* flappydunk.sav: the records, the ball chosen, and the run in progress (kept when you leave) */
-static struct {
+static struct __attribute__((aligned(4))) { /* whole words, as the sum reads them (a TI-84 CE packs structs) */
uint8_t magic, version, flags, skin; /* flags: 1 a run to continue, 2 the guide was read */
uint32_t sum; /* of the words after it: a damaged file starts afresh */
uint32_t best, swishes, games, best_streak;
diff --git a/games/suika/Makefile b/games/suika/Makefile
index 272e9117..9adcb84e 100644
--- a/games/suika/Makefile
+++ b/games/suika/Makefile
@@ -86,5 +86,5 @@ test: build/play
# the other targets (platform/port.mk): make port TARGET=sdl, web, nspire, ti84ce
PORT_ID = suika
PORT_NAME = Suika Game
-PORT_SRC = src/main.c ../../launcher/src/gfx.c ../../launcher/src/xfont.c
+PORT_SRC = src/main.c ../../launcher/src/gfx.c ../../launcher/src/xfont.c ../../launcher/src/icons.c
include ../../platform/port.mk
diff --git a/games/suika/src/main.c b/games/suika/src/main.c
index bc78d09c..da1281d9 100644
--- a/games/suika/src/main.c
+++ b/games/suika/src/main.c
@@ -88,7 +88,7 @@ typedef struct {
int16_t v[7]; /* x, y, vx, vy, c, s, w, times scale[] */
uint8_t k, land;
} packed_t;
-static struct {
+static struct __attribute__((aligned(4))) { /* whole words, as the sum reads them (a TI-84 CE packs structs) */
uint8_t magic, version, flags, cur; /* cur: the fruit in (or coming to) the cloud */
uint8_t next, drop, pad[2]; /* drop: the falling fruit + 1 */
uint32_t sum; /* of the words after it: a damaged file starts afresh */
diff --git a/games/towerblock/src/main.c b/games/towerblock/src/main.c
index 3118d682..6ab601a8 100644
--- a/games/towerblock/src/main.c
+++ b/games/towerblock/src/main.c
@@ -56,7 +56,7 @@ typedef struct {
} slab_t;
/* towerblocks.sav: the best, and the tower in progress */
-static struct {
+static struct __attribute__((aligned(4))) { /* whole words, as the sum reads them (a TI-84 CE packs structs) */
uint8_t magic, version, flags, pad; /* flags: 1 a tower to go on with, 2 the guide was read */
uint32_t sum; /* of the words after it: a damaged file starts afresh */
uint32_t best, score, offset; /* offset: the colours' start, the original's colorOffset */