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
Merge Cat Ninja
Mason3630ffc8e4ba516
diff --cc Makefileindex abdfafde,7b137f68..0aa08090--- a/Makefile+++ b/Makefile@@@ -18,7 -18,7 +18,7 @@@ PY ?= pythonCARGO ?= cargoB = build/data# Conventional games honor a configurable output directory; special layouts are kept local.- GAMES_REDIRECT = angrybirds badtime balatro blockblast breakout buckshot celeste championisland chess clashroyale connectfour cookieclicker coreball dinorun donkeykong doodlejump doom dune famidash finalearth2 flappybird flappydunk fnaf fnaf2 fnaf3 fnaf4 fnf g2048 hillclimb hollowknight invaders isaac jetpackjoyride leveldevil mahjong meowdoku minesweeper monkeymart numblocks numpowder numvisuals pacman paperclips polytrack portal pvz rider snake snowrider sokoban solitaire sonic stickmanhook subway sudoku suika templerun tombofthemask towerblock twoplayer undertale uno uttt-GAMES_REDIRECT = angrybirds badtime balatro blockblast breakout buckshot catninja celeste championisland chess connectfour cookieclicker coreball dinorun donkeykong doodlejump doom dune famidash finalearth2 flappybird flappydunk fnaf fnaf2 fnaf3 fnaf4 fnf g2048 hillclimb hollowknight invaders isaac jetpackjoyride leveldevil mahjong meowdoku minesweeper monkeymart numblocks numpowder numvisuals pacman paperclips polytrack portal pvz rider snake snowrider sokoban solitaire sonic stickmanhook subway sudoku suika templerun tombofthemask towerblock turborush twoplayer undertale uno uttt++GAMES_REDIRECT = angrybirds badtime balatro blockblast breakout buckshot catninja celeste championisland chess clashroyale connectfour cookieclicker coreball dinorun donkeykong doodlejump doom dune famidash finalearth2 flappybird flappydunk fnaf fnaf2 fnaf3 fnaf4 fnf g2048 hillclimb hollowknight invaders isaac jetpackjoyride leveldevil mahjong meowdoku minesweeper monkeymart numblocks numpowder numvisuals pacman paperclips polytrack portal pvz rider snake snowrider sokoban solitaire sonic stickmanhook subway sudoku suika templerun tombofthemask towerblock twoplayer undertale uno utttGAMES_OUT = dinorunGAME_REDIRECT_ARG = $(if $(filter $(1),$(GAMES_OUT)),OUT=../../$(B)/games/$(1),BUILD_DIR=../../$(B)/games/$(1))# the RAM the oldest calculator software that runs apps gives them (23.2: 148928 bytes; 25.2 gives 153676).@@@ -29,7 -29,7 +29,7 @@@ RAM_LIMIT = 14892# custom builds of Epsilon 25.2's source give apps less: 133652 bytes; every game fits there too, in NumPlay and on# its own (their big buffers are on the stack, 32 KB apart from that RAM, or in the RAM the software has left)CUSTOM_RAM = 133652- BIG_APPS = Celeste HollowKnight Undertale ChampionIsland FinalEarth2 NumPowder NumBlocks NumDrive SubwaySurfers FiveNightsAtFreddys Doom BindingOfIsaac HillClimbRacing PlantsVsZombies SonicTheHedgehog CookieClicker LevelDevil JetpackJoyride StickmanHook DonkeyKong Dune MonkeyMart TombOfTheMask UNO FridayNightFunkin AngryBirds PolyTrack UniversalPaperclips BadTimeSimulator Mahjong Rider SnowRider3D TempleRun FiveNightsAtFreddys2 FiveNightsAtFreddys3 FiveNightsAtFreddys4 Famidash ClashRoyale UniversalPaperclips-French-BIG_APPS = Celeste HollowKnight Undertale ChampionIsland FinalEarth2 NumPowder NumBlocks NumDrive SubwaySurfers FiveNightsAtFreddys Doom BindingOfIsaac HillClimbRacing PlantsVsZombies SonicTheHedgehog CookieClicker LevelDevil JetpackJoyride StickmanHook DonkeyKong Dune MonkeyMart TombOfTheMask UNO FridayNightFunkin TurboRush AngryBirds PolyTrack UniversalPaperclips BadTimeSimulator Mahjong Rider SnowRider3D TempleRun FiveNightsAtFreddys2 FiveNightsAtFreddys3 FiveNightsAtFreddys4 Famidash CatNinja UniversalPaperclips-French++BIG_APPS = Celeste HollowKnight Undertale ChampionIsland FinalEarth2 NumPowder NumBlocks NumDrive SubwaySurfers FiveNightsAtFreddys Doom BindingOfIsaac HillClimbRacing PlantsVsZombies SonicTheHedgehog CookieClicker LevelDevil JetpackJoyride StickmanHook DonkeyKong Dune MonkeyMart TombOfTheMask UNO FridayNightFunkin AngryBirds PolyTrack UniversalPaperclips BadTimeSimulator Mahjong Rider SnowRider3D TempleRun FiveNightsAtFreddys2 FiveNightsAtFreddys3 FiveNightsAtFreddys4 Famidash ClashRoyale UniversalPaperclips-French CatNinja# the calculator's space for installed apps: from the end of its software (64 KiB aligned) to 64 KiB before the# end of its 4 MiB slot of flash, 0x903F0000. The software's size sets the start: 0x90200000 is the latest a# NumPlay counts on (1.94 MB, APP_SPACE); Epsilon 26.4 on an N0120 ends at 0x90180000 (2.44 MB, the@@@ -47,7 -47,7 +47,7 @@@ XL_APP_SPACE = 629145# the spaces the customizer website offers (kit.json "spaces"; tools/kit.py links a NumPlay at each)SPACES = std:$(APP_START):$(APP_END) e26:$(APP_START_26):$(APP_END) xl:$(APP_START):$(XL_END) xl26:$(APP_START_26):$(XL_END)# big games that must install on their own without Enlarged Extra Apps: make check holds them to APP_SPACE- APP_SPACE_APPS = HillClimbRacing FridayNightFunkin AngryBirds PolyTrack UniversalPaperclips UniversalPaperclips-French BadTimeSimulator Mahjong SnowRider3D TempleRun Famidash-APP_SPACE_APPS = HillClimbRacing FridayNightFunkin TurboRush AngryBirds PolyTrack UniversalPaperclips UniversalPaperclips-French BadTimeSimulator Mahjong SnowRider3D TempleRun Famidash CatNinja++APP_SPACE_APPS = HillClimbRacing FridayNightFunkin AngryBirds PolyTrack UniversalPaperclips UniversalPaperclips-French BadTimeSimulator Mahjong SnowRider3D TempleRun Famidash CatNinja# Upsilon, the N0110 and N0115's custom software, gives .nwa apps less RAM: NumPlay-Upsilon.nwa has# the games that fit it (NumPlay draws their text there: see launcher/src/compat.c)UPSILON_RAM = 107674@@@ -336,7 -337,7 +336,8 @@@ APP_fnaf2 = $(B)/games/fnaf2/fnaf2.nwa:APP_fnaf3 = $(B)/games/fnaf3/fnaf3.nwa:FiveNightsAtFreddys3.nwaAPP_fnaf4 = $(B)/games/fnaf4/fnaf4.nwa:FiveNightsAtFreddys4.nwaAPP_famidash = $(B)/games/famidash/famidash.nwa:Famidash.nwa+APP_clashroyale = $(B)/games/clashroyale/clashroyale.nwa:ClashRoyale.nwa+ APP_catninja = $(B)/games/catninja/catninja.nwa:CatNinja.nwa# the big games' modules are made from these (the kit)$(foreach g,$(XL_GAMES),$(eval MOD_$(g) = $$(word 1,$$(subst :, ,$$(APP_$(g))))))@@@ -384,7 -386,7 +385,8 @@@ apps: | $(B$(MAKE) -C games/fnaf3 build NWLINK="$(NWLINK)" BUILD_DIR=../../$(B)/games/fnaf3$(MAKE) -C games/fnaf4 build NWLINK="$(NWLINK)" BUILD_DIR=../../$(B)/games/fnaf4$(MAKE) -C games/famidash build NWLINK="$(NWLINK)" BUILD_DIR=../../$(B)/games/famidash+ $(MAKE) -C games/clashroyale build NWLINK="$(NWLINK)" BUILD_DIR=../../$(B)/games/clashroyale+ $(MAKE) -C games/catninja build NWLINK="$(NWLINK)" BUILD_DIR=../../$(B)/games/catninjacd games/tetris/tetris && NWLINK="$(NWLINK)" $(CARGO) build --release --quietcp $(word 1,$(subst :, ,$(APP_numdash))) $(B)/apps/$(word 2,$(subst :, ,$(APP_numdash)))cp $(word 1,$(subst :, ,$(APP_crossyroad))) $(B)/apps/$(word 2,$(subst :, ,$(APP_crossyroad)))@@@ -431,7 -434,7 +433,8 @@@cp $(word 1,$(subst :, ,$(APP_fnaf3))) $(B)/apps/$(word 2,$(subst :, ,$(APP_fnaf3)))cp $(word 1,$(subst :, ,$(APP_fnaf4))) $(B)/apps/$(word 2,$(subst :, ,$(APP_fnaf4)))cp $(word 1,$(subst :, ,$(APP_famidash))) $(B)/apps/$(word 2,$(subst :, ,$(APP_famidash)))+ cp $(word 1,$(subst :, ,$(APP_clashroyale))) $(B)/apps/$(word 2,$(subst :, ,$(APP_clashroyale)))+ cp $(word 1,$(subst :, ,$(APP_catninja))) $(B)/apps/$(word 2,$(subst :, ,$(APP_catninja)))arm-none-eabi-strip --strip-unneeded $(B)/apps/Tetris.nwaSTD_APPS = $(foreach g,$(STD_GAMES),$(B)/apps/$(NWA_$(g)))@@@ -518,6 -522,6 +521,7 @@@ clean-$(MAKE) -C games/fnaf3 clean-$(MAKE) -C games/fnaf4 clean-$(MAKE) -C games/famidash clean+ -$(MAKE) -C games/clashroyale clean+ -$(MAKE) -C games/catninja clean-cd games/tetris/tetris && $(CARGO) clean-$(foreach g,$(STD_GAMES),$(MAKE) -C games/$(g) clean;)diff --cc docs/play.mdindex ad3677d7,8665a8b5..7c145a95--- a/docs/play.md+++ b/docs/play.md@@@ -790,23 -807,26 +790,41 @@@ Your icon moves on by itself: jump ove<br clear="right">+## Clash Royale++<img src="../games/clashroyale/docs/shot.png" width="320" align="right" alt="Clash Royale: troops at the bridge, the bot's towers on the right">++| Key | What it does |+| --- | --- |+| **1** to **4** | Pick a card of your hand |+| **Left / Right**, **OK** | Pick a card, then take it to the field |+| **Arrows** | Move the card on the field |+| **OK** | Drop it there |+| **Back** | Put the card back; in the hand, pause |+| **Home** | Keep the battle and quit |++Knock down the bot's towers before it knocks down yours: a Princess tower is a crown, the King tower is three and ends the battle. Elixir fills up by itself and pays for your cards; a played card goes to the back of your deck and the next takes its place. Troops and buildings go on your side of the river, spells anywhere. The last minute gives double elixir; even crowns at the end bring overtime, where the next crown wins. Wins give trophies, and trophies open the next arena. Build your deck of eight from the 41 cards in Deck.++<br clear="right">++ ## Cat Ninja++ <img src="../games/catninja/docs/shot.png" width="320" align="right" alt="Cat Ninja: the cat wall jumps up a shaft in level 2">+-Cat Ninja comes as its own app, `CatNinja.nwa`: install it on its own.-+ | Key | What it does |+ | --- | --- |+ | **Left / Right** (or 4 / 6) | Run |+ | **Up**, **OK** or **EXE** (or 8) | Jump; again in the air: double jump; against a wall: wall jump |+ | **Down** (or 2) | Roll (hold it and run); in the air: slam |+ | **Shift** | Jetpack on or off |+ | **⌫** (backspace) | Back to the last checkpoint |+ | **Back** | Pause: Resume, Retry, Title, How to play, Quit game |+ | **Home** | Save and quit |++ Walk right from the title map. Each level leads into the next: get through its spikes, lasers, mines and shooters, and grab the crystals on the way. Jump from wall to wall to climb (not on the sticky green walls). A slam breaks glass and presses red buttons. Gravity changers turn the whole world round. Die and you go back to the last checkpoint. Collect more than 20 of the 50 crystals before the end to save the world.++ <br clear="right">+## Portal Returns<img src="media/portal.gif" width="320" align="right" alt="Portal Returns: falling through a portal and flying across a test chamber">diff --cc games/games.jsonindex 3331f96b,06e18903..4890698b--- a/games/games.json+++ b/games/games.json@@@ -1429,27 -1449,26 +1429,48 @@@"repo": "https://github.com/Mason363/NumPlay/tree/main/games/famidash","default": false,"xl": true+ },+ {+ "id": "clashroyale",+ "rank": 37,+ "title": "Clash Royale",+ "tagline": "Knock down the towers",+ "credit": "Based on the game by Supercell",+ "top": "0x2E5CB8",+ "bottom": "0x0C1A3C",+ "accent": "0xFFC832",+ "colors": 16,+ "records": [+ "clashroyale.sav",+ "crresume.sav",+ "clashroyale_saves.py"+ ],+ "shots": [+ "docs/shot.png"+ ],+ "repo": "https://github.com/Mason363/NumPlay/tree/main/games/clashroyale",+ "default": false,+ "xl": true+ },+ {+ "id": "catninja",- "rank": 37,++ "rank": 38,+ "title": "Cat Ninja",+ "tagline": "Wall jumps, traps and 50 crystals",+ "credit": "Based on Cat Ninja by Richman Stewart",+ "top": "0x7B3FC4",+ "bottom": "0x2A1450",+ "accent": "0xE473EE",+ "colors": 16,+ "records": [+ "catninja.sav",+ "catninja_saves.py"+ ],+ "shots": [+ "docs/shot.png"+ ],+ "repo": "https://github.com/Mason363/NumPlay/tree/main/games/catninja",+ "default": false,+ "xl": true}]diff --cc tests/test_games.pyindex 41829392,ac9c928c..5c9aecac--- a/tests/test_games.py+++ b/tests/test_games.py@@@ -312,15 -316,15 +312,20 @@@ GAMES =presses((1500, "ok"), (2200, "ok"), (3000, "ok"), (4000, "ok"), (8000, "back"))+ [(5000, 7000, K["ok"])], 9000,presses((1500, "ok"), (2500, "ok")) + [(3500, 5500, K["ok"])], 6500),+ # a level, its message, then play; then back to the level select+ "portal": ("PortalReturns.nwa", "portal.sav",+ presses((1500, "ok"), (2500, "ok"), (3500, "ok")) + every(4000, 7000, 400, "right", 300), 8000,+ presses((1500, "ok")), 4000),+ # Battle: how to play (the first time), then the battle: a card dropped at the bridge; Home keeps the battle and the+ # profile. Next time, from the copy, Battle goes straight in, quit with On/Off+ "clashroyale": ("ClashRoyale.nwa", "clashroyale.sav",+ presses((1500, "ok"), (2200, "ok"), (4000, "1"), (4400, "ok"), (6500, "2"), (6900, "ok")), 9000,+ presses((1500, "ok")), 5000),+ # how to play (the first time), then right through the title map into level 1, Back to pause; Home keeps it.+ # Next time, from the copy, right again: the title map's way back to level 1+ "catninja": ("CatNinja.nwa", "catninja.sav",+ presses((1500, "ok"), (9500, "back")) + [(2500, 9000, K["right"])], 10000,+ [(1500, 6000, K["right"])], 6500),- # a level, its message, then play; then back to the level select- "portal": ("PortalReturns.nwa", "portal.sav",- presses((1500, "ok"), (2500, "ok"), (3500, "ok")) + every(4000, 7000, 400, "right", 300), 8000,- presses((1500, "ok")), 4000),}@@@ -388,7 -392,7 +393,8 @@@ COPIES = {"championisland": "champion_s"badtime": "badtime_saves.py", "mahjong": "mahjong_saves.py","rider": "rider_saves.py", "snowrider": "snowrider_saves.py", "templerun": "templerun_saves.py","fnaf2": "fnaf2_saves.py", "fnaf3": "fnaf3_saves.py", "fnaf4": "fnaf4_saves.py", "famidash": "famidash_saves.py",- "clashroyale": "clashroyale_saves.py"}++ "clashroyale": "clashroyale_saves.py",+ "catninja": "catninja_saves.py"}def paperclips_ok(v):@@@ -421,16 -425,16 +427,26 @@@ def famidash_ok(v)return struct.unpack_from("<I", v, len(v) - 4)[0] == h+def clashroyale_ok(v):+ """Clash Royale's profile: "CRY1", version 1, 48 bytes, an FNV-1a sum of the rest at the end"""+ if len(v) != 48 or v[:4] != b"CRY1" or struct.unpack_from("<HH", v, 4) != (1, 48):+ return False+ h = 2166136261+ for x in v[:-4]:+ h = (h ^ x) * 16777619 & 0xFFFFFFFF+ return struct.unpack_from("<I", v, 44)[0] == h+++ def catninja_ok(v):+ """Cat Ninja's save: "CTN1", version 1, 40 bytes, an FNV-1a sum of the rest at the end"""+ if len(v) != 40 or v[:4] != b"CTN1" or v[4] != 1:+ return False+ h = 2166136261+ for x in v[:-4]:+ h = (h ^ x) * 16777619 & 0xFFFFFFFF+ return struct.unpack_from("<I", v, len(v) - 4)[0] == h++def badtime_ok(v):"""Bad Time Simulator's save: "BTS1", version 1, 24 bytes, an FNV-1a sum of the rest at the end"""if len(v) != 24 or v[:4] != b"BTS1" or struct.unpack_from("<HH", v, 4) != (1, 24):@@@ -659,8 -669,9 +675,11 @@@ CHECKS =# "FMD1", version 1: how to play read (flags at 5), time played (564); after the reinstall, from the copy, more"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),+ # "CRY1", version 1, its size (48): how to play read (guide at 40); after the reinstall, from the copy+ "clashroyale": (lambda v: clashroyale_ok(v) and v[40] == 1,) * 2,+ # "CTN1", version 1: how to play read (flags at 5), in level 1 (the level at 9); after the reinstall, from the+ # 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 keptdiff --cc tools/release.pyindex 5cf389b6,24ca3edd..d4871778--- a/tools/release.py+++ b/tools/release.py@@@ -63,7 -64,7 +63,8 @@@ ALONE ="fnaf3": ("Five Nights at Freddy's 3", "Fazbear's Fright's six nights with Springtrap and the phantoms: the lure, the vents, the maintenance panel"),"fnaf4": ("Five Nights at Freddy's 4", "the bedroom's nights with the Nightmares: listen at the doors, the closet, the bed, Fun with Plushtrap"),"famidash": ("Famidash", "TFDSoft's Geometry Dash for the NES, made for the calculator: the 173 levels of Famidash HUGE, every mode, practice mode"),+ "clashroyale": ("Clash Royale", "battles against a bot: 41 cards of the 2016 game, its seven arenas, elixir, crowns and trophies"),+ "catninja": ("Cat Ninja", "Richman Stewart's Flash platformer: its 30 levels of wall jumps and traps, the boss and the crystals"),}VARIANTS = [("NumPlay-Invisible.nwa", "The same app, hidden: a blank icon with no name"),