# Harvest Moon 64: clean room Play: **https://andrewnakas.github.io/hm64-cleanroom/** (Chrome, Edge or Firefox; keyboard or gamepad). Harvest Moon 64 (US) built from the [hm64-decomp](https://github.com/harvestwhisperer/hm64-decomp) decompilation, with **every asset the ROM carries regenerated** from coarse facts and our own code, running in [N64Wasm](https://github.com/nbarkhina/N64Wasm) (MIT) in the browser. ## What is kept, what is regenerated | Kept (facts) | Regenerated | |---|---| | game code and data (the decomp's matching build), dialogue/cutscene bytecode and text, note sequences (melodies), map geometry, sprite headers and animation metadata, IPL3 and RSP microcode | all 9,016 sprite and map texture frames and their 3,516 palettes, the dialogue font and its palettes, all 147 instrument/sound samples, their VADPCM codebooks and loop states | Per texture frame the spec keeps only its format, size, a colour grid (4x4, 16x16 from 128 px) and the 2-bit alpha outline; per sample its length, rate, loop, a coarse spectral outline and the median pitch (`games/hm64/spec/`). Everything else is drawn or synthesised: - sprites: cel-style cutouts in the kept silhouette (`paint.py`), palettes by k-means over our own images; - text inside sprites: our own transcriptions re-typeset with an original stroke font (`labels.json`, `labels_auto.json`); - dialogue portraits: 139 frames painted from our own briefs (`portrait_briefs.json`, `portraits.py`); - the dialogue font: stroke font fitted to each cell's kept ink box (`font.py`); - samples: resynthesised from the outline, tonal ones held at the kept pitch, own 4-predictor books (`audio_gen.py`). A taint scan (`taint_report.py`) compares every regenerated byte range (raw, decoded RGBA, PCM) with the retail ROM; publishing is refused unless it reports 0 failing. No ROM, retail pixels or retail samples are in this repo or on the site. ## Build (you need your own ROM) ``` python -m games.hm64.extract_spec games/hm64/spec # dirty room: facts only python -m games.hm64.pack base games/hm64/spec base.z64 # dirty room: kept-facts image python -m games.hm64.generate games/hm64/spec clean.patch # clean room python -m games.hm64.pack rom base.z64 clean.patch clean.z64 python -m games.hm64.taint_report clean.z64 games/hm64/spec python ports/emu/make_site.py site clean.z64 ``` Status and decisions: [STATUS.md](STATUS.md).