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.

Hollow Knight: charms can be changed at a bench again

Mason363a5de03973d52
diff --git a/games/hollowknight/README.md b/games/hollowknight/README.md
index 8155dcbb..41bb12a3 100644
--- a/games/hollowknight/README.md
+++ b/games/hollowknight/README.md
@@ -72,7 +72,7 @@ In menus, OK or EXE confirms and Back goes back. In the inventory, left and righ
## Good to know
* **One app at a time:** Hollow Knight takes all the room the calculator has for apps. Installing it from the NumWorks website swaps out NumPlay and the other apps, and installing NumPlay again swaps it back out. Your saves in each one are kept.
-* **Only the start of the game:** it ends with Hornet in Greenpath. The ways on to places further in stay shut, like Jiji's door, the lift down to the mines and the Dream Nail's paths.
+* **Only the start of the game:** it ends with Hornet in Greenpath. The ways on to places further in stay shut, like Jiji's door, the lift down to the mines and the Dream Nail's paths, and so do the Forgotten Crossroads' side rooms off the way to Greenpath, like Brooding Mawlek's and the Glowing Womb.
* **No music or sound:** the calculator has no speaker.
* **A few things are simpler:** dust, sparks and other particles are left out, and characters and scenery are drawn a little less finely so the whole game fits.
* **Busy rooms stay smooth:** when the calculator falls behind, the room is drawn at half the height, each line shown twice. The HUD, text and menus stay sharp.
diff --git a/games/hollowknight/src/npc.c b/games/hollowknight/src/npc.c
index acbbb1f8..af3ecb73 100644
--- a/games/hollowknight/src/npc.c
+++ b/games/hollowknight/src/npc.c
@@ -75,6 +75,7 @@ static void start_rest(Bench *b, const Ent *e) {
/* Rest Burst: health back, the bench the place to come back to, then the game saved */
static void rest_burst(Bench *b, const Ent *e) {
hero_max_health();
+ pd_set_flag(PDF_AT_BENCH, true); /* (atBench: the inventory opens, charms can be changed) */
b->sleeping = false, b->get_off_wake = false;
save_set_respawn(str_at(e->s0), b->face_right = g_hero.cs.facing_right);
persist_reset_semi();
@@ -84,6 +85,7 @@ static void rest_burst(Bench *b, const Ent *e) {
static void get_off(Bench *b, const Ent *e) {
/* Get Off: the Knight back down from the bench */
Hero *h = &g_hero;
+ pd_set_flag(PDF_AT_BENCH, false);
hero_gravity(true);
anim_play_from_frame(&h->anim, b->get_off_wake ? CLIP_KNIGHT_WAKE : CLIP_KNIGHT_GET_OFF, 0);
hud_slide(false);
@@ -272,6 +274,7 @@ bool bench_respawn(const char *name) {
hero_stop_anim_control();
hero_gravity(false);
hero_max_health();
+ pd_set_flag(PDF_AT_BENCH, true);
anim_play(&h->anim, CLIP_KNIGHT_SIT_FALL_ASLEEP);
h->body.vx = h->body.vy = 0;
b->sleeping = false, b->get_off_wake = false; /* (sleeping: here, once moved up) */
diff --git a/games/hollowknight/tests/check.py b/games/hollowknight/tests/check.py
index ef071b81..e186c770 100644
--- a/games/hollowknight/tests/check.py
+++ b/games/hollowknight/tests/check.py
@@ -7,6 +7,7 @@
a load
- a long walk of made up keys from every room: the Knight never out of the room, without control, wedged, undrawn or
out of the view
+- a bench: sat on, the inventory opened, a charm equipped, then up again (atBench off)
- every room played with its enemies hit, in a new game and after the bosses, drawn whole and fast (as a slow
calculator draws it): the sanitizers stop on any fault
"""
@@ -19,7 +20,9 @@ from concurrent.futures import ThreadPoolExecutor
PLAY, DATA = sys.argv[1], sys.argv[2]
WALKS = [(seed, 4000) for seed in range(1, 5)] # (seed, ticks of 20 ms)
SWEEP_KEYS = "_*30,R*120,A*3,J*25,L*200,A*4,_*60,R*60,J*30,A*3,_*900"
-WORLDS = ("", "7,11") # PlayerData bools on, by number: none, then the False Knight and Hornet beaten
+WORLDS = ("", "7,11")
+# Crossroads_47's bench: sit, the inventory, right to the charms, equip the first, close, get up
+BENCH_KEYS = "*60,U*3,*150,I*2,*60,R*2,*15,R*2,*15,R*2,*15,R*2,*30,O*2,*30,I*2,*60,R*2,*80" # PlayerData bools on, by number: none, then the False Knight and Hornet beaten
JOBS = os.cpu_count() or 2
@@ -50,6 +53,12 @@ def main():
with tempfile.TemporaryDirectory() as saves:
rc, out = play("--gates", "arenas", env={"HKSAVES": saves})
results.append(report("arenas", rc, out, ("FAIL",)))
+ # (HKFLAGS: a charm had, Gathering Swarm; HKPD: the bools on at the end, 77 its equipped one, 0 atBench)
+ rc, out = play("--room", "Crossroads_47", "--at", "29.3,6.5", "--play", BENCH_KEYS, env={"HKFLAGS": "3,37", "HKPD": "1"})
+ pd = next((l.split()[1:] for l in out.splitlines() if l.startswith("pd:")), [])
+ pd = pd[:next((i for i, t in enumerate(pd) if not t.isdigit()), len(pd))]
+ bench = "77" in pd and "0" not in pd
+ results.append(report("bench: a charm equipped", rc, out if bench else out + "\nFAIL bools on: " + " ".join(pd), ("FAIL",)))
with ThreadPoolExecutor(JOBS) as pool:
walks = list(pool.map(lambda w: play("--gates", "wander:all:%d:%d" % w, env={"HKFAST": "1"} if w[0] % 2 else None), WALKS))
for (seed, ticks), (rc, out) in zip(WALKS, walks):