Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Thumbs.db
# Claude Code - local settings excluded, hooks tracked
.claude/settings.local.json

# NAAP reference sources (vendored Flash originals + decompiled output) — kept local, not committed
# Local decompile output (and any accidental NAAP re-clones). Upstream sources: ../Baseline/Astronomy/
NAAP/
# Flash decompilation tooling (npm run decompile) — downloaded FFDec
tools/ffdec/
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@ npm run lint && npm run check && npm run build && npm test
## Development notes

- `ConfigurationsZodiacStrip` and `PtolemaicZodiacStrip` are separate view nodes; `MotionsOfTheSun/` cherry-picks constellation data and strip mapping from here.
- **`npm run decompile`** extracts NAAP Flash ActionScript via JPEXS FFDec into gitignored `NAAP/decompiled/` — read-only reference.
- **`npm run decompile`** extracts NAAP Flash ActionScript via JPEXS FFDec from `../Baseline/Astronomy/flash-animations` into gitignored `NAAP/decompiled/`.
- After `npm run build`, the sim is installable offline via Workbox (`dist/manifest.webmanifest`).
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@ A two-screen [SceneryStack](https://scenerystack.org/) port of the NAAP **Solar
- Git hooks for Biome pre-commit checks
- Shared GitHub Actions CI via `OpenPhysics/Baton`

### NAAP reference sources

Upstream Flash / AIR / React NAAP sources live in the sibling
[`Baseline`](https://github.com/OpenPhysics/Baseline) repo under `Astronomy/`
(see `baselines.json`). Clone Baseline with the fleet bootstrap, then:

```bash
(cd ../Baseline && ./scripts/fetch-baselines.sh)
```

`npm run decompile` reads `.swf` files from
`../Baseline/Astronomy/flash-animations` and writes ActionScript into the
sim-local gitignored `NAAP/decompiled/` (requires Java; one-time
`npm run decompile -- --setup`).

## Quick Start

```bash
Expand Down
17 changes: 15 additions & 2 deletions scripts/decompile-flash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* decompile-flash.ts
*
* Extract readable ActionScript (and optionally assets) from the original NAAP
* Flash sources under `NAAP/`, so the ported Solar System Models sim can be
* Flash sources under `../Baseline/Astronomy/flash-animations/` (sibling Baseline repo), so the ported Solar System Models sim can be
* checked against the real implementation.
*
* The `.fla` files are old binary (OLE compound) projects that no current tool
Expand Down Expand Up @@ -35,7 +35,18 @@ import { inflateRawSync } from "node:zlib";

const here = dirname(fileURLToPath(import.meta.url));
const repoRoot = resolve(here, "..");
const flashRoot = join(repoRoot, "NAAP", "flash-animations", "flashdev2");
const flashRoot = resolve(repoRoot, "..", "Baseline", "Astronomy", "flash-animations", "flashdev2");

/** Fail fast when the Baseline sibling checkout (or fetch) is missing. */
function ensureFlashRoot(): void {
if (!existsSync(flashRoot)) {
fail(
`NAAP Flash sources not found at:\n ${flashRoot}\n` +
`Clone OpenPhysics/Baseline as a sibling of this sim, then:\n` +
` (cd ../Baseline && ./scripts/fetch-baselines.sh --only Astronomy/flash-animations)`,
);
}
}

/**
* Latest canonical SWFs whose ActionScript informs the port (used by --all).
Expand Down Expand Up @@ -430,6 +441,8 @@ async function main(): Promise<void> {
return;
}

ensureFlashRoot();

const movies = resolveTargets(opts);
if (movies.length === 0) {
fail("No .swf targets resolved. Check the paths, or run with --help.");
Expand Down