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.

Cat Ninja: How to play page in one gradient, its emulator test

Mason3632f7ec970c8b7
diff --git a/games/catninja/Makefile b/games/catninja/Makefile
index 31831e5d..63ea054c 100644
--- a/games/catninja/Makefile
+++ b/games/catninja/Makefile
@@ -25,6 +25,7 @@ CFLAGS = -std=gnu11 $(shell $(NWLINK) eadk-cflags-device) -DPLATFORM_DEVICE=1 -D
CFLAGS += -Os -Wall -Wextra -Wno-unused-parameter -fno-math-errno
CFLAGS += -fno-tree-loop-distribute-patterns -flto -fno-fat-lto-objects -fwhole-program -fvisibility=internal
CFLAGS += -ffunction-sections -fdata-sections
+CFLAGS += $(if $(PERF_LEVEL),-DPERF_LEVEL=$(PERF_LEVEL)) # (make perf PERF_LEVEL=n: that level straight away)
LDFLAGS = -Wl,--relocatable -nostartfiles --specs=nano.specs
LDFLAGS += -Wl,-e,main -Wl,-u,eadk_app_name -Wl,-u,eadk_app_icon -Wl,-u,eadk_api_level
LDFLAGS += -Wl,--gc-sections -flinker-output=nolto-rel
diff --git a/games/catninja/src/main.c b/games/catninja/src/main.c
index 96d1e25b..20ce6124 100644
--- a/games/catninja/src/main.c
+++ b/games/catninja/src/main.c
@@ -168,7 +168,7 @@ static const char *const help[] = {
static void scene(void *ctx) {
(void)ctx;
if (ov == OV_HELP) {
- gfx_vgrad(0, gfx_y0, 320, gfx_y1 - gfx_y0, 0x2A1450, 0x0C0618);
+ gfx_vgrad(0, 0, 320, 240, 0x2A1450, 0x0C0618);
text_c(&np_font_title, 160, 34, "How to play", HEX(0xE473EE));
for (int i = 0; i < (int)(sizeof help / sizeof help[0]); i++)
text_c(&np_font_small, 160, 62 + i * 18 + (i > 0) * 6, help[i], i ? HEX(0xFFFFFF) : HEX(0x12DFF5));
@@ -215,6 +215,12 @@ int main(void) {
draw_init();
load();
start_game();
+#ifdef PERF_LEVEL /* (make perf: a level straight away) */
+ {
+ extern void game_debug_goto(int lv);
+ game_debug_goto(PERF_LEVEL), sv.flags |= 1;
+ }
+#endif
if (!(sv.flags & 1)) ov = OV_HELP, help_back = OV_NONE, sv.flags |= 1;
uint32_t held = plat_keys(), stale = held, gheld = 0, last = plat_millis(), saved = last, acc = 0;
int up_held = 0, spawn_seen = P.spawnx * 7 + P.spawny * 3 + P.spawnlevel;
diff --git a/tests/test_games.py b/tests/test_games.py
index f0a72276..ac9c928c 100644
--- a/tests/test_games.py
+++ b/tests/test_games.py
@@ -670,8 +670,8 @@ CHECKS = {
"famidash": (lambda v: famidash_ok(v) and v[5] & 1 and struct.unpack_from("<I", v, 2100)[0] >= 7000,
lambda v: famidash_ok(v) and v[5] & 1 and struct.unpack_from("<I", v, 2100)[0] >= 12000),
# "CTN1", version 1: how to play read (flags at 5), in level 1 (the level at 9); after the reinstall, from the
- # copy, still there
- "catninja": (lambda v: catninja_ok(v) and v[5] & 1 and v[9] == 0, lambda v: catninja_ok(v) and v[5] & 1 and v[9] == 0),
+ # copy, back in it through the title map and on (level 1 or 2)
+ "catninja": (lambda v: catninja_ok(v) and v[5] & 1 and v[9] == 0, lambda v: catninja_ok(v) and v[5] & 1 and v[9] in (0, 1)),
"breakout": (lambda v: len(v) == 12 and v[:2] == b"B\2" and v[4] == 1 and struct.unpack_from("<I", v, 8)[0] >= 10,
lambda v: v[4] == 0 and struct.unpack_from("<I", v, 8)[0] >= 1), # best kept, shake off
# Air Hockey and the easy computer chosen; then the normal computer and Tanks, the tallies of the six games kept