Introduces watch/, a real Pebble watchapp (built via pebble build) that
build / build (push) Successful in 30s

shows the daily tarot/astrology reading on-device: persistence, reading
computation, and UI screens, driven by the existing engine/interpreter
code linked in unchanged where possible.

Required engine-side changes to make that linking work:
- A compact low-precision ephemeris (lowprec_ephemeris.c) replacing the
  vendored ~127KB Astronomy Engine, which doesn't fit the watch's ~64KB
  app budget.
- Hand-rolled sqrt/atan2/sin/cos replacements for that ephemeris and
  astro.c's Ascendant calculation - Pebble's statically-linked libm
  hard-faults on real hardware under this app's -fPIE link for all four.
- narrative.c/guidance.c refactored from FILE*/fprintf onto snprintf-
  based buffers, since Pebble's SDK blocks fprintf at compile time.
This commit is contained in:
ml
2026-07-14 17:10:22 +02:00
parent d9b6e2889b
commit 1a654da3e9
44 changed files with 1920 additions and 182 deletions
+10
View File
@@ -1,7 +1,17 @@
#ifndef DECK_ASTRO_H
#define DECK_ASTRO_H
/* Pebble's SDK pre-defines <time.h>'s own include guard (so a real
* #include <time.h> is a silent no-op) and instead declares struct
* tm/time_t/gmtime()/etc. itself, inside pebble.h - see PBL_SDK_3,
* predefined by the Pebble build for every target platform. Desktop
* builds (deck-engine, the interpreter, and this file's own tests) use
* plain <time.h> as normal. */
#ifdef PBL_SDK_3
#include <pebble.h>
#else
#include <time.h>
#endif
#define NUM_BODIES 10
#define MAX_ASPECTS 100