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.
C calculatorcalculator-gamescasiochesscrossy-roaddrive-madfx-cg50gamesgeometry-dashgraphing-calculatorndlessnumworksnumworks-appsnumworks-calculatornumworks-gamenumworks-gamestetristi-84-plus-ceti-nspire
Build in build/data: Balatro's texts find their header from any folder, and the paths in the docs and tests
Mason3637c504c43d936
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 4e6d596c..69322ae0 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -36,7 +36,7 @@ Then:| `make lang NWLINK=nwlink` | The French and Chinese versions || `make -C games/<game> NWLINK=nwlink` | One game on its own || `make -C games/<game> test` | That game's tests on your computer (most games have them) |-| `python3 tests/test_games.py build/apps` | Plays every app in the emulator and checks its saves |+| `python3 tests/test_games.py build/compiled/games` | Plays every app in the emulator and checks its saves || `python3 tools/emu.py app.nwa --ms 5000 --shots 2000 --out shots` | Runs any `.nwa` in the emulator and takes pictures || `python3 tools/emulator.py app.nwa` | The emulator in a window, to play with the mouse and keyboard; `--live` rebuilds as you save || `python3 tools/build.py` | Builds everything and puts the finished apps in `build/compiled/` (`--game ID` for one game, `--watch` to build again when you save) |diff --git a/Makefile b/Makefileindex 086cd67a..f97fd432 100644--- a/Makefile+++ b/Makefile@@ -1,8 +1,9 @@# NumPlay: one launcher app with every game, plus each game on its own.#-# make build/NumPlay*.nwa and build/apps/*.nwa (the release files)+# make build/data/NumPlay*.nwa and build/data/apps/*.nwa (python3 tools/build.py also puts the+# finished ones in build/compiled: the NumPlays, and each game in build/compiled/games)# make check link the NumPlay apps like the calculator does, print sizes, check RAM-# make sim build/NumPlay.nwb for the Epsilon simulator+# make sim build/data/NumPlay.nwb for the Epsilon simulator# make emu run NumPlay.nwa in the ARM emulator (tools/emu.py)# make clean#diff --git a/games/balatro/Makefile b/games/balatro/Makefileindex 3201f4f1..f627e4b2 100644--- a/games/balatro/Makefile+++ b/games/balatro/Makefile@@ -17,7 +17,7 @@ ifeq ($(shell grep -q 'define NP_TEXT_EXTRA 1' ../common/np_text.h && echo 1),1)SRC += $(BUILD_DIR)/texts.cendif-CFLAGS = -std=c99 $(shell $(NWLINK) eadk-cflags-device)+CFLAGS = -std=c99 -Isrc $(shell $(NWLINK) eadk-cflags-device)CFLAGS += -Os -Wall -fno-math-errno -fno-tree-loop-distribute-patterns -fno-reorder-functions -flto-partition=oneCFLAGS += -flto -fno-fat-lto-objects -fwhole-program -fvisibility=internal $(EXTRA)LDFLAGS = -Wl,--relocatable -nostartfiles --specs=nano.specsdiff --git a/games/balatro/tools/mktexts.py b/games/balatro/tools/mktexts.pyindex 2e7d30e6..b4e0a15b 100644--- a/games/balatro/tools/mktexts.py+++ b/games/balatro/tools/mktexts.py@@ -46,7 +46,7 @@ def main():for a, b in pairs:packed += bytes([a & 255, a >> 8 | (b & 15) << 4, b >> 4])c = ["/* Made by tools/mktexts.py from src/texts.h (translated): Balatro's texts in this language. */",- '#include "../src/data.h"', ""]+ '#include "data.h"', ""]c.append("static const uint8_t lang_blob[%d] = {" % len(blob))for i in range(0, len(blob), 24):c.append(" " + ",".join(str(v) for v in blob[i:i + 24]) + ",")diff --git a/games/tetris/README.md b/games/tetris/README.mdindex 2201b89f..d672ecbe 100644--- a/games/tetris/README.md+++ b/games/tetris/README.md@@ -24,6 +24,6 @@ The original is released into the public domain ([UNLICENSE](UNLICENSE)). This c## Build-`cargo build --release` (Rust with the `thumbv7em-none-eabihf` target, `arm-none-eabi-gcc` and `nwlink` in the path) writes the app to `target/thumbv7em-none-eabihf/release/tetris`. From the NumPlay root, `make apps` copies it to `build/apps/Tetris.nwa`.+`cargo build --release` (Rust with the `thumbv7em-none-eabihf` target, `arm-none-eabi-gcc` and `nwlink` in the path) writes the app to `target/thumbv7em-none-eabihf/release/tetris`. From the NumPlay root, `python3 tools/build.py` puts it in `build/compiled/games/Tetris.nwa`.`numworks_utils` and `nppm_decoder` are Tatone26's libraries from the same repository.diff --git a/tests/test_games.py b/tests/test_games.pyindex 65dd601b..b9999c6a 100644--- a/tests/test_games.py+++ b/tests/test_games.py@@ -11,7 +11,7 @@ what used to crash calculators or lose saves:untouched, and a file added after the save does not stop the game fromupdating it on the second run.-Usage: test_games.py build/apps [--game NAME] [--out DIR]+Usage: test_games.py build/compiled/games [--game NAME] [--out DIR]"""import argparseimport jsondiff --git a/tests/test_numblocks_progress.py b/tests/test_numblocks_progress.pyindex 548c60bd..7f5aca9a 100644--- a/tests/test_numblocks_progress.py+++ b/tests/test_numblocks_progress.py@@ -11,7 +11,7 @@ numblocks_saves.py. In the ARM emulator:2. "install again" (every file but the scripts deleted): started again, thesaves come back byte for byte and the other script is untouched.-Usage: test_numblocks_progress.py build/apps/NumBlocks.nwa [--out DIR]+Usage: test_numblocks_progress.py build/compiled/games/NumBlocks.nwa [--out DIR]"""import argparseimport base64diff --git a/tests/test_progress.py b/tests/test_progress.pyindex 2e5a6eb3..797e2888 100644--- a/tests/test_progress.py+++ b/tests/test_progress.py@@ -13,7 +13,7 @@ numplay_saves.py. In the ARM emulator:4. holding OK resets the game, and the copy follows: after another update,the game starts over while the others keep their progress.-Usage: test_progress.py build/NumPlay.nwa [--out DIR]+Usage: test_progress.py build/compiled/NumPlay.nwa [--out DIR]"""import argparseimport base64diff --git a/tests/test_small_ram.py b/tests/test_small_ram.pyindex 40cebeab..a444fdad 100644--- a/tests/test_small_ram.py+++ b/tests/test_small_ram.py@@ -6,7 +6,7 @@ with less, and its games use the RAM after it up to the end of what there is (to2. with 120000 bytes, NumBlocks doesn't fit: OK on its card doesn't start it (the card says how much it lacks),while NumDash, which fits, starts and makes no access outside the app's RAM.-Usage: test_small_ram.py build/NumPlay.nwa [--out DIR]+Usage: test_small_ram.py build/compiled/NumPlay.nwa [--out DIR]"""import argparseimport osdiff --git a/tests/test_uninstall.py b/tests/test_uninstall.pyindex a2db0a05..6b2db523 100644--- a/tests/test_uninstall.py+++ b/tests/test_uninstall.py@@ -9,7 +9,7 @@ what happened to the flash and to the calculator's files.record lookup cache no longer points into moved data;- relaunching NumPlay shows the game gone and does not touch the flash again.-Usage: test_uninstall.py build/NumPlay.nwa [--out DIR]+Usage: test_uninstall.py build/compiled/NumPlay.nwa [--out DIR]"""import argparseimport jsondiff --git a/tests/test_upsilon.py b/tests/test_upsilon.pyindex c433d647..6244ea4f 100644--- a/tests/test_upsilon.py+++ b/tests/test_upsilon.py@@ -8,7 +8,7 @@there, launcher/src/compat.c);4. Home quits.-Usage: test_upsilon.py build/NumPlay-Upsilon.nwa [--out DIR]+Usage: test_upsilon.py build/compiled/NumPlay-Upsilon.nwa [--out DIR]"""import argparseimport osdiff --git a/tools/record.py b/tools/record.pyindex b247160c..007d550a 100644--- a/tools/record.py+++ b/tools/record.py@@ -6,7 +6,7 @@ screen as it runs (see launcher/sim/sim.c); this turns the frames into PNGscreenshots and GIFs.Usage:- record.py --simulator PATH/Epsilon --nwb build/NumPlay.nwb \+ record.py --simulator PATH/Epsilon --nwb build/data/NumPlay.nwb \--keys "1500-1600:right,3000:ok" --out docs/raw \[--png 1200:home.png,3400:game.png] [--gif 500-4000:carousel.gif] [--fps 30] [--scale 2]"""@@ -81,7 +81,7 @@ def save_gif(frames, path, scale, fps):def main():ap = argparse.ArgumentParser()ap.add_argument("--simulator", default=os.environ.get("EPSILON"))- ap.add_argument("--nwb", default="build/NumPlay.nwb")+ ap.add_argument("--nwb", default="build/data/NumPlay.nwb")ap.add_argument("--keys", help="scripted keys for the simulator")ap.add_argument("--frames", help="use raw frames already recorded (tools/emu.py, tools/media) instead")ap.add_argument("--end", type=int, default=0)diff --git a/tools/release.py b/tools/release.pyindex 81338516..907211f0 100644--- a/tools/release.py+++ b/tools/release.py@@ -10,7 +10,7 @@ link to each file, and every file gets a label saying what it is.then the list;- prints one `path#label` per line, the arguments of `gh release create`.-Usage: release.py --tag v1.3.0 --notes build/release-notes.md+Usage: release.py --tag v1.3.0 --notes build/data/release-notes.md --build build/compiled"""import argparseimport json