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
Monkey Mart: wired in like the other big games, with its README, pictures and GIF
Mason363eff750c0a8ec
diff --git a/.github/workflows/build.yml b/.github/workflows/build.ymlindex ceaf6556..e2b9cdc7 100644--- a/.github/workflows/build.yml+++ b/.github/workflows/build.yml@@ -74,6 +74,7 @@ jobs:make -C games/jetpackjoyride host testmake -C games/donkeykong host testmake -C games/dune host test+ make -C games/monkeymart host testmake -C games/invaders host testmake -C games/sudoku host testmake -C games/uttt host testdiff --git a/Makefile b/Makefileindex 8a851a84..36062e12 100644--- a/Makefile+++ b/Makefile@@ -18,7 +18,7 @@ PY ?= python3CARGO ?= cargoB = build/data# Conventional games honor a configurable output directory; special layouts are kept local.-GAMES_REDIRECT = balatro blockblast breakout buckshot celeste championisland chess connectfour cookieclicker coreball dinorun donkeykong doodlejump doom dune finalearth2 flappybird flappydunk fnaf g2048 hillclimb hollowknight invaders isaac jetpackjoyride leveldevil minesweeper numblocks numpowder numvisuals pacman portal pvz snake sokoban solitaire sonic stickmanhook subway sudoku suika towerblock twoplayer undertale uttt+GAMES_REDIRECT = balatro blockblast breakout buckshot celeste championisland chess connectfour cookieclicker coreball dinorun donkeykong doodlejump doom dune finalearth2 flappybird flappydunk fnaf g2048 hillclimb hollowknight invaders isaac jetpackjoyride leveldevil minesweeper monkeymart numblocks numpowder numvisuals pacman portal pvz snake sokoban solitaire sonic stickmanhook subway sudoku suika towerblock twoplayer undertale 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 @@ RAM_LIMIT = 148928# 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+BIG_APPS = Celeste HollowKnight Undertale ChampionIsland FinalEarth2 NumPowder NumBlocks NumDrive SubwaySurfers FiveNightsAtFreddys Doom BindingOfIsaac HillClimbRacing PlantsVsZombies SonicTheHedgehog CookieClicker LevelDevil JetpackJoyride StickmanHook DonkeyKong Dune MonkeyMart# the calculator's space for installed apps (0x90200000 to 0x903F0000 in its flash)APP_SPACE = 2031616# with Enlarged Extra Apps (nwagyu's Nwagra), the app loader is told the space goes on to the end of the@@ -293,6 +293,7 @@ APP_jetpackjoyride = $(B)/games/jetpackjoyride/jetpackjoyride.nwa:JetpackJoyrideAPP_stickmanhook = $(B)/games/stickmanhook/stickmanhook.nwa:StickmanHook.nwaAPP_donkeykong = $(B)/games/donkeykong/donkeykong.nwa:DonkeyKong.nwaAPP_dune = $(B)/games/dune/dune.nwa:Dune.nwa+APP_monkeymart = $(B)/games/monkeymart/monkeymart.nwa:MonkeyMart.nwa# the big games' modules are made from these (the kit)$(foreach g,$(XL_GAMES),$(eval MOD_$(g) = $$(word 1,$$(subst :, ,$$(APP_$(g))))))@@ -324,6 +325,7 @@ apps: | $(B)$(MAKE) -C games/stickmanhook build NWLINK="$(NWLINK)" BUILD_DIR=../../$(B)/games/stickmanhook$(MAKE) -C games/donkeykong build NWLINK="$(NWLINK)" BUILD_DIR=../../$(B)/games/donkeykong$(MAKE) -C games/dune build NWLINK="$(NWLINK)" BUILD_DIR=../../$(B)/games/dune+ $(MAKE) -C games/monkeymart build NWLINK="$(NWLINK)" BUILD_DIR=../../$(B)/games/monkeymartcd 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)))@@ -353,6 +355,7 @@ apps: | $(B)cp $(word 1,$(subst :, ,$(APP_stickmanhook))) $(B)/apps/$(word 2,$(subst :, ,$(APP_stickmanhook)))cp $(word 1,$(subst :, ,$(APP_donkeykong))) $(B)/apps/$(word 2,$(subst :, ,$(APP_donkeykong)))cp $(word 1,$(subst :, ,$(APP_dune))) $(B)/apps/$(word 2,$(subst :, ,$(APP_dune)))+ cp $(word 1,$(subst :, ,$(APP_monkeymart))) $(B)/apps/$(word 2,$(subst :, ,$(APP_monkeymart)))arm-none-eabi-strip --strip-unneeded $(B)/apps/Tetris.nwaSTD_APPS = $(foreach g,$(STD_GAMES),$(B)/apps/$(NWA_$(g)))@@ -422,5 +425,6 @@ clean:-$(MAKE) -C games/stickmanhook clean-$(MAKE) -C games/donkeykong clean-$(MAKE) -C games/dune clean+ -$(MAKE) -C games/monkeymart clean-cd games/tetris/tetris && $(CARGO) clean-$(foreach g,$(STD_GAMES),$(MAKE) -C games/$(g) clean;)diff --git a/docs/media/monkeymart.gif b/docs/media/monkeymart.gifnew file mode 100644index 00000000..e0dc789fBinary files /dev/null and b/docs/media/monkeymart.gif differdiff --git a/games/monkeymart/README.md b/games/monkeymart/README.mdindex e9276c31..1af32f6d 100644--- a/games/monkeymart/README.md+++ b/games/monkeymart/README.md@@ -1,98 +1,83 @@-# Monkey Mart+> **Monkey Mart is a [NumPlay](../../README.md) game that comes on its own.** It is too big to fit next to NumPlay on the calculator. Get `MonkeyMart.nwa` from the [latest release](https://github.com/Mason363/NumPlay/releases/latest).++<p align="center">+ <img src="src/icon.png" width="84" alt="Monkey Mart icon">+</p>++<h1 align="center">Monkey Mart</h1>++<p align="center">+ <b>Run a grocery mart as a monkey, on the NumWorks calculator.</b><br>+ Both marts of TinyDobbins' web game: crops, animals, machines, customers and workers.+</p>++<p align="center">+ <a href="https://github.com/Mason363/NumPlay/releases/latest/download/MonkeyMart.nwa"><b>Download MonkeyMart.nwa</b></a>+ · <a href="#controls">Controls</a>+</p>++<p align="center">+ <img src="../../docs/media/monkeymart.gif" width="640" alt="Monkey Mart: the monkey picks bananas and corn, fills the shelves and takes the money at the till while customers shop">+</p>++## Highlights++* **Both marts:** the first one sells bananas, corn, eggs, milk, popcorn and yogurt; the truck takes you to the second, with cocoa, coffee beans, peanuts, chocolate, ground coffee, peanut butter, cappuccino and chocolate bars.+* **Everything by walking:** stand by a palm, a plant, a hen, a cow or a machine to pick up what it makes, by its shelf to put it there, by the till to take the money, and on a pad to pay for what comes next.+* **Customers with their own lists:** each wants a few foods, takes a basket for a long list, waits at the till and pays the game's prices.+* **Animals and machines tire:** the hens, the cow and the machines stop after a few items until you walk up to them.+* **Workers:** a cashier, assistants, a farmer, chefs and a manager, each with the game's rounds. They tire and nap, and the manager wakes them.+* **The troublemaker:** he throws food off a shelf until you shoo him away.+* **Upgrades and hats:** stamina, stack and speed for you, your workers, animals and machines, at the game's prices, and 17 hats to buy and wear.+* **The game's look:** its own pictures, monkeys, animals and font.+* **Saved as you go:** Home saves and quits, and the game saves every 30 seconds. Your marts are also copied into `monkeymart_saves.py`, so installing the app again doesn't erase them.++<table>+ <tr>+ <td align="center"><img src="docs/shot.png" width="390" alt="The first mart at work"><br><sub>The first mart, with customers at the shelves and the till</sub></td>+ <td align="center"><img src="docs/guide.png" width="390" alt="The first minute"><br><sub>The first minute: the guide points to each pad</sub></td>+ </tr>+ <tr>+ <td align="center"><img src="docs/upgrades.png" width="390" alt="The upgrades window"><br><sub>Upgrades for you and your workers</sub></td>+ <td align="center"><img src="docs/hats.png" width="390" alt="The hat shop"><br><sub>The hat shop</sub></td>+ </tr>+ <tr>+ <td align="center"><img src="docs/mart2.png" width="390" alt="The second mart"><br><sub>The second mart</sub></td>+ <td align="center"><img src="docs/title.png" width="390" alt="The title screen"><br><sub>The title screen</sub></td>+ </tr>+</table>++## How to play++Walk with the arrows. Stand by a banana palm until your arms are full, then by the banana shelf to put them there. Customers walk in, take what they want and wait at the till: stand by it to serve them, and pick up the money they leave. Spend it on the next pad with a price: a new shelf, plant, animal, machine or worker. Hens, cows and machines need corn and bananas brought to their dishes, and stop now and then until you walk up to them. Buy the truck at the end of the first mart to drive to the second.-Native NumWorks adaptation by **Bobydeluxe**, based on TinyDobbins' Monkey Mart.+## Controls-The supplied reference is version **2.1**. It contains **two playable marts**;-its third-mart module is commented out and absent from the archive. This port-includes both supplied marts, their complete layouts and purchase progression,-14 products, all production chains, employees, upgrades and 21 hat choices.+| Key | What it does |+| --- | --- |+| Arrows | Walk, or move the selection in windows |+| OK | Open the upgrades; buy or choose in windows |+| shift | Open the hats |+| Back | Pause (Resume, Marts, How to play, Quit game), or close a window |+| Home | Save and quit |-| Mart | Products | Employees |-| --- | --- | --- |-| 1 | Bananas, corn, eggs, milk, popcorn, yogurt | Cashier, two assistants, farmer, chef, manager |-| 2 | Cocoa, coffee beans, peanuts, chocolate, ground coffee, peanut butter, cappuccino, chocolate bars | Cashier, three assistants, two chefs, manager |+## Good to know-Harvest, deliver goods to shelves, supply machines, serve customers at the till-and collect the money they leave behind. Walk onto purchase pads to expand the-mart or hire staff. Workers become tired; animals sleep and machines need repair.-Wake them by approaching, or hire a manager to handle these jobs. Troublemakers-can scatter goods; recover the goods and approach the troublemaker to send them away.+* **On its own:** Monkey Mart is too big to fit next to NumPlay. Installing it from the NumWorks website swaps out NumPlay and the other apps, and installing NumPlay again swaps it back out.+* **Version 2.1, the web game:** its two marts, with their places, prices and order. The third mart was still to come in that version.+* **Left out:** the ads and what they gave (double money, energy boosts, the cash machine, and the four hats you got for watching ads), and music and sound (the calculator has no speaker).+* **As in the game:** what's on the shelves and in your arms isn't kept when you leave (the shelves restock at random on your return), and nothing is saved until the tutorial ends.+* **On the keypad:** pressing two arrows into a counter slides you along it, where the game would stop you.-## Preview+## Credits- +Inspired by [Monkey Mart](https://poki.com/en/g/monkey-mart) by TinyDobbins, not affiliated with them. Go play the original: it's free on the web, with music, sound and the newer marts.-Developed-mart captures from the validation saves:+* The pictures (the marts' floors, shelves, plants, machines, decorations, the clouds and icons), the monkeys and animals (baked from the game's Spine skeleton) and the Riffic font (InkyType's) come from the game's own web build, read by [tools/data.py](tools/data.py) and [tools/art.py](tools/art.py) into [src/data.c](src/data.c) and [src/art.c](src/art.c). Its rules and numbers follow the game's own code.+* The calculator adaptation is by **[Bobydeluxe](https://github.com/Bobydeluxe)**, who brought it to NumPlay.- +Made by Mason Chen as part of NumPlay.-## Controls+## License-| Key | Action |-| --- | --- |-| Arrows | Move; nearby interactions are automatic |-| OK / EXE | Confirm menu selection or purchase |-| BACK | Pause; return from a submenu |-| 0 | Map during play; controls from the title screen |-| HOME / Power | Save and exit |--The pause menu contains upgrades, hats, mart selection, boosts, controls and a confirmed progress reset.-Progress is saved every 30 seconds when changed, when pausing and when leaving.-`monkeymart.sav` occupies **768 bytes**. Full storage offers retry, continue and-exit options without removing unrelated files.--## Calculator adaptations--The original sprites, floors, layout positions, prices and unlock order come-from the supplied game. Graphics are reduced for the 320 × 240 screen, Spine-animation is baked into compact frames, and menus use sharp native-size English-text. Controls use calculator keys. The original sound engine is omitted because-the target calculators have no standard audio output.--Online rewarded advertisements are replaced with explicit, offline rewards on-a saved cooldown. Claiming a reward grants a token; the originally ad-only hats-use their original required counts of tokens. This is an adaptation of the-reference game's content and rules, rather than a pixel-identical web runtime.--Tested in ARM emulation for N0110, N0115 and N0120, plus Upsilon's smaller RAM-allocation. Physical-calculator testing remains useful for display-transfer-timing and firmware-specific behavior. See [VALIDATION.md](VALIDATION.md).--## Build--Requires ARM GCC, Python with Pillow, Node.js and nwlink. The checked-in assets-make ordinary builds independent of the reference game and installed fonts.--```sh-python build.py --arm-bin /path/to/arm/bin --nwlink /path/to/nwlink-```--Produces `output/monkeymart.nwa`, `output/monkeymart.bin`, a debug artifact, and a-JSON size report. The `.nwa` is also copied to `../../build/apps/MonkeyMart.nwa`.-The same standalone application targets all three calculator models.--Alternatively:--```sh-make build check-make test-make test-assets-make test-arm-```--`HOST_CC`, `PYTHON` and `NWLINK` can override local tool locations. ARM tests need-the repository emulator's Python dependencies: Unicorn, pyelftools and Pillow.-Build and host tests must precede the ARM tests, which use generated save fixtures.--## Reference and credits--- Original game and artwork: **TinyDobbins**.-- Native NumWorks adaptation: **Bobydeluxe**; in-game credit: **By Bobydeluxe**.-- [Supplied reference](https://github.com/Gr4ys0n/Gr4ys0n.github.io/tree/29006b0f11904704c390b457f7055c9fa1e53484/public/assets/games/monkey-mart).-- [Asset derivation and provenance](ASSETS.md).--Monkey Mart is a large standalone game. It is excluded from the launcher and-`games/games.json`. Build it with `make build/data/apps/MonkeyMart.nwa` from the-repository root, or `python tools/build.py --game monkeymart`. Release tooling-lists `MonkeyMart.nwa` among the individual large games. Not affiliated with-TinyDobbins.+The game's code is licensed under the GNU General Public License v3.0: see the `LICENSE` file at the root of the repository. The pictures, the font and the game's data are TinyDobbins' and keep their own terms (see Credits).diff --git a/games/monkeymart/docs/guide.png b/games/monkeymart/docs/guide.pngnew file mode 100644index 00000000..a658d340Binary files /dev/null and b/games/monkeymart/docs/guide.png differdiff --git a/games/monkeymart/docs/hats.png b/games/monkeymart/docs/hats.pngnew file mode 100644index 00000000..7d5564d6Binary files /dev/null and b/games/monkeymart/docs/hats.png differdiff --git a/games/monkeymart/docs/mart2.png b/games/monkeymart/docs/mart2.pngnew file mode 100644index 00000000..e3931436Binary files /dev/null and b/games/monkeymart/docs/mart2.png differdiff --git a/games/monkeymart/docs/shot.png b/games/monkeymart/docs/shot.pngnew file mode 100644index 00000000..d9093e9fBinary files /dev/null and b/games/monkeymart/docs/shot.png differdiff --git a/games/monkeymart/docs/title.png b/games/monkeymart/docs/title.pngnew file mode 100644index 00000000..fdbf194bBinary files /dev/null and b/games/monkeymart/docs/title.png differdiff --git a/games/monkeymart/docs/upgrades.png b/games/monkeymart/docs/upgrades.pngnew file mode 100644index 00000000..8338e94fBinary files /dev/null and b/games/monkeymart/docs/upgrades.png differdiff --git a/tests/test_games.py b/tests/test_games.pyindex e9a227f5..3f5f2a09 100644--- a/tests/test_games.py+++ b/tests/test_games.py@@ -237,6 +237,10 @@ GAMES = {# the title, Play, the first press (the guide goes) and the ball rolls; Home keeps the run. Next time, from the# copy, it opens paused: Back, and it rolls on"dune": ("Dune.nwa", "dune.sav", presses((1500, "ok"), (2600, "ok")), 5000, presses((1500, "back")), 3500),+ # a mart past its tutorial (seeded): the title, the upgrades, your free stack bought (that saves); next time, from+ # the copy, the next level for 100 coins+ "monkeymart": ("MonkeyMart.nwa", "monkeymart.sav", presses((1500, "ok"), (2500, "ok"), (3200, "ok"), (3900, "back")),+ 5000, presses((1500, "ok"), (2500, "ok"), (3200, "ok"), (3900, "back")), 5000),# 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,@@ -254,7 +258,27 @@ def coreball_save(level, best, flags=0):return v + struct.pack("<I", h)+def monkeymart_save():+ """monkeymart.sav: "MMMT", version 1, its size (364), then the progress (save.h): 500 coins, the first hat, mart 1+ with its first six places bought (the tutorial over) and 40 in the cash box, every upgrade at level 1; FNV-1a of+ it all after"""+ p = bytearray(352)+ struct.pack_into("<IIBB", p, 0, 500, 1, 0, 0)+ p[10] = 6+ struct.pack_into("<I", p, 12, 40)+ for i in (6, 4, 0, 1, 5, 7): # the cash box, the banana shelf, two palms, the corn shelf, a corn plant+ p[20 + i] = 1+ for i in range(72):+ p[278 + i] = 1+ v = b"MMMT" + struct.pack("<HH", 1, 364) + bytes(p)+ h = 0x811C9DC5+ for x in v:+ h = (h ^ x) * 0x01000193 & 0xFFFFFFFF+ return v + struct.pack("<I", h)++SEEDS = {+ "monkeymart": monkeymart_save(),# level 5 to play, 9 reached, how to play not read yet"coreball": coreball_save(5, 9),# the first level done and last played@@ -281,7 +305,7 @@ COPIES = {"championisland": "champion_saves.py", "numblocks": "numblocks_saves.p"hillclimb": "hillclimb_saves.py", "pvz": "pvz_saves.py", "sonic": "sonic_saves.py","cookieclicker": "cookieclicker_saves.py", "leveldevil": "leveldevil_saves.py","jetpackjoyride": "jetpackjoyride_saves.py", "stickmanhook": "stickmanhook_saves.py",- "donkeykong": "donkeykong_saves.py", "dune": "dune_saves.py"}+ "donkeykong": "donkeykong_saves.py", "dune": "dune_saves.py", "monkeymart": "monkeymart_saves.py"}def dk_frames(v):@@ -418,6 +442,10 @@ CHECKS = {# a run kept ("DUNE", has_run at 27, the run's frames at 328); after the reinstall, from the copy, it goes on"dune": (lambda v: len(v) == 1548 and v[:4] == b"DUNE" and v[27] == 1 and struct.unpack_from("<I", v, 328)[0] >= 200,lambda v: len(v) == 1548 and v[:4] == b"DUNE" and v[27] == 1 and struct.unpack_from("<I", v, 328)[0] >= 300),+ # your stack bought (level 2, upgrades_level at 287), the coins kept; after the reinstall, from the copy, level 3+ # for 100 coins+ "monkeymart": (lambda v: len(v) == 364 and v[:4] == b"MMMT" and v[287] == 2 and struct.unpack_from("<I", v, 8)[0] >= 500,+ lambda v: len(v) == 364 and v[:4] == b"MMMT" and v[287] == 3 and struct.unpack_from("<I", v, 8)[0] >= 400),"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 keptdiff --git a/tools/release.py b/tools/release.pyindex e799dfe6..bb44fa34 100644--- a/tools/release.py+++ b/tools/release.py@@ -23,7 +23,6 @@ REPO = "https://github.com/Mason363/NumPlay"EXTRAS = set()# games too big to fit next to NumPlay on the calculator: only on their own, in a section of their ownALONE = {- "monkeymart": ("Monkey Mart", "run both marts from version 2.1, with 14 products, employees and 21 hats; adapted by Bobydeluxe"),"celeste": ("Celeste", "the whole climb up Celeste Mountain"),"hollowknight": ("Hollow Knight", "from King's Pass to Hornet in Greenpath"),"undertale": ("Undertale", "the whole Underground, to the barrier and the neutral ending"),@@ -44,6 +43,7 @@ ALONE = {"stickmanhook": ("Stickman Hook", "swing from hook to hook: 39 levels made by hand, then endless ones"),"donkeykong": ("Donkey Kong", "the 1981 arcade game: barrels, pies, elevators and rivets, up to Pauline"),"dune": ("Dune", "roll down the dunes and fly over the line, with the shop's 26 balls and 7 landscapes"),+ "monkeymart": ("Monkey Mart", "run a grocery mart as a monkey, both marts: crops, animals, machines and workers"),}VARIANTS = [("NumPlay-Invisible.nwa", "The same app, hidden: a blank icon with no name"),