diff --git a/.gitattributes b/.gitattributes index 1d8da2a..0906e8c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,3 +2,4 @@ assets/skeleton-source.svg -text *.png binary *.DSK binary +*.DAT binary diff --git a/BONEQ.DSK b/BONEQ.DSK index db0fc32..01d1bf1 100644 Binary files a/BONEQ.DSK and b/BONEQ.DSK differ diff --git a/Makefile b/Makefile index 474e2a2..18cb567 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ CPPFLAGS += -DTEST_SEED=2709 endif CPPFLAGS += -I. CFLAGS = --coco --intermediate --stack-space=2048 $(OPTIM) -SOURCES = main.c src/quiz.c src/ui.c src/bones.c src/map_data.c +SOURCES = main.c src/quiz.c src/ui.c src/bones.c src/map_data.c src/graphics.c src/geometry.c OBJECTS = $(SOURCES:%.c=obj/%.o) .PHONY: all build disk clean assets test all: disk @@ -22,18 +22,19 @@ build: build/BONEQ.bin disk: build/BONEQ.dsk build/BONEQ.bin: $(OBJECTS) @mkdir -p build - "$(CMOC)" --coco --intermediate --org=2000 --limit=7800 -o $@ $(OBJECTS) -lgime -linput -lbcontrol -lhirestxt + "$(CMOC)" --coco --intermediate --org=2000 --limit=7800 -o $@ $(OBJECTS) -linput -lbcontrol -lhirestxt -lbank -ldecbfile # Explicit project headers avoid CMOC .d paths to expired VCC build snapshots. -obj/%.o: %.c quiz.h ui.h map_data.h Makefile +obj/%.o: %.c quiz.h ui.h map_data.h graphics.h geometry.h Makefile @mkdir -p $(dir $@) "$(CMOC)" $(CPPFLAGS) $(CFLAGS) --intdir=$(dir $@) -c -o $@ $< obj/boot.bin: tools/boot.c Makefile @mkdir -p obj "$(CMOC)" --dos -O0 --limit=2800 -o $@ $< -build/BONEQ.dsk: build/BONEQ.bin obj/boot.bin +build/BONEQ.dsk: build/BONEQ.bin obj/boot.bin assets/generated/BONES.DAT $(PERL) -e 'print chr(255) x (35*18*256)' > $@ "$(INSTALL_LOADER)" $@ obj/boot.bin "$(WRITECOCOFILE)" $@ build/BONEQ.bin + "$(WRITECOCOFILE)" --binary $@ assets/generated/BONES.DAT assets: python3 tools/prepare_questions.py python3 tools/prepare_assets.py diff --git a/README.md b/README.md index 40f8294..e5caf65 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,14 @@ # Bone Quest for CoCo An anatomy quiz for a 512 KB Color Computer 3, built from Capital Quest's working -quiz foundation. Identify 25 major bones and bone groups on a human skeleton, +quiz foundation. Identify 28 skeletal structures on a human skeleton, choose among four names or type the answer, then review missed questions. +The skeleton uses native 640 × 225 graphics with four colors and page swapping. Download the ready-to-test [BONEQ.DSK](BONEQ.DSK). Both complete quiz modes have been checked in VCC Plus on emulated MC6809 and HD6309 processors. -![Bone Quest identifying the neck vertebrae in the full skeleton and enlarged detail view](docs/images/multiple-choice.png) +![Bone Quest identifying ribs in the high-resolution full skeleton and enlarged chest view](docs/images/multiple-choice.png) ## Machine and loading @@ -19,23 +20,30 @@ or write to its disk. Use disposable copies while developing. ## Controls and rules -- Title: 1 multiple choice, 2 typed answers, C credits, Q quit to BASIC. +- At any screen, Q, Escape or CoCo Break quits to BASIC, including during + a question or the automatic feedback pause. +- Title: 1 multiple choice, 2 typed answers, C credits. - Multiple choice: 1–4 selects an answer. The correct slot is chosen randomly from the three that were not correct last time; the first question can use any slot. Feedback advances automatically after its sound and reading pause. -- Typed answers: Enter submits, Backspace edits, Esc/CoCo Break reveals, Space advances +- Typed answers: Enter submits, Backspace edits, blank Enter reveals, Space advances after feedback. Case and extra spaces are ignored. Common names such as collarbone, shoulder blade, thighbone, kneecap, shinbone and tailbone are accepted. A close spelling offers R to retry or V to reveal; a corrected answer earns - one point, with corrections counted separately. The entry limit is 33 characters. -- Progress: teal unanswered, purple correct, red missed, yellow current. The full - skeleton keeps context while a detail panel enlarges the selected area. + one point, with corrections counted separately. A blank answer or reveal counts + as a miss. The entry limit is 33 characters. +- Progress: white bones, red missed structures, yellow current. Correct answers + return to white; feedback and the score confirm success. The full skeleton keeps + context while a detail panel enlarges the selected area. Dark linework separates + neighboring bones and individual ribs. Unquizzed anatomy stays white for context. - Results: R review, N next review page, B back, P play again, Q quit. Each topic is - asked once. One correct answer earns one point; percentage is correct/25×100. + asked once. One correct answer earns one point; percentage is correct/28×100. -The quiz covers 25 named major bones/groups shown by the supplied anterior-view -illustration, not every individual bone in an adult skeleton. Paired left/right -counterparts share a question. Finger and toe phalanges are separate topics; +The quiz follows the 28 labels in the supplied reference: bones, bone groups, +bone parts and two facial cavities. It does not cover every individual bone +in an adult skeleton. Paired left/right counterparts share a question. The +manubrium, sternum body and xiphoid process are separate topics, as are the +ilium and pubis. Finger and toe phalanges are separate topics; bare "phalanges" is deliberately not a complete answer. See docs/ANATOMY.md. ## Build @@ -53,11 +61,11 @@ make VCC_CONFIGURATION=Release disk ``` Debug uses optimized code with frame pointers; Test uses deterministic seed 2709. -Clean between configurations in one working folder. Generated anatomy/drawing C -is retained for normal builds. Optional asset regeneration needs Python 3, Pillow +Clean between configurations in one working folder. Generated anatomy metadata +and BONES.DAT are retained for normal builds. Optional asset regeneration needs Python 3, Pillow and rsvg-convert; optional host logic tests need a host C compiler. After editing data/bones.json or the skeleton artwork, run make assets to refresh -the retained C tables. make test detects stale question data and invalid geometry. +the retained metadata and drawing data. make test detects stale question data and invalid geometry. ## Credits and source @@ -67,8 +75,8 @@ GPL-3.0-or-later. Bone Quest is a separate project; Capital Quest is unchanged. Skeleton artwork: Mariana Ruiz Villarreal (LadyofHats), author's public-domain release via Wikimedia Commons. The original SVG and source receipt are retained. -Adaptations remove labels, reduce resolution, recolor and encode per-topic masks -and selected detail views. See assets/CREDITS.md and docs/ANATOMY.md. +Adaptations remove labels, fit the CoCo pixel aspect, preserve bone/rib linework, +recolor and encode per-topic masks and enlarged detail views. See assets/CREDITS.md and docs/ANATOMY.md. The game remains GPL-3.0-or-later; preserve the full LICENSE and component notices. Pierre Sarrazin's font and boot helper keep their public-domain headers. The diff --git a/assets/CREDITS.md b/assets/CREDITS.md index 670612a..559da36 100644 --- a/assets/CREDITS.md +++ b/assets/CREDITS.md @@ -5,14 +5,21 @@ Original: **Human skeleton front en.svg**, by **Mariana Ruiz Villarreal (LadyofHats)**, released into the public domain by its author. -- Description/terms: https://commons.wikimedia.org/wiki/File: Human_skeleton_front_en.svg +- Description/terms: https://commons.wikimedia.org/wiki/File:Human_skeleton_front_en.svg - Original SVG: https://upload.wikimedia.org/wikipedia/commons/c/ca/Human_skeleton_front_en.svg - Retained source: skeleton-source.svg; exact download hash: source-receipt.json. The author grants use for any purpose where a public-domain dedication is not legally possible. Original metadata remains in the retained SVG. Adaptations for Bone Quest remove the printed labels and leader lines, reduce resolution, -recolor the drawing and encode selected bone/group masks and detail views. +recolor the drawing and encode selected structure masks and detail views. +The 28-topic adaptation retains source-derived linework and rib spaces, uses a black canvas for outer contours, and separates the sternum and hip parts by artist-coordinate +regions. Orbital and nasal cavity highlights use the original facial recesses. The left +thumb chain is rotated toward the palm as a pose adaptation, preserving its +relative bone lengths and joints; the retained SVG remains byte-identical. +See data/geometry-manifest.json for exact segmentation and conversion details. +The additional user-supplied raster reference guides the topic list and linework +style; its pixels are not included in the game. This is an educational front-view diagram; grouped and paired bones are not individually counted questions. No endorsement by the artist is implied. diff --git a/assets/generated/BONES.DAT b/assets/generated/BONES.DAT new file mode 100644 index 0000000..658137c Binary files /dev/null and b/assets/generated/BONES.DAT differ diff --git a/assets/generated/chest-display-preview.png b/assets/generated/chest-display-preview.png new file mode 100644 index 0000000..b0a7c49 Binary files /dev/null and b/assets/generated/chest-display-preview.png differ diff --git a/assets/generated/chest-preview.png b/assets/generated/chest-preview.png index 272d56d..f6302eb 100644 Binary files a/assets/generated/chest-preview.png and b/assets/generated/chest-preview.png differ diff --git a/assets/generated/chest-regions.png b/assets/generated/chest-regions.png index b741803..e35ef8c 100644 Binary files a/assets/generated/chest-regions.png and b/assets/generated/chest-regions.png differ diff --git a/assets/generated/foot-display-preview.png b/assets/generated/foot-display-preview.png new file mode 100644 index 0000000..7c2b798 Binary files /dev/null and b/assets/generated/foot-display-preview.png differ diff --git a/assets/generated/foot-preview.png b/assets/generated/foot-preview.png index 5ffa7fb..e22de64 100644 Binary files a/assets/generated/foot-preview.png and b/assets/generated/foot-preview.png differ diff --git a/assets/generated/foot-regions.png b/assets/generated/foot-regions.png index 0e8f028..3349c9d 100644 Binary files a/assets/generated/foot-regions.png and b/assets/generated/foot-regions.png differ diff --git a/assets/generated/hand-display-preview.png b/assets/generated/hand-display-preview.png new file mode 100644 index 0000000..4dedd7d Binary files /dev/null and b/assets/generated/hand-display-preview.png differ diff --git a/assets/generated/hand-preview.png b/assets/generated/hand-preview.png index 26410c6..792c7e9 100644 Binary files a/assets/generated/hand-preview.png and b/assets/generated/hand-preview.png differ diff --git a/assets/generated/hand-regions.png b/assets/generated/hand-regions.png index 8bb700d..bbd82ca 100644 Binary files a/assets/generated/hand-regions.png and b/assets/generated/hand-regions.png differ diff --git a/assets/generated/head-display-preview.png b/assets/generated/head-display-preview.png new file mode 100644 index 0000000..a7f9812 Binary files /dev/null and b/assets/generated/head-display-preview.png differ diff --git a/assets/generated/head-preview.png b/assets/generated/head-preview.png index 92d797e..2cf4b5c 100644 Binary files a/assets/generated/head-preview.png and b/assets/generated/head-preview.png differ diff --git a/assets/generated/head-regions.png b/assets/generated/head-regions.png index 10b4573..bdfc06d 100644 Binary files a/assets/generated/head-regions.png and b/assets/generated/head-regions.png differ diff --git a/assets/generated/overview-display-preview.png b/assets/generated/overview-display-preview.png new file mode 100644 index 0000000..5ffc586 Binary files /dev/null and b/assets/generated/overview-display-preview.png differ diff --git a/assets/generated/overview-preview.png b/assets/generated/overview-preview.png index 0c35953..8f87ea9 100644 Binary files a/assets/generated/overview-preview.png and b/assets/generated/overview-preview.png differ diff --git a/assets/generated/overview-regions.png b/assets/generated/overview-regions.png index 750ad95..65c214e 100644 Binary files a/assets/generated/overview-regions.png and b/assets/generated/overview-regions.png differ diff --git a/assets/generated/spine-display-preview.png b/assets/generated/spine-display-preview.png new file mode 100644 index 0000000..484dbc4 Binary files /dev/null and b/assets/generated/spine-display-preview.png differ diff --git a/assets/generated/spine-preview.png b/assets/generated/spine-preview.png index 3a75bc3..d58638e 100644 Binary files a/assets/generated/spine-preview.png and b/assets/generated/spine-preview.png differ diff --git a/assets/generated/spine-regions.png b/assets/generated/spine-regions.png index 38486f9..5634f29 100644 Binary files a/assets/generated/spine-regions.png and b/assets/generated/spine-regions.png differ diff --git a/data/bones.json b/data/bones.json index 6ddb44d..8bf8560 100644 --- a/data/bones.json +++ b/data/bones.json @@ -1,56 +1,12 @@ [ { - "code": "CRANIUM", - "name": "Cranium", - "hint": "Head above the lower jaw", + "code": "SKULL", + "name": "Skull", + "hint": "Head, including the lower jaw", "aliases": [ - "skull" - ] - }, - { - "code": "MANDIBLE", - "name": "Mandible", - "hint": "Lower jaw", - "aliases": [ - "lower jaw", - "jawbone" - ] - }, - { - "code": "CLAVICLE", - "name": "Clavicle", - "hint": "Front of the shoulder", - "aliases": [ - "collarbone", - "collar bone" - ] - }, - { - "code": "SCAPULA", - "name": "Scapula", - "hint": "Back of the shoulder", - "aliases": [ - "shoulder blade", - "shoulderblade" - ] - }, - { - "code": "STERNUM", - "name": "Sternum", - "hint": "Center of the chest", - "aliases": [ - "breastbone", - "breast bone" - ] - }, - { - "code": "RIBS", - "name": "Ribs", - "hint": "Curving around the chest", - "aliases": [ - "rib", - "rib bones" - ] + "cranium" + ], + "kind": "bone_group" }, { "code": "CERVICAL", @@ -59,15 +15,36 @@ "aliases": [ "neck vertebrae", "cervical vertebra" - ] + ], + "kind": "bone_group" }, { - "code": "THORACIC", - "name": "Thoracic vertebrae", - "hint": "Upper and middle back", + "code": "MANUBRIUM", + "name": "Manubrium", + "hint": "Upper breastbone section", "aliases": [ - "thoracic vertebra" - ] + "manubrium sterni" + ], + "kind": "bone_part" + }, + { + "code": "STERNUM", + "name": "Body of sternum", + "hint": "Middle breastbone section", + "aliases": [ + "sternal body", + "sternum body" + ], + "kind": "bone_part" + }, + { + "code": "XIPHOID", + "name": "Xiphoid process", + "hint": "Small tip of the breastbone", + "aliases": [ + "xiphoid" + ], + "kind": "bone_part" }, { "code": "LUMBAR", @@ -76,7 +53,15 @@ "aliases": [ "lumbar vertebra", "lower back vertebrae" - ] + ], + "kind": "bone_group" + }, + { + "code": "ILIUM", + "name": "Ilium", + "hint": "Upper flared part of the hip", + "aliases": [], + "kind": "bone_part" }, { "code": "SACRUM", @@ -84,7 +69,8 @@ "hint": "Base of spine above tailbone", "aliases": [ "sacral bone" - ] + ], + "kind": "bone" }, { "code": "COCCYX", @@ -93,68 +79,17 @@ "aliases": [ "tailbone", "tail bone" - ] + ], + "kind": "bone" }, { - "code": "PELVIS", - "name": "Pelvic girdle", - "hint": "Hip region, on either side", + "code": "PUBIS", + "name": "Pubis", + "hint": "Front lower part of the hip", "aliases": [ - "hip bones", - "hip girdle", - "coxal bones" - ] - }, - { - "code": "HUMERUS", - "name": "Humerus", - "hint": "Upper arm", - "aliases": [ - "upper arm bone" - ] - }, - { - "code": "RADIUS", - "name": "Radius", - "hint": "Forearm, thumb side", - "aliases": [ - "radius bone" - ] - }, - { - "code": "ULNA", - "name": "Ulna", - "hint": "Forearm, little-finger side", - "aliases": [ - "ulna bone" - ] - }, - { - "code": "CARPALS", - "name": "Carpals", - "hint": "Wrist", - "aliases": [ - "wrist bones", - "carpal bones" - ] - }, - { - "code": "METACARPALS", - "name": "Metacarpals", - "hint": "Palm between wrist and fingers", - "aliases": [ - "palm bones", - "metacarpal bones" - ] - }, - { - "code": "FINGERS", - "name": "Finger phalanges", - "hint": "Digits of the hand", - "aliases": [ - "finger bones", - "hand phalanges" - ] + "pubic bone" + ], + "kind": "bone_part" }, { "code": "FEMUR", @@ -163,7 +98,8 @@ "aliases": [ "thighbone", "thigh bone" - ] + ], + "kind": "bone" }, { "code": "PATELLA", @@ -172,42 +108,29 @@ "aliases": [ "kneecap", "knee cap" - ] - }, - { - "code": "TIBIA", - "name": "Tibia", - "hint": "Lower leg, inner side", - "aliases": [ - "shinbone", - "shin bone" - ] - }, - { - "code": "FIBULA", - "name": "Fibula", - "hint": "Lower leg, outer side", - "aliases": [ - "calf bone", - "calfbone" - ] + ], + "kind": "bone" }, { "code": "TARSALS", "name": "Tarsals", "hint": "Rear foot and ankle", "aliases": [ + "tarsus", "ankle bones", "tarsal bones" - ] + ], + "kind": "bone_group" }, { "code": "METATARSALS", "name": "Metatarsals", "hint": "Mid-foot behind the toes", "aliases": [ + "metatarsus", "metatarsal bones" - ] + ], + "kind": "bone_group" }, { "code": "TOES", @@ -216,6 +139,135 @@ "aliases": [ "toe bones", "foot phalanges" - ] + ], + "kind": "bone_group" + }, + { + "code": "ORBIT", + "name": "Orbital cavity", + "hint": "Bony space around the eye", + "aliases": [ + "eye socket", + "orbit" + ], + "kind": "cavity" + }, + { + "code": "NASAL", + "name": "Nasal cavity", + "hint": "Space behind the nose", + "aliases": [ + "nose cavity" + ], + "kind": "cavity" + }, + { + "code": "CLAVICLE", + "name": "Clavicle", + "hint": "Front of the shoulder", + "aliases": [ + "collarbone", + "collar bone" + ], + "kind": "bone" + }, + { + "code": "SCAPULA", + "name": "Scapula", + "hint": "Back of the shoulder", + "aliases": [ + "shoulder blade", + "shoulderblade" + ], + "kind": "bone" + }, + { + "code": "RIBS", + "name": "Ribs", + "hint": "Curving around the chest", + "aliases": [ + "rib", + "rib bones" + ], + "kind": "bone_group" + }, + { + "code": "HUMERUS", + "name": "Humerus", + "hint": "Upper arm", + "aliases": [ + "upper arm bone" + ], + "kind": "bone" + }, + { + "code": "ULNA", + "name": "Ulna", + "hint": "Forearm, little-finger side", + "aliases": [ + "ulna bone" + ], + "kind": "bone" + }, + { + "code": "RADIUS", + "name": "Radius", + "hint": "Forearm, thumb side", + "aliases": [ + "radius bone" + ], + "kind": "bone" + }, + { + "code": "CARPALS", + "name": "Carpals", + "hint": "Wrist", + "aliases": [ + "carpus", + "wrist bones", + "carpal bones" + ], + "kind": "bone_group" + }, + { + "code": "METACARPALS", + "name": "Metacarpals", + "hint": "Palm between wrist and fingers", + "aliases": [ + "metacarpus", + "palm bones", + "metacarpal bones" + ], + "kind": "bone_group" + }, + { + "code": "FINGERS", + "name": "Finger phalanges", + "hint": "Digits of the hand", + "aliases": [ + "finger bones", + "hand phalanges" + ], + "kind": "bone_group" + }, + { + "code": "FIBULA", + "name": "Fibula", + "hint": "Lower leg, outer side", + "aliases": [ + "calf bone", + "calfbone" + ], + "kind": "bone" + }, + { + "code": "TIBIA", + "name": "Tibia", + "hint": "Lower leg, inner side", + "aliases": [ + "shinbone", + "shin bone" + ], + "kind": "bone" } ] diff --git a/data/geometry-manifest.json b/data/geometry-manifest.json index 197ece4..9a683fc 100644 --- a/data/geometry-manifest.json +++ b/data/geometry-manifest.json @@ -1,5 +1,6 @@ { - "schemaVersion": 1, + "schemaVersion": 3, + "encoding": "delta-runs-v1", "source": { "file": "assets/skeleton-source.svg", "sha256": "501752c94533439a31521a929a10ad1dd1b781f588d44fc87144c426a38b8773", @@ -8,243 +9,255 @@ "page": "https://commons.wikimedia.org/wiki/File:Human_skeleton_front_en.svg" }, "coordinateRender": [ + 872, + 1684 + ], + "sourceCoordinates": [ 436, 842 ], - "overviewSourceBounds": [ - 59, - 20, - 405, - 822 + "pixelAspect": [ + 1, + 2 ], "topics": [ { "id": 0, - "code": "CRANIUM", - "sourceElements": [ - "Cranium", - "g1297" - ] + "code": "SKULL" }, { "id": 1, - "code": "MANDIBLE", - "sourceElements": [ - "Mandible" - ] + "code": "CERVICAL" }, { "id": 2, - "code": "CLAVICLE", - "sourceElements": [ - "ClavicleLeft", - "ClavicleRight" - ] + "code": "MANUBRIUM" }, { "id": 3, - "code": "SCAPULA", - "sourceElements": [ - "Scapula" - ] + "code": "STERNUM" }, { "id": 4, - "code": "STERNUM", - "sourceElements": [ - "Sternum", - "Manubrium" - ] + "code": "XIPHOID" }, { "id": 5, - "code": "RIBS", - "sourceElements": [ - "g845", - "g1609" - ] + "code": "LUMBAR" }, { "id": 6, - "code": "CERVICAL", - "sourceElements": [ - "CervicalVertebrae" - ] + "code": "ILIUM" }, { "id": 7, - "code": "THORACIC", - "sourceElements": [ - "ThoracicVertebrae" - ] + "code": "SACRUM" }, { "id": 8, - "code": "LUMBAR", - "sourceElements": [ - "LumbarVertebrae" - ] + "code": "COCCYX" }, { "id": 9, - "code": "SACRUM", - "sourceElements": [ - "Sacrum" - ] + "code": "PUBIS" }, { "id": 10, - "code": "COCCYX", - "sourceElements": [ - "Coccyx" - ] + "code": "FEMUR" }, { "id": 11, - "code": "PELVIS", - "sourceElements": [ - "PelvicGirdle", - "g447" - ] + "code": "PATELLA" }, { "id": 12, - "code": "HUMERUS", - "sourceElements": [ - "HumerusLeft", - "HumerusRight" - ] + "code": "TARSALS" }, { "id": 13, - "code": "RADIUS", - "sourceElements": [ - "RadiusLeft", - "RadiusRight" - ] + "code": "METATARSALS" }, { "id": 14, - "code": "ULNA", - "sourceElements": [ - "UlnaLeft", - "UlnaRight" - ] + "code": "TOES" }, { "id": 15, - "code": "CARPALS", - "sourceElements": [ - "CarpalsLeft", - "CarpalsRight" - ] + "code": "ORBIT" }, { "id": 16, - "code": "METACARPALS", - "sourceElements": [ - "MetacarpalsLeft", - "MetacarpalsRight" - ] + "code": "NASAL" }, { "id": 17, - "code": "FINGERS", - "sourceElements": [ - "PhalangesLeft", - "PhalangesRight" - ] + "code": "CLAVICLE" }, { "id": 18, - "code": "FEMUR", - "sourceElements": [ - "g3760", - "FemurLeft", - "path479", - "path481", - "path513", - "path499" - ] + "code": "SCAPULA" }, { "id": 19, - "code": "PATELLA", - "sourceElements": [ - "PatellaLeft", - "PatellaRight" - ] + "code": "RIBS" }, { "id": 20, - "code": "TIBIA", - "sourceElements": [ - "TibiaLeft", - "TibiaRight" - ] + "code": "HUMERUS" }, { "id": 21, - "code": "FIBULA", - "sourceElements": [ - "FibulaLeft", - "FibulaRight" - ] + "code": "ULNA" }, { "id": 22, - "code": "TARSALS", - "sourceElements": [ - "TarsalsLeft", - "TarsalsRight" - ] + "code": "RADIUS" }, { "id": 23, - "code": "METATARSALS", - "sourceElements": [ - "MetatarsalsLeft", - "MetatarsalsRight" - ] + "code": "CARPALS" }, { "id": 24, - "code": "TOES", - "sourceElements": [ - "PhalangesFootLeft", - "PhalangesFootRight" - ] + "code": "METACARPALS" + }, + { + "id": 25, + "code": "FINGERS" + }, + { + "id": 26, + "code": "FIBULA" + }, + { + "id": 27, + "code": "TIBIA" } ], - "paintOrder": [ - 15, - 16, - 17, - 22, - 23, - 24, - 21, - 20, - 18, - 11, - 3, - 10, - 9, - 8, - 5, - 7, - 6, - 0, - 1, - 4, - 2, - 12, - 14, - 13, - 19 - ], - "facialRecesses": "Original source shading thresholds, eyes and nasal recess only", - "pairedSides": "Both sides use one bone-family identity; no left/right questions", + "contextIndex": 28, + "inkIndex": 29, + "drawCount": 30, + "derivedRegions": { + "leftThumbPose": { + "elements": [ + "g1977", + "g1951", + "g1963" + ], + "rotationDegrees": 30, + "pivot": [ + 367, + 416 + ], + "purpose": "Relax the anatomical left thumb on screen right without changing bone lengths or joints" + }, + "sternum": "Native Sternum path split atsource y228: body above, xiphoid below", + "ilium": "Native PelvicGirdle upperwings clipped atsource y371; remaining lowerhip isneutralcontext", + "pubis": "Nativeg447 pairedpubicarch", + "orbit": "Nativepath1577/path1579 eye-recess shapes withopacityflattened", + "nasal": "Source facialregion x195..212 y75..102 withluminance<140", + "ribs": "Native g845/g1609 bright bone-face pixels, excluding gray cartilage; source rib matte occludes rear scapula", + "internalInk": "Native full-skeleton luminance below180/255, box resampled coverage at least70/255; cavity cores retain their own selectable masks" + }, + "originalSourceGroups": { + "CRANIUM": [ + "Cranium", + "g1297" + ], + "MANDIBLE": [ + "Mandible" + ], + "CLAVICLE": [ + "ClavicleLeft", + "ClavicleRight" + ], + "SCAPULA": [ + "Scapula" + ], + "STERNUM": [ + "Sternum", + "Manubrium" + ], + "RIBS": [ + "g845", + "g1609" + ], + "CERVICAL": [ + "CervicalVertebrae" + ], + "THORACIC": [ + "ThoracicVertebrae" + ], + "LUMBAR": [ + "LumbarVertebrae" + ], + "SACRUM": [ + "Sacrum" + ], + "COCCYX": [ + "Coccyx" + ], + "PELVIS": [ + "PelvicGirdle", + "g447" + ], + "HUMERUS": [ + "HumerusLeft", + "HumerusRight" + ], + "RADIUS": [ + "RadiusLeft", + "RadiusRight" + ], + "ULNA": [ + "UlnaLeft", + "UlnaRight" + ], + "CARPALS": [ + "CarpalsLeft", + "CarpalsRight" + ], + "METACARPALS": [ + "MetacarpalsLeft", + "MetacarpalsRight" + ], + "FINGERS": [ + "PhalangesLeft", + "PhalangesRight" + ], + "FEMUR": [ + "g3760", + "FemurLeft", + "path479", + "path481", + "path513", + "path499" + ], + "PATELLA": [ + "PatellaLeft", + "PatellaRight" + ], + "TIBIA": [ + "TibiaLeft", + "TibiaRight" + ], + "FIBULA": [ + "FibulaLeft", + "FibulaRight" + ], + "TARSALS": [ + "TarsalsLeft", + "TarsalsRight" + ], + "METATARSALS": [ + "MetatarsalsLeft", + "MetatarsalsRight" + ], + "TOES": [ + "PhalangesFootLeft", + "PhalangesFootRight" + ] + }, "views": [ { "id": 0, @@ -255,36 +268,42 @@ 405, 822 ], - "width": 64, - "height": 149, - "spanBytes": 2109, - "offsetBytes": 52, + "width": 159, + "height": 184, + "fileOffset": 0, + "spanBytes": 3270, + "offsetBytes": 62, "pixels": { - "CRANIUM": 134, - "MANDIBLE": 53, - "CLAVICLE": 50, - "SCAPULA": 89, - "STERNUM": 57, - "RIBS": 455, - "CERVICAL": 27, - "THORACIC": 35, - "LUMBAR": 80, - "SACRUM": 42, - "COCCYX": 3, - "PELVIS": 248, - "HUMERUS": 202, - "RADIUS": 103, - "ULNA": 83, - "CARPALS": 25, - "METACARPALS": 69, - "FINGERS": 98, - "FEMUR": 351, - "PATELLA": 39, - "TIBIA": 281, - "FIBULA": 100, - "TARSALS": 32, - "METATARSALS": 59, - "TOES": 55 + "SKULL": 434, + "CERVICAL": 69, + "MANUBRIUM": 54, + "STERNUM": 69, + "XIPHOID": 12, + "LUMBAR": 207, + "ILIUM": 407, + "SACRUM": 125, + "COCCYX": 9, + "PUBIS": 245, + "FEMUR": 902, + "PATELLA": 84, + "TARSALS": 86, + "METATARSALS": 178, + "TOES": 142, + "ORBIT": 94, + "NASAL": 21, + "CLAVICLE": 142, + "SCAPULA": 228, + "RIBS": 430, + "HUMERUS": 554, + "ULNA": 221, + "RADIUS": 253, + "CARPALS": 73, + "METACARPALS": 158, + "FINGERS": 210, + "FIBULA": 262, + "TIBIA": 750, + "CONTEXT": 334, + "INK": 634 } }, { @@ -296,36 +315,42 @@ 243, 154 ], - "width": 38, - "height": 65, - "spanBytes": 444, - "offsetBytes": 52, + "width": 114, + "height": 98, + "fileOffset": 3270, + "spanBytes": 2084, + "offsetBytes": 62, "pixels": { - "CRANIUM": 916, - "MANDIBLE": 281, - "CLAVICLE": 84, - "SCAPULA": 0, + "SKULL": 4506, + "CERVICAL": 478, + "MANUBRIUM": 0, "STERNUM": 0, - "RIBS": 37, - "CERVICAL": 166, - "THORACIC": 28, + "XIPHOID": 0, "LUMBAR": 0, + "ILIUM": 0, "SACRUM": 0, "COCCYX": 0, - "PELVIS": 0, + "PUBIS": 0, + "FEMUR": 0, + "PATELLA": 0, + "TARSALS": 0, + "METATARSALS": 0, + "TOES": 0, + "ORBIT": 867, + "NASAL": 161, + "CLAVICLE": 257, + "SCAPULA": 0, + "RIBS": 54, "HUMERUS": 0, - "RADIUS": 0, "ULNA": 0, + "RADIUS": 0, "CARPALS": 0, "METACARPALS": 0, "FINGERS": 0, - "FEMUR": 0, - "PATELLA": 0, - "TIBIA": 0, "FIBULA": 0, - "TARSALS": 0, - "METATARSALS": 0, - "TOES": 0 + "TIBIA": 0, + "CONTEXT": 67, + "INK": 1245 } }, { @@ -337,36 +362,42 @@ 410, 500 ], - "width": 61, - "height": 65, - "spanBytes": 588, - "offsetBytes": 52, + "width": 185, + "height": 98, + "fileOffset": 5354, + "spanBytes": 2158, + "offsetBytes": 62, "pixels": { - "CRANIUM": 0, - "MANDIBLE": 0, - "CLAVICLE": 0, - "SCAPULA": 0, - "STERNUM": 0, - "RIBS": 0, + "SKULL": 0, "CERVICAL": 0, - "THORACIC": 0, + "MANUBRIUM": 0, + "STERNUM": 0, + "XIPHOID": 0, "LUMBAR": 0, + "ILIUM": 0, "SACRUM": 0, "COCCYX": 0, - "PELVIS": 0, - "HUMERUS": 0, - "RADIUS": 92, - "ULNA": 46, - "CARPALS": 134, - "METACARPALS": 305, - "FINGERS": 361, + "PUBIS": 0, "FEMUR": 0, "PATELLA": 0, - "TIBIA": 0, - "FIBULA": 0, "TARSALS": 0, "METATARSALS": 0, - "TOES": 0 + "TOES": 0, + "ORBIT": 0, + "NASAL": 0, + "CLAVICLE": 0, + "SCAPULA": 0, + "RIBS": 0, + "HUMERUS": 0, + "ULNA": 166, + "RADIUS": 302, + "CARPALS": 516, + "METACARPALS": 921, + "FINGERS": 1042, + "FIBULA": 0, + "TIBIA": 0, + "CONTEXT": 0, + "INK": 1014 } }, { @@ -378,77 +409,89 @@ 275, 825 ], - "width": 63, - "height": 65, - "spanBytes": 495, - "offsetBytes": 52, + "width": 191, + "height": 98, + "fileOffset": 7512, + "spanBytes": 2372, + "offsetBytes": 62, "pixels": { - "CRANIUM": 0, - "MANDIBLE": 0, - "CLAVICLE": 0, - "SCAPULA": 0, - "STERNUM": 0, - "RIBS": 0, + "SKULL": 0, "CERVICAL": 0, - "THORACIC": 0, + "MANUBRIUM": 0, + "STERNUM": 0, + "XIPHOID": 0, "LUMBAR": 0, + "ILIUM": 0, "SACRUM": 0, "COCCYX": 0, - "PELVIS": 0, + "PUBIS": 0, + "FEMUR": 0, + "PATELLA": 0, + "TARSALS": 1348, + "METATARSALS": 2143, + "TOES": 1440, + "ORBIT": 0, + "NASAL": 0, + "CLAVICLE": 0, + "SCAPULA": 0, + "RIBS": 0, "HUMERUS": 0, - "RADIUS": 0, "ULNA": 0, + "RADIUS": 0, "CARPALS": 0, "METACARPALS": 0, "FINGERS": 0, - "FEMUR": 0, - "PATELLA": 0, - "TIBIA": 297, - "FIBULA": 81, - "TARSALS": 376, - "METATARSALS": 571, - "TOES": 440 + "FIBULA": 326, + "TIBIA": 1103, + "CONTEXT": 0, + "INK": 1521 } }, { "id": 4, "name": "spine", "sourceBounds": [ - 169, + 126, 274, - 235, - 400 + 279, + 423 ], - "width": 34, - "height": 65, - "spanBytes": 621, - "offsetBytes": 52, + "width": 201, + "height": 98, + "fileOffset": 9884, + "spanBytes": 3108, + "offsetBytes": 62, "pixels": { - "CRANIUM": 0, - "MANDIBLE": 0, + "SKULL": 0, + "CERVICAL": 0, + "MANUBRIUM": 0, + "STERNUM": 0, + "XIPHOID": 0, + "LUMBAR": 1244, + "ILIUM": 3176, + "SACRUM": 856, + "COCCYX": 46, + "PUBIS": 1630, + "FEMUR": 1386, + "PATELLA": 0, + "TARSALS": 0, + "METATARSALS": 0, + "TOES": 0, + "ORBIT": 0, + "NASAL": 0, "CLAVICLE": 0, "SCAPULA": 0, - "STERNUM": 0, - "RIBS": 143, - "CERVICAL": 0, - "THORACIC": 59, - "LUMBAR": 544, - "SACRUM": 315, - "COCCYX": 28, - "PELVIS": 429, + "RIBS": 570, "HUMERUS": 0, - "RADIUS": 0, "ULNA": 0, + "RADIUS": 0, "CARPALS": 0, "METACARPALS": 0, "FINGERS": 0, - "FEMUR": 0, - "PATELLA": 0, - "TIBIA": 0, "FIBULA": 0, - "TARSALS": 0, - "METATARSALS": 0, - "TOES": 0 + "TIBIA": 0, + "CONTEXT": 640, + "INK": 1799 } }, { @@ -460,53 +503,75 @@ 300, 308 ], - "width": 68, - "height": 62, - "spanBytes": 1245, - "offsetBytes": 52, + "width": 215, + "height": 98, + "fileOffset": 12992, + "spanBytes": 3592, + "offsetBytes": 62, "pixels": { - "CRANIUM": 0, - "MANDIBLE": 0, - "CLAVICLE": 158, - "SCAPULA": 326, - "STERNUM": 181, - "RIBS": 1573, - "CERVICAL": 67, - "THORACIC": 137, - "LUMBAR": 73, + "SKULL": 0, + "CERVICAL": 236, + "MANUBRIUM": 282, + "STERNUM": 412, + "XIPHOID": 53, + "LUMBAR": 299, + "ILIUM": 0, "SACRUM": 0, "COCCYX": 0, - "PELVIS": 0, - "HUMERUS": 269, - "RADIUS": 0, + "PUBIS": 0, + "FEMUR": 0, + "PATELLA": 0, + "TARSALS": 0, + "METATARSALS": 0, + "TOES": 0, + "ORBIT": 0, + "NASAL": 0, + "CLAVICLE": 634, + "SCAPULA": 1444, + "RIBS": 2568, + "HUMERUS": 1040, "ULNA": 0, + "RADIUS": 0, "CARPALS": 0, "METACARPALS": 0, "FINGERS": 0, - "FEMUR": 0, - "PATELLA": 0, - "TIBIA": 0, "FIBULA": 0, - "TARSALS": 0, - "METATARSALS": 0, - "TOES": 0 + "TIBIA": 0, + "CONTEXT": 1884, + "INK": 1520 } } ], - "geometryROMBytes": 5975, + "asset": { + "file": "assets/generated/BONES.DAT", + "spanBytes": 16584, + "bytes": 16640, + "sha256": "60303495c7c4df61b0e1b46797126b48ecad82874df9e0a0739a5617589e2255", + "checksum": 50756, + "padding": "Zero padded to256 bytes" + }, + "geometryROMBytes": 552, "detailSelector": [ 1, 1, 5, 5, 5, - 5, + 4, + 4, + 4, + 4, + 4, + 0, + 0, + 3, + 3, + 3, + 1, 1, 5, - 4, - 4, - 4, - 4, + 5, + 5, 0, 0, 0, @@ -514,163 +579,176 @@ 2, 2, 0, - 0, - 0, - 0, - 3, - 3, - 3 + 0 ], "overviewBoxes": { - "CRANIUM": [ - 20, + "SKULL": [ + 50, 0, - 13, - 17 - ], - "MANDIBLE": [ - 20, - 11, - 13, - 9 - ], - "CLAVICLE": [ - 12, - 22, - 30, - 4 - ], - "SCAPULA": [ - 10, - 23, - 34, - 13 - ], - "STERNUM": [ - 24, - 25, - 6, - 17 - ], - "RIBS": [ - 14, - 23, - 26, - 30 + 33, + 24 ], "CERVICAL": [ - 23, + 57, + 24, 19, - 8, + 6 + ], + "MANUBRIUM": [ + 60, + 31, + 13, 5 ], - "THORACIC": [ - 24, - 23, - 5, - 27 + "STERNUM": [ + 62, + 37, + 9, + 10 ], - "LUMBAR": [ - 23, - 49, - 8, - 14 - ], - "SACRUM": [ - 21, - 60, - 10, - 8 - ], - "COCCYX": [ - 26, - 67, - 2, - 3 - ], - "PELVIS": [ - 13, - 56, - 27, - 18 - ], - "HUMERUS": [ - 1, - 27, - 49, - 27 - ], - "RADIUS": [ - 1, - 52, - 55, - 22 - ], - "ULNA": [ - 1, - 53, - 51, - 21 - ], - "CARPALS": [ - 1, - 72, - 56, + "XIPHOID": [ + 64, + 47, + 4, 4 ], - "METACARPALS": [ - 0, - 73, + "LUMBAR": [ + 56, 60, - 8 + 20, + 18 ], - "FINGERS": [ - 0, - 73, - 64, - 16 + "ILIUM": [ + 33, + 69, + 66, + 12 + ], + "SACRUM": [ + 54, + 74, + 24, + 10 + ], + "COCCYX": [ + 62, + 83, + 7, + 3 + ], + "PUBIS": [ + 40, + 80, + 49, + 12 ], "FEMUR": [ - 11, - 67, - 30, - 40 + 29, + 82, + 72, + 49 ], "PATELLA": [ - 18, - 104, - 16, - 5 - ], - "TIBIA": [ - 17, - 106, - 18, - 33 - ], - "FIBULA": [ - 17, - 109, - 18, - 29 + 46, + 128, + 37, + 7 ], "TARSALS": [ - 19, - 138, - 14, - 5 + 46, + 170, + 37, + 7 ], "METATARSALS": [ - 16, - 140, - 20, - 5 + 39, + 173, + 51, + 7 ], "TOES": [ - 13, - 143, + 33, + 177, + 64, + 7 + ], + "ORBIT": [ + 53, + 9, 26, - 6 + 5 + ], + "NASAL": [ + 63, + 12, + 6, + 5 + ], + "CLAVICLE": [ + 30, + 28, + 73, + 5 + ], + "SCAPULA": [ + 25, + 29, + 84, + 18 + ], + "RIBS": [ + 34, + 28, + 64, + 37 + ], + "HUMERUS": [ + 4, + 33, + 119, + 34 + ], + "ULNA": [ + 2, + 65, + 128, + 26 + ], + "RADIUS": [ + 4, + 65, + 135, + 26 + ], + "CARPALS": [ + 2, + 88, + 140, + 7 + ], + "METACARPALS": [ + 1, + 90, + 148, + 10 + ], + "FINGERS": [ + 1, + 93, + 152, + 17 + ], + "FIBULA": [ + 42, + 135, + 46, + 36 + ], + "TIBIA": [ + 43, + 131, + 44, + 41 ] } } diff --git a/docs/ANATOMY.md b/docs/ANATOMY.md index 2dc9685..5908d4d 100644 --- a/docs/ANATOMY.md +++ b/docs/ANATOMY.md @@ -1,45 +1,96 @@ # Bone Quest anatomy bank -The quiz identifies **25 major bones or bone groups** in the supplied anterior -skeleton illustration. It does not ask separately about every individual bone -in the adult skeleton. Left and right counterparts share one topic. Vertebrae -are grouped by region; the bones of each wrist, palm, hand digits, rear foot, -mid-foot and toes are also grouped. +The quiz now follows the **28 labels in the user-supplied human skeletal-system +reference**, in its numbered order. These topics are bones, bone groups, parts of +bones, and two cavities. They are not 28 individual bones or a claim to quiz every +individual bone in the adult skeleton. Paired left/right counterparts share a +topic. The orbital and nasal cavities are anatomical spaces, not bones. -`data/bones.json` is the canonical ordered bank. `src/bones.c` contains three -runtime fields: displayed name, short location hint, and pipe-separated accepted -aliases. Stable codes remain in JSON; fixed topic order binds artwork, history -and questions. `tools/prepare_questions.py` regenerates the C table. Names are at -most 22 characters and hints at most 30 characters. +`data/bones.json` is the canonical ordered bank. Its stable code and `kind` remain +in authoring data. `src/bones.c` contains only the three runtime fields: displayed +name, short location hint, and pipe-separated accepted aliases. Fixed topic order +binds artwork, history and questions. `tools/prepare_questions.py` regenerates +that compact table and its `--check` option detects stale C. Names are at most +18 characters, aliases at most 33, and hints at most 30. -## Naming choices +## Reference order and corrected terminology -- **Cranium** follows the illustration's labeled grouping above the separately - drawn mandible. **Skull** is accepted as the familiar introductory term. This - is not a quiz distinguishing all cranial and facial bones. The skull includes - the mandible in complete anatomical descriptions; the game treats the lower - jaw as its own highlighted topic. -- **Pelvic girdle** means the paired hip bones here. The sacrum and coccyx are - separate topics. Bare **pelvis** is deliberately not an accepted alias because - the complete bony pelvis includes those additional bones. -- **Finger phalanges** includes the thumb. **Toe phalanges** is a separate topic. - Bare **phalanges** is not accepted for either because it cannot distinguish +| Reference | Stable code | Displayed answer | Topic kind | +| --- | --- | --- | --- | +| 1 | SKULL | Skull | Bone group | +| 2 | CERVICAL | Cervical vertebrae | Bone group | +| 3 | MANUBRIUM | Manubrium | Part of sternum | +| 4 | STERNUM | Body of sternum | Part of sternum | +| 5 | XIPHOID | Xiphoid process | Part of sternum | +| 6 | LUMBAR | Lumbar vertebrae | Bone group | +| 7 | ILIUM | Ilium | Part of hip bone | +| 8 | SACRUM | Sacrum | Bone | +| 9 | COCCYX | Coccyx | Bone | +| 10 | PUBIS | Pubis | Part of hip bone | +| 11 | FEMUR | Femur | Bone | +| 12 | PATELLA | Patella | Bone | +| 13 | TARSALS | Tarsals | Bone group | +| 14 | METATARSALS | Metatarsals | Bone group | +| 15 | TOES | Toe phalanges | Bone group | +| 16 | ORBIT | Orbital cavity | Cavity | +| 17 | NASAL | Nasal cavity | Cavity | +| 18 | CLAVICLE | Clavicle | Bone | +| 19 | SCAPULA | Scapula | Bone | +| 20 | RIBS | Ribs | Bone group | +| 21 | HUMERUS | Humerus | Bone | +| 22 | ULNA | Ulna | Bone | +| 23 | RADIUS | Radius | Bone | +| 24 | CARPALS | Carpals | Bone group | +| 25 | METACARPALS | Metacarpals | Bone group | +| 26 | FINGERS | Finger phalanges | Bone group | +| 27 | FIBULA | Fibula | Bone | +| 28 | TIBIA | Tibia | Bone | + +The reference's **Illium** is corrected to **Ilium**. Its **Manubri sterni** label +is represented by **Manubrium**, with the correct expanded term **manubrium +sterni** accepted. **Shoulder blade** remains an alias for Scapula. The regional +terms **tarsus**, **metatarsus**, **carpus**, and **metacarpus** are accepted for +the corresponding groups. These spellings and aliases preserve the intended +anatomy without treating a printed spelling error as a second canonical answer. + +## Naming and grouping choices + +- **Skull** replaces the previous separate cranium and mandible questions. It + is a combined topic, not an assertion that the skull is one adult bone. + **Cranium** is accepted as a familiar alternative term in this overview. +- The sternum is divided into **Manubrium**, **Body of sternum**, and **Xiphoid + process**. **Sternal body / sternum body** identifies its middle part. Bare + **sternum** or **breastbone** is not an exact alias for just that middle part. +- **Ilium** and **Pubis** replace the broad pelvic-girdle question. The sacrum + and coccyx remain separate topics. **Pelvis**, **hip bone**, and **pelvic + girdle** are not aliases for either selected hip-bone part. The ischium is + not a separate question in this reference set. +- **Orbital cavity** accepts **eye socket** and **orbit**. **Nasal cavity** + accepts **nose cavity**. Both are spaces bounded by skull structures; neither + is a bone. Prompts and educational copy must use **structure/topic** when + describing the whole question set rather than calling all 28 targets bones. +- **Finger phalanges** includes the thumb. **Toe phalanges** is separate. Bare + **phalanges** is deliberately not accepted because it cannot distinguish the hand from the foot. **Finger bones / hand phalanges** and **toe bones / foot phalanges** are accepted respectively. -- **Radius** and **ulna** are distinguished using the anatomical position: the - radius lies on the thumb side and the ulna on the little-finger side. - **Tibia** and **fibula** use the inner and outer sides of the lower leg. -- **Sternum** is the whole breastbone topic, including its manubrium portion; - the manubrium is not a second overlapping answer. -- Common names such as collarbone, shoulder blade, breastbone, kneecap, - thighbone, shinbone and tailbone are accepted. A location hint is not - automatically an accepted answer. Names of body regions such as **forearm** - or **foot bones** are too broad to identify one highlighted topic. +- **Radius** and **ulna** are distinguished in the anatomical position: the + radius is on the thumb side, the ulna on the little-finger side. **Tibia** + and **fibula** are on the inner and outer sides of the lower leg respectively. +- Common names such as collarbone, shoulder blade, thighbone, kneecap, shinbone + and tailbone remain accepted. A location hint is not automatically an answer. + +The previous standalone **Mandible** and **Thoracic vertebrae** questions are +not in this reference's 28 topics. The diagram can still show unquizzed anatomy +for context; such anatomy must not be assigned to a different answer merely to +fill a mask. The new reference order changes topic indices, so geometry IDs, +question count, histories, score percentage, and deterministic test expectations +must be regenerated together. Canonical names and aliases are unique after lowercasing and collapsing spaces. -Case and extra-space handling belongs to the shared quiz normalization; this -bank supplies no ambiguous duplicate alias. The data contains no treatment, -injury or diagnostic questions. +The JSON `kind` values distinguish `bone`, `bone_group`, `bone_part`, and `cavity`. +These labels describe the learning units; a paired bone name still covers both +left and right examples. The bank contains no treatment, injury or diagnostic +questions. ## Primary references checked @@ -55,16 +106,14 @@ verify names, group boundaries and location facts on November 11, 2026: - [Bones of the lower limb](https://openstax.org/books/anatomy-and-physiology-2e/pages/8-4-bones-of-the-lower-limb) These are factual verification references. No textbook passages, assessments or -artwork are imported into the game. The concise location hints are written for -this quiz; they are not quotations from the textbook. +artwork are imported into the game. The short location hints are written for +this quiz, not quotations from the textbook. ## Diagram provenance -The visual reference is [Human skeleton front en.svg](https://commons.wikimedia.org/wiki/File:Human_skeleton_front_en.svg) -by **Mariana Ruiz Villarreal (LadyofHats)**. The author released it into the -public domain. The original Wikimedia description distinguishes labels for -individual bones from labels for groups. Bone Quest uses its selected group -names while keeping a single stable topic for paired counterparts. The retained -source SVG and source-receipt.json belong to the artwork workflow; generated -geometry and any simplifications must preserve this attribution and explain -what was adapted. +The original visual source remains [Human skeleton front en.svg](https://commons.wikimedia.org/wiki/File:Human_skeleton_front_en.svg) +by **Mariana Ruiz Villarreal (LadyofHats)**, released into the public domain by +its author. The newly supplied labeled reference determines this topic list; +its photographed/cartoon pixels are not imported as runtime art by this data +change. The retained Wikimedia SVG, adaptation receipt, generated masks, and +any anatomy-specific segmentation must preserve their actual provenance. diff --git a/docs/IMPLEMENTATION.md b/docs/IMPLEMENTATION.md index 1e7dfb6..80075b3 100644 --- a/docs/IMPLEMENTATION.md +++ b/docs/IMPLEMENTATION.md @@ -4,7 +4,7 @@ Working checklist: - [x] Create private VCCPlusApps/BoneQuest repository and separate main checkout. - [x] Adapt the supplied public-domain SVG into compact per-topic graphics. -- [x] Verify25 major bones/bone groups and accepted answer aliases. +- [x] Verify 28 reference structures and accepted answer aliases. - [x] Implement anatomy-specific layout, two modes, feedback/review/replay. - [x] Build with stock VCC Plus tools and create BONEQ.DSK. - [x] Run host/geometry and isolated6809/6309 gameplay checks. @@ -14,5 +14,52 @@ Foundation: Capital Quest, revision afa6f3c2a05cbd71c1f22ec3506f4f63421b2bc6, GPL-3.0-or-later. Its geography assets/manuals are not used by Bone Quest. Skeleton: Mariana Ruiz Villarreal (LadyofHats), Wikimedia Human_skeleton_front_en.svg, author's public-domain dedication; original retained under assets/ with hash receipt. -The quiz covers named major bones and groups shown in the diagram, not 206 +The quiz follows the 28 structures in Brian's reference, including distinct +sternum sections, ilium/pubis and orbital/nasal cavities. It does not cover 206 individually selectable bones. Paired left/right examples share one question. +The original SVG remains the retained source; the supplied raster reference +guides subject selection and the preference for clear outlines and rib gaps. + + +## High-resolution rendering + +Brian requested the highest native CoCo 3 resolution with a mostly black-and-white +skeleton. The game now uses 640 × 225, four colors: black background/linework, +white anatomy, yellow current structure and red missed structures. Correct +structures return to white rather than consuming another palette entry. + +The local GPL graphics driver adapts VCC Plus's original SDK GIME implementation; +its upstream revision/hash remain in src/graphics.c. It owns two 40 KiB pages in +physical banks $1E–$27, leaving the documented bank library's $28–$2B available +for artwork. Both drawings and the 2 KB stack stay separate from the program. +The driver clips 2-bit pixels, borrows the $8000 window only in short masked +sections, restores the MMU/interrupt state, flips at vertical blank, and restores +BASIC on exit. gfx_copy_front copies the visible page to the hidden page so +feedback and spelling prompts can reuse the skeleton rather than repainting it. + +BONES.DAT contains six compact drawing views, loaded read-only from drive 0 into +asset banks once at startup. The loader validates exact size and a generated +checksum; host checks verify SHA-256. Normal builds retain this data and the small +C metadata, with no asset authoring dependencies. The original SVG is rendered +anew at 872 × 1684 before reduction, with native pixels treated as 1:2 in physical +width:height. The 159 × 184 overview and enlarged regional views retain rib gaps, +facial recesses, joints and bone boundaries. Precise source selection, coordinate +cuts and ownership evidence are in data/geometry-manifest.json. + +The source game, emulator and website repositories remain separate. This work +changes Bone Quest only; the VCC Plus app and Capital Quest are unchanged. + + +## Hand pose and global exit refinement + +The anatomical left thumb (screen right) now rests closer to the palm. The +converter rotates its metacarpal and both phalanges together by 30 degrees about +source point (367,416), preserving bone lengths and joint relationships. Both +region ownership and linework use that same transform in overview/detail views; +the original SVG is unchanged. The exact source element IDs are in the manifest. + +Q/q, Escape (ASCII 27) and CoCo Break (ASCII 3) now call one cleanup path from +all interactive screens. It releases the keyboard, closes graphics and asset +banks, restores normal CPU speed and returns to BASIC. The automatic reading +pause polls those keys too. Escape/Break are no longer reveal shortcuts: blank +Enter reveals an answer as a miss; the spelling-help menu retains V to reveal. diff --git a/docs/SCREENSHOTS.json b/docs/SCREENSHOTS.json index d228469..9ff04b3 100644 --- a/docs/SCREENSHOTS.json +++ b/docs/SCREENSHOTS.json @@ -3,12 +3,14 @@ "file": "docs/images/title.png", "width": 640, "height": 480, - "sha256": "c760e20e70c3063f2938acad87c80979ef8f795ff981bfa3eacb6fff5b3db9f3", + "guestWidth": 640, + "guestHeight": 225, + "sha256": "8cd34f02ac0d4ee433e83e2666121daa2c32166b366c171c301a0e831e948222", "emulator": "VCC Plus 3.6.1 (54)", "processor": "MC6809", "ramKB": 512, "video": "RGB", - "diskSHA256": "cf9b2da5842551d76b58c3be2064a78163536526826fca13ac7ee58c269e1e66", + "diskSHA256": "373a3f387daf541b1eb4edd3421a125dd57094e600ee48d162802ac22f65ceba", "capture": "Unmodified guest frame from isolated keyboard-driven playtest", "note": "Scripted validation includes deliberate incorrect answers." }, @@ -16,12 +18,14 @@ "file": "docs/images/multiple-choice.png", "width": 640, "height": 480, - "sha256": "a0f272e2e0355260e27bfef6b5021e4cb984e054eac9e39a0f910f05af66e3c5", + "guestWidth": 640, + "guestHeight": 225, + "sha256": "d7815e218ff50750556362739f2e096bd3a415a60de20ddb81b1fcfa74a7a3bf", "emulator": "VCC Plus 3.6.1 (54)", "processor": "MC6809", "ramKB": 512, "video": "RGB", - "diskSHA256": "cf9b2da5842551d76b58c3be2064a78163536526826fca13ac7ee58c269e1e66", + "diskSHA256": "373a3f387daf541b1eb4edd3421a125dd57094e600ee48d162802ac22f65ceba", "capture": "Unmodified guest frame from isolated keyboard-driven playtest", "note": "Scripted validation includes deliberate incorrect answers." }, @@ -29,12 +33,14 @@ "file": "docs/images/typed-answer.png", "width": 640, "height": 480, - "sha256": "f44cd5b9493a2b4704532f444f4666b536db375e4b7a6338683bcade9246444d", + "guestWidth": 640, + "guestHeight": 225, + "sha256": "04b0149afa66c37ab2aa985bac30a92b24868bbf16f40cb01047c5ac4eea0d77", "emulator": "VCC Plus 3.6.1 (54)", "processor": "MC6809", "ramKB": 512, "video": "RGB", - "diskSHA256": "cf9b2da5842551d76b58c3be2064a78163536526826fca13ac7ee58c269e1e66", + "diskSHA256": "373a3f387daf541b1eb4edd3421a125dd57094e600ee48d162802ac22f65ceba", "capture": "Unmodified guest frame from isolated keyboard-driven playtest", "note": "Scripted validation includes deliberate incorrect answers." }, @@ -42,12 +48,44 @@ "file": "docs/images/results.png", "width": 640, "height": 480, - "sha256": "81839f1acdf3511d62c52fc6fdc53df138a5b86048563628b450df6ffe7c6297", + "guestWidth": 640, + "guestHeight": 225, + "sha256": "2dee6d6c16b4bd0fb942dd466ab814f418dc875f81c76fe845428740c826f1af", "emulator": "VCC Plus 3.6.1 (54)", "processor": "MC6809", "ramKB": 512, "video": "RGB", - "diskSHA256": "cf9b2da5842551d76b58c3be2064a78163536526826fca13ac7ee58c269e1e66", + "diskSHA256": "373a3f387daf541b1eb4edd3421a125dd57094e600ee48d162802ac22f65ceba", + "capture": "Unmodified guest frame from isolated keyboard-driven playtest", + "note": "Scripted validation includes deliberate incorrect answers." + }, + { + "file": "docs/images/head-detail.png", + "width": 640, + "height": 480, + "guestWidth": 640, + "guestHeight": 225, + "sha256": "05b796dd8bb74979924b4b4af4c2ec10b2f06582a56b1bf5d13a1a61aad9f874", + "emulator": "VCC Plus 3.6.1 (54)", + "processor": "MC6809", + "ramKB": 512, + "video": "RGB", + "diskSHA256": "373a3f387daf541b1eb4edd3421a125dd57094e600ee48d162802ac22f65ceba", + "capture": "Unmodified guest frame from isolated keyboard-driven playtest", + "note": "Scripted validation includes deliberate incorrect answers." + }, + { + "file": "docs/images/hand-detail.png", + "width": 640, + "height": 480, + "guestWidth": 640, + "guestHeight": 225, + "sha256": "9adca4eed509d5bed1bf1497a1518c91b69cc1b52de0c373a29b0d037101fdf6", + "emulator": "VCC Plus 3.6.1 (54)", + "processor": "MC6809", + "ramKB": 512, + "video": "RGB", + "diskSHA256": "373a3f387daf541b1eb4edd3421a125dd57094e600ee48d162802ac22f65ceba", "capture": "Unmodified guest frame from isolated keyboard-driven playtest", "note": "Scripted validation includes deliberate incorrect answers." } diff --git a/docs/TESTING.md b/docs/TESTING.md index d2d57b8..2c93d0e 100644 --- a/docs/TESTING.md +++ b/docs/TESTING.md @@ -1,64 +1,101 @@ -# Initial Bone Quest verification — November 11, 2026 +# High-resolution Bone Quest verification — November 11, 2026 -## Built and delivered +## Candidate and builds -The root BONEQ.DSK is a standard 35-track DECB image, 161,280 bytes, SHA-256: +The current candidate is a 35-track DECB disk, 161,280 bytes, SHA-256: -`cf9b2da5842551d76b58c3be2064a78163536526826fca13ac7ee58c269e1e66` +`373a3f387daf541b1eb4edd3421a125dd57094e600ee48d162802ac22f65ceba` + +Source base: 3cc37be5fb46b2e45be54ab13f52765c702edc24 plus the reviewable +28-structure/high-resolution changes in this checkout. Selected source hashes +and final check summaries are recorded in VERIFICATION.json. Built with installed VCC Plus 3.6.1 (54), bundled CMOC 0.1.100 and LWTools 4.25. -Release, Debug and Test disk builds passed. Program/static storage ends at -$764E (Release),$7687 (Debug),$7653 (Test), below the $7800 limit and separate -2 KB stack reservation. Two graphics pages retain the public GIME512 KB contract. -Generated skeleton geometry occupies 5,975 bytes; ordinary builds do not run an -SVG renderer or need Python/Pillow/rsvg-convert. +Release program/static storage ends at $73FD; Debug at $745B; Test at $7402. +All remain below the $7800 limit, with the separate 2 KB stack below $8000. +Debug and Test were built in separate minimal folders without the original SVG, +Python, Pillow or asset-conversion scripts as build inputs. + +The display is native 640 × 225, four colors, with two 36,000-byte images in +40 KiB reservations ($1E–$27). Artwork uses the bank library's separate $28–$2B +reservation. BONES.DAT is 16,640 bytes; compiled geometry metadata is 552 bytes. +The loader reads the file once, verifies size/checksum and never writes to disk. +Ordinary builds use the retained metadata and drawing file. ## Logic and artwork -make test passed: 50,000 option sets across 2,000 games, all 25 topics once per game, -four distinct choices, no consecutive repeated correct slot, all permitted -slot transitions, replay reset, canonical names/common aliases, known-wrong -name/alias priority, spelling checks, scoring and duplicate-answer guards. -All 25 authoring topics/aliases agree exactly with generated C. The original SVG -hash matches its receipt. Six geometry views have bounded, disjoint spans; -each topic has nonempty overview coverage, with detailed small-bone views. +make test passed 56,000 option sets across 2,000 complete shuffled 28-topic +orders: unique topics/options, no consecutive correct-slot repeats, all allowed +transitions, replay reset, aliases, known-wrong-name priority, spelling, scoring +and duplicate-answer protection. Canonical bank/generated C identity, the +original SVG hash, external artwork SHA-256/checksum, six disjoint bounded views, +and visible coverage for every overview/selected-detail topic also passed. -## Feedback audio +## Graphics and loading regressions -Separate bounded correct/incorrect feedback captures contained nonzero 44.1 kHz -stereo PCM (peak 16128). Capture began at the actual feedback phase, before the -tones; no microphone or host audio device was used. This establishes generated -guest signal, not audible listening or comprehensive frequency analysis. +The retained tests/check_graphics.py fixture passed on both guest CPUs. It checks +576,000 actual guest pixels per CPU across four observations and three +presentations: packed 2-bit edges, all 8 KiB seams, fifth-bank rows, clipping, +page flips, complete front-to-back copies, edits staying hidden until present, +stock MMU restoration, BASIC return and zero writes. Its host arithmetic check +compares the actual rectangle function against an independent pixel reference +for all horizontal positions/widths on 15 critical rows and 1,000 clipped +multirow rectangles. + +The retained tests/check_loader.py checks passed on both CPUs: missing artwork, +wrong file size and wrong checksum all return to BASIC with a clear error and +zero guest disk writes. Tests modify disposable in-memory copies only. + +## Thumb pose and quit controls + +The screen-right hand's thumb chain is rotated toward the palm in the converter; +bone lengths and relative joints are preserved. All six generated views use the +same pose, and the original SVG hash remains unchanged. The current guest hand +capture is images/hand-detail.png. + +The separate quit regression passed 16 actual guest scenarios across both CPUs: +Q/q, Break/native Escape and ASCII 27 via Ctrl+Shift+Down, title, credits, +multiple choice, partial typed input, spelling help, typed feedback and the +automatic reading pause. All return to BASIC with normal MMU mappings and zero +disk writes. Complete-game runs additionally quit directly from missed review. +Blank Enter now reveals a typed answer; Escape/Break are reserved for exit. + +The unchanged low-level graphics and loader modules retain the earlier +regression evidence recorded below; those suites were not repeated for this +pose/input refinement. ## Actual gameplay -The actual Release disk completed a 25-question multiple-choice game AND a -25-question typed game on each emulated MC6809 and HD6309, with512 KB RAM, -CoCo 3 BASIC, FD-502 Disk BASIC and RGB video. Tests used isolated app-owned -machines and disposable disk copies; no personal emulator or desktop input -was controlled. +The actual Release disk completed a full 28-question multiple-choice round and +a full 28-question typed-answer round on each emulated MC6809 and HD6309. Both +reported zero disk writes and preserved the exact disk hash. -The driver decoded displayed text against the matching linked font and checked -the skeleton's actual pixels against the topic masks and answer history. It -verified question numbers, readable choices, current highlighting, purple/red -progress, no consecutive correct-slot repeats, held-key protection, deliberate -wrong answers, common aliases, case/spacing, spelling retry and Backspace, -33-character entry bounds, reveal, scores 20/25 (80%), one correction, paged -review, neutral replay title and clean return to BASIC. Both runs preserved the -disk hash and reported zero guest writes. +The driver reads the actual displayed text and checks the full skeleton and +enlarged detail pixels against the current question and answer history. Checks +include all 28 highlights, white normal/correct structures, yellow current, +red missed, four readable choices, no repeated correct slot, held-key release, +common aliases, case/spacing, spelling retry/Backspace, the 33-character bound, +reveal, 23/28 (82%) scoring, one correction, paged review, replay and BASIC exit. +Separate correct/incorrect feedback captures verify nonzero guest audio samples; +this establishes generated signal, not audible listening. Personal emulator +settings/media and desktop input are untouched. -To repeat these developer checks, provide your own ROM paths explicitly: +To repeat developer checks, supply your own private ROM paths: ```sh python3 tests/playtest.py --rom /path/to/coco3.rom --disk-rom /path/to/disk11.rom +python3 tests/check_quit.py --rom /path/to/coco3.rom --disk-rom /path/to/disk11.rom +python3 tests/check_graphics.py --rom /path/to/coco3.rom --disk-rom /path/to/disk11.rom +python3 tests/check_loader.py --rom /path/to/coco3.rom --disk-rom /path/to/disk11.rom ``` -The harness uses the installed app's isolated helper and is qualified against -the build identified above; it is not a general alternate MCP server. Private -ROMs, raw captures, result JSON and build outputs stay ignored under test-output/. -Selected unchanged guest frames are retained in docs/images/ and identified by -docs/SCREENSHOTS.json. They are actual game frames, not native-window marketing -captures or mockups. +Raw logs/captures and ROM inputs are excluded from Git. Selected unmodified guest +frames are in images/ with matching hashes and disk identity in SCREENSHOTS.json. +At 640 × 225, the helper's active image starts at output (0,16), with two output +rows per guest row. These are game frames rather than native-window captures. -No physical CoCo, host Intel, macOS 14 or audible listening qualification is -claimed. Native editor/source-open UI is not exercised by the headless tests. +No physical CoCo, host Intel, macOS 14, native editor/source-open UI or audible +listening qualification is claimed. The original 25-topic candidate's evidence +is preserved in testing/INITIAL_25_TOPICS.md and its original source revision. + +The initial high-resolution candidate record is retained in testing/HIGH_RESOLUTION_INITIAL.md and .json; its prior disk remains unchanged under test-output/pre-thumb-quit/. diff --git a/docs/VERIFICATION.json b/docs/VERIFICATION.json new file mode 100644 index 0000000..4934907 --- /dev/null +++ b/docs/VERIFICATION.json @@ -0,0 +1,352 @@ +{ + "date": "2026-11-11", + "baseRevision": "3cc37be5fb46b2e45be54ab13f52765c702edc24", + "sourceState": "Local 28-structure / 640x225 / relaxed thumb / global quit changes retained for review", + "disk": { + "file": "BONEQ.DSK", + "bytes": 161280, + "sha256": "373a3f387daf541b1eb4edd3421a125dd57094e600ee48d162802ac22f65ceba" + }, + "configuration": "Release", + "programEnd": "73FD", + "app": "VCC Plus 3.6.1 (54)", + "toolchain": { + "CMOC": "0.1.100", + "LWTools": "4.25" + }, + "sourceFiles": { + "Makefile": "b0e9816d4b1712cd903b1e51ebb5c80901fb45ba4233f6b091e6e97fe5cdd1d7", + "assets/generated/BONES.DAT": "60303495c7c4df61b0e1b46797126b48ecad82874df9e0a0739a5617589e2255", + "assets/skeleton-source.svg": "501752c94533439a31521a929a10ad1dd1b781f588d44fc87144c426a38b8773", + "data/bones.json": "c4c609fd8a55d503279a728078dd285e2bfb0aaaa0d231a6e097eccafc9bbd50", + "data/geometry-manifest.json": "cf79e4c4f780103939fb0a01f6513b1e1a094479d656a3858ab11212060fa1f3", + "geometry.h": "6f5671aecc191b68940193b4a4cfedb45de065ec3aebd82b8b780f8f911bd81f", + "graphics.h": "432db9ea323eabdff8badb83e15ee6d59f45a8f21f2c593ecbfab025f23a9d47", + "main.c": "fa0b248eac3557ef26e6df9c256c313207aa6cc0d15ca72d605c86d4053a58ab", + "map_data.h": "cbe804d68efe6e24226e86243b7c0df7f81898cc24d135c334744bd505e72359", + "quiz.h": "664c9b3b967d561c7a11c54a994b0963ffaca7019d2fc06ca812cdd7861c1b44", + "src/bones.c": "f533d2ecfbc3fc47f0669ef3cf2f4faec25728958ea71182e42a5893b17b4fed", + "src/geometry.c": "32cf6c08bd48bc065280657af29e00f065db6b6d64b053b22818e669c860cf99", + "src/graphics.c": "e7044af1de881695b06d3eb3cda0387d372cc5b0251d72a42b2255c48f65f9e0", + "src/map_data.c": "b89c39c4c2c52aa4f1107f4dafc063ca65f3f67e080ad4643ed37e51d461f4b6", + "src/quiz.c": "6c5e0e52d24e625dd9593fd2918eb9e86f9e0b842f04edfd6c580fe7844502f5", + "src/ui.c": "b4af299bd32db673ae061a956ec1d8914553fea4d5336a94615fe7c441b90559", + "tests/check_assets.py": "890517b520c464553abfe5404c0e839a049441b134c0ee6211b40f9569072ee6", + "tests/check_graphics.py": "3965b8f249aa4e5c8810fa3c779dfed67d2742213839a5c2ddc9fbc653f58bb7", + "tests/check_loader.py": "81059e960ca9eb507b1a243452d3df2ed22b52c6d211210056cb4afc7776acc4", + "tests/check_quit.py": "d13ef9c0f5653cae49d5428ee1de3bd765286e9369a42c9192d293952238d186", + "tests/graphics_arithmetic.c": "97fed0470f309a165588f6ecf44f25998fb1c79f469345a09f46588aa3be21ee", + "tests/graphics_fixture.c": "9445eb27e91d15d0b6a0b6c28316c63e98546f6be5d8a39cbb53f0ea457ed43c", + "tests/playtest.py": "9db0733fd63b7cf3ee0ed089ccce0b9488345b57645a686ba4f2f7e80804dc8d", + "tests/test_quiz.c": "d923cd7ba61230f4ae0a9e16f8a6d96258d7dd7d89cb78014775a7eb3e5846c0", + "tools/boot.c": "6fba20dc79348b28c951a1323d1aa4e857bc63fd3e898fc8b3eefd69ad077486", + "tools/prepare_assets.py": "2a2e1c6af1981b1182af297bfcddb24c3e95f6a052f7d90d873250fa6477d1ed", + "tools/prepare_questions.py": "c1f51dde59dcc1e1ab596461e9a521ee0b4a37a5cfaa9b0deda3a8ba9fee6f3f", + "ui.h": "a19c47004e2d915939eb128634e15d4b1d5299fc3b3b61be8f316b7cc425b9fb" + }, + "gameplay": [ + { + "cpu": "6809", + "ramKB": 512, + "multipleChoice": 28, + "typed": 28, + "score": 23, + "spellingCorrections": 1, + "mapPixelsChecked": true, + "detailPixelsChecked": true, + "feedbackAudio": true, + "noRepeatedCorrectSlots": true, + "heldKey": true, + "review": true, + "replay": true, + "exit": true, + "diskSHA256": "373a3f387daf541b1eb4edd3421a125dd57094e600ee48d162802ac22f65ceba", + "diskWrites": 0 + }, + { + "cpu": "6309", + "ramKB": 512, + "multipleChoice": 28, + "typed": 28, + "score": 23, + "spellingCorrections": 1, + "mapPixelsChecked": true, + "detailPixelsChecked": true, + "feedbackAudio": true, + "noRepeatedCorrectSlots": true, + "heldKey": true, + "review": true, + "replay": true, + "exit": true, + "diskSHA256": "373a3f387daf541b1eb4edd3421a125dd57094e600ee48d162802ac22f65ceba", + "diskWrites": 0 + } + ], + "feedbackAudio": [ + { + "file": "6309-correct-feedback.wav", + "sampleRate": 44100, + "frames": 88651, + "peak": 16128, + "generatedSignal": true, + "audibleListening": false + }, + { + "file": "6309-incorrect-feedback.wav", + "sampleRate": 44100, + "frames": 88652, + "peak": 16128, + "generatedSignal": true, + "audibleListening": false + }, + { + "file": "6809-correct-feedback.wav", + "sampleRate": 44100, + "frames": 88652, + "peak": 16128, + "generatedSignal": true, + "audibleListening": false + }, + { + "file": "6809-incorrect-feedback.wav", + "sampleRate": 44100, + "frames": 88652, + "peak": 16128, + "generatedSignal": true, + "audibleListening": false + } + ], + "configurationBuilds": [ + { + "configuration": "Debug", + "programEnd": "745B", + "diskSHA256": "6e323886ce705997a3886e2ea27a5ac40db2d591a93a2a8f69f176157935be07", + "ordinaryBuildWithoutAuthoringInputs": true + }, + { + "configuration": "Test", + "programEnd": "7402", + "diskSHA256": "d3b602d8e7ee36d0eca49c82cd3705d98d13e92bfa239aa245d15bc0ccb7ddb9", + "ordinaryBuildWithoutAuthoringInputs": true + } + ], + "graphics": { + "sourceSHA256": { + "src/graphics.c": "e7044af1de881695b06d3eb3cda0387d372cc5b0251d72a42b2255c48f65f9e0", + "graphics.h": "432db9ea323eabdff8badb83e15ee6d59f45a8f21f2c593ecbfab025f23a9d47", + "tests/graphics_fixture.c": "9445eb27e91d15d0b6a0b6c28316c63e98546f6be5d8a39cbb53f0ea457ed43c", + "tests/graphics_arithmetic.c": "97fed0470f309a165588f6ecf44f25998fb1c79f469345a09f46588aa3be21ee", + "tests/check_graphics.py": "3965b8f249aa4e5c8810fa3c779dfed67d2742213839a5c2ddc9fbc653f58bb7", + "tools/boot.c": "6fba20dc79348b28c951a1323d1aa4e857bc63fd3e898fc8b3eefd69ad077486" + }, + "fixtureDiskSHA256": "a4dc07c314e338848a31026d8c5f5551979d3797b3e2bda79744fb177f4a42a2", + "emulatorVersion": "3.6.1", + "emulatorBuild": "54", + "hostArithmetic": "passed", + "tests": [ + { + "cpu": "6809", + "ramKB": 512, + "width": 640, + "height": 225, + "frameTop": 16, + "pageFlips": 3, + "frontCopied": true, + "noPrematurePresentation": true, + "guestPixelsChecked": 576000, + "clipping": true, + "partialByteEdges": true, + "bankBoundaries": true, + "MMURestored": true, + "BASICReturned": true, + "diskWrites": 0 + }, + { + "cpu": "6309", + "ramKB": 512, + "width": 640, + "height": 225, + "frameTop": 16, + "pageFlips": 3, + "frontCopied": true, + "noPrematurePresentation": true, + "guestPixelsChecked": 576000, + "clipping": true, + "partialByteEdges": true, + "bankBoundaries": true, + "MMURestored": true, + "BASICReturned": true, + "diskWrites": 0 + } + ] + }, + "loader": [ + { + "cpu": "6809", + "variant": "missing", + "BASICReturned": true, + "diskWrites": 0 + }, + { + "cpu": "6809", + "variant": "wrong-size", + "BASICReturned": true, + "diskWrites": 0 + }, + { + "cpu": "6809", + "variant": "wrong-checksum", + "BASICReturned": true, + "diskWrites": 0 + }, + { + "cpu": "6309", + "variant": "missing", + "BASICReturned": true, + "diskWrites": 0 + }, + { + "cpu": "6309", + "variant": "wrong-size", + "BASICReturned": true, + "diskWrites": 0 + }, + { + "cpu": "6309", + "variant": "wrong-checksum", + "BASICReturned": true, + "diskWrites": 0 + } + ], + "quitControls": [ + { + "cpu": "6809", + "scenario": "title-Q", + "BASICReturned": true, + "MMURestored": true, + "diskWrites": 0, + "diskSHA256": "373a3f387daf541b1eb4edd3421a125dd57094e600ee48d162802ac22f65ceba" + }, + { + "cpu": "6809", + "scenario": "credits-Break", + "BASICReturned": true, + "MMURestored": true, + "diskWrites": 0, + "diskSHA256": "373a3f387daf541b1eb4edd3421a125dd57094e600ee48d162802ac22f65ceba" + }, + { + "cpu": "6809", + "scenario": "choice-Q", + "BASICReturned": true, + "MMURestored": true, + "diskWrites": 0, + "diskSHA256": "373a3f387daf541b1eb4edd3421a125dd57094e600ee48d162802ac22f65ceba" + }, + { + "cpu": "6809", + "scenario": "typed-q", + "BASICReturned": true, + "MMURestored": true, + "diskWrites": 0, + "diskSHA256": "373a3f387daf541b1eb4edd3421a125dd57094e600ee48d162802ac22f65ceba" + }, + { + "cpu": "6809", + "scenario": "typed-ASCII27", + "BASICReturned": true, + "MMURestored": true, + "diskWrites": 0, + "diskSHA256": "373a3f387daf541b1eb4edd3421a125dd57094e600ee48d162802ac22f65ceba" + }, + { + "cpu": "6809", + "scenario": "spelling-Break", + "BASICReturned": true, + "MMURestored": true, + "diskWrites": 0, + "diskSHA256": "373a3f387daf541b1eb4edd3421a125dd57094e600ee48d162802ac22f65ceba" + }, + { + "cpu": "6809", + "scenario": "typed-feedback-Q", + "BASICReturned": true, + "MMURestored": true, + "diskWrites": 0, + "diskSHA256": "373a3f387daf541b1eb4edd3421a125dd57094e600ee48d162802ac22f65ceba" + }, + { + "cpu": "6809", + "scenario": "auto-feedback-Break", + "BASICReturned": true, + "MMURestored": true, + "diskWrites": 0, + "diskSHA256": "373a3f387daf541b1eb4edd3421a125dd57094e600ee48d162802ac22f65ceba" + }, + { + "cpu": "6309", + "scenario": "title-Q", + "BASICReturned": true, + "MMURestored": true, + "diskWrites": 0, + "diskSHA256": "373a3f387daf541b1eb4edd3421a125dd57094e600ee48d162802ac22f65ceba" + }, + { + "cpu": "6309", + "scenario": "credits-Break", + "BASICReturned": true, + "MMURestored": true, + "diskWrites": 0, + "diskSHA256": "373a3f387daf541b1eb4edd3421a125dd57094e600ee48d162802ac22f65ceba" + }, + { + "cpu": "6309", + "scenario": "choice-Q", + "BASICReturned": true, + "MMURestored": true, + "diskWrites": 0, + "diskSHA256": "373a3f387daf541b1eb4edd3421a125dd57094e600ee48d162802ac22f65ceba" + }, + { + "cpu": "6309", + "scenario": "typed-q", + "BASICReturned": true, + "MMURestored": true, + "diskWrites": 0, + "diskSHA256": "373a3f387daf541b1eb4edd3421a125dd57094e600ee48d162802ac22f65ceba" + }, + { + "cpu": "6309", + "scenario": "typed-ASCII27", + "BASICReturned": true, + "MMURestored": true, + "diskWrites": 0, + "diskSHA256": "373a3f387daf541b1eb4edd3421a125dd57094e600ee48d162802ac22f65ceba" + }, + { + "cpu": "6309", + "scenario": "spelling-Break", + "BASICReturned": true, + "MMURestored": true, + "diskWrites": 0, + "diskSHA256": "373a3f387daf541b1eb4edd3421a125dd57094e600ee48d162802ac22f65ceba" + }, + { + "cpu": "6309", + "scenario": "typed-feedback-Q", + "BASICReturned": true, + "MMURestored": true, + "diskWrites": 0, + "diskSHA256": "373a3f387daf541b1eb4edd3421a125dd57094e600ee48d162802ac22f65ceba" + }, + { + "cpu": "6309", + "scenario": "auto-feedback-Break", + "BASICReturned": true, + "MMURestored": true, + "diskWrites": 0, + "diskSHA256": "373a3f387daf541b1eb4edd3421a125dd57094e600ee48d162802ac22f65ceba" + } + ], + "retainedRegressionNote": "Graphics and loader source unchanged since preceding high-resolution candidate; prior module regressions retained." +} diff --git a/docs/images/hand-detail.png b/docs/images/hand-detail.png new file mode 100644 index 0000000..670486c Binary files /dev/null and b/docs/images/hand-detail.png differ diff --git a/docs/images/head-detail.png b/docs/images/head-detail.png new file mode 100644 index 0000000..39488f9 Binary files /dev/null and b/docs/images/head-detail.png differ diff --git a/docs/images/multiple-choice.png b/docs/images/multiple-choice.png index 05a5d73..7ff09b4 100644 Binary files a/docs/images/multiple-choice.png and b/docs/images/multiple-choice.png differ diff --git a/docs/images/results.png b/docs/images/results.png index f13b808..02f6b01 100644 Binary files a/docs/images/results.png and b/docs/images/results.png differ diff --git a/docs/images/title.png b/docs/images/title.png index 1720e65..365a7fc 100644 Binary files a/docs/images/title.png and b/docs/images/title.png differ diff --git a/docs/images/typed-answer.png b/docs/images/typed-answer.png index 0f70ec0..b8be54c 100644 Binary files a/docs/images/typed-answer.png and b/docs/images/typed-answer.png differ diff --git a/docs/testing/HIGH_RESOLUTION_INITIAL.json b/docs/testing/HIGH_RESOLUTION_INITIAL.json new file mode 100644 index 0000000..b8b0a66 --- /dev/null +++ b/docs/testing/HIGH_RESOLUTION_INITIAL.json @@ -0,0 +1,220 @@ +{ + "date": "2026-11-11", + "baseRevision": "3cc37be5fb46b2e45be54ab13f52765c702edc24", + "sourceState": "Local 28-structure / 640x225 changes retained for review", + "disk": { + "file": "BONEQ.DSK", + "bytes": 161280, + "sha256": "2ef7530ef3d7fc0270e46ef800266fc6ce1557b58a470e3b8e97e3959d428d96" + }, + "configuration": "Release", + "programEnd": "73A3", + "app": "VCC Plus 3.6.1 (54)", + "toolchain": { + "CMOC": "0.1.100", + "LWTools": "4.25" + }, + "sourceFiles": { + "Makefile": "b0e9816d4b1712cd903b1e51ebb5c80901fb45ba4233f6b091e6e97fe5cdd1d7", + "assets/generated/BONES.DAT": "8a8a3a84156cb3fd3bd767ee13a2dd267a8f63ec373d9fd3fb99b883020f1bd2", + "assets/skeleton-source.svg": "501752c94533439a31521a929a10ad1dd1b781f588d44fc87144c426a38b8773", + "data/bones.json": "c4c609fd8a55d503279a728078dd285e2bfb0aaaa0d231a6e097eccafc9bbd50", + "data/geometry-manifest.json": "36e0cd424f822f9347c37d79cf97aa15befe17651d07b8c9676d5521c2bcf653", + "geometry.h": "6f5671aecc191b68940193b4a4cfedb45de065ec3aebd82b8b780f8f911bd81f", + "graphics.h": "432db9ea323eabdff8badb83e15ee6d59f45a8f21f2c593ecbfab025f23a9d47", + "main.c": "a948780d1dc842365eb49b9bfef4b1c82fde779b89c3f31c99e75490f0600deb", + "map_data.h": "cbe804d68efe6e24226e86243b7c0df7f81898cc24d135c334744bd505e72359", + "quiz.h": "664c9b3b967d561c7a11c54a994b0963ffaca7019d2fc06ca812cdd7861c1b44", + "src/bones.c": "f533d2ecfbc3fc47f0669ef3cf2f4faec25728958ea71182e42a5893b17b4fed", + "src/geometry.c": "32cf6c08bd48bc065280657af29e00f065db6b6d64b053b22818e669c860cf99", + "src/graphics.c": "e7044af1de881695b06d3eb3cda0387d372cc5b0251d72a42b2255c48f65f9e0", + "src/map_data.c": "e89a4932324f7785d828b50656c557fb1c8fc064b718366c1a4717fd11752a84", + "src/quiz.c": "6c5e0e52d24e625dd9593fd2918eb9e86f9e0b842f04edfd6c580fe7844502f5", + "src/ui.c": "268bcc4b12e9e9949a1331a89906a39d13e02fb183a771e4bdfcf89342b4761e", + "tests/check_assets.py": "890517b520c464553abfe5404c0e839a049441b134c0ee6211b40f9569072ee6", + "tests/check_graphics.py": "3965b8f249aa4e5c8810fa3c779dfed67d2742213839a5c2ddc9fbc653f58bb7", + "tests/check_loader.py": "81059e960ca9eb507b1a243452d3df2ed22b52c6d211210056cb4afc7776acc4", + "tests/graphics_arithmetic.c": "97fed0470f309a165588f6ecf44f25998fb1c79f469345a09f46588aa3be21ee", + "tests/graphics_fixture.c": "9445eb27e91d15d0b6a0b6c28316c63e98546f6be5d8a39cbb53f0ea457ed43c", + "tests/playtest.py": "3f050f73e7132b3fe7ee2cd721661836f8a8a7ab4b7707d2e45b7d21ca0f30f5", + "tests/test_quiz.c": "d923cd7ba61230f4ae0a9e16f8a6d96258d7dd7d89cb78014775a7eb3e5846c0", + "tools/boot.c": "6fba20dc79348b28c951a1323d1aa4e857bc63fd3e898fc8b3eefd69ad077486", + "tools/prepare_assets.py": "c4569478b00e46f6753b8d0fd610e0fee1ffc257b0be047cac2e2fb3e863ab02", + "tools/prepare_questions.py": "c1f51dde59dcc1e1ab596461e9a521ee0b4a37a5cfaa9b0deda3a8ba9fee6f3f", + "ui.h": "671d7b56d840713e42441122665670e1c33e689ac0741085b62e5ae71b6dffbc" + }, + "gameplay": [ + { + "cpu": "6809", + "ramKB": 512, + "multipleChoice": 28, + "typed": 28, + "score": 23, + "spellingCorrections": 1, + "mapPixelsChecked": true, + "detailPixelsChecked": true, + "feedbackAudio": true, + "noRepeatedCorrectSlots": true, + "heldKey": true, + "review": true, + "replay": true, + "exit": true, + "diskSHA256": "2ef7530ef3d7fc0270e46ef800266fc6ce1557b58a470e3b8e97e3959d428d96", + "diskWrites": 0 + }, + { + "cpu": "6309", + "ramKB": 512, + "multipleChoice": 28, + "typed": 28, + "score": 23, + "spellingCorrections": 1, + "mapPixelsChecked": true, + "detailPixelsChecked": true, + "feedbackAudio": true, + "noRepeatedCorrectSlots": true, + "heldKey": true, + "review": true, + "replay": true, + "exit": true, + "diskSHA256": "2ef7530ef3d7fc0270e46ef800266fc6ce1557b58a470e3b8e97e3959d428d96", + "diskWrites": 0 + } + ], + "feedbackAudio": [ + { + "file": "6309-correct-feedback.wav", + "sampleRate": 44100, + "frames": 88652, + "peak": 16128, + "generatedSignal": true, + "audibleListening": false + }, + { + "file": "6309-incorrect-feedback.wav", + "sampleRate": 44100, + "frames": 88652, + "peak": 16128, + "generatedSignal": true, + "audibleListening": false + }, + { + "file": "6809-correct-feedback.wav", + "sampleRate": 44100, + "frames": 88651, + "peak": 16128, + "generatedSignal": true, + "audibleListening": false + }, + { + "file": "6809-incorrect-feedback.wav", + "sampleRate": 44100, + "frames": 88652, + "peak": 16128, + "generatedSignal": true, + "audibleListening": false + } + ], + "configurationBuilds": [ + { + "configuration": "Debug", + "programEnd": "73FA", + "diskSHA256": "dbe8b50162883450aaf1f740569653eb75b993518a52f93880503a877c76aa67", + "ordinaryBuildWithoutAuthoringInputs": true + }, + { + "configuration": "Test", + "programEnd": "73A8", + "diskSHA256": "a80fe3c132aff9eaa1dae02a98903c9eca35b38d8e0b4de6c20cd50586ce2884", + "ordinaryBuildWithoutAuthoringInputs": true + } + ], + "graphics": { + "sourceSHA256": { + "src/graphics.c": "e7044af1de881695b06d3eb3cda0387d372cc5b0251d72a42b2255c48f65f9e0", + "graphics.h": "432db9ea323eabdff8badb83e15ee6d59f45a8f21f2c593ecbfab025f23a9d47", + "tests/graphics_fixture.c": "9445eb27e91d15d0b6a0b6c28316c63e98546f6be5d8a39cbb53f0ea457ed43c", + "tests/graphics_arithmetic.c": "97fed0470f309a165588f6ecf44f25998fb1c79f469345a09f46588aa3be21ee", + "tests/check_graphics.py": "3965b8f249aa4e5c8810fa3c779dfed67d2742213839a5c2ddc9fbc653f58bb7", + "tools/boot.c": "6fba20dc79348b28c951a1323d1aa4e857bc63fd3e898fc8b3eefd69ad077486" + }, + "fixtureDiskSHA256": "a4dc07c314e338848a31026d8c5f5551979d3797b3e2bda79744fb177f4a42a2", + "emulatorVersion": "3.6.1", + "emulatorBuild": "54", + "hostArithmetic": "passed", + "tests": [ + { + "cpu": "6809", + "ramKB": 512, + "width": 640, + "height": 225, + "frameTop": 16, + "pageFlips": 3, + "frontCopied": true, + "noPrematurePresentation": true, + "guestPixelsChecked": 576000, + "clipping": true, + "partialByteEdges": true, + "bankBoundaries": true, + "MMURestored": true, + "BASICReturned": true, + "diskWrites": 0 + }, + { + "cpu": "6309", + "ramKB": 512, + "width": 640, + "height": 225, + "frameTop": 16, + "pageFlips": 3, + "frontCopied": true, + "noPrematurePresentation": true, + "guestPixelsChecked": 576000, + "clipping": true, + "partialByteEdges": true, + "bankBoundaries": true, + "MMURestored": true, + "BASICReturned": true, + "diskWrites": 0 + } + ] + }, + "loader": [ + { + "cpu": "6809", + "variant": "missing", + "BASICReturned": true, + "diskWrites": 0 + }, + { + "cpu": "6809", + "variant": "wrong-size", + "BASICReturned": true, + "diskWrites": 0 + }, + { + "cpu": "6809", + "variant": "wrong-checksum", + "BASICReturned": true, + "diskWrites": 0 + }, + { + "cpu": "6309", + "variant": "missing", + "BASICReturned": true, + "diskWrites": 0 + }, + { + "cpu": "6309", + "variant": "wrong-size", + "BASICReturned": true, + "diskWrites": 0 + }, + { + "cpu": "6309", + "variant": "wrong-checksum", + "BASICReturned": true, + "diskWrites": 0 + } + ] +} diff --git a/docs/testing/HIGH_RESOLUTION_INITIAL.md b/docs/testing/HIGH_RESOLUTION_INITIAL.md new file mode 100644 index 0000000..92040f8 --- /dev/null +++ b/docs/testing/HIGH_RESOLUTION_INITIAL.md @@ -0,0 +1,80 @@ +# High-resolution Bone Quest verification — November 11, 2026 + +## Candidate and builds + +The current candidate is a 35-track DECB disk, 161,280 bytes, SHA-256: + +`2ef7530ef3d7fc0270e46ef800266fc6ce1557b58a470e3b8e97e3959d428d96` + +Source base: 3cc37be5fb46b2e45be54ab13f52765c702edc24 plus the reviewable +28-structure/high-resolution changes in this checkout. Selected source hashes +and final check summaries are recorded in VERIFICATION.json. + +Built with installed VCC Plus 3.6.1 (54), bundled CMOC 0.1.100 and LWTools 4.25. +Release program/static storage ends at $73A3; Debug at $73FA; Test at $73A8. +All remain below the $7800 limit, with the separate 2 KB stack below $8000. +Debug and Test were built in separate minimal folders without the original SVG, +Python, Pillow or asset-conversion scripts as build inputs. + +The display is native 640 × 225, four colors, with two 36,000-byte images in +40 KiB reservations ($1E–$27). Artwork uses the bank library's separate $28–$2B +reservation. BONES.DAT is 16,640 bytes; compiled geometry metadata is 552 bytes. +The loader reads the file once, verifies size/checksum and never writes to disk. +Ordinary builds use the retained metadata and drawing file. + +## Logic and artwork + +make test passed 56,000 option sets across 2,000 complete shuffled 28-topic +orders: unique topics/options, no consecutive correct-slot repeats, all allowed +transitions, replay reset, aliases, known-wrong-name priority, spelling, scoring +and duplicate-answer protection. Canonical bank/generated C identity, the +original SVG hash, external artwork SHA-256/checksum, six disjoint bounded views, +and visible coverage for every overview/selected-detail topic also passed. + +## Graphics and loading regressions + +The retained tests/check_graphics.py fixture passed on both guest CPUs. It checks +576,000 actual guest pixels per CPU across four observations and three +presentations: packed 2-bit edges, all 8 KiB seams, fifth-bank rows, clipping, +page flips, complete front-to-back copies, edits staying hidden until present, +stock MMU restoration, BASIC return and zero writes. Its host arithmetic check +compares the actual rectangle function against an independent pixel reference +for all horizontal positions/widths on 15 critical rows and 1,000 clipped +multirow rectangles. + +The retained tests/check_loader.py checks passed on both CPUs: missing artwork, +wrong file size and wrong checksum all return to BASIC with a clear error and +zero guest disk writes. Tests modify disposable in-memory copies only. + +## Actual gameplay + +The actual Release disk completed a full 28-question multiple-choice round and +a full 28-question typed-answer round on each emulated MC6809 and HD6309. Both +reported zero disk writes and preserved the exact disk hash. + +The driver reads the actual displayed text and checks the full skeleton and +enlarged detail pixels against the current question and answer history. Checks +include all 28 highlights, white normal/correct structures, yellow current, +red missed, four readable choices, no repeated correct slot, held-key release, +common aliases, case/spacing, spelling retry/Backspace, the 33-character bound, +reveal, 23/28 (82%) scoring, one correction, paged review, replay and BASIC exit. +Separate correct/incorrect feedback captures verify nonzero guest audio samples; +this establishes generated signal, not audible listening. Personal emulator +settings/media and desktop input are untouched. + +To repeat developer checks, supply your own private ROM paths: + +```sh +python3 tests/playtest.py --rom /path/to/coco3.rom --disk-rom /path/to/disk11.rom +python3 tests/check_graphics.py --rom /path/to/coco3.rom --disk-rom /path/to/disk11.rom +python3 tests/check_loader.py --rom /path/to/coco3.rom --disk-rom /path/to/disk11.rom +``` + +Raw logs/captures and ROM inputs are excluded from Git. Selected unmodified guest +frames are in images/ with matching hashes and disk identity in SCREENSHOTS.json. +At 640 × 225, the helper's active image starts at output (0,16), with two output +rows per guest row. These are game frames rather than native-window captures. + +No physical CoCo, host Intel, macOS 14, native editor/source-open UI or audible +listening qualification is claimed. The original 25-topic candidate's evidence +is preserved in testing/INITIAL_25_TOPICS.md and its original source revision. diff --git a/docs/testing/INITIAL_25_TOPICS.md b/docs/testing/INITIAL_25_TOPICS.md new file mode 100644 index 0000000..530e51b --- /dev/null +++ b/docs/testing/INITIAL_25_TOPICS.md @@ -0,0 +1,68 @@ +Historical verification for the original 25-topic candidate at source revision +3cc37be5fb46b2e45be54ab13f52765c702edc24. Its disk and matching screenshots +remain in that revision. See ../TESTING.md for current high-resolution results. + +# Initial Bone Quest verification — November 11, 2026 + +## Built and delivered + +The root BONEQ.DSK is a standard 35-track DECB image, 161,280 bytes, SHA-256: + +`cf9b2da5842551d76b58c3be2064a78163536526826fca13ac7ee58c269e1e66` + +Built with installed VCC Plus 3.6.1 (54), bundled CMOC 0.1.100 and LWTools 4.25. +Release, Debug and Test disk builds passed. Program/static storage ends at +$764E (Release),$7687 (Debug),$7653 (Test), below the $7800 limit and separate +2 KB stack reservation. Two graphics pages retain the public GIME512 KB contract. +Generated skeleton geometry occupies 5,975 bytes; ordinary builds do not run an +SVG renderer or need Python/Pillow/rsvg-convert. + +## Logic and artwork + +make test passed: 50,000 option sets across 2,000 games, all 25 topics once per game, +four distinct choices, no consecutive repeated correct slot, all permitted +slot transitions, replay reset, canonical names/common aliases, known-wrong +name/alias priority, spelling checks, scoring and duplicate-answer guards. +All 25 authoring topics/aliases agree exactly with generated C. The original SVG +hash matches its receipt. Six geometry views have bounded, disjoint spans; +each topic has nonempty overview coverage, with detailed small-bone views. + +## Feedback audio + +Separate bounded correct/incorrect feedback captures contained nonzero 44.1 kHz +stereo PCM (peak 16128). Capture began at the actual feedback phase, before the +tones; no microphone or host audio device was used. This establishes generated +guest signal, not audible listening or comprehensive frequency analysis. + +## Actual gameplay + +The actual Release disk completed a 25-question multiple-choice game AND a +25-question typed game on each emulated MC6809 and HD6309, with512 KB RAM, +CoCo 3 BASIC, FD-502 Disk BASIC and RGB video. Tests used isolated app-owned +machines and disposable disk copies; no personal emulator or desktop input +was controlled. + +The driver decoded displayed text against the matching linked font and checked +the skeleton's actual pixels against the topic masks and answer history. It +verified question numbers, readable choices, current highlighting, purple/red +progress, no consecutive correct-slot repeats, held-key protection, deliberate +wrong answers, common aliases, case/spacing, spelling retry and Backspace, +33-character entry bounds, reveal, scores 20/25 (80%), one correction, paged +review, neutral replay title and clean return to BASIC. Both runs preserved the +disk hash and reported zero guest writes. + +To repeat these developer checks, provide your own ROM paths explicitly: + +```sh +python3 tests/playtest.py --rom /path/to/coco3.rom --disk-rom /path/to/disk11.rom +``` + +The harness uses the installed app's isolated helper and is qualified against +the build identified above; it is not a general alternate MCP server. Private +ROMs, raw captures, result JSON and build outputs stay ignored under test-output/. +Selected unchanged guest frames are retained in docs/images/ and identified by +docs/SCREENSHOTS.json. They are actual game frames, not native-window marketing +captures or mockups. + +No physical CoCo, host Intel, macOS 14 or audible listening qualification is +claimed. Native editor/source-open UI is not exercised by the headless tests. diff --git a/geometry.h b/geometry.h new file mode 100644 index 0000000..7da5022 --- /dev/null +++ b/geometry.h @@ -0,0 +1,8 @@ +#ifndef BONE_GEOMETRY_H +#define BONE_GEOMETRY_H +/* Read-only disk art is loaded once into the SDK's dedicated asset banks. */ +extern unsigned char geometry_failed; +unsigned char geometry_open(void); +unsigned char geometry_byte(unsigned offset); +void geometry_close(void); +#endif diff --git a/graphics.h b/graphics.h new file mode 100644 index 0000000..1119666 --- /dev/null +++ b/graphics.h @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +#ifndef BONE_GRAPHICS_H +#define BONE_GRAPHICS_H +#define GFX_WIDTH 640 +#define GFX_HEIGHT 225 + +/* Bone Quest's local four-color GIME driver, adapted from VCC Plus's GPL SDK. + Open from stock IRQ-enabled CoCo 3 BASIC text, with at least 512 KiB RAM. + Code/globals/stack must be below $8000. Both pages reserve physical blocks + $1E-$27 ($3C000-$4FFFF, 80 KiB); the bank library's $28-$2B remain available. + Drawing borrows task 0's $8000 window briefly and restores it and CC before + returning. Do not change the MMU/video registers or call from an interrupt. + Coordinates and rectangles clip to 640x225; palette slots are 0..3. + A successful present flips on BASIC's vertical interrupt and draws into the + former front page, whose contents persist. Close restores BASIC and palette. */ +unsigned char gfx_open(void); +void gfx_fill_rect(unsigned x,unsigned y,unsigned w,unsigned h,unsigned char color); +void gfx_plot(unsigned x,unsigned y,unsigned char color); +void gfx_clear(unsigned char color); +void gfx_set_palette(unsigned char slot,unsigned char rgb); +/* Copy the displayed image into the hidden page without showing/flipping it. + Mapping and interrupt state are restored between each 32-byte chunk. + Returns 0 while closed; 1 after copying all 36,000 visible bytes. */ +unsigned char gfx_copy_front(void); +unsigned char gfx_present(void); +void gfx_close(void); +#endif diff --git a/main.c b/main.c index efe496f..cb56e5e 100644 --- a/main.c +++ b/main.c @@ -1,98 +1,103 @@ /* Bone Quest — based on Brian Holman's GPL-3.0-or-later Capital Quest. */ #include #include -#include +#include "graphics.h" +#include "geometry.h" #include "quiz.h" #include "ui.h" static char line[54],answer[ANSWER_SIZE]; static U8 mode,spelling_attempt; U8 phase,current_bone; +void quit_game(void) +{ + release_keys();close_input();gfx_close();geometry_close();setHighSpeed(FALSE); + printf("Thanks for playing Bone Quest!\n");exit(0); +} static void present(void) { - if(!gime_present()){gime_close();setHighSpeed(FALSE);printf("Graphics timer stopped.\n");exit(1);} + if(geometry_failed || !gfx_present()){gfx_close();geometry_close();setHighSpeed(FALSE);printf("Graphics or artwork stopped.\n");exit(1);} } -static U8 choose(const char *allowed) +static U8 choose(const char *allowed,U8 ready_phase) { - U8 c;release_keys(); + U8 c;phase=7;release_keys();phase=ready_phase; do{c=next_key();if(c>='a' && c<='z')c-='a'-'A';}while(!strchr(allowed,c)); return c; } static void credits(void) { - phase=5;frame("CREDITS"); - text(8,21,"A JOURNEY THROUGH THE SKELETON",6); - text(8,42,"Skeleton: Mariana Ruiz Villarreal",7); - text(8,54,"(LadyofHats), public-domain artwork.",2); - text(8,70,"Wikimedia Commons:",7); - text(8,82,"Human_skeleton_front_en.svg",2); - text(8,99,"Adapted: labels removed, reduced, recolored;",7); - text(8,110,"bone masks and enlarged details prepared.",7); - text(8,129,"Font / boot: Pierre Sarrazin, public domain.",2); - text(8,143,"Based on Capital Quest by Brian Holman.",7); - text(8,155,"Game GPL-3.0-or-later. See assets/CREDITS.md",2); - text(8,180,"SPACE: back",6);present();choose(" "); + phase=7;frame("CREDITS"); + text(16,21,"A JOURNEY THROUGH THE SKELETON",2); + text(16,42,"Skeleton: Mariana Ruiz Villarreal",1); + text(16,54,"(LadyofHats), public-domain artwork.",1); + text(16,70,"Wikimedia Commons:",1); + text(16,82,"Human_skeleton_front_en.svg",1); + text(16,99,"Adapted: labels removed, reduced, recolored;",1); + text(16,110,"bone masks and enlarged details prepared.",1); + text(16,129,"Font / boot: Pierre Sarrazin, public domain.",1); + text(16,143,"Based on Capital Quest by Brian Holman.",1); + text(16,155,"Game GPL-3.0-or-later. See assets/CREDITS.md",1); + text(16,212,"SPACE: back Q/Esc/Break: quit",2);present();choose(" ",5); } static U8 title(void) { U8 c; do{ - phase=0;frame("HUMAN ANATOMY");show_skeleton(255,0); - text(112,35,"25 BONES + GROUPS",6); - text(112,54,"1 MULTIPLE CHOICE",7); - text(112,75,"2 TYPE THE NAME",7); - text(112,101,"C CREDITS",2);text(112,117,"Q QUIT TO BASIC",2); - text(112,143,"Find the yellow bone.",7); - text(112,155,"Learn from each answer.",2); - text(112,169,"512 KB COCO 3 / RGB",6); - text(8,183,"Release keys between presses. Choose 1 or 2.",2); - present();c=choose("12CQ");if(c=='C')credits(); + phase=7;frame("HUMAN ANATOMY");show_skeleton(255,0); + text(224,35,"28 STRUCTURES",2); + text(224,54,"1 MULTIPLE CHOICE",1); + text(224,75,"2 TYPE THE NAME",1); + text(224,101,"C CREDITS",1);text(224,117,"Q QUIT TO BASIC",1); + text(224,143,"Find the yellow part.",1); + text(224,155,"Learn from each answer.",1); + text(224,169,"512 KB COCO 3 / RGB",2); + text(16,216,"1/2: start Q/Esc/Break: quit",1); + present();c=choose("12CQ",0);if(c=='C')credits(); }while(c=='C'); return c; } static void question_screen(void) { - phase=1;frame(mode==1?"MULTIPLE CHOICE":"TYPE THE NAME"); - sprintf(line,"Question %u/%u Score %u",(unsigned)question+1,BONE_COUNT,(unsigned)score);text(8,19,line,7); + phase=7;frame(mode==1?"MULTIPLE CHOICE":"TYPE THE NAME"); + sprintf(line,"Question %u/%u Score %u",(unsigned)question+1,BONE_COUNT,(unsigned)score);text(16,19,line,1); show_skeleton(current_bone,1); - text(112,106,"Name the yellow bone(s).",6); - text(112,118,bones[current_bone].hint,2); - text(8,183,"Teal:new Purple:right Red:miss Yellow:now",2); + text(224,140,"Name the yellow structure.",2); + text(224,153,bones[current_bone].hint,1); + text(16,216,"Yellow:current Red:missed Q/Esc/Break:quit",1); } static U8 multiple_choice(void) { U8 i,c;quiz_options(current_bone);question_screen(); - for(i=0;i<4;++i){sprintf(line,"%u %s",(unsigned)i+1,bones[options[i]].name);text(112,132+i*11,line,7);} - present();c=choose("1234")-'1';strcpy(answer,bones[options[c]].name); + for(i=0;i<4;++i){sprintf(line,"%u %s",(unsigned)i+1,bones[options[i]].name);text(224,168+i*11,line,1);} + present();c=choose("1234",1)-'1';strcpy(answer,bones[options[c]].name); return options[c]==current_bone; } static void input_screen(U8 too_long) { - gime_fill_rect(108,129,212,48,1);text(112,132,answer,7); - text(112+strlen(answer)*6,132,"_",6); - text(112,146,too_long?"Use Backspace to edit.":"Enter:submit Esc:reveal",2); - text(112,159,"Backspace edits the name.",2); - text(112,171,"Case / spaces ignored.",2);present(); + gfx_fill_rect(216,166,424,48,0);text(224,168,answer,1); + text(224+strlen(answer)*12,168,"_",2); + text(224,183,too_long?"Use Backspace to edit.":"Enter:submit Q/Esc:quit",1); + text(224,196,"Blank Enter: show answer.",1); + text(224,208,"Backspace edits; case ignored.",1);present(); } static void input_edit(U8 old_n,U8 new_n) { U8 p,first=old_n='a' && c<='z')||(c>='A' && c<='Z')||c==' '||c=='.'||c=='-'){ /* 33 visible characters fit beside the full-body overview. */ if(n<33){old_n=n;answer[n++]=c;answer[n]=0;input_edit(old_n,n);} @@ -106,46 +111,46 @@ static void answer_sound(U8 right) } static void feedback(U8 right) { - question_screen();phase=3; - text(112,134,right?"CORRECT!":"NOT THIS TIME.",right?6:5); - text(112,147,bones[current_bone].name,7); - text(112,162,mode==1?"Next follows automatically.":"SPACE: next question",2); - present();answer_sound(right);if(mode==1)delay(90);else choose(" "); + gfx_copy_front();gfx_fill_rect(216,166,424,48,0);phase=3; + text(224,170,right?"CORRECT!":"NOT THIS TIME.",right?2:3); + text(224,183,bones[current_bone].name,1); + text(224,201,mode==1?"Next follows automatically.":"SPACE: next question",1); + present();answer_sound(right);if(mode==1)pause_or_quit(90);else choose(" ",3); } static U8 results(void) { U8 c,i,page,start,missed=BONE_COUNT-score; for(;;){ - phase=4;frame("YOUR RESULTS");show_skeleton(255,1); - text(112,35,"SKELETON COMPLETE",6); - sprintf(line,"%u / %u correct %u%%",(unsigned)score,BONE_COUNT,(unsigned)score*100/BONE_COUNT);text(112,55,line,7); - sprintf(line,"%u spelling corrections",(unsigned)corrections);text(112,77,line,2); - sprintf(line,"%u topics to revisit",(unsigned)missed);text(112,93,line,7); - text(112,118,"R REVIEW MISSED BONES",6);text(112,138,"P PLAY AGAIN",7);text(112,158,"Q QUIT TO BASIC",7); - text(8,183,"Every topic once. Keep learning!",2);present();c=choose("RPQ");if(c!='R')return c; + phase=7;frame("YOUR RESULTS");show_skeleton(255,1); + text(224,35,"SKELETON COMPLETE",2); + sprintf(line,"%u / %u correct %u%%",(unsigned)score,BONE_COUNT,(unsigned)score*100/BONE_COUNT);text(224,55,line,1); + sprintf(line,"%u spelling corrections",(unsigned)corrections);text(224,77,line,1); + sprintf(line,"%u topics to revisit",(unsigned)missed);text(224,93,line,1); + text(224,118,"R REVIEW MISSED TOPICS",2);text(224,138,"P PLAY AGAIN",1);text(224,158,"Q QUIT TO BASIC",1); + text(16,216,"Every topic once. Q/Esc/Break: quit",1);present();c=choose("RPQ",4);if(c!='R')return c; page=0;start=0; for(;;){ - phase=6;frame("MISSED BONES");sprintf(line,"Review page %u",(unsigned)page+1);text(8,19,line,6);i=start;c=0; + phase=7;frame("MISSED TOPICS");sprintf(line,"Review page %u",(unsigned)page+1);text(16,19,line,2);i=start;c=0; while(i +#include +#include +#include "geometry.h" +#include "map_data.h" +static DECBDrive drive; +static byte cache[256]; +static unsigned cache_at=65535; +static byte ready; +byte geometry_failed; +byte geometry_open(void) +{ + DECBFile file;unsigned sectors,offset,sum=0,i;unsigned long length; + byte opened=0,ok=0; + geometry_failed=0; + if(ready || !bank_open())return 0; + if(decb_init(&drive,1)!=DECB_OK){bank_close();return 0;} + if(decb_registerDrive(0)!=DECB_OK)goto done; + if(decb_openSectorFile(&file,0,"BONES.DAT")!=DECB_OK)goto done; + opened=1; + /* This API returns a granule count, with 255 indicating failure. */ + if(decb_getOpenFileSize(&file,§ors,&length)==255 || length!=bone_asset_size || bone_asset_size> BANK_CAPACITY || bone_asset_size%256)goto done; + for(offset=0;offset=bone_asset_size){geometry_failed=1;return 0;} + if(aligned!=cache_at){ + if(!bank_read(aligned,cache,256)){geometry_failed=1;return 0;} + cache_at=aligned; + } + return cache[offset&255]; +} +void geometry_close(void) +{ + if(ready)bank_close();ready=0;cache_at=65535; +} diff --git a/src/graphics.c b/src/graphics.c new file mode 100644 index 0000000..a9980d0 --- /dev/null +++ b/src/graphics.c @@ -0,0 +1,330 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// Bone Quest adaptation, November 11, 2026, of VCC Plus sdk/cmoc/gime/gime.c. +// Upstream checkout revision: f1ab8538a5b6b88a82951e9305db349a470a4e86 +// Upstream file SHA-256: 3a4ec27d3bc19cf59b1bcf23ae9ccb89aa308731e97ec12ef9609516c323859d +// Changes: 640x225 four-color pixels, five banks per page, bounded front-to-back +// copies, and BASIC border restoration. This local driver does not change the VCC Plus SDK contract. +#include "graphics.h" + +typedef unsigned char byte; +#define REG(addr) (*(byte *)(addr)) + +#define FIRST_PAGE 0x1e +#define SECOND_PAGE 0x23 +#define WINDOW 0x8000 + +static byte back; // Zero when closed; otherwise an 8 KiB block number. +static byte palette[16]; +static byte copyBuffer[32]; +static const byte *textImage; + +// program_end is provided by CMOC's linker script. While bank 4 is mapped, +// neither an instruction fetch nor a stack access may land in the window. +static asm byte lowProgramAndStack(void) +{ + asm { +program_end import + ldx #program_end + cmpx #$8000 + bhi @reject + cmps #$8000 + bhi @reject + tfr cc,b + bitb #$10 + bne @reject + ldb #1 + rts +@reject clrb + } +} + +// A real 128 KiB GIME accepts the same MMU register writes as a 512 KiB +// machine, but blocks $20 and $30 alias. Change just one byte reversibly. +// An inactive window (for instance, wrong task) also fails this test. +static asm byte independentBanks(void) +{ + asm { + pshs cc + orcc #$50 + lda >$ffa4 + pshs a + lda #$30 + sta >$ffa4 + lda >$9555 + pshs a + lda #$20 + sta >$ffa4 + lda >$9555 + pshs a + coma + sta >$9555 + cmpa >$9555 + bne @alias + lda #$30 + sta >$ffa4 + ldb >$9555 + cmpb 1,s + bne @alias + ldb #1 + bra @restore +@alias clrb +@restore + lda #$20 + sta >$ffa4 + puls a + sta >$9555 + leas 1,s + puls a + sta >$ffa4 + puls cc + } +} + +// BASIC's 16-bit TIMER is incremented by its vertical interrupt handler. +// Poll the complete word, including through wraparound, with interrupts live. +// Pages start on 8 KiB boundaries, so their low video offset is zero. +// Flipping therefore needs one high-offset store. +// The countdown makes missing IRQs a recoverable error. +static byte field(byte offsetHigh, byte flip) +{ + asm { + ldd >$0112 + ldx #$2000 +@wait cmpd >$0112 + bne @blank + leax -1,x + bne @wait + clrb + bra @done +@blank tst :flip + beq @success + ldb :offsetHigh + stb >$ff9d +@success + ldb #1 +@done stb :flip + } + return flip; +} + +// Paint at most one scan-line fragment in one bank. Four 2-bit pixels fit +// in each byte; preserve neighboring pixels at partial byte edges. Interrupts +// stay masked only for the short mapping interval (at most 160 full bytes). +static void span(byte bank, unsigned address, byte firstMask, byte fullBytes, + byte lastMask, byte packed) +{ + asm { + pshs cc + orcc #$50 + lda >$ffa4 + nop + pshs a + lda :bank + sta >$ffa4 + ldx :address + tst :firstMask + beq @full + lda :firstMask + coma + anda ,x + pshs a + lda :packed + anda :firstMask + ora ,s+ + sta ,x+ +@full ldb :fullBytes + beq @last + lda :packed +@loop sta ,x+ + decb + bne @loop +@last tst :lastMask + beq @done + lda :lastMask + coma + anda ,x + pshs a + lda :packed + anda :lastMask + ora ,s+ + sta ,x +@done puls a + sta >$ffa4 + puls cc + } +} + +void gfx_fill_rect(unsigned x, unsigned y, unsigned w, unsigned h, byte color) +{ + unsigned rowByte; + byte packed; + if (!back || color > 3 || x >= GFX_WIDTH || y >= GFX_HEIGHT || !w || !h) + return; + if (w > GFX_WIDTH - x) w = GFX_WIDTH - x; + if (h > GFX_HEIGHT - y) h = GFX_HEIGHT - y; + packed = color | (color << 2); + packed |= packed << 4; + // A pixel index y*640 would overflow the CoCo's 16-bit unsigned int. + // Byte addresses stay below 36,000 even on the final scan line. + rowByte = y * 160u + (x >> 2); + while (h--) { + unsigned offset = rowByte; + unsigned remaining = w; + byte first = (byte)(x & 3); + while (remaining) { + unsigned inBank = offset & 0x1fff; + unsigned count = ((0x2000u - inBank) << 2) - first; + unsigned rest; + byte firstCount = 0, firstMask = 0, lastMask = 0, tail; + if (count > remaining) count = remaining; + if (first || count < 4) { + firstCount = 4 - first; + if (firstCount > count) firstCount = (byte)count; + firstMask = (byte)((0xffu >> (first << 1)) & + (0xffu << ((4 - first - firstCount) << 1))); + } + rest = count - firstCount; + tail = (byte)(rest & 3); + if (tail) lastMask = (byte)(0xffu << ((4 - tail) << 1)); + span((byte)(back + (offset >> 13)), WINDOW + inBank, + firstMask, (byte)(rest >> 2), lastMask, packed); + offset += (first + count) >> 2; + first = (byte)((first + count) & 3); + remaining -= count; + } + rowByte += 160; + } +} + +void gfx_plot(unsigned x, unsigned y, byte color) +{ + gfx_fill_rect(x, y, 1, 1, color); +} + +void gfx_clear(byte color) +{ + gfx_fill_rect(0, 0, GFX_WIDTH, GFX_HEIGHT, color); +} + +void gfx_set_palette(byte slot, byte rgb) +{ + if (back && slot < 4 && rgb < 64) + REG(0xffb0 + slot) = rgb; +} + +byte gfx_open(void) +{ + byte i, width; + // Super Extended BASIC defines HRMODE at $E6 and HRWIDTH at $E7. + if (back || !lowProgramAndStack() || *(unsigned *)0xfff8 != 0xfef7 || + REG(0xe6) != 0 || REG(0xe7) > 2) + return 0; + for (i = 0; i < 16; ++i) { + byte bank = REG(0xffa0 + i) & 0x3f; + if (bank >= FIRST_PAGE && bank < SECOND_PAGE + 5) + return 0; + } + if (!field(0, 0) || !independentBanks()) + return 0; + + width = REG(0xe7); + textImage = (const byte *)0xe032 + width * 9; + for (i = 0; i < 16; ++i) + palette[i] = REG(0xffb0 + i) & 0x3f; + + back = FIRST_PAGE; + gfx_clear(0); + back = SECOND_PAGE; + gfx_clear(0); + if (!field(0, 0)) { + back = 0; + return 0; + } + // Super Extended BASIC keeps editable images of the write-only registers + // at $E032 (text tables) and $E070 (graphics). Keep the ROM's color phase. + REG(0xff90) = REG(0xe070); + REG(0xff98) = REG(0xe071); + REG(0xff99) = 0x7d; // 225 lines, 160 bytes per row, four colors. + REG(0xff9a) = 0; // Black outer border; restore the BASIC image on close. + REG(0xff9c) = 0; + REG(0xff9d) = FIRST_PAGE << 2; + REG(0xff9e) = 0; + REG(0xff9f) = 0; + return 1; +} + +// Borrow the same short window twice per chunk. The staging buffer, program +// and stack stay below $8000. Restore BASIC's mapping and interrupt mask between +// chunks so a complete page copy cannot defer its vertical interrupt for long. +static void copyChunk(byte sourceBank,byte destinationBank,unsigned address, + byte *buffer) +{ + asm { + pshs cc,y + orcc #$50 + lda >$ffa4 + nop + pshs a + lda :sourceBank + sta >$ffa4 + ldx :address + ldy :buffer + ldb #32 +@read lda ,x+ + sta ,y+ + decb + bne @read + lda :destinationBank + sta >$ffa4 + ldx :buffer + ldy :address + ldb #32 +@write lda ,x+ + sta ,y+ + decb + bne @write + puls a + sta >$ffa4 + puls cc,y + } +} + +byte gfx_copy_front(void) +{ + unsigned offset; + byte front; + if(!back)return 0; + front=back==FIRST_PAGE?SECOND_PAGE:FIRST_PAGE; + // 36,000 visible bytes and each 8 KiB bank are multiples of 32. + // Consequently no chunk crosses a bank or the visible image's end. + for(offset=0;offset<36000u;offset+=32) + copyChunk((byte)(front+(offset>>13)),(byte)(back+(offset>>13)), + WINDOW+(offset&0x1fff),copyBuffer); + return 1; +} + +byte gfx_present(void) +{ + if (!back || !field(back << 2, 1)) + return 0; + back = (back == SECOND_PAGE ? FIRST_PAGE : SECOND_PAGE); + return 1; +} + +void gfx_close(void) +{ + byte i; + if (!back) return; + field(0, 0); // Even if the timer stops, always give the display back. + REG(0xff90) = textImage[0]; + REG(0xff98) = textImage[1]; + REG(0xff99) = textImage[2]; + REG(0xff9a) = textImage[3]; + REG(0xff9c) = textImage[5]; + REG(0xff9d) = textImage[6]; + REG(0xff9e) = textImage[7]; + REG(0xff9f) = textImage[8]; + for (i = 0; i < 16; ++i) + REG(0xffb0 + i) = palette[i]; + back = 0; +} diff --git a/src/map_data.c b/src/map_data.c index 324283c..325df52 100644 --- a/src/map_data.c +++ b/src/map_data.c @@ -1,298 +1,54 @@ -/* Generated by tools/prepare_assets.py from LadyofHats public-domain SVG. */ +/* Generated source-derived Bone Quest structure masks. */ #include "map_data.h" -const unsigned char bone_spans[] = { - 0,23,7,1,22,9,2,21,11,3,20,13,4,20,13,5,20,13,6,20,13,7,20,2, - 7,26,1,7,31,2,8,20,2,8,26,1,8,32,1,9,20,2,9,26,1,9,32,1, - 10,20,2,10,25,1,10,32,1,11,20,1,11,22,4,11,28,3,11,32,1,12,23,2, - 12,28,2,13,23,3,13,27,3,14,23,7,15,23,7,16,24,5,11,21,1,11,31,1, - 12,20,3,12,30,3,13,21,2,13,30,3,14,21,2,14,30,3,15,21,2,15,30,2, - 16,21,3,16,29,3,17,22,10,18,22,9,19,24,6,22,13,1,23,12,11,23,33,9, - 24,13,2,24,16,9,24,29,12,25,23,2,25,28,4,23,11,1,24,10,3,24,41,2, - 25,10,7,25,19,1,25,37,7,26,11,6,26,36,7,27,13,5,27,36,5,28,14,4, - 28,36,4,29,14,3,29,19,1,29,37,3,30,14,3,30,37,3,31,13,3,31,37,4, - 32,13,3,32,34,2,32,38,2,33,14,2,33,38,2,34,14,1,34,38,1,35,14,1, - 35,17,2,35,35,1,25,25,3,26,24,6,27,24,5,28,24,5,29,25,4,30,25,4, - 31,25,4,32,25,3,33,25,4,34,25,3,35,25,3,36,25,3,37,25,3,38,26,2, - 39,26,2,40,26,2,41,26,1,23,23,2,23,29,3,25,20,3,25,32,1,26,18,6, - 26,30,5,27,18,6,27,29,7,28,18,6,28,29,7,29,17,2,29,20,5,29,29,8, - 30,17,6,30,31,6,31,16,9,31,29,8,32,16,9,32,28,6,32,36,2,33,16,6, - 33,24,1,33,29,1,33,32,6,34,15,10,34,28,10,35,15,2,35,19,6,35,28,7, - 35,36,3,36,15,10,36,28,10,37,14,11,37,28,11,38,15,11,38,28,3,38,32,7, - 39,15,10,39,28,4,39,34,5,40,14,11,40,28,11,41,14,11,41,28,11,42,14,10, - 42,29,10,43,14,6,43,21,4,43,28,4,43,33,4,43,38,2,44,14,10,44,29,4, - 44,35,5,45,14,8,45,28,1,45,30,9,46,14,7,46,23,1,46,28,3,46,32,7, - 47,14,9,47,30,9,48,14,8,48,23,1,48,28,2,48,31,8,49,14,10,49,29,3, - 49,33,6,50,15,3,50,20,3,50,31,2,50,35,3,51,15,1,51,18,3,51,32,2, - 51,37,1,52,33,1,19,23,1,20,23,7,21,23,8,22,23,8,23,25,3,23,28,1, - 24,25,3,39,25,1,40,25,1,41,25,1,41,27,1,42,25,3,43,25,3,44,24,4, - 45,24,4,46,24,4,47,24,4,48,24,4,49,26,1,49,24,2,49,27,2,50,23,6, - 51,24,5,52,24,5,53,23,7,54,24,5,55,23,8,56,24,5,57,23,7,58,24,5, - 59,23,8,60,23,7,61,24,5,62,25,3,60,22,1,60,30,1,61,22,2,61,29,2, - 62,21,4,62,28,3,63,22,9,64,23,7,65,23,6,66,24,5,67,25,2,67,27,1, - 68,26,1,69,26,1,56,17,2,56,32,5,57,15,7,57,31,7,58,14,9,58,30,9, - 59,14,9,59,31,9,60,13,9,60,31,9,61,13,9,61,31,9,62,13,8,62,31,9, - 63,14,8,63,31,8,64,15,7,64,31,7,65,16,5,65,31,6,66,16,6,66,30,7, - 67,16,6,67,30,6,68,17,6,68,30,5,69,18,6,69,29,5,70,19,2,70,22,12, - 71,19,3,71,23,6,71,31,3,72,19,15,73,20,4,73,28,5,27,10,3,27,41,3, - 28,9,5,28,40,5,29,8,6,29,40,5,30,8,6,30,40,5,31,8,5,31,42,4, - 32,8,4,32,42,4,33,8,4,33,43,3,34,8,3,34,43,3,35,8,3,35,43,3, - 36,7,3,36,43,3,37,7,3,37,43,3,38,7,3,38,43,3,39,7,3,39,43,3, - 40,6,3,40,44,2,41,6,3,41,44,2,42,5,4,42,44,3,43,5,3,43,44,3, - 44,5,3,44,44,3,45,4,4,45,44,3,46,4,3,46,44,3,47,4,3,47,44,4, - 48,3,4,48,44,4,49,3,4,49,44,5,50,2,5,50,44,5,51,1,7,51,44,6, - 52,2,6,52,43,6,53,6,1,53,44,2,52,49,1,53,1,3,53,48,2,54,2,2, - 54,48,2,55,2,3,55,48,2,56,2,3,56,48,3,57,3,2,57,49,2,58,4,2, - 58,49,3,59,4,2,59,49,3,60,4,2,60,50,3,61,4,2,61,50,3,62,4,2, - 62,51,2,63,4,2,63,51,3,64,4,2,64,51,3,65,4,2,65,52,2,66,4,2, - 66,52,3,67,4,2,67,52,3,68,4,2,68,52,3,69,4,2,69,52,4,70,4,2, - 70,52,4,71,3,3,71,52,4,72,3,3,72,53,1,73,4,2,53,4,2,53,46,2, - 54,4,3,54,45,3,55,5,1,55,46,2,56,5,1,56,46,2,57,46,3,58,3,1, - 58,46,3,59,3,1,59,47,2,60,2,2,60,47,3,61,2,2,61,47,3,62,2,2, - 62,48,2,63,2,2,63,48,2,64,2,2,64,48,2,65,2,2,65,48,3,66,2,2, - 66,49,2,67,1,3,67,49,2,68,1,3,68,49,2,69,1,2,69,50,2,70,1,2, - 70,50,2,71,1,2,71,50,2,72,1,2,72,51,1,73,1,1,72,52,1,72,54,3, - 73,2,2,73,51,5,74,1,5,74,51,3,74,55,1,75,1,5,73,56,4,74,54,1, - 74,56,2,75,6,2,75,51,7,76,1,5,76,7,2,76,51,5,76,57,1,77,0,7, - 77,52,4,77,57,1,78,0,3,78,4,3,78,52,7,79,0,3,79,4,1,79,6,2, - 79,54,1,80,0,8,73,60,1,74,60,2,75,61,2,76,62,2,77,8,2,78,9,2, - 79,9,2,79,52,2,79,55,4,80,52,7,81,0,8,81,53,7,82,1,7,82,53,7, - 83,1,7,83,54,6,84,1,7,84,54,1,84,56,4,85,1,6,85,56,3,86,3,4, - 86,58,1,87,3,3,88,4,1,67,15,1,67,36,1,68,13,4,68,35,2,68,38,2, - 69,12,6,69,34,6,70,12,5,70,34,7,71,11,6,71,36,5,72,12,5,72,36,5, - 73,12,5,73,35,5,74,13,4,74,35,5,75,13,4,75,36,3,76,14,3,76,35,4, - 77,14,3,77,35,4,78,14,4,78,35,3,79,14,4,79,35,3,80,15,3,80,34,4, - 81,15,3,81,34,4,82,15,4,82,34,4,83,15,4,83,33,4,84,16,3,84,33,4, - 85,16,3,85,33,4,86,16,4,86,33,3,87,16,4,87,32,4,88,17,3,88,32,4, - 89,17,4,89,32,4,90,17,4,90,32,3,91,17,4,91,31,4,92,18,4,92,31,4, - 93,18,4,93,31,4,94,18,4,94,30,4,95,18,5,95,30,4,96,18,5,96,30,4, - 97,18,5,97,30,4,98,18,6,98,29,5,99,18,6,99,29,5,100,18,6,100,28,6, - 101,18,7,101,28,7,102,17,9,102,27,8,103,17,9,103,27,8,104,17,3,104,22,4, - 104,27,3,104,33,2,105,17,2,105,23,2,105,27,2,105,34,1,106,28,1,104,20,2, - 104,30,3,105,19,4,105,29,5,106,18,6,106,29,5,107,19,4,107,29,5,108,20,2, - 108,30,3,106,17,1,106,24,1,106,27,1,106,34,1,107,17,2,107,23,2,107,27,2, - 107,34,1,108,17,3,108,22,4,108,27,3,108,33,2,109,18,7,109,27,8,110,18,7, - 110,27,7,111,19,6,111,27,6,112,19,6,112,28,5,113,20,5,113,28,5,114,20,4, - 114,28,4,115,20,4,115,28,4,116,20,4,116,28,4,117,20,4,117,28,4,118,20,4, - 118,28,4,119,20,4,119,28,4,120,20,4,120,28,4,121,20,4,121,28,4,122,20,4, - 122,28,4,123,20,4,123,28,4,124,21,3,124,28,4,125,21,4,125,28,3,126,21,4, - 126,28,3,127,21,4,127,28,3,128,21,3,128,28,3,129,21,3,129,28,3,130,21,4, - 130,27,4,131,21,4,131,27,4,132,21,4,132,27,4,133,21,4,133,27,4,134,21,4, - 134,27,4,135,21,10,136,21,10,137,21,10,138,22,3,138,26,3,109,17,1,110,17,1, - 110,34,1,111,17,2,111,33,2,112,17,2,112,33,2,113,17,2,113,33,2,114,17,2, - 114,33,2,115,18,1,115,33,2,116,18,2,116,33,2,117,18,2,117,33,1,118,18,2, - 118,32,2,119,18,2,119,32,2,120,18,2,120,32,2,121,18,2,121,32,2,122,18,2, - 122,32,2,123,19,1,123,32,2,124,19,2,124,32,1,125,19,2,125,31,2,126,19,2, - 126,31,2,127,19,2,127,31,2,128,19,2,128,31,2,129,19,2,129,31,2,130,19,2, - 130,31,2,131,20,1,131,31,1,132,20,1,132,31,1,133,19,2,133,31,2,134,19,2, - 134,31,1,135,20,1,135,31,1,136,19,2,136,31,2,137,19,2,137,31,2,138,20,2, - 138,29,3,139,19,6,139,26,7,140,22,3,140,26,4,141,23,2,141,26,3,142,24,1, - 142,27,1,140,18,4,140,30,5,141,17,6,141,29,6,142,16,8,142,28,8,143,16,8, - 143,28,8,144,19,3,144,30,3,143,15,1,143,36,1,144,14,5,144,33,5,145,13,8, - 145,31,8,146,13,7,146,31,8,147,14,5,147,33,5,148,34,1,148,36,1, -}; - -const unsigned bone_offsets[] = { - 0,90,135,159,246,297,534,549,591,636,669,678,786,948,1074,1194,1218,1278,1353,1605,1635,1842,2013,2043, - 2073,2109, -}; - -static const unsigned char head_spans[] = { - 1,16,6,2,12,14,3,10,18,4,8,22,5,7,24,6,6,26,7,5,28,8,5,29, - 9,4,30,10,3,32,11,3,32,12,2,34,13,2,34,14,2,34,15,2,34,16,2,34, - 17,2,34,18,2,34,19,2,9,19,13,23,20,2,6,20,17,5,20,30,2,20,33,3, - 21,2,5,21,17,4,21,31,5,22,2,4,22,17,4,22,32,4,23,3,3,23,17,4, - 23,32,3,24,3,3,24,17,4,24,32,3,25,3,3,25,17,4,25,32,3,26,3,3, - 26,17,4,26,32,3,27,3,3,27,16,4,27,32,4,28,2,4,28,15,2,28,22,1, - 28,31,5,29,2,5,29,14,2,29,22,2,29,30,6,30,2,15,30,21,15,31,3,1, - 31,7,10,31,21,10,31,34,1,32,8,8,32,21,8,32,34,1,33,8,8,33,22,7, - 34,9,7,34,22,7,35,9,7,35,19,1,35,21,8,36,9,20,37,10,18,38,11,17, - 39,10,18,40,10,18,41,10,18,42,11,17,43,12,15,44,15,10,31,4,3,31,31,3, - 32,3,5,32,29,5,33,3,5,33,29,5,34,3,6,34,29,5,35,4,5,35,29,5, - 36,4,5,36,29,5,37,4,5,37,29,5,38,4,5,38,29,5,39,5,4,39,29,5, - 40,5,5,40,29,4,41,5,5,41,29,4,42,6,5,42,28,5,43,6,6,43,27,6, - 44,6,9,44,25,7,45,6,26,46,6,25,47,7,23,48,9,20,49,10,18,50,12,15, - 51,14,12,60,0,1,61,0,9,62,0,12,62,31,7,63,0,14,63,26,12,64,0,15, - 64,24,14,59,9,1,59,28,2,60,8,7,60,24,7,61,9,6,61,24,8,62,13,2, - 62,24,2,62,29,2,50,11,1,51,11,3,51,26,2,52,11,17,53,11,16,54,11,17, - 55,11,17,56,10,19,57,9,20,58,9,20,59,10,18,60,15,8,61,15,8,60,23,1, - 61,23,1,62,15,9,63,15,9,64,15,8, +static const unsigned bone_offsets[] = { + 0,120,150,162,186,196,264,314,346,356,412,646,684,724,764,824,846,858,882,974,1198,1358,1474,1584, + 1634,1742,1904,2050,2290,2444,3270, }; static const unsigned head_offsets[] = { - 0,234,339,363,363,363,390,429,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444, - 444,444, -}; - -static const unsigned char hand_spans[] = { - 0,18,12,1,18,12,2,18,13,3,18,13,4,18,13,5,18,12,6,18,11,7,19,6, - 0,11,6,1,11,6,2,11,6,3,12,6,4,12,6,5,12,6,6,13,5,7,13,3, - 8,13,2,7,17,2,7,25,6,8,17,14,9,16,18,10,16,18,11,15,19,12,15,17, - 13,15,15,14,15,15,15,16,8,16,19,2,9,35,2,10,34,11,11,34,12,12,32,14, - 13,30,8,13,42,3,14,30,5,14,43,1,15,24,4,15,31,4,16,16,3,16,21,2, - 16,24,5,16,31,4,17,16,7,17,24,5,17,32,3,18,16,13,18,33,2,19,16,8, - 19,25,4,19,33,3,20,16,3,20,20,5,20,26,3,20,33,3,21,16,3,21,21,3, - 21,26,4,21,33,3,22,16,4,22,21,3,22,27,3,22,33,4,23,16,4,23,22,3, - 23,27,3,23,34,3,24,16,4,24,22,3,24,27,4,24,34,4,25,17,3,25,22,3, - 25,28,3,25,34,4,26,17,3,26,23,3,26,28,4,26,34,5,27,17,3,27,23,3, - 27,28,4,27,34,5,28,17,4,28,23,4,28,28,5,28,34,5,29,17,5,29,23,11, - 29,35,4,30,17,5,30,23,11,30,35,1,31,18,1,31,23,5,31,29,5,32,24,2, - 32,30,2,12,46,2,13,45,4,14,44,6,15,45,6,16,47,6,17,49,5,18,50,5, - 19,50,5,20,51,6,21,53,4,22,54,4,23,55,2,30,36,4,31,19,3,31,35,5, - 32,18,4,32,26,3,32,32,8,33,18,4,33,24,5,33,30,5,33,36,4,34,19,3, - 34,24,5,34,30,5,34,37,3,35,20,3,35,25,4,35,31,4,35,37,4,36,20,3, - 36,26,4,36,31,4,36,37,4,37,20,3,37,26,4,37,32,3,37,38,3,38,21,3, - 38,26,4,38,32,4,38,38,4,39,21,3,39,27,3,39,32,4,39,38,4,40,21,4, - 40,27,3,40,33,3,40,38,4,41,21,4,41,27,4,41,33,4,41,38,4,42,22,3, - 42,27,4,42,33,4,42,39,3,43,22,4,43,27,5,43,33,5,43,39,3,44,23,3, - 44,28,4,44,34,4,44,40,2,45,23,3,45,28,4,45,34,4,45,40,3,46,24,3, - 46,29,4,46,35,3,46,40,3,47,25,2,47,30,3,47,35,3,47,40,3,48,25,3, - 48,30,4,48,36,3,48,40,3,49,26,1,49,31,3,49,36,3,49,41,2,50,31,4, - 50,36,4,50,41,3,51,32,3,51,36,4,51,41,2,52,32,3,52,37,3,53,33,2, - 53,38,3,54,33,2,54,38,3,55,38,3, + 0,654,808,808,808,808,808,808,808,808,808,808,808,808,808,808,874,904,944,944,978,978,978,978, + 978,978,978,978,978,1000,2084, }; static const unsigned hand_offsets[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,51,84,291,588,588,588,588,588,588, - 588,588, -}; - -static const unsigned char foot_spans[] = { - 0,3,19,1,3,19,2,3,19,3,2,20,4,2,20,5,2,20,6,2,20,7,2,20, - 8,1,21,9,1,20,10,1,20,11,1,18,12,1,17,13,2,15,14,2,14,15,2,7, - 16,2,5,17,3,3,0,22,6,1,22,6,2,22,6,3,22,6,4,22,7,5,22,7, - 6,22,7,7,22,7,8,22,7,9,22,8,10,23,6,11,24,5,12,26,3,9,21,1, - 10,21,2,11,19,5,12,18,8,13,17,9,14,16,10,15,9,17,16,7,18,17,6,21, - 18,3,25,19,3,27,20,3,30,21,3,31,22,3,22,22,26,4,22,31,4,23,4,20, - 23,27,1,23,32,3,24,3,15,24,21,2,24,33,1,25,3,14,26,3,13,27,3,12, - 28,3,12,29,3,12,30,3,10,31,3,9,32,5,6,33,6,4,34,7,3,35,7,3, - 36,8,2,22,25,1,22,30,1,23,24,3,23,28,4,23,35,2,24,18,3,24,23,10, - 24,34,4,25,17,21,26,16,23,27,15,25,28,15,26,29,15,26,30,13,29,31,12,31, - 32,11,33,33,10,9,33,21,24,34,10,10,34,22,24,35,10,10,35,23,23,36,10,11, - 36,24,23,37,10,12,37,25,23,38,11,12,38,26,20,39,13,11,39,27,19,40,15,11, - 40,29,10,40,42,1,41,17,11,41,29,7,42,18,16,43,19,14,44,20,9,45,21,7, - 46,22,5,47,22,4,48,23,2,49,24,1,38,46,4,39,46,5,40,39,3,40,43,9, - 41,36,17,42,34,20,43,33,23,44,29,2,44,32,24,45,28,3,45,32,25,46,27,20, - 46,48,9,47,26,6,47,33,15,47,49,9,48,25,8,48,34,14,48,50,5,48,56,3, - 49,25,8,49,36,19,49,56,3,50,25,9,50,37,13,50,51,4,50,57,1,51,25,10, - 51,38,12,51,53,3,52,29,7,52,39,11,52,54,3,53,30,6,53,39,7,53,47,4, - 53,54,3,54,30,8,54,40,6,54,48,4,54,55,1,55,30,8,55,41,6,55,49,4, - 56,31,7,56,43,5,56,49,4,57,32,7,57,44,4,57,50,3,58,33,7,58,45,4, - 59,36,4,59,45,4,60,36,4,60,47,1,61,37,2, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,60, + 208,524,912,912,912,912,2158, }; static const unsigned foot_offsets[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,93,195, - 324,495, -}; - -static const unsigned char spine_spans[] = { - 0,0,1,0,3,6,0,27,5,1,2,6,1,10,2,1,22,2,1,28,6,2,0,7, - 2,9,3,2,22,3,2,29,5,3,0,6,3,8,4,3,22,4,3,30,4,4,0,4, - 4,7,5,4,22,6,4,31,3,5,0,2,5,6,4,5,24,5,5,33,1,6,4,5, - 6,26,5,7,2,5,7,27,5,8,0,6,8,28,6,9,0,5,9,30,4,10,0,3, - 10,31,3,11,0,1,11,33,1,0,12,10,1,12,10,2,12,10,3,12,10,4,12,10, - 5,12,9,5,21,1,6,12,10,7,12,11,8,12,11,9,9,17,10,8,18,11,10,1, - 11,12,11,12,12,11,13,12,11,14,12,11,15,9,2,15,12,13,16,8,19,17,8,19, - 18,10,1,18,12,13,19,12,11,20,12,11,21,8,1,21,11,12,21,25,3,22,7,22, - 23,6,22,24,7,16,24,26,1,25,12,11,26,12,11,27,12,11,27,25,2,28,7,21, - 29,7,21,30,8,19,31,12,11,32,12,11,33,8,1,33,12,11,33,25,3,34,7,3, - 34,12,11,34,24,4,35,6,22,36,7,20,37,8,17,38,10,13,39,11,12,40,11,12, - 41,12,10,42,13,8,36,27,2,37,5,3,37,25,5,38,5,5,38,23,7,39,4,7, - 39,23,7,40,4,7,40,23,7,41,4,8,41,22,8,42,3,10,42,21,9,43,3,27, - 44,3,27,45,4,7,45,12,18,46,4,25,47,8,18,48,9,17,49,9,16,50,9,16, - 51,9,16,52,9,15,53,10,13,54,12,9,55,14,6,55,13,1,55,20,1,56,13,8, - 57,14,5,58,15,4,59,15,4,60,16,3,61,16,2,26,32,2,27,0,2,27,31,3, - 28,0,4,28,30,4,29,0,6,29,29,5,30,0,7,30,28,6,31,0,8,31,28,6, - 32,0,8,32,28,6,33,0,8,33,28,6,34,0,7,34,28,6,35,0,6,35,28,6, - 36,0,7,36,29,5,37,0,5,37,30,4,38,0,5,38,30,4,39,0,4,39,30,4, - 40,0,4,40,30,4,41,0,4,41,30,4,42,0,3,42,30,4,43,0,3,43,30,4, - 44,0,3,44,30,4,45,0,4,45,30,4,46,0,4,46,29,5,47,0,4,47,29,5, - 48,0,3,48,30,4,49,0,2,49,30,4,50,0,2,50,30,4,51,0,3,51,30,4, - 52,0,4,52,30,4,53,0,5,53,29,5,54,0,6,54,28,6,55,0,6,55,27,7, - 56,0,6,56,26,8,57,0,5,57,26,8,58,0,5,58,27,7,59,0,7,59,27,7, - 60,0,8,60,26,8,61,0,9,61,25,9,62,0,10,62,24,10,63,0,2,63,3,8, - 63,23,11,64,0,2,64,4,8,64,14,2,64,17,2,64,21,8,64,31,3, + 0,0,0,0,0,0,0,0,0,0,0,0,0,212,568,942,942,942,942,942,942,942,942,942, + 942,942,942,1000,1134,1134,2372, }; static const unsigned spine_offsets[] = { - 0,0,0,0,0,0,105,105,123,270,351,375,621,621,621,621,621,621,621,621,621,621,621,621, - 621,621, -}; - -static const unsigned char chest_spans[] = { - 3,7,2,4,6,17,4,51,11,5,6,22,5,45,17,6,7,23,6,40,22,7,24,7, - 7,37,17,8,27,5,8,37,8,9,28,3,9,37,4,5,4,2,5,62,2,6,3,4, - 6,62,3,7,2,6,7,60,6,8,2,13,8,59,8,9,2,14,9,20,1,9,54,13, - 10,3,13,10,53,13,11,9,8,11,52,9,12,8,9,12,21,2,12,46,1,12,51,9, - 13,9,8,13,51,9,14,9,8,14,51,9,15,10,6,15,52,7,16,10,5,16,19,3, - 16,53,6,17,9,6,17,19,1,17,48,2,17,53,6,18,9,6,18,53,7,19,8,7, - 19,53,9,20,7,7,20,54,7,21,8,5,21,19,1,21,55,5,22,9,4,22,18,2, - 22,48,4,22,55,5,23,9,5,23,50,1,23,55,4,24,10,5,24,54,4,25,10,3, - 25,55,3,26,10,2,26,18,1,26,56,1,27,16,4,27,48,4,28,16,1,28,51,1, - 29,11,1,30,11,1,32,15,2,32,50,2,8,32,1,8,35,2,9,31,6,10,29,10, - 11,29,10,12,29,10,13,29,10,14,29,9,15,30,8,16,31,6,17,30,8,18,30,8, - 19,31,6,20,31,6,21,31,6,22,31,6,23,31,6,24,31,6,25,31,6,26,31,6, - 27,31,6,28,31,6,29,31,6,30,32,4,31,32,4,32,32,4,33,33,2,34,32,3, - 35,32,4,36,33,2,37,33,2,38,33,2,3,41,1,4,25,5,4,38,5,5,28,2, - 5,37,7,6,30,1,6,37,1,7,22,2,8,22,5,8,45,1,9,21,7,9,41,7, - 10,18,11,10,39,10,11,17,12,11,39,12,12,17,4,12,23,6,12,39,7,12,47,4, - 13,17,12,13,39,12,14,17,12,14,42,9,15,16,14,15,38,14,16,15,4,16,22,9, - 16,37,16,17,15,4,17,20,10,17,38,10,17,50,3,18,15,11,18,43,10,19,15,11, - 19,28,3,19,37,3,19,45,8,20,14,17,20,37,17,21,13,6,21,20,11,21,37,18, - 22,13,5,22,20,11,22,37,11,22,52,3,23,14,12,23,30,1,23,37,13,23,51,4, - 24,15,9,24,27,4,24,37,3,24,45,9,25,13,18,25,37,18,26,12,6,26,19,12, - 26,37,19,27,11,5,27,20,11,27,37,11,27,52,5,28,11,5,28,17,8,28,27,4, - 28,37,2,28,43,8,28,52,4,29,12,10,29,25,6,29,37,5,29,45,11,30,12,20, - 30,36,20,31,11,21,31,37,19,32,11,4,32,17,14,32,36,1,32,38,12,32,53,4, - 33,11,22,33,35,7,33,44,8,33,53,4,34,12,9,34,25,7,34,35,8,34,46,10, - 35,11,20,35,36,8,35,49,8,36,10,20,36,37,20,37,10,4,37,16,9,37,26,4, - 37,37,15,37,54,4,38,10,13,38,25,5,38,37,14,38,54,4,39,11,8,39,22,8, - 39,37,20,40,10,19,40,38,19,41,10,3,41,14,15,41,39,19,42,10,3,42,14,16, - 42,37,6,42,45,9,42,55,4,43,10,9,43,23,7,43,37,7,43,47,7,43,55,4, - 44,10,6,44,21,9,44,37,9,44,50,9,45,10,17,45,39,19,46,9,17,46,41,17, - 47,9,4,47,14,11,47,28,2,47,37,3,47,42,16,48,9,15,48,26,4,48,37,5, - 48,44,9,48,54,4,49,10,13,49,25,4,49,39,4,49,44,14,50,11,11,50,24,4, - 50,40,4,50,45,12,51,10,11,51,22,5,51,28,2,51,37,2,51,41,16,52,10,4, - 52,16,10,52,27,3,52,37,3,52,42,15,53,10,14,53,26,3,53,38,3,53,43,8, - 53,54,3,54,10,12,54,24,4,54,39,4,54,47,10,55,11,7,55,22,5,55,41,3, - 55,49,8,56,13,3,56,20,5,56,42,4,56,51,5,57,12,3,57,19,4,57,44,4, - 57,52,3,58,12,1,58,18,4,58,45,3,58,53,3,59,18,2,59,46,3,59,55,1, - 0,28,13,1,27,14,2,27,14,3,27,14,4,31,6,5,31,6,4,30,1,4,37,1, - 5,30,1,6,31,6,7,31,6,8,33,2,35,31,1,36,30,3,36,35,1,37,30,3, - 37,35,2,38,30,3,38,35,2,39,30,7,40,30,7,41,30,7,42,30,7,43,30,7, - 44,30,7,45,30,7,46,30,7,47,30,7,48,30,7,49,30,7,50,30,7,51,30,7, - 52,30,7,53,30,7,54,30,7,55,30,7,56,28,11,57,28,11,58,30,7,59,30,7, - 60,28,1,60,30,9,61,27,13,12,4,3,12,62,4,13,2,7,13,60,8,14,0,9, - 14,60,8,15,0,10,15,59,9,16,0,10,16,59,9,17,0,9,17,59,9,18,0,9, - 18,60,8,19,0,8,19,62,6,20,0,7,20,63,5,21,0,6,21,63,5,22,0,5, - 22,64,4,23,0,5,23,64,4,24,0,5,24,64,4,25,0,4,25,65,3,26,0,4, - 26,65,3,27,0,3,27,65,3,28,0,3,28,65,3,29,0,3,29,65,3,30,0,3, - 30,65,3,31,0,2,31,65,3,32,0,2,32,66,2,33,0,2,33,66,2,34,0,2, - 34,66,2,35,0,1,35,66,2,36,0,1,36,66,2,37,0,1,37,66,2,38,66,2, - 39,66,2,40,67,1,41,67,1,42,67,1,43,67,1,44,67,1,45,67,1,46,67,1, - 47,67,1,48,67,1,49,67,1,50,67,1,51,67,1,52,67,1,53,67,1,54,67,1, - 55,67,1,56,67,1,57,67,1,58,66,2,59,66,2,60,66,2,61,67,1, + 0,0,0,0,0,0,300,476,618,644,918,1108,1108,1108,1108,1108,1108,1108,1108,1108,1346,1346,1346,1346, + 1346,1346,1346,1346,1346,1480,3108, }; static const unsigned chest_offsets[] = { - 0,0,0,39,228,324,888,906,990,1017,1017,1017,1017,1245,1245,1245,1245,1245,1245,1245,1245,1245,1245,1245, - 1245,1245, + 0,0,58,96,150,170,228,228,228,228,228,228,228,228,228,228,228,228,302,572,1310,1646,1646,1646, + 1646,1646,1646,1646,1646,2032,3592, }; -const unsigned char bone_boxes[25][4] = {{20,0,13,17},{20,11,13,9},{12,22,30,4},{10,23,34,13},{24,25,6,17},{14,23,26,30},{23,19,8,5},{24,23,5,27},{23,49,8,14},{21,60,10,8},{26,67,2,3},{13,56,27,18},{1,27,49,27},{1,52,55,22},{1,53,51,21},{1,72,56,4},{0,73,60,8},{0,73,64,16},{11,67,30,40},{18,104,16,5},{17,106,18,33},{17,109,18,29},{19,138,14,5},{16,140,20,5},{13,143,26,6}}; +const unsigned char bone_boxes[28][4] = {{50,0,33,24},{57,24,19,6},{60,31,13,5},{62,37,9,10},{64,47,4,4},{56,60,20,18},{33,69,66,12},{54,74,24,10},{62,83,7,3},{40,80,49,12},{29,82,72,49},{46,128,37,7},{46,170,37,7},{39,173,51,7},{33,177,64,7},{53,9,26,5},{63,12,6,5},{30,28,73,5},{25,29,84,18},{34,28,64,37},{4,33,119,34},{2,65,128,26},{4,65,135,26},{2,88,140,7},{1,90,148,10},{1,93,152,17},{42,135,46,36},{43,131,44,41}}; const unsigned char bone_detail_view[] = { - 1,1,5,5,5,5,1,5,4,4,4,4,0,0,0,2,2,2,0,0,0,0,3,3, - 3, + 1,1,5,5,5,4,4,4,4,4,0,0,3,3,3,1,1,5,5,5,0,0,0,2, + 2,2,0,0, }; const unsigned char bone_view_widths[] = { - 64,38,61,63,34,68, + 159,114,185,191,201,215, }; const unsigned char bone_view_heights[] = { - 149,65,65,65,65,62, + 184,98,98,98,98,98, +}; + +const unsigned bone_view_data_offsets[] = { + 0,3270,5354,7512,9884,12992, }; -const unsigned char * const bone_view_spans[BONE_VIEW_COUNT] = {bone_spans,head_spans,hand_spans,foot_spans,spine_spans,chest_spans}; const unsigned * const bone_view_offsets[BONE_VIEW_COUNT] = {bone_offsets,head_offsets,hand_offsets,foot_offsets,spine_offsets,chest_offsets}; +const unsigned bone_asset_size = 16640; +const unsigned bone_asset_checksum = 50756; diff --git a/src/ui.c b/src/ui.c index 80aa70c..03e9a0f 100644 --- a/src/ui.c +++ b/src/ui.c @@ -3,7 +3,8 @@ #include #include #include -#include +#include "graphics.h" +#include "geometry.h" #include "ui.h" #include "map_data.h" static Keyboard keyboard; @@ -11,46 +12,60 @@ static U8 initialized; unsigned entropy=0xB41D; void text(unsigned x,unsigned y,const char *s,U8 color) { - U8 c,row,col,bits;unsigned left=x; + U8 c,row,col,bits,start;unsigned left=x; while((c=(U8)*s++)!=0){ if(c=='\n'){y+=9;x=left;continue;}if(c<32||c>126)c='?'; - for(row=0;row<8;++row){bits=font5x8[(unsigned)(c-32)*8+row];for(col=0;col<5;++col)if(!(bits&(128>>col)))gime_plot(x+col,y+row,color);} - x+=6; + for(row=0;row<8;++row){ + bits=font5x8[(unsigned)(c-32)*8+row];col=0; + while(col<5){ + if(bits&(128>>col)){++col;continue;} + start=col;do{++col;}while(col<5 && !(bits&(128>>col))); + gfx_fill_rect(x+start*2,y+row,(col-start)*2,1,color); + } + } + x+=12; } } void frame(const char *label) { - gime_clear(0);gime_fill_rect(0,0,320,13,1);text(8,3,"BONE QUEST",7);text(176,3,label,7);gime_fill_rect(8,29,304,1,2); + gfx_clear(0);text(16,3,"BONE QUEST",1);text(352,3,label,1);gfx_fill_rect(16,29,608,1,1); } static void draw_view(U8 view,U8 current,U8 progress,unsigned ox,unsigned oy,U8 scale,U8 cx,U8 cy,U8 cw,U8 ch) { - const U8 *data=bone_view_spans[view];const unsigned *off=bone_view_offsets[view]; - U8 b,y,x,n,col;unsigned i,end,left,right; - for(b=0;b=cy+ch)continue; - left=x>cx?x:cx;right=x+n;if(right>cx+cw)right=cx+cw;if(left>=right)continue; - gime_fill_rect(ox+(left-cx)*scale,oy+(unsigned)(y-cy)*scale,(right-left)*scale,scale,col); + const unsigned *off=bone_view_offsets[view];unsigned base=bone_view_data_offsets[view]; + U8 b,y,n,col,skip;unsigned i,end,left,right,x; + for(b=0;b=bone_view_widths[view]){x-=bone_view_widths[view];++y;} + n=geometry_byte(base+i++); + if(y>=cy && ycx?x:(unsigned)cx;right=x+n;if(right>cx+cw)right=cx+cw; + if(left=BONE_COUNT)return; - gime_fill_rect(108,30,212,73,1);view=bone_detail_view[current]; + gfx_fill_rect(216,30,424,106,0);view=bone_detail_view[current]; if(view){ w=bone_view_widths[view];h=bone_view_heights[view]; - draw_view(view,current,progress,112+(200-w)/2,34+(65-h)/2,1,0,0,w,h); + draw_view(view,current,progress,224+(400-w)/2,34+(98-h)/2,1,0,0,w,h); }else{ x=bone_boxes[current][0];y=bone_boxes[current][1];w=bone_boxes[current][2];h=bone_boxes[current][3]; if(x>2){x-=2;w+=2;}else{x=0;} if(y>2){y-=2;h+=2;}else{y=0;} w+=2;h+=2;if(x+w>bone_view_widths[0])w=bone_view_widths[0]-x;if(y+h>bone_view_heights[0])h=bone_view_heights[0]-y; - scale=65/h;if(!scale)scale=1;if(scale>4)scale=4;if(w*scale>200)scale=200/w; - draw_view(0,current,progress,112+(200-w*scale)/2,34+(65-h*scale)/2,scale,x,y,w,h); + scale=98/h;if(!scale)scale=1;if(scale>4)scale=4;if((unsigned)w*scale>400)scale=(U8)(400/w); + draw_view(0,current,progress,224+(400-(unsigned)w*scale)/2,34+(98-(unsigned)h*scale)/2,scale,x,y,w,h); } } static U8 any_key(void) @@ -66,9 +81,21 @@ U8 next_key(void) { U8 c;if(!initialized){Keyboard_init(&keyboard);initialized=1;} do{entropy=(entropy<<1)^(entropy>>15)^getTimer()^0x1021;c=Keyboard_poll(&keyboard);}while(!c); + if(c==3 || c==27 || c=='q' || c=='Q')quit_game(); entropy^=(unsigned)c<<8;return c; } void close_input(void) { if(initialized){Keyboard_shutdown(&keyboard);initialized=0;} } + +/* Keep the reading pause responsive to the same global quit keys as menus. */ +void pause_or_quit(unsigned ticks) +{ + unsigned since=getTimer();U8 c; + if(!initialized){Keyboard_init(&keyboard);initialized=1;} + do{ + c=Keyboard_poll(&keyboard); + if(c==3 || c==27 || c=='q' || c=='Q')quit_game(); + }while((unsigned)(getTimer()-since)