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.

Add standalone Jetpack Joyride by Bobydeluxe

Bobydeluxef864e3b4f457
diff --git a/README.md b/README.md
index 67eeae81..70894793 100644
--- a/README.md
+++ b/README.md
@@ -87,6 +87,10 @@ These are too big to fit next to NumPlay, so each one is its own app. Install it
</tr>
</table>
+**[Jetpack Joyride](games/jetpackjoyride/README.md)** is also offered as a separate,
+English-only app by **Bobydeluxe**. Its README includes build and installation
+instructions.
+
## How to install
You need your calculator, its USB cable, and a computer with **Google Chrome** or **Microsoft Edge**. It takes about 2 minutes.
@@ -198,6 +202,7 @@ NumPlay is a fan project, made out of love for these games and for the NumWorks
- **[Tatone26](https://github.com/Tatone26/Numworks-games)**'s **All the Apps** inspired NumPlay's list of classics. Flappy Bird, Pac-Man, Snake, Connect Four, Solitaire and 2048 are written in C for NumPlay and keep its options, with no code copied from it. Tetris is Tatone26's own, which they released into the public domain, adapted for NumPlay.
- **[Gabriele Cirulli](https://github.com/gabrielecirulli/2048)** made 2048.
+- **[Bobydeluxe](https://github.com/Bobydeluxe)** made the **[Jetpack Joyride](games/jetpackjoyride/README.md)** NumWorks adaptation, including its interface, flight engine and sprite renderer. **Halfbrick** created the original game and artwork; asset provenance and rights are recorded in the game's [artwork notes](games/jetpackjoyride/assets/README.md).
- **Block Blast!** by [Hungry Studio](https://www.hungrystudio.com) inspired NumPlay's Block Blast, written in C for NumPlay with no code or art from it. Its blocks, scoring and colours follow measurements of the app by the players behind [blockblast-Self-Improvement-loop](https://github.com/Kucze3205/blockblast-Self-Improvement-loop).
- Snake, Solitaire and Block Breaker look and play like **Google's games** in Search. They are drawn from scratch; nothing is taken from Google.
- **Chrome's dinosaur game** by Google inspired Chrome Dino, which ports its rules, numbers and pictures from [Chromium's source](https://chromium.googlesource.com/chromium/src/+/main/components/neterror/resources/dino_game/) (BSD license). **[LilyTheCatgirl](https://github.com/LilyTheCuteCatgirl)** brought it to NumPlay. Not affiliated with Google.
diff --git a/games/jetpackjoyride/.gitignore b/games/jetpackjoyride/.gitignore
new file mode 100644
index 00000000..16be8f21
--- /dev/null
+++ b/games/jetpackjoyride/.gitignore
@@ -0,0 +1 @@
+/output/
diff --git a/games/jetpackjoyride/Makefile b/games/jetpackjoyride/Makefile
new file mode 100644
index 00000000..4d58c62d
--- /dev/null
+++ b/games/jetpackjoyride/Makefile
@@ -0,0 +1,55 @@
+# Jetpack Joyride: English-only app and NumPlay module.
+CC = arm-none-eabi-gcc
+NWLINK ?= npx --yes -- [email protected]
+PYTHON ?= python3
+ARM_LD ?= arm-none-eabi-ld
+OBJCOPY = arm-none-eabi-objcopy
+PACKER = tools/compact_nwa.py tools/standalone.ld
+SRC = src/main.c src/physics.c src/save.c src/render.c
+HEADERS = $(wildcard src/*.h) ../common/epsilon_app.h ../common/epsilon_files.h
+OBJECTS = $(patsubst src/%.c,output/%.o,$(SRC))
+CFLAGS = -std=c11 $(shell $(NWLINK) eadk-cflags-device) -Os -Wall -Wextra -Werror
+CFLAGS += -fno-math-errno -fsingle-precision-constant -ffunction-sections -fdata-sections -fstack-usage
+CFLAGS += -fno-tree-loop-distribute-patterns -flto -fno-fat-lto-objects -fvisibility=internal
+LINK = -nostartfiles --specs=nano.specs -Wl,--relocatable,--gc-sections,-e,main -flinker-output=nolto-rel
+
+.PHONY: build check module sim-module test clean assets check-assets
+build: output/jetpackjoyride.nwa
+assets:
+ $(PYTHON) tools/assets.py
+check-assets:
+ $(PYTHON) tools/assets.py --check
+output/%.o: src/%.c $(HEADERS) | output
+ $(CC) $(CFLAGS) -c $< -o $@
+output/icon.o: src/icon.png | output
+ $(NWLINK) png-icon-o $< $@
+output/icon-compact.o: output/icon.o $(PACKER)
+ $(PYTHON) tools/compact_nwa.py icon $< $@ --objcopy $(OBJCOPY)
+output/jetpackjoyride-debug.nwa: $(OBJECTS) output/icon-compact.o $(PACKER)
+ $(CC) $(CFLAGS) $(LINK) -Wl,-u,eadk_app_name,-u,eadk_app_icon,-u,eadk_api_level $(OBJECTS) output/icon-compact.o -lm -o output/standalone.o
+ $(PYTHON) tools/compact_nwa.py app output/standalone.o $@ --ld $(ARM_LD)
+output/jetpackjoyride.nwa: output/jetpackjoyride-debug.nwa $(PACKER)
+ $(PYTHON) tools/compact_nwa.py release $< $@ --objcopy $(OBJCOPY)
+module: output/module.o
+output/module.o: $(OBJECTS)
+ $(CC) $(CFLAGS) $(LINK) $^ -lm -o $@
+check: build
+ $(NWLINK) nwa-bin output/jetpackjoyride.nwa output/jetpackjoyride.bin --ram-length 107674
+ $(NWLINK) nwa-bin output/jetpackjoyride-debug.nwa output/jetpackjoyride-debug.bin --ram-length 107674
+ $(PYTHON) -c "from pathlib import Path; assert Path('output/jetpackjoyride.bin').read_bytes() == Path('output/jetpackjoyride-debug.bin').read_bytes(), 'Release compaction changed installed bytes'"
+output:
+ mkdir -p $@
+test: | output
+ $(PYTHON) tests/test_compact_nwa.py
+ $(HOST_CC) -std=c11 -O2 -Wall -Wextra -Werror -Isrc tests/test.c src/physics.c src/save.c src/render.c -lm -o output/test
+ cd output && ./test
+HOST_CC ?= cc
+sim-module: | output
+ mkdir -p output/sim
+ cc -std=c11 -O2 -fPIC $(shell $(NWLINK) eadk-cflags-simulator) -Dmain=np_jetpackjoyride_main -c src/main.c -o output/sim/main.o
+ cc -std=c11 -O2 -fPIC -c src/physics.c -o output/sim/physics.o
+ cc -std=c11 -O2 -fPIC -c src/save.c -o output/sim/save.o
+ cc -std=c11 -O2 -fPIC -c src/render.c -o output/sim/render.o
+ ld -r output/sim/*.o -exported_symbol _np_jetpackjoyride_main -o output/sim-module.o
+clean:
+ rm -rf output
diff --git a/games/jetpackjoyride/README.md b/games/jetpackjoyride/README.md
new file mode 100644
index 00000000..795a8e0a
--- /dev/null
+++ b/games/jetpackjoyride/README.md
@@ -0,0 +1,115 @@
+# Jetpack Joyride
+
+By **Bobydeluxe**. An English-only NumWorks adaptation with artwork from the
+[Jetpack Joyride Facebook assets archive](https://archive.org/download/jetpack-joyride-assets),
+created by **Halfbrick**. See [artwork provenance](assets/README.md).
+
+![Main menu](docs/title.png)
+![Animated main menu](docs/menu-animation.gif)
+![Laboratory run](docs/gameplay.png)
+![The Stash](docs/shop.png)
+
+## Play
+
+Install standalone `JetpackJoyride.nwa` with a compatible NumWorks external-app
+installer, then open Jetpack Joyride from the calculator's Home menu. Build and
+install it separately from the combined NumPlay launcher. A module build is
+provided for later integration.
+
+| Key | Action |
+| --- | --- |
+| Hold OK / EXE / Up | Thrust upward |
+| Release | Fall; no fuel limit |
+| Back | Pause, or return in menus |
+| Home / On-Off | Save and exit |
+| Arrows, then OK / EXE | Select a menu entry |
+
+The main menu uses the original silver/gold wordmarks, character artwork,
+a slowly scrolling laboratory and large industrial buttons. **Play/Resume**,
+**The Stash** and **How to Play** are the three entries. The credit remains
+**by Bobydeluxe**. The guide, shop, pause, restart, purchase and result screens
+share the new steel/navy/gold design, with all text in English.
+
+During play, Barry runs or flies with the original head/body animation frames
+and a machine-gun jetpack. The supplied laboratory wall and floor scroll past
+background scientists, spinning coins, electric zappers, missiles and shields.
+Rotating zappers use matching electric colours and the original endpoint
+sprites. The compact HUD shows meters, run coins, pause bars and an equipped
+shield. Original images are resized and palette-adapted to the 320x240 display.
+
+Keep changing altitude. Laser groups include a low/high/low slalom, a narrow
+gate followed by a middle beam, a staircase, vertically offset gates and paired
+rotating beams with floor/ceiling bars. The opening weave blocks floor, ceiling
+and centre camping. Static columns are 260 pixels apart, rotating columns 300.
+Every fifth group is a missile: its warning follows your altitude, locks, then
+fires. Move after the lock. Shields absorb one hit and do not stack.
+
+Collected coins enter a persistent wallet immediately. **The Stash** previews,
+buys and equips permanent outfits: Classic is free, Arctic costs 50 coins,
+Rose 120 and Lime 200. Purchases require confirmation; owned outfits can be
+re-equipped for free. Outfits only change appearance. Existing purchases and
+wallet balances are retained.
+
+Distance determines the record. Speed increases from 2.25 to 4.5 pixels per
+16 ms simulation tick. Rotating beams complete a revolution in 128 ticks,
+with both directions and varied initial phases. Their collider follows the
+finite beam, so empty corners are safe. Flights end at 1,000,000 meters to
+keep counters bounded. Physics and obstacle generation are unchanged by the
+artwork revision.
+
+Pausing freezes the simulation; resuming waits for a fresh launch press.
+Restarting asks before replacing a live flight. The checked 260-byte JJN2 save
+preserves the exact world, random state, obstacle phases, records, wallet and
+outfits. JJN1 saves still import their world and lifetime coins. Full-storage
+recovery offers retry, return, or explicit exit without saving. Other
+calculator records are preserved.
+
+## Build
+
+Requires ARM GCC with newlib, Python 3 and nwlink 1.0.0. The portable builder
+also uses pyelftools. Pillow is needed only for asset regeneration and
+screenshot/ARM tests, not the ordinary ARM build.
+
+```sh
+make build module check
+make test
+python tests/arm.py --nwlink nwlink
+python tests/menu.py --nwlink nwlink
+
+# Optional portable build, including Windows without Make:
+python tools/build.py --toolchain /path/to/arm/bin --nwlink /path/to/nwlink/bin/nwlink
+
+# Optional offline sprite/icon regeneration:
+python tools/assets.py
+python tools/assets.py --check
+```
+
+Generated sprites live in `src/assets.h`. The source manifest records original
+filenames and hashes. The game-local icon/ELF packer verifies identical release/debug
+installed bytes on four target profiles. Native tests create ARM fixtures in
+`output/`; the ARM suite uses the unstripped debug NWA.
+
+| Resource | Bytes |
+| --- | ---: |
+| Downloadable NWA | 57,432 |
+| Installed code/assets | 49,732 |
+| Static RAM | 5,857 |
+| Deepest observed ARM stack | 436 |
+| Save payload / with record overhead | 260 / 281 |
+| Compressed launcher icon | 1,559 |
+
+The artwork increases flash storage compared with the preceding procedural
+version (20,008 downloadable / 13,804 installed bytes). Static RAM and save size
+are unchanged. The device stores only the packed sprites it uses; the original
+archive and source PNGs are not installed on the calculator.
+
+One 320x8 RGB565 strip uses 5,120 bytes. Row-indexed RLE, packed 4-bit literals
+and shared outfit palettes avoid full-screen textures in RAM, a PNG decoder,
+heap allocations and texture caches. The laboratory repeats one small tile at
+2x scale. Fixed-point physics uses four hazard slots and eighteen pickup slots.
+
+Simulation runs at 62.5 Hz and drawing at up to 31.25 Hz. The title's independent
+80 ms cosmetic clock never advances the saved simulation. Static menus push
+no pixels when unchanged. All tested ARM scenes stay within the 32 ms drawing
+budget; measured maximum is 12 ms. These are emulator measurements; physical
+calculator display timing remains to be checked. See [validation](VALIDATION.md).
diff --git a/games/jetpackjoyride/VALIDATION.md b/games/jetpackjoyride/VALIDATION.md
new file mode 100644
index 00000000..cbe27546
--- /dev/null
+++ b/games/jetpackjoyride/VALIDATION.md
@@ -0,0 +1,114 @@
+# Local validation - 20 October 2026
+
+Standalone Jetpack Joyride with the revised artwork/interface. Publication
+changes are limited to this game and its link/credit in the root README.
+
+## Artwork and interface
+
+Forty packed sprites/textures are generated offline from the supplied Halfbrick
+archive: Barry head/body frames, machine-gun jetpack, title wordmarks/character,
+laboratory wall/floor, scientists, coins, electricity, caps, missile, muzzle
+flash, warning and shield. Source filenames/hashes and rights are recorded in
+`assets/source-manifest.json` and `assets/README.md`.
+
+The lab wall stops at the physical floor. Barry and the background scientists
+stand above that floor, and the foreground rail covers art below it. The HUD
+covers all its first three strips so moving sprites cannot leave stale pixels
+at its lower edge. The title's original wordmarks, character, slow laboratory
+scroll and large gold/steel buttons replace the previous console. The Stash,
+guide, ready, pause, restart, purchase, result and storage-error screens use
+the new interface. English text, by Bobydeluxe credit and all controls remain.
+
+The asset generator verifies the original PNG hashes and round-trips every
+encoded row, checking offsets and palette indices. `tools/assets.py --check`
+passes, verifying byte-identical header, resource report and launcher icon.
+Normal builds use the generated header and do not require Pillow.
+
+Small palettes use packed 4-bit literal indices; other sprites use 8-bit
+indices. Repeated colours/transparency use RLE packets. Row offsets let the
+renderer read only the current eight-pixel strip. The wall and floor repeat
+small 2x tiles. Outfits share sprite indices with four small suit palettes.
+No heap allocation, PNG decoder, full-screen buffer, decompressed texture
+cache or additional static RAM was introduced.
+
+## Build and resources
+
+ARM GCC 15.2.1, nwlink 1.0.0, C11, -Os, LTO, warnings as errors. Standalone and
+module builds pass. Release/debug installed bytes match on N0110, N0115/custom
+RAM, N0120 and Upsilon. A game-local lossless icon/ELF packer is included.
+
+| Resource | Bytes |
+| --- | ---: |
+| Downloadable NWA | 57,432 |
+| Installed code/assets, all profiles | 49,732 |
+| Static RAM, all profiles | 5,857 |
+| Observed deepest ARM stack | 436 |
+| Save payload / with record overhead | 260 / 281 |
+| Packed launcher icon | 1,559 |
+| Encoded sprite payload, palettes and row offsets | 33,954 |
+
+The preceding procedural build was 20,008 download bytes / 13,804 installed.
+Original artwork increases flash use, while static RAM and saves are unchanged.
+Packed 4-bit literals and reduced palettes cut the first sprite prototype from
+64,044 to 57,432 download bytes. Original source PNGs are not installed on the
+calculator. Rendering still uses one 5,120-byte strip and fixed object pools.
+
+## Native regression suite
+
+TinyCC compiled and executed the final native suite; ARM GCC checked its source
+with -Wall -Wextra -Werror. Results:
+
+- 80/80 controller seeds reached 3,000 meters, covering 692,000 simulation ticks,
+ all five hazard types, shields and four simultaneous hazards.
+- Another 200,000 irregular-input ticks passed game-state validation.
+- Floor, ceiling, centre-hovering and shielded-floor camping all collided by
+ 45 / 71 / 45 / 98 meters across 200 seeds per strategy.
+- Rotating beam tests cover all 128 phase/direction values, finite segment
+ collisions, safe empty corners, shield protection and phase save round trips.
+- Shop tests verify exact 50/120/200 prices, permanent ownership, free
+ re-equipping, rejected insufficient funds and identical outfit physics.
+- JJN1 migration, exact JJN2 round trips, one-bit corruption of each save byte,
+ invalid fields and 1,000-tick restored/uninterrupted equivalence pass.
+- Every view and selection, 240 boundary/exhaust frames, 128 rotating-beam
+ frames and 96 title-animation steps match full redraws pixel for pixel.
+ Unchanged frames push no pixels. Push bounds and the 2,560-pixel strip
+ capacity are asserted by the display callback.
+- Animated menu renders leave simulation and statistics byte-identical.
+
+Physics, generation, pricing, controls, save layout and persistence code were
+not changed by the artwork revision.
+
+## Compiled ARM application
+
+The full app suite passes on N0110/Epsilon (148,928 bytes RAM allowance),
+N0115/custom RAM (133,652), N0120/Epsilon (153,676) and Upsilon (107,674).
+Held-key launch protection, pause, cancelled restart, resume, exact saved-world
+restoration, Home/On-Off exits and preservation of unrelated records pass.
+RAM cleanup, Home unlocking and firmware-RAM integrity are checked.
+
+Shop navigation cancels/buys with real keyboard events, equips owned items,
+rejects insufficient funds and preserves exact expected balances/ownership.
+Legacy save import, result/restart and full-storage retry/return/explicit-exit
+scenarios also pass without damaging existing records.
+
+A live keyboard run reaches 986 meters, clears 32 hazards and collects 80 coins.
+It includes rotating lasers and every hazard type. The crowded scene and the
+four-rotor stress scene pass. All these new-artwork scenarios peak at 12 ms
+per draw, with no draw over 32 ms; deepest observed stack is 436 bytes.
+
+The final change makes the title background scroll every cosmetic-clock step.
+Its focused ARM suite passes again on all four profiles: 16 distinct snapshots,
+unchanged zero-initialized simulation, preserved sentinel storage and clean
+Home exit. Title draws peak at 12 ms and stack at 412 bytes. The final native
+suite was repeated after this clock-only adjustment. Gameplay screens/code
+are unchanged from the preceding full ARM-suite run.
+
+Screenshots and the animated title GIF in `docs/` come from the actual compiled
+ARM app. Emulator output/reports remain in ignored `output/`. Physical-device
+display timing and feel remain to be checked; emulator timing is not a physical
+calculator performance claim.
+
+The isolated publication build is byte-identical to the validated local app.
+Native, lossless-packing, asset-regeneration, four-profile ARM gameplay and
+four-profile animated-menu suites pass from the publication snapshot using
+the upstream repository helpers.
diff --git a/games/jetpackjoyride/assets/README.md b/games/jetpackjoyride/assets/README.md
new file mode 100644
index 00000000..f8396b1a
--- /dev/null
+++ b/games/jetpackjoyride/assets/README.md
@@ -0,0 +1,31 @@
+# Artwork provenance and packing
+
+The supplied [Jetpack Joyride Facebook assets archive](https://archive.org/download/jetpack-joyride-assets)
+identifies **Halfbrick** as creator. Its `jetpack joyride images.rar` contains
+the source PNGs used here. `source-manifest.json` records each original filename
+and SHA-256, alongside its descriptive local filename in `source/`.
+
+These are original game assets adapted for this unofficial NumWorks version:
+Barry's separate head/body animations, machine-gun jetpack, title wordmarks,
+title character, laboratory wall and floor, scientists, spinning coins,
+electric beams, caps, missiles, muzzle flashes, warning and shield artwork.
+The outfits recolour Barry's suit while retaining the original skin/hair.
+The rotating beam uses the same electric colours and original endpoint sprites.
+
+Artwork belongs to Halfbrick and retains its original rights. The archive does
+not provide a separate redistribution licence; inclusion here does not place
+these images under the GPL licence used for this implementation's code.
+This fan adaptation is not affiliated with or endorsed by Halfbrick.
+
+`python tools/assets.py` runs offline with Pillow and recreates `src/assets.h`,
+`src/icon.png` and `assets/packed.json`. `--check` verifies those outputs without
+writing. Normal ARM builds use the generated header and do not need Pillow.
+
+Sprites are reduced to their display size and indexed palettes. Literal packets
+use packed 4-bit indices where possible, with 8-bit indices for larger palettes.
+Repeated colours and transparent spans use run-length packets. Every row has an
+offset, allowing the renderer to decode only the current eight-pixel screen
+strip. The generator round-trips every encoded row and validates all palette
+indices and offsets. There is no heap allocation, texture-sized RAM buffer or
+PNG decoder on the calculator. One small laboratory tile repeats at 2x scale;
+it does not store multiple full-screen backgrounds.
diff --git a/games/jetpackjoyride/assets/packed.json b/games/jetpackjoyride/assets/packed.json
new file mode 100644
index 00000000..8a639b1a
--- /dev/null
+++ b/games/jetpackjoyride/assets/packed.json
@@ -0,0 +1,243 @@
+{
+ "lab": {
+ "width": 128,
+ "height": 96,
+ "bits": 8,
+ "bytes": 6068
+ },
+ "floor": {
+ "width": 128,
+ "height": 12,
+ "bits": 4,
+ "bytes": 329
+ },
+ "jetpack_word": {
+ "width": 205,
+ "height": 59,
+ "bits": 4,
+ "bytes": 4979
+ },
+ "joyride_word": {
+ "width": 210,
+ "height": 55,
+ "bits": 4,
+ "bytes": 5046
+ },
+ "hero": {
+ "width": 72,
+ "height": 104,
+ "bits": 8,
+ "bytes": 4338
+ },
+ "barry_0": {
+ "width": 28,
+ "height": 40,
+ "bits": 8,
+ "bytes": 578
+ },
+ "barry_1": {
+ "width": 28,
+ "height": 40,
+ "bits": 8,
+ "bytes": 573
+ },
+ "barry_2": {
+ "width": 28,
+ "height": 40,
+ "bits": 8,
+ "bytes": 573
+ },
+ "barry_3": {
+ "width": 28,
+ "height": 40,
+ "bits": 8,
+ "bytes": 571
+ },
+ "barry_4": {
+ "width": 28,
+ "height": 40,
+ "bits": 8,
+ "bytes": 568
+ },
+ "barry_5": {
+ "width": 28,
+ "height": 40,
+ "bits": 8,
+ "bytes": 575
+ },
+ "barry_6": {
+ "width": 28,
+ "height": 40,
+ "bits": 8,
+ "bytes": 565
+ },
+ "barry_7": {
+ "width": 28,
+ "height": 40,
+ "bits": 8,
+ "bytes": 563
+ },
+ "coin_0": {
+ "width": 11,
+ "height": 11,
+ "bits": 4,
+ "bytes": 138
+ },
+ "coin_1": {
+ "width": 11,
+ "height": 11,
+ "bits": 4,
+ "bytes": 134
+ },
+ "coin_2": {
+ "width": 11,
+ "height": 11,
+ "bits": 4,
+ "bytes": 138
+ },
+ "coin_3": {
+ "width": 11,
+ "height": 11,
+ "bits": 4,
+ "bytes": 143
+ },
+ "coin_4": {
+ "width": 11,
+ "height": 11,
+ "bits": 4,
+ "bytes": 150
+ },
+ "coin_5": {
+ "width": 11,
+ "height": 11,
+ "bits": 4,
+ "bytes": 139
+ },
+ "coin_6": {
+ "width": 11,
+ "height": 11,
+ "bits": 4,
+ "bytes": 138
+ },
+ "coin_7": {
+ "width": 11,
+ "height": 11,
+ "bits": 4,
+ "bytes": 136
+ },
+ "shield": {
+ "width": 18,
+ "height": 18,
+ "bits": 8,
+ "bytes": 332
+ },
+ "missile": {
+ "width": 28,
+ "height": 23,
+ "bits": 8,
+ "bytes": 398
+ },
+ "zapper_cap": {
+ "width": 15,
+ "height": 15,
+ "bits": 8,
+ "bytes": 225
+ },
+ "beam_h_0": {
+ "width": 58,
+ "height": 10,
+ "bits": 4,
+ "bytes": 285
+ },
+ "beam_v_0": {
+ "width": 10,
+ "height": 70,
+ "bits": 4,
+ "bytes": 613
+ },
+ "beam_c_0": {
+ "width": 10,
+ "height": 100,
+ "bits": 4,
+ "bytes": 864
+ },
+ "beam_h_1": {
+ "width": 58,
+ "height": 10,
+ "bits": 4,
+ "bytes": 246
+ },
+ "beam_v_1": {
+ "width": 10,
+ "height": 70,
+ "bits": 4,
+ "bytes": 560
+ },
+ "beam_c_1": {
+ "width": 10,
+ "height": 100,
+ "bits": 4,
+ "bytes": 789
+ },
+ "beam_h_2": {
+ "width": 58,
+ "height": 10,
+ "bits": 4,
+ "bytes": 252
+ },
+ "beam_v_2": {
+ "width": 10,
+ "height": 70,
+ "bits": 4,
+ "bytes": 635
+ },
+ "beam_c_2": {
+ "width": 10,
+ "height": 100,
+ "bits": 4,
+ "bytes": 900
+ },
+ "flash_0": {
+ "width": 14,
+ "height": 16,
+ "bits": 4,
+ "bytes": 156
+ },
+ "flash_1": {
+ "width": 14,
+ "height": 16,
+ "bits": 4,
+ "bytes": 185
+ },
+ "scientist_0": {
+ "width": 17,
+ "height": 21,
+ "bits": 4,
+ "bytes": 170
+ },
+ "scientist_1": {
+ "width": 17,
+ "height": 21,
+ "bits": 4,
+ "bytes": 172
+ },
+ "scientist_2": {
+ "width": 17,
+ "height": 21,
+ "bits": 4,
+ "bytes": 167
+ },
+ "scientist_3": {
+ "width": 17,
+ "height": 21,
+ "bits": 4,
+ "bytes": 173
+ },
+ "warning": {
+ "width": 18,
+ "height": 18,
+ "bits": 4,
+ "bytes": 134
+ },
+ "total_encoded_bytes": 33954
+}
diff --git a/games/jetpackjoyride/assets/source-manifest.json b/games/jetpackjoyride/assets/source-manifest.json
new file mode 100644
index 00000000..8df5c73c
--- /dev/null
+++ b/games/jetpackjoyride/assets/source-manifest.json
@@ -0,0 +1,67 @@
+{
+ "source": "https://archive.org/download/jetpack-joyride-assets",
+ "archive": "jetpack joyride images.rar",
+ "creator": "Halfbrick",
+ "files": {
+ "laboratory": {
+ "archive_file": "1a3e77c5-b730-4ae6-9506-35e2644094c2.png",
+ "sha256": "f23ee6f646df07467b108ab446b3fbf881bbf20ce19645bac433c4f55ee7dca4"
+ },
+ "jetpack_word": {
+ "archive_file": "ad9d62ec-8e4e-416e-826e-f577fe609103.png",
+ "sha256": "25cd6dedf1c18fe16b9e4ac0d1e8bf8c91028652863aaae8a39555131e8e269b"
+ },
+ "joyride_word": {
+ "archive_file": "4f8632f9-cd71-4b2f-898a-2f47c0344b7f.png",
+ "sha256": "9bae8136eeb41c10b1a7d9ee83f8e1e21ef1244ae897759d97880effbd5e1921"
+ },
+ "barry_hero": {
+ "archive_file": "ee031bfe-32a8-487d-9f68-f0c66a3acf55.png",
+ "sha256": "bd72558eb01bb53cc22b488d30780e28850209e910bef94720503ccdad0d4c34"
+ },
+ "barry_body": {
+ "archive_file": "21420928-1f48-42b3-af14-a9d19b8d8020.png",
+ "sha256": "162c5f7dfc67a8755367d0b0a37fdf2d5b1b4c8f4511fa1be5dd5f4630d2c844"
+ },
+ "barry_head": {
+ "archive_file": "c26be092-2285-4590-b144-df89a4dbf0c0.png",
+ "sha256": "fcf79f3e8913fc0640ce122c19ed710ea22d58ecd7a19f4bd394260c2f0bc356"
+ },
+ "machinegun": {
+ "archive_file": "00c9a12f-2d9f-4bf9-ba50-e6a8e2858b52.png",
+ "sha256": "4dc03708d7a9465a9adf6fdcee414161e094d76fa41e4488ccae08cba193578e"
+ },
+ "coins": {
+ "archive_file": "5f7ee621-7ab3-41ef-bbd7-db48931e8f42.png",
+ "sha256": "93b62a15ad4bda739aa80cbc48c3ad61f6367b47c7bb8902b5cc7f83e034109a"
+ },
+ "shield": {
+ "archive_file": "26d5bd62-7f80-4226-ba11-432368e112cf.png",
+ "sha256": "01638947eb71019753d609ff5f1d3a28a661d1ad6737b930bf54e1ea70c0d370"
+ },
+ "missiles": {
+ "archive_file": "970298ce-a6e3-411a-9ab3-5f6d62ad9f9e.png",
+ "sha256": "69b569f095dc424e5cee0369b5628f1c12ea3f6d96e5cf5ebc413fadeb1f8bc9"
+ },
+ "zapper_caps": {
+ "archive_file": "4a2e43c1-5af8-4c01-8e71-e9e2e7815986.png",
+ "sha256": "ffe6915a3bdf72eba728c89651361da97b49c2d50c2c8c4f7bf001269882552c"
+ },
+ "electricity": {
+ "archive_file": "6f62ade3-a4ea-457d-8281-4c836e647f7f.png",
+ "sha256": "95062befaf56dd49235dd7a985fcfb27cd9a5414165a259575308556a1009645"
+ },
+ "muzzle_flash": {
+ "archive_file": "0ae2fd6b-7484-4bd8-9184-f3bf9fac5d08.png",
+ "sha256": "baa348db9cfa40e11d996d5a6f274627e64cb43477ab817fd1e1bdc9cdd8d4a2"
+ },
+ "scientists": {
+ "archive_file": "6029b5c9-ee09-4747-90ea-2e14087ab8c7 (1).png",
+ "sha256": "55917d8ca84c8ae397b9be84f6cc602bbf7c5b60766bf4f6e675364eb7cc2b68"
+ },
+ "warnings": {
+ "archive_file": "89bfda72-a412-49ec-b87f-a4b09ff275f7.png",
+ "sha256": "de1eab0412d80479fc96b6fe2103ffad96ee8b5921deccb7dc088f9ffbb14559"
+ }
+ }
+}
diff --git a/games/jetpackjoyride/assets/source/barry_body.png b/games/jetpackjoyride/assets/source/barry_body.png
new file mode 100644
index 00000000..74757f24
Binary files /dev/null and b/games/jetpackjoyride/assets/source/barry_body.png differ
diff --git a/games/jetpackjoyride/assets/source/barry_head.png b/games/jetpackjoyride/assets/source/barry_head.png
new file mode 100644
index 00000000..c8a0868e
Binary files /dev/null and b/games/jetpackjoyride/assets/source/barry_head.png differ
diff --git a/games/jetpackjoyride/assets/source/barry_hero.png b/games/jetpackjoyride/assets/source/barry_hero.png
new file mode 100644
index 00000000..08c2d651
Binary files /dev/null and b/games/jetpackjoyride/assets/source/barry_hero.png differ
diff --git a/games/jetpackjoyride/assets/source/coins.png b/games/jetpackjoyride/assets/source/coins.png
new file mode 100644
index 00000000..e993260a
Binary files /dev/null and b/games/jetpackjoyride/assets/source/coins.png differ
diff --git a/games/jetpackjoyride/assets/source/electricity.png b/games/jetpackjoyride/assets/source/electricity.png
new file mode 100644
index 00000000..0c405e7c
Binary files /dev/null and b/games/jetpackjoyride/assets/source/electricity.png differ
diff --git a/games/jetpackjoyride/assets/source/jetpack_word.png b/games/jetpackjoyride/assets/source/jetpack_word.png
new file mode 100644
index 00000000..21b9418e
Binary files /dev/null and b/games/jetpackjoyride/assets/source/jetpack_word.png differ
diff --git a/games/jetpackjoyride/assets/source/joyride_word.png b/games/jetpackjoyride/assets/source/joyride_word.png
new file mode 100644
index 00000000..80a5a7cc
Binary files /dev/null and b/games/jetpackjoyride/assets/source/joyride_word.png differ
diff --git a/games/jetpackjoyride/assets/source/laboratory.png b/games/jetpackjoyride/assets/source/laboratory.png
new file mode 100644
index 00000000..cc14cb00
Binary files /dev/null and b/games/jetpackjoyride/assets/source/laboratory.png differ
diff --git a/games/jetpackjoyride/assets/source/machinegun.png b/games/jetpackjoyride/assets/source/machinegun.png
new file mode 100644
index 00000000..15bc92fa
Binary files /dev/null and b/games/jetpackjoyride/assets/source/machinegun.png differ
diff --git a/games/jetpackjoyride/assets/source/missiles.png b/games/jetpackjoyride/assets/source/missiles.png
new file mode 100644
index 00000000..907e8e07
Binary files /dev/null and b/games/jetpackjoyride/assets/source/missiles.png differ
diff --git a/games/jetpackjoyride/assets/source/muzzle_flash.png b/games/jetpackjoyride/assets/source/muzzle_flash.png
new file mode 100644
index 00000000..0db3ca73
Binary files /dev/null and b/games/jetpackjoyride/assets/source/muzzle_flash.png differ
diff --git a/games/jetpackjoyride/assets/source/scientists.png b/games/jetpackjoyride/assets/source/scientists.png
new file mode 100644
index 00000000..c4d7ebb2
Binary files /dev/null and b/games/jetpackjoyride/assets/source/scientists.png differ
diff --git a/games/jetpackjoyride/assets/source/shield.png b/games/jetpackjoyride/assets/source/shield.png
new file mode 100644
index 00000000..aaf7e69e
Binary files /dev/null and b/games/jetpackjoyride/assets/source/shield.png differ
diff --git a/games/jetpackjoyride/assets/source/warnings.png b/games/jetpackjoyride/assets/source/warnings.png
new file mode 100644
index 00000000..6494c2d2
Binary files /dev/null and b/games/jetpackjoyride/assets/source/warnings.png differ
diff --git a/games/jetpackjoyride/assets/source/zapper_caps.png b/games/jetpackjoyride/assets/source/zapper_caps.png
new file mode 100644
index 00000000..b3c5d7a5
Binary files /dev/null and b/games/jetpackjoyride/assets/source/zapper_caps.png differ
diff --git a/games/jetpackjoyride/docs/buy.png b/games/jetpackjoyride/docs/buy.png
new file mode 100644
index 00000000..4d819c59
Binary files /dev/null and b/games/jetpackjoyride/docs/buy.png differ
diff --git a/games/jetpackjoyride/docs/gameplay.png b/games/jetpackjoyride/docs/gameplay.png
new file mode 100644
index 00000000..170d88fe
Binary files /dev/null and b/games/jetpackjoyride/docs/gameplay.png differ
diff --git a/games/jetpackjoyride/docs/guide.png b/games/jetpackjoyride/docs/guide.png
new file mode 100644
index 00000000..4732ed1c
Binary files /dev/null and b/games/jetpackjoyride/docs/guide.png differ
diff --git a/games/jetpackjoyride/docs/menu-animation.gif b/games/jetpackjoyride/docs/menu-animation.gif
new file mode 100644
index 00000000..37fda03f
Binary files /dev/null and b/games/jetpackjoyride/docs/menu-animation.gif differ
diff --git a/games/jetpackjoyride/docs/result.png b/games/jetpackjoyride/docs/result.png
new file mode 100644
index 00000000..d06c27be
Binary files /dev/null and b/games/jetpackjoyride/docs/result.png differ
diff --git a/games/jetpackjoyride/docs/rotors-turned.png b/games/jetpackjoyride/docs/rotors-turned.png
new file mode 100644
index 00000000..467995e1
Binary files /dev/null and b/games/jetpackjoyride/docs/rotors-turned.png differ
diff --git a/games/jetpackjoyride/docs/rotors.png b/games/jetpackjoyride/docs/rotors.png
new file mode 100644
index 00000000..bac38930
Binary files /dev/null and b/games/jetpackjoyride/docs/rotors.png differ
diff --git a/games/jetpackjoyride/docs/shop.png b/games/jetpackjoyride/docs/shop.png
new file mode 100644
index 00000000..c39b9406
Binary files /dev/null and b/games/jetpackjoyride/docs/shop.png differ
diff --git a/games/jetpackjoyride/docs/title.png b/games/jetpackjoyride/docs/title.png
new file mode 100644
index 00000000..275875ab
Binary files /dev/null and b/games/jetpackjoyride/docs/title.png differ
diff --git a/games/jetpackjoyride/src/assets.h b/games/jetpackjoyride/src/assets.h
new file mode 100644
index 00000000..a4461b56
--- /dev/null
+++ b/games/jetpackjoyride/src/assets.h
@@ -0,0 +1,1651 @@
+/* Generated by tools/assets.py. Artwork: Halfbrick; see assets/README.md. */
+#ifndef JJ_ASSETS_H
+#define JJ_ASSETS_H
+#include <stdint.h>
+typedef struct { uint16_t w,h; const uint16_t *palette,*rows; const uint8_t *data; uint8_t bits; } jj_sprite;
+static const uint16_t jj_barry_palette_0[] = {0x0,0xffff,0xff36,0xfeec,0xd657,0xed90,0xb48f,0xa4cf,0xc501,0xccaa,0xb3ec,0x936d,0x6b4e,0x8340,0xa2ea,0x82e8,0x8289,0x6a05,0x528e,0x5202,0x71a3,0x5943,0x4206,0x40e1,0x3820,0x316b,0x1928,0x2923,0x18c6,0x1081,0x0,0x0};
+static const uint16_t jj_barry_palette_1[] = {0x0,0xffff,0xff36,0xfeec,0xd657,0xed90,0xb48f,0xa4cf,0xc501,0xccaa,0xb3ec,0x936d,0x6b4e,0x8340,0xa2ea,0x82e8,0x8289,0x6a05,0x963c,0x5202,0x71a3,0x5943,0x4206,0x40e1,0x3820,0x7d37,0x6c74,0x2923,0x5bd1,0x1081,0x324a,0x0};
+static const uint16_t jj_barry_palette_2[] = {0x0,0xffff,0xff36,0xfeec,0xd657,0xed90,0xb48f,0xa4cf,0xc501,0xccaa,0xb3ec,0x936d,0x6b4e,0x8340,0xa2ea,0x82e8,0x8289,0x6a05,0xaa4f,0x5202,0x71a3,0x5943,0x4206,0x40e1,0x3820,0x79ab,0x6148,0x2923,0x40e6,0x1081,0x0,0x0};
+static const uint16_t jj_barry_palette_3[] = {0x0,0xffff,0xff36,0xfeec,0xd657,0xed90,0xb48f,0xa4cf,0xc501,0xccaa,0xb3ec,0x936d,0x6b4e,0x8340,0xa2ea,0x82e8,0x8289,0x6a05,0x64c8,0x5202,0x71a3,0x5943,0x4206,0x40e1,0x3820,0x4ba6,0x3ac5,0x2923,0x2a03,0x1081,0x0,0x0};
+static const uint16_t jj_lab_palette[] = {
+ 0x0,0xbdf8,0x9d35,0x8452,0x73b1,0x636f,0x52ef,0x4ace,0x4ace,0x4a8b,0x428d,0x3a4c,0x320c,0x29ec,0x31ea,0x21aa,0x216a,0x2968,0x1949,0x1929,0x1929,0x1929,0x1928,0x1928,
+ 0x1929,0x1929,0x1929,0x1929,0x1929,0x1927,0x1907,0x884,
+};
+static const uint16_t jj_lab_rows[] = {
+ 0,2,120,249,378,507,625,723,725,746,748,766,784,806,808,827,829,831,833,854,880,899,901,903,
+ 905,923,984,1024,1114,1198,1271,1361,1467,1543,1619,1689,1746,1818,1888,1932,1990,2038,2083,2127,2167,2210,2258,2307,
+ 2351,2396,2447,2496,2542,2589,2629,2673,2717,2772,2836,2873,2915,2970,3019,3061,3098,3155,3220,3294,3367,3443,3516,3595,
+ 3672,3752,3832,3918,4008,4094,4182,4277,4368,4455,4571,4672,4764,4855,4946,5043,5145,5254,5349,5446,5555,5640,5707,5758,
+ 5810,
+};
+static const uint8_t jj_lab_data[] = {
+ 255,31,130,30,3,31,31,30,30,130,29,0,30,130,29,7,30,29,29,30,30,29,29,30,
+ 130,29,130,30,1,31,31,132,30,3,31,31,30,30,130,29,0,30,130,29,7,30,29,29,
+ 30,30,29,29,30,130,29,130,30,1,31,31,132,30,3,31,31,30,30,130,29,0,30,130,
+ 29,7,30,29,29,30,30,29,29,30,130,29,130,30,1,31,31,132,30,3,31,31,30,30,
+ 130,29,0,30,130,29,7,30,29,29,30,30,29,29,30,130,29,130,30,3,31,31,30,30,
+ 30,17,17,29,5,14,30,17,29,31,31,15,31,31,29,17,31,31,17,17,31,31,17,29,
+ 31,31,17,17,30,9,9,30,130,17,28,29,5,14,30,17,29,31,31,15,31,31,29,17,
+ 31,31,17,17,31,31,17,29,31,31,17,17,30,9,9,30,130,17,28,29,5,14,30,17,
+ 29,31,31,15,31,31,29,17,31,31,17,17,31,31,17,29,31,31,17,17,30,9,9,30,
+ 130,17,29,29,5,14,30,17,29,31,31,15,31,31,29,17,31,31,17,17,31,31,17,29,
+ 31,31,17,17,30,9,9,30,17,10,17,17,29,9,17,29,14,29,31,31,14,130,31,16,
+ 14,31,31,17,17,31,31,15,29,31,31,15,17,29,9,9,29,130,17,8,29,9,17,29,
+ 14,29,31,31,14,130,31,16,14,31,31,17,17,31,31,15,29,31,31,15,17,29,9,14,
+ 29,130,17,8,29,9,17,29,14,29,31,31,14,130,31,16,14,31,31,17,17,31,31,15,
+ 29,31,31,15,17,29,9,9,30,130,17,8,29,9,17,29,14,29,31,31,14,130,31,17,
+ 14,31,31,17,17,31,31,15,29,31,31,15,17,29,9,9,29,17,127,17,15,30,29,31,
+ 17,15,29,31,31,14,31,31,29,14,31,31,17,17,31,31,14,29,31,31,14,17,29,31,
+ 29,29,15,17,15,30,29,31,17,15,29,31,31,14,31,31,29,14,31,31,17,17,31,31,
+ 14,29,31,31,14,17,29,31,29,29,15,17,15,30,29,31,17,15,29,31,31,14,31,31,
+ 29,14,31,31,17,17,31,31,14,29,31,31,14,17,29,31,29,29,15,17,15,30,29,31,
+ 17,15,29,31,31,14,31,31,29,14,31,31,17,17,31,31,14,29,31,31,14,17,29,31,
+ 29,29,15,130,17,1,30,29,130,17,15,31,17,15,17,31,17,15,29,31,17,17,31,29,
+ 17,17,31,131,17,1,30,30,132,17,1,30,29,130,17,15,31,17,15,17,31,17,15,29,
+ 31,17,17,31,29,15,17,31,131,17,1,30,30,132,17,1,30,29,130,17,15,31,17,15,
+ 17,31,17,15,29,31,17,17,31,29,15,17,31,131,17,1,30,30,132,17,1,30,29,130,
+ 17,15,31,17,15,17,31,17,15,29,31,17,17,31,29,15,17,31,131,17,3,30,30,17,
+ 17,130,14,0,11,131,14,16,9,11,14,11,9,14,14,9,9,14,14,9,9,14,14,9,
+ 11,137,14,0,11,131,14,16,9,11,14,11,9,14,14,9,9,14,14,9,9,14,14,9,
+ 11,137,14,0,11,131,14,16,9,11,14,11,9,14,14,9,9,14,14,9,9,14,14,9,
+ 11,137,14,0,11,131,14,16,9,11,14,11,9,14,14,9,9,14,14,9,9,14,14,9,
+ 11,134,14,255,29,133,1,1,2,2,157,1,1,2,2,157,1,1,2,2,157,1,0,2,
+ 152,1,255,2,133,2,0,3,158,2,0,3,158,2,0,3,158,2,0,3,152,2,133,1,
+ 0,2,158,1,0,2,158,1,0,2,158,1,0,2,152,1,133,1,1,2,2,157,1,1,
+ 2,2,157,1,1,2,2,156,1,1,2,2,152,1,255,2,131,2,1,3,3,157,2,0,
+ 3,158,2,0,3,158,2,0,3,154,2,255,3,255,4,255,4,144,6,1,5,5,157,6,
+ 1,5,5,157,6,1,5,5,157,6,0,5,141,6,143,7,2,6,6,8,156,7,2,6,
+ 6,8,156,7,2,6,6,8,156,7,2,5,6,8,140,7,143,12,0,11,158,12,0,11,
+ 158,12,0,11,157,12,1,11,11,142,12,255,23,255,15,255,13,137,12,139,13,147,12,139,
+ 13,147,12,139,13,147,12,139,13,137,12,136,22,1,16,12,136,13,3,12,13,22,18,144,
+ 22,1,16,12,137,13,1,12,16,145,22,1,18,12,136,13,6,12,13,22,18,22,22,18,
+ 131,22,1,18,18,131,22,5,18,18,22,22,16,12,136,13,4,12,13,22,18,22,134,18,
+ 137,31,2,15,12,13,135,12,148,31,2,15,12,13,133,12,2,13,11,17,147,31,2,15,
+ 12,13,134,12,0,13,148,31,2,15,12,13,135,12,138,31,1,27,28,134,27,3,30,31,
+ 13,11,134,12,2,30,30,26,131,27,16,26,26,25,25,30,30,25,27,26,27,27,28,27,
+ 28,30,30,13,134,12,6,11,15,30,28,28,25,24,132,25,3,30,30,21,27,133,25,4,
+ 30,31,13,11,13,132,12,3,11,30,30,28,134,27,3,25,30,30,28,134,27,3,30,31,
+ 13,11,134,12,2,30,30,28,136,27,1,23,26,134,27,3,28,30,30,13,132,11,3,10,
+ 22,30,24,135,27,3,25,23,30,25,135,27,3,30,30,12,11,131,12,2,11,13,30,136,
+ 27,3,25,30,30,25,134,27,3,25,30,30,13,132,11,3,10,29,30,25,135,27,3,25,
+ 30,23,25,134,27,3,25,30,30,12,132,11,3,10,22,30,25,135,27,1,26,23,1,23,
+ 26,135,27,2,28,30,30,132,15,2,29,30,28,136,27,3,25,23,30,25,136,27,1,31,
+ 23,133,12,0,30,137,27,3,25,30,30,25,136,27,1,31,30,132,15,2,29,30,28,136,
+ 27,3,25,30,23,25,135,27,2,28,31,30,132,15,2,29,30,26,136,27,1,26,23,0,
+ 23,130,24,0,26,134,27,0,30,132,31,0,30,134,27,9,26,27,24,24,25,23,30,21,
+ 24,24,134,27,2,30,30,12,131,11,1,13,30,133,27,10,24,27,27,24,25,30,30,21,
+ 24,24,26,134,27,0,30,132,31,1,30,28,133,27,131,24,3,25,30,23,25,130,24,134,
+ 27,0,30,132,31,1,30,28,133,27,5,24,27,24,27,24,23,1,22,19,130,20,131,24,
+ 130,27,0,28,132,27,0,25,130,27,131,24,12,20,20,24,20,21,23,30,19,24,20,20,
+ 24,24,132,27,7,30,11,10,11,11,10,12,30,131,27,13,24,24,20,20,24,24,19,30,
+ 30,19,23,20,24,20,130,24,130,27,0,28,132,27,0,26,130,27,131,24,130,20,4,23,
+ 21,30,23,21,131,20,130,24,130,27,0,25,132,27,0,25,131,27,130,24,5,20,20,24,
+ 20,19,23,1,22,19,132,20,1,24,24,140,27,0,24,134,20,3,19,23,30,18,131,20,
+ 0,24,130,27,9,28,27,30,11,10,11,11,10,12,30,131,27,0,24,132,20,3,19,30,
+ 30,18,133,20,0,24,141,27,0,24,133,20,3,18,30,23,19,133,20,0,24,140,27,1,
+ 24,24,133,20,1,19,22,1,22,19,130,20,131,24,139,27,131,24,132,20,3,19,23,30,
+ 18,130,20,1,24,24,130,27,9,28,27,30,11,10,11,11,10,12,30,131,27,1,24,24,
+ 131,20,3,19,30,30,18,131,20,131,24,138,27,131,24,132,20,3,18,30,23,19,131,20,
+ 131,24,138,27,132,24,131,20,1,19,22,1,22,19,132,20,0,24,142,27,0,24,133,20,
+ 3,18,23,30,18,131,20,132,27,2,30,30,11,131,10,1,12,30,132,27,0,24,131,20,
+ 3,19,30,30,18,132,20,0,24,142,27,0,24,133,20,3,18,30,23,19,132,20,0,24,
+ 142,27,0,24,133,20,1,19,22,1,23,27,132,24,144,27,132,24,4,27,28,23,30,21,
+ 131,24,132,27,1,30,30,132,10,1,12,30,133,27,131,24,4,25,30,30,28,27,132,24,
+ 143,27,132,24,4,27,28,30,23,25,132,24,144,27,134,24,0,23,1,22,12,130,24,145,
+ 27,11,24,27,27,24,24,27,18,12,30,30,21,23,130,24,132,27,1,30,30,132,10,1,
+ 12,30,133,27,131,24,7,21,30,30,12,16,27,24,24,147,27,130,24,4,20,12,30,23,
+ 19,130,24,4,27,24,27,27,24,141,27,1,24,27,132,24,0,23,2,23,17,27,151,25,
+ 6,24,25,23,17,30,30,25,136,27,1,30,30,132,10,1,12,30,137,27,5,25,30,30,
+ 17,22,28,130,25,130,26,1,25,24,134,26,3,25,24,26,26,131,25,6,26,25,27,17,
+ 30,23,26,136,27,0,24,134,27,0,24,137,27,1,26,23,1,30,31,155,30,3,31,30,
+ 30,25,136,27,8,30,30,10,8,10,10,8,11,30,137,27,0,25,131,30,0,22,151,23,
+ 5,22,29,30,30,27,26,155,27,1,26,23,2,22,15,23,137,22,132,23,137,22,5,23,
+ 22,14,30,30,25,136,27,2,30,30,10,131,8,1,11,30,137,27,8,25,30,30,13,16,
+ 22,20,20,22,132,20,133,22,137,20,5,22,18,13,30,23,26,155,27,1,26,23,3,23,
+ 14,27,28,151,26,5,28,22,14,30,30,25,136,27,1,30,30,131,8,2,7,11,30,137,
+ 27,5,25,30,30,14,22,28,151,27,5,28,23,14,30,23,26,155,27,1,26,23,1,23,
+ 30,153,27,5,24,30,30,23,30,25,136,27,1,30,30,131,8,2,7,11,30,137,27,0,
+ 25,131,30,0,24,151,27,5,24,27,30,30,23,26,155,27,1,26,23,1,23,21,154,27,
+ 4,24,21,23,30,25,135,27,9,28,30,30,8,7,7,8,6,10,30,137,27,4,25,30,
+ 30,21,24,154,27,3,21,30,23,26,155,27,1,26,23,0,23,156,27,3,26,23,30,25,
+ 136,27,8,30,30,8,6,7,7,6,10,30,137,27,3,25,30,30,25,155,27,3,25,30,
+ 23,26,155,27,1,26,23,0,23,157,24,3,23,30,28,27,130,24,132,27,8,30,30,7,
+ 6,6,7,6,10,30,132,27,133,24,3,30,30,25,27,153,24,3,27,25,30,23,157,24,
+ 0,23,1,22,19,155,20,5,19,23,30,13,18,24,130,20,131,27,2,30,30,7,131,6,
+ 1,10,30,131,27,0,24,132,20,3,19,30,30,18,155,20,3,18,30,23,19,155,20,1,
+ 19,22,1,22,19,155,20,5,19,23,30,14,18,21,130,19,0,25,130,26,1,27,23,132,
+ 6,1,10,30,131,27,0,24,132,20,3,19,23,30,18,155,20,3,18,30,23,19,155,20,
+ 1,19,22,1,22,19,155,20,1,19,23,130,30,0,22,132,23,131,30,132,6,1,10,30,
+ 131,27,0,24,132,20,3,19,23,30,18,155,20,3,18,30,23,19,155,20,1,19,22,1,
+ 22,19,155,20,4,19,23,30,17,22,135,29,1,30,29,131,6,2,5,10,30,131,27,0,
+ 24,132,20,3,19,30,30,18,155,20,3,18,30,23,19,155,20,1,19,22,1,22,19,155,
+ 20,5,19,23,30,10,16,21,130,18,12,25,25,26,25,27,30,6,5,6,6,5,10,30,
+ 131,27,0,24,132,20,3,19,23,30,18,155,20,3,18,30,23,19,155,20,1,19,22,1,
+ 22,19,155,20,5,19,23,30,30,23,19,130,20,131,27,8,30,30,6,5,6,6,5,10,
+ 30,131,27,0,24,132,20,3,19,29,30,18,155,20,3,18,30,23,19,155,20,1,19,22,
+ 1,22,19,155,20,3,19,23,30,18,131,20,0,24,131,27,2,30,29,6,131,5,1,8,
+ 30,132,27,132,20,3,19,23,30,18,155,20,3,18,30,23,19,155,20,1,19,22,1,22,
+ 19,155,20,3,19,23,29,21,131,20,0,24,131,27,1,30,8,133,5,1,15,30,130,27,
+ 0,24,132,20,3,19,23,30,18,155,20,3,18,30,23,19,155,20,1,19,22,0,20,157,
+ 18,1,23,29,130,18,131,20,4,27,26,30,11,4,134,5,3,16,27,24,24,130,20,131,
+ 18,1,22,29,157,18,1,29,23,157,18,0,22,157,18,3,16,22,29,16,131,18,5,19,
+ 20,20,30,12,4,135,5,5,6,20,27,20,20,19,131,18,3,16,22,29,16,155,18,3,
+ 16,29,22,21,155,18,1,21,18,157,18,3,16,22,29,16,132,18,4,20,21,30,8,4,
+ 135,5,4,4,15,27,19,20,132,18,3,16,22,29,16,155,18,4,16,29,22,13,16,153,
+ 18,2,16,13,18,0,18,157,16,2,22,22,16,133,18,3,19,30,10,4,135,5,3,4,
+ 15,27,19,131,18,6,16,18,16,22,29,16,18,131,16,144,18,132,16,7,18,16,22,23,
+ 14,16,18,16,149,18,4,16,18,18,14,22,0,18,157,16,5,22,22,16,18,16,16,130,
+ 18,3,19,30,10,4,135,5,2,4,15,27,130,18,130,16,5,18,16,22,29,16,18,153,
+ 16,5,18,16,29,22,30,23,131,18,0,20,130,18,6,20,18,18,20,18,20,20,138,18,
+ 2,23,30,22,158,16,1,22,22,132,16,130,18,1,30,10,137,4,3,15,25,16,18,133,
+ 16,1,22,29,157,16,3,29,29,17,17,153,29,2,17,17,29,158,16,1,18,22,135,16,
+ 1,30,10,137,4,1,15,21,135,16,1,22,22,157,16,3,17,22,10,15,130,16,1,15,
+ 15,143,16,0,15,131,16,2,15,10,18,0,16,157,15,1,16,17,130,15,132,16,1,30,
+ 8,137,4,1,15,21,131,16,131,15,1,17,22,131,15,147,16,133,15,7,17,18,30,22,
+ 16,16,20,30,131,27,136,30,132,27,0,20,130,16,2,22,30,16,158,15,1,16,17,132,
+ 15,130,16,1,30,8,137,4,3,13,21,16,16,133,15,1,17,22,137,15,136,16,138,15,
+ 1,17,16,130,15,2,18,14,10,145,11,6,15,18,16,16,15,15,16,158,15,1,16,17,
+ 134,15,2,16,23,8,137,4,1,13,18,135,15,1,17,22,157,15,1,17,16,130,15,2,
+ 23,10,3,144,4,2,3,5,18,131,15,0,16,159,15,0,17,135,15,1,23,14,136,4,
+ 2,5,15,16,135,15,1,17,17,157,15,1,17,16,130,15,1,22,8,147,4,1,15,16,
+ 131,15,157,15,3,13,15,17,13,135,15,1,30,11,135,4,1,13,16,135,15,3,13,16,
+ 17,13,131,15,2,16,23,20,132,22,1,23,23,132,22,2,20,22,18,134,15,0,17,131,
+ 15,1,22,6,147,4,1,14,16,131,15,0,15,157,13,1,15,17,131,13,132,15,2,16,
+ 30,7,133,4,1,11,18,132,15,130,13,130,15,1,17,13,130,15,2,16,15,8,141,11,
+ 2,10,12,18,132,15,1,13,17,132,15,0,5,130,4,133,5,130,6,132,5,130,4,1,
+ 11,16,131,15,0,15,157,13,1,15,17,134,13,130,15,1,18,17,132,4,1,5,18,131,
+ 15,133,13,2,11,15,17,130,13,4,15,22,8,3,3,141,4,4,3,11,18,13,15,130,
+ 13,10,17,15,13,13,16,14,4,4,3,9,31,130,30,132,31,131,30,9,31,6,4,4,
+ 8,16,13,15,13,15,158,13,1,15,15,136,13,130,15,132,4,2,6,15,15,135,13,3,
+ 14,11,15,17,130,13,4,18,10,4,4,5,140,4,4,5,5,3,14,16,131,13,10,17,
+ 15,13,13,16,12,4,4,3,11,29,130,17,4,29,30,31,30,30,131,17,5,30,8,4,
+ 4,6,16,130,13,0,15,158,13,1,15,15,137,13,1,15,15,131,4,2,3,5,16,132,
+ 15,14,14,14,15,13,15,29,17,17,13,13,16,12,4,4,5,142,1,4,2,5,4,15,
+ 15,130,13,5,15,15,13,13,16,10,130,4,1,14,17,130,14,130,29,1,17,17,131,14,
+ 5,17,11,3,4,5,15,130,13,0,14,0,13,157,12,1,14,15,132,12,132,13,1,15,
+ 15,131,4,3,3,5,15,15,136,14,5,11,17,17,12,15,14,131,4,143,1,20,5,3,
+ 5,15,13,13,12,15,15,13,13,16,6,3,4,4,17,14,9,9,14,130,17,2,11,14,
+ 14,130,9,1,17,14,130,4,0,15,131,13,0,13,157,12,1,14,15,135,12,12,13,13,
+ 15,14,4,3,4,4,3,5,15,13,13,135,12,9,8,15,15,12,13,14,4,3,4,4,
+ 143,1,19,5,3,3,11,13,13,12,15,14,12,13,15,5,3,3,4,29,17,14,14,130,
+ 17,3,14,9,14,17,130,14,9,17,17,4,4,3,12,13,13,12,13,158,12,2,14,15,
+ 11,136,12,8,13,14,4,3,4,4,3,5,15,136,12,11,14,17,14,15,11,13,14,4,
+ 3,3,5,3,141,1,40,3,4,3,3,11,13,12,12,15,14,12,13,15,4,3,3,5,
+ 29,11,11,14,29,3,6,14,14,17,17,14,9,8,14,29,4,3,3,10,15,12,12,13,
+ 0,12,157,11,1,12,14,133,11,131,12,8,13,14,4,3,4,4,3,5,13,132,12,132,
+ 11,9,10,14,15,11,13,14,4,3,4,3,141,4,24,5,4,3,4,3,11,13,12,11,
+ 15,14,12,13,14,4,4,3,6,17,14,15,17,17,1,5,130,17,10,14,9,8,9,17,
+ 30,5,3,3,7,15,130,12,158,11,2,12,14,10,136,11,2,13,14,4,131,3,2,5,
+ 13,12,137,11,5,14,14,11,13,14,4,130,3,0,4,130,14,1,11,11,135,14,0,6,
+ 131,3,13,11,13,11,11,14,14,11,15,11,3,4,3,9,29,130,17,5,14,1,7,29,
+ 17,14,130,11,10,17,29,31,6,3,3,5,15,11,11,12,3,11,7,10,11,151,10,4,
+ 11,10,7,12,14,133,10,131,11,2,12,13,4,131,3,1,5,12,132,11,133,10,9,14,
+ 14,10,12,14,4,4,5,4,17,140,31,41,30,5,3,5,4,11,12,11,10,14,12,10,
+ 15,8,3,4,3,14,29,14,17,15,9,2,17,29,15,11,14,14,11,11,14,29,9,3,
+ 3,4,13,11,11,12,2,11,14,11,153,10,3,11,14,11,14,137,10,2,12,12,4,131,
+ 3,3,4,12,11,11,136,10,9,12,14,10,12,12,4,3,2,9,29,130,14,3,17,30,
+ 29,17,132,14,14,29,30,7,4,2,3,11,12,11,10,14,12,10,15,6,130,3,24,14,
+ 14,8,14,14,9,14,29,17,11,14,11,6,7,6,8,14,11,3,3,4,12,11,10,11,
+ 1,14,17,155,14,2,17,14,14,137,10,2,11,12,4,131,3,1,4,11,138,10,9,12,
+ 14,10,11,12,4,2,2,8,14,130,9,3,11,17,14,14,132,9,35,17,30,6,4,2,
+ 3,11,11,10,10,14,11,10,14,5,3,3,4,17,14,8,9,14,14,29,17,14,9,14,
+ 8,9,9,8,9,14,14,130,3,3,11,11,10,11,1,11,6,155,10,3,6,11,12,8,
+ 136,10,2,11,12,4,131,3,1,4,11,137,10,18,8,11,14,10,11,12,4,2,2,8,
+ 14,8,8,6,9,14,11,11,6,131,8,29,17,30,6,4,2,3,11,11,10,10,14,11,
+ 10,12,4,3,3,4,17,11,9,9,14,17,17,14,9,9,11,9,131,8,8,14,17,4,
+ 3,3,8,11,10,11,2,11,11,10,153,8,0,10,130,11,3,8,10,8,8,134,10,1,
+ 12,4,131,3,1,4,11,134,10,32,8,10,10,8,11,14,8,11,11,4,2,2,8,14,
+ 8,9,7,9,11,9,11,6,8,9,9,8,17,29,6,4,2,3,11,130,10,11,14,11,
+ 10,11,4,3,3,5,17,9,6,8,130,17,3,9,1,14,14,132,6,8,9,17,4,3,
+ 3,6,11,10,10,2,10,14,10,153,8,4,10,14,10,11,7,134,8,130,10,1,11,4,
+ 131,3,0,4,131,10,135,8,28,11,12,8,10,11,4,2,2,8,14,7,7,6,14,9,
+ 9,14,6,8,7,6,9,17,29,6,4,2,3,11,130,10,3,12,11,11,10,130,3,4,
+ 9,29,14,9,11,130,17,3,1,1,17,17,132,9,8,14,29,5,3,3,5,11,8,10,
+ 1,10,6,154,8,4,7,6,10,11,7,136,8,1,10,11,132,3,1,4,10,137,8,10,
+ 7,11,12,6,10,11,4,2,2,9,17,130,14,3,11,9,14,17,133,14,12,31,6,4,
+ 2,3,11,10,8,6,12,10,11,7,130,3,4,14,29,11,14,17,130,14,17,1,1,30,
+ 14,9,9,14,9,9,14,31,6,3,3,4,11,8,10,5,8,7,8,7,8,8,130,7,
+ 2,8,8,7,130,8,0,7,132,8,2,7,8,8,132,7,8,8,7,10,11,7,8,8,
+ 7,7,132,8,1,10,11,132,3,1,4,10,133,8,130,7,37,8,7,10,14,11,10,11,
+ 4,2,2,9,30,17,11,8,8,14,17,17,11,8,11,9,9,17,31,6,4,2,3,10,
+ 8,10,12,12,10,11,6,130,3,130,14,22,17,17,12,9,14,1,1,29,11,8,12,9,
+ 8,12,17,30,9,3,3,4,10,8,10,0,8,130,7,0,8,153,7,3,10,11,7,8,
+ 132,7,130,8,1,10,11,132,3,1,4,10,130,8,2,7,7,8,130,7,29,8,7,10,
+ 14,14,11,11,4,2,2,9,30,14,10,9,14,17,17,11,9,12,12,9,14,29,31,6,
+ 4,2,3,130,11,4,15,14,10,11,4,130,3,0,14,130,17,11,14,8,9,14,1,1,
+ 17,7,11,11,8,11,130,17,0,11,130,3,2,10,8,10,0,8,142,7,1,8,8,139,
+ 7,3,6,10,11,6,134,7,3,8,8,10,11,132,3,1,4,10,131,8,134,7,9,10,
+ 14,6,11,11,4,2,2,9,29,130,14,3,17,17,14,11,131,14,19,17,30,31,6,4,
+ 2,3,11,11,10,7,14,10,11,4,3,3,4,30,29,130,17,9,9,11,17,1,1,11,
+ 14,17,14,14,132,17,130,3,2,8,8,10,0,8,156,7,3,6,10,11,6,134,7,3,
+ 8,7,10,11,132,3,0,4,131,8,134,7,35,6,10,11,8,10,10,4,2,2,8,14,
+ 8,6,6,14,17,9,14,8,7,6,6,9,17,30,6,4,2,3,10,8,10,10,11,11,
+ 10,130,3,2,5,17,11,130,9,6,14,14,30,1,1,14,14,130,9,10,8,9,9,14,
+ 17,4,3,3,6,10,8,0,8,156,7,3,6,10,11,6,134,7,3,8,7,10,11,132,
+ 3,0,4,131,8,134,7,10,6,10,11,14,10,10,4,2,2,8,14,130,8,21,9,11,
+ 9,11,7,8,7,9,9,14,30,6,4,2,3,10,8,10,15,11,12,8,130,3,26,6,
+ 17,9,9,6,9,14,17,17,9,2,14,14,6,9,9,6,7,8,9,17,4,3,3,5,
+ 10,8,0,8,139,7,132,8,139,7,3,6,10,11,6,134,7,3,8,7,8,11,132,3,
+ 4,4,8,8,7,8,134,7,18,6,10,11,6,8,11,4,2,2,8,14,7,8,7,9,
+ 9,14,14,6,130,8,13,9,17,30,6,4,2,3,10,8,8,6,11,14,6,130,3,26,
+ 9,17,9,9,7,9,17,17,11,11,14,9,11,9,8,9,8,7,9,9,17,5,3,3,
+ 4,10,8,0,8,137,7,2,8,10,10,132,11,0,8,137,7,3,6,10,11,6,133,7,
+ 5,8,8,7,10,12,4,131,3,4,5,10,7,8,8,135,7,17,10,11,7,10,11,4,
+ 3,2,8,14,8,8,7,9,14,11,9,7,131,8,30,17,31,5,4,2,3,11,8,8,
+ 7,11,14,5,3,4,3,14,14,9,8,6,9,17,14,9,14,14,8,14,9,6,131,8,
+ 7,9,17,8,3,3,4,10,10,0,8,134,7,5,8,7,7,12,4,2,130,4,6,3,
+ 5,12,7,7,8,8,134,7,1,10,11,132,7,130,8,2,7,10,11,134,4,0,10,131,
+ 8,132,7,18,8,7,10,11,7,10,10,4,3,2,8,14,6,7,6,9,14,9,14,131,
+ 6,30,7,17,31,5,4,2,3,11,10,8,7,11,14,5,3,4,4,14,14,9,8,9,
+ 17,14,8,2,14,9,11,17,14,130,9,9,8,8,9,14,9,3,4,4,10,10,0,8,
+ 136,7,2,12,6,3,132,4,2,3,6,12,137,7,2,10,11,6,134,7,3,10,12,4,
+ 3,134,4,1,11,8,136,7,17,10,11,7,10,11,4,2,2,9,17,9,9,11,14,8,
+ 11,14,14,130,9,12,14,29,30,5,4,2,3,11,8,8,7,11,15,131,4,12,29,17,
+ 14,14,17,14,9,9,1,5,14,14,17,134,14,1,17,14,130,4,1,8,10,136,10,2,
+ 12,10,3,135,4,1,10,12,136,10,2,11,14,8,134,10,2,13,5,3,135,4,1,6,
+ 11,135,10,34,8,11,12,8,12,8,4,4,3,10,29,9,9,14,8,10,14,17,14,9,
+ 9,14,17,14,29,5,4,3,4,12,11,10,10,14,15,130,4,22,5,17,11,14,17,14,
+ 8,10,14,3,9,17,17,14,8,6,10,14,17,15,11,11,14,130,4,1,8,12,134,11,
+ 5,10,11,12,4,4,5,135,4,3,11,11,10,10,131,11,3,10,10,11,11,134,10,4,
+ 12,10,4,4,5,133,4,3,5,4,7,11,132,10,13,11,10,10,11,11,10,8,3,4,
+ 6,5,9,29,9,130,14,5,17,17,29,14,9,14,130,17,20,31,5,4,6,5,6,12,
+ 10,10,12,14,5,4,4,8,29,17,17,29,14,9,130,14,2,17,29,17,130,14,6,17,
+ 29,29,17,14,17,29,130,4,1,6,12,136,3,0,4,138,5,1,4,4,144,3,2,4,
+ 5,4,137,5,1,4,4,138,3,22,4,4,5,5,4,9,17,5,5,9,5,5,9,9,
+ 3,9,9,3,9,14,17,6,4,130,5,0,4,130,3,23,4,5,5,4,9,29,5,5,
+ 9,5,5,9,9,3,9,9,3,9,9,3,9,9,5,5,130,9,4,6,4,5,4,3,
+ 137,5,139,6,147,5,140,6,139,5,130,6,18,5,9,17,5,9,14,5,9,17,9,9,
+ 17,9,5,17,9,17,8,4,130,6,133,5,29,6,5,17,17,5,9,14,5,9,17,9,
+ 9,17,9,5,17,9,5,9,9,5,9,17,9,17,10,5,6,6,5,198,6,17,14,17,
+ 9,29,9,9,29,17,9,17,29,9,9,29,9,31,11,5,138,6,24,29,17,9,29,9,
+ 9,29,17,9,17,29,9,9,29,9,9,29,9,9,29,14,9,31,14,5,130,6,196,7,
+ 13,8,6,11,17,17,29,17,17,29,17,14,29,17,14,130,17,2,29,14,8,138,7,23,
+ 29,29,17,29,17,17,29,17,17,29,29,17,29,29,17,17,29,17,17,29,17,17,29,17,
+ 131,7,
+};
+static const jj_sprite jj_lab = {128,96,jj_lab_palette,jj_lab_rows,jj_lab_data,8};
+static const uint16_t jj_floor_palette[] = {
+ 0x0,0xce9a,0xbe39,0xbe19,0xb5d8,0xad97,0x9d36,0x8474,0x52ee,0x39e9,0x31a9,0x2126,0x18e6,0x10c5,0x1083,0x0,
+};
+static const uint16_t jj_floor_rows[] = {
+ 0,2,20,40,58,60,78,96,130,148,189,234,271,
+};
+static const uint8_t jj_floor_data[] = {
+ 255,8,198,6,0,112,144,6,1,119,139,6,0,112,145,6,0,112,132,6,199,5,2,101,
+ 96,142,5,0,96,140,5,2,101,96,142,5,0,96,132,5,202,1,0,32,142,1,0,32,
+ 142,1,0,32,142,1,0,32,131,1,255,4,149,2,0,48,158,2,0,48,159,2,1,51,
+ 155,2,1,51,136,2,149,3,1,68,157,3,1,68,159,3,0,80,156,3,0,80,136,3,
+ 1,170,139,9,135,10,1,153,137,10,139,9,136,10,0,144,137,10,139,9,137,10,0,144,
+ 136,10,139,9,136,10,0,144,135,10,1,204,139,13,147,12,139,13,147,12,139,13,147,12,
+ 139,13,145,12,10,187,170,189,184,156,192,130,10,147,11,8,170,189,184,156,192,130,10,147,
+ 11,8,170,189,184,156,192,130,10,147,11,8,170,189,184,156,192,130,10,145,11,5,255,233,
+ 188,130,10,4,188,169,224,147,15,3,233,188,130,10,4,188,169,224,147,15,3,233,188,130,
+ 10,4,188,169,224,147,15,3,233,188,130,10,4,188,169,224,145,15,13,238,186,205,186,172,
+ 219,171,147,14,11,186,205,186,172,219,171,147,14,11,186,205,186,172,219,171,147,14,11,186,
+ 205,186,172,219,171,145,14,
+};
+static const jj_sprite jj_floor = {128,12,jj_floor_palette,jj_floor_rows,jj_floor_data,4};
+static const uint16_t jj_jetpack_word_palette[] = {
+ 0x0,0xf79c,0xe6fb,0xce79,0xb5d8,0x9d15,0x7c53,0x39e8,0x863,0x22,0x22,0x21,0x0,0x0,0x0,0x0,
+};
+static const uint16_t jj_jetpack_word_rows[] = {
+ 0,9,31,54,92,131,177,225,278,336,409,484,560,647,732,826,916,1008,1100,1195,1295,1397,1501,1603,
+ 1701,1798,1898,1994,2086,2181,2278,2380,2487,2589,2687,2776,2869,2961,3049,3149,3258,3358,3457,3554,3655,3756,3862,3965,
+ 4067,4167,4275,4381,4482,4570,4646,4706,4756,4792,4819,4827,
+};
+static const uint8_t jj_jetpack_word_data[] = {
+ 255,0,194,0,3,187,203,133,0,255,0,173,0,130,15,2,204,176,136,0,6,252,251,172,
+ 240,130,11,1,170,131,0,255,0,169,0,10,191,221,255,204,186,176,132,0,0,144,136,8,
+ 131,10,1,155,130,0,255,0,150,0,1,188,131,15,130,12,0,176,135,0,0,240,131,10,
+ 2,154,176,132,10,130,0,2,136,112,132,8,130,7,5,138,169,154,130,0,255,0,142,0,
+ 4,252,221,176,134,10,2,139,192,132,11,130,0,130,8,133,7,11,136,154,169,160,8,134,
+ 134,4,3,49,124,130,9,0,160,130,0,246,0,0,176,130,15,1,203,143,0,6,136,172,
+ 252,144,137,8,132,11,5,171,135,118,130,5,5,68,36,136,130,9,4,160,8,112,131,3,
+ 10,33,18,33,123,154,160,131,0,239,0,10,223,253,220,205,252,192,130,11,140,0,130,8,
+ 1,151,138,6,6,86,152,138,176,130,10,2,135,16,134,2,1,23,132,9,4,8,132,48,
+ 135,1,2,104,128,130,10,131,0,237,0,5,255,201,170,132,8,5,171,170,154,137,0,130,
+ 8,0,112,130,5,0,64,135,3,15,34,18,71,136,171,170,135,34,134,1,1,120,130,9,
+ 4,168,134,64,134,1,4,34,120,144,130,10,131,0,211,0,4,220,252,192,132,15,130,12,
+ 1,187,136,0,1,152,138,7,5,137,170,154,136,0,3,136,116,132,3,138,1,12,33,38,
+ 136,154,152,115,32,134,1,1,120,130,9,4,168,133,48,135,1,2,106,128,130,10,132,0,
+ 190,0,1,187,132,15,3,220,202,130,0,1,223,130,13,134,11,2,172,192,130,10,0,192,
+ 132,11,133,0,3,167,101,134,3,4,66,39,128,130,9,0,160,135,0,4,137,115,32,145,
+ 1,10,33,88,139,168,116,32,134,1,8,120,153,168,135,80,135,1,6,55,137,169,160,132,
+ 0,180,0,0,240,134,13,130,11,1,205,131,15,2,204,176,130,10,131,12,16,252,203,186,
+ 188,207,135,202,186,160,130,11,1,171,132,0,2,198,32,135,3,9,34,23,138,153,171,134,
+ 0,3,135,50,147,1,9,33,104,138,135,82,134,1,7,120,169,168,166,136,1,2,41,128,
+ 130,10,133,0,164,0,2,188,192,131,15,4,203,176,0,132,11,139,15,3,184,139,131,10,
+ 4,200,119,96,138,5,131,4,2,56,176,133,10,131,0,1,166,136,2,4,18,35,128,131,
+ 9,0,160,133,0,3,135,66,150,1,6,56,138,136,96,135,1,1,120,130,9,3,135,66,
+ 135,1,5,120,154,154,133,0,155,0,2,204,176,130,13,134,11,0,192,130,11,1,170,134,
+ 15,0,144,130,8,135,7,8,100,38,186,154,112,131,4,133,3,1,67,131,2,7,50,33,
+ 55,139,131,10,0,176,130,0,1,134,139,2,6,24,138,153,160,133,0,2,135,32,150,1,
+ 2,33,80,131,8,0,96,135,1,7,104,153,136,114,134,1,3,34,136,131,10,133,0,142,
+ 0,9,255,205,252,203,160,130,11,0,192,139,15,6,207,186,171,128,133,7,3,101,84,136,
+ 3,10,67,23,200,197,52,64,144,3,3,33,105,132,10,130,0,1,117,140,2,6,136,169,
+ 154,176,132,0,2,117,32,134,1,138,2,134,1,0,64,131,8,0,96,135,1,7,72,138,
+ 135,50,133,1,4,33,120,128,130,10,134,0,141,0,133,15,3,186,171,132,15,0,128,130,
+ 7,135,6,1,86,130,10,1,197,133,3,141,4,8,50,74,156,100,64,146,3,2,33,112,
+ 131,10,6,154,15,115,48,138,2,4,22,136,160,130,9,131,0,3,151,50,132,1,0,32,
+ 132,3,1,68,130,3,1,67,134,1,0,64,131,8,0,96,134,1,2,34,112,130,8,1,
+ 115,135,1,2,88,128,130,10,135,0,139,0,1,203,133,8,5,185,186,100,131,5,130,4,
+ 134,3,7,67,24,202,180,134,5,141,4,5,34,137,198,130,4,146,3,2,35,160,131,9,
+ 5,160,199,35,138,2,4,19,168,160,130,9,131,0,3,135,50,133,1,0,64,136,7,1,
+ 99,134,1,0,80,130,8,1,151,134,1,2,33,112,130,8,0,64,134,1,4,33,105,128,
+ 130,10,135,0,138,0,3,200,83,130,4,8,34,250,199,69,64,141,5,7,65,140,171,68,
+ 130,5,144,4,5,33,138,183,131,4,145,3,3,33,108,131,9,4,12,115,48,132,2,0,
+ 48,132,2,4,19,120,160,130,9,131,0,3,183,50,133,1,1,106,132,8,4,176,151,48,
+ 131,2,9,18,20,136,152,114,133,1,6,33,120,135,48,134,1,3,35,120,130,10,136,0,
+ 138,0,3,247,53,130,6,6,50,171,199,64,144,5,6,40,202,180,64,131,5,143,4,5,
+ 33,138,168,132,4,1,52,133,3,0,64,136,3,9,20,248,153,160,183,134,2,0,48,133,
+ 2,3,21,184,130,9,131,0,3,183,66,133,1,3,88,137,130,10,4,0,136,96,131,3,
+ 9,69,86,136,168,98,133,1,5,33,120,149,136,1,5,92,139,170,136,0,138,0,13,247,
+ 70,85,100,39,204,116,144,5,6,40,201,180,64,134,5,140,4,2,33,128,130,10,133,4,
+ 1,36,133,3,3,86,84,132,3,3,20,248,130,9,2,12,112,134,2,0,48,133,2,7,
+ 21,200,169,152,131,0,4,116,33,32,131,1,2,55,128,131,9,130,0,1,136,133,7,130,
+ 8,4,0,134,48,135,1,3,121,99,135,1,6,39,138,186,160,136,0,138,0,14,247,54,
+ 85,101,39,203,132,96,143,5,6,39,201,196,64,130,5,130,4,1,85,133,4,130,3,130,
+ 4,5,54,171,186,133,4,1,34,135,8,0,96,133,3,3,21,200,130,9,2,11,112,134,
+ 2,1,51,133,2,2,55,160,131,9,131,0,4,117,33,32,130,1,3,33,120,131,9,132,
+ 0,1,172,130,15,133,0,3,134,50,134,1,2,122,96,136,1,5,89,139,170,137,0,138,
+ 0,14,247,70,86,101,38,251,132,96,133,5,0,96,136,5,23,22,201,198,67,35,85,100,
+ 69,84,83,38,86,130,7,5,143,171,186,133,4,2,34,240,131,11,3,203,199,133,3,3,
+ 21,248,130,9,3,184,99,133,2,1,51,133,2,3,22,184,130,9,131,0,4,134,33,32,
+ 130,1,4,33,120,128,130,9,143,0,3,150,50,134,1,2,120,80,134,1,1,33,130,8,
+ 2,186,160,137,0,139,0,12,134,86,101,98,79,168,64,133,5,1,68,132,3,131,4,27,
+ 108,186,191,118,103,139,196,69,84,82,28,255,204,251,130,0,2,200,48,132,4,3,34,218,
+ 130,9,3,160,199,133,3,3,21,248,130,9,3,184,67,132,2,2,18,64,133,2,3,23,
+ 200,130,9,0,160,130,0,1,134,130,2,130,1,4,33,104,128,130,9,143,0,2,182,48,
+ 135,1,1,135,134,1,7,34,71,139,171,138,0,139,0,2,166,80,131,6,5,20,249,131,
+ 131,5,2,99,80,136,7,2,143,192,131,0,131,15,4,192,181,64,131,5,4,49,138,128,
+ 130,9,131,0,1,200,133,4,12,50,186,154,153,12,115,64,131,3,19,21,248,169,154,130,
+ 50,50,35,17,67,132,2,3,22,136,131,9,130,0,1,151,132,2,8,18,22,136,153,160,
+ 143,0,2,247,48,134,1,2,39,64,135,2,3,23,137,130,10,138,0,139,0,2,198,80,
+ 131,6,5,20,249,131,131,5,2,98,48,132,15,144,0,2,198,64,131,5,7,50,124,154,
+ 153,131,0,2,200,80,132,4,12,50,138,154,154,15,115,64,131,3,3,37,200,130,9,1,
+ 168,134,3,2,21,96,134,2,2,23,160,130,9,0,160,130,0,2,167,16,133,2,6,22,
+ 152,153,160,143,0,2,167,64,135,2,1,99,134,2,6,22,136,186,160,139,0,139,0,2,
+ 247,64,131,6,17,20,249,132,86,85,99,44,137,152,144,0,2,199,64,131,5,7,66,108,
+ 154,154,132,0,1,149,133,4,2,39,192,130,9,5,160,247,36,130,3,3,66,72,131,9,
+ 1,168,133,3,5,33,119,19,132,2,2,23,176,131,9,5,160,10,113,133,2,3,23,168,
+ 130,9,0,160,143,0,2,117,32,132,3,1,34,135,3,7,33,104,154,171,139,0,139,0,
+ 2,247,64,131,6,13,36,249,182,70,85,98,47,130,9,0,160,144,0,2,247,64,132,5,
+ 6,36,249,169,160,132,0,1,166,133,4,2,39,192,130,9,5,160,247,36,130,3,4,67,
+ 39,192,130,9,1,167,133,3,5,34,135,51,133,2,2,72,160,131,9,5,0,167,35,130,
+ 2,4,51,23,160,131,9,0,176,143,0,1,133,133,3,1,33,135,3,3,20,136,130,10,
+ 140,0,139,0,2,247,64,131,6,17,36,249,198,70,85,98,47,169,154,144,0,2,248,64,
+ 132,5,2,36,240,130,9,0,160,132,0,2,199,48,131,4,3,82,111,130,9,4,160,247,
+ 48,130,4,10,52,49,124,137,154,96,133,3,5,19,251,98,132,3,13,33,137,169,154,0,
+ 167,52,130,3,5,68,22,138,130,9,0,160,143,0,3,134,52,140,3,7,33,90,139,170,
+ 140,0,139,0,2,247,64,131,6,14,52,249,199,70,85,99,47,160,130,9,144,0,2,248,
+ 64,132,5,2,35,240,130,9,0,160,132,0,2,247,48,132,4,9,20,248,153,160,199,134,
+ 4,8,22,248,153,164,64,132,3,5,19,188,83,132,4,3,34,122,131,9,4,0,167,48,
+ 133,4,3,37,138,131,9,143,0,3,150,52,140,3,8,35,120,154,153,160,139,0,139,0,
+ 2,247,80,131,6,17,52,248,247,70,101,99,44,185,154,144,0,2,248,48,132,5,2,35,
+ 240,130,9,0,160,132,0,3,247,53,131,4,11,19,248,153,160,200,99,132,4,6,22,248,
+ 153,176,133,4,6,82,58,182,48,132,5,4,65,43,128,130,9,4,160,167,48,133,5,2,
+ 51,112,132,9,143,0,1,150,140,3,131,2,3,120,138,130,9,0,176,138,0,139,0,2,
+ 247,64,131,6,6,84,249,247,64,131,6,7,50,139,154,188,134,11,1,171,134,0,2,248,
+ 48,132,5,2,35,240,131,9,132,0,3,248,53,130,4,6,81,61,137,144,131,10,0,96,
+ 132,4,9,81,111,137,159,84,132,5,5,34,185,116,132,5,12,98,60,138,153,160,167,64,
+ 133,5,2,50,112,132,9,143,0,1,149,135,3,135,2,3,21,152,132,9,138,0,140,0,
+ 1,116,131,6,6,84,186,247,64,131,6,4,66,143,192,134,15,0,176,130,10,0,144,134,
+ 0,2,248,48,132,5,2,36,240,131,9,132,0,13,247,53,69,69,36,250,188,130,11,2,
+ 246,64,132,5,8,22,248,154,133,80,131,6,7,82,59,139,69,132,6,4,35,168,160,130,
+ 9,3,10,134,133,5,2,49,112,132,9,143,0,1,133,131,3,141,2,2,120,128,131,9,
+ 0,160,137,0,140,0,1,115,132,6,5,56,191,115,131,6,4,82,120,128,132,7,3,102,
+ 140,130,9,0,160,133,0,2,248,64,132,5,2,36,240,130,9,0,160,132,0,2,247,64,
+ 132,5,2,36,176,134,8,1,101,132,6,7,22,248,155,116,132,6,7,81,75,154,100,132,
+ 6,4,81,107,128,130,9,4,168,182,64,132,5,2,49,112,132,9,143,0,2,150,48,134,
+ 2,0,48,135,2,4,17,120,160,131,9,0,160,136,0,140,0,1,115,131,6,6,82,123,
+ 247,48,132,6,0,32,132,3,131,4,2,23,240,131,9,134,0,0,128,133,5,2,36,240,
+ 130,9,0,160,132,0,2,247,48,132,6,2,66,80,135,3,133,6,7,22,248,156,116,132,
+ 6,17,65,107,154,116,101,101,86,21,248,130,9,5,160,198,69,131,4,2,49,112,132,9,
+ 143,0,2,166,48,133,2,4,18,65,32,132,1,5,33,56,138,131,9,136,0,140,0,1,
+ 116,132,6,5,23,252,116,132,6,134,5,130,6,6,68,170,153,160,134,0,2,166,80,131,
+ 6,2,68,240,130,9,0,160,132,0,2,247,48,133,6,137,5,133,6,7,22,248,159,83,
+ 132,6,7,49,138,154,132,133,5,3,36,122,130,9,4,160,198,48,132,4,2,49,112,132,
+ 9,143,0,2,151,64,133,2,2,19,112,135,1,5,33,104,138,130,9,0,160,135,0,140,
+ 0,2,133,80,131,6,4,22,250,128,143,6,3,65,140,130,9,134,0,2,198,80,131,6,
+ 2,84,240,131,9,133,0,1,115,148,6,9,67,123,153,245,70,130,5,9,100,26,202,187,
+ 100,133,5,3,22,248,130,9,4,12,99,64,132,3,1,23,132,9,143,0,4,135,65,32,
+ 132,1,2,56,96,136,1,2,57,128,132,9,0,176,134,0,140,0,2,133,80,131,6,6,
+ 22,249,134,80,141,6,3,65,140,130,9,134,0,2,247,80,132,6,6,56,185,169,144,132,
+ 0,1,131,148,6,8,21,249,169,246,64,132,5,1,49,131,8,3,118,69,132,4,2,22,
+ 176,131,9,2,140,96,133,3,3,33,122,130,9,0,160,143,0,2,135,64,134,1,2,39,
+ 112,135,1,5,33,88,138,130,9,0,160,134,0,140,0,2,246,80,131,6,6,22,248,182,
+ 80,141,6,6,65,140,153,160,134,0,2,247,80,132,6,6,39,249,169,144,132,0,2,132,
+ 80,143,6,12,86,98,40,186,168,230,64,130,5,1,69,135,3,133,4,4,50,39,192,130,
+ 9,2,140,96,131,3,9,35,33,122,169,154,143,0,2,136,64,133,1,5,33,108,98,134,
+ 1,4,33,121,128,132,9,133,0,140,0,2,246,80,131,6,6,38,248,246,80,141,6,6,
+ 65,140,154,160,134,0,2,247,80,132,6,3,22,248,130,9,132,0,2,133,80,134,6,138,
+ 5,9,34,124,171,176,246,142,4,134,3,2,23,192,130,9,4,140,99,48,132,2,6,22,
+ 154,153,160,136,0,133,8,3,168,165,133,1,5,33,88,132,136,1,3,72,138,131,9,133,
+ 0,140,0,2,246,80,131,6,6,70,248,247,80,131,6,0,80,135,4,6,83,107,186,176,
+ 135,0,2,247,80,132,6,3,22,248,130,9,132,0,3,166,86,136,5,133,4,12,49,71,
+ 203,176,11,133,48,135,4,140,3,2,23,192,130,9,4,140,99,48,132,2,2,20,128,130,
+ 9,0,160,133,0,135,8,4,188,136,64,135,1,4,89,135,32,134,1,5,33,88,138,130,
+ 9,0,160,132,0,140,0,2,246,80,131,6,6,86,248,247,80,131,6,2,50,80,130,6,
+ 131,7,3,140,187,137,0,2,247,64,132,6,6,22,248,153,160,132,0,2,198,64,132,5,
+ 130,3,1,68,132,5,5,68,122,202,131,0,5,199,67,68,146,3,2,21,128,130,9,4,
+ 140,99,48,132,2,2,19,128,130,9,1,171,130,0,1,154,131,8,9,119,136,154,136,66,
+ 134,1,5,89,136,82,134,1,5,34,120,154,130,9,0,160,131,0,140,0,2,246,64,131,
+ 6,6,85,185,247,80,131,6,2,53,240,130,12,132,15,0,192,139,0,3,247,70,131,5,
+ 6,22,248,153,160,132,0,2,247,48,131,5,6,65,70,119,176,134,15,0,176,133,0,3,
+ 246,36,148,3,10,33,138,153,140,99,48,132,2,2,18,128,131,9,3,160,9,131,7,13,
+ 101,34,103,138,136,66,18,132,1,5,90,136,116,136,1,3,57,138,131,9,131,0,140,0,
+ 2,246,64,131,6,6,84,138,247,80,131,6,2,84,240,131,9,144,0,2,247,48,132,5,
+ 6,22,248,153,160,132,0,3,247,53,131,4,4,22,252,192,132,10,137,0,3,246,36,148,
+ 3,3,34,122,130,9,1,198,132,3,131,2,3,137,154,131,8,1,182,132,2,3,50,19,
+ 131,8,3,83,18,130,1,8,33,90,136,151,32,134,1,5,34,104,138,130,9,0,160,130,
+ 0,140,0,2,246,64,131,6,6,82,123,247,80,131,6,6,84,139,153,160,144,0,2,247,
+ 48,132,5,6,38,248,153,160,132,0,3,247,53,131,4,3,21,184,130,9,140,0,2,247,
+ 48,132,4,137,3,1,68,133,3,8,20,200,153,183,64,133,3,1,34,135,8,3,247,51,
+ 133,2,8,23,152,134,49,32,130,1,8,33,90,138,136,80,136,1,2,39,128,132,9,2,
+ 160,0,140,0,14,247,69,101,101,23,207,99,96,131,5,2,55,192,130,9,145,0,1,114,
+ 132,5,3,38,248,130,9,132,0,3,247,37,131,4,3,20,139,130,9,140,0,2,198,48,
+ 132,4,1,35,136,5,0,64,133,3,3,19,248,130,9,2,133,32,132,3,1,34,132,12,
+ 6,168,120,99,48,133,2,7,23,152,134,49,130,2,11,18,21,136,168,135,50,135,1,3,
+ 88,138,130,9,2,160,0,132,0,0,192,133,11,3,15,132,132,5,5,23,255,115,132,5,
+ 5,23,248,154,145,0,1,115,132,5,2,53,192,131,9,133,0,2,115,80,131,4,3,35,
+ 139,130,9,140,0,1,134,133,4,3,22,251,133,12,2,180,64,132,3,8,34,123,153,140,
+ 80,133,3,1,34,132,7,5,101,66,36,134,2,7,23,152,135,49,132,2,9,20,136,154,
+ 136,98,134,1,5,33,120,138,130,9,1,160,1,0,133,12,6,187,170,159,128,132,5,6,
+ 65,127,199,48,132,5,5,22,248,153,135,0,1,204,135,0,2,133,64,131,5,3,67,140,
+ 130,9,133,0,1,115,132,5,6,50,124,137,144,140,0,0,112,134,4,6,22,216,169,160,
+ 130,9,2,165,64,133,3,7,21,248,152,197,133,3,1,35,134,2,131,3,134,2,6,23,
+ 153,135,48,133,2,3,19,120,130,9,2,136,80,136,1,2,88,128,132,9,0,0,2,12,
+ 192,130,13,8,204,250,169,156,192,132,5,6,65,127,199,48,132,5,5,22,216,154,135,11,
+ 3,203,186,133,0,2,133,64,132,5,5,23,248,153,133,0,1,116,132,5,6,65,127,137,
+ 144,139,0,2,247,32,133,4,3,22,248,130,10,130,0,3,199,52,131,3,8,65,111,137,
+ 140,80,140,3,139,2,7,22,137,168,131,135,2,9,121,137,168,135,50,133,1,5,33,88,
+ 138,130,9,0,160,2,247,48,131,4,7,55,201,171,189,132,5,6,65,127,183,64,132,5,
+ 3,22,251,137,15,3,186,169,133,0,1,182,133,5,5,23,248,153,133,0,0,128,134,5,
+ 5,23,248,153,139,0,2,247,48,133,4,5,22,248,170,131,0,4,200,52,64,130,3,3,
+ 65,88,130,9,1,167,142,3,137,2,1,23,130,10,2,136,48,134,2,3,22,152,130,9,
+ 3,135,82,135,1,4,39,136,160,130,9,2,247,48,131,5,3,18,218,130,12,0,240,133,
+ 5,4,23,250,128,133,5,1,22,130,8,136,7,4,185,169,176,132,0,13,246,86,85,101,
+ 23,248,153,133,0,1,166,133,5,5,23,248,153,139,0,3,247,53,132,4,5,22,248,170,
+ 132,0,2,134,48,133,4,7,22,248,153,166,142,3,135,2,8,23,248,187,152,48,134,2,
+ 11,22,152,153,160,135,66,133,1,8,33,72,137,170,176,2,247,64,131,5,4,19,252,176,
+ 130,8,133,5,5,22,202,182,132,5,5,52,84,67,133,2,2,22,240,130,9,0,160,132,
+ 0,2,246,80,131,6,6,81,127,137,144,133,0,2,246,64,132,5,5,23,248,153,139,0,
+ 3,247,69,131,4,6,49,127,138,160,132,0,2,247,32,133,4,8,23,248,153,184,64,143,
+ 3,132,2,3,20,136,130,11,2,136,48,134,2,11,22,168,154,160,8,99,134,1,7,33,
+ 106,154,171,2,247,64,131,5,1,35,132,5,1,68,132,5,6,38,248,246,80,132,6,134,
+ 5,7,102,86,82,124,130,9,132,0,2,246,64,131,6,7,81,127,137,154,132,0,2,246,
+ 64,132,5,6,23,248,153,160,138,0,3,166,69,131,4,6,19,123,154,160,132,0,1,247,
+ 134,4,9,35,139,153,168,134,145,3,13,34,103,170,176,9,115,50,132,3,3,22,168,130,
+ 10,4,0,136,64,133,3,8,67,87,155,184,0,3,247,70,139,5,131,6,7,81,127,143,
+ 100,143,6,3,81,124,130,9,132,0,2,246,48,131,6,7,81,127,137,154,132,0,2,246,
+ 64,132,5,6,23,248,153,160,138,0,3,130,69,130,4,3,81,91,131,10,132,0,3,170,
+ 99,132,4,12,49,124,154,160,187,100,48,134,2,1,50,134,3,4,123,171,176,130,0,2,
+ 200,64,135,5,4,121,170,128,131,0,5,136,118,119,134,8,131,0,2,7,64,144,6,7,
+ 81,124,156,131,143,6,3,81,124,130,9,132,0,2,246,48,131,6,7,81,127,137,155,132,
+ 0,3,246,70,131,5,6,23,248,153,160,138,0,14,132,69,84,69,20,248,170,176,133,0,
+ 2,247,32,132,3,11,36,139,171,176,10,199,142,6,4,120,184,160,133,0,3,138,154,131,
+ 11,3,170,136,135,0,137,8,133,0,3,15,100,143,6,8,37,202,171,247,64,142,6,3,
+ 81,127,130,9,133,0,1,99,131,6,7,81,127,137,154,132,0,13,246,70,85,101,23,248,
+ 170,139,0,2,199,32,132,3,5,39,186,186,134,0,1,200,134,7,3,172,171,133,0,0,
+ 192,135,15,133,12,2,252,128,137,0,135,8,154,0,4,0,132,80,141,6,11,35,139,171,
+ 0,197,69,140,6,6,81,127,154,160,133,0,1,115,132,5,5,23,249,170,133,0,2,200,
+ 80,131,4,6,81,127,155,176,140,0,9,167,135,136,120,251,138,0,0,192,134,15,0,160,
+ 199,0,5,0,251,83,139,6,5,35,127,172,131,0,4,183,67,64,130,5,1,68,133,3,
+ 5,34,124,155,134,0,1,214,131,5,5,69,140,171,135,0,9,203,171,186,186,187,144,0,
+ 134,15,221,0,130,0,2,248,96,137,4,6,50,88,251,192,132,0,2,191,112,141,6,3,
+ 143,171,135,0,0,192,134,15,1,203,138,0,134,12,247,0,131,0,1,207,139,7,2,255,
+ 160,136,0,130,15,1,188,138,15,0,176,139,0,132,10,255,0,140,0,134,0,137,15,255,
+ 0,187,0,
+};
+static const jj_sprite jj_jetpack_word = {205,59,jj_jetpack_word_palette,jj_jetpack_word_rows,jj_jetpack_word_data,4};
+static const uint16_t jj_joyride_word_palette[] = {
+ 0x0,0xffd1,0xff2f,0xfe8b,0xfdc9,0xfd67,0xfce6,0xf526,0xf443,0xab41,0x5160,0x840,0x0,0x0,0x0,0x0,
+};
+static const uint16_t jj_joyride_word_rows[] = {
+ 0,43,109,182,266,352,428,499,568,638,717,803,899,997,1105,1203,1305,1405,1513,1612,1715,1816,1927,2032,
+ 2130,2216,2298,2381,2464,2549,2634,2721,2822,2931,3031,3126,3223,3318,3419,3520,3631,3735,3843,3947,4049,4145,4237,4308,
+ 4382,4458,4538,4621,4699,4779,4854,4902,
+};
+static const uint8_t jj_joyride_word_data[] = {
+ 147,0,136,12,138,0,0,176,142,12,0,176,138,0,136,12,138,0,137,12,132,0,148,12,
+ 139,0,137,12,131,0,0,240,148,12,0,176,138,0,150,12,2,240,0,146,0,1,255,133,
+ 14,130,15,134,0,1,252,130,15,140,14,3,255,207,135,0,1,255,133,14,130,15,136,0,
+ 130,15,133,14,130,15,130,0,130,15,0,224,146,15,1,207,135,0,139,15,1,0,138,15,
+ 137,14,132,15,134,0,130,15,148,14,3,252,240,145,0,2,255,160,135,9,1,252,132,0,
+ 130,15,0,176,144,9,0,224,130,15,132,0,2,207,176,135,9,1,252,134,0,2,207,176,
+ 135,9,5,175,192,252,148,9,0,160,130,15,134,0,1,251,135,9,5,175,204,252,149,9,
+ 0,176,130,15,132,0,2,207,160,149,9,2,255,0,145,0,3,251,152,133,5,2,58,240,
+ 131,0,4,251,185,112,144,5,4,74,188,240,130,0,3,207,183,133,5,3,55,252,134,0,
+ 4,207,165,80,132,4,8,41,204,15,181,80,143,4,131,3,3,75,252,132,0,4,207,163,
+ 48,132,4,7,58,252,255,115,146,4,6,85,122,207,192,130,0,4,207,162,64,148,5,2,
+ 159,192,144,0,6,255,184,133,112,130,5,3,115,159,130,0,7,204,184,117,119,141,5,13,
+ 100,52,252,240,15,251,119,131,5,4,117,58,240,134,0,2,251,144,130,7,12,85,117,83,
+ 175,15,184,80,146,7,5,83,58,252,131,0,3,206,165,134,7,4,174,204,240,145,7,130,
+ 5,14,117,87,155,204,0,207,163,112,146,5,4,117,158,192,144,0,4,255,185,96,132,5,
+ 10,114,159,0,252,233,112,146,5,12,100,58,252,0,207,183,96,132,5,4,115,159,192,132,
+ 0,4,207,183,96,133,5,7,121,188,15,184,148,5,5,100,74,252,130,0,3,206,167,134,
+ 5,6,174,204,248,96,149,5,10,117,155,192,12,250,48,149,5,2,158,192,144,0,4,255,
+ 185,96,133,5,8,41,240,12,233,128,148,5,11,100,58,252,0,203,151,132,5,4,100,75,
+ 192,132,0,3,252,166,133,5,8,119,175,176,251,128,149,5,11,101,122,204,0,206,167,133,
+ 5,7,122,236,206,136,150,5,9,119,155,240,207,163,149,5,2,158,192,144,0,4,255,185,
+ 96,133,5,8,41,240,207,152,112,149,5,11,100,58,204,12,250,119,132,5,4,66,175,192,
+ 131,0,3,254,136,134,5,7,155,192,15,184,152,5,8,155,240,12,234,96,133,5,7,122,
+ 236,206,136,151,5,8,104,191,252,250,48,149,5,2,158,192,144,0,5,255,185,100,132,5,
+ 7,41,240,207,150,152,5,8,58,252,0,203,128,134,5,3,57,204,131,0,4,251,134,64,
+ 132,5,9,121,236,0,251,132,149,5,10,70,139,252,12,234,96,132,5,9,71,174,204,232,
+ 132,150,5,8,72,174,204,250,48,148,5,3,73,236,144,0,6,255,185,100,80,130,4,7,
+ 82,159,12,185,133,4,0,80,145,4,11,83,156,208,12,234,117,131,4,4,83,43,240,130,
+ 0,5,207,152,69,132,4,10,138,192,15,251,132,80,148,4,10,84,105,239,12,234,112,131,
+ 4,11,84,90,236,206,136,69,150,4,8,104,236,207,163,80,147,4,3,89,236,144,0,4,
+ 255,185,112,133,4,7,41,240,250,133,132,4,1,53,139,6,133,4,9,51,191,0,207,152,
+ 134,4,9,60,252,0,207,150,133,4,9,121,236,0,255,184,133,4,0,80,138,6,0,112,
+ 133,4,8,104,223,12,234,112,133,4,7,90,236,206,136,133,4,140,6,134,4,6,143,204,
+ 250,48,133,4,0,80,141,6,3,137,251,144,0,4,255,185,112,133,4,7,41,240,250,133,
+ 132,4,2,51,160,136,11,2,152,80,133,4,2,59,240,130,0,3,203,151,133,4,8,57,
+ 204,0,251,144,133,4,10,56,156,192,15,235,128,134,4,0,144,136,11,1,150,133,4,8,
+ 104,223,12,234,112,133,4,7,90,236,206,136,133,4,1,137,136,11,1,167,133,4,7,56,
+ 252,207,163,133,4,1,89,142,11,1,240,144,0,5,255,185,115,132,4,6,41,240,250,128,
+ 134,4,1,59,136,14,1,152,134,4,2,59,240,130,0,3,207,152,133,4,8,51,252,11,
+ 249,128,133,4,11,88,191,240,15,235,131,133,4,0,144,136,14,1,151,132,4,9,54,141,
+ 240,206,167,132,4,9,53,174,252,232,131,132,4,1,137,136,14,1,183,133,4,7,56,252,
+ 207,163,133,4,2,89,208,139,14,130,15,0,0,144,0,6,255,185,115,64,130,3,8,66,
+ 159,15,168,64,134,3,0,176,134,12,4,188,152,64,134,3,1,191,131,0,2,250,128,133,
+ 3,8,67,172,12,201,64,131,3,5,67,104,207,130,0,5,254,184,52,131,3,1,73,136,
+ 12,2,151,64,130,3,10,67,104,223,12,234,80,131,3,11,67,90,239,206,136,52,131,3,
+ 3,137,203,134,12,1,183,132,3,9,67,143,204,250,52,130,3,4,67,89,176,140,12,130,
+ 0,144,0,4,255,185,112,134,3,6,159,15,168,64,134,3,1,191,133,0,4,191,152,64,
+ 134,3,1,191,131,0,3,254,135,134,3,6,127,191,168,64,133,3,3,90,239,130,0,3,
+ 254,184,133,3,3,73,252,132,0,3,206,151,133,3,8,104,223,12,234,80,133,3,7,90,
+ 236,206,136,133,3,2,137,240,134,0,2,251,112,134,3,7,143,204,250,52,132,3,3,89,
+ 191,142,0,144,0,4,255,185,112,134,3,6,159,15,168,64,134,3,2,191,192,132,0,4,
+ 191,152,64,134,3,1,191,131,0,4,252,166,32,133,3,6,123,207,168,64,132,3,4,72,
+ 191,192,130,0,4,254,184,32,133,3,2,159,192,132,0,3,206,151,133,3,8,104,223,12,
+ 234,80,133,3,7,74,236,206,136,133,3,2,137,240,134,0,2,251,112,133,3,6,40,252,
+ 207,160,134,3,3,73,191,142,0,144,0,4,255,185,64,134,3,5,159,15,168,135,3,1,
+ 191,133,0,3,191,152,135,3,1,191,131,0,4,255,184,64,133,3,6,41,251,132,32,132,
+ 3,3,74,220,131,0,4,254,184,32,133,3,2,159,192,132,0,3,206,151,132,3,9,38,
+ 141,240,206,165,132,3,9,36,174,204,232,98,132,3,2,137,240,134,0,3,251,114,132,3,
+ 7,40,252,207,164,132,3,4,36,155,240,142,0,144,0,5,255,185,66,133,3,7,159,15,
+ 168,50,130,3,4,35,59,240,133,0,5,191,152,50,130,3,4,35,59,240,132,0,4,251,
+ 132,32,132,3,6,42,250,133,32,130,3,5,35,138,252,131,0,4,254,184,32,133,3,2,
+ 159,192,132,0,3,206,151,132,3,9,38,141,240,206,165,132,3,9,36,174,204,232,98,131,
+ 3,3,40,159,134,0,3,251,114,132,3,9,40,252,207,164,50,130,3,4,36,155,240,142,
+ 0,144,0,4,255,185,64,133,2,7,57,240,250,131,132,2,3,51,191,133,0,4,191,152,
+ 48,132,2,3,51,191,132,0,4,204,166,48,133,2,3,156,183,133,2,3,56,175,132,0,
+ 3,254,184,133,2,3,57,252,132,0,3,206,149,133,2,8,104,223,12,234,80,133,2,7,
+ 74,236,206,134,133,2,2,137,240,134,0,2,251,128,134,2,7,143,204,250,67,132,2,3,
+ 73,191,142,0,144,0,4,255,185,64,133,2,7,57,240,250,131,132,2,3,51,191,133,0,
+ 4,191,152,48,132,2,3,51,191,132,0,4,191,168,48,132,2,5,51,169,113,132,2,3,
+ 137,204,132,0,4,254,184,16,132,2,3,57,252,132,0,3,206,149,132,2,9,23,141,240,
+ 206,164,132,2,8,20,174,204,232,96,133,2,2,137,240,134,0,2,251,128,133,2,8,25,
+ 252,207,164,48,132,2,3,73,191,142,0,144,0,4,255,185,64,133,2,7,57,240,250,131,
+ 132,2,3,51,191,133,0,3,191,152,133,2,3,51,191,133,0,2,205,144,135,2,1,168,
+ 133,2,4,24,175,192,132,0,4,254,184,16,133,2,3,159,204,131,0,3,205,149,132,2,
+ 9,23,141,240,206,164,132,2,9,20,174,204,232,113,132,2,2,137,240,134,0,3,251,129,
+ 132,2,8,25,252,207,165,48,131,2,4,19,155,240,142,0,144,0,5,255,185,49,132,2,
+ 8,57,240,250,130,16,130,2,4,19,59,240,133,0,5,191,152,33,130,2,4,19,59,240,
+ 133,0,3,190,168,132,2,4,19,72,16,132,2,3,56,252,133,0,4,254,184,16,131,2,
+ 2,18,144,134,15,3,207,149,132,2,9,23,141,240,206,164,132,2,9,20,174,204,232,113,
+ 131,2,3,24,159,134,0,3,251,129,132,2,9,25,252,207,165,33,130,2,3,19,155,136,
+ 15,0,224,130,15,130,0,144,0,4,255,185,48,132,1,8,35,159,15,168,32,132,1,3,
+ 51,191,133,0,4,191,152,32,132,1,3,51,191,134,0,2,203,144,133,1,2,36,128,131,
+ 1,5,33,137,204,133,0,5,254,184,18,131,1,1,41,136,11,1,151,131,1,10,33,120,
+ 223,12,234,64,131,1,11,33,58,236,206,134,18,131,1,2,137,240,134,0,2,251,128,134,
+ 1,7,159,204,250,82,132,1,1,57,138,11,130,15,130,0,144,0,4,255,185,48,133,1,
+ 7,57,240,250,130,132,1,3,51,191,133,0,4,191,152,32,132,1,3,51,191,134,0,3,
+ 207,150,133,1,1,50,133,1,3,139,239,133,0,3,254,184,133,1,1,37,137,3,0,64,
+ 133,1,8,120,223,12,234,64,133,1,7,58,236,206,135,133,1,2,137,240,134,0,2,251,
+ 128,134,1,7,159,204,250,82,132,1,0,48,140,8,4,175,192,0,144,0,4,255,185,48,
+ 133,1,7,57,240,250,130,132,1,3,51,191,133,0,4,191,152,32,132,1,3,51,191,134,
+ 0,3,205,152,133,1,0,48,133,1,3,120,191,134,0,3,254,184,152,1,8,89,223,12,
+ 234,64,133,1,7,58,236,206,135,133,1,2,137,240,134,0,2,251,128,134,1,7,159,204,
+ 250,82,145,1,5,74,223,0,144,0,4,255,185,48,133,1,7,57,240,250,130,132,1,3,
+ 51,191,133,0,4,191,152,32,132,1,3,52,191,135,0,3,254,132,139,1,3,89,207,134,
+ 0,3,254,184,151,1,9,56,190,240,206,164,133,1,7,58,236,206,135,133,1,2,137,240,
+ 134,0,2,251,128,134,1,7,159,204,250,114,145,1,5,89,223,0,144,0,4,255,185,48,
+ 133,1,7,57,240,250,130,132,1,3,51,191,133,0,4,191,152,32,132,1,3,52,191,135,
+ 0,3,253,151,138,1,4,56,191,192,134,0,3,254,184,151,1,9,57,191,0,206,164,133,
+ 1,7,58,236,206,135,133,1,2,137,240,134,0,2,251,128,134,1,7,159,204,250,114,145,
+ 1,5,89,223,0,144,0,4,255,185,48,133,1,7,57,240,250,130,132,1,3,51,191,133,
+ 0,4,191,152,32,132,1,3,52,191,135,0,3,254,181,138,1,3,57,191,135,0,3,254,
+ 184,150,1,10,56,175,192,12,234,64,133,1,7,58,236,206,151,133,1,2,137,240,134,0,
+ 2,235,128,134,1,7,159,204,250,98,145,1,5,89,223,0,144,0,4,255,185,48,133,1,
+ 7,57,240,250,130,132,1,3,51,191,133,0,4,191,152,32,132,1,3,52,191,136,0,3,
+ 251,147,137,1,3,90,236,135,0,3,254,184,149,1,4,56,175,192,130,0,3,206,164,133,
+ 1,7,58,236,206,151,133,1,2,137,240,134,0,2,235,128,134,1,7,159,204,250,98,145,
+ 1,5,89,223,0,144,0,4,255,185,48,133,1,7,57,240,250,130,132,1,3,51,191,133,
+ 0,4,191,152,32,132,1,3,53,191,136,0,3,206,164,137,1,2,155,192,136,0,3,254,
+ 184,148,1,5,56,174,255,130,0,3,206,164,133,1,7,58,239,206,151,133,1,2,137,240,
+ 134,0,2,235,128,134,1,7,159,204,250,130,145,1,5,89,223,0,144,0,4,255,185,48,
+ 133,1,7,57,240,250,130,132,1,3,52,191,133,0,4,191,168,32,132,1,3,53,191,136,
+ 0,4,207,168,32,135,1,3,73,252,136,0,3,254,184,146,1,6,56,138,236,240,131,0,
+ 3,206,164,133,1,7,58,236,206,151,133,1,2,137,240,134,0,2,235,128,134,1,7,159,
+ 204,250,130,145,1,5,74,223,0,144,0,4,255,185,48,132,1,8,35,159,15,168,32,132,
+ 1,3,52,191,133,0,4,191,168,32,132,1,3,53,191,137,0,3,251,147,135,1,3,137,
+ 204,136,0,5,254,184,18,131,1,7,40,152,135,18,131,1,6,40,155,236,240,132,0,3,
+ 206,164,131,1,9,33,74,236,206,150,133,1,2,137,240,134,0,2,235,128,134,1,7,159,
+ 204,250,130,132,1,0,48,138,8,6,152,175,192,0,144,0,5,255,185,49,132,2,8,57,
+ 240,250,130,16,130,2,4,19,75,240,133,0,5,191,168,33,130,2,4,19,91,240,137,0,
+ 5,207,152,33,131,2,4,20,155,240,137,0,4,254,184,16,131,2,8,18,159,203,131,16,
+ 131,2,5,19,158,207,133,0,4,206,164,16,131,2,9,20,174,204,233,97,131,2,3,24,
+ 159,134,0,3,235,129,132,2,9,25,252,207,168,33,130,2,2,19,144,137,11,0,192,130,
+ 15,130,0,144,0,5,255,185,65,132,2,7,57,240,250,131,131,2,4,19,75,240,133,0,
+ 3,191,168,132,2,4,19,91,240,137,0,3,207,168,133,2,4,24,158,192,137,0,4,254,
+ 184,16,133,2,6,157,252,151,16,131,2,4,19,154,240,134,0,3,206,165,132,2,9,20,
+ 174,207,233,129,132,2,2,137,240,134,0,3,251,129,132,2,8,25,252,207,168,48,131,2,
+ 3,20,155,140,15,130,0,144,0,4,255,185,64,133,2,7,57,240,250,131,132,2,3,52,
+ 191,133,0,4,191,168,48,132,2,3,71,191,138,0,2,206,144,134,2,3,138,252,137,0,
+ 4,254,184,16,132,2,6,57,252,218,112,133,2,4,56,174,192,133,0,3,206,165,133,2,
+ 7,74,236,254,152,133,2,2,137,240,134,0,2,251,128,133,2,8,25,252,207,168,48,132,
+ 2,3,73,191,142,0,144,0,4,255,185,64,132,2,8,51,159,15,168,48,132,2,3,68,
+ 191,133,0,4,191,168,48,132,2,3,71,191,138,0,2,204,144,134,2,3,138,236,137,0,
+ 5,254,184,35,131,2,7,57,252,251,132,131,2,6,50,72,191,192,132,0,3,206,165,131,
+ 2,9,50,74,236,254,152,133,2,2,137,240,134,0,2,251,128,134,2,7,159,204,250,131,
+ 132,2,3,73,191,142,0,144,0,5,255,185,66,133,3,5,159,15,168,133,3,3,69,191,
+ 133,0,3,191,168,132,3,4,36,123,240,138,0,3,207,146,132,3,4,40,174,192,137,0,
+ 4,254,184,32,133,3,6,159,204,234,112,134,3,3,139,239,132,0,3,206,165,132,3,9,
+ 37,174,207,233,130,132,3,2,137,240,134,0,3,251,130,132,3,7,41,252,207,168,132,3,
+ 4,36,155,240,142,0,1,0,136,15,133,0,4,255,185,80,134,3,6,159,15,168,64,132,
+ 3,3,69,191,133,0,4,191,168,64,132,3,3,88,191,138,0,2,207,144,134,3,3,138,
+ 236,137,0,4,254,184,32,132,3,8,73,252,207,168,64,132,3,4,40,157,240,132,0,3,
+ 206,165,132,3,8,37,174,255,233,128,133,3,2,137,240,134,0,2,251,128,133,3,8,41,
+ 252,207,168,64,132,3,3,89,191,142,0,3,15,254,133,13,2,255,192,131,0,4,255,185,
+ 112,134,3,6,159,15,168,64,132,3,3,85,191,133,0,4,191,168,64,132,3,3,88,191,
+ 138,0,2,207,144,134,3,3,138,236,137,0,3,254,184,133,3,8,73,252,207,185,80,133,
+ 3,3,72,255,132,0,3,206,166,133,3,7,90,236,254,152,133,3,2,137,240,134,0,2,
+ 251,128,134,3,7,159,204,250,132,132,3,3,89,191,142,0,3,12,186,133,9,2,171,192,
+ 131,0,5,255,185,115,132,4,8,57,240,250,132,48,130,4,5,53,91,252,132,0,5,191,
+ 168,67,130,4,4,55,139,240,138,0,3,207,147,132,4,4,56,174,192,137,0,4,254,184,
+ 48,131,4,9,52,159,192,207,152,133,4,4,56,156,192,131,0,3,206,166,131,3,10,67,
+ 106,236,254,152,48,131,4,3,56,159,134,0,3,251,131,132,4,9,57,252,207,168,67,130,
+ 4,4,53,155,240,142,0,2,207,144,134,8,3,58,252,131,0,3,251,151,133,4,7,57,
+ 240,250,133,132,4,3,117,191,133,0,4,191,168,80,132,4,3,120,191,138,0,3,207,147,
+ 132,4,4,56,174,192,137,0,4,254,184,48,133,4,7,159,192,12,185,134,4,3,137,252,
+ 131,0,4,206,166,48,131,4,8,54,174,255,233,128,133,4,2,137,240,134,0,3,251,131,
+ 132,4,8,57,252,207,168,80,132,4,3,121,191,142,0,3,206,164,132,3,4,67,175,192,
+ 132,15,2,185,112,134,4,6,159,15,168,80,132,4,4,117,191,192,132,15,4,191,168,80,
+ 132,4,3,120,191,138,0,2,207,144,134,4,3,138,236,137,0,3,254,184,133,4,9,89,
+ 252,0,207,152,133,4,4,89,175,192,130,0,3,206,166,133,4,7,106,239,254,152,133,4,
+ 3,137,204,132,15,3,207,184,133,4,8,57,252,207,168,112,132,4,4,105,191,192,137,15,
+ 3,204,0,2,206,160,134,5,1,74,134,15,3,201,100,132,5,7,73,240,250,135,132,5,
+ 2,117,176,136,14,2,168,112,131,5,4,70,139,240,138,0,3,207,148,132,5,4,72,174,
+ 192,137,0,4,254,184,64,133,5,9,159,192,15,203,132,133,5,3,138,252,130,0,3,206,
+ 166,133,4,8,106,239,254,152,64,132,5,1,138,136,15,2,185,64,132,5,9,73,252,207,
+ 168,116,130,5,3,70,156,142,15,0,0,2,206,160,134,5,1,73,135,10,1,134,132,5,
+ 8,116,159,15,168,112,132,5,2,120,160,134,11,4,171,152,112,132,5,3,104,191,138,0,
+ 3,207,148,133,5,3,138,236,137,0,4,254,184,64,132,5,11,105,252,0,255,200,132,132,
+ 5,3,121,188,130,0,3,206,166,133,4,7,106,239,254,152,133,5,1,137,137,10,1,132,
+ 132,5,8,73,252,207,168,112,132,5,1,105,140,10,3,187,240,2,206,160,134,5,0,96,
+ 137,7,0,96,133,5,7,138,240,250,150,133,5,140,8,0,96,132,5,3,136,191,138,0,
+ 2,207,144,134,5,3,138,252,137,0,3,254,184,133,5,3,105,252,130,0,3,252,152,133,
+ 5,10,120,174,192,12,234,96,131,4,9,84,106,239,254,152,133,5,0,128,139,3,134,5,
+ 7,159,204,250,134,132,5,2,103,64,135,5,131,6,3,121,251,4,207,152,112,132,6,1,
+ 85,135,6,1,85,133,6,7,155,240,203,149,133,6,140,5,132,6,4,88,172,240,138,0,
+ 3,207,149,132,6,4,88,175,192,137,0,4,255,184,80,133,6,2,159,192,130,0,5,207,
+ 184,133,131,6,10,88,155,192,12,234,96,133,5,8,138,239,206,136,80,132,6,0,80,145,
+ 6,9,136,236,207,168,133,145,6,4,87,158,192,3,15,169,150,6,8,137,236,12,249,128,
+ 152,6,3,138,252,138,0,3,207,149,133,6,3,138,252,137,0,4,255,184,80,133,6,2,
+ 159,192,131,0,4,203,166,112,132,6,9,136,191,192,206,168,133,5,7,138,239,206,152,151,
+ 6,8,88,174,240,250,144,149,6,2,159,192,4,12,249,128,148,6,10,120,175,192,207,152,
+ 112,150,6,4,136,175,192,138,0,2,207,144,134,6,3,138,252,137,0,4,255,184,80,133,
+ 6,2,159,192,131,0,3,206,168,133,6,9,88,156,240,206,168,131,5,9,101,138,239,206,
+ 152,151,6,9,136,191,240,207,152,148,6,2,159,192,4,12,233,128,148,6,3,137,239,130,
+ 0,3,206,168,149,6,4,137,175,192,139,0,2,207,144,134,6,3,138,252,137,0,4,255,
+ 184,80,133,6,2,159,192,132,0,2,203,144,134,6,8,136,239,12,234,128,131,5,9,101,
+ 138,239,206,152,151,6,11,137,191,0,204,168,133,146,6,2,158,192,5,0,254,168,145,6,
+ 5,120,158,255,130,0,4,252,233,128,147,6,4,137,175,192,140,0,2,207,144,134,6,3,
+ 138,252,137,0,4,255,184,80,133,6,2,159,192,132,0,3,207,152,133,6,8,89,191,12,
+ 234,128,131,5,9,102,138,239,206,152,150,6,3,137,188,131,0,4,207,168,128,146,6,2,
+ 158,192,7,0,252,234,136,143,6,4,137,188,240,132,0,4,204,184,128,144,6,6,120,153,
+ 220,240,140,0,3,207,151,132,6,4,120,175,192,138,0,3,251,151,133,6,2,159,192,132,
+ 0,4,204,168,112,133,6,21,137,240,206,168,117,87,103,138,236,254,136,148,6,5,136,155,
+ 204,131,0,5,252,234,136,143,6,4,118,158,192,130,0,4,252,234,144,142,8,4,153,223,
+ 240,134,0,4,252,186,144,144,8,4,154,204,240,141,0,2,207,144,135,8,2,191,240,137,
+ 0,2,255,192,135,8,2,159,192,133,0,2,204,144,135,8,5,191,12,250,135,8,5,175,
+ 207,233,149,8,4,154,207,192,133,0,4,252,234,144,145,8,2,159,192,131,0,131,15,1,
+ 169,140,10,0,192,130,15,136,0,130,15,2,185,144,140,10,2,154,224,130,15,142,0,2,
+ 255,176,135,10,1,207,139,0,2,252,144,135,10,1,255,133,0,2,255,176,134,10,6,159,
+ 240,15,176,134,10,6,154,252,255,192,148,9,1,172,130,15,135,0,131,15,0,160,144,9,
+ 2,175,192,133,0,1,252,130,15,137,14,130,15,1,207,138,0,1,252,130,15,140,14,3,
+ 255,207,145,0,130,15,132,14,131,15,140,0,130,15,132,14,130,15,135,0,130,15,132,14,
+ 131,15,1,0,130,15,132,14,131,15,1,0,130,15,145,14,132,15,139,0,1,252,130,15,
+ 141,14,130,15,0,0,136,0,140,12,0,176,144,0,0,176,142,12,0,176,148,0,136,12,
+ 143,0,136,12,137,0,0,240,135,12,132,0,0,240,136,12,131,0,0,240,148,12,0,176,
+ 144,0,145,12,1,0,
+};
+static const jj_sprite jj_joyride_word = {210,55,jj_joyride_word_palette,jj_joyride_word_rows,jj_joyride_word_data,4};
+static const uint16_t jj_hero_palette[] = {
+ 0x0,0xffff,0xffff,0xffff,0xffff,0xfffe,0xfffd,0xfff0,0xffdb,0xff79,0xffb4,0xff32,0xfeb5,0xee74,0xfeb0,0xfe10,0xfdaf,0xfd4c,0xfd0d,0xd591,0xb572,0xc4ef,0xfc2e,0xfc2b,
+ 0xd44d,0xac4d,0xd3aa,0xdae8,0x9cd2,0x9c4e,0x9b6a,0x83ac,0x6350,0x8ac8,0x8246,0x5a88,0x3a4d,0xc0a3,0x61a5,0x5185,0x4903,0x31ca,0x2969,0x28e4,0x1861,0x20,0x5,0x0,
+};
+static const uint16_t jj_hero_rows[] = {
+ 0,7,23,46,73,103,136,168,202,234,263,297,332,364,389,421,455,490,527,567,606,654,701,748,
+ 795,843,891,939,986,1036,1088,1139,1189,1238,1286,1334,1377,1412,1449,1490,1533,1577,1625,1671,1712,1762,1817,1870,
+ 1924,1976,2033,2093,2157,2220,2281,2343,2406,2462,2514,2559,2589,2618,2655,2690,2730,2762,2791,2821,2849,2885,2918,2968,
+ 3016,3063,3104,3143,3184,3231,3281,3327,3379,3422,3466,3509,3550,3592,3632,3665,3697,3730,3761,3791,3820,3843,3865,3886,
+ 3906,3926,3945,3964,3981,3997,4011,4023,4032,
+};
+static const uint8_t jj_hero_data[] = {
+ 184,0,1,34,39,140,0,180,0,0,39,130,0,6,33,34,39,43,0,40,38,135,0,174,
+ 0,17,34,34,38,39,0,43,34,33,39,44,38,33,34,39,44,43,33,39,134,0,174,0,
+ 21,38,34,34,33,33,38,39,33,30,38,40,34,30,38,39,43,34,34,43,0,0,43,130,
+ 0,172,0,26,34,34,39,38,39,38,33,33,34,38,33,30,34,38,30,33,39,40,34,33,
+ 39,43,0,39,43,0,0,169,0,29,42,34,27,33,34,38,39,40,39,34,33,33,34,34,
+ 30,30,34,33,30,38,39,34,30,38,40,40,34,43,0,0,170,0,28,38,34,38,38,34,
+ 38,39,40,38,34,30,33,34,33,30,33,33,30,34,39,34,30,34,39,38,34,40,0,0,
+ 168,0,30,34,34,38,40,39,38,34,34,38,38,39,38,33,30,33,33,30,33,33,30,33,
+ 39,38,30,34,39,38,34,39,44,44,167,0,13,34,33,38,40,40,38,34,34,33,34,33,
+ 33,38,38,133,33,11,30,33,39,38,33,34,39,38,34,40,43,43,166,0,1,34,34,132,
+ 40,2,38,34,34,131,33,1,34,34,134,33,9,39,38,33,34,39,38,34,40,43,43,165,
+ 0,1,39,34,132,40,2,39,38,34,130,38,0,39,130,40,0,39,131,34,5,33,34,39,
+ 38,34,38,130,39,2,43,40,43,165,0,1,39,38,132,40,26,38,34,38,38,33,30,25,
+ 25,30,33,38,40,43,40,39,38,38,39,39,38,39,40,40,43,43,40,43,164,0,2,39,
+ 33,34,131,40,130,38,1,33,19,134,12,5,19,25,38,43,43,40,130,39,2,40,43,43,
+ 130,40,0,43,164,0,2,39,38,38,131,40,3,38,34,25,15,138,12,4,19,33,43,44,
+ 43,134,40,0,43,164,0,3,43,38,40,39,130,40,5,34,24,16,13,12,12,131,9,134,
+ 12,5,15,30,39,43,44,44,130,43,1,40,43,163,0,3,34,34,33,38,130,40,12,39,
+ 25,18,16,12,12,19,21,21,19,13,12,9,135,12,7,21,30,33,33,38,39,43,0,162,
+ 0,4,33,26,30,38,34,130,40,13,38,24,24,16,12,12,34,40,38,34,33,30,25,13,
+ 135,12,6,15,16,18,18,21,0,0,160,0,24,34,33,26,33,33,30,34,38,40,39,38,
+ 30,18,19,12,12,13,24,30,34,38,34,34,38,25,135,12,5,16,21,24,16,30,0,158,
+ 0,27,34,33,30,30,33,33,30,30,34,39,40,38,34,38,24,19,15,12,12,16,24,25,
+ 30,38,38,34,38,33,134,12,5,15,16,24,16,30,0,156,0,20,34,30,26,30,30,33,
+ 33,34,30,30,33,40,40,38,33,34,24,24,15,12,21,134,39,2,34,38,30,133,12,5,
+ 15,24,25,19,30,0,154,0,6,34,33,26,30,33,33,34,130,0,23,34,17,34,40,40,
+ 34,34,33,24,24,15,12,35,28,6,9,31,44,43,43,39,34,38,15,130,12,7,19,33,
+ 34,34,38,34,30,0,151,0,6,34,34,33,33,34,33,34,134,0,5,30,33,40,40,34,
+ 34,130,24,12,12,19,29,1,1,13,31,43,44,43,39,39,33,130,12,8,19,38,34,34,
+ 38,34,34,38,0,150,0,4,34,33,34,38,38,135,0,35,34,33,38,33,40,40,34,34,
+ 24,24,21,12,19,20,5,5,31,39,43,44,31,31,24,15,12,12,15,24,39,40,43,39,
+ 24,16,35,0,149,0,3,34,33,38,38,136,0,17,27,14,12,16,34,40,39,34,33,24,
+ 24,19,12,15,19,5,5,39,130,44,15,29,19,19,12,12,13,19,24,33,42,43,35,35,
+ 19,0,0,148,0,3,38,26,26,38,136,0,37,40,15,9,13,8,15,34,40,38,30,24,
+ 24,16,12,15,19,5,3,34,43,39,34,20,21,15,12,12,15,19,24,13,31,44,28,29,
+ 25,0,0,148,0,3,34,26,30,34,136,0,23,34,12,25,30,19,8,15,38,38,30,24,
+ 24,15,12,12,15,19,6,20,34,25,21,20,19,130,12,10,19,24,24,13,39,45,28,13,
+ 30,0,0,147,0,0,34,130,26,1,33,38,135,0,11,35,13,30,24,33,25,9,30,40,
+ 30,24,21,131,12,2,16,21,19,130,21,0,19,130,12,8,9,12,24,26,13,43,44,13,
+ 13,130,0,147,0,1,34,26,130,30,0,34,134,0,12,35,29,13,19,21,38,33,8,21,
+ 40,30,24,24,130,12,6,9,9,10,12,12,15,15,133,12,6,16,30,13,33,33,9,21,
+ 130,0,148,0,5,26,33,30,30,33,34,132,0,21,39,13,29,20,13,13,33,33,12,12,
+ 35,30,24,24,15,12,12,9,9,12,9,10,131,12,10,15,21,16,16,30,26,24,25,20,
+ 9,25,130,0,148,0,130,33,4,30,33,30,34,34,130,0,36,29,13,31,35,12,12,13,
+ 24,24,12,13,19,24,24,15,12,12,9,13,25,21,19,19,13,13,12,12,19,24,26,26,
+ 19,15,16,24,16,30,130,0,148,0,3,33,33,30,34,131,30,17,34,38,43,35,20,29,
+ 39,20,12,12,15,16,15,12,19,24,24,19,130,12,7,21,29,30,29,30,25,25,21,131,
+ 19,6,16,13,12,12,15,16,33,130,0,148,0,5,33,30,33,33,30,33,130,30,2,34,
+ 35,31,130,20,20,29,20,9,12,9,9,21,19,29,21,18,12,12,19,25,31,31,9,13,
+ 20,21,132,25,130,21,3,19,16,16,33,130,0,149,0,132,33,35,34,33,30,33,9,19,
+ 20,20,29,20,31,29,13,12,25,34,13,29,29,25,21,13,25,25,29,31,6,1,1,5,
+ 6,9,13,19,21,25,130,29,2,21,16,35,130,0,150,0,21,30,30,34,33,34,33,34,
+ 20,9,20,20,31,44,31,20,35,39,39,43,39,19,21,130,31,131,25,6,33,13,8,9,
+ 8,9,6,130,5,5,6,6,13,31,25,21,131,0,151,0,20,30,33,33,34,33,34,9,
+ 13,20,20,35,43,28,29,35,42,42,41,42,29,19,130,31,130,25,16,21,31,20,6,9,
+ 8,6,9,8,9,6,9,6,19,31,25,29,131,0,152,0,15,34,30,34,34,31,8,19,
+ 20,20,28,20,20,31,41,36,32,130,36,4,20,25,31,31,29,130,25,1,29,20,135,6,
+ 5,8,9,29,31,25,35,131,0,154,0,3,33,33,28,9,132,20,3,28,35,35,28,131,
+ 32,5,36,25,29,31,31,29,131,25,132,21,132,19,130,29,0,43,131,0,152,0,5,18,
+ 0,0,34,13,12,132,20,3,29,35,39,36,132,32,5,36,31,29,29,31,29,132,25,130,
+ 29,133,31,2,25,35,43,131,0,151,0,6,17,14,23,0,39,19,13,131,20,5,29,35,
+ 39,39,32,28,132,32,6,36,41,35,31,31,29,29,134,25,0,29,130,31,2,29,31,41,
+ 132,0,151,0,6,17,11,18,0,31,19,19,130,20,6,31,39,43,36,31,12,21,133,32,
+ 0,41,130,36,4,35,35,31,31,29,131,25,0,29,131,31,1,41,42,132,0,151,0,17,
+ 16,14,14,23,29,19,17,20,20,35,43,44,41,32,15,12,16,31,131,32,7,36,36,32,
+ 36,36,28,32,32,130,35,0,31,132,35,130,41,0,43,132,0,151,0,18,14,11,10,16,
+ 25,21,17,21,28,39,43,43,32,29,10,15,24,25,29,130,32,16,36,36,32,32,36,28,
+ 28,41,42,32,36,32,32,41,41,36,42,130,36,0,42,132,0,150,0,20,23,11,10,6,
+ 10,25,15,17,26,31,39,39,42,32,20,10,16,24,24,32,36,130,32,131,36,14,32,36,
+ 41,43,41,43,36,28,41,41,36,41,36,36,41,133,0,150,0,18,18,11,10,1,9,31,
+ 15,17,26,39,39,35,32,32,20,10,15,24,30,137,36,1,28,32,130,43,8,36,32,41,
+ 41,42,36,36,41,35,133,0,145,0,0,22,131,0,20,18,10,10,6,35,31,31,17,26,
+ 39,43,29,28,32,20,10,16,16,24,33,42,132,36,1,32,36,130,28,11,43,43,32,28,
+ 32,36,36,41,41,42,42,33,133,0,144,0,2,23,14,18,130,0,21,18,10,9,20,35,
+ 28,35,30,17,38,43,29,28,32,20,10,16,16,24,33,42,41,130,36,18,41,36,36,32,
+ 32,42,43,36,28,28,32,41,36,42,42,33,33,24,25,132,0,144,0,9,18,14,14,23,
+ 0,0,18,10,8,29,130,31,12,42,35,30,38,29,20,32,28,10,12,16,24,30,130,41,
+ 1,36,36,131,42,2,43,43,42,131,32,7,41,42,41,33,30,33,25,25,132,0,144,0,
+ 37,23,14,11,15,23,0,18,9,9,20,29,35,39,35,31,35,38,31,13,36,28,10,10,
+ 12,16,24,31,35,35,36,41,42,41,42,42,43,43,41,131,32,7,42,42,35,30,33,33,
+ 30,30,132,0,145,0,11,14,10,10,18,23,17,8,9,9,20,35,39,130,31,10,35,35,
+ 9,39,31,10,10,12,16,25,29,130,35,2,41,42,42,131,43,131,32,9,36,42,41,41,
+ 35,30,33,33,35,43,131,0,139,0,0,18,132,0,30,15,10,6,9,22,18,9,6,13,
+ 9,31,39,35,35,31,29,31,13,35,30,10,10,12,16,30,31,28,35,35,41,42,131,43,
+ 0,42,132,32,9,42,42,41,35,30,30,39,43,39,43,130,0,138,0,18,18,14,15,18,
+ 18,0,0,16,10,5,1,9,23,10,8,31,20,20,31,130,35,15,31,39,13,29,29,10,
+ 12,12,24,30,38,35,35,41,41,42,131,43,131,32,4,28,32,41,41,36,130,33,3,35,
+ 39,35,39,130,0,138,0,1,18,14,130,11,14,16,23,18,10,5,4,1,12,14,6,20,
+ 31,20,20,29,130,35,17,39,20,19,25,10,15,18,15,24,26,30,35,41,42,43,43,42,
+ 42,130,32,16,28,28,32,41,41,36,41,31,29,34,35,31,35,39,44,0,0,138,0,33,
+ 23,15,11,10,8,9,11,18,11,6,2,4,1,9,6,9,9,29,28,20,20,29,31,31,
+ 29,13,25,10,13,19,25,13,15,24,130,36,20,42,41,32,28,32,32,28,32,41,42,42,
+ 36,36,35,31,30,33,39,35,35,43,130,0,139,0,32,17,11,10,5,2,5,12,14,6,
+ 2,4,4,1,6,13,8,13,31,35,31,28,20,20,28,13,25,12,15,13,19,25,21,31,
+ 131,36,19,42,35,36,41,32,41,42,41,36,41,42,31,31,35,33,29,30,30,35,33,130,
+ 0,137,0,33,23,23,18,11,10,6,2,2,5,15,8,1,4,1,4,1,9,13,13,31,
+ 35,35,29,20,20,35,28,20,25,15,19,19,24,41,131,36,14,42,39,35,42,32,36,41,
+ 36,41,36,41,0,35,31,35,131,31,1,29,35,130,0,136,0,12,18,15,14,16,15,10,
+ 9,4,4,1,12,10,4,130,1,8,4,1,9,13,13,28,20,9,8,131,20,14,29,25,
+ 25,30,36,36,32,36,41,35,31,35,35,42,36,131,41,0,36,130,0,7,35,35,29,30,
+ 33,33,35,40,130,0,135,0,27,23,14,11,10,10,15,11,10,8,1,4,6,10,6,1,
+ 4,1,1,4,1,5,8,9,6,5,9,9,6,131,1,6,13,29,36,41,36,42,41,131,
+ 35,1,42,41,131,36,0,42,132,0,131,35,132,0,135,0,2,23,18,14,130,10,9,14,
+ 11,10,6,1,4,8,8,1,4,130,1,0,4,131,1,0,3,130,1,9,4,1,4,4,
+ 3,20,29,42,39,43,130,28,6,31,35,42,42,36,36,35,143,0,136,0,12,23,18,14,
+ 10,10,14,11,10,9,5,1,6,6,134,1,130,4,0,1,130,4,130,1,6,4,1,13,
+ 29,35,39,32,131,28,5,35,39,31,25,25,33,143,0,137,0,11,22,18,16,11,14,14,
+ 11,10,8,5,4,5,145,1,3,4,1,9,20,137,28,2,25,33,33,142,0,138,0,130,
+ 23,6,17,14,11,10,10,6,4,147,1,3,4,1,1,13,136,28,4,30,30,25,30,33,
+ 140,0,135,0,13,23,23,18,17,15,11,12,9,8,8,6,5,5,4,147,1,3,4,4,
+ 5,9,135,28,0,30,130,29,3,25,30,30,33,137,0,133,0,7,18,16,11,10,8,6,
+ 5,4,133,1,0,4,152,1,0,9,132,28,0,20,130,29,0,30,130,29,2,25,30,33,
+ 136,0,130,0,5,18,15,14,11,10,6,130,1,1,2,2,131,4,153,1,8,3,3,5,
+ 9,20,20,13,6,6,130,13,1,30,30,130,29,1,25,30,136,0,130,0,9,17,11,11,
+ 10,10,6,2,2,1,4,162,1,8,5,5,1,1,6,10,10,11,24,130,25,1,30,26,
+ 137,0,131,0,11,16,14,11,11,10,8,6,5,4,1,4,5,162,1,8,5,8,11,15,
+ 16,14,14,24,26,139,0,132,0,0,18,130,14,8,11,11,10,8,9,8,5,1,4,157,
+ 1,130,4,6,5,12,15,15,14,16,18,141,0,133,0,2,22,18,15,130,14,3,15,10,
+ 6,4,130,1,0,4,158,1,5,5,5,8,15,23,23,142,0,135,0,0,22,130,18,8,
+ 12,5,2,1,1,5,6,5,4,142,1,0,4,136,1,10,4,1,8,9,5,1,4,1,
+ 6,15,23,142,0,136,0,2,23,16,6,130,1,6,6,8,5,5,1,4,4,151,1,11,
+ 4,1,8,14,11,8,1,4,1,6,15,23,141,0,134,0,6,23,18,14,8,1,5,8,
+ 130,10,6,8,5,1,4,1,4,4,132,1,9,4,4,1,1,4,1,8,6,1,4,135,
+ 1,11,4,6,10,14,14,10,5,2,4,6,16,23,140,0,133,0,2,23,16,11,130,10,
+ 6,14,15,11,11,10,6,4,130,1,1,4,4,136,1,5,4,1,6,12,2,4,134,1,
+ 12,4,6,8,10,10,16,16,10,8,9,8,10,23,140,0,133,0,10,22,15,14,14,16,
+ 17,16,14,14,12,6,138,1,0,4,131,1,6,4,4,1,12,8,1,4,132,1,2,4,
+ 6,8,130,10,3,11,17,18,16,130,14,0,18,140,0,134,0,131,23,3,14,14,16,12,
+ 142,1,9,5,5,1,1,2,2,9,9,1,4,130,1,3,5,5,6,8,132,10,1,14,
+ 18,130,23,1,22,22,140,0,137,0,7,15,15,16,9,1,2,4,4,135,1,17,4,4,
+ 6,4,5,10,10,8,5,6,12,12,1,4,1,4,5,8,135,10,1,11,16,145,0,137,
+ 0,7,17,16,6,1,2,6,6,5,133,1,20,4,5,4,6,11,10,8,14,14,11,10,
+ 10,16,12,1,4,4,5,6,10,11,135,10,0,14,145,0,136,0,8,23,13,4,1,5,
+ 9,9,6,4,131,1,10,5,6,5,6,1,9,15,11,10,11,18,130,17,10,18,6,1,
+ 1,5,6,6,12,11,10,11,133,10,1,14,23,144,0,135,0,7,23,12,1,1,6,10,
+ 9,5,131,1,27,4,1,9,9,6,5,2,9,17,16,14,16,11,12,13,12,5,1,5,
+ 8,8,6,6,12,17,11,14,14,130,11,130,14,0,23,144,0,134,0,7,23,12,1,1,
+ 8,14,10,5,133,1,1,4,12,130,6,6,1,12,15,14,15,11,6,131,1,10,4,9,
+ 10,10,6,6,8,16,18,16,16,132,14,0,16,145,0,133,0,8,23,16,10,8,10,16,
+ 11,6,4,131,1,18,4,1,6,12,5,8,9,10,17,14,6,5,4,1,5,2,4,4,
+ 5,130,10,3,8,6,6,11,130,23,5,22,18,18,17,17,23,145,0,133,0,7,18,14,
+ 11,11,17,14,9,5,132,1,26,4,1,9,12,4,9,16,18,16,10,1,2,2,4,4,
+ 1,4,1,6,10,10,11,8,6,6,10,18,153,0,132,0,0,22,130,14,4,18,16,15,
+ 8,4,131,1,12,4,2,5,14,9,5,10,18,16,11,8,4,4,131,1,10,4,1,9,
+ 10,10,11,12,6,8,8,18,153,0,133,0,7,18,18,23,0,23,12,5,2,130,1,11,
+ 4,1,5,10,15,6,6,14,18,11,9,4,132,1,11,5,4,6,11,10,10,11,14,8,
+ 8,10,17,153,0,137,0,35,18,9,5,4,1,1,4,1,5,9,11,15,5,8,16,17,
+ 10,6,1,1,4,4,1,5,5,4,9,14,11,10,14,18,11,10,11,17,153,0,136,0,
+ 36,23,11,10,5,1,4,1,1,6,10,11,16,15,6,10,18,15,8,2,1,4,4,1,
+ 6,6,5,5,14,17,14,14,18,0,18,14,15,18,153,0,136,0,30,18,11,10,4,4,
+ 1,5,8,10,11,15,18,11,10,11,18,11,5,2,1,5,4,5,8,6,5,8,18,23,
+ 17,18,130,0,0,22,155,0,136,0,27,23,11,6,2,4,5,10,10,11,18,23,18,11,
+ 11,15,18,10,6,4,5,5,1,8,10,6,5,12,23,162,0,136,0,26,16,8,1,4,
+ 1,9,11,14,18,23,0,18,14,15,23,18,10,9,8,5,1,5,10,10,8,8,16,163,
+ 0,135,0,27,23,9,1,4,1,8,14,18,22,23,0,0,17,14,18,0,18,11,10,8,
+ 1,4,8,12,14,8,11,23,163,0,134,0,7,23,12,4,4,2,5,11,18,132,0,14,
+ 16,14,23,0,0,16,8,4,4,6,8,12,16,10,18,164,0,134,0,6,18,6,1,4,
+ 4,10,18,133,0,14,17,18,0,0,23,12,6,5,5,8,9,16,18,16,23,164,0,133,
+ 0,6,23,9,1,2,4,10,17,134,0,13,23,23,0,0,18,8,5,4,6,8,11,23,
+ 22,22,165,0,132,0,6,23,15,4,2,1,10,18,138,0,7,23,12,6,4,5,8,10,
+ 18,168,0,132,0,5,18,10,1,1,10,17,138,0,7,23,15,6,4,4,6,9,18,169,
+ 0,131,0,5,23,11,10,9,10,16,139,0,6,18,8,5,2,6,8,16,170,0,131,0,
+ 4,17,11,10,10,16,139,0,6,23,9,4,2,5,8,16,171,0,130,0,4,23,14,14,
+ 11,16,140,0,6,12,4,2,5,8,14,23,171,0,130,0,3,17,14,14,17,140,0,6,
+ 16,6,1,2,8,11,23,172,0,5,0,0,23,14,14,16,140,0,6,23,9,1,2,6,
+ 11,18,173,0,4,0,0,17,11,16,141,0,5,16,10,8,8,11,18,174,0,3,0,23,
+ 11,16,141,0,5,18,14,14,11,11,18,175,0,2,0,17,14,142,0,4,15,14,14,15,
+ 18,176,0,1,22,18,142,0,3,18,11,15,16,178,0,0,23,143,0,1,18,15,180,0,
+};
+static const jj_sprite jj_hero = {72,104,jj_hero_palette,jj_hero_rows,jj_hero_data,8};
+static const uint16_t jj_barry_0_rows[] = {
+ 0,2,4,6,8,10,12,14,26,39,51,64,79,96,108,122,136,151,166,187,207,226,244,261,
+ 271,288,308,328,349,372,394,416,435,446,458,470,481,490,492,494,496,
+};
+static const uint8_t jj_barry_0_data[] = {
+ 155,0,155,0,155,0,155,0,155,0,155,0,155,0,140,0,2,17,0,17,133,0,0,17,
+ 132,0,140,0,2,10,17,10,133,17,1,10,17,131,0,140,0,0,17,135,15,2,10,15,
+ 17,130,0,140,0,131,17,131,21,3,17,10,15,21,130,0,140,0,130,17,2,21,21,24,
+ 131,21,1,17,21,130,0,139,0,1,24,17,130,21,0,17,131,24,2,21,21,24,130,0,
+ 139,0,0,24,132,21,131,2,0,14,132,0,139,0,0,24,132,21,4,2,14,21,21,14,
+ 132,0,139,0,0,24,131,21,2,24,5,5,130,14,132,0,139,0,9,24,21,24,21,24,
+ 5,5,21,21,14,133,0,139,0,9,24,24,2,24,21,5,21,4,31,21,133,0,132,0,
+ 1,26,29,132,0,10,24,2,5,14,14,5,2,4,31,5,10,132,0,133,0,1,27,27,
+ 132,0,4,14,2,5,14,6,130,2,1,5,10,132,0,133,0,0,22,133,0,9,24,14,
+ 2,11,6,2,2,6,10,14,132,0,133,0,0,22,133,0,8,24,24,14,16,11,6,6,
+ 16,16,133,0,133,0,0,27,134,0,7,24,14,14,16,6,6,11,16,133,0,130,0,2,
+ 22,22,29,130,22,146,0,6,0,0,22,22,27,16,22,131,27,1,0,0,130,25,139,0,
+ 16,8,13,19,27,4,7,16,3,27,27,22,0,25,18,18,25,25,138,0,130,8,14,7,
+ 4,4,7,19,16,7,22,25,18,28,18,28,25,28,137,0,130,8,15,27,4,7,16,3,
+ 27,27,25,18,25,18,12,25,28,11,31,136,0,19,23,19,19,29,23,23,3,9,0,0,
+ 25,18,18,28,18,12,18,25,5,14,135,0,1,0,9,131,23,3,20,20,0,0,130,18,
+ 6,25,28,12,12,18,2,2,135,0,3,0,0,20,3,130,20,2,9,0,0,131,28,5,
+ 25,28,18,25,5,5,135,0,131,0,3,20,20,23,23,130,0,1,28,25,132,28,1,14,
+ 14,135,0,138,0,5,31,28,25,18,18,28,138,0,137,0,1,31,31,130,28,1,18,28,
+ 138,0,137,0,6,31,31,28,25,18,25,28,138,0,137,0,5,31,31,0,18,25,28,139,
+ 0,140,0,3,31,31,22,31,138,0,155,0,155,0,155,0,
+};
+static const jj_sprite jj_barry_0 = {28,40,jj_barry_palette_0,jj_barry_0_rows,jj_barry_0_data,8};
+static const uint16_t jj_barry_1_rows[] = {
+ 0,2,4,6,8,10,12,26,41,56,71,88,105,117,131,146,161,176,192,212,231,248,260,266,
+ 284,304,326,348,370,394,411,431,451,466,475,481,483,485,487,489,491,
+};
+static const uint8_t jj_barry_1_data[] = {
+ 155,0,155,0,155,0,155,0,155,0,155,0,142,0,0,17,130,0,0,17,130,0,0,17,
+ 131,0,140,0,0,10,132,15,0,10,130,15,1,10,17,130,0,140,0,0,24,130,17,131,
+ 21,3,17,10,15,21,130,0,140,0,130,17,2,21,21,24,131,21,1,17,21,130,0,139,
+ 0,1,24,17,130,21,0,17,131,24,2,21,21,24,130,0,139,0,0,24,130,21,7,17,
+ 17,5,2,5,5,24,24,131,0,139,0,0,24,132,21,131,2,0,14,132,0,139,0,0,
+ 24,131,21,2,24,5,5,130,14,132,0,139,0,9,24,21,24,21,24,5,5,21,21,14,
+ 133,0,139,0,9,24,24,2,24,21,5,21,4,31,21,133,0,139,0,9,24,2,5,5,
+ 14,5,5,4,31,14,133,0,139,0,10,24,2,5,14,14,5,2,4,31,5,10,132,0,
+ 132,0,1,26,29,133,0,9,24,14,2,11,6,2,2,6,10,14,132,0,133,0,1,27,
+ 27,132,0,8,24,24,14,16,11,6,6,16,16,133,0,133,0,0,22,134,0,7,24,14,
+ 14,16,6,6,11,16,133,0,133,0,0,22,135,0,130,14,130,16,134,0,133,0,0,27,
+ 148,0,130,0,2,22,22,29,130,22,130,0,4,25,18,18,25,25,138,0,6,0,0,22,
+ 22,27,16,22,131,27,6,25,18,25,28,25,28,28,137,0,18,8,13,19,27,4,7,16,
+ 3,27,27,25,18,18,28,18,18,25,11,31,136,0,130,8,6,7,4,4,7,19,16,28,
+ 130,18,6,28,18,12,18,25,14,14,135,0,130,8,16,27,4,7,16,3,27,27,28,18,
+ 18,25,28,12,12,18,2,5,135,0,20,23,19,19,29,23,23,3,9,0,0,28,28,18,
+ 25,25,28,28,18,5,5,14,134,0,1,0,9,131,23,1,20,20,130,0,134,28,1,14,
+ 14,135,0,3,0,0,20,3,130,20,7,9,0,0,28,28,18,18,25,132,28,135,0,131,
+ 0,5,20,20,23,23,0,28,130,18,1,25,25,132,28,0,31,134,0,135,0,4,22,31,
+ 25,25,28,132,0,1,28,31,135,0,135,0,3,22,31,28,28,143,0,135,0,0,31,146,
+ 0,155,0,155,0,155,0,155,0,155,0,
+};
+static const jj_sprite jj_barry_1 = {28,40,jj_barry_palette_0,jj_barry_1_rows,jj_barry_1_data,8};
+static const uint16_t jj_barry_2_rows[] = {
+ 0,2,4,6,8,10,12,14,26,39,51,64,79,96,108,122,136,151,166,187,207,226,244,261,
+ 271,288,306,325,346,369,391,413,432,442,453,464,475,485,487,489,491,
+};
+static const uint8_t jj_barry_2_data[] = {
+ 155,0,155,0,155,0,155,0,155,0,155,0,155,0,140,0,2,17,0,17,133,0,0,17,
+ 132,0,140,0,2,10,17,10,133,17,1,10,17,131,0,140,0,0,17,135,15,2,10,15,
+ 17,130,0,140,0,131,17,131,21,3,17,10,15,21,130,0,140,0,130,17,2,21,21,24,
+ 131,21,1,17,21,130,0,139,0,1,24,17,130,21,0,17,131,24,2,21,21,24,130,0,
+ 139,0,0,24,132,21,131,2,0,14,132,0,139,0,0,24,132,21,4,2,14,21,21,14,
+ 132,0,139,0,0,24,131,21,2,24,5,5,130,14,132,0,139,0,9,24,21,24,21,24,
+ 5,5,21,21,14,133,0,139,0,9,24,24,2,24,21,5,21,4,31,21,133,0,132,0,
+ 1,26,29,132,0,10,24,2,5,14,14,5,2,4,31,5,10,132,0,133,0,1,27,27,
+ 132,0,4,14,2,5,14,6,130,2,1,5,10,132,0,133,0,0,22,133,0,9,24,14,
+ 2,11,6,2,2,6,10,14,132,0,133,0,0,22,133,0,8,24,24,14,16,11,6,6,
+ 16,16,133,0,133,0,0,27,134,0,7,24,14,14,16,6,6,11,16,133,0,130,0,2,
+ 22,22,29,130,22,146,0,6,0,0,22,22,27,16,22,131,27,3,0,0,25,25,140,0,
+ 12,8,13,19,27,4,7,16,3,27,27,22,0,25,130,18,139,0,130,8,13,7,4,4,
+ 7,19,16,7,22,25,18,28,18,28,25,138,0,130,8,15,27,4,7,16,3,27,27,25,
+ 18,25,18,12,25,28,11,31,136,0,19,23,19,19,29,23,23,3,9,0,0,25,18,18,
+ 28,18,12,18,25,5,14,135,0,1,0,9,131,23,3,20,20,0,0,130,18,6,25,28,
+ 12,12,18,2,2,135,0,3,0,0,20,3,130,20,2,9,0,0,131,28,5,25,28,18,
+ 25,5,5,135,0,131,0,3,20,20,23,23,130,0,1,28,25,132,28,1,14,14,135,0,
+ 139,0,4,28,25,18,18,28,138,0,138,0,0,31,130,18,1,25,28,138,0,137,0,5,
+ 31,22,25,18,18,28,139,0,137,0,1,31,22,130,28,0,31,139,0,137,0,2,31,31,
+ 0,131,31,138,0,155,0,155,0,155,0,
+};
+static const jj_sprite jj_barry_2 = {28,40,jj_barry_palette_0,jj_barry_2_rows,jj_barry_2_data,8};
+static const uint16_t jj_barry_3_rows[] = {
+ 0,2,4,6,8,10,12,23,38,55,71,84,99,112,125,140,155,170,186,207,225,241,255,261,
+ 278,298,321,344,367,389,410,431,451,466,477,479,481,483,485,487,489,
+};
+static const uint8_t jj_barry_3_data[] = {
+ 155,0,155,0,155,0,155,0,155,0,155,0,142,0,1,17,17,134,0,0,17,130,0,140,
+ 0,1,21,10,132,15,0,10,130,15,0,10,130,0,140,0,1,24,24,130,17,6,21,21,
+ 17,21,15,10,15,130,0,140,0,6,24,17,21,17,21,21,24,131,21,0,17,130,0,140,
+ 0,1,21,17,130,21,131,24,130,21,130,0,140,0,131,21,7,17,24,5,2,5,14,24,
+ 24,130,0,140,0,132,21,0,24,130,2,1,5,14,131,0,140,0,132,21,5,14,5,5,
+ 14,21,14,131,0,140,0,9,21,21,24,21,24,5,5,21,21,14,132,0,140,0,9,21,
+ 24,2,24,21,2,21,4,31,14,132,0,140,0,9,24,2,14,5,14,2,5,1,31,14,
+ 132,0,140,0,10,24,2,5,14,14,2,2,1,31,10,10,131,0,132,0,1,26,29,133,
+ 0,10,24,24,2,2,11,6,2,6,6,10,14,131,0,133,0,1,27,27,133,0,3,24,
+ 14,14,16,130,6,0,16,133,0,133,0,0,22,135,0,6,24,14,14,11,6,6,11,133,
+ 0,133,0,0,22,135,0,2,24,14,14,131,16,133,0,133,0,0,27,148,0,130,0,2,
+ 22,22,29,130,22,131,0,130,18,1,25,25,137,0,6,0,0,22,22,27,16,22,131,27,
+ 6,0,25,28,18,28,25,28,137,0,19,8,13,19,27,4,7,16,3,27,27,22,25,25,
+ 18,12,25,28,11,28,31,135,0,130,8,17,7,4,4,7,19,16,7,25,18,25,18,12,
+ 18,25,25,14,17,17,134,0,130,8,17,27,4,7,16,3,27,27,28,25,18,28,18,12,
+ 18,25,5,14,17,134,0,7,23,19,19,29,23,23,3,9,130,0,130,28,5,25,28,18,
+ 25,5,5,135,0,1,0,9,131,23,3,20,20,0,0,130,28,0,25,131,28,1,14,14,
+ 135,0,3,0,0,20,3,130,20,1,9,0,132,28,5,25,18,25,25,28,28,135,0,131,
+ 0,6,20,20,23,23,31,25,25,131,28,0,25,131,18,0,31,134,0,135,0,0,31,130,
+ 28,132,0,3,28,25,31,31,134,0,135,0,0,31,136,0,1,31,31,135,0,155,0,155,
+ 0,155,0,155,0,155,0,155,0,
+};
+static const jj_sprite jj_barry_3 = {28,40,jj_barry_palette_0,jj_barry_3_rows,jj_barry_3_data,8};
+static const uint16_t jj_barry_4_rows[] = {
+ 0,2,4,6,8,10,16,27,41,58,70,86,102,118,131,146,163,180,196,215,234,248,254,260,
+ 276,297,320,343,366,389,409,429,444,452,460,467,474,480,482,484,486,
+};
+static const uint8_t jj_barry_4_data[] = {
+ 155,0,155,0,155,0,155,0,155,0,147,0,0,17,134,0,140,0,130,21,131,17,1,15,
+ 21,133,0,138,0,4,21,10,15,15,17,132,21,0,24,133,0,137,0,11,21,15,15,17,
+ 17,21,21,24,21,24,21,24,133,0,137,0,2,10,17,17,130,21,132,24,134,0,137,0,
+ 10,21,17,17,21,21,24,14,2,5,14,24,134,0,137,0,6,21,17,21,17,21,24,5,
+ 130,2,0,14,134,0,137,0,10,21,21,17,21,21,24,2,14,21,5,14,134,0,137,0,
+ 132,21,5,14,5,5,21,21,14,134,0,137,0,130,21,7,24,21,5,5,21,4,31,14,
+ 134,0,137,0,11,21,21,24,2,24,5,2,5,1,31,10,10,133,0,137,0,11,24,24,
+ 2,14,5,5,2,2,1,31,2,10,133,0,137,0,5,24,24,2,5,14,5,131,2,1,
+ 10,14,133,0,132,0,1,26,29,131,0,4,24,24,2,2,11,131,6,0,16,134,0,133,
+ 0,1,27,27,131,0,4,24,14,14,16,11,130,6,0,16,134,0,133,0,0,22,133,0,
+ 2,24,14,14,131,16,135,0,133,0,0,22,148,0,133,0,0,27,148,0,130,0,2,22,
+ 22,29,130,22,131,0,2,18,18,25,139,0,6,0,0,22,22,27,16,22,131,27,7,0,
+ 28,25,12,25,28,11,31,136,0,19,8,13,19,27,4,7,16,3,27,27,22,0,28,28,
+ 18,18,25,25,14,14,135,0,130,8,17,7,4,4,7,19,16,7,22,0,28,28,18,12,
+ 18,18,5,2,14,134,0,130,8,4,27,4,7,16,3,130,27,9,0,28,25,28,18,12,
+ 12,2,2,14,134,0,7,23,19,19,29,23,23,3,9,130,0,3,28,25,18,25,130,28,
+ 1,14,14,135,0,1,0,9,131,23,1,20,20,130,0,6,28,18,28,18,25,25,28,137,
+ 0,3,0,0,20,3,130,20,0,9,131,0,5,28,25,28,18,25,28,137,0,131,0,3,
+ 20,20,23,23,132,0,130,18,0,28,138,0,140,0,2,18,18,28,139,0,140,0,2,18,
+ 18,28,139,0,140,0,1,31,31,140,0,140,0,1,31,22,140,0,141,0,0,31,140,0,
+ 155,0,155,0,155,0,
+};
+static const jj_sprite jj_barry_4 = {28,40,jj_barry_palette_0,jj_barry_4_rows,jj_barry_4_data,8};
+static const uint16_t jj_barry_5_rows[] = {
+ 0,2,4,6,8,14,25,38,51,68,80,96,112,125,138,153,170,187,203,222,241,255,261,267,
+ 283,304,327,350,373,396,416,436,451,459,467,474,481,487,489,491,493,
+};
+static const uint8_t jj_barry_5_data[] = {
+ 155,0,155,0,155,0,155,0,147,0,0,17,134,0,143,0,5,17,17,0,0,10,17,133,
+ 0,140,0,130,21,5,17,15,17,17,10,17,133,0,137,0,5,21,21,10,15,15,17,133,
+ 21,133,0,137,0,11,10,15,15,17,17,21,21,24,21,24,21,24,133,0,137,0,2,21,
+ 17,17,130,21,133,24,133,0,137,0,10,21,17,17,21,17,24,14,2,5,14,24,134,0,
+ 137,0,1,21,17,130,21,1,24,5,130,2,0,14,134,0,137,0,132,21,5,24,2,14,
+ 21,5,14,134,0,137,0,132,21,5,14,5,5,21,21,14,134,0,137,0,130,21,7,24,
+ 21,5,5,21,4,31,14,134,0,137,0,11,21,21,24,2,24,5,2,5,1,31,10,10,
+ 133,0,137,0,11,24,24,2,14,5,5,2,2,1,31,2,10,133,0,137,0,5,24,24,
+ 2,5,14,5,131,2,1,10,14,133,0,132,0,1,26,29,131,0,4,24,24,2,2,11,
+ 131,6,0,16,134,0,133,0,1,27,27,131,0,4,24,14,14,16,11,130,6,0,16,134,
+ 0,133,0,0,22,133,0,2,24,14,14,131,16,135,0,133,0,0,22,148,0,133,0,0,
+ 27,148,0,130,0,2,22,22,29,130,22,131,0,2,18,18,25,139,0,6,0,0,22,22,
+ 27,16,22,131,27,7,0,28,25,12,25,28,11,31,136,0,19,8,13,19,27,4,7,16,
+ 3,27,27,22,0,28,28,18,18,25,25,14,14,135,0,130,8,17,7,4,4,7,19,16,
+ 7,22,0,28,28,18,12,18,18,5,2,14,134,0,130,8,4,27,4,7,16,3,130,27,
+ 9,0,28,25,28,18,12,12,2,2,14,134,0,7,23,19,19,29,23,23,3,9,130,0,
+ 3,28,25,18,25,130,28,1,14,14,135,0,1,0,9,131,23,1,20,20,130,0,6,28,
+ 18,28,18,25,25,28,137,0,3,0,0,20,3,130,20,0,9,131,0,5,28,25,28,18,
+ 25,28,137,0,131,0,3,20,20,23,23,132,0,130,18,0,28,138,0,140,0,2,18,18,
+ 28,139,0,140,0,2,18,18,28,139,0,140,0,1,31,31,140,0,140,0,1,31,22,140,
+ 0,141,0,0,31,140,0,155,0,155,0,155,0,
+};
+static const jj_sprite jj_barry_5 = {28,40,jj_barry_palette_0,jj_barry_5_rows,jj_barry_5_data,8};
+static const uint16_t jj_barry_6_rows[] = {
+ 0,2,4,6,8,10,20,30,42,57,70,86,102,115,128,143,160,177,193,212,231,245,251,257,
+ 273,294,317,340,363,386,406,426,441,449,457,464,471,477,479,481,483,
+};
+static const uint8_t jj_barry_6_data[] = {
+ 155,0,155,0,155,0,155,0,155,0,144,0,0,17,130,0,0,17,133,0,140,0,130,21,
+ 132,17,0,10,133,0,138,0,4,21,10,15,15,17,133,21,133,0,137,0,7,21,15,15,
+ 17,17,21,21,24,131,21,133,0,137,0,5,10,15,17,17,21,21,133,24,133,0,137,0,
+ 10,21,17,17,21,21,24,14,2,5,14,24,134,0,137,0,1,21,17,130,21,1,24,5,
+ 130,2,0,14,134,0,137,0,132,21,5,24,2,14,21,5,14,134,0,137,0,132,21,5,
+ 14,5,5,21,21,14,134,0,137,0,130,21,7,24,21,5,5,21,4,31,14,134,0,137,
+ 0,11,21,21,24,2,24,5,2,5,1,31,10,10,133,0,137,0,11,24,24,2,14,5,
+ 5,2,2,1,31,2,10,133,0,137,0,5,24,24,2,5,14,5,131,2,1,10,14,133,
+ 0,132,0,1,26,29,131,0,4,24,24,2,2,11,131,6,0,16,134,0,133,0,1,27,
+ 27,131,0,4,24,14,14,16,11,130,6,0,16,134,0,133,0,0,22,133,0,2,24,14,
+ 14,131,16,135,0,133,0,0,22,148,0,133,0,0,27,148,0,130,0,2,22,22,29,130,
+ 22,131,0,2,18,18,25,139,0,6,0,0,22,22,27,16,22,131,27,7,0,28,25,12,
+ 25,28,11,31,136,0,19,8,13,19,27,4,7,16,3,27,27,22,0,28,28,18,18,25,
+ 25,14,14,135,0,130,8,17,7,4,4,7,19,16,7,22,0,28,28,18,12,18,18,5,
+ 2,14,134,0,130,8,4,27,4,7,16,3,130,27,9,0,28,25,28,18,12,12,2,2,
+ 14,134,0,7,23,19,19,29,23,23,3,9,130,0,3,28,25,18,25,130,28,1,14,14,
+ 135,0,1,0,9,131,23,1,20,20,130,0,6,28,18,28,18,25,25,28,137,0,3,0,
+ 0,20,3,130,20,0,9,131,0,5,28,25,28,18,25,28,137,0,131,0,3,20,20,23,
+ 23,132,0,130,18,0,28,138,0,140,0,2,18,18,28,139,0,140,0,2,18,18,28,139,
+ 0,140,0,1,31,31,140,0,140,0,1,31,22,140,0,141,0,0,31,140,0,155,0,155,
+ 0,155,0,
+};
+static const jj_sprite jj_barry_6 = {28,40,jj_barry_palette_0,jj_barry_6_rows,jj_barry_6_data,8};
+static const uint16_t jj_barry_7_rows[] = {
+ 0,2,4,6,8,10,19,31,43,57,69,84,100,113,126,141,158,175,191,210,229,243,249,255,
+ 271,292,315,338,361,384,404,424,439,447,455,462,469,475,477,479,481,
+};
+static const uint8_t jj_barry_7_data[] = {
+ 155,0,155,0,155,0,155,0,155,0,145,0,3,17,0,17,17,133,0,141,0,1,21,21,
+ 131,17,1,10,17,133,0,138,0,0,21,130,15,0,17,133,21,133,0,137,0,0,21,130,
+ 15,0,17,133,21,0,24,133,0,137,0,2,10,15,15,130,21,133,24,133,0,137,0,0,
+ 21,131,17,5,24,14,2,5,14,24,134,0,137,0,6,21,17,21,17,21,24,5,130,2,
+ 0,14,134,0,137,0,132,21,5,24,2,14,21,5,14,134,0,137,0,132,21,5,14,5,
+ 5,21,21,14,134,0,137,0,130,21,7,24,21,5,5,21,4,31,14,134,0,137,0,11,
+ 21,21,24,2,24,5,2,5,1,31,10,10,133,0,137,0,11,24,24,2,14,5,5,2,
+ 2,1,31,2,10,133,0,137,0,5,24,24,2,5,14,5,131,2,1,10,14,133,0,132,
+ 0,1,26,29,131,0,4,24,24,2,2,11,131,6,0,16,134,0,133,0,1,27,27,131,
+ 0,4,24,14,14,16,11,130,6,0,16,134,0,133,0,0,22,133,0,2,24,14,14,131,
+ 16,135,0,133,0,0,22,148,0,133,0,0,27,148,0,130,0,2,22,22,29,130,22,131,
+ 0,2,18,18,25,139,0,6,0,0,22,22,27,16,22,131,27,7,0,28,25,12,25,28,
+ 11,31,136,0,19,8,13,19,27,4,7,16,3,27,27,22,0,28,28,18,18,25,25,14,
+ 14,135,0,130,8,17,7,4,4,7,19,16,7,22,0,28,28,18,12,18,18,5,2,14,
+ 134,0,130,8,4,27,4,7,16,3,130,27,9,0,28,25,28,18,12,12,2,2,14,134,
+ 0,7,23,19,19,29,23,23,3,9,130,0,3,28,25,18,25,130,28,1,14,14,135,0,
+ 1,0,9,131,23,1,20,20,130,0,6,28,18,28,18,25,25,28,137,0,3,0,0,20,
+ 3,130,20,0,9,131,0,5,28,25,28,18,25,28,137,0,131,0,3,20,20,23,23,132,
+ 0,130,18,0,28,138,0,140,0,2,18,18,28,139,0,140,0,2,18,18,28,139,0,140,
+ 0,1,31,31,140,0,140,0,1,31,22,140,0,141,0,0,31,140,0,155,0,155,0,155,
+ 0,
+};
+static const jj_sprite jj_barry_7 = {28,40,jj_barry_palette_0,jj_barry_7_rows,jj_barry_7_data,8};
+static const uint16_t jj_coin_0_palette[] = {
+ 0x0,0xff93,0xff52,0xff0f,0xfece,0xfe6c,0xee0b,0xedaa,0xdd49,0xd4e9,0xcc66,0xbbe5,0xb384,0x92c1,0x8180,0x2820,
+};
+static const uint16_t jj_coin_0_rows[] = {
+ 0,8,17,24,31,38,45,52,60,67,74,82,
+};
+static const uint8_t jj_coin_0_data[] = {
+ 130,0,4,200,137,176,130,0,4,0,129,32,130,3,2,144,0,10,9,20,67,55,74,0,
+ 10,193,66,17,52,117,192,10,146,33,34,84,151,160,10,148,50,83,116,152,144,10,165,100,
+ 49,103,168,160,3,213,119,130,6,3,172,93,10,11,90,203,204,91,0,10,0,182,120,134,
+ 176,0,130,0,4,219,171,208,130,0,
+};
+static const jj_sprite jj_coin_0 = {11,11,jj_coin_0_palette,jj_coin_0_rows,jj_coin_0_data,4};
+static const uint16_t jj_coin_1_palette[] = {
+ 0x0,0xffd5,0xff6b,0xf6cf,0xf66d,0xee0b,0xe5aa,0xdd6a,0xdd28,0xd4c7,0xc446,0xc3c4,0xab23,0xa2a1,0x9200,0x800,
+};
+static const uint16_t jj_coin_1_rows[] = {
+ 0,8,15,22,29,36,43,50,57,64,71,78,
+};
+static const uint8_t jj_coin_1_data[] = {
+ 3,0,185,130,7,3,173,0,10,11,49,19,68,93,0,10,5,17,99,89,88,0,10,195,
+ 21,49,55,133,176,10,163,20,17,71,151,160,7,180,52,51,74,130,9,10,200,84,65,59,
+ 169,160,10,203,134,150,140,213,192,10,12,197,172,205,120,0,10,13,202,86,133,126,0,10,
+ 0,221,202,171,224,0,
+};
+static const jj_sprite jj_coin_1 = {11,11,jj_coin_1_palette,jj_coin_1_rows,jj_coin_1_data,4};
+static const uint16_t jj_coin_2_palette[] = {
+ 0x0,0xffd1,0xfecf,0xedeb,0xedca,0xe589,0xdd28,0xd4a7,0xcc66,0xcc05,0xbba4,0x9b82,0xa2e2,0x9a61,0xb924,0x2860,
+};
+static const uint16_t jj_coin_2_rows[] = {
+ 0,8,17,25,32,39,46,53,60,67,74,82,
+};
+static const uint8_t jj_coin_2_data[] = {
+ 130,0,4,101,52,144,130,0,2,0,80,130,1,4,135,144,0,1,7,130,1,5,153,135,
+ 160,10,5,17,52,19,168,0,10,4,33,51,69,200,0,10,6,66,82,70,166,208,10,8,
+ 116,83,52,166,0,10,10,118,103,55,136,0,10,13,169,73,172,92,0,10,0,204,132,133,
+ 160,0,130,0,130,12,1,140,130,0,
+};
+static const jj_sprite jj_coin_2 = {11,11,jj_coin_2_palette,jj_coin_2_rows,jj_coin_2_data,4};
+static const uint16_t jj_coin_3_palette[] = {
+ 0x0,0xfff8,0xff71,0xee2c,0xdd8a,0xdce7,0xec43,0xc404,0x93e2,0xb343,0xa2a1,0xa9c0,0x4000,0x0,0x0,0x0,
+};
+static const uint16_t jj_coin_3_rows[] = {
+ 0,10,18,27,34,41,48,55,64,71,79,87,
+};
+static const uint8_t jj_coin_3_data[] = {
+ 130,0,0,112,130,5,0,112,130,0,130,0,4,66,20,160,130,0,2,0,80,130,1,4,
+ 170,144,0,10,0,65,18,85,160,0,10,0,50,19,119,160,0,10,0,66,35,151,160,0,
+ 10,0,83,35,117,160,0,2,0,144,130,3,4,119,160,0,10,0,165,83,154,160,0,130,
+ 0,4,151,84,144,130,0,130,0,4,186,169,160,130,0,
+};
+static const jj_sprite jj_coin_3 = {11,11,jj_coin_3_palette,jj_coin_3_rows,jj_coin_3_data,4};
+static const uint16_t jj_coin_4_palette[] = {
+ 0x0,0xfff9,0xfff2,0xffb2,0xfecd,0xe5e9,0xf5eb,0xed69,0xcd08,0xd486,0xbbe7,0xc424,0xb363,0xa2a0,0x9a40,0x0,
+};
+static const uint16_t jj_coin_4_rows[] = {
+ 0,6,14,24,34,42,50,60,70,78,88,94,
+};
+static const uint8_t jj_coin_4_data[] = {
+ 131,0,130,9,131,0,130,0,4,148,36,176,130,0,130,0,0,96,130,1,0,144,130,0,
+ 130,0,0,64,130,1,0,144,130,0,130,0,4,130,51,176,130,0,130,0,4,130,51,192,
+ 130,0,130,0,0,144,130,4,0,192,130,0,130,0,0,176,130,4,0,192,130,0,130,0,
+ 4,198,103,192,130,0,130,0,0,208,130,11,0,208,130,0,131,0,130,14,131,0,
+};
+static const jj_sprite jj_coin_4 = {11,11,jj_coin_4_palette,jj_coin_4_rows,jj_coin_4_data,4};
+static const uint16_t jj_coin_5_palette[] = {
+ 0x0,0xffef,0xfeef,0xedaa,0xd548,0xec68,0xcc46,0xc405,0x9be1,0xb343,0x9aa1,0x9240,0x99c0,0x6060,0x0,0x0,
+};
+static const uint16_t jj_coin_5_rows[] = {
+ 0,8,16,23,30,37,44,53,60,67,75,83,
+};
+static const uint8_t jj_coin_5_data[] = {
+ 131,0,130,3,0,96,130,0,130,0,4,116,17,48,130,0,10,0,167,162,17,64,0,10,
+ 0,180,115,17,48,0,10,0,183,115,18,64,0,10,0,183,148,34,64,0,2,0,176,130,
+ 6,4,35,96,0,10,0,185,116,54,160,0,10,0,187,164,121,176,0,130,0,4,167,122,
+ 160,130,0,131,0,0,144,130,11,130,0,
+};
+static const jj_sprite jj_coin_5 = {11,11,jj_coin_5_palette,jj_coin_5_rows,jj_coin_5_data,4};
+static const uint16_t jj_coin_6_palette[] = {
+ 0x0,0xff93,0xfeef,0xf68d,0xf60b,0xe58a,0xdce7,0xcc66,0xc405,0xbba4,0xab02,0xa2a1,0xd8c5,0x8b20,0x9200,0x2860,
+};
+static const uint16_t jj_coin_6_rows[] = {
+ 0,8,15,22,30,37,46,53,60,67,74,82,
+};
+static const uint8_t jj_coin_6_data[] = {
+ 130,0,4,133,86,144,130,0,10,0,133,49,18,144,0,10,9,119,68,17,59,0,2,8,
+ 96,131,2,3,19,128,10,8,163,33,34,70,0,4,7,164,32,130,3,2,86,0,10,7,
+ 163,35,68,104,0,10,8,120,85,70,154,0,10,11,106,150,74,190,0,10,0,150,116,158,
+ 224,0,130,0,4,184,174,224,130,0,
+};
+static const jj_sprite jj_coin_6 = {11,11,jj_coin_6_palette,jj_coin_6_rows,jj_coin_6_data,4};
+static const uint16_t jj_coin_7_palette[] = {
+ 0x0,0xfff6,0xff94,0xff6e,0xfeef,0xf6ad,0xf64c,0xf60b,0xe5ca,0xdd6a,0xcca7,0xc405,0xab23,0xaa20,0x89a0,0x2020,
+};
+static const uint16_t jj_coin_7_rows[] = {
+ 0,7,14,21,29,38,45,52,59,66,73,80,
+};
+static const uint8_t jj_coin_7_data[] = {
+ 10,0,218,153,170,176,0,10,12,99,66,18,91,0,10,9,36,33,65,22,0,3,196,116,
+ 130,1,3,65,59,0,160,130,6,6,36,20,69,176,10,168,85,67,39,71,176,10,168,180,
+ 18,87,105,176,10,197,200,100,103,139,192,10,9,109,169,151,188,0,10,14,133,136,123,205,
+ 0,10,0,235,170,206,208,0,
+};
+static const jj_sprite jj_coin_7 = {11,11,jj_coin_7_palette,jj_coin_7_rows,jj_coin_7_data,4};
+static const uint16_t jj_shield_palette[] = {
+ 0x0,0xbedb,0x565c,0xd7d,0x151a,0x55c,0x53c,0x51b,0x6c12,0x5b8f,0xcb8,0x3bd2,0x4b9,0x498,0x458,0x636e,0x634d,0x5aaa,0x5a48,0x4985,0x0,0x0,0x1800,0x0,
+};
+static const uint16_t jj_shield_rows[] = {
+ 0,2,4,15,31,48,67,86,105,124,143,162,181,199,216,231,242,244,246,
+};
+static const uint8_t jj_shield_data[] = {
+ 145,0,145,0,133,0,5,17,15,8,8,15,17,133,0,5,0,0,17,9,15,8,133,2,
+ 5,8,15,9,16,0,0,2,0,0,15,131,2,3,4,12,6,3,131,2,2,9,0,0,
+ 4,0,0,15,4,3,130,14,9,12,6,6,7,6,3,4,9,0,0,17,0,0,15,4,
+ 12,14,12,13,12,6,5,5,6,5,12,9,0,0,17,0,0,15,4,4,14,13,13,12,
+ 6,5,5,6,3,4,9,0,0,17,0,0,15,4,4,14,13,13,12,6,5,5,6,3,
+ 4,9,0,0,17,0,0,15,4,4,14,13,13,12,6,5,5,6,3,4,9,0,0,17,
+ 0,0,15,4,4,14,13,13,12,6,5,5,6,3,12,9,0,0,4,0,0,16,11,7,
+ 130,13,9,12,6,5,6,6,3,14,15,0,0,130,0,14,9,14,4,12,13,13,7,6,
+ 5,3,14,11,17,0,0,130,0,11,17,8,14,13,12,12,5,3,5,14,11,16,130,0,
+ 131,0,9,17,9,11,14,14,12,14,11,9,16,131,0,133,0,1,16,15,130,9,0,16,
+ 133,0,145,0,145,0,
+};
+static const jj_sprite jj_shield = {18,18,jj_shield_palette,jj_shield_rows,jj_shield_data,8};
+static const uint16_t jj_missile_palette[] = {
+ 0x0,0xffff,0xfffc,0xe758,0xff14,0xb5f4,0xfd70,0x94f2,0xfbac,0xfa48,0x6bcf,0x52cd,0xe0e5,0xb802,0x8801,0x39ab,0x20c9,0x0,
+};
+static const uint16_t jj_missile_rows[] = {
+ 0,2,4,10,20,31,44,64,83,102,122,146,171,194,216,236,254,273,283,294,304,310,312,314,
+};
+static const uint8_t jj_missile_data[] = {
+ 155,0,155,0,144,0,131,13,134,0,143,0,0,13,130,4,0,13,134,0,141,0,1,13,
+ 8,131,9,0,13,134,0,137,0,130,15,0,13,133,12,1,13,15,133,0,131,0,6,13,
+ 13,12,9,8,8,3,137,5,6,3,16,10,5,5,11,0,131,0,5,12,8,6,6,4,
+ 4,138,2,6,3,15,5,2,1,11,0,130,0,6,13,8,6,4,4,6,6,139,3,5,
+ 15,3,1,1,11,0,4,0,0,13,8,8,132,9,0,5,137,7,6,5,11,5,3,1,
+ 11,0,5,0,14,12,8,9,9,130,12,1,9,7,130,10,134,13,6,5,11,5,3,1,
+ 11,0,3,0,14,12,9,133,12,5,7,10,10,13,9,9,131,4,7,13,7,11,7,5,
+ 2,11,0,4,0,14,12,9,12,131,13,1,12,10,130,11,134,14,6,10,11,7,7,3,
+ 11,0,5,0,0,14,9,12,12,130,13,1,12,7,137,11,6,7,11,7,5,3,11,0,
+ 130,0,2,14,8,8,131,9,0,5,137,7,6,5,15,5,2,2,11,0,131,0,1,12,
+ 9,130,8,0,9,139,5,5,15,5,3,2,11,0,131,0,5,14,14,12,9,9,12,138,
+ 7,6,5,16,11,7,7,15,0,137,0,130,16,135,14,0,15,133,0,141,0,1,14,12,
+ 131,13,0,14,134,0,143,0,0,14,130,9,0,14,134,0,144,0,131,14,134,0,155,0,
+ 155,0,
+};
+static const jj_sprite jj_missile = {28,23,jj_missile_palette,jj_missile_rows,jj_missile_data,8};
+static const uint16_t jj_zapper_cap_palette[] = {
+ 0x0,0xe737,0xad74,0xacf2,0x8cb2,0xb3ce,0x7bf0,0x6b8e,0x4b4d,0xc1e6,0x5aec,0x52ab,0x52ac,0x4a6b,0x422a,0x39c9,0x21aa,0xc841,0x6004,0x20c7,0x2801,0x9,0x0,0x0,
+};
+static const uint16_t jj_zapper_cap_rows[] = {
+ 0,2,4,6,19,34,49,65,81,97,112,126,139,141,143,145,
+};
+static const uint8_t jj_zapper_cap_data[] = {
+ 142,0,142,0,142,0,130,0,1,14,12,130,10,2,6,2,7,131,0,3,0,0,12,4,
+ 130,2,4,4,2,1,3,17,130,0,2,0,14,4,131,2,7,4,3,1,3,5,9,0,
+ 0,3,0,12,4,7,130,12,7,7,4,2,5,5,9,0,0,2,0,12,7,130,14,8,
+ 15,10,6,2,6,17,9,0,0,3,0,13,7,13,130,14,7,12,7,4,7,17,9,0,
+ 0,3,0,15,7,7,131,12,6,7,4,5,9,9,0,0,2,0,0,14,131,6,4,7,
+ 6,1,5,9,130,0,130,0,7,15,13,10,10,12,7,4,10,131,0,142,0,142,0,142,
+ 0,
+};
+static const jj_sprite jj_zapper_cap = {15,15,jj_zapper_cap_palette,jj_zapper_cap_rows,jj_zapper_cap_data,8};
+static const uint16_t jj_beam_h_0_palette[] = {
+ 0x0,0xffdd,0xffdc,0xffdc,0xfff9,0xfff0,0xffe5,0xff45,0xfde1,0xfce0,0xfc00,0xfba0,0xf420,0xfac0,0x0,0x0,
+};
+static const uint16_t jj_beam_h_0_rows[] = {
+ 0,2,4,23,50,83,112,151,187,217,231,
+};
+static const uint8_t jj_beam_h_0_data[] = {
+ 185,0,185,0,134,0,0,160,145,0,0,160,141,0,0,160,131,0,2,169,144,136,0,133,
+ 0,2,168,144,130,0,1,169,134,0,6,169,0,152,160,139,0,11,168,154,169,135,139,153,
+ 133,0,132,0,8,168,119,137,135,128,133,0,11,168,137,135,104,186,154,132,0,8,169,152,
+ 103,136,112,130,6,5,135,120,154,130,0,131,9,1,136,134,6,7,121,154,169,152,134,6,
+ 3,136,120,131,9,4,136,118,96,137,5,6,102,120,137,144,131,7,2,101,80,133,4,1,
+ 85,132,7,1,102,130,5,0,64,130,5,130,6,130,7,0,96,130,5,1,68,130,3,131,
+ 1,9,35,52,69,86,103,1,85,130,4,0,48,135,1,1,52,132,5,1,67,131,1,0,
+ 48,135,4,1,51,131,1,1,34,131,3,1,34,131,1,0,48,130,4,132,1,0,32,135,
+ 3,0,32,134,1,0,32,131,3,0,32,136,1,0,32,132,3,134,2,131,3,0,32,130,
+ 1,133,3,135,2,135,3,133,2,136,3,144,2,131,3,
+};
+static const jj_sprite jj_beam_h_0 = {58,10,jj_beam_h_0_palette,jj_beam_h_0_rows,jj_beam_h_0_data,4};
+static const uint16_t jj_beam_v_0_palette[] = {
+ 0x0,0xffdd,0xffdd,0xffdc,0xffdc,0xffdc,0xfff2,0xff83,0xeff0,0xfe01,0xfce0,0xfc20,0xfba0,0xfb60,0x0,0x0,
+};
+static const uint16_t jj_beam_v_0_rows[] = {
+ 0,6,12,18,24,30,36,42,49,56,63,70,76,82,88,95,102,109,116,123,129,136,143,149,
+ 155,161,167,173,179,185,191,197,203,209,215,221,227,233,240,247,254,260,266,273,280,286,292,298,
+ 304,310,316,322,328,334,340,347,353,359,365,371,378,384,391,397,403,409,415,421,427,433,439,
+};
+static const uint8_t jj_beam_v_0_data[] = {
+ 132,0,4,183,98,64,132,0,4,167,98,64,132,0,4,151,65,64,131,0,5,185,133,20,
+ 131,0,5,183,133,51,131,0,5,167,98,67,131,0,5,151,97,67,130,0,6,167,133,20,
+ 48,130,0,6,151,132,20,48,130,0,6,185,133,52,48,130,0,3,185,133,130,3,5,0,
+ 169,120,131,3,9,0,167,120,20,51,9,0,185,118,20,51,130,0,6,167,97,67,48,130,
+ 0,6,167,98,67,48,130,0,6,185,131,67,48,130,0,3,185,133,130,3,130,0,6,167,
+ 133,52,48,9,0,185,120,65,67,130,0,6,167,132,20,48,130,0,6,201,117,20,48,131,
+ 0,5,167,97,67,131,0,5,183,98,67,131,0,5,185,133,51,132,0,4,152,83,64,132,
+ 0,4,152,65,64,132,0,4,167,65,64,132,0,4,167,66,64,132,0,4,167,98,64,132,
+ 0,4,167,98,64,132,0,4,167,97,64,131,0,5,169,118,20,131,0,5,167,118,20,131,
+ 0,5,185,116,20,131,0,5,201,132,20,131,0,5,167,132,52,130,0,6,151,118,20,48,
+ 130,0,6,151,118,20,48,130,0,6,183,118,20,48,131,0,5,151,97,67,131,0,5,167,
+ 97,67,130,0,3,185,120,130,3,130,0,6,169,120,65,64,131,0,5,167,116,20,131,0,
+ 5,185,118,20,132,0,4,167,97,64,132,0,4,183,98,64,132,0,4,183,98,64,132,0,
+ 4,183,98,64,132,0,4,183,98,64,132,0,4,167,66,64,132,0,4,168,67,64,131,0,
+ 5,167,97,67,130,0,6,167,118,20,48,131,0,5,151,81,67,131,0,5,167,65,67,131,
+ 0,5,167,65,67,131,0,5,152,81,67,130,0,6,167,117,20,48,9,0,185,119,97,67,
+ 130,0,6,169,118,20,48,131,0,5,167,97,67,131,0,5,185,132,52,132,0,4,167,65,
+ 64,132,0,4,167,66,64,132,0,4,167,98,64,132,0,4,183,98,64,132,0,4,183,98,
+ 64,132,0,4,183,98,64,
+};
+static const jj_sprite jj_beam_v_0 = {10,70,jj_beam_v_0_palette,jj_beam_v_0_rows,jj_beam_v_0_data,4};
+static const uint16_t jj_beam_c_0_palette[] = {
+ 0x0,0xffdd,0xffdc,0xffdc,0xffdd,0xffd3,0xff84,0xfff2,0xdfe7,0xfde1,0xfce0,0xfc20,0xfba0,0xfb20,0x0,0x0,
+};
+static const uint16_t jj_beam_c_0_rows[] = {
+ 0,6,12,18,24,30,36,42,48,54,60,67,74,81,88,95,102,108,115,121,127,134,141,148,
+ 155,162,169,176,182,188,195,202,208,214,220,227,233,239,245,251,257,263,269,275,281,287,293,299,
+ 305,311,317,323,329,335,342,348,355,362,368,374,380,386,393,400,406,412,418,424,430,436,442,448,
+ 454,460,466,472,479,485,492,499,505,511,517,523,529,536,543,549,556,563,570,576,582,588,594,600,
+ 606,612,618,624,630,
+};
+static const uint8_t jj_beam_c_0_data[] = {
+ 132,0,4,182,81,48,132,0,4,166,81,48,132,0,4,166,81,48,132,0,4,152,49,48,
+ 132,0,4,152,49,48,131,0,5,185,115,67,131,0,5,182,115,34,131,0,5,166,84,50,
+ 131,0,5,166,81,50,131,0,5,152,81,50,130,0,6,182,131,19,32,130,0,6,166,131,
+ 19,32,130,0,6,150,115,67,32,130,0,6,185,115,35,32,130,0,3,201,115,130,2,130,
+ 0,2,166,112,131,2,5,0,166,135,131,2,6,0,166,135,64,130,2,9,0,182,135,19,
+ 34,9,0,185,103,19,34,130,0,6,150,113,50,32,130,0,6,166,113,50,32,130,0,6,
+ 166,116,50,32,130,0,6,185,114,50,32,130,0,3,185,115,130,2,130,0,3,185,115,130,
+ 2,130,0,6,166,115,35,32,9,0,185,103,52,50,9,0,185,104,52,50,130,0,6,166,
+ 131,19,32,130,0,6,201,131,19,32,131,0,5,152,81,50,131,0,5,166,81,50,131,0,
+ 5,166,116,50,131,0,2,182,112,130,2,131,0,5,185,115,34,132,0,4,151,50,48,132,
+ 0,4,152,52,48,132,0,4,152,49,48,132,0,4,168,49,48,132,0,4,166,52,48,132,
+ 0,4,166,81,48,132,0,4,166,81,48,132,0,4,166,81,48,132,0,4,166,81,48,131,
+ 0,5,185,101,19,131,0,5,169,133,19,131,0,5,166,133,19,131,0,5,166,133,19,131,
+ 0,5,185,131,19,131,0,5,201,131,19,131,0,5,182,115,67,131,0,5,150,115,34,130,
+ 0,6,150,135,19,32,9,0,185,136,81,50,130,0,6,166,133,19,32,130,0,6,182,133,
+ 19,32,131,0,5,152,81,50,131,0,5,166,81,50,131,0,5,166,81,50,131,0,5,150,
+ 116,34,130,0,6,166,135,50,48,130,0,6,185,136,52,48,131,0,5,166,133,19,131,0,
+ 5,185,133,19,132,0,4,150,81,48,132,0,4,166,81,48,132,0,4,166,116,48,132,0,
+ 4,182,116,48,132,0,4,182,116,48,132,0,4,182,84,48,132,0,4,182,84,48,132,0,
+ 4,182,81,48,132,0,4,166,81,48,132,0,4,168,52,48,131,0,2,201,112,130,2,131,
+ 0,5,166,113,50,130,0,6,166,133,19,32,130,0,6,182,133,19,32,131,0,5,152,49,
+ 50,131,0,5,152,49,50,131,0,5,168,49,50,131,0,5,152,49,50,131,0,5,152,49,
+ 50,130,0,6,185,131,19,32,130,0,6,166,133,19,32,9,0,185,136,81,50,130,0,6,
+ 166,133,19,32,130,0,6,185,101,19,32,131,0,2,166,112,130,2,131,0,5,185,115,35,
+ 132,0,4,152,49,48,132,0,4,168,49,48,132,0,4,166,52,48,132,0,4,166,81,48,
+ 132,0,4,166,81,48,132,0,4,182,81,48,132,0,4,182,81,48,132,0,4,182,84,48,
+ 132,0,4,166,84,48,
+};
+static const jj_sprite jj_beam_c_0 = {10,100,jj_beam_c_0_palette,jj_beam_c_0_rows,jj_beam_c_0_data,4};
+static const uint16_t jj_beam_h_1_palette[] = {
+ 0x0,0xffdd,0xffdd,0xffdc,0xfff6,0xfff0,0xffe7,0xff45,0xfde1,0xfd20,0xfc80,0xfc00,0xfba0,0xeb20,0xf800,0x0,
+};
+static const uint16_t jj_beam_h_1_rows[] = {
+ 0,29,63,96,132,164,184,186,188,190,192,
+};
+static const uint8_t jj_beam_h_1_data[] = {
+ 130,3,1,18,136,1,2,34,16,131,3,1,18,130,1,2,34,16,130,3,1,17,130,2,
+ 144,1,3,34,19,131,5,5,67,18,33,130,2,2,52,64,133,5,0,64,130,3,1,68,
+ 134,5,1,68,130,3,0,16,137,2,3,19,68,130,5,16,153,136,118,84,67,52,85,102,
+ 128,130,9,11,136,118,86,103,103,137,130,8,2,118,96,131,5,136,4,6,85,103,137,144,
+ 130,0,1,186,130,7,130,6,5,120,135,138,131,0,8,202,135,137,152,144,131,0,8,186,
+ 135,103,136,112,133,6,8,119,103,154,192,0,132,0,130,9,2,120,160,130,11,1,154,134,
+ 0,1,170,130,0,0,160,135,0,15,168,144,9,118,135,121,169,137,132,0,134,0,1,170,
+ 156,0,0,160,131,0,4,153,201,144,130,0,0,160,133,0,185,0,185,0,185,0,185,0,
+};
+static const jj_sprite jj_beam_h_1 = {58,10,jj_beam_h_1_palette,jj_beam_h_1_rows,jj_beam_h_1_data,4};
+static const uint16_t jj_beam_v_1_palette[] = {
+ 0x0,0xffdd,0xffdc,0xffdd,0xfff7,0xffe9,0xff24,0xfdc0,0xfd20,0xfc80,0xff91,0xe788,0xfbe0,0xf340,0xf800,0x0,
+};
+static const uint16_t jj_beam_v_1_rows[] = {
+ 0,5,10,15,20,25,30,36,42,48,54,60,66,72,78,84,90,96,102,108,114,119,125,131,
+ 137,143,149,154,159,164,169,174,179,184,189,194,200,205,210,215,221,227,233,238,243,248,253,258,
+ 263,268,273,278,284,290,296,302,308,314,320,326,332,338,344,350,356,361,366,371,376,381,386,
+};
+static const uint8_t jj_beam_v_1_data[] = {
+ 2,37,128,134,0,2,42,112,134,0,2,26,112,134,0,3,58,124,133,0,3,52,105,133,
+ 0,3,20,87,133,0,4,18,86,128,132,0,5,34,165,121,131,0,4,33,166,128,132,0,
+ 4,35,70,144,132,0,4,35,70,144,132,0,4,33,69,128,132,0,5,33,69,104,131,0,
+ 5,33,69,103,131,0,5,33,69,108,131,0,5,33,69,108,131,0,5,33,69,87,131,0,
+ 5,33,165,104,131,0,4,33,165,112,132,0,4,35,167,192,132,0,3,35,167,133,0,4,
+ 34,167,192,132,0,4,34,166,128,132,0,5,18,85,105,131,0,4,18,86,128,132,0,4,
+ 20,87,192,132,0,3,52,104,133,0,3,52,105,133,0,3,58,124,133,0,2,58,112,134,
+ 0,2,42,112,134,0,2,37,112,134,0,2,37,112,134,0,3,42,124,133,0,3,42,104,
+ 133,0,4,42,86,144,132,0,3,26,103,133,0,3,52,104,133,0,3,20,88,133,0,4,
+ 18,87,192,132,0,4,18,86,144,132,0,4,18,86,128,132,0,3,52,105,133,0,3,58,
+ 124,133,0,2,42,112,134,0,2,37,112,134,0,2,37,112,134,0,2,37,128,134,0,2,
+ 37,128,134,0,2,42,112,134,0,3,42,105,133,0,4,26,86,128,132,0,4,20,86,128,
+ 132,0,4,34,86,192,132,0,4,35,167,192,132,0,4,35,70,192,132,0,4,35,70,192,
+ 132,0,4,35,69,128,132,0,4,33,69,112,132,0,5,33,69,105,131,0,5,33,69,120,
+ 131,0,4,35,166,144,132,0,4,34,166,112,132,0,4,20,86,128,132,0,3,52,104,133,
+ 0,3,58,105,133,0,3,42,124,133,0,2,37,112,134,0,2,37,128,134,0,2,37,128,
+ 134,0,
+};
+static const jj_sprite jj_beam_v_1 = {10,70,jj_beam_v_1_palette,jj_beam_v_1_rows,jj_beam_v_1_data,4};
+static const uint16_t jj_beam_c_1_palette[] = {
+ 0x0,0xffdd,0xffdc,0xffdd,0xfff6,0xffe7,0xff04,0xfdc1,0xfd20,0xfc60,0xffd4,0xdf67,0xfbe0,0xec00,0xeb40,0x0,
+};
+static const uint16_t jj_beam_c_1_rows[] = {
+ 0,5,10,15,20,25,30,35,40,46,52,58,64,70,76,82,88,94,100,107,113,119,125,131,
+ 137,144,150,156,162,167,172,178,184,190,196,202,208,214,219,224,229,234,239,244,249,254,259,264,
+ 269,274,280,286,292,297,302,307,312,318,324,330,336,341,346,351,356,361,366,371,376,381,386,391,
+ 396,401,407,413,419,425,431,437,443,449,455,461,467,473,479,485,491,497,503,509,515,520,525,530,
+ 535,540,545,550,555,
+};
+static const uint8_t jj_beam_c_1_data[] = {
+ 2,37,128,134,0,2,37,128,134,0,2,42,112,134,0,2,26,112,134,0,3,58,124,133,
+ 0,3,58,105,133,0,3,52,105,133,0,3,20,88,133,0,4,18,87,192,132,0,4,18,
+ 86,128,132,0,5,34,85,121,131,0,5,34,165,124,131,0,4,33,165,128,132,0,4,35,
+ 70,128,132,0,4,35,70,144,132,0,4,35,69,128,132,0,4,33,69,112,132,0,5,33,
+ 69,105,131,0,6,33,69,87,144,130,0,5,33,69,88,131,0,5,33,69,105,131,0,5,
+ 33,69,124,131,0,5,33,69,105,131,0,5,33,165,87,131,0,6,33,165,87,192,130,0,
+ 5,33,165,105,131,0,4,33,165,128,132,0,4,35,166,144,132,0,3,35,167,133,0,3,
+ 35,167,133,0,4,34,167,192,132,0,4,34,166,144,132,0,4,34,165,112,132,0,5,18,
+ 85,105,131,0,5,18,85,124,131,0,4,18,86,144,132,0,4,20,87,192,132,0,3,20,
+ 88,133,0,3,52,105,133,0,3,58,105,133,0,3,58,124,133,0,3,58,124,133,0,2,
+ 58,112,134,0,2,26,112,134,0,2,42,112,134,0,2,37,128,134,0,2,37,128,134,0,
+ 3,42,124,133,0,3,42,105,133,0,4,42,104,192,132,0,4,42,86,128,132,0,4,26,
+ 87,144,132,0,3,26,88,133,0,3,52,104,133,0,3,52,88,133,0,3,20,87,133,0,
+ 4,18,87,192,132,0,4,18,86,144,132,0,4,18,86,128,132,0,4,18,87,144,132,0,
+ 3,52,88,133,0,3,58,105,133,0,3,58,124,133,0,2,42,112,134,0,2,37,112,134,
+ 0,2,37,112,134,0,2,37,128,134,0,2,37,128,134,0,2,37,128,134,0,2,37,128,
+ 134,0,2,42,112,134,0,3,42,121,133,0,3,26,104,133,0,4,26,86,128,132,0,4,
+ 20,86,128,132,0,4,18,86,144,132,0,4,34,166,144,132,0,4,34,167,192,132,0,4,
+ 35,167,192,132,0,4,35,70,192,132,0,4,35,70,192,132,0,4,35,69,144,132,0,4,
+ 33,37,128,132,0,4,33,37,112,132,0,5,33,69,108,131,0,5,33,69,88,131,0,5,
+ 33,69,121,131,0,4,35,166,144,132,0,4,34,166,144,132,0,4,34,85,112,132,0,4,
+ 18,86,112,132,0,4,20,87,192,132,0,3,52,105,133,0,3,58,105,133,0,3,42,124,
+ 133,0,2,42,112,134,0,2,37,112,134,0,2,37,128,134,0,2,37,128,134,0,2,37,
+ 128,134,0,
+};
+static const jj_sprite jj_beam_c_1 = {10,100,jj_beam_c_1_palette,jj_beam_c_1_rows,jj_beam_c_1_data,4};
+static const uint16_t jj_beam_h_2_palette[] = {
+ 0x0,0xffc8,0xff86,0xffe0,0xff05,0xfe63,0xfd82,0xfce0,0xfc40,0xfc00,0xfba0,0xfa40,0x840,0xf801,0x0,0x0,
+};
+static const uint16_t jj_beam_h_2_rows[] = {
+ 0,6,25,52,87,120,146,153,155,169,198,
+};
+static const uint8_t jj_beam_h_2_data[] = {
+ 174,0,0,128,137,0,134,0,1,120,144,0,0,112,141,0,10,119,0,135,86,7,112,133,
+ 0,133,0,7,116,71,135,86,134,0,9,102,7,81,96,8,135,0,13,134,37,102,82,20,
+ 101,87,132,0,131,0,1,118,130,2,5,20,33,71,131,0,30,134,66,66,36,38,101,120,
+ 8,135,101,65,33,18,36,116,16,130,2,4,86,120,0,130,5,11,68,18,0,66,69,20,
+ 131,5,25,65,70,36,0,65,33,37,84,66,17,37,5,86,131,0,8,86,4,33,20,80,
+ 131,2,1,69,134,0,0,80,132,1,1,37,134,0,10,84,100,17,34,69,96,142,0,3,
+ 84,34,141,0,3,101,102,167,0,185,0,1,102,143,0,130,6,137,0,1,102,149,0,130,
+ 6,0,16,130,2,0,80,138,0,6,66,33,34,64,130,0,5,102,5,33,130,2,0,80,
+ 144,0,4,82,33,16,
+};
+static const jj_sprite jj_beam_h_2 = {58,10,jj_beam_h_2_palette,jj_beam_h_2_rows,jj_beam_h_2_data,4};
+static const uint16_t jj_beam_v_2_palette[] = {
+ 0x0,0xffc7,0xff66,0xffe0,0xfee4,0xfe03,0xfd41,0xfc80,0xfc00,0xfba0,0xfaa0,0xf860,0x0,0x0,0x0,0x0,
+};
+static const uint16_t jj_beam_v_2_rows[] = {
+ 0,6,12,19,26,35,43,49,55,60,66,72,77,82,87,92,97,103,109,115,120,125,131,137,
+ 144,151,158,167,176,184,192,199,206,213,221,230,237,245,252,257,263,269,275,283,291,299,306,313,
+ 319,325,331,337,344,351,357,363,369,375,381,387,393,398,404,410,417,426,435,443,449,455,461,
+};
+static const uint8_t jj_beam_v_2_data[] = {
+ 131,0,5,66,0,81,131,0,5,66,0,81,130,0,6,114,32,6,16,130,0,6,97,64,
+ 6,16,130,0,2,81,80,130,0,0,32,130,0,1,65,131,0,0,64,4,0,114,64,132,
+ 0,4,0,81,96,132,0,3,7,66,133,0,4,0,81,80,132,0,4,0,97,80,132,0,
+ 3,5,34,133,0,3,117,23,133,0,3,6,20,133,0,3,7,34,133,0,3,0,81,133,
+ 0,4,0,81,80,132,0,4,0,97,80,132,0,4,0,81,80,132,0,3,6,34,133,0,
+ 3,7,66,133,0,4,0,97,64,132,0,4,0,132,32,132,0,130,0,2,81,96,131,0,
+ 130,0,2,81,80,131,0,130,0,2,97,64,131,0,130,0,2,114,32,130,0,0,80,130,
+ 0,2,116,32,130,0,0,64,131,0,1,65,130,0,0,32,131,0,1,81,130,0,0,32,
+ 130,0,6,116,16,6,16,130,0,6,114,32,6,16,130,0,6,97,64,6,16,5,0,117,
+ 22,130,0,0,32,130,0,2,97,64,130,0,0,80,130,0,2,97,64,131,0,4,0,114,
+ 32,131,0,0,96,3,7,66,132,0,0,80,3,6,36,133,0,4,0,81,96,132,0,4,
+ 0,114,64,132,0,130,0,1,66,132,0,4,0,98,64,131,0,0,80,4,0,81,80,131,
+ 0,0,32,4,0,116,16,131,0,0,32,130,0,6,97,64,6,16,130,0,6,116,32,6,
+ 16,131,0,5,65,0,97,131,0,5,81,96,2,131,0,5,81,80,2,131,0,5,81,80,
+ 5,131,0,2,81,80,130,0,130,0,3,116,22,130,0,5,0,100,20,131,0,4,0,81,
+ 64,132,0,4,0,97,80,132,0,4,0,114,32,132,0,4,0,114,32,132,0,4,0,97,
+ 64,132,0,4,0,81,80,132,0,3,6,34,133,0,4,0,81,80,132,0,4,0,116,16,
+ 132,0,130,0,2,97,80,131,0,130,0,2,114,64,130,0,0,80,130,0,2,132,32,130,
+ 0,0,32,131,0,1,66,130,0,0,32,131,0,5,82,0,97,131,0,5,81,0,97,131,
+ 0,5,82,0,97,
+};
+static const jj_sprite jj_beam_v_2 = {10,70,jj_beam_v_2_palette,jj_beam_v_2_rows,jj_beam_v_2_data,4};
+static const uint16_t jj_beam_c_2_palette[] = {
+ 0x0,0xffe1,0xfea4,0xfcc0,0xfc00,0xfee5,0xfd81,0xf7a7,0xff05,0xfb80,0xfae0,0xf980,0xf801,0x0,0x0,0x0,
+};
+static const uint16_t jj_beam_c_2_rows[] = {
+ 0,6,12,19,26,33,42,51,59,67,73,79,84,89,95,101,107,112,117,122,127,132,137,142,
+ 148,154,160,166,171,176,181,187,193,199,205,212,219,226,235,244,253,262,270,278,285,292,299,306,
+ 314,323,332,339,346,354,362,369,374,380,386,392,398,406,414,422,430,437,444,451,457,465,471,477,
+ 483,489,496,503,510,516,522,528,534,540,546,552,558,564,569,574,580,586,592,599,608,617,626,634,
+ 642,648,654,660,666,
+};
+static const uint8_t jj_beam_c_2_data[] = {
+ 131,0,5,39,0,103,131,0,5,39,0,103,130,0,6,72,128,6,112,130,0,6,55,128,
+ 6,112,130,0,6,103,80,6,112,130,0,2,103,32,130,0,0,112,130,0,2,103,96,130,
+ 0,0,112,130,0,1,39,131,0,0,80,4,0,72,112,131,0,0,96,4,0,55,80,132,
+ 0,4,0,103,96,132,0,3,3,39,133,0,3,3,135,133,0,4,0,103,32,132,0,4,
+ 0,103,80,132,0,4,4,103,96,132,0,3,54,120,133,0,3,50,115,133,0,3,6,118,
+ 133,0,3,6,114,133,0,3,3,136,133,0,3,3,39,133,0,3,0,39,133,0,4,0,
+ 103,96,132,0,4,0,103,32,132,0,4,0,103,32,132,0,4,0,103,32,132,0,3,6,
+ 135,133,0,3,3,120,133,0,3,0,39,133,0,4,0,103,32,132,0,4,0,56,128,132,
+ 0,130,0,1,87,132,0,130,0,1,39,132,0,130,0,2,103,96,131,0,130,0,2,103,
+ 32,131,0,130,0,2,103,80,131,0,130,0,2,55,128,130,0,0,96,130,0,2,56,128,
+ 130,0,0,32,130,0,2,56,112,130,0,0,80,130,0,2,66,112,130,0,0,128,131,0,
+ 1,39,130,0,0,112,131,0,1,39,130,0,0,112,130,0,6,66,112,6,112,130,0,6,
+ 53,112,6,112,130,0,6,55,128,6,112,130,0,6,103,32,6,112,5,0,50,118,130,0,
+ 0,112,130,0,2,103,32,130,0,0,80,130,0,2,103,80,130,0,0,96,130,0,2,103,
+ 80,131,0,130,0,2,39,96,131,0,4,0,55,128,131,0,0,96,4,3,135,48,131,0,
+ 0,96,3,6,117,132,0,0,96,3,4,135,133,0,4,0,103,96,132,0,4,0,55,32,
+ 132,0,4,0,72,128,132,0,130,0,1,87,132,0,4,0,56,80,131,0,0,96,4,0,
+ 103,48,131,0,0,128,4,0,103,32,131,0,0,112,4,0,50,112,131,0,0,112,130,0,
+ 6,103,32,6,112,130,0,6,56,128,6,112,130,0,6,69,112,6,112,131,0,5,39,0,
+ 103,131,0,1,39,130,0,0,112,131,0,5,39,96,7,131,0,5,39,96,8,131,0,5,
+ 103,96,8,131,0,5,103,96,6,131,0,2,39,96,130,0,130,0,3,50,118,130,0,130,
+ 0,2,56,112,131,0,5,0,50,114,131,0,4,0,39,128,132,0,4,0,103,96,132,0,
+ 4,0,103,80,132,0,4,0,55,128,132,0,4,0,56,128,132,0,4,0,56,128,132,0,
+ 4,0,55,128,132,0,4,0,103,32,132,0,3,3,87,133,0,3,6,120,133,0,4,3,
+ 39,96,132,0,4,0,103,128,132,0,5,0,66,118,131,0,130,0,2,103,32,131,0,130,
+ 0,2,55,80,130,0,0,96,130,0,2,56,128,130,0,0,32,130,0,2,69,128,130,0,
+ 0,128,131,0,1,39,130,0,0,112,131,0,1,39,130,0,0,112,131,0,5,39,0,103,
+ 131,0,5,39,0,103,131,0,5,39,0,103,131,0,5,39,0,103,
+};
+static const jj_sprite jj_beam_c_2 = {10,100,jj_beam_c_2_palette,jj_beam_c_2_rows,jj_beam_c_2_data,4};
+static const uint16_t jj_flash_0_palette[] = {
+ 0x0,0xffff,0xfffd,0xffe8,0xffc8,0xff87,0xfee4,0xfe83,0xfde2,0xfd61,0xfd41,0xfd41,0xfd41,0xfd41,0xfd41,0x0,
+};
+static const uint16_t jj_flash_0_rows[] = {
+ 0,2,4,6,8,10,12,18,24,32,41,50,61,71,81,88,90,
+};
+static const uint8_t jj_flash_0_data[] = {
+ 141,0,141,0,141,0,141,0,141,0,141,0,132,0,0,176,135,0,132,0,1,217,134,0,
+ 132,0,5,118,192,7,130,0,130,0,7,204,98,221,119,130,0,10,0,215,115,19,53,208,
+ 130,0,130,0,1,83,130,1,2,51,64,130,0,130,0,1,131,131,1,1,61,130,0,131,
+ 0,0,112,130,3,1,91,131,0,132,0,2,187,208,133,0,141,0,
+};
+static const jj_sprite jj_flash_0 = {14,16,jj_flash_0_palette,jj_flash_0_rows,jj_flash_0_data,4};
+static const uint16_t jj_flash_1_palette[] = {
+ 0x0,0xffff,0xfff4,0xffe8,0xffe0,0xff87,0xff25,0xfe83,0xfe02,0xfdc1,0xfd61,0xfd41,0xfd41,0xfd41,0xfd41,0x0,
+};
+static const uint16_t jj_flash_1_rows[] = {
+ 0,2,4,6,11,18,26,36,46,54,62,72,81,92,102,111,119,
+};
+static const uint8_t jj_flash_1_data[] = {
+ 141,0,141,0,141,0,138,0,2,112,0,1,11,135,0,3,120,0,1,12,134,0,4,115,
+ 192,0,2,13,96,132,0,2,147,48,130,0,3,0,54,130,13,3,131,21,130,0,13,0,
+ 113,93,211,19,125,135,13,0,211,22,49,39,115,112,0,0,130,7,131,3,5,115,22,0,
+ 10,11,49,87,118,33,48,130,0,6,0,131,18,96,130,3,0,208,130,0,130,0,0,128,
+ 132,7,1,89,130,0,130,0,10,53,157,217,83,176,0,3,0,221,133,0,3,221,0,
+};
+static const jj_sprite jj_flash_1 = {14,16,jj_flash_1_palette,jj_flash_1_rows,jj_flash_1_data,4};
+static const uint16_t jj_scientist_0_palette[] = {
+ 0x0,0xfffe,0xff36,0xc5f7,0xed90,0x8bf1,0xa2ea,0x43e9,0x4a2a,0x1a44,0x1180,0x0,
+};
+static const uint16_t jj_scientist_0_rows[] = {
+ 0,2,4,6,8,10,12,14,16,18,24,32,41,52,61,69,77,85,92,98,100,102,
+};
+static const uint8_t jj_scientist_0_data[] = {
+ 144,0,144,0,144,0,144,0,144,0,144,0,144,0,144,0,144,0,133,0,130,3,135,0,
+ 132,0,1,49,130,5,134,0,132,0,130,1,2,88,96,133,0,131,0,2,49,80,130,1,
+ 1,38,132,0,131,0,7,17,53,17,70,132,0,131,0,5,17,57,165,134,0,131,0,4,
+ 17,57,160,135,0,131,0,4,181,87,160,135,0,131,0,3,176,153,136,0,133,0,130,11,
+ 135,0,144,0,144,0,
+};
+static const jj_sprite jj_scientist_0 = {17,21,jj_scientist_0_palette,jj_scientist_0_rows,jj_scientist_0_data,4};
+static const uint16_t jj_scientist_1_palette[] = {
+ 0x0,0xfffe,0xff36,0xc5f7,0x43e9,0x8bf1,0xa2ea,0x4a2a,0x1a44,0x1180,0x0,
+};
+static const uint16_t jj_scientist_1_rows[] = {
+ 0,2,4,6,8,10,12,14,20,26,34,42,53,64,73,83,93,98,100,102,104,106,
+};
+static const uint8_t jj_scientist_1_data[] = {
+ 144,0,144,0,144,0,144,0,144,0,144,0,144,0,133,0,1,17,136,0,133,0,130,3,
+ 135,0,132,0,5,51,21,119,133,0,132,0,5,53,19,86,133,0,131,0,3,49,51,130,
+ 1,0,32,132,0,130,0,3,49,19,130,5,1,54,132,0,130,0,7,49,19,137,149,133,
+ 0,130,0,8,68,57,0,153,160,132,0,5,0,168,137,131,0,1,170,132,0,2,0,160,
+ 141,0,144,0,144,0,144,0,144,0,
+};
+static const jj_sprite jj_scientist_1 = {17,21,jj_scientist_1_palette,jj_scientist_1_rows,jj_scientist_1_data,4};
+static const uint16_t jj_scientist_2_palette[] = {
+ 0x0,0xfffe,0xff36,0xc5f7,0xed90,0x8bf1,0xa2ea,0x43e9,0x4a2a,0x1a44,0x1180,0x0,
+};
+static const uint16_t jj_scientist_2_rows[] = {
+ 0,2,4,6,8,10,12,14,16,18,24,32,41,52,62,71,79,86,93,95,97,99,
+};
+static const uint8_t jj_scientist_2_data[] = {
+ 144,0,144,0,144,0,144,0,144,0,144,0,144,0,144,0,144,0,133,0,130,3,135,0,
+ 132,0,4,49,53,80,134,0,132,0,130,1,2,88,96,133,0,130,0,3,51,21,130,1,
+ 1,38,132,0,130,0,130,1,5,51,17,70,132,0,130,0,6,81,21,154,80,134,0,131,
+ 0,4,53,151,160,135,0,131,0,3,183,121,136,0,131,0,3,187,170,136,0,144,0,144,
+ 0,144,0,
+};
+static const jj_sprite jj_scientist_2 = {17,21,jj_scientist_2_palette,jj_scientist_2_rows,jj_scientist_2_data,4};
+static const uint16_t jj_scientist_3_palette[] = {
+ 0x0,0xfffe,0xff36,0xc5f7,0xed90,0x43e9,0x8bf1,0xa2ea,0x79a5,0x4a2a,0x1a44,0x1180,0x0,
+};
+static const uint16_t jj_scientist_3_rows[] = {
+ 0,2,4,6,8,10,12,14,21,28,36,45,55,64,73,82,93,95,97,99,101,103,
+};
+static const uint8_t jj_scientist_3_data[] = {
+ 144,0,144,0,144,0,144,0,144,0,144,0,144,0,133,0,2,49,48,135,0,133,0,3,
+ 51,99,134,0,133,0,5,17,54,152,132,0,132,0,6,51,22,103,128,132,0,132,0,1,
+ 54,130,1,1,39,132,0,130,0,7,59,17,102,55,133,0,130,0,7,107,17,51,171,133,
+ 0,11,0,202,97,22,186,86,132,0,3,0,204,130,6,4,0,187,192,132,0,144,0,144,
+ 0,144,0,144,0,144,0,
+};
+static const jj_sprite jj_scientist_3 = {17,21,jj_scientist_3_palette,jj_scientist_3_rows,jj_scientist_3_data,4};
+static const uint16_t jj_warning_palette[] = {
+ 0x0,0xf286,0xd164,0xb0a1,0x8800,0x6000,0x0,
+};
+static const uint16_t jj_warning_rows[] = {
+ 0,2,4,6,8,10,17,24,34,44,54,60,66,72,74,76,78,80,82,
+};
+static const uint8_t jj_warning_data[] = {
+ 145,0,145,0,145,0,145,0,145,0,134,0,2,82,32,135,0,134,0,2,82,32,135,0,
+ 135,0,1,34,130,0,0,16,131,0,135,0,1,34,130,0,1,17,130,0,135,0,1,35,
+ 130,0,1,17,130,0,140,0,0,16,131,0,135,0,1,17,135,0,135,0,1,34,135,0,
+ 145,0,145,0,145,0,145,0,145,0,
+};
+static const jj_sprite jj_warning = {18,18,jj_warning_palette,jj_warning_rows,jj_warning_data,4};
+static const jj_sprite *const jj_barry[] = {&jj_barry_0,&jj_barry_1,&jj_barry_2,&jj_barry_3,&jj_barry_4,&jj_barry_5,&jj_barry_6,&jj_barry_7};
+static const jj_sprite *const jj_coin[] = {&jj_coin_0,&jj_coin_1,&jj_coin_2,&jj_coin_3,&jj_coin_4,&jj_coin_5,&jj_coin_6,&jj_coin_7};
+static const jj_sprite *const jj_beam_h[] = {&jj_beam_h_0,&jj_beam_h_1,&jj_beam_h_2};
+static const jj_sprite *const jj_beam_v[] = {&jj_beam_v_0,&jj_beam_v_1,&jj_beam_v_2};
+static const jj_sprite *const jj_beam_c[] = {&jj_beam_c_0,&jj_beam_c_1,&jj_beam_c_2};
+static const jj_sprite *const jj_flash[] = {&jj_flash_0,&jj_flash_1};
+static const jj_sprite *const jj_scientist[] = {&jj_scientist_0,&jj_scientist_1,&jj_scientist_2,&jj_scientist_3};
+static const uint16_t *const jj_suit_palettes[] = {jj_barry_palette_0,jj_barry_palette_1,jj_barry_palette_2,jj_barry_palette_3};
+#endif
diff --git a/games/jetpackjoyride/src/icon.png b/games/jetpackjoyride/src/icon.png
new file mode 100644
index 00000000..3962e268
Binary files /dev/null and b/games/jetpackjoyride/src/icon.png differ
diff --git a/games/jetpackjoyride/src/jetpack.h b/games/jetpackjoyride/src/jetpack.h
new file mode 100644
index 00000000..26d7c66f
--- /dev/null
+++ b/games/jetpackjoyride/src/jetpack.h
@@ -0,0 +1,45 @@
+/* SPDX-License-Identifier: GPL-3.0-only
+ * NumWorks game implementation by Bobydeluxe. Artwork credits: assets/README.md.
+ */
+#ifndef JETPACK_H
+#define JETPACK_H
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+#define JJ_Q 256
+#define JJ_TICK_MS 16
+#define JJ_SAVE_BYTES 260
+#define JJ_HAZARDS 4
+#define JJ_PICKUPS 18
+#define JJ_LIMIT 10000000u
+enum { JJ_WAIT,JJ_RUNNING,JJ_OVER };
+enum { JJ_HORIZONTAL,JJ_VERTICAL,JJ_MISSILE,JJ_COLUMN,JJ_ROTATING };
+enum { JJ_COIN,JJ_SHIELD };
+typedef struct { int32_t x; uint16_t y; uint8_t kind,timer,active; } jj_hazard;
+typedef struct { int32_t x; uint16_t y; uint8_t kind,active; } jj_pickup;
+typedef struct {
+ uint32_t best,runs,coins,dodged,wallet;
+ uint8_t owned,suit;
+} jj_stats;
+typedef struct {
+ int32_t y,vy,next;
+ uint32_t rng,tick,distance;
+ uint16_t coins,passed,events;
+ uint8_t phase,present,started,thrust,shield,invuln,reason,flash;
+ jj_hazard hazard[JJ_HAZARDS];
+ jj_pickup pickup[JJ_PICKUPS];
+} jj_game;
+void jj_new(jj_game *g,uint32_t seed);
+void jj_start(jj_game *g,jj_stats *s);
+void jj_step(jj_game *g,jj_stats *s,bool thrust);
+uint32_t jj_distance(const jj_game *g);
+int jj_speed(const jj_game *g);
+void jj_bounds(unsigned kind,int *w,int *h);
+void jj_rotor(const jj_hazard *p,uint32_t tick,int *dx,int *dy);
+bool jj_rotor_hit(const jj_hazard *p,uint32_t tick,int32_t y);
+unsigned jj_price(unsigned suit);
+bool jj_equip(jj_stats *s,unsigned suit);
+bool jj_valid(const jj_game *g,const jj_stats *s);
+void jj_encode(const jj_game *g,const jj_stats *s,uint8_t out[JJ_SAVE_BYTES]);
+bool jj_decode(jj_game *g,jj_stats *s,const uint8_t *p,size_t n);
+#endif
diff --git a/games/jetpackjoyride/src/main.c b/games/jetpackjoyride/src/main.c
new file mode 100644
index 00000000..10b23114
--- /dev/null
+++ b/games/jetpackjoyride/src/main.c
@@ -0,0 +1,130 @@
+/* SPDX-License-Identifier: GPL-3.0-only */
+#include <eadk.h>
+#include "jetpack.h"
+#include "render.h"
+#include "../../common/epsilon_app.h"
+#include "../../common/epsilon_files.h"
+#ifdef __ELF__
+const char eadk_app_name[] __attribute__((section(".rodata.eadk_app_name")))="Jetpack Joyride";
+const uint32_t eadk_api_level __attribute__((section(".rodata.eadk_api_level")))=0;
+#endif
+#define KEY(k) (UINT64_C(1)<<(k))
+static jj_game game;
+static jj_stats stats;
+static uint8_t save_data[JJ_SAVE_BYTES];
+static bool have_save,save_failed;
+static uint32_t last_checksum;
+uint32_t perf_frames,perf_max,perf_slow;
+static void push(int x,int y,int w,int h,const uint16_t *p) {
+ eadk_display_push_rect((eadk_rect_t){x,y,w,h},p);
+}
+static bool save(void) {
+ jj_encode(&game,&stats,save_data);
+ unsigned n=JJ_SAVE_BYTES-4;
+ uint32_t hash=save_data[n]|(uint32_t)save_data[n+1]<<8|(uint32_t)save_data[n+2]<<16|(uint32_t)save_data[n+3]<<24;
+ if(have_save&&hash==last_checksum&&!save_failed)return true;
+ save_failed=!ef_write("jetpackjoyride.sav",save_data,JJ_SAVE_BYTES);
+ if(!save_failed)have_save=true,last_checksum=hash;
+ return !save_failed;
+}
+static void fresh(uint32_t seed) {jj_new(&game,seed);}
+int main(void) {
+ np_app_begin();
+ uint32_t length=0;const uint8_t *data=ef_read("jetpackjoyride.sav",&length);
+ jj_decode(&game,&stats,data,length);
+ unsigned view=JJ_TITLE,selected=0,help_return=JJ_TITLE,help_selection=2;
+ unsigned error_return=JJ_TITLE,error_selection=0;
+ uint64_t previous=eadk_keyboard_scan(),stale=previous;
+ uint32_t now=(uint32_t)eadk_timing_millis(),tick_at=now,draw_at=now,save_at=now;
+ jj_invalidate();
+ for(;;) {
+ now=(uint32_t)eadk_timing_millis();uint64_t keys=eadk_keyboard_scan();stale&=keys;
+ uint64_t active=keys&~stale,hit=active&~previous;previous=active;
+ bool ok=(hit&(KEY(eadk_key_ok)|KEY(eadk_key_exe)))!=0;
+ bool back=(hit&KEY(eadk_key_back))!=0;
+ bool next=(hit&(KEY(eadk_key_right)|KEY(eadk_key_down)))!=0;
+ bool prev=(hit&(KEY(eadk_key_left)|KEY(eadk_key_up)))!=0;
+ if(view!=JJ_SAVE_ERROR&&(keys&(KEY(eadk_key_home)|KEY(eadk_key_on_off)))) {
+ if(save())break;
+ error_return=view==JJ_PLAY?JJ_READY:view;error_selection=selected;
+ view=JJ_SAVE_ERROR;hit=0;ok=back=next=prev=false;stale=keys;
+ }
+ if(view==JJ_PLAY) {
+ if(back)view=JJ_PAUSE,selected=0,save();
+ else {
+ bool thrust=(active&(KEY(eadk_key_ok)|KEY(eadk_key_exe)|KEY(eadk_key_up)))!=0;
+ if(now-tick_at>4*JJ_TICK_MS)tick_at=now-4*JJ_TICK_MS;
+ while(now-tick_at>=JJ_TICK_MS&&game.phase==JJ_RUNNING) {
+ jj_step(&game,&stats,thrust);tick_at+=JJ_TICK_MS;
+ }
+ if(game.phase==JJ_OVER)view=JJ_RESULT,selected=0,save();
+ if(now-save_at>=5000)save(),save_at=now;
+ }
+ } else {
+ tick_at=now;
+ if(view==JJ_TITLE) {
+ if(next)selected=(selected+1)%3;
+ if(prev)selected=(selected+2)%3;
+ if(back) {
+ if(save())break;
+ error_return=JJ_TITLE;error_selection=selected;view=JJ_SAVE_ERROR;
+ } else if(ok) {
+ if(selected==0) {
+ if(!game.present||game.phase==JJ_OVER)fresh(now^(stats.runs*0x9E3779B9u));
+ view=JJ_READY;selected=0;
+ } else if(selected==1)view=JJ_SHOP,selected=stats.suit;
+ else help_return=JJ_TITLE,help_selection=2,view=JJ_GUIDE;
+ }
+ } else if(view==JJ_READY) {
+ if(back)view=JJ_TITLE,selected=0;
+ else if(ok)jj_start(&game,&stats),view=JJ_PLAY,tick_at=now;
+ } else if(view==JJ_PAUSE) {
+ if(next)selected=(selected+1)%4;
+ if(prev)selected=(selected+3)%4;
+ if(back||(ok&&selected==0))view=JJ_READY;
+ else if(ok&&selected==1)view=JJ_CONFIRM,selected=0;
+ else if(ok&&selected==2)help_return=JJ_PAUSE,help_selection=2,view=JJ_GUIDE;
+ else if(ok&&selected==3)view=JJ_TITLE,selected=0;
+ } else if(view==JJ_CONFIRM) {
+ if(next||prev)selected=!selected;
+ if(back||(ok&&selected==0))view=JJ_PAUSE,selected=1;
+ else if(ok)fresh(now^(stats.runs*0x9E3779B9u)),view=JJ_READY,selected=0;
+ } else if(view==JJ_RESULT) {
+ if(next||prev)selected=!selected;
+ if(back||(ok&&selected))view=JJ_TITLE,selected=0;
+ else if(ok)fresh(now^(stats.runs*0x9E3779B9u)),view=JJ_READY,selected=0;
+ } else if(view==JJ_SHOP) {
+ if(next)selected=(selected+1)%4;
+ if(prev)selected=(selected+3)%4;
+ if(back)view=JJ_TITLE,selected=1;
+ else if(ok) {
+ if(!selected||(stats.owned&(1u<<selected)))jj_equip(&stats,selected),save();
+ else if(stats.wallet>=jj_price(selected))view=JJ_BUY,selected<<=1;
+ }
+ } else if(view==JJ_BUY) {
+ if(next||prev)selected^=1;
+ if(back||(ok&&!(selected&1)))view=JJ_SHOP,selected>>=1;
+ else if(ok) {
+ selected>>=1;jj_equip(&stats,selected);save();view=JJ_SHOP;
+ }
+ } else if(view==JJ_GUIDE) {
+ if(back||ok)view=help_return,selected=help_selection;
+ } else if(view==JJ_SAVE_ERROR) {
+ if(back)break;
+ if(ok&&save())break;
+ if(hit&KEY(eadk_key_one))view=error_return,selected=error_selection;
+ }
+ }
+ if(now-draw_at>=32||hit||!perf_frames) {
+ uint32_t start=(uint32_t)eadk_timing_millis();
+ jj_menu_time(now);
+ jj_render(&game,&stats,view,selected,save_failed,push);
+ uint32_t spent=(uint32_t)eadk_timing_millis()-start;
+ if(spent>perf_max)perf_max=spent;
+ if(spent>32)++perf_slow;
+ ++perf_frames;draw_at=now;
+ }
+ eadk_timing_msleep(4);
+ }
+ return np_app_end();
+}
diff --git a/games/jetpackjoyride/src/physics.c b/games/jetpackjoyride/src/physics.c
new file mode 100644
index 00000000..1bccb022
--- /dev/null
+++ b/games/jetpackjoyride/src/physics.c
@@ -0,0 +1,195 @@
+/* SPDX-License-Identifier: GPL-3.0-only */
+#include "jetpack.h"
+#include <string.h>
+static uint32_t random(jj_game *g) {
+ uint32_t x=g->rng;x^=x<<13;x^=x>>17;x^=x<<5;return g->rng=x;
+}
+static void increment(uint32_t *v) {if(*v<UINT32_MAX)++*v;}
+uint32_t jj_distance(const jj_game *g) {return g->distance/(10*JJ_Q);}
+int jj_speed(const jj_game *g) {
+ unsigned extra=jj_distance(g)/4;
+ return 576+(int)(extra>576?576:extra); /* 2.25 to 4.5 px per tick. */
+}
+void jj_bounds(unsigned kind,int *w,int *h) {
+ *w=kind==JJ_ROTATING?84:kind==JJ_HORIZONTAL?58:kind==JJ_MISSILE?24:10;
+ *h=kind==JJ_ROTATING?84:kind==JJ_VERTICAL?70:kind==JJ_COLUMN?100:10;
+}
+static int sine(unsigned phase) {
+ static const uint16_t quarter[]={0,25,50,74,98,121,142,162,181,198,213,226,237,245,251,255,256};
+ phase&=63;
+ if(phase<=16)return quarter[phase];
+ if(phase<=32)return quarter[32-phase];
+ if(phase<=48)return -(int)quarter[phase-32];
+ return -(int)quarter[64-phase];
+}
+void jj_rotor(const jj_hazard *p,uint32_t tick,int *dx,int *dy) {
+ /* One revolution in 128 simulation ticks; bit 6 reverses rotation.
+ * Phase lives in the existing timer byte, so saves and pools stay the same. */
+ unsigned angle=(p->timer+((p->timer&64)?0u-tick/2:tick/2))&63;
+ *dx=sine(angle+16)*36;*dy=sine(angle)*36;
+}
+static int magnitude(int v) {return v<0?-v:v;}
+bool jj_rotor_hit(const jj_hazard *p,uint32_t tick,int32_t y) {
+ int dx,dy;jj_rotor(p,tick,&dx,&dy);
+ int x=64*JJ_Q-p->x,yy=y-p->y*JJ_Q;
+ int ax=magnitude(dx),ay=magnitude(dy);
+ /* Segment vs player box expanded by the beam's 3 px half-thickness.
+ * Early bounds keep the cross products below signed 32-bit limits even
+ * for off-screen objects. Unlike a square collider, corners remain safe. */
+ if(magnitude(x)>ax+10*JJ_Q||magnitude(yy)>ay+11*JJ_Q)return false;
+ return magnitude(x*dy-yy*dx)<=10*JJ_Q*ay+11*JJ_Q*ax;
+}
+unsigned jj_price(unsigned suit) {
+ static const uint8_t prices[]={0,50,120,200};return suit<4?prices[suit]:0;
+}
+bool jj_equip(jj_stats *s,unsigned suit) {
+ if(suit>=4)return false;
+ if(suit&&!(s->owned&(1u<<suit))) {
+ unsigned price=jj_price(suit);if(s->wallet<price)return false;
+ s->wallet-=price;s->owned|=(uint8_t)(1u<<suit);
+ }
+ s->suit=(uint8_t)suit;return true;
+}
+void jj_new(jj_game *g,uint32_t seed) {
+ memset(g,0,sizeof *g);g->y=198*JJ_Q;g->next=180*JJ_Q;
+ g->rng=seed?seed:0x4A455450u;g->present=1;
+}
+void jj_start(jj_game *g,jj_stats *s) {
+ if(!g->present||g->phase==JJ_OVER)return;
+ if(!g->started)increment(&s->runs),g->started=1;
+ g->phase=JJ_RUNNING;
+}
+static void pickup(jj_game *g,int x,int y,unsigned kind) {
+ for(unsigned i=0;i<JJ_PICKUPS;++i)if(!g->pickup[i].active) {
+ g->pickup[i]=(jj_pickup){x*JJ_Q,(uint16_t)y,(uint8_t)kind,1};return;
+ }
+}
+static void hazard(jj_game *g,int x,int y,unsigned kind) {
+ for(unsigned i=0;i<JJ_HAZARDS;++i)if(!g->hazard[i].active) {
+ unsigned timer=kind==JJ_MISSILE?75:kind==JJ_ROTATING?random(g)&127:0;
+ g->hazard[i]=(jj_hazard){x*JJ_Q,(uint16_t)y,(uint8_t)kind,(uint8_t)timer,1};return;
+ }
+}
+static void trail(jj_game *g,int x,int y) {
+ for(int i=0;i<4;++i)pickup(g,x-68+i*22,y,JJ_COIN);
+}
+static void spawn(jj_game *g) {
+ int last=356,safe=120;
+ unsigned pattern=!g->events?0:g->events==2?4:random(g)%5;
+ if(g->events%5==4) {
+ hazard(g,356,120,JJ_MISSILE);g->next=680*JJ_Q;
+ } else {
+ /* Authored patterns, not independently random hazards: each column leaves
+ * a deliberate corridor. A 260 px step leaves >52 collision-free ticks at
+ * top speed for a 60 px altitude change. The opening weave blocks both
+ * floor camping and ceiling camping, independent of the random seed. */
+ if(pattern==0) {
+ bool reverse=g->events&&(random(g)&1);
+ for(int i=0;i<3;++i) {
+ bool low=((i&1)!=0)==reverse;
+ safe=low?90:150;last=356+i*260;
+ hazard(g,last,low?164:76,JJ_COLUMN);trail(g,last,safe);
+ }
+ } else if(pattern==1) {
+ hazard(g,356,59,JJ_VERTICAL);hazard(g,356,181,JJ_VERTICAL);trail(g,356,120);
+ last=616;hazard(g,last,120,JJ_HORIZONTAL);safe=random(g)&1?80:160;trail(g,last,safe);
+ } else if(pattern==2) {
+ bool reverse=(random(g)&1)!=0;
+ for(int i=0;i<3;++i) {
+ int y=i==1?130:((i==0)!=reverse?198:42);
+ safe=y>175?150:95;last=356+i*260;
+ hazard(g,last,y,JJ_HORIZONTAL);trail(g,last,safe);
+ }
+ } else if(pattern==3) {
+ bool reverse=(random(g)&1)!=0;
+ for(int i=0;i<2;++i) {
+ int offset=((i==0)!=reverse)?-16:16;last=356+i*260;safe=120+offset;
+ hazard(g,last,59+offset,JJ_VERTICAL);hazard(g,last,181+offset,JJ_VERTICAL);trail(g,last,safe);
+ }
+ } else {
+ bool reverse=(random(g)&1)!=0;
+ for(int i=0;i<2;++i) {
+ bool low=((i&1)==0)!=reverse;last=356+i*300;safe=low?160:80;
+ hazard(g,last,low?90:150,JJ_ROTATING);
+ hazard(g,last,low?198:42,JJ_HORIZONTAL);trail(g,last,safe);
+ }
+ }
+ if(g->events%4==3)pickup(g,last+60,safe,JJ_SHIELD);
+ /* Start the next group only after the last hazard has left the screen. */
+ g->next=(last-356+440+(int)(random(g)%65))*JJ_Q;
+ }
+ ++g->events;
+}
+static bool touching(int x,int y,int w,int h,int py,int radius) {
+ /* Fixed-point inclusive rectangles. Small player hitbox forgives art edges.
+ * The fastest missile moves <10 px/tick: narrower than either collider. */
+ return x+w*JJ_Q/2>=(64-radius)*JJ_Q&&x-w*JJ_Q/2<=(64+radius)*JJ_Q&&
+ y+h*JJ_Q/2>=py-8*JJ_Q&&y-h*JJ_Q/2<=py+8*JJ_Q;
+}
+void jj_step(jj_game *g,jj_stats *s,bool thrust) {
+ if(g->phase!=JJ_RUNNING)return;
+ int speed=jj_speed(g);++g->tick;g->thrust=(uint8_t)thrust;
+ if(g->invuln)--g->invuln;
+ if(g->flash)--g->flash;
+ g->vy+=thrust?-46:38;
+ if(g->vy<-1050)g->vy=-1050;
+ if(g->vy>1150)g->vy=1150;
+ g->y+=g->vy;
+ if(g->y<42*JJ_Q)g->y=42*JJ_Q,g->vy=0;
+ if(g->y>198*JJ_Q)g->y=198*JJ_Q,g->vy=0;
+ g->distance+=(uint32_t)speed;g->next-=speed;
+ if(g->next<=0)spawn(g);
+ /* Pickups resolve first, so a shield collected on a hit can protect you. */
+ for(unsigned i=0;i<JJ_PICKUPS;++i) {
+ jj_pickup *p=&g->pickup[i];if(!p->active)continue;
+ p->x-=speed;
+ if(p->x<-16*JJ_Q)p->active=0;
+ else if(touching(p->x,p->y*JJ_Q,10,10,g->y,10)) {
+ p->active=0;g->flash=6;
+ if(p->kind==JJ_SHIELD)g->shield=1;
+ else {if(g->coins<65535)++g->coins;increment(&s->coins);increment(&s->wallet);}
+ }
+ }
+ for(unsigned i=0;i<JJ_HAZARDS;++i) {
+ jj_hazard *p=&g->hazard[i];if(!p->active)continue;
+ if(p->kind==JJ_MISSILE&&p->timer) {
+ if(p->timer>35)p->y=(uint16_t)(g->y/JJ_Q);
+ --p->timer;continue;
+ }
+ int w,h;jj_bounds(p->kind,&w,&h);
+ int old_right=p->x+w*JJ_Q/2;
+ p->x-=speed+(p->kind==JJ_MISSILE?1152:0);
+ if(old_right>55*JJ_Q&&p->x+w*JJ_Q/2<=55*JJ_Q) {
+ if(g->passed<65535)++g->passed;
+ increment(&s->dodged);
+ }
+ if(p->x<(p->kind==JJ_ROTATING?-48:-40)*JJ_Q)p->active=0;
+ else if(!g->invuln&&(p->kind==JJ_ROTATING?jj_rotor_hit(p,g->tick,g->y):touching(p->x,p->y*JJ_Q,w,h,g->y,7))) {
+ if(g->shield)g->shield=0,g->invuln=80,p->active=0;
+ else g->phase=JJ_OVER,g->reason=(uint8_t)(p->kind==JJ_MISSILE?2:1);
+ }
+ }
+ if(jj_distance(g)>s->best)s->best=jj_distance(g);
+ if(g->distance>=JJ_LIMIT*JJ_Q)g->phase=JJ_OVER,g->reason=3;
+}
+bool jj_valid(const jj_game *g,const jj_stats *s) {
+ if(s->best>JJ_LIMIT/10||s->suit>3||s->owned>15||s->wallet>s->coins||
+ (s->suit&&!(s->owned&(1u<<s->suit)))||g->y<0||g->y>240*JJ_Q||g->vy<-1050||g->vy>1150||
+ g->next<0||g->next>1100*JJ_Q||g->distance>JJ_LIMIT*JJ_Q+1200||g->tick>4500000||
+ g->phase>JJ_OVER||g->present>1||g->started>1||g->thrust>1||g->shield>1||
+ g->invuln>80||g->reason>3||g->flash>6||g->events>30000)return false;
+ if(g->present&&(!g->rng||g->y<42*JJ_Q||g->y>198*JJ_Q))return false;
+ if(g->phase!=JJ_WAIT&&(!g->present||!g->started))return false;
+ for(unsigned i=0;i<JJ_HAZARDS;++i) {
+ const jj_hazard *p=&g->hazard[i];
+ if(p->active>1||p->kind>JJ_ROTATING||p->timer>(p->kind==JJ_ROTATING?127:75))return false;
+ if(p->active&&(p->x<(p->kind==JJ_ROTATING?-48:-40)*JJ_Q||p->x>876*JJ_Q||p->y<42||p->y>198||
+ (p->kind!=JJ_MISSILE&&p->kind!=JJ_ROTATING&&p->timer)))return false;
+ }
+ for(unsigned i=0;i<JJ_PICKUPS;++i) {
+ const jj_pickup *p=&g->pickup[i];
+ if(p->active>1||p->kind>JJ_SHIELD)return false;
+ if(p->active&&(p->x<-16*JJ_Q||p->x>936*JJ_Q||p->y<42||p->y>198))return false;
+ }
+ return true;
+}
diff --git a/games/jetpackjoyride/src/render.c b/games/jetpackjoyride/src/render.c
new file mode 100644
index 00000000..fbd7ef94
--- /dev/null
+++ b/games/jetpackjoyride/src/render.c
@@ -0,0 +1,379 @@
+/* SPDX-License-Identifier: GPL-3.0-only
+ * Halfbrick sprites adapted for a 5 KiB strip renderer; no framebuffer.
+ */
+#include "render.h"
+#include "assets.h"
+#include <stdlib.h>
+#include <string.h>
+#define C(v) ((uint16_t)((((v)>>8)&0xF800)|(((v)>>5)&0x07E0)|(((v)>>3)&31)))
+#define INK C(0x080D18)
+#define BG C(0x202B3E)
+#define PANEL C(0x35445D)
+#define EDGE C(0x748097)
+#define MUTED C(0xBAC4D2)
+#define WHITE C(0xFFF9E8)
+#define CYAN C(0x70C9F4)
+#define AMBER C(0xFFD04B)
+#define RED C(0xF57862)
+static uint16_t band[320*8];
+static int x0,y0,x1,y1;
+static int16_t lo[30],hi[30];
+static bool initialized;
+static const jj_game *world;
+static const jj_stats *stats;
+static unsigned page,selection;
+static bool failed;
+static uint32_t menu_frame,old_menu_frame;
+void jj_menu_time(uint32_t ms) {menu_frame=ms/80;}
+static const uint8_t alphabet[][5] = {
+ {0x7e,0x11,0x11,0x11,0x7e},{0x7f,0x49,0x49,0x49,0x36},{0x3e,0x41,0x41,0x41,0x22},
+ {0x7f,0x41,0x41,0x22,0x1c},{0x7f,0x49,0x49,0x49,0x41},{0x7f,0x09,0x09,0x09,0x01},
+ {0x3e,0x41,0x49,0x49,0x7a},{0x7f,0x08,0x08,0x08,0x7f},{0x00,0x41,0x7f,0x41,0x00},
+ {0x20,0x40,0x41,0x3f,0x01},{0x7f,0x08,0x14,0x22,0x41},{0x7f,0x40,0x40,0x40,0x40},
+ {0x7f,0x02,0x0c,0x02,0x7f},{0x7f,0x04,0x08,0x10,0x7f},{0x3e,0x41,0x41,0x41,0x3e},
+ {0x7f,0x09,0x09,0x09,0x06},{0x3e,0x41,0x51,0x21,0x5e},{0x7f,0x09,0x19,0x29,0x46},
+ {0x46,0x49,0x49,0x49,0x31},{0x01,0x01,0x7f,0x01,0x01},{0x3f,0x40,0x40,0x40,0x3f},
+ {0x1f,0x20,0x40,0x20,0x1f},{0x3f,0x40,0x38,0x40,0x3f},{0x63,0x14,0x08,0x14,0x63},
+ {0x07,0x08,0x70,0x08,0x07},{0x61,0x51,0x49,0x45,0x43},
+ {0x3e,0x51,0x49,0x45,0x3e},{0x00,0x42,0x7f,0x40,0x00},{0x62,0x51,0x49,0x49,0x46},
+ {0x22,0x41,0x49,0x49,0x36},{0x18,0x14,0x12,0x7f,0x10},{0x27,0x45,0x45,0x45,0x39},
+ {0x3c,0x4a,0x49,0x49,0x30},{0x01,0x71,0x09,0x05,0x03},{0x36,0x49,0x49,0x49,0x36},
+ {0x06,0x49,0x49,0x29,0x1e},
+ {0,0x08,0x3e,0x08,0},{0,0x08,0x08,0x08,0},{0,0x60,0x60,0,0},
+ {0,0x36,0x36,0,0},{0x20,0x10,0x08,0x04,0x02},{0,0,0x5f,0,0},
+ {0x08,0x14,0x22,0x41,0},{0x41,0x22,0x14,0x08,0},{0,0,0x7f,0,0}
+};
+
+static void mark(int x,int y,int w,int h) {
+ if(x<0)w+=x,x=0;
+ if(y<0)h+=y,y=0;
+ if(x+w>320)w=320-x;
+ if(y+h>240)h=240-y;
+ if(w<=0||h<=0)return;
+ for(int row=y/8;row<=(y+h-1)/8;++row) {
+ if(x<lo[row])lo[row]=(int16_t)x;
+ if(x+w>hi[row])hi[row]=(int16_t)(x+w);
+ }
+}
+void jj_invalidate(void) {initialized=false;mark(0,0,320,240);}
+static void pixel(int x,int y,uint16_t color) {
+ if(x>=x0&&x<x1&&y>=y0&&y<y1)band[(y-y0)*(x1-x0)+x-x0]=color;
+}
+static void rect(int x,int y,int w,int h,uint16_t color) {
+ int l=x<x0?x0:x,t=y<y0?y0:y,r=x+w>x1?x1:x+w,b=y+h>y1?y1:y+h;
+ if(l>=r||t>=b)return;
+ for(int j=t;j<b;++j) {
+ uint16_t *p=band+(j-y0)*(x1-x0)+l-x0;
+ for(int i=l;i<r;++i)*p++=color;
+ }
+}
+static void line(int a,int b,int c,int d,uint16_t color) {
+ if((a<x0&&c<x0)||(a>=x1&&c>=x1)||(b<y0&&d<y0)||(b>=y1&&d>=y1))return;
+ int dx=abs(c-a),sx=a<c?1:-1,dy=-abs(d-b),sy=b<d?1:-1,e=dx+dy;
+ for(;;) {
+ pixel(a,b,color);
+ if(a==c&&b==d)break;
+ int twice=e*2;
+ if(twice>=dy)e+=dy,a+=sx;
+ if(twice<=dx)e+=dx,b+=sy;
+ }
+}
+static void circle(int x,int y,int r,uint16_t color) {
+ if(y+r<y0||y-r>=y1||x+r<x0||x-r>=x1)return;
+ int start=y-r>y0?y-r:y0,end=y+r<y1?y+r:y1-1;
+ for(int j=start;j<=end;++j) {
+ int dy=j-y,half=0;
+ while((half+1)*(half+1)+dy*dy<=r*r)++half;
+ rect(x-half,j,half*2+1,1,color);
+ }
+}
+static void text(int x,int y,const char *s,int scale,uint16_t color) {
+ if(y>=y1||y+7*scale<=y0)return;
+ for(;*s;++s,x+=6*scale) {
+ unsigned ch=(unsigned char)*s,i;
+ if(ch>='a'&&ch<='z')ch-=32;
+ if(ch>='A'&&ch<='Z')i=ch-'A';
+ else if(ch>='0'&&ch<='9')i=ch-'0'+26;
+ else {
+ static const char punctuation[]="+-.:/!<>|";const char *p=strchr(punctuation,(int)ch);
+ if(!p||ch==' ')continue;
+ i=36+(unsigned)(p-punctuation);
+ }
+ for(int col=0;col<5;++col)for(int row=0;row<7;++row)
+ if(alphabet[i][col]&(1<<row))rect(x+col*scale,y+row*scale,scale,scale,color);
+ }
+}
+static void center(int x,int y,const char *s,int scale,uint16_t color) {
+ text(x-((int)strlen(s)*6*scale-scale)/2,y,s,scale,color);
+}
+static void number(int x,int y,uint32_t value,int scale,uint16_t color) {
+ char s[11];unsigned n=0;
+ do{s[n++]=(char)('0'+value%10);value/=10;}while(value);
+ for(unsigned i=0;i<n/2;++i){char c=s[i];s[i]=s[n-i-1];s[n-i-1]=c;}
+ s[n]=0;text(x,y,s,scale,color);
+}
+
+static void sprite(const jj_sprite *im,int x,int y,int scale,const uint16_t *palette) {
+ if(x+(int)im->w*scale<=x0||x>=x1||y+(int)im->h*scale<=y0||y>=y1)return;
+ if(!palette)palette=im->palette;
+ int first=y<y0?(y0-y)/scale:0,last=(y1-y+scale-1)/scale;
+ if(last>im->h)last=im->h;
+ for(int row=first;row<last;++row) {
+ const uint8_t *p=im->data+im->rows[row],*end=im->data+im->rows[row+1];
+ int xx=x,yy=y+row*scale;
+ while(p<end) {
+ unsigned tag=*p++,n=(tag&127)+1;
+ if(tag&128) {
+ unsigned color=*p++;
+ if(color)rect(xx,yy,(int)n*scale,scale,palette[color]);
+ xx+=(int)n*scale;
+ } else {
+ for(unsigned i=0;i<n;++i,xx+=scale) {
+ unsigned color=im->bits==4?(p[i/2]>>(i&1?0:4))&15:p[i];
+ if(color&&xx+scale>x0&&xx<x1)rect(xx,yy,scale,scale,palette[color]);
+ }
+ p+=im->bits==4?(n+1)/2:n;
+ }
+ }
+ }
+}
+static void outlined(int x,int y,const char *s,int scale,uint16_t color) {
+ text(x-1,y,s,scale,INK);text(x+1,y,s,scale,INK);
+ text(x,y-1,s,scale,INK);text(x,y+1,s,scale,INK);text(x,y,s,scale,color);
+}
+static uint16_t suit_color(unsigned suit) {
+ static const uint16_t colors[]={AMBER,CYAN,C(0xF58BB5),C(0xA8D864)};
+ return colors[suit&3];
+}
+static void pilot(int x,int y,int scale,bool thrust,unsigned tick,unsigned suit) {
+ unsigned frame=thrust?4+(tick/4)%4:(tick/5)%4;
+ if(thrust) {
+ /* Machine-gun exhaust: a real muzzle flash and a few deterministic shots. */
+ sprite(jj_flash[(tick/3)&1],x-18*scale,y+7*scale,scale,0);
+ for(unsigned i=0;i<3;++i) {
+ int d=(int)((tick*5+i*13)%36);
+ int yy=y+(14+d)*scale;
+ if(yy<216)rect(x-12*scale+(int)(i&1)*3*scale,yy,scale,yy+3*scale>216?216-yy:3*scale,AMBER);
+ }
+ }
+ sprite(jj_barry[frame],x-17*scale,y-24*scale,scale,jj_suit_palettes[suit&3]);
+}
+static void coin(int x,int y,unsigned tick) {
+ sprite(jj_coin[(tick/3)&7],x-5,y-5,1,0);
+}
+static void shield(int x,int y) {
+ sprite(&jj_shield,x-9,y-9,1,0);
+}
+static void cap(int x,int y) {sprite(&jj_zapper_cap,x-7,y-7,1,0);}
+static void zapper(int x,int y,unsigned kind,unsigned tick) {
+ int w,h;jj_bounds(kind,&w,&h);unsigned frame=(tick/3)%3;
+ bool vertical=kind==JJ_VERTICAL||kind==JJ_COLUMN;
+ const jj_sprite *im=kind==JJ_HORIZONTAL?jj_beam_h[frame]:kind==JJ_COLUMN?jj_beam_c[frame]:jj_beam_v[frame];
+ sprite(im,x-w/2,y-h/2,1,0);
+ if(vertical)cap(x,y-h/2),cap(x,y+h/2);
+ else cap(x-w/2,y),cap(x+w/2,y);
+}
+static void rotor(const jj_hazard *p) {
+ int dx,dy;jj_rotor(p,world->tick,&dx,&dy);
+ dx/=JJ_Q;dy/=JJ_Q;int x=p->x/JJ_Q,y=p->y;
+ if(x+45<x0||x-45>=x1||y+45<y0||y-45>=y1)return;
+ bool horizontal=abs(dx)>=abs(dy);
+ for(int k=-3;k<=3;++k)line(x-dx+(horizontal?0:k),y-dy+(horizontal?k:0),
+ x+dx+(horizontal?0:k),y+dy+(horizontal?k:0),k==0?WHITE:k==1||k==-1?AMBER:C(0x906426));
+ /* A small travelling arc follows the same finite beam as the collider. */
+ int jitter=world->tick&2?2:-2;
+ line(x-dx,y-dy,x+jitter,y-jitter,WHITE);
+ line(x+jitter,y-jitter,x+dx,y+dy,WHITE);
+ cap(x-dx,y-dy);cap(x+dx,y+dy);
+}
+static void floor_panel(unsigned shift) {
+ for(int x=-(int)(shift%256);x<320;x+=256)sprite(&jj_floor,x,216,2,0);
+}
+static void lab(unsigned shift) {
+ rect(x0,y0,x1-x0,y1-y0,INK);
+ shift%=256;
+ for(int x=-(int)shift;x<320;x+=256)sprite(&jj_lab,x,24,2,0);
+ /* Continue the supplied floor/ceiling textures beyond the play area. */
+ rect(0,0,320,24,C(0x252B36));rect(0,21,320,3,C(0xA0A7AD));
+ floor_panel(shift);
+}
+static void flight(void) {
+ unsigned shift=world->distance/(JJ_Q*2);
+ lab(shift);
+ for(unsigned i=0;i<3;++i) {
+ int x=355-(int)((shift+i*137)%450);
+ sprite(jj_scientist[(world->tick/7+i)&3],x,195,1,0);
+ }
+ for(unsigned i=0;i<JJ_PICKUPS;++i) {
+ const jj_pickup *p=&world->pickup[i];if(!p->active)continue;
+ int x=p->x/JJ_Q;
+ if(p->kind==JJ_COIN)coin(x,p->y,world->tick);else shield(x,p->y);
+ }
+ for(unsigned i=0;i<JJ_HAZARDS;++i) {
+ const jj_hazard *p=&world->hazard[i];if(!p->active)continue;
+ int x=p->x/JJ_Q,y=p->y;
+ if(p->kind==JJ_ROTATING)rotor(p);
+ else if(p->kind!=JJ_MISSILE)zapper(x,y,p->kind,world->tick);
+ else if(p->timer) {
+ bool locked=p->timer<=35;
+ if(locked||world->tick%16<11) {
+ rect(286,y-12,32,25,INK);
+ sprite(&jj_warning,290,y-9,1,0);
+ text(310,y-3,"<",1,locked?RED:AMBER);
+ }
+ } else {
+ sprite(jj_flash[(world->tick/3)&1],x+11,y-8,1,0);
+ sprite(&jj_missile,x-14,y-11,1,0);
+ }
+ }
+ int y=world->y/JJ_Q;
+ if((world->shield||world->invuln)&&(world->shield||world->tick%8<5)) {
+ circle(63,y-3,22,C(0x51C0F2));circle(63,y-3,20,C(0x2B5978));
+ circle(63,y-3,18,C(0x203A57));
+ }
+ pilot(64,y,1,world->thrust,world->tick,stats->suit);
+ /* Art below the floor is clipped by the foreground rail. */
+ floor_panel(shift);
+ rect(0,0,320,24,C(0x252B36));
+ uint32_t meters=jj_distance(world),v=meters;unsigned digits=1;while(v>=10)v/=10,++digits;
+ number(9,4,meters,2,WHITE);text(13+(int)digits*12,10,"M",1,WHITE);
+ coin(183,11,0);number(194,7,world->coins,1,AMBER);
+ if(world->shield)shield(274,11);
+ rect(300,5,3,11,C(0xAFB8C3));rect(306,5,3,11,C(0xAFB8C3));
+}
+static void footer(const char *hint) {
+ rect(0,219,320,21,INK);rect(0,219,320,1,EDGE);text(12,227,hint,1,MUTED);
+}
+static void heading(const char *label,const char *sub) {
+ lab(64);
+ rect(0,0,320,58,INK);rect(0,56,320,2,AMBER);
+ outlined(12,12,label,2,WHITE);text(13,38,sub,1,MUTED);
+}
+static void button(int x,int y,int w,int h,const char *label,bool on) {
+ rect(x,y+2,w,h,INK);rect(x,y,w,h-2,on?C(0x9A5E0F):C(0x3A4355));
+ rect(x+1,y+1,w-2,h-5,on?C(0xF4B531):C(0x65718A));
+ rect(x+2,y+2,w-4,(h-6)/2,on?C(0xFFDA67):C(0x7A879D));
+ rect(x+2,y+h-5,w-4,1,on?C(0xF8D050):C(0xA4B0BC));
+ center(x+w/2,y+(h-10)/2,label,1,on?INK:WHITE);
+ if(on)text(x+8,y+(h-10)/2,">",1,INK);
+}
+static void title(void) {
+ lab(menu_frame);
+ sprite(&jj_jetpack_word,17,25,1,0);sprite(&jj_joyride_word,20,79,1,0);
+ int bob=(int)((menu_frame/4)%12);if(bob>6)bob=12-bob;
+ sprite(&jj_hero,238,40+bob,1,0);
+ outlined(15,7,"BEST",1,MUTED);number(49,7,stats->best,1,WHITE);text(98,7,"M",1,MUTED);
+ coin(243,10,0);number(254,7,stats->wallet,1,AMBER);
+ button(52,148,216,33,world->started&&world->phase!=JJ_OVER?"RESUME RUN":"PLAY",selection==0);
+ button(52,187,104,27,"THE STASH",selection==1);
+ button(164,187,104,27,"HOW TO PLAY",selection==2);
+ rect(0,222,320,18,INK);text(10,228,"BY BOBYDELUXE",1,MUTED);text(255,228,"OK PLAY",1,WHITE);
+}
+static const char *const suits[]={"CLASSIC","ARCTIC","ROSE","LIME"};
+static void shop(void) {
+ heading("THE STASH","OUTFITS");
+ coin(230,41,0);number(242,38,stats->wallet,1,AMBER);
+ for(unsigned i=0;i<4;++i) {
+ int x=9+(int)i*78;bool on=selection==i;
+ rect(x-1,70,70,116,INK);rect(x,71,68,114,on?C(0x956320):C(0x4E5E74));
+ rect(x+2,73,64,110,on?C(0x394355):C(0x243147));
+ if(on)rect(x+2,73,64,2,AMBER),rect(x+2,181,64,2,AMBER);
+ center(x+34,81,suits[i],1,on?AMBER:WHITE);
+ pilot(x+34,132,1,true,12,i);
+ const char *status=stats->suit==i?"EQUIPPED":!i||(stats->owned&(1u<<i))?"OWNED":0;
+ if(status)center(x+34,165,status,1,stats->suit==i?CYAN:MUTED);
+ else {coin(x+21,168,0);number(x+31,165,jj_price(i),1,AMBER);}
+ }
+ const char *hint=stats->suit==selection?"EQUIPPED":!selection||(stats->owned&(1u<<selection))?"OK EQUIP OUTFIT":stats->wallet<jj_price(selection)?"COLLECT MORE COINS":"OK BUY OUTFIT";
+ center(160,202,hint,1,failed?RED:WHITE);
+ footer(failed?"SAVE FAILED / HOME TO RETRY":"ARROWS CHOOSE BACK RETURN");
+}
+static void guide(void) {
+ heading("HOW TO PLAY","JETPACK JOYRIDE");
+ rect(57,65,256,43,BG);rect(57,113,256,43,BG);rect(57,160,256,49,BG);
+ pilot(31,91,1,true,0,stats->suit);
+ text(63,73,"HOLD OK / EXE / UP TO RISE.",1,WHITE);
+ text(63,89,"RELEASE TO FALL. NO FUEL LIMIT.",1,MUTED);
+ zapper(31,139,JJ_VERTICAL,0);
+ text(63,119,"DODGE ELECTRIC ZAPPERS.",1,WHITE);
+ text(63,135,"SOME ROTATE. MISSILES LOCK ON.",1,MUTED);
+ coin(23,185,0);shield(44,185);
+ text(63,168,"COINS BUY OUTFITS IN THE STASH.",1,WHITE);
+ text(63,184,"SHIELDS PROTECT AGAINST ONE HIT.",1,MUTED);
+ text(63,200,"BACK PAUSES. HOME SAVES AND EXITS.",1,MUTED);
+ footer("OK / BACK RETURN");
+}
+static void choice(int y,const char *label,unsigned id) {
+ bool on=selection==id;
+ if(on)rect(29,y-5,262,20,C(0x806026)),rect(29,y-5,3,20,AMBER);
+ text(42,y,label,1,on?WHITE:MUTED);
+ if(on)text(270,y,">",1,AMBER);
+}
+static void modal(void) {
+ rect(17,44,286,158,INK);rect(20,47,280,152,C(0x4D596C));
+ rect(23,50,274,146,BG);rect(23,50,274,3,AMBER);
+ if(page==JJ_READY) {
+ center(160,65,world->started?"READY TO RESUME":"LET'S GO",2,WHITE);
+ center(160,101,"HOLD TO RISE. RELEASE TO FALL.",1,MUTED);
+ center(160,121,"WATCH OUT FOR ZAPPERS!",1,AMBER);
+ center(160,157,world->started?"OK / EXE RESUME":"OK / EXE PLAY",1,WHITE);
+ center(160,180,"BACK MAIN MENU",1,MUTED);
+ } else if(page==JJ_PAUSE) {
+ text(34,61,"PAUSED",2,WHITE);
+ text(35,84,failed?"SAVE FAILED - CHECK STORAGE":"PROGRESS SAVED",1,failed?RED:MUTED);
+ choice(107,"RESUME",0);choice(129,"NEW RUN",1);
+ choice(151,"HOW TO PLAY",2);choice(177,"MAIN MENU",3);
+ } else if(page==JJ_CONFIRM) {
+ center(160,65,"START A NEW RUN",2,WHITE);
+ center(160,97,"THIS RUN WILL END.",1,MUTED);
+ center(160,113,"YOUR COINS AND RECORD WILL STAY.",1,MUTED);
+ choice(147,"KEEP PLAYING",0);choice(177,"START NEW",1);
+ } else if(page==JJ_BUY) {
+ unsigned item=selection>>1;
+ center(160,65,"BUY OUTFIT",2,WHITE);
+ text(35,99,suits[item],1,suit_color(item));number(170,99,jj_price(item),1,AMBER);text(200,99,"COINS",1,MUTED);
+ center(160,119,"PERMANENT UNLOCK. NO GAMEPLAY CHANGE.",1,MUTED);
+ unsigned saved=selection;selection&=1;
+ choice(149,"CANCEL",0);choice(178,"BUY AND EQUIP",1);selection=saved;
+ } else if(page==JJ_SAVE_ERROR) {
+ center(160,65,"SAVE FAILED",2,RED);
+ center(160,95,"FREE STORAGE MAY BE FULL.",1,MUTED);
+ center(160,113,"YOUR RUN IS STILL IN MEMORY.",1,MUTED);
+ text(35,140,"OK RETRY SAVE AND EXIT",1,WHITE);
+ text(35,162,"1 RETURN TO GAME",1,CYAN);
+ text(35,183,"BACK EXIT WITHOUT SAVING",1,AMBER);
+ } else {
+ text(34,62,"RUN COMPLETE",2,WHITE);
+ text(35,87,world->reason==2?"MISSILE HIT":world->reason==3?"LAB END REACHED":"ZAPPED!",1,AMBER);
+ number(35,106,jj_distance(world),3,WHITE);text(35,133,"METERS",1,MUTED);
+ coin(235,116,0);number(247,113,world->coins,1,AMBER);
+ choice(154,"TRY AGAIN",0);choice(180,"MAIN MENU",1);
+ }
+}
+
+static unsigned old_page=99,old_selection;
+static uint32_t old_tick,old_distance,old_wallet;
+static uint16_t old_coins;
+static uint8_t old_shield,old_suit;
+static bool old_failed;
+void jj_render(const jj_game *g,const jj_stats *s,unsigned view,unsigned selected,bool save_failed,jj_push push) {
+ world=g;stats=s;page=view;selection=selected;failed=save_failed;
+ if(!initialized||view!=old_page||selected!=old_selection||failed!=old_failed||s->suit!=old_suit||
+ (view!=JJ_PLAY&&old_wallet!=s->wallet))mark(0,0,320,240);
+ else if(view==JJ_PLAY&&old_tick!=g->tick)mark(0,24,320,216);
+ else if(view==JJ_TITLE&&menu_frame!=old_menu_frame)mark(0,0,320,240);
+ if(view==JJ_PLAY&&(old_distance!=jj_distance(g)||old_coins!=g->coins||old_shield!=g->shield))mark(0,0,320,24);
+ old_page=view;old_selection=selected;old_tick=g->tick;old_failed=failed;
+ old_distance=jj_distance(g);old_coins=g->coins;old_shield=g->shield;
+ old_wallet=s->wallet;old_suit=s->suit;
+ old_menu_frame=menu_frame;
+ for(int row=0;row<30;++row) {
+ if(hi[row]<=lo[row])continue;
+ x0=lo[row];x1=hi[row];y0=row*8;y1=y0+8;
+ if(view==JJ_TITLE)title();else if(view==JJ_SHOP)shop();else if(view==JJ_GUIDE)guide();
+ else if(view==JJ_BUY){rect(x0,y0,x1-x0,y1-y0,BG);modal();}
+ else {if(g->present)flight();else title();if(view!=JJ_PLAY)modal();}
+ push(x0,y0,x1-x0,8,band);lo[row]=320;hi[row]=0;
+ }
+ initialized=true;
+}
diff --git a/games/jetpackjoyride/src/render.h b/games/jetpackjoyride/src/render.h
new file mode 100644
index 00000000..9c46a96c
--- /dev/null
+++ b/games/jetpackjoyride/src/render.h
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-3.0-only */
+#ifndef JETPACK_RENDER_H
+#define JETPACK_RENDER_H
+#include "jetpack.h"
+enum { JJ_TITLE,JJ_PLAY,JJ_READY,JJ_PAUSE,JJ_SHOP,JJ_GUIDE,JJ_CONFIRM,JJ_RESULT,JJ_SAVE_ERROR,JJ_BUY };
+typedef void (*jj_push)(int x,int y,int w,int h,const uint16_t *pixels);
+void jj_invalidate(void);
+void jj_menu_time(uint32_t ms);
+void jj_render(const jj_game *g,const jj_stats *s,unsigned page,unsigned selected,bool failed,jj_push push);
+#endif
diff --git a/games/jetpackjoyride/src/save.c b/games/jetpackjoyride/src/save.c
new file mode 100644
index 00000000..9398797d
--- /dev/null
+++ b/games/jetpackjoyride/src/save.c
@@ -0,0 +1,48 @@
+/* SPDX-License-Identifier: GPL-3.0-only */
+#include "jetpack.h"
+#include <string.h>
+static void w16(uint8_t *p,uint32_t v) {p[0]=(uint8_t)v;p[1]=(uint8_t)(v>>8);}
+static unsigned r16(const uint8_t *p) {return p[0]|(unsigned)p[1]<<8;}
+static void w32(uint8_t *p,uint32_t v) {w16(p,v);w16(p+2,v>>16);}
+static uint32_t r32(const uint8_t *p) {return r16(p)|(uint32_t)r16(p+2)<<16;}
+static uint32_t checksum(const uint8_t *p) {
+ uint32_t h=2166136261u;for(unsigned i=0;i<JJ_SAVE_BYTES-4;++i)h=(h^p[i])*16777619u;return h;
+}
+void jj_encode(const jj_game *g,const jj_stats *s,uint8_t out[JJ_SAVE_BYTES]) {
+ memset(out,0,JJ_SAVE_BYTES);memcpy(out,"JJN2",4);
+ w32(out+4,s->best);w32(out+8,s->runs);w32(out+12,s->coins);w32(out+16,s->dodged);
+ w32(out+20,g->rng);w32(out+24,g->tick);w32(out+28,g->distance);
+ w32(out+32,g->y);w32(out+36,g->vy);w32(out+40,g->next);
+ w16(out+44,g->coins);w16(out+46,g->passed);w16(out+48,g->events);
+ out[50]=g->phase;out[51]=g->present;out[52]=g->started;out[53]=g->thrust;
+ out[54]=g->shield;out[55]=g->invuln;out[56]=g->reason;out[57]=g->flash;
+ w32(out+58,s->wallet);out[62]=s->owned;out[63]=s->suit;
+ for(unsigned i=0;i<JJ_HAZARDS;++i) {
+ const jj_hazard *p=&g->hazard[i];uint8_t *d=out+64+i*12;
+ w32(d,p->x);w16(d+4,p->y);d[6]=p->kind;d[7]=p->timer;d[8]=p->active;
+ }
+ for(unsigned i=0;i<JJ_PICKUPS;++i) {
+ const jj_pickup *p=&g->pickup[i];uint8_t *d=out+112+i*8;
+ w32(d,p->x);w16(d+4,p->y);d[6]=p->kind;d[7]=p->active;
+ }
+ w32(out+256,checksum(out));
+}
+bool jj_decode(jj_game *g,jj_stats *s,const uint8_t *p,size_t n) {
+ if(!p||n!=JJ_SAVE_BYTES||(memcmp(p,"JJN1",4)&&memcmp(p,"JJN2",4))||r32(p+256)!=checksum(p))return false;
+ jj_game a;memset(&a,0,sizeof a);jj_stats b;memset(&b,0,sizeof b);
+ b.best=r32(p+4);b.runs=r32(p+8);b.coins=r32(p+12);b.dodged=r32(p+16);
+ b.wallet=p[3]=='1'?b.coins:r32(p+58);b.owned=p[3]=='1'?0:p[62];b.suit=p[3]=='1'?0:p[63];
+ a.rng=r32(p+20);a.tick=r32(p+24);a.distance=r32(p+28);
+ a.y=(int32_t)r32(p+32);a.vy=(int32_t)r32(p+36);a.next=(int32_t)r32(p+40);
+ a.coins=(uint16_t)r16(p+44);a.passed=(uint16_t)r16(p+46);a.events=(uint16_t)r16(p+48);
+ a.phase=p[50];a.present=p[51];a.started=p[52];a.thrust=p[53];
+ a.shield=p[54];a.invuln=p[55];a.reason=p[56];a.flash=p[57];
+ for(unsigned i=0;i<JJ_HAZARDS;++i) {
+ const uint8_t *d=p+64+i*12;a.hazard[i]=(jj_hazard){(int32_t)r32(d),(uint16_t)r16(d+4),d[6],d[7],d[8]};
+ }
+ for(unsigned i=0;i<JJ_PICKUPS;++i) {
+ const uint8_t *d=p+112+i*8;a.pickup[i]=(jj_pickup){(int32_t)r32(d),(uint16_t)r16(d+4),d[6],d[7]};
+ }
+ if(!jj_valid(&a,&b))return false;
+ *g=a;*s=b;return true;
+}
diff --git a/games/jetpackjoyride/tests/arm.py b/games/jetpackjoyride/tests/arm.py
new file mode 100644
index 00000000..692dee9b
--- /dev/null
+++ b/games/jetpackjoyride/tests/arm.py
@@ -0,0 +1,186 @@
+#!/usr/bin/env python3
+"""Execute the compiled app on all four NumPlay ARM emulator profiles.
+Build first and run tests/test.c to produce save fixtures. Requires Unicorn,
+Pillow and pyelftools. --nwlink accepts a command wrapper on Windows.
+"""
+import argparse
+import io
+import json
+from pathlib import Path
+import struct
+import tempfile
+import types
+
+ROOT=Path(__file__).resolve().parents[1]
+OUT=ROOT/'output'
+emu_path=ROOT.parents[1]/'tools/emu.py'
+emu=types.ModuleType('jetpack_emu');emu.__file__=str(emu_path);emu.io=io
+source=emu_path.read_text().replace('ELFFile(open(elf, "rb"))','ELFFile(io.BytesIO(open(elf, "rb").read()))')
+source=source.replace('chunk = CPU_HZ // 1000','chunk = CPU_HZ // 10000')
+source=source.replace('self.now_ms += 1\n','self.now_ms += 0.1\n')
+# A static menu can execute many sleeps in a single instruction slice. Stop
+# at a completed sleep when a checkpoint is reached; CPU/game state is intact.
+source=source.replace(' next_frame = self.now_ms if frame_ms else None',
+ ' self.checkpoint = until_ms\n next_frame = self.now_ms if frame_ms else None')
+source=source.replace(' self.slept_ms += r0\n',
+ ' self.slept_ms += r0\n if self.now_ms >= self.checkpoint: uc.emu_stop()\n')
+exec(compile(source,str(emu_path),'exec'),emu.__dict__)
+
+def record(name,value):
+ data=name.encode()+b'\0'+value
+ return struct.pack('<H',len(data)+2)+data
+
+def records(data):
+ result={};pos=0
+ while True:
+ n,=struct.unpack_from('<H',data,pos)
+ if not n:return result
+ assert n>=4 and pos+n<=len(data)
+ end=data.index(0,pos+2,pos+n)
+ result[data[pos+2:end].decode()]=data[end+1:pos+n];pos+=n
+
+def presses(*items):return [(t,t+d,emu.KEYS[k]) for t,k,d in items]
+def state(c):return bytes(c.uc.mem_read(c.symbols['game'],232))
+def u32(c,s):return struct.unpack('<I',c.uc.mem_read(c.symbols[s],4))[0]
+def safe(c,exited=True):
+ assert c.exited==exited
+ assert not c.violations,c.violations
+ assert not c.firmware_ram_changes(),c.firmware_ram_changes()
+ if exited:assert c.app_ram_clean() and c.locks==0
+def performance(c):
+ result={k:u32(c,k) for k in ('perf_frames','perf_max','perf_slow')}
+ assert result['perf_max']<=32 and result['perf_slow']==0,result
+ return result
+
+def controller(g):
+ y,vy=struct.unpack_from('<2i',g);nearest=1000000;target=120
+ for i in range(4):
+ x,yy,kind,timer,active=struct.unpack_from('<iH3B',g,40+i*12)
+ width=84 if kind==4 else 58 if kind==0 else 24 if kind==2 else 10
+ if active and x+width*128>=54*256 and x<nearest:
+ nearest=x
+ if kind==2:target=120 if timer>35 else 165 if yy<120 else 75
+ elif kind==4:target=160 if yy<120 else 80
+ elif kind==3:target=150 if yy<120 else 90
+ elif kind==0:target=150 if yy>175 else 95 if yy<70 else 80
+ else:
+ target=180 if yy<120 else 60
+ for j in range(4):
+ xx,y2,k2,t2,a2=struct.unpack_from('<iH3B',g,40+j*12)
+ if j!=i and a2 and xx==x and k2==1:target=(yy+y2)//2
+ if nearest==1000000:
+ for i in range(18):
+ x,yy,kind,active=struct.unpack_from('<iH2B',g,88+i*8)
+ if active and 44*256<x<nearest:nearest=x;target=yy
+ return y+vy*10>target*256
+
+def main():
+ ap=argparse.ArgumentParser(description=__doc__);ap.add_argument('--nwlink',default='nwlink');a=ap.parse_args()
+ (OUT/'tmp').mkdir(exist_ok=True);tempfile.tempdir=str(OUT/'tmp');nwa=str(OUT/'jetpackjoyride-debug.nwa')
+ report=[]
+ for name,model,system,ram in [('n0110','n0110','epsilon',148928),('n0115-custom','n0110','epsilon',133652),('n0120','n0120','epsilon',153676),('upsilon','n0110','upsilon',107674)]:
+ emu.configure(model,system,ram);storage=OUT/(name+'-storage.bin')
+ storage.write_bytes(record('keep.py',b'print(42)\n')+b'\0\0')
+ c=emu.Calculator(nwa,storage_file=str(storage),nwlink=a.nwlink);c.enable_checks()
+ c.keys=presses((0,'ok',300),(600,'ok',70),(1000,'ok',70),(1150,'up',500),(1750,'back',70),(1950,'down',70),(2100,'ok',70),(2250,'back',70),(2400,'up',70),(2550,'ok',70),(2700,'ok',70),(3000,'home',120))
+ c.run(550);assert not state(c)[31],'Held launch key entered a game';c.save_png(str(OUT/(name+'-title.png')))
+ c.run(1640);g=state(c);assert g[30]==1 and g[32]==1 and g[33]==1
+ c.save_png(str(OUT/(name+'-gameplay.png')))
+ c.run(1900);saved=records(c.storage_bytes())['jetpackjoyride.sav'];tick=struct.unpack_from('<I',saved,24)[0]
+ assert len(saved)==260 and saved[:4]==b'JJN2';c.save_png(str(OUT/(name+'-pause.png')))
+ c.run(2380);assert records(c.storage_bytes())['jetpackjoyride.sav']==saved
+ assert struct.unpack_from('<I',state(c),16)[0]==tick,'Pause/cancel changed world'
+ c.run(2900);perf=performance(c);c.run(3300);safe(c)
+ saved=records(c.storage_bytes())['jetpackjoyride.sav'];assert struct.unpack_from('<I',saved,8)[0]==1
+ assert records(c.storage_bytes())['keep.py']==b'print(42)\n'
+ stack=c.stack_used();recs=records(c.storage_bytes());recs['later.py']=b'x=123\n'
+ storage.write_bytes(b''.join(record(k,v) for k,v in recs.items())+b'\0\0')
+ c2=emu.Calculator(nwa,storage_file=str(storage),nwlink=a.nwlink);c2.enable_checks()
+ c2.keys=presses((500,'ok',70),(900,'ok',70),(1150,'exe',160),(1450,'onoff',120))
+ c2.run(800)
+ assert state(c2)==saved[32:44]+saved[20:32]+saved[44:58]+b'\0\0'+saved[64:256],'Resume did not restore exact simulation state'
+ c2.run(1800);safe(c2)
+ recs=records(c2.storage_bytes());assert recs['later.py']==b'x=123\n' and recs['keep.py']==b'print(42)\n'
+ assert struct.unpack_from('<I',recs['jetpackjoyride.sav'],8)[0]==1
+ # Real shop navigation: cancel, buy with a held OK, cancel another
+ # purchase, relaunch, equip owned suits and reject insufficient funds.
+ storage=OUT/(name+'-shop-storage.bin');sentinel=record('keep.py',b'shop sentinel\n')
+ storage.write_bytes(sentinel+record('jetpackjoyride.sav',(OUT/'shop-save.bin').read_bytes())+b'\0\0')
+ c3=emu.Calculator(nwa,storage_file=str(storage),nwlink=a.nwlink);c3.enable_checks()
+ c3.keys=presses((500,'down',70),(700,'ok',70),(1000,'down',70),(1200,'ok',70),(1400,'ok',70),(1600,'ok',70),(1800,'down',70),(2000,'ok',300),(2600,'down',70),(2800,'ok',70),(3000,'back',70),(3200,'back',70),(3500,'home',100))
+ c3.run(1350);c3.save_png(str(OUT/(name+'-buy.png')))
+ c3.run(2400);c3.save_png(str(OUT/(name+'-shop.png')));shop_perf=performance(c3)
+ c3.run(3900);safe(c3);recs=records(c3.storage_bytes());data=recs['jetpackjoyride.sav']
+ assert struct.unpack_from('<I',data,58)[0]==150 and data[62:64]==b'\x02\x01'
+ assert recs['keep.py']==b'shop sentinel\n';stack=max(stack,c2.stack_used(),c3.stack_used())
+ c4=emu.Calculator(nwa,storage_file=str(storage),nwlink=a.nwlink);c4.enable_checks()
+ c4.keys=presses((500,'right',70),(800,'ok',70),(1100,'ok',70),(1400,'down',70),(1600,'ok',70),(1800,'down',70),(2000,'ok',70),(2200,'up',70),(2400,'down',70),(2600,'down',70),(2800,'ok',70),(3200,'home',100))
+ c4.run(3000);c4.save_png(str(OUT/(name+'-insufficient.png')));c4.run(3600);safe(c4)
+ data=records(c4.storage_bytes())['jetpackjoyride.sav']
+ assert struct.unpack_from('<I',data,58)[0]==30 and data[62:64]==b'\x06\x02'
+ report.append(dict(profile=name,stack=max(stack,c4.stack_used()),shop_max=shop_perf['perf_max'],**perf));print(json.dumps(report[-1]),flush=True)
+ emu.configure('n0110','epsilon',148928);storage=OUT/'stress-storage.bin'
+ storage.write_bytes(record('jetpackjoyride.sav',(OUT/'stress-save.bin').read_bytes())+b'\0\0')
+ c=emu.Calculator(nwa,storage_file=str(storage),nwlink=a.nwlink);c.enable_checks()
+ c.keys=presses((500,'ok',70),(900,'ok',300),(1500,'back',70),(1800,'home',100))
+ c.run(1150);c.save_png(str(OUT/'arm-stress.png'));c.run(1700);stress=performance(c);c.run(2200);safe(c)
+ # Real keyboard input only: controller observes state but never writes it.
+ storage=OUT/'keyboard-storage.bin';storage.write_bytes(record('jetpackjoyride.sav',(OUT/'start-save.bin').read_bytes())+b'\0\0')
+ c=emu.Calculator(nwa,storage_file=str(storage),nwlink=a.nwlink);c.enable_checks()
+ c.keys=presses((500,'ok',70),(900,'ok',70));c.run(980);seen=0;snapped=False;rotor_snapped=False
+ for _ in range(10000):
+ g=state(c);distance=struct.unpack_from('<I',g,20)[0]//2560
+ for i in range(4):
+ if g[48+i*12]:seen|=1<<g[46+i*12]
+ visible=any(g[48+i*12] and g[46+i*12]<2 and 140*256<struct.unpack_from('<i',g,40+i*12)[0]<240*256 for i in range(4))
+ if not snapped and distance>70 and visible:
+ c.save_png(str(OUT/'arm-flight.png'));snapped=True
+ visible_rotor=any(g[48+i*12] and g[46+i*12]==4 and 120*256<struct.unpack_from('<i',g,40+i*12)[0]<260*256 for i in range(4))
+ if not rotor_snapped and visible_rotor:
+ c.save_png(str(OUT/'arm-rotor-flight.png'));rotor_snapped=True
+ if (distance>=650 and seen==31) or g[30]==2:break
+ key=emu.KEYS['up'] if controller(g) else 0
+ c.keys=[(c.now_ms,c.now_ms+40,key)];c.run(c.now_ms+16)
+ c.save_png(str(OUT/'arm-keyboard-last.png'));assert distance>=650 and seen==31,(distance,seen,g[36])
+ keyboard=performance(c);keyboard.update(meters=distance,hazards=struct.unpack_from('<H',g,26)[0],coins=struct.unpack_from('<H',g,24)[0],stack=c.stack_used())
+ c.keys=[(c.now_ms,c.now_ms+150,emu.KEYS['home'])];c.run(c.now_ms+500);safe(c)
+ # Four rotating beams test the maximum renderer load. Ordinary authored
+ # rotor groups are covered separately by the live-keyboard run above.
+ storage=OUT/'rotor-storage.bin'
+ storage.write_bytes(record('jetpackjoyride.sav',(OUT/'rotor-stress-save.bin').read_bytes())+b'\0\0')
+ c=emu.Calculator(nwa,storage_file=str(storage),nwlink=a.nwlink);c.enable_checks()
+ c.keys=presses((500,'ok',70),(900,'ok',70),(1500,'back',70),(1800,'home',100))
+ c.run(1050);c.save_png(str(OUT/'arm-rotors.png'))
+ c.run(1350);c.save_png(str(OUT/'arm-rotors-turned.png'));rotors=performance(c)
+ c.run(2200);safe(c);rotors['stack']=c.stack_used()
+ # Guide/shop navigation and title Back exit.
+ storage=OUT/'menus-storage.bin';storage.write_bytes(b'\0\0')
+ c=emu.Calculator(nwa,storage_file=str(storage),nwlink=a.nwlink);c.enable_checks()
+ c.keys=presses((500,'down',70),(800,'ok',70),(1400,'back',70),(1700,'right',70),(2000,'ok',70),(2600,'back',70),(3000,'back',70))
+ c.run(1100);c.save_png(str(OUT/'arm-shop.png'));c.run(2400);c.save_png(str(OUT/'arm-guide.png'));c.run(3300);safe(c)
+ # Import an actual save produced by the previous app, without losing its
+ # world or coins; migrate only when writing the new format on exit.
+ legacy=(ROOT/'tests/legacy-save.bin').read_bytes();storage=OUT/'legacy-storage.bin'
+ storage.write_bytes(record('jetpackjoyride.sav',legacy)+b'\0\0')
+ c=emu.Calculator(nwa,storage_file=str(storage),nwlink=a.nwlink);c.enable_checks()
+ c.keys=presses((500,'down',70),(800,'ok',70),(1200,'home',100));c.run(1600);safe(c)
+ migrated=records(c.storage_bytes())['jetpackjoyride.sav']
+ assert migrated[:4]==b'JJN2' and migrated[4:58]==legacy[4:58] and migrated[64:256]==legacy[64:256]
+ assert migrated[58:62]==legacy[12:16] and migrated[62:64]==b'\0\0'
+ # A normal collision, result screen, and restart must count two flights.
+ storage=OUT/'collision-storage.bin';storage.write_bytes(record('jetpackjoyride.sav',(OUT/'start-save.bin').read_bytes())+b'\0\0')
+ c=emu.Calculator(nwa,storage_file=str(storage),nwlink=a.nwlink);c.enable_checks()
+ c.keys=presses((500,'ok',70),(900,'ok',70));c.run(30000)
+ assert state(c)[30]==2,'No-input flight should eventually collide';c.save_png(str(OUT/'arm-result.png'))
+ t=c.now_ms;c.keys=presses((t+100,'ok',70),(t+400,'ok',70),(t+800,'home',100));c.run(t+1200);safe(c)
+ assert struct.unpack_from('<I',records(c.storage_bytes())['jetpackjoyride.sav'],8)[0]==2
+ storage=OUT/'full-storage.bin';full=record('large.py',b'#'*(emu.STORAGE_SIZE-16));storage.write_bytes(full+b'\0\0')
+ c=emu.Calculator(nwa,storage_file=str(storage),nwlink=a.nwlink);c.enable_checks();c.keys=presses((500,'home',300))
+ c.run(1200);safe(c,False);c.save_png(str(OUT/'arm-storage-full.png'));assert c.storage_bytes()[:len(full)]==full
+ c.keys+=presses((1400,'1',70),(1700,'home',100),(2100,'ok',70),(2500,'back',70));c.run(2900);safe(c)
+ assert c.storage_bytes()[:len(full)]==full
+ result=dict(profiles=report,stress=stress,keyboard=keyboard,rotors=rotors)
+ (OUT/'arm-validation.json').write_text(json.dumps(result,indent=2)+'\n')
+ print('PASS: all profiles, input, pause/cancel/resume, persistence, stress, live keyboard, full storage; '+json.dumps(result),flush=True)
+
+if __name__=='__main__':main()
diff --git a/games/jetpackjoyride/tests/legacy-save.bin b/games/jetpackjoyride/tests/legacy-save.bin
new file mode 100644
index 00000000..b805de4a
Binary files /dev/null and b/games/jetpackjoyride/tests/legacy-save.bin differ
diff --git a/games/jetpackjoyride/tests/menu.py b/games/jetpackjoyride/tests/menu.py
new file mode 100644
index 00000000..271c4187
--- /dev/null
+++ b/games/jetpackjoyride/tests/menu.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python3
+"""Focused animated-title check on the actual ARM application."""
+import argparse
+import hashlib
+import json
+import tempfile
+from PIL import Image
+from arm import OUT,emu,performance,presses,record,records,safe,state
+
+def main():
+ ap=argparse.ArgumentParser(description=__doc__);ap.add_argument('--nwlink',default='nwlink');a=ap.parse_args()
+ (OUT/'tmp').mkdir(exist_ok=True);tempfile.tempdir=str(OUT/'tmp');report=[]
+ for name,model,system,ram in [('n0110','n0110','epsilon',148928),('n0115-custom','n0110','epsilon',133652),('n0120','n0120','epsilon',153676),('upsilon','n0110','upsilon',107674)]:
+ emu.configure(model,system,ram);storage=OUT/(name+'-menu-storage.bin')
+ storage.write_bytes(record('keep.py',b'menu sentinel\n')+b'\0\0')
+ c=emu.Calculator(str(OUT/'jetpackjoyride-debug.nwa'),storage_file=str(storage),nwlink=a.nwlink);c.enable_checks()
+ hashes=set();frames=[]
+ for frame in range(16):
+ c.run(200+frame*160);hashes.add(hashlib.sha256(c.screen).digest())
+ assert state(c)==bytes(232),'Menu animation changed the simulation'
+ if name=='n0110':
+ path=OUT/f'animated-title-{frame}.png';c.save_png(str(path));frames.append(Image.open(path).copy())
+ assert len(hashes)==16,'Title background did not animate'
+ perf=performance(c)
+ c.keys=presses((2900,'home',100));c.run(3300);safe(c)
+ assert records(c.storage_bytes())['keep.py']==b'menu sentinel\n'
+ report.append(dict(profile=name,unique_frames=len(hashes),stack=c.stack_used(),**perf))
+ if frames:frames[0].save(OUT/'menu-animation.gif',save_all=True,append_images=frames[1:],duration=160,loop=0)
+ (OUT/'menu-validation.json').write_text(json.dumps(report,indent=2)+'\n')
+ print(json.dumps(report,indent=2))
+
+if __name__=='__main__':main()
diff --git a/games/jetpackjoyride/tests/test.c b/games/jetpackjoyride/tests/test.c
new file mode 100644
index 00000000..42e34f1c
--- /dev/null
+++ b/games/jetpackjoyride/tests/test.c
@@ -0,0 +1,251 @@
+/* SPDX-License-Identifier: GPL-3.0-only */
+#include "jetpack.h"
+#include "render.h"
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+typedef char layout_checked[(sizeof(jj_game)==232&&offsetof(jj_game,hazard)==40&&offsetof(jj_game,pickup)==88)?1:-1];
+static uint16_t screen[320*240],reference[320*240];
+static unsigned pushes;
+static void push(int x,int y,int w,int h,const uint16_t *p) {
+ assert(x>=0&&y>=0&&w>0&&h>0&&x+w<=320&&y+h<=240&&w*h<=2560);
+ for(int j=0;j<h;++j)memcpy(screen+(y+j)*320+x,p+j*w,(size_t)w*2);
+ ++pushes;
+}
+static void shot(const char *name) {
+ FILE *f=fopen(name,"wb");assert(f);fprintf(f,"P6\n320 240\n255\n");
+ for(unsigned i=0;i<320*240;++i) {
+ unsigned c=screen[i];fputc(((c>>11)&31)*255/31,f);fputc(((c>>5)&63)*255/63,f);fputc((c&31)*255/31,f);
+ }
+ fclose(f);
+}
+static void fixture(const char *name,const jj_game *g,const jj_stats *s) {
+ assert(jj_valid(g,s));uint8_t data[JJ_SAVE_BYTES];jj_encode(g,s,data);
+ FILE *f=fopen(name,"wb");assert(f);assert(fwrite(data,1,sizeof data,f)==sizeof data);fclose(f);
+}
+static void setup(jj_game *g,jj_stats *s) {*s=(jj_stats){0};jj_new(g,42);jj_start(g,s);}
+static bool controller(const jj_game *g);
+static void collisions(void) {
+ jj_game g; jj_stats s;setup(&g,&s);
+ for(int i=0;i<200;++i)jj_step(&g,&s,true);
+ assert(g.y==42*JJ_Q&&g.vy==0&&g.phase==JJ_RUNNING);
+ memset(g.hazard,0,sizeof g.hazard);g.next=600*JJ_Q;
+ for(int i=0;i<100;++i)jj_step(&g,&s,false);
+ assert(g.y==198*JJ_Q&&g.vy==0&&s.runs==1);
+ jj_start(&g,&s);assert(s.runs==1);
+ for(unsigned kind=0;kind<=JJ_ROTATING;++kind) {
+ setup(&g,&s);g.y=120*JJ_Q;
+ g.hazard[0]=(jj_hazard){67*JJ_Q,120,(uint8_t)kind,0,1};jj_step(&g,&s,false);
+ assert(g.phase==JJ_OVER&&g.reason==(kind==JJ_MISSILE?2:1));
+ jj_game frozen=g;jj_stats book=s;jj_step(&g,&s,true);
+ assert(!memcmp(&g,&frozen,sizeof g)&&!memcmp(&s,&book,sizeof s));
+ setup(&g,&s);g.y=120*JJ_Q;g.shield=1;
+ g.hazard[0]=(jj_hazard){67*JJ_Q,120,(uint8_t)kind,0,1};jj_step(&g,&s,false);
+ assert(g.phase==JJ_RUNNING&&!g.shield&&g.invuln==80&&!g.hazard[0].active);
+ }
+ setup(&g,&s);g.y=120*JJ_Q;g.pickup[0]=(jj_pickup){65*JJ_Q,120,JJ_COIN,1};jj_step(&g,&s,false);
+ assert(g.coins==1&&s.coins==1&&s.wallet==1&&!g.pickup[0].active);jj_step(&g,&s,false);assert(g.coins==1);
+ g.pickup[0]=(jj_pickup){65*JJ_Q,120,JJ_SHIELD,1};g.hazard[0]=(jj_hazard){65*JJ_Q,120,JJ_HORIZONTAL,0,1};
+ jj_step(&g,&s,false);assert(g.invuln==80&&!g.shield&&g.phase==JJ_RUNNING);
+ setup(&g,&s);g.y=120*JJ_Q;g.hazard[0]=(jj_hazard){356*JJ_Q,65,JJ_MISSILE,36,1};
+ jj_step(&g,&s,false);assert(g.hazard[0].y==120&&g.hazard[0].timer==35);
+ for(int i=0;i<35;++i)jj_step(&g,&s,true);
+ assert(g.hazard[0].y==120&&!g.hazard[0].timer&&g.hazard[0].x==356*JJ_Q);
+ jj_step(&g,&s,true);assert(g.hazard[0].x<356*JJ_Q&&g.phase==JJ_RUNNING);
+ setup(&g,&s);g.hazard[0]=(jj_hazard){28*JJ_Q,90,JJ_HORIZONTAL,0,1};
+ jj_step(&g,&s,false);assert(g.passed==1&&s.dodged==1);
+ jj_step(&g,&s,false);assert(g.passed==1);
+ setup(&g,&s);g.distance=JJ_LIMIT*JJ_Q-1;g.tick=4000000;jj_step(&g,&s,false);
+ assert(g.phase==JJ_OVER&&g.reason==3&&jj_valid(&g,&s));
+ s.runs=s.coins=s.dodged=UINT32_MAX;jj_new(&g,1);jj_start(&g,&s);assert(s.runs==UINT32_MAX);
+}
+static void hash(uint8_t *p) {
+ uint32_t h=2166136261u;for(unsigned i=0;i<256;++i)h=(h^p[i])*16777619u;
+ for(int i=0;i<4;++i)p[256+i]=(uint8_t)(h>>(8*i));
+}
+static void saves(void) {
+ jj_game g,a; jj_stats s,b;setup(&g,&s);uint8_t data[JJ_SAVE_BYTES],bad[JJ_SAVE_BYTES];
+ for(int i=0;i<300;++i)jj_step(&g,&s,i%80<35);
+ jj_encode(&g,&s,data);assert(jj_decode(&a,&b,data,sizeof data));
+ assert(!memcmp(&g,&a,sizeof g)&&!memcmp(&s,&b,sizeof s));
+ for(unsigned i=0;i<sizeof data;++i) {
+ memcpy(bad,data,sizeof bad);bad[i]^=1;jj_game keep=a;jj_stats book=b;
+ assert(!jj_decode(&a,&b,bad,sizeof bad)&&!memcmp(&a,&keep,sizeof a)&&!memcmp(&b,&book,sizeof b));
+ }
+ assert(!jj_decode(&a,&b,NULL,0)&&!jj_decode(&a,&b,data,sizeof data-1));
+ static const unsigned offsets[]={35,39,43,50,51,52,53,54,55,56,57,61,62,63,70,71,72,118,119};
+ for(unsigned i=0;i<sizeof offsets/sizeof *offsets;++i) {
+ memcpy(bad,data,sizeof bad);bad[offsets[i]]=255;hash(bad);assert(!jj_decode(&a,&b,bad,sizeof bad));
+ }
+ setup(&g,&s);
+ for(int i=0;i<200;++i)jj_step(&g,&s,controller(&g));
+ jj_game clone; jj_stats book;jj_encode(&g,&s,data);assert(jj_decode(&clone,&book,data,sizeof data));
+ for(int i=0;i<1000;++i) {
+ bool thrust=controller(&g);jj_step(&g,&s,thrust);jj_step(&clone,&book,thrust);
+ assert(!memcmp(&g,&clone,sizeof g)&&!memcmp(&s,&book,sizeof s));
+ }
+ assert(g.phase==JJ_RUNNING&&jj_distance(&g)>100);
+ memset(&g,0,sizeof g);memset(&s,0,sizeof s);jj_encode(&g,&s,data);assert(jj_decode(&a,&b,data,sizeof data));
+ FILE *f=fopen("../tests/legacy-save.bin","rb");assert(f);assert(fread(data,1,sizeof data,f)==sizeof data);fclose(f);
+ assert(!memcmp(data,"JJN1",4)&&jj_decode(&g,&s,data,sizeof data));
+ assert(s.wallet==s.coins&&!s.owned&&!s.suit);jj_encode(&g,&s,data);
+ assert(!memcmp(data,"JJN2",4)&&jj_decode(&a,&b,data,sizeof data)&&!memcmp(&g,&a,sizeof g)&&!memcmp(&s,&b,sizeof s));
+}
+static bool controller(const jj_game *g) {
+ int target=120;int nearest=1000000;
+ for(unsigned i=0;i<JJ_HAZARDS;++i) {
+ const jj_hazard *p=&g->hazard[i];
+ int w,h;jj_bounds(p->kind,&w,&h);
+ if(!p->active||p->x+w*JJ_Q/2<54*JJ_Q)continue;
+ if(p->x<nearest) {
+ nearest=p->x;
+ if(p->kind==JJ_MISSILE)target=p->timer>35?120:p->y<120?165:75;
+ else if(p->kind==JJ_ROTATING)target=p->y<120?160:80;
+ else if(p->kind==JJ_COLUMN)target=p->y<120?150:90;
+ else if(p->kind==JJ_HORIZONTAL)target=p->y>175?150:p->y<70?95:80;
+ else {
+ target=p->y<120?180:60;
+ for(unsigned j=0;j<JJ_HAZARDS;++j) {
+ const jj_hazard *q=&g->hazard[j];
+ if(j!=i&&q->active&&q->x==p->x&&q->kind==JJ_VERTICAL)target=(p->y+q->y)/2;
+ }
+ }
+ }
+ }
+ if(nearest==1000000)for(unsigned i=0;i<JJ_PICKUPS;++i) {
+ const jj_pickup *p=&g->pickup[i];
+ if(p->active&&p->x>44*JJ_Q&&p->x<nearest)target=p->y,nearest=p->x;
+ }
+ return g->y+g->vy*10>target*JJ_Q;
+}
+static void courses(void) {
+ unsigned successes=0,seen=0,shields=0,max_active=0;unsigned long steps=0;
+ for(unsigned seed=1;seed<=80;++seed) {
+ jj_game g;jj_stats s={0};jj_new(&g,seed);
+ if(seed==1)fixture("start-save.bin",&g,&s);
+ jj_start(&g,&s);
+ for(unsigned i=0;i<20000&&g.phase==JJ_RUNNING&&jj_distance(&g)<3000;++i) {
+ jj_step(&g,&s,controller(&g));assert(jj_valid(&g,&s));++steps;
+ unsigned active=0;
+ for(unsigned j=0;j<JJ_HAZARDS;++j)if(g.hazard[j].active)seen|=1u<<g.hazard[j].kind,++active;
+ if(active>max_active)max_active=active;
+ if(g.shield)++shields;
+ if(seed==1&&jj_distance(&g)>=500&&jj_distance(&g)<=501)fixture("flight-save.bin",&g,&s);
+ if(i%113==0) {
+ jj_game copy; jj_stats book;uint8_t data[JJ_SAVE_BYTES];jj_encode(&g,&s,data);
+ assert(jj_decode(&copy,&book,data,sizeof data)&&!memcmp(&copy,&g,sizeof g));
+ }
+ }
+ if(jj_distance(&g)>=3000)++successes;
+ else printf("Seed %u ended at %u m, cause %u\n",seed,(unsigned)jj_distance(&g),g.reason);
+ }
+ printf("Courses: %u/80 reached 3000 m; hazard kinds %u; shield frames %u; %lu steps\n",successes,seen,shields,steps);
+ assert(successes>=70&&seen==31&&shields&&max_active==4);
+ jj_game g; jj_stats s;setup(&g,&s);uint32_t r=0x452341u;
+ for(unsigned i=0;i<200000;++i) {
+ r^=r<<13;r^=r>>17;r^=r<<5;
+ if(g.phase==JJ_OVER)jj_new(&g,r),jj_start(&g,&s);
+ jj_step(&g,&s,(r&31)<16);assert(jj_valid(&g,&s));
+ }
+ setup(&g,&s);g.y=110*JJ_Q;g.shield=1;g.thrust=1;g.distance=5000*JJ_Q;
+ for(unsigned i=0;i<JJ_HAZARDS;++i)g.hazard[i]=(jj_hazard){(int32_t)(125+i*62)*JJ_Q,(uint16_t)(i&1?140:87),(uint8_t)(i%3),i==2?30:0,1};
+ for(unsigned i=0;i<JJ_PICKUPS;++i)g.pickup[i]=(jj_pickup){(int32_t)(70+i*14)*JJ_Q,(uint16_t)(i&1?60:190),(uint8_t)(i%8==0),1};
+ fixture("stress-save.bin",&g,&s);
+}
+static void rendering(void) {
+ jj_game g; jj_stats s;setup(&g,&s);g.y=120*JJ_Q;g.shield=1;
+ g.hazard[0]=(jj_hazard){190*JJ_Q,90,JJ_VERTICAL,0,1};
+ g.hazard[1]=(jj_hazard){356*JJ_Q,151,JJ_MISSILE,50,1};
+ for(int i=0;i<7;++i)g.pickup[i]=(jj_pickup){(145+i*22)*JJ_Q,190,JJ_COIN,1};
+ for(unsigned view=0;view<=JJ_BUY;++view)for(unsigned selected=0;selected<(view==JJ_BUY?8:4);++selected) {
+ jj_invalidate();jj_render(&g,&s,view,selected,false,push);
+ if(!selected) {if(view==JJ_TITLE)shot("title.ppm");if(view==JJ_GUIDE)shot("guide.ppm");if(view==JJ_SHOP)shot("shop.ppm");if(view==JJ_PLAY)shot("gameplay.ppm");}
+ for(unsigned frame=0;frame<24;++frame) {
+ if(view==JJ_PLAY)jj_step(&g,&s,controller(&g));
+ jj_render(&g,&s,view,selected,false,push);memcpy(reference,screen,sizeof screen);
+ jj_invalidate();jj_render(&g,&s,view,selected,false,push);assert(!memcmp(screen,reference,sizeof screen));
+ }
+ unsigned before=pushes;jj_render(&g,&s,view,selected,false,push);assert(pushes==before);
+ }
+ /* Screen boundaries, the longest exhaust plume, shield and invulnerability
+ * blinking must never leave pixels on a later partial redraw. */
+ setup(&g,&s);g.next=600*JJ_Q;g.shield=1;
+ for(int i=0;i<240;++i) {
+ jj_step(&g,&s,i<100||i>215);
+ jj_render(&g,&s,JJ_PLAY,0,false,push);memcpy(reference,screen,sizeof screen);
+ jj_invalidate();jj_render(&g,&s,JJ_PLAY,0,false,push);assert(!memcmp(screen,reference,sizeof screen));
+ }
+ jj_game frozen=g;jj_stats book=s;
+ for(unsigned frame=0;frame<96;++frame) {
+ jj_menu_time(frame*80);jj_render(&g,&s,JJ_TITLE,0,false,push);
+ memcpy(reference,screen,sizeof screen);
+ jj_invalidate();jj_render(&g,&s,JJ_TITLE,0,false,push);assert(!memcmp(screen,reference,sizeof screen));
+ unsigned before=pushes;jj_render(&g,&s,JJ_TITLE,0,false,push);assert(before==pushes);
+ }
+ assert(!memcmp(&g,&frozen,sizeof g)&&!memcmp(&s,&book,sizeof s));
+}
+static void camping(void) {
+ unsigned latest[4]={0};
+ for(unsigned seed=1;seed<=200;++seed)for(unsigned mode=0;mode<4;++mode) {
+ jj_game g;jj_stats s={0};jj_new(&g,seed);jj_start(&g,&s);g.shield=(uint8_t)(mode==3);
+ for(unsigned tick=0;tick<1600&&g.phase==JJ_RUNNING;++tick)
+ jj_step(&g,&s,mode==1||(mode==2&&g.y+g.vy*10>120*JJ_Q));
+ assert(g.phase==JJ_OVER&&g.reason==1&&jj_distance(&g)<150);
+ if(jj_distance(&g)>latest[mode])latest[mode]=jj_distance(&g);
+ }
+ printf("Camping (floor / ceiling / center / floor with shield): dead by %u / %u / %u / %u meters, 200 seeds each\n",latest[0],latest[1],latest[2],latest[3]);
+}
+static void purchases(void) {
+ jj_game g;jj_stats s;setup(&g,&s);s.coins=200;s.wallet=200;
+ fixture("shop-save.bin",&g,&s);
+ assert(jj_price(1)==50&&jj_price(2)==120&&jj_price(3)==200);
+ jj_stats before=s;s.wallet=49;before=s;assert(!jj_equip(&s,1)&&!memcmp(&s,&before,sizeof s));
+ s.wallet=50;assert(jj_equip(&s,1)&&!s.wallet&&s.suit==1&&s.owned==2);
+ assert(jj_equip(&s,1)&&!s.wallet&&jj_equip(&s,0)&&!s.wallet&&s.suit==0);
+ before=s;assert(!jj_equip(&s,3)&&!jj_equip(&s,4)&&!memcmp(&s,&before,sizeof s));
+ s.wallet=200;assert(jj_equip(&s,3)&&!s.wallet&&s.suit==3&&s.owned==10);
+ uint8_t raw[JJ_SAVE_BYTES];jj_game a;jj_stats b;jj_encode(&g,&s,raw);
+ assert(jj_decode(&a,&b,raw,sizeof raw)&&b.owned==10&&b.suit==3&&!b.wallet);
+ /* Outfits must not change flight mechanics. */
+ setup(&g,&s);a=g;b=s;b.suit=2;b.owned=4;
+ for(int i=0;i<1200;++i) {
+ bool thrust=controller(&g);jj_step(&g,&s,thrust);jj_step(&a,&b,thrust);
+ assert(!memcmp(&g,&a,sizeof g)&&s.wallet==b.wallet&&s.coins==b.coins);
+ }
+}
+static void rotators(void) {
+ jj_hazard p={100*JJ_Q,120,JJ_ROTATING,0,1};int dx,dy;
+ jj_rotor(&p,0,&dx,&dy);assert(dx==36*JJ_Q&&!dy&&jj_rotor_hit(&p,0,120*JJ_Q));
+ jj_rotor(&p,32,&dx,&dy);assert(!dx&&dy==36*JJ_Q&&!jj_rotor_hit(&p,32,120*JJ_Q));
+ /* A diagonal segment misses the empty corner of its enclosing square. */
+ p.x=90*JJ_Q;assert(!jj_rotor_hit(&p,16,146*JJ_Q));
+ assert(jj_rotor_hit(&p,16,94*JJ_Q));
+ for(unsigned phase=0;phase<128;++phase) {
+ p.timer=(uint8_t)phase;p.x=64*JJ_Q;
+ jj_rotor(&p,37,&dx,&dy);
+ assert(dx*dx+dy*dy>=35*35*JJ_Q*JJ_Q&&dx*dx+dy*dy<=37*37*JJ_Q*JJ_Q);
+ assert(jj_rotor_hit(&p,37,120*JJ_Q));
+ assert(!jj_rotor_hit(&p,37,60*JJ_Q));
+ jj_game g;jj_stats s;setup(&g,&s);g.hazard[0]=p;g.hazard[0].x=210*JJ_Q;
+ uint8_t raw[JJ_SAVE_BYTES];jj_game a;jj_stats b;jj_encode(&g,&s,raw);
+ assert(jj_decode(&a,&b,raw,sizeof raw)&&!memcmp(&g,&a,sizeof g));
+ }
+ jj_game g;jj_stats s;setup(&g,&s);g.y=120*JJ_Q;g.hazard[0]=p;
+ g.hazard[0].timer=65;jj_step(&g,&s,false);assert(g.phase==JJ_OVER&&g.reason==1);
+ setup(&g,&s);g.y=120*JJ_Q;g.hazard[0]=p;g.hazard[0].timer=65;g.shield=1;
+ jj_step(&g,&s,false);assert(g.phase==JJ_RUNNING&&g.invuln==80&&!g.hazard[0].active);
+ setup(&g,&s);g.y=120*JJ_Q;g.hazard[0]=(jj_hazard){154*JJ_Q,90,JJ_ROTATING,70,1};
+ g.hazard[1]=(jj_hazard){281*JJ_Q,150,JJ_ROTATING,23,1};
+ fixture("rotor-save.bin",&g,&s);
+ for(int frame=0;frame<128;++frame) {
+ ++g.tick;jj_render(&g,&s,JJ_PLAY,0,false,push);memcpy(reference,screen,sizeof screen);
+ jj_invalidate();jj_render(&g,&s,JJ_PLAY,0,false,push);assert(!memcmp(screen,reference,sizeof screen));
+ }
+ g.shield=1;
+ for(unsigned i=0;i<4;++i)g.hazard[i]=(jj_hazard){(int32_t)(110+i*54)*JJ_Q,(uint16_t)(i&1?150:90),JJ_ROTATING,(uint8_t)(i*31),1};
+ fixture("rotor-stress-save.bin",&g,&s);
+ puts("PASS: rotating beam angles, empty corners, both directions, phase saves, shield hits and 128 redraws");
+}
+int main(void) {
+ collisions();rotators();saves();camping();purchases();courses();rendering();puts("PASS: physics, patterns, anti-camping, shop, migration, saves, redraw equivalence");return 0;
+}
diff --git a/games/jetpackjoyride/tests/test_compact_nwa.py b/games/jetpackjoyride/tests/test_compact_nwa.py
new file mode 100644
index 00000000..4874fac7
--- /dev/null
+++ b/games/jetpackjoyride/tests/test_compact_nwa.py
@@ -0,0 +1,90 @@
+#!/usr/bin/env python3
+"""Build-time LZ4 correctness and block-format boundary checks (stdlib only)."""
+import importlib.util
+from pathlib import Path
+import random
+import unittest
+
+SOURCE = Path(__file__).resolve().parents[1]/'tools/compact_nwa.py'
+SPEC = importlib.util.spec_from_file_location('compact_nwa', SOURCE)
+packing = importlib.util.module_from_spec(SPEC)
+SPEC.loader.exec_module(packing)
+
+
+class CompressionTests(unittest.TestCase):
+ def check_block(self, raw):
+ block = packing.compress_lz4(raw)
+ self.assertEqual(packing.decode_lz4(block, len(raw)), raw)
+ # Walk token boundaries independently to check the LZ4 end constraints.
+ pos, decoded, last_match, final_literals = 0, 0, None, None
+ while pos < len(block):
+ token = block[pos]
+ pos += 1
+ literal = token >> 4
+ if literal == 15:
+ while block[pos] == 255:
+ literal += 255
+ pos += 1
+ literal += block[pos]
+ pos += 1
+ pos += literal
+ decoded += literal
+ if pos == len(block):
+ final_literals = literal
+ break
+ distance = int.from_bytes(block[pos:pos+2], 'little')
+ self.assertGreater(distance, 0)
+ self.assertLessEqual(distance, decoded)
+ pos += 2
+ match = (token & 15) + 4
+ if (token & 15) == 15:
+ while block[pos] == 255:
+ match += 255
+ pos += 1
+ match += block[pos]
+ pos += 1
+ last_match = decoded
+ decoded += match
+ self.assertEqual(decoded, len(raw))
+ self.assertIsNotNone(final_literals)
+ if last_match is not None:
+ self.assertGreaterEqual(final_literals, 5)
+ self.assertLessEqual(last_match, len(raw)-12)
+ return block
+
+ def test_lengths_and_random_literals(self):
+ rng = random.Random(6140)
+ for size in (0, 1, 4, 5, 11, 12, 15, 19, 20, 254, 255, 270, 1024):
+ with self.subTest(size=size):
+ self.check_block(bytes(rng.randrange(256) for _ in range(size)))
+
+ def test_long_overlapping_matches_and_extension_bytes(self):
+ for pattern in (b'A', b'\x00\xff', bytes(range(32))):
+ raw = (pattern*packing.ICON_BYTES)[:packing.ICON_BYTES]
+ with self.subTest(pattern=pattern):
+ self.assertLess(len(self.check_block(raw)), 150)
+
+ def test_repeated_pixel_rows(self):
+ row = b'\x08\xc5'*20 + b'\xff\xff'*15 + b'\x08\xc5'*20
+ self.check_block(row*56)
+
+ def test_known_raw_block(self):
+ self.assertEqual(packing.decode_lz4(b'\x13A\x01\x00\x50hello', 13), b'A'*8+b'hello')
+
+ def test_truncated_invalid_and_oversized_output(self):
+ for block, expected in ((b'',1),(b'\xf0',1),(b'\x10',1),
+ (b'\x00\x00\x00',4),(b'\x10A\x02\x00',5),
+ (b'\x10A',2),(b'\x13A\x01\x00\x50hello',12)):
+ with self.subTest(block=block):
+ with self.assertRaises(ValueError):
+ packing.decode_lz4(block,expected)
+
+ def test_repeatable_and_bounded_input(self):
+ raw = b'abcd'*100+b'last five'
+ self.assertEqual(self.check_block(raw),self.check_block(raw))
+ with self.assertRaises(ValueError):
+ packing.compress_lz4(b'x'*65536)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/games/jetpackjoyride/tools/assets.py b/games/jetpackjoyride/tools/assets.py
new file mode 100644
index 00000000..05954bfe
--- /dev/null
+++ b/games/jetpackjoyride/tools/assets.py
@@ -0,0 +1,227 @@
+#!/usr/bin/env python3
+"""Build indexed, row-addressable sprites from the supplied Halfbrick artwork.
+
+Run with Pillow after changing assets/source. No image decoder or heap is used
+on the calculator. The generated file is checked in, so normal builds need
+neither Pillow nor access to the source archive.
+"""
+from pathlib import Path
+from PIL import Image
+import argparse
+import hashlib
+import io
+import json
+
+ROOT = Path(__file__).resolve().parents[1]
+SOURCE = ROOT / 'assets/source'
+OUT = ROOT / 'src/assets.h'
+NN = Image.Resampling.NEAREST
+LZ = Image.Resampling.LANCZOS
+images = []
+
+
+def source(name):
+ return Image.open(SOURCE / (name + '.png')).convert('RGBA')
+
+
+def add(name, image, colors=32, palette=None):
+ images.append((name, image, colors, palette))
+
+
+def crop_cell(im, i, size=32):
+ x = i % (im.width // size) * size
+ y = i // (im.width // size) * size
+ return im.crop((x, y, x + size, y + size))
+
+
+def rgb565(rgb):
+ r, g, b = rgb
+ return (r >> 3) << 11 | (g >> 2) << 5 | (b >> 3)
+
+
+def runs(row, bits):
+ """PackBits: high bit = repeat, otherwise literal; count minus one."""
+ out = bytearray()
+ x = 0
+ while x < len(row):
+ n = 1
+ while x + n < len(row) and row[x + n] == row[x] and n < 128:
+ n += 1
+ if n >= 3:
+ out.extend((0x80 | (n - 1), row[x]))
+ x += n
+ else:
+ start = x
+ x += n
+ while x < len(row) and x - start < 128:
+ if x + 2 < len(row) and row[x] == row[x + 1] == row[x + 2]:
+ break
+ x += 1
+ out.append(x - start - 1)
+ literal = row[start:x]
+ if bits == 4:
+ out.extend((literal[k] << 4) | (literal[k + 1] if k + 1 < len(literal) else 0)
+ for k in range(0, len(literal), 2))
+ else:
+ out.extend(literal)
+ return out
+
+
+def main():
+ ap = argparse.ArgumentParser(description=__doc__)
+ ap.add_argument('--check', action='store_true', help='verify deterministic generated files without writing')
+ args = ap.parse_args()
+ images.clear()
+ manifest = json.loads((ROOT / 'assets/source-manifest.json').read_text())
+ for name, entry in manifest['files'].items():
+ assert hashlib.sha256((SOURCE / (name + '.png')).read_bytes()).hexdigest() == entry['sha256'], name
+ # One low-resolution tile renders at 2x: 256x192 pixels of the real lab.
+ lab = source('laboratory').crop((0, 128, 1024, 752)).resize((128, 96), LZ)
+ add('lab', lab, 32)
+ add('floor', source('laboratory').crop((0, 752, 1024, 880)).resize((128, 12), LZ), 16)
+ add('jetpack_word', source('jetpack_word').resize((205, 59), LZ), 16)
+ add('joyride_word', source('joyride_word').resize((210, 55), LZ), 16)
+ hero = source('barry_hero')
+ add('hero', hero.crop(hero.getbbox()).resize((72, 104), LZ), 48)
+ # Body/head sheets share aligned 32-pixel cells. Ground frames 0..3,
+ # airborne frames 4..7. Composite before reducing to calculator scale.
+ frames = []
+ body, head, pack = source('barry_body'), source('barry_head'), source('machinegun')
+ pack = pack.crop(pack.getbbox()).resize((16, 16), NN)
+ for i in range(8):
+ im = Image.new('RGBA', (40, 48))
+ im.alpha_composite(pack, (0, 22))
+ im.alpha_composite(crop_cell(body, i), (7, 16))
+ im.alpha_composite(crop_cell(head, i), (7, 0))
+ frames.append(im.resize((28, 40), NN))
+ atlas = Image.new('RGB', (28 * 8, 40), '#111017')
+ for i, im in enumerate(frames):
+ atlas.paste(im.convert('RGB'), (i * 28, 0))
+ pal = atlas.quantize(colors=31, method=Image.Quantize.MEDIANCUT, dither=Image.Dither.NONE)
+ barry_colors = [tuple(pal.getpalette()[i:i + 3]) for i in range(0, 93, 3)]
+ for i, im in enumerate(frames):
+ add('barry_' + str(i), im, 32, barry_colors)
+ coins = source('coins')
+ for i in range(8):
+ add('coin_' + str(i), crop_cell(coins, i).resize((11, 11), LZ), 16)
+ add('shield', source('shield').resize((18, 18), LZ), 24)
+ add('missile', crop_cell(source('missiles'), 0).resize((28, 23), NN), 24)
+ add('zapper_cap', crop_cell(source('zapper_caps'), 0, 128).resize((15, 15), LZ), 24)
+ electricity = source('electricity')
+ for i in range(3):
+ beam = electricity.crop((0, i * 64, 1024, i * 64 + 64))
+ add('beam_h_' + str(i), beam.resize((58, 10), LZ), 16)
+ add('beam_v_' + str(i), beam.resize((70, 10), LZ).transpose(Image.Transpose.ROTATE_90), 16)
+ add('beam_c_' + str(i), beam.resize((100, 10), LZ).transpose(Image.Transpose.ROTATE_90), 16)
+ flash = source('muzzle_flash')
+ for i in range(2):
+ add('flash_' + str(i), crop_cell(flash, i, 64).resize((14, 16), NN), 16)
+ scientists = source('scientists')
+ for i in range(4):
+ # Whole person per cell, as opposed to Barry's separate body/head.
+ cell = crop_cell(scientists, i)
+ add('scientist_' + str(i), cell.resize((17, 21), NN), 24)
+ warning = source('warnings').crop((0, 0, 64, 64))
+ add('warning', warning.resize((18, 18), NN), 16)
+
+ lines = ['/* Generated by tools/assets.py. Artwork: Halfbrick; see assets/README.md. */',
+ '#ifndef JJ_ASSETS_H', '#define JJ_ASSETS_H', '#include <stdint.h>',
+ 'typedef struct { uint16_t w,h; const uint16_t *palette,*rows; const uint8_t *data; uint8_t bits; } jj_sprite;']
+ total = 0
+ report = {}
+ def array(kind, name, values, fmt=str):
+ lines.append('static const ' + kind + ' ' + name + '[] = {')
+ for k in range(0, len(values), 24):
+ lines.append(' ' + ','.join(fmt(v) for v in values[k:k + 24]) + ',')
+ lines.append('};')
+
+ for name, im, colors, shared in images:
+ rgb = im.convert('RGB')
+ if shared:
+ palette_im = Image.new('P', (1, 1))
+ flat = [v for c in shared for v in c]
+ palette_im.putpalette(flat + flat[-3:] * (256 - len(shared)))
+ indexed = rgb.quantize(palette=palette_im, dither=Image.Dither.NONE)
+ palette_rgb = shared
+ else:
+ indexed = rgb.quantize(colors=colors - 1, method=Image.Quantize.MEDIANCUT, dither=Image.Dither.NONE)
+ packed_palette = indexed.getpalette()
+ palette_rgb = [tuple(packed_palette[i:i + 3]) for i in range(0, len(packed_palette), 3)]
+ # Threshold alpha before encoding: index zero is transparent.
+ indices = [v + 1 if a >= 96 else 0 for v, a in zip(indexed.getdata(), im.getchannel('A').getdata())]
+ palette = [0] + [rgb565(c) for c in palette_rgb]
+ bits = 4 if max(indices) < 16 else 8
+ offsets = [0]
+ data = bytearray()
+ decoded = []
+ for y in range(im.height):
+ row = indices[y * im.width:(y + 1) * im.width]
+ packed = runs(row, bits)
+ # Round-trip each row and bound every index/offset at generation.
+ check = []
+ pos = 0
+ while pos < len(packed):
+ tag = packed[pos]; pos += 1
+ count = (tag & 127) + 1
+ if tag & 128:
+ check.extend([packed[pos]] * count); pos += 1
+ else:
+ if bits == 4:
+ check.extend((packed[pos + k // 2] >> (0 if k & 1 else 4)) & 15 for k in range(count))
+ pos += (count + 1) // 2
+ else:
+ check.extend(packed[pos:pos + count]); pos += count
+ assert row == check and all(v < len(palette) for v in check)
+ data.extend(packed); offsets.append(len(data)); decoded.extend(check)
+ assert len(data) < 65536
+ if shared:
+ palette_name = 'jj_barry_palette_0'
+ else:
+ palette_name = 'jj_' + name + '_palette'
+ array('uint16_t', palette_name, palette, hex)
+ array('uint16_t', 'jj_' + name + '_rows', offsets)
+ array('uint8_t', 'jj_' + name + '_data', list(data))
+ lines.append(f'static const jj_sprite jj_{name} = {{{im.width},{im.height},{palette_name},jj_{name}_rows,jj_{name}_data,{bits}}};')
+ cost = len(data) + len(offsets) * 2 + (0 if shared else len(palette) * 2)
+ total += cost
+ report[name] = dict(width=im.width, height=im.height, bits=bits, bytes=cost)
+ # Shared shirt palette: preserve warm skin/hair; tint the cool suit tones.
+ palette_lines = []
+ for suit, target in enumerate([(1, 1, 1), (0.82, 1.08, 1.24), (1.45, 0.63, 1.04), (0.83, 1.32, 0.60)]):
+ colors = [(0, 0, 0)] + barry_colors
+ if suit:
+ remapped = [colors[0]]
+ for r, g, b in colors[1:]:
+ if b > r * 1.05 and b > g * 0.95:
+ light = max(r, g, b)
+ if suit == 1:
+ light = min(235, light + 65)
+ r, g, b = [min(255, int(light * t)) for t in target]
+ remapped.append((r, g, b))
+ colors = remapped
+ palette_lines.append('static const uint16_t jj_barry_palette_' + str(suit) + '[] = {' + ','.join(hex(rgb565(c)) for c in colors) + '};')
+ lines[5:5] = palette_lines
+ for group, count in [('barry', 8), ('coin', 8), ('beam_h', 3), ('beam_v', 3), ('beam_c', 3), ('flash', 2), ('scientist', 4)]:
+ lines.append('static const jj_sprite *const jj_' + group + '[] = {' + ','.join('&jj_' + group + '_' + str(i) for i in range(count)) + '};')
+ lines.append('static const uint16_t *const jj_suit_palettes[] = {jj_barry_palette_0,jj_barry_palette_1,jj_barry_palette_2,jj_barry_palette_3};')
+ lines.append('#endif\n')
+ header = '\n'.join(lines).encode('utf-8')
+ report['total_encoded_bytes'] = total + 256
+ report_data = (json.dumps(report, indent=2) + '\n').encode('utf-8')
+ # The calculator's icon uses the supplied character artwork as well.
+ icon = Image.new('RGBA', (55, 56), '#17283d')
+ hero = source('barry_hero'); hero.thumbnail((39, 55), LZ)
+ icon.alpha_composite(hero, (9, 0))
+ icon_data = io.BytesIO()
+ icon.convert('RGB').quantize(colors=24, dither=Image.Dither.NONE).convert('RGB').save(icon_data, format='PNG', optimize=True)
+ outputs = {OUT: header, ROOT / 'assets/packed.json': report_data, ROOT / 'src/icon.png': icon_data.getvalue()}
+ for path, data in outputs.items():
+ if args.check:
+ assert path.read_bytes() == data, 'Regenerate ' + str(path)
+ else:
+ path.write_bytes(data)
+ print(json.dumps({'sprites': len(images), 'encoded_bytes': total + 256, 'check': args.check}, indent=2))
+
+
+if __name__ == '__main__':
+ main()
diff --git a/games/jetpackjoyride/tools/build.py b/games/jetpackjoyride/tools/build.py
new file mode 100644
index 00000000..c95c4bb2
--- /dev/null
+++ b/games/jetpackjoyride/tools/build.py
@@ -0,0 +1,90 @@
+#!/usr/bin/env python3
+"""Optional portable standalone build; the normal NumPlay build uses Make.
+
+python tools/build.py --toolchain /path/to/arm/bin --nwlink /path/to/nwlink/bin/nwlink
+Requires nwlink 1.0.0, ARM GCC, Pillow (icon generation), pyelftools (size report).
+"""
+import argparse
+import json
+import os
+from pathlib import Path
+import shlex
+import shutil
+import subprocess
+import sys
+
+ROOT = Path(__file__).resolve().parents[1]
+
+
+def main():
+ ap = argparse.ArgumentParser(description=__doc__)
+ ap.add_argument('--toolchain', type=Path)
+ ap.add_argument('--nwlink', default='nwlink')
+ ap.add_argument('--node', default='node')
+ a = ap.parse_args()
+ out = ROOT / 'output'
+ out.mkdir(exist_ok=True)
+
+ def run(*args, capture=False):
+ return subprocess.run([str(v) for v in args], cwd=ROOT, check=True,
+ capture_output=capture, text=capture)
+
+ def tool(name):
+ binary = 'arm-none-eabi-' + name + ('.exe' if os.name == 'nt' else '')
+ return a.toolchain / binary if a.toolchain else binary
+
+ nw = [a.node, a.nwlink] if Path(a.nwlink).is_file() and not a.nwlink.endswith(('.exe', '.cmd')) else [a.nwlink]
+ flags = ['-std=c11', '-Os', '-Wall', '-Wextra', '-Werror', '-fno-math-errno',
+ '-fsingle-precision-constant', '-ffunction-sections', '-fdata-sections',
+ '-fstack-usage', '-fno-tree-loop-distribute-patterns', '-flto', '-fvisibility=internal']
+ flags += shlex.split(run(*nw, 'eadk-cflags-device', capture=True).stdout, posix=True)
+ # shlex on Windows may treat the include path's backslashes as escapes;
+ # nwlink prints forward slashes on Windows, so this remains portable.
+ objects = []
+ for source in ('main', 'physics', 'save', 'render'):
+ obj = out / (source + '.o')
+ run(tool('gcc'), *flags, '-c', ROOT / 'src' / (source + '.c'), '-o', obj)
+ objects.append(obj)
+ run(*nw, 'png-icon-o', ROOT / 'src/icon.png', out / 'icon.o')
+ packer = ROOT / 'tools/compact_nwa.py'
+ icon_report = json.loads(run(sys.executable, packer, 'icon', out / 'icon.o',
+ out / 'icon-compact.o', '--objcopy', tool('objcopy'), capture=True).stdout)
+ common = [tool('gcc'), *flags, '-nostartfiles', '--specs=nano.specs',
+ '-Wl,--relocatable,--gc-sections,-e,main', '-flinker-output=nolto-rel', *objects]
+ run(*common, '-lm', '-o', out / 'module.o')
+ run(*common, '-Wl,-u,eadk_app_name,-u,eadk_app_icon,-u,eadk_api_level', out / 'icon-compact.o',
+ '-lm', '-o', out / 'standalone.o')
+ run(sys.executable, packer, 'app', out / 'standalone.o', out / 'jetpackjoyride-debug.nwa',
+ '--ld', tool('ld'))
+ run(sys.executable, packer, 'release', out / 'jetpackjoyride-debug.nwa',
+ out / 'JetpackJoyride.nwa', '--objcopy', tool('objcopy'))
+ if os.name != 'nt':
+ shutil.copyfile(out / 'JetpackJoyride.nwa', out / 'jetpackjoyride.nwa')
+ profiles = []
+ from elftools.elf.elffile import ELFFile
+ for name, base, ram in [('n0110', 0x20000000, 148928), ('n0115-custom', 0x20000000, 133652),
+ ('n0120', 0x24000000, 153676), ('upsilon', 0x20000000, 107674)]:
+ options = ['--ram-start', hex(base + 0x37000 - ram), '--ram-length', str(ram)]
+ elf, binary = out / (name + '.elf'), out / (name + '.bin')
+ run(*nw, 'nwa-elf', out / 'JetpackJoyride.nwa', elf, *options)
+ run(*nw, 'nwa-bin', out / 'JetpackJoyride.nwa', binary, *options)
+ debug_binary = out / (name + '-debug.bin')
+ run(*nw, 'nwa-bin', out / 'jetpackjoyride-debug.nwa', debug_binary, *options)
+ if binary.read_bytes() != debug_binary.read_bytes():
+ raise RuntimeError(f'Release compaction changed installed bytes on {name}')
+ with elf.open('rb') as f:
+ e = ELFFile(f)
+ static_ram = sum(s['sh_size'] for s in e.iter_sections() if s.name in ('.data', '.bss'))
+ if static_ram > 12288:
+ raise RuntimeError(f'Static RAM budget exceeded: {static_ram}')
+ if binary.stat().st_size > 65536:
+ raise RuntimeError('Installed flash budget exceeded')
+ profiles.append(dict(profile=name, installed_flash=binary.stat().st_size, static_ram=static_ram, ram_limit=ram))
+ report = dict(nwa_bytes=(out / 'JetpackJoyride.nwa').stat().st_size, save_bytes=260,
+ **icon_report, profiles=profiles)
+ (out / 'sizes.json').write_text(json.dumps(report, indent=2) + '\n')
+ print(json.dumps(report, indent=2))
+
+
+if __name__ == '__main__':
+ main()
diff --git a/games/jetpackjoyride/tools/compact_nwa.py b/games/jetpackjoyride/tools/compact_nwa.py
new file mode 100644
index 00000000..f320bb54
--- /dev/null
+++ b/games/jetpackjoyride/tools/compact_nwa.py
@@ -0,0 +1,228 @@
+#!/usr/bin/env python3
+"""Lossless standalone NWA packing. Python standard library + ARM binutils.
+
+Keep the standard ELF/NWI formats: no runtime decoder, extra RAM, or archive.
+"""
+import argparse
+from bisect import bisect_left, insort
+import json
+from pathlib import Path
+import subprocess
+import tempfile
+
+ICON_BYTES = 55 * 56 * 2
+
+
+def decode_lz4(data, expected_size):
+ """Decode a raw LZ4 block, with an exact output bound for launcher icons."""
+ out = bytearray()
+ pos = 0
+
+ def length(value):
+ nonlocal pos
+ if value == 15:
+ while True:
+ if pos >= len(data):
+ raise ValueError('Truncated LZ4 length')
+ extra = data[pos]
+ pos += 1
+ value += extra
+ if extra != 255:
+ break
+ return value
+
+ while pos < len(data):
+ token = data[pos]
+ pos += 1
+ size = length(token >> 4)
+ if pos + size > len(data) or len(out) + size > expected_size:
+ raise ValueError('Invalid LZ4 literal run')
+ out += data[pos:pos + size]
+ pos += size
+ if pos == len(data):
+ break
+ if pos + 2 > len(data):
+ raise ValueError('Truncated LZ4 offset')
+ distance = data[pos] | data[pos + 1] << 8
+ pos += 2
+ size = length(token & 15) + 4
+ if not distance or distance > len(out) or len(out) + size > expected_size:
+ raise ValueError('Invalid LZ4 match')
+ for _ in range(size):
+ out.append(out[-distance])
+ if len(out) != expected_size:
+ raise ValueError('Unexpected decoded icon size')
+ return bytes(out)
+
+
+def _extension_cost(value, threshold):
+ return 0 if value < threshold else 1 + (value - threshold) // 255
+
+
+def compress_lz4(data):
+ """Find a minimum-size raw LZ4 parse for a small (<= 65535 byte) image.
+
+ A suffix array finds the longest legal previous match. Dynamic programming
+ chooses literal/match lengths, including extension-byte costs. The final
+ five bytes are literals; the last match starts at least twelve bytes from
+ the end, as required by standard LZ4 block decoders.
+ """
+ n = len(data)
+ if n > 65535:
+ raise ValueError('Only small build-time assets are supported')
+ if not n:
+ return b'\0'
+ suffixes = sorted(range(n), key=lambda i: data[i:])
+ rank = [0] * n
+ for r, pos in enumerate(suffixes):
+ rank[pos] = r
+ seen = []
+ matches = [(0, 0)] * n
+ for i in range(n - 11):
+ r = rank[i]
+ at = bisect_left(seen, r)
+ best, distance = 0, 0
+ # Among earlier suffixes, a lexicographic neighbour has the longest
+ # common prefix. Overlapping matches are legal in LZ4.
+ for q in seen[max(0, at - 1):at + 1]:
+ j = suffixes[q]
+ lo, hi = 0, n - i - 5
+ while lo < hi:
+ mid = (lo + hi + 1) // 2
+ if data[i:i + mid] == data[j:j + mid]:
+ lo = mid
+ else:
+ hi = mid - 1
+ if lo > best:
+ best, distance = lo, i - j
+ matches[i] = best, distance
+ insort(seen, r)
+
+ dp = [0] * (n + 1)
+ plan = [None] * n
+ match_cost = [0] * n
+ match_length = [0] * n
+ starts = []
+ for i in range(n - 1, -1, -1):
+ best = n - i + 1 + _extension_cost(n - i, 15)
+ longest, _ = matches[i]
+ if longest >= 4:
+ cost, size = min((2 + _extension_cost(size, 19) + dp[i + size], size)
+ for size in range(4, longest + 1))
+ match_cost[i], match_length[i] = cost, size
+ starts.append(i)
+ for j in reversed(starts):
+ literal = j - i
+ if literal + 3 >= best:
+ break
+ cost = 1 + literal + _extension_cost(literal, 15) + match_cost[j]
+ if cost < best:
+ best = cost
+ plan[i] = j, match_length[j], matches[j][1]
+ dp[i] = best
+
+ out = bytearray()
+
+ def emit_length(value):
+ while value >= 255:
+ out.append(255)
+ value -= 255
+ out.append(value)
+
+ anchor = 0
+ while anchor < n:
+ entry = plan[anchor]
+ if entry is None:
+ literal = n - anchor
+ out.append(min(literal, 15) << 4)
+ if literal >= 15:
+ emit_length(literal - 15)
+ out += data[anchor:]
+ break
+ j, size, distance = entry
+ literal = j - anchor
+ out.append(min(literal, 15) << 4 | min(size - 4, 15))
+ if literal >= 15:
+ emit_length(literal - 15)
+ out += data[anchor:j]
+ out += bytes((distance & 255, distance >> 8))
+ if size >= 19:
+ emit_length(size - 19)
+ anchor = j + size
+ if len(out) != dp[0] or decode_lz4(out, n) != data:
+ raise ValueError('Lossless compression verification failed')
+ return bytes(out)
+
+
+def compact_icon(source, output, objcopy):
+ output.parent.mkdir(parents=True, exist_ok=True)
+ with tempfile.TemporaryDirectory(dir=output.parent) as folder:
+ folder = Path(folder)
+ original, packed, obj = folder/'original.nwi', folder/'packed.nwi', folder/'icon.o'
+ section = '.rodata.eadk_app_icon'
+ subprocess.run([objcopy, '--dump-section=' + section + '=' + str(original),
+ str(source), str(obj)], check=True)
+ before = original.read_bytes()
+ pixels = decode_lz4(before, ICON_BYTES)
+ after = compress_lz4(pixels)
+ if len(after) > len(before):
+ after = before
+ packed.write_bytes(after)
+ subprocess.run([objcopy, '--update-section=' + section + '=' + str(packed),
+ str(obj), str(output)], check=True)
+ # Verify the bytes actually stored in the resulting ELF, too.
+ subprocess.run([objcopy, '--dump-section=' + section + '=' + str(packed),
+ str(output), str(folder/'verify.o')], check=True)
+ if decode_lz4(packed.read_bytes(), ICON_BYTES) != pixels:
+ raise ValueError('Packed icon pixels changed')
+ return dict(source_icon_bytes=len(before), icon_bytes=len(after), decoded_icon_bytes=ICON_BYTES)
+
+
+def compact_app(source, output, linker):
+ output.parent.mkdir(parents=True, exist_ok=True)
+ script = Path(__file__).with_name('standalone.ld')
+ with tempfile.TemporaryDirectory(dir=output.parent) as folder:
+ packed = Path(folder)/'packed.nwa'
+ subprocess.run([linker, '--relocatable', '--script', str(script), str(source),
+ '-o', str(packed)], check=True)
+ output.write_bytes(packed.read_bytes())
+
+
+def compact_release(source, output, objcopy):
+ """Remove unused ARM mapping symbols from the transport ELF only.
+
+ GNU objcopy preserves $t/$d symbols specially even when unused. Rename
+ them in a temporary release copy, then let objcopy decide which symbols
+ relocations still need. Keep the debug ELF intact for ARM disassembly.
+ Python builders compare release/debug bytes on all supported profiles;
+ Make's check target compares them on the smallest RAM profile.
+ """
+ output.parent.mkdir(parents=True, exist_ok=True)
+ with tempfile.TemporaryDirectory(dir=output.parent) as folder:
+ folder = Path(folder)
+ stripped, renamed = folder/'stripped.nwa', folder/'renamed.nwa'
+ subprocess.run([objcopy, '--strip-unneeded', str(source), str(stripped)], check=True)
+ subprocess.run([objcopy, '--redefine-sym=$t=unused_thumb_marker',
+ '--redefine-sym=$d=unused_data_marker', str(stripped),
+ str(renamed)], check=True)
+ subprocess.run([objcopy, '--strip-unneeded', str(renamed), str(output)], check=True)
+
+
+def main():
+ ap = argparse.ArgumentParser(description=__doc__)
+ ap.add_argument('kind', choices=('icon', 'app', 'release'))
+ ap.add_argument('source', type=Path)
+ ap.add_argument('output', type=Path)
+ ap.add_argument('--objcopy', default='arm-none-eabi-objcopy')
+ ap.add_argument('--ld', default='arm-none-eabi-ld')
+ args = ap.parse_args()
+ if args.kind == 'icon':
+ print(json.dumps(compact_icon(args.source, args.output, args.objcopy)))
+ elif args.kind == 'release':
+ compact_release(args.source, args.output, args.objcopy)
+ else:
+ compact_app(args.source, args.output, args.ld)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/games/jetpackjoyride/tools/icon.py b/games/jetpackjoyride/tools/icon.py
new file mode 100644
index 00000000..ed0ca055
--- /dev/null
+++ b/games/jetpackjoyride/tools/icon.py
@@ -0,0 +1,6 @@
+#!/usr/bin/env python3
+"""Regenerate the Halfbrick-artwork launcher icon and packed sprites together."""
+from assets import main
+
+if __name__ == '__main__':
+ main()
diff --git a/games/jetpackjoyride/tools/standalone.ld b/games/jetpackjoyride/tools/standalone.ld
new file mode 100644
index 00000000..28679582
--- /dev/null
+++ b/games/jetpackjoyride/tools/standalone.ld
@@ -0,0 +1,15 @@
+/* Compact a standalone NWA after the first link has removed unused code.
+ * Keep EADK metadata separate, and preserve mergeable strings for nwlink.
+ * NumPlay modules retain their original sections for launcher garbage collection.
+ */
+SECTIONS {
+ .rodata.eadk_app_name : { *(.rodata.eadk_app_name) }
+ .rodata.eadk_app_icon : { *(.rodata.eadk_app_icon) }
+ .rodata.eadk_api_level : { *(.rodata.eadk_api_level) }
+ .text : { *(.text.startup.main) *(.text .text.*) }
+ .rodata.str1.1 : { *(.rodata*.str1.1) }
+ .rodata : { *(.rodata .rodata.*) }
+ .data : { *(.data .data.*) }
+ .bss : { *(.bss .bss.*) *(COMMON) }
+ /DISCARD/ : { *(.comment) *(.note.GNU-stack) }
+}