Mode d’emploi
- Copiez la commande et examinez le paquet avant de l’installer dans votre environnement agent.
- Consultez le document original pour les outils, identifiants et environnements requis.
- Décrivez les entrées et le livrable souhaité ; comparez la sortie aux sources.
npx skills add https://github.com/ewrogers/megadev-skills --skill megadev-mathAvant de commencer
- L’installation n’inclut ni abonnement au modèle, ni quota API, ni accès aux fichiers.
- Étoiles et installations reflètent l’activité, pas un test indépendant de qualité ou de sécurité.
Rendu depuis le dépôt source en conservant titres, exemples, code, tableaux, liens et images.
Megadev Math
Start with the game's units and maximum values. Choose the format from those requirements, then prove every intermediate fits. The Lab's orbit display, colors, controls and motion are illustrations, not design defaults.
Workflow
- Inspect the project's Megadev revision, compiler flags and existing numeric helpers. Read actual
lib/math.handlib/fixed.h; names alone are not an API contract. See the SDK audit and arithmetic contracts. - Write down position/velocity units, fractional bits, maximum delta, product width and rounding rule. Signed Q8.8 is useful for local offsets but cannot hold an absolute 320-pixel screen coordinate. Use a wider position or an integer origin plus a bounded offset.
- Use checked operations at trust boundaries. Reject overflow or zero division before executing a trapping instruction, and preserve the old result on failure. Do not turn a numerical failure into an accidental wraparound teleport.
- Select the cheapest sufficient geometric operation. Compare squared distances for radius tests; normalize only when a unit direction is required. See vectors and trig.
- Separate time from interpolation progress. Keep authoritative state in the fixed game tick, advance render clocks through the existing timing owner, and specify endpoint/interrupt behavior. See interpolation and integration.
- Run independent host oracles and compiled original-M68000 execution checks. Then inspect PAL/NTSC motion in ares. Emulator success does not qualify real-hardware timing.
Standalone example
Run scripts/create_project.py with a new destination. It copies Math Lab, including application helpers, generated quarter-wave table, procedural art, host checks and a Megadev boot/module shell. It refuses an existing destination.
Use ewrogers/megadev:latest with explicit linux/arm64 or linux/amd64, --cpus=2, a bind mount and at most two make jobs. Follow the Lab README for complete commands. No SGDK library, fix16, sinFix16 or floating-point runtime is assumed.
Ownership and scope
math_core.cowns numeric contracts only. It has no VDP, CD, mailbox, allocation or timing side effects.motion.cdemonstrates consuming those helpers; its speed and ranges are sample choices.- Reuse the project's renderer, input snapshot and time accumulator. Do not install another VBlank callback just to use math.
- Both CPUs are original 68000s; the Sub CPU is not a floating-point or vector coprocessor. Moving arithmetic there introduces coordination and Word RAM ownership costs. Use
megadev-systemandmegadev-memoryfor those contracts. - Leave collision policy to
megadev-collision, gameplay timing tomegadev-gameplay, ASIC image transforms tomegadev-scalingand measurements tomegadev-performance. Trig-rotating a coordinate is not rendering a rotated sprite.
Acceptance
Require boundary and negative inputs, failure preservation, tiny/zero vector handling, all trig quadrants, interpolation endpoints, and PAL/NTSC equal logical time. Use the selected target flags, including debug, because host arithmetic cannot validate inline assembly. Record the SDK revision and known API limitations with the results.




