diff --git a/public/octatrack-modules/grain/0.1.3-experimental.mwrm b/public/octatrack-modules/grain/0.1.3-experimental.mwrm
deleted file mode 100644
index d88256bd1f..0000000000
Binary files a/public/octatrack-modules/grain/0.1.3-experimental.mwrm and /dev/null differ
diff --git a/public/octatrack-modules/grain/0.2.0-experimental.mwrm b/public/octatrack-modules/grain/0.2.0-experimental.mwrm
new file mode 100644
index 0000000000..5898bab07e
Binary files /dev/null and b/public/octatrack-modules/grain/0.2.0-experimental.mwrm differ
diff --git a/sdk/approvals/grain-build-approval.json b/sdk/approvals/grain-build-approval.json
index ed903abf6a..632039be9f 100644
--- a/sdk/approvals/grain-build-approval.json
+++ b/sdk/approvals/grain-build-approval.json
@@ -1,17 +1,16 @@
{
"kind": "owner-approved-update",
"id": "grain",
- "version": "0.1.3-experimental",
+ "version": "0.2.0-experimental",
"approvedBy": "repeat98",
- "approvedOn": "2026-11-23",
- "ownerStatement": "On 23 November 2026, repeat98 approved Grain 0.1.3-experimental (“I approve 0.1.3”), chose Flex's PTCH units, and after the unit runs on package 07b6e497 said “ok let's bring this update live”, with the waivers listed here.",
- "reason": "Package 07b6e497b3513a7d9b1d32c278e26c0385d068e5d4a5dc2e1d96be04d916d865. 0.1.3 makes trig keys, CHROMATIC keys and MIDI notes play Grain's engine instead of plain Flex (the START flag 0x20 counts as the pool's audition only while the pool window is open on the selected track) and reads PTCH in Flex's units (60 an octave), in which stock locks CHROMATIC and MIDI notes. On the owner's MKII (OS 1.40C, development twin 95adb64b of base 0.8) five rolled-back trials showed no crash, stall, freeze or skipped track; the trig cases, the audition and the PTCH knob behaved as TESTING.md records. Nothing was heard: tuning by ear, a recorded CHROMATIC take, SCALE, a 0.1.2 project reloaded and the MKI are untested. The controls and screens are 0.1.2's, so 0.1.2's captures and tutorial stay. Worst-case chip timing and complete memory bounds remain unmeasured, as for 0.1.2.",
- "retainedUiVersion": "0.1.2-experimental",
- "sourceSha256": "24fad490769a6e8aaaabe34104956da5e1cb64a690367136a59db9682e874ccc",
+ "approvedOn": "2026-12-02",
+ "ownerStatement": "On 2 December 2026, repeat98 approved Grain 0.2.0-experimental (#2426) for release (“no let's bring it live”), after being told that it needs his approval record and his exception for the medium pattern (105.3 % of a frame), with the waivers listed here. On 30 November he had accepted CLMP as EDGE's default, as an exception, with release notes saying how WRAP restores projects saved with 0.1.2 or 0.1.3.",
+ "reason": "Package db1cb96a163450ce79cc9e361e4c41e94c431735d2df5d1139797cb4686cfe12. 0.2.0 adds EDGE (CLMP default, WRAP, STOP, BNCE), skips the stock FLEX reader's PCM copy while Grain renders its own voice (the site POLY8 also detours, so the two are listed as conflicts), fixes POS p-locks and halves the frame cost of a first instance (16.1 % from 33.3 %). On the author's MKI (OS 1.40C, development base 4c7eb79b) package 520215cb was measured with device:price --curve: admitted on the empty pattern, refused on the medium pattern at 105.3 %, which this approval waives as release-cost. The POS lock byte was checked by hand on 520215cb. db1cb96a differs from 520215cb only in the waveform view's display code; the frame cost and the lock test were not repeated on it. Not run: npm run test:procedure, an MKII, worst-case chip cycles and complete memory bounds.",
+ "sourceSha256": "1345af6db7462f990a5e930baabf8e77bd84914987a4334ed30ca1beadcf2b5a",
"waived": [
"current-build-hardware",
"chip-worst-case-cycles",
"complete-memory-bounds",
- "release-documentation"
+ "release-cost"
]
}
diff --git a/sdk/catalog.json b/sdk/catalog.json
index 8e74364d0a..ed32963373 100644
--- a/sdk/catalog.json
+++ b/sdk/catalog.json
@@ -259,7 +259,7 @@
},
{
"id": "grain",
- "version": "0.1.3-experimental",
+ "version": "0.2.0-experimental",
"addedAt": "2026-11-20T12:00:00Z"
},
{
diff --git a/sdk/machines/octatrack/frame-costs.json b/sdk/machines/octatrack/frame-costs.json
index 7ec823f3b5..a413ff6c15 100644
--- a/sdk/machines/octatrack/frame-costs.json
+++ b/sdk/machines/octatrack/frame-costs.json
@@ -8,7 +8,7 @@
"bbd": {"first":0.7,"each":0.4,"rest":0,"points":[0.7,-0.1,0.4,0.7],"measured":"bbd 0.1.2-experimental on T1 T3 T6 T7: Dev17 C04 at 126 BPM, trigs on steps 1/5/9/13 of T1-T4, T6, T7 (T2 and T4 play samples), picks on empty C02; owner's MKII; base 0.8 twin 27 479ad391; 8 s a reading; 2026-11-22"},
"euclid": {"first":3.7,"each":2.5,"rest":2.5,"points":[3.7,3.9,6.4,6.7],"measured":"euclid 0.1.5-experimental on T1 T3 T6 T7: Dev17 C04 at 126 BPM, trigs on steps 1/5/9/13 of T1-T4, T6, T7 (T2 and T4 play samples; stock alone 79.4 %), picks on empty C02; base dce1d30e (0.8 twin); 8 s a reading; 2026-11-22 (npm run device:price -- --curve)"},
"everb": {"first":0.7,"each":0.2,"rest":0,"points":[0.7,0.8,1,-0.6],"measured":"everb 0.1.2-experimental on T1 T3 T6 T7: Dev17 C04 at 126 BPM, trigs on steps 1/5/9/13 of T1-T4, T6, T7 (T2 and T4 play samples; stock alone 79.4 %), picks on empty C02; base dce1d30e (0.8 twin); 8 s a reading; 2026-11-22 (npm run device:price -- --curve)"},
- "grain": {"first":33.3,"each":33.3,"rest":0,"points":[33.3],"measured":"grain 0.1.3-experimental on T1: C04 at 126 BPM, trigs on steps 1/5/9/13 of T1-T4, T6, T7 (the scene FM Synth 0.1.5's curve used); picks on empty C02; Grain on T1, whose Flex slot holds a loaded 16-bit stereo sample. One instance: a second (T3, the other track with a loaded sample) was refused on 23 November and on T6/T7 Grain would render silence; owner's MKII; base 95adb64b (0.8 development twin, built from main 4035fdfa8); 8 s a reading; 2026-11-23 (evidence/frame-cost.json)","paused":4.7},
+ "grain": {"first":16.1,"each":8.6,"rest":0.4,"points":[16.1,24.7],"measured":"grain 0.2.0-experimental on T1 T3: A01 at 120 BPM, 16 steps, trigs on steps 1/5/9/13 of T1-T4, T6, T7: T1 and T3 Flex with a loaded 16-bit stereo sample (0.91 MB), T2 and T4 stock samples with time stretch off, T6 and T7 no sample, T5 and T8 empty; picks on empty A02; the author's MKI; package 520215cb; base 4c7eb79b (development base booted in RAM); 8 s a reading; 2026-11-30 (evidence/frame-cost.json)","paused":4.7},
"lofi2": {"first":1,"each":0,"rest":0,"points":[1,-1.5,-0.3,-1.3],"measured":"lofi2 0.1.1-experimental on T1 T3 T6 T7: Dev17 C04 at 126 BPM, trigs on steps 1/5/9/13 of T1-T4, T6, T7 (T2 and T4 play samples), picks on empty C02; owner's MKII; base 0.8 twin 28 053fd054; 8 s a reading; 2026-11-22"},
"mackity": {"first":0.9,"each":0.9,"rest":0,"points":[-1.8,-2.2,0.9,-2.9],"measured":"mackity 0.1.0-experimental on T1 T3 T6 T7: Project on the owner's development unit, bank C, Part 1 reloaded in RAM to its saved copy; picks on the empty C02, readings on C04 (trigs on steps 1/5/9/13 of T1-T4, T6, T7) at the project tempo; transport played by the tool; base development twin 8fd6d456 of base 0.8.1 (eb6679620d0c9ed7), the owner's MKII, OS 1.40C; 8 s a reading; 2026-11-25 (evidence/frame-cost.json)"},
"midiverb": {"first":2,"each":2,"rest":0,"points":[0.9,0.2,2.2,1],"measured":"midiverb 0.2.0-experimental on T1 T3 T6 T7: Dev17 bank C: C04 Part 2 (working = saved), picks on the empty C02, the curve on C04 (trigs on steps 1/5/9/13 of T1-T4, T6, T7), transport stopped; twin ed5474c6 of base 0.8.3 (main 80ea1e584); base development twin ed5474c6 of base 0.8.3 (main 80ea1e584), the owner's MKII, OS 1.40C; 8 s a reading; 2026-11-27 (evidence/frame-cost.json)"},
diff --git a/sdk/octatrack/modules/grain/README.md b/sdk/octatrack/modules/grain/README.md
index 4baaac96af..493f0d2787 100755
--- a/sdk/octatrack/modules/grain/README.md
+++ b/sdk/octatrack/modules/grain/README.md
@@ -1,6 +1,6 @@
# Grain
-Version 0.1.3-experimental · by A Force Truly Evil (@AForceTrulyEvil). The author played an earlier build on an MKI. The [test record](TESTING.md) identifies the build for each result.
+Version 0.2.0-experimental · by A Force Truly Evil (@AForceTrulyEvil). The author played an earlier build on an MKI. The [test record](TESTING.md) identifies the build for each result.
## Overview
@@ -20,10 +20,10 @@ SRC (knobs A to F):
| POS | 0 to 127.8 | Where the grains are read: 0 is the start of the sample, 127.8 the end. Turned slowly it moves in eighths (41.0, 41.1, 41.2, 41.3, 41.5, 41.6, 41.7, 41.8, 42.0) and speeds up as you turn faster; a pressed knob jumps by seven. |
| SIZE | 0 to 127 | The length of each grain, on an exponential scale: 0 is 10 ms, 64 about 100 ms, 127 one second. |
| DENS | 0 to 127 | How often a grain is born. Low values leave gaps; 64 puts the grains one after another; 127 overlaps four of them (up to six sound at once). With MODE SYNC it picks the division of the bar: 1, 2, 4, 6, 8, 12, 16, 24, 32, 48 or 64 grains. |
-| SPRY | 0 to 127 | How far each grain strays from POS at random: 0 keeps them all on POS, 127 spreads them up to half the sample either way. The sample is a ring: a grain born or reading past the end carries on from the beginning, and one going back past the beginning carries on from the end. |
+| SPRY | 0 to 127 | How far each grain strays from POS at random: 0 keeps them all on POS, 127 spreads them up to half the sample either way. What happens when a grain reaches an edge of the sample is set by EDGE. |
| SCAN | -2.00 to +2.00 | A read head that runs through the sample from POS: 1.00 is the sample's own speed, negative runs backwards, 0.00 holds. It wraps round the sample and starts again from POS at every trig. |
-SRC SETUP (knobs A to D):
+SRC SETUP (knobs A to E):
| Knob | Values | What it does |
| --- | --- | --- |
@@ -31,6 +31,7 @@ SRC SETUP (knobs A to D):
| DIR | 0 to 127 | The share of grains that play backwards: 0 none, 64 half, chosen at random, 127 all. |
| PAN | OFF, 1 to 127 | A random pan for each grain, independent of where it was born. OFF at 0, the widest spread at 127. |
| MODE | RAND, SYNC | RAND: the grains are born freely, as DENS says. SYNC: they follow the project's tempo, and DENS picks how many fall in a bar. |
+| EDGE | CLMP, WRAP, STOP, BNCE | What happens at the start and end of the sample. Turn several detents to change a value. **CLMP:** SPRY can't push a grain past an end. A grain that runs off one end carries on from the other. **WRAP:** the sample is a loop. A grain pushed or running off one end comes out of the other (as in 0.1.2). **STOP:** grains stay inside. SPRY can't push one past an end, and a grain that reaches an end stops there. **BNCE:** SPRY can't push a grain past an end. A grain that reaches an end plays back the other way. |
## Usage
@@ -43,7 +44,7 @@ SRC SETUP (knobs A to D):
1. Double-tap a track key, choose GRAIN in the machine list and press YES, then double-tap again and pick a Flex sample.
2. Put a trig on the track and play. Press SRC and turn POS: the grains move through the sample, and the waveform shows where. Turn SIZE down for a fine mist and up for long overlapping grains.
3. Turn SPRY up to scatter the grains around POS, and DENS up to thicken the cloud. Turn SCAN to let the read head run through the sample by itself.
-4. Press SRC twice for SRC SETUP: turn PAN for a spread across the stereo field, DIR for a share of backward grains, SHAP to change the grain window, and MODE to SYNC to lock the grains to the tempo.
+4. Press SRC twice for SRC SETUP: turn PAN for a spread across the stereo field, DIR for a share of backward grains, SHAP to change the grain window, MODE to SYNC to lock the grains to the tempo, and EDGE to choose what happens when a grain reaches the start or end of the sample.
5. Press SRC once more from SRC SETUP for the full-screen page, with a larger waveform and every value beside its name, for precise settings.
6. Press SRC again to leave the full-screen page. Press STOP to stop playback.
@@ -59,7 +60,7 @@ Everything else, menus, saving, loading, scenes, recording, MIDI and timing, is
## What a Part keeps
-Everything Grain stores in a Part is a value stock's own power-on check accepts: PTCH as Flex's (64 is 0), SHAP and MODE in LOOP and RATE, POS's eighths in TSNS, and DIR and PAN in the track's unused NEIGHBOR bytes. A project opened without the module, or on a unit without it, keeps its banks and plays the track as Flex.
+Everything Grain stores in a Part is a value stock's own power-on check accepts: PTCH as Flex's (64 is 0), SHAP and MODE in LOOP and RATE, POS's eighths in TSNS, EDGE in TSTR (0 to 3), and DIR and PAN in the track's unused NEIGHBOR bytes. A project opened without the module, or on a unit without it, keeps its banks and plays the track as Flex.
## Screens and audio
@@ -74,7 +75,7 @@ The author supplied a 45-second recording of Grain on their Octatrack MKI. They
## Compatibility and limitations
-Grain uses a Modwerk base for Octatrack OS 1.40C and plays the selected track's Flex sample. Up to six grains can sound on each admitted track. An unreadable or loading sample plays silence. Replacing a sample during a note takes effect on the next trig. Sequencer trigs, trig keys, CHROMATIC keys and MIDI notes all play the grains, a note at its pitch (within PTCH's -12 to +12 semitones, as on Flex); only FUNC + YES in the sample pool plays the sample as a plain Flex, as a preview, until the track's next trig. POS parameter locks use whole numbers. Each grain plays 3 dB below full scale, so six long grains of a loud sample stay clean; raise the track volume if a single grain is too quiet. PTCH changed units in 0.1.3: Grain 0.1.2 stored semitones (-24 to +24), 0.1.3 reads Flex's units (5 a semitone), so a PTCH saved with 0.1.2 plays at a fifth of its transposition (+12 becomes +2.4): set it again. A SCALE in PROJECT > CONTROL > SEQUENCER (the scale quantizer that comes with FM Synth and Scale Quantizer) now steps in the same units as Grain; not tested on a unit.
+Grain uses a Modwerk base for Octatrack OS 1.40C and plays the selected track's Flex sample. Up to six grains can sound on each admitted track. An unreadable or loading sample plays silence. Replacing a sample during a note takes effect on the next trig. Sequencer trigs, trig keys, CHROMATIC keys and MIDI notes all play the grains, a note at its pitch (within PTCH's -12 to +12 semitones, as on Flex); only FUNC + YES in the sample pool plays the sample as a plain Flex, as a preview, until the track's next trig. POS parameter locks use whole numbers. Each grain plays 3 dB below full scale, so six long grains of a loud sample stay clean; raise the track volume if a single grain is too quiet. PTCH changed units in 0.1.3: Grain 0.1.2 stored semitones (-24 to +24), 0.1.3 reads Flex's units (5 a semitone), so a PTCH saved with 0.1.2 plays at a fifth of its transposition (+12 becomes +2.4): set it again. A SCALE in PROJECT > CONTROL > SEQUENCER (the scale quantizer that comes with FM Synth and Scale Quantizer) now steps in the same units as Grain; not tested on a unit. EDGE (0.2.0): a project saved with 0.1.3 or earlier opens with EDGE on CLMP, so a grain that SPRY threw past an edge is now born on that edge instead of wrapping. Set EDGE to WRAP for the 0.1.2 sound, or to STOP for the 0.1.0 and 0.1.1 sound without the click.
## Tests and measurements
diff --git a/sdk/octatrack/modules/grain/TESTING.md b/sdk/octatrack/modules/grain/TESTING.md
index 49d77c8a28..9dfcefb6ef 100755
--- a/sdk/octatrack/modules/grain/TESTING.md
+++ b/sdk/octatrack/modules/grain/TESTING.md
@@ -1,6 +1,50 @@
# GRAIN testing
-Grain 0.1.3-experimental · by A Force Truly Evil.
+Grain 0.2.0-experimental · by A Force Truly Evil.
+
+## 0.2.0-experimental: EDGE, four ways to treat the sample's edges, 23 November 2026
+
+The package is `e8d7c794905a2ff05a1f44f4d5a221263a8668f4fbf1f1e407a9f849701ae6d1` (31,524 bytes), rebuilt on 0.1.3 with
+`scripts/octatrack-module-packages.py` in the pinned toolchain. It loads 30,148 bytes of code and data and reserves 2,864 of BSS
+(33,012 bytes of static memory; 31,808 in 0.1.2). The deepest Grain-only audio stack is 780 bytes by the same method as 0.1.2's 768
+(`grain_render` 168, `gran_render` 412 against 392, `stereo_paged` 92 and `stereo_page` 84, plus four return addresses and 8 for the
+frame pointers `link.w` saves).
+
+- **EDGE** is a selector in SRC SETUP, knob E, with four values stored in SETUP E (the byte stock calls TSTR, whose range 0 to 3
+ passes the power-on check): CLMP 0 (the default), WRAP 1, STOP 2 and BNCE 3. A value above 3 reads as CLMP. SETUP E also held the
+ eighths of SIZE in the display code, but nothing ever wrote them, so `part_size` no longer reads it. EDGE lives in the engine's track (`gran_set_edge`), not in `GranParams`, so the
+ structure `verify_lanes.py` reads is 0.1.3's.
+- **Where a grain is born** (POS plus SPRY outside the sample). WRAP: on the other side, as in 0.1.2. CLMP, STOP and BNCE: on the edge
+ that was crossed; past the end, a forward CLMP grain starts at the beginning (the end and the beginning are the same point) and a
+ STOP or BNCE grain, or a backward one, on the last frame.
+- **A grain that reaches an edge while it plays.** CLMP and WRAP: it carries on from the other side, in its own direction. STOP: it
+ ends there. BNCE: it is reflected about the edge and turns round.
+- **STOP shortens the grain** that would reach an edge before its window ends, so that the window ends at the edge. 0.1.0 and 0.1.1
+ cut such a grain in the middle of its window, which clicked. A grain that does not reach an edge is unchanged.
+- **Cost.** The two loops that run for every sample, `stereo_page` and `stereo_paged`, compile to the same instructions as in 0.1.2
+ (the function bodies in `grain_core.s` compared). The new code runs when a grain is born or reaches an edge: a few compares, and for
+ STOP a multiplication and a compare (a division only for a grain that does reach an edge).
+- **Host results.** WRAP renders match 0.1.2 bit for bit over 7,200 combinations of sample length, mono and stereo, POS, SIZE, DENS,
+ SPRY, DIR, SCAN and pitch. STOP renders match 0.1.1's engine (with 0.1.2's window tables) bit for bit where no grain comes near an
+ edge (96 cases with SPRY 0, DIR 0 and SCAN 0 on long samples). On a clean 220 Hz tone, the output steps over 2,500 in one sample went from 118 to 0 at POS 124, 10 to 0 at
+ POS 100, 7 to 0 at POS 110 with SPRY 60, and 2 to 0 at POS 60 with SPRY 127 (STOP, SIZE 70, DENS 100, before and after the
+ shortening); at pitch x4 with half the grains backwards, from 23 to 8. `verify.py` runs every case in all four modes (optimized
+ against plain paths) and holds references for CLMP, STOP and BNCE beside 0.1.2's three, which WRAP keeps. `range_test.c` checks
+ births at both edges and a sounding grain at both edges in every mode. `verify_lanes.py` passes on the compiled kernels, including
+ 0.1.3's PTCH checks.
+
+**On the MKI** (the author, OS 1.40C, official base `6d23e888`, card set with Grain, E-Verb, Mini Verb, syntiz, FM Synth, BBD Delay and
+Tape Echo): the first build of this release, package `8a4555de` (STOP without the shortening), with an eight-tone sample, one tone a
+second from C3 to E5, so the notes heard say which part of the sample each grain reads. SIZE 64, DENS 100, SCAN 0, PTCH 0. In CLMP,
+WRAP and BNCE the notes heard were those the host renders give: at POS 0 with SPRY 60, at POS 127 with SPRY 0 and 60, and at POS 0
+with DIR 127. STOP was nearly silent at POS 127.8, as expected (a grain born that close to the end has a few milliseconds of sample
+left), and played as expected at POS 120. The author heard a click when a STOP grain reached an edge; the shortening above is the
+change made for it. A later build, package `0e4bebd4` (STOP shortened; card set for the same base), loaded and played, and the author ran the rest of
+the release checklist (the STOP click, EDGE across a save and a power cycle, a p-lock on EDGE, an older project) and reported nothing
+wrong. **CPU meter** (the stock meter, read by eye, DENS and SPRY at maximum, PTCH +24, all four EDGE modes): 65 to 68 %, about 66 to
+67 % on average in every mode. **Not recorded:** a unit run of the final package `e8d7c794`, which is `0e4bebd4`'s engine on 0.1.3 (the unit
+runs above were made before 0.1.3 was merged); the frame-cost curve for 0.2.0 (`evidence/frame-cost.json` is 0.1.3's: first 33.3, each
+33.3); MKII.
## 0.1.3-experimental: trig keys, CHROMATIC keys and MIDI notes play grains, in tune, 23 November 2026
@@ -767,3 +811,99 @@ back to SRC. Pressing PLAYBACK again closes it. FUNC + PLAYBACK still opens SRC
| An MKII unit | the keymap and the panel differ between the models | Not run | not run: no MKII at hand; the emulator was used in MKII mode, which is not hardware evidence |
An emulator result never counts as hardware evidence; every row says which it is.
+
+## Unreleased: POS p-locks and recording a Grain track (28 November 2026)
+
+Not packaged in this branch and not released. Base 0.8.2, the author's MKI.
+
+**POS p-locks.** With a trig held in grid recording, or in live recording, POS moves one unit per detent (seven with the
+knob pushed), the Part is left alone and the page shows the locked value. Before, the fine step also ran there: the lock
+moved only every eight slow detents and the eighths were written to the Part. Emulator: pass, also on step 18. On the unit
+the author reported it works.
+
+**Recording a Grain track into a Flex recorder (repeat98/modwerk#2186).** Reproduced: Grain on T4 (DENS 127), time-stretched
+loops on T2 and T3, T1 recording T4. The base's frame guard skipped about 600 Grain renders a second while recording; none
+or a few without recording, and none with a time-stretched Flex track in Grain's place.
+
+Change: while Grain renders its own voice, the stock FLEX reader's PCM copy (`jsr 0x40007960` at `0x400041c4`) is skipped,
+since Grain replaced all of it. The rest of the reader runs as before; `gran.c` is unchanged.
+
+On the unit, with an on-screen DTCN3 meter (not in this branch), while recording, per render call: stock FLEX part 9.9 to
+1.6 us, grain mix 14.6 to 14.7 us, total 31.3 to 22.6 us (about 17.2 % to 12.5 % of a frame). Without recording the total was
+38.4 us before; it was not measured after. Skips fell to 161 in about seven minutes; the author heard at most an isolated one.
+Emulator: audio matches the previous build within the run-to-run variation (not bit-exact).
+
+Open before a release: POLY8 detours the same site, so the two cannot be installed together (a base event would solve it);
+the frame-cost curve has not been re-measured with `device:price` and the declared price is unchanged; `verify.py` passed
+for the p-lock change and was not re-run for the second one (the engine file is unchanged).
+
+## 0.2.0 on the final package, 30 November and 1 December 2026
+
+Package 520215cb (the one in this branch). The author's MKI, OS 1.40C.
+
+**Frame cost** (`device:price --curve`, development base 4c7eb79b, three 8 s readings a state, `evidence/frame-cost.json`):
+first instance 16.1 % of a frame, a second one 8.6 % more (0.1.3 read 33.3 % for the first). At rest, installed and unused,
++0.4 points of the mean. Admitted on the empty pattern (longest frame 51.8 %, none dropped); refused on the medium pattern
+(105.3 % with Grain on T1). The scene without Grain was not measured on its own. With Grain on T1 and T3 the longest frame
+was 113.9 % with three renders skipped, with the Part's CPU allowance raised for the curve's picks.
+
+**POS eighths in the XVOL lock byte** (1 December, by hand on the unit): POS locked with eighths on a trig; the trig copied,
+pasted and its locks cleared; the track switched to Flex and to Static with the lock still there, the crossfader moved.
+The author reports everything correct and no volume jump.
+
+**Not run:** `npm run test:procedure` (the scripted unit pass and soak), the MKII.
+
+**The package in this branch, db1cb96a,** was rebuilt after those readings with a change to the waveform view's display code
+only. Compiled against 520215cb's source, every function of the engine and the render path is identical; `shown_pos`,
+`wave_area` and `knob_value` differ. The frame cost and the lock byte test above were run on 520215cb and not repeated.
+The author runs a build with the same display change on their MKI.
+
+### Test procedure: grain 0.2.0-experimental, 2026-12-02
+
+Build: revision `cce982542384`, package `0.2.0-experimental.mwrm` SHA-256 `db1cb96a163450ce79cc9e361e4c41e94c431735d2df5d1139797cb4686cfe12`. `npm run test:procedure -- grain --package public/octatrack-modules/grain/0.2.0-experimental.mwrm --no-unit --out OUT`, 15 s. Emulator results are not hardware evidence; only what ran on the unit is.
+
+| # | Step | Layer | Result | Command | Evidence |
+|---|---|---|---|---|---|
+| 1 | Software checks | host | passed | `npm run module:doctor -- grain` | logs/01-software.log |
+| 2 | Beside every other module | contract | passed | `npm run modules:compat -- grain` | logs/02-compat.log |
+| 3 | Name the build | host | passed | | logs/03-build.log |
+| 4 | DSP cost model | contract | passed | `node scripts/cycle-scan.mjs check` | logs/04-cost-model.log |
+| 5 | Emulator rehearsal | emulator | not run: no emulator session: no adapted ot_emu: build it once (scripts/octatrack-emulator/README.md) and set MODWERK_OT_EMU to it, or pass --emulator OT_EMU; no development twin: build one outside Git (docs/OCTATRACK_DRIVING.md, the first paragraph) and set MODWERK_OT_TWIN to its folder, or pass --twin DIR | | |
+| 6 | Read the unit | unit | not run: left alone with --no-unit | `node scripts/device.mjs status --socket /tmp/modwerk-share.sock`
`node scripts/octatrack-part-state.mjs read --socket /tmp/modwerk-share.sock --out OUT/part-start.json`
`node scripts/device.mjs do inventory --socket /tmp/modwerk-share.sock` | |
+| 7 | Scripted unit pass | unit | not run: left alone with --no-unit | `npm run device:test -- --share /tmp/modwerk-share.sock --testing-entry OUT/device-test.md public/octatrack-modules/grain/0.2.0-experimental.mwrm` | |
+| 8 | Soak | unit | not run: left alone with --no-unit | `node scripts/device.mjs try public/octatrack-modules/grain/0.2.0-experimental.mwrm --seconds 420 --socket /tmp/modwerk-share.sock`
`node scripts/octatrack-soak.mjs --seconds 120 --log OUT/soak.json`
`node scripts/octatrack-part-state.mjs restore --socket /tmp/modwerk-share.sock --start OUT/part-start.json` | |
+| 9 | Cost on the unit | unit | not run: left alone with --no-unit | `npm run device:price -- --share /tmp/modwerk-share.sock --out OUT/price.json --scene 'the bank, pattern and Part the unit was on, transport stopped (test:procedure)' --curve T1,T3,T6,T7 public/octatrack-modules/grain/0.2.0-experimental.mwrm` | |
+| 10 | Put back | unit | not run: left alone with --no-unit | `node scripts/device.mjs do inventory --socket /tmp/modwerk-share.sock`
`node scripts/octatrack-part-state.mjs restore --socket /tmp/modwerk-share.sock --start OUT/part-start.json` | |
+| 11 | Agent by hand | unit | to do | | |
+| 12 | Submitter's own stage | unit | to do | | |
+
+#### Edge cases for this change
+
+Derive them from what the change touches and run each one (docs/TEST_PROCEDURE.md#edge-cases). A start, from the manifest and the changed files:
+
+- a track machine: the project naming it after it is removed (MISSING); a Part change into a Part that uses it while playing (docs/OCTATRACK_MODULE_EDGE_CASES.md#projects-and-the-installed-modules)
+- memory: the module pool nearly full; a delay buffer next to it; the largest set it can join (docs/OCTATRACK_HARDWARE_TRAPS.md#dsp-loader-dynamic-dsp-code)
+- persistence: saved in a Part, then a Part reload, a project reload and a power cycle; removed while a saved Part still names it (docs/OCTATRACK_MODULE_EDGE_CASES.md#copying-and-saving)
+
+| Case | Why this change makes it a risk | How run | Result |
+|---|---|---|---|
+| Grain beside every other module, POLY8 included | 0.2.0 skips the stock FLEX reader's PCM copy at a site POLY8 also detours | step 2, `npm run modules:compat -- grain`, with `poly8` in `compatibility.conflicts` | pass (contract): the site never offers the two together |
+| The medium pattern with Grain on one track | the first instance takes the medium pattern to 105.3 % of a frame | the author's `device:price --curve` on package 520215cb, their MKI (section above) | refused, as reported by the author; waived by the owner as release-cost for this version |
+| Recording a Grain track into a Flex recorder | the change that skips the PCM copy is there to stop dropped renders while recording (#2186) | the author's MKI, 520215cb's source (section above) | skips fell to 161 in about seven minutes, as reported by the author; not run on db1cb96a |
+| The project naming Grain after it is removed (MISSING) | a track machine must read as Flex without the module | not run | not run: no unit in this pass |
+| A Part change into a Part that uses Grain, while playing | the machine is set up on the switch | not run | not run: no unit in this pass |
+| The module pool nearly full; the largest set Grain can join | 0.2.0's package is 34,170 bytes, 3,746 more than 0.1.3 | not run | not run: no unit in this pass |
+| Saved in a Part, then a Part reload, a project reload and a power cycle | EDGE adds a stored value; a project saved with 0.1.2 or 0.1.3 opens in CLMP | the author's MKI on earlier 0.2.0 builds (table above) | pass for earlier builds, as reported by the author; not run on db1cb96a |
+
+#### Left for the submitter at their unit
+
+- how it sounds and plays, and timing by ear
+- MIDI, scenes and recording with it
+- it beside the other modules installed on their unit
+- two instances with different settings, on both FX slots and both DSP cores where it can (docs/MODULE_QUALIFICATION.md)
+- Part reload, project save and reload, and a power cycle with it saved: what survives (the Keep and the power cycle are theirs)
+
+#### For the pull request
+
+Not tested on a unit: run without the unit for the release on 2 December 2026; the hardware results above are the author's, on their MKI.
+Edge cases: the table above, one row a case (or "Edge cases: none, because …").
diff --git a/sdk/octatrack/modules/grain/evidence/frame-cost.json b/sdk/octatrack/modules/grain/evidence/frame-cost.json
index 806259d95a..924d3a7eff 100644
--- a/sdk/octatrack/modules/grain/evidence/frame-cost.json
+++ b/sdk/octatrack/modules/grain/evidence/frame-cost.json
@@ -1,22 +1,25 @@
{
"module": "grain",
- "version": "0.1.3-experimental",
- "base": "95adb64b (0.8 development twin, built from main 4035fdfa8)",
- "scene": "C04 at 126 BPM, trigs on steps 1/5/9/13 of T1-T4, T6, T7 (the scene FM Synth 0.1.5's curve used); picks on empty C02; Grain on T1, whose Flex slot holds a loaded 16-bit stereo sample. One instance: a second (T3, the other track with a loaded sample) was refused on 23 November and on T6/T7 Grain would render silence; owner's MKII",
+ "version": "0.2.0-experimental",
+ "base": "4c7eb79b (development base booted in RAM)",
+ "scene": "A01 at 120 BPM, 16 steps, trigs on steps 1/5/9/13 of T1-T4, T6, T7: T1 and T3 Flex with a loaded 16-bit stereo sample (0.91 MB), T2 and T4 stock samples with time stretch off, T6 and T7 no sample, T5 and T8 empty; picks on empty A02; the author's MKI; package 520215cb",
"seconds": 8,
- "measuredAt": "2026-11-23T17:33:05.742Z",
+ "measuredAt": "2026-11-30T16:00:46.174Z",
"tracks": [
- "T1"
+ "T1",
+ "T3"
],
- "rest": 0,
- "first": 33.3,
- "each": 33.3,
+ "rest": 0.4,
+ "first": 16.1,
+ "each": 8.6,
"points": [
- 81.1,
- 114.4
+ 89.2,
+ 105.3,
+ 113.9
],
"adds": [
- 33.3
+ 16.1,
+ 24.7
],
"admission": [
{
@@ -25,18 +28,22 @@
"track": "T1",
"seconds": 8,
"admitted": true,
- "frameMax": 51.3,
- "frame": 32.7,
+ "frameMax": 51.8,
+ "frame": 32.4,
"dropped": 0,
"stalls": 0
},
{
"pattern": "medium",
- "number": 4,
+ "number": 1,
"track": "T1",
"seconds": 8,
- "admitted": false
+ "admitted": false,
+ "frameMax": 105.3
}
],
- "notes": []
+ "notes": [
+ "the Part's CPU allowance at 400 % for the curve's picks, back to 45 % for the admission runs",
+ "stopped after T3: longest frame 113.9 %, 3 renders skipped"
+ ]
}
diff --git a/sdk/octatrack/modules/grain/evidence/performance.json b/sdk/octatrack/modules/grain/evidence/performance.json
index 510a21869c..dcdf14a1c3 100755
--- a/sdk/octatrack/modules/grain/evidence/performance.json
+++ b/sdk/octatrack/modules/grain/evidence/performance.json
@@ -1,7 +1,7 @@
{
"schema": 1,
"module": "grain",
- "version": "0.1.3-experimental",
+ "version": "0.2.0-experimental",
"kind": "coldfire",
"cycles": {
"unit": "cycles/event",
diff --git a/sdk/octatrack/modules/grain/grain_core.s b/sdk/octatrack/modules/grain/grain_core.s
index 2dc440fe1a..815078eb8e 100644
--- a/sdk/octatrack/modules/grain/grain_core.s
+++ b/sdk/octatrack/modules/grain/grain_core.s
@@ -5,6 +5,21 @@
#APP
.text
.even
+ .globl grain_copy
+grain_copy:
+ move.l 8(%sp),%d0
+ moveq #7,%d1
+ cmp.l %d1,%d0
+ bhi.s 1f
+ lea grain_skip,%a0
+ tst.b (0,%a0,%d0.l)
+ bne.s 2f
+1: jsr 0x40007960
+2: lea 24(%sp),%sp
+ jmp 0x400041cc
+
+ .text
+ .even
grain_stock_pool:
move.l %a2,-(%sp)
tst.l 0x460e70e0
@@ -72,7 +87,7 @@ stereo_page:
move.l %a2,44(%sp)
move.l 112(%sp),%a5
#APP
-| 335 "gran.c" 1
+| 365 "gran.c" 1
1:
.if 1
move.l %a0,%d2
@@ -172,7 +187,7 @@ stereo_page:
move.l 108(%sp),%a5
move.l 104(%sp),%d0
#APP
-| 335 "gran.c" 1
+| 365 "gran.c" 1
1:
.if 0
move.l %a1,%d2
@@ -271,7 +286,7 @@ stereo_page:
move.l %d0,76(%sp)
move.l %a2,72(%sp)
#APP
-| 335 "gran.c" 1
+| 365 "gran.c" 1
1:
.if 1
move.l %a0,%d2
@@ -350,7 +365,7 @@ stereo_page:
move.l 108(%sp),%a5
move.l 104(%sp),%d6
#APP
-| 335 "gran.c" 1
+| 365 "gran.c" 1
1:
.if 0
move.l %a1,%d2
@@ -436,7 +451,7 @@ stereo_page:
clr.l 76(%sp)
move.l %d4,80(%sp)
#APP
-| 335 "gran.c" 1
+| 365 "gran.c" 1
1:
.if 1
move.l %a0,%d2
@@ -537,7 +552,7 @@ stereo_page:
move.l 108(%sp),%a5
move.l 104(%sp),%d7
#APP
-| 335 "gran.c" 1
+| 365 "gran.c" 1
1:
.if 0
move.l %a2,%d3
@@ -621,7 +636,7 @@ stereo_page:
clr.l 76(%sp)
move.l %d4,80(%sp)
#APP
-| 335 "gran.c" 1
+| 365 "gran.c" 1
1:
.if 1
move.l %a0,%d0
@@ -701,7 +716,7 @@ stereo_page:
move.l %d4,80(%sp)
move.l %a2,68(%sp)
#APP
-| 335 "gran.c" 1
+| 365 "gran.c" 1
1:
.if 0
move.l %a1,%d3
@@ -779,7 +794,7 @@ stereo_page:
move.l 108(%sp),%a5
move.l 104(%sp),%d0
#APP
-| 335 "gran.c" 1
+| 365 "gran.c" 1
1:
.if 0
move.l %a1,%d2
@@ -861,7 +876,7 @@ stereo_page:
move.l 104(%sp),%d5
move.l 112(%sp),%a5
#APP
-| 335 "gran.c" 1
+| 365 "gran.c" 1
1:
.if 1
move.l %a1,%d2
@@ -940,7 +955,7 @@ stereo_page:
move.l %d0,76(%sp)
move.l %d4,80(%sp)
#APP
-| 335 "gran.c" 1
+| 365 "gran.c" 1
1:
.if 1
move.l %a0,%d2
@@ -1018,7 +1033,7 @@ stereo_page:
move.l 108(%sp),%a5
move.l 104(%sp),%d7
#APP
-| 335 "gran.c" 1
+| 365 "gran.c" 1
1:
.if 0
move.l %a2,%d3
@@ -1294,6 +1309,48 @@ mode_text:
lea .LC4,%a1
jra .L67
.size mode_text, .-mode_text
+ .section .rodata.str1.1
+.LC6:
+ .string "WRAP"
+.LC7:
+ .string "CLMP"
+.LC8:
+ .string "BNCE"
+.LC9:
+ .string "STOP"
+ .text
+ .align 2
+ .type edge_text, @function
+edge_text:
+ move.l 8(%sp),%d0
+ tst.l %d0
+ jle .L76
+ moveq #1,%d1
+ cmp.l %d0,%d1
+ jeq .L77
+ subq.l #2,%d0
+ tst.l %d0
+ jeq .L82
+ move.l 4(%sp),%a0
+ lea .LC8,%a1
+.L75:
+ move.b (%a1)+,%d0
+ move.b %d0,(%a0)+
+ jne .L75
+ rts
+.L77:
+ move.l 4(%sp),%a0
+ lea .LC6,%a1
+ jra .L75
+.L76:
+ move.l 4(%sp),%a0
+ lea .LC7,%a1
+ jra .L75
+.L82:
+ move.l 4(%sp),%a0
+ lea .LC9,%a1
+ jra .L75
+ .size edge_text, .-edge_text
.align 2
.type scan_text, @function
scan_text:
@@ -1303,13 +1360,13 @@ scan_text:
movem.l #28,(%sp)
move.l 24(%sp),%a0
cmp.l %d0,%d1
- jcs .L76
- jeq .L77
+ jcs .L86
+ jeq .L87
add.l #-64,%d0
move.l %d0,12(%sp)
tst.l %d0
- jlt .L82
-.L75:
+ jlt .L92
+.L85:
mulu.w #100,%d0
moveq #10,%d3
moveq #100,%d4
@@ -1326,7 +1383,7 @@ scan_text:
move.l %d2,%a1
lea (48,%a1),%a1
tst.l 12(%sp)
- jge .L83
+ jge .L93
moveq #45,%d3
move.b %d0,1(%a0)
move.w %a1,%d2
@@ -1341,7 +1398,7 @@ scan_text:
movem.l (%sp),#28
lea (20,%sp),%sp
rts
-.L76:
+.L86:
moveq #48,%d0
move.w #48,%a1
moveq #32,%d4
@@ -1359,10 +1416,10 @@ scan_text:
movem.l (%sp),#28
lea (20,%sp),%sp
rts
-.L82:
+.L92:
neg.l %d0
- jra .L75
-.L77:
+ jra .L85
+.L87:
moveq #50,%d0
moveq #43,%d2
move.w #48,%a1
@@ -1380,9 +1437,9 @@ scan_text:
movem.l (%sp),#28
lea (20,%sp),%sp
rts
-.L83:
+.L93:
tst.l 12(%sp)
- jeq .L84
+ jeq .L94
moveq #43,%d4
move.b %d0,1(%a0)
move.w %a1,%d2
@@ -1397,7 +1454,7 @@ scan_text:
movem.l (%sp),#28
lea (20,%sp),%sp
rts
-.L84:
+.L94:
moveq #32,%d3
move.b %d0,1(%a0)
move.w %a1,%d2
@@ -1427,11 +1484,11 @@ grain_admit:
move.l #1074606604,%a1
move.l #defaults+12,%d1
sub.l %a0,%a1
-.L88:
+.L98:
move.b (%a1,%a0.l),%d0
move.b %d0,(%a0)+
cmp.l %d1,%a0
- jne .L88
+ jne .L98
moveq #64,%d1
swap %d1
move.l #1073758272,%d0
@@ -1448,27 +1505,27 @@ ours:
moveq #7,%d1
move.l 12(%sp),%d0
cmp.l %d0,%d1
- jcs .L95
+ jcs .L105
move.l 8(%sp),%a0
mvz.b 34(%a0,%d0.l),%d1
subq.l #1,%d1
tst.l %d1
- jeq .L98
-.L95:
+ jeq .L108
+.L105:
move.l (%sp)+,%d2
clr.l %d0
rts
-.L98:
+.L108:
mulu.w #30,%d0
moveq #71,%d1
lea 60(%a0,%d0.l),%a0
mvz.b (%a0),%d0
cmp.l %d0,%d1
- jne .L95
+ jne .L105
mvz.b 1(%a0),%d0
moveq #82,%d2
cmp.l %d0,%d2
- jne .L95
+ jne .L105
move.b 2(%a0),%d0
moveq #1,%d1
move.l (%sp)+,%d2
@@ -1503,7 +1560,7 @@ grain_dial:
move.l 76(%sp),%d2
move.l %d2,40(%sp)
cmp.l %a0,%d3
- jcc .L118
+ jcc .L128
move.l 36(%sp),%a2
move.l 32(%sp),%d2
move.l %d0,68(%sp)
@@ -1518,22 +1575,22 @@ grain_dial:
move.l %a0,76(%sp)
lea (48,%sp),%sp
jmp 1074035124
-.L118:
+.L128:
move.l #1187521622,%a2
move.l (%a2),%d0
add.l #-1073741824,%d0
cmp.l #133169151,%d0
- jls .L119
-.L102:
+ jls .L129
+.L112:
move.l 1187503134,%d0
tst.l %d0
- jeq .L106
+ jeq .L116
moveq #3,%d0
-.L106:
+.L116:
tst.b setup_turned.l
- jeq .L107
+ jeq .L117
tst.b setup_turned+1.l
- jeq .L120
+ jeq .L130
move.l 36(%sp),%a2
moveq #8,%d0
move.l 32(%sp),%d2
@@ -1549,7 +1606,7 @@ grain_dial:
move.l %a0,76(%sp)
lea (48,%sp),%sp
jmp 1074035124
-.L107:
+.L117:
tst.b setup_turned+1.l
sne %d2
mvs.b %d2,%d3
@@ -1561,7 +1618,7 @@ grain_dial:
lsr.l %d2,%d0
lsl.l #3,%d0
and.l %d3,%d0
-.L122:
+.L132:
move.l 36(%sp),%a2
move.l 32(%sp),%d2
move.l 28(%sp),%d3
@@ -1576,7 +1633,7 @@ grain_dial:
move.l %a0,76(%sp)
lea (48,%sp),%sp
jmp 1074035124
-.L119:
+.L129:
move.b 47(%sp),%d0
moveq #3,%d2
move.l (%a2),%d3
@@ -1604,21 +1661,21 @@ grain_dial:
move.l 20(%sp),%a0
move.l 12(%sp),%a1
tst.l %d0
- jeq .L102
+ jeq .L112
move.l %d2,%d0
moveq #30,%d2
muls.l %d2,%d0
moveq #1,%d3
cmp.l %d1,%d3
- jeq .L121
+ jeq .L131
move.l 44(%sp),%a1
add.l #64,%d0
moveq #127,%d2
move.b (%a1,%d0.l),%d0
and.l %d0,%d2
move.l %d2,%a1
- jra .L102
-.L120:
+ jra .L112
+.L130:
moveq #1,%d3
or.l %d3,%d0
move.l %a0,%d2
@@ -1626,201 +1683,48 @@ grain_dial:
lsr.l %d2,%d0
lsl.l #3,%d0
and.l %d3,%d0
- jra .L122
-.L121:
+ jra .L132
+.L131:
move.l 44(%sp),%a1
add.l #63,%d0
moveq #127,%d2
move.b (%a1,%d0.l),%d0
and.l %d0,%d2
move.l %d2,%a1
- jra .L102
+ jra .L112
.size grain_dial, .-grain_dial
.align 2
- .type pos_step, @function
-pos_step:
- lea (-36,%sp),%sp
- movem.l #1036,(%sp)
- move.l #1187521622,%a0
- moveq #1,%d2
- move.b 269161676,%d1
- move.b 269161679,%d0
- move.w %d0,%a1
- move.l (%a0),%d0
- cmp.l 40(%sp),%d2
- jne .L124
- move.l (%a0),%a0
- add.l #-1073741824,%a0
- cmp.l #133169151,%a0
- jls .L138
-.L124:
- movem.l (%sp),#1036
- move.l 48(%sp),%d0
- add.l 44(%sp),%d0
- lea (36,%sp),%sp
- rts
-.L138:
- move.l %a1,%d3
- moveq #3,%d2
- and.l %d2,%d3
- add.l #585088,%d0
- move.l %d3,%a1
- moveq #7,%d3
- and.l %d1,%d3
- move.l #6322,%d1
- move.l %d3,-(%sp)
- move.l %d3,32(%sp)
- move.l %a1,%d3
- muls.l %d1,%d3
- move.l %d0,%d1
- move.l %d3,28(%sp)
- add.l %d3,%d1
- move.l %d1,-(%sp)
- move.l %d1,20(%sp)
- jsr ours
- addq.l #8,%sp
- move.l 12(%sp),%d1
- tst.l %d0
- jeq .L124
- move.b 31(%sp),%d2
- move.l 48(%sp),%d0
- lsl.l #3,%d0
- ext.w %d2
- move.w %d2,%d3
- move.w %d2,%a0
- moveq #7,%d2
- mulu.w #30,%d3
- move.l %d3,%a1
- lea (485,%a1),%a1
- move.l %a1,20(%sp)
- add.l %d1,%a1
- move.b (%a1),%d1
- and.l %d2,%d1
- add.l %d1,%d0
- tst.l 1187503686
- jeq .L127
- move.l 44(%sp),%d1
- moveq #56,%d3
- muls.l %d3,%d1
- add.l %d1,%d0
-.L128:
- cmp.l #1023,%d0
- jle .L134
- move.l #1023,%d0
-.L135:
- move.w %a0,%d1
- move.l 20(%sp),%d2
- move.l 24(%sp),%a2
- add.l #269110990,%a2
- mulu.w #72,%d1
- move.l %d1,%a0
- moveq #7,%d1
- and.l %d0,%d1
- add.l #-2147481547,%a0
- asr.l #3,%d0
- move.b %d1,(%a1)
- move.b %d1,(%a2,%d2.l)
- move.b %d1,(%a0)
-.L139:
- movem.l (%sp),#1036
- lea (36,%sp),%sp
- rts
-.L134:
- tst.l %d0
- jge .L135
- move.w %a0,%d1
- clr.l %d0
- move.l 20(%sp),%d2
- move.l 24(%sp),%a2
- add.l #269110990,%a2
- mulu.w #72,%d1
- move.l %d1,%a0
- moveq #7,%d1
- and.l %d0,%d1
- add.l #-2147481547,%a0
- asr.l #3,%d0
- move.b %d1,(%a1)
- move.b %d1,(%a2,%d2.l)
- move.b %d1,(%a0)
- jra .L139
-.L127:
- move.l -66600948,%a2
- move.l (last.1),%d2
- move.l 44(%sp),%d1
- move.l %a2,28(%sp)
- move.l %d2,32(%sp)
- move.l %a2,(last.1)
- tst.l %d1
- jlt .L140
- moveq #1,%d3
- cmp.l %d1,%d3
- jge .L129
-.L132:
- move.l 44(%sp),%d1
- lsl.l #4,%d1
- move.l %d1,44(%sp)
-.L131:
- add.l 44(%sp),%d0
- jra .L128
-.L129:
- move.l 28(%sp),%d1
- sub.l 32(%sp),%d1
- cmp.l #1583999,%d1
- jls .L132
- cmp.l #3959999,%d1
- jhi .L133
- move.l 44(%sp),%d2
- lsl.l #3,%d2
- move.l %d2,44(%sp)
- add.l 44(%sp),%d0
- jra .L128
-.L140:
- neg.l %d1
- moveq #1,%d3
- cmp.l %d1,%d3
- jlt .L132
- jra .L129
-.L133:
- cmp.l #9239999,%d1
- jhi .L131
- move.l 44(%sp),%d3
- add.l %d3,%d3
- move.l %d3,44(%sp)
- add.l 44(%sp),%d0
- jra .L128
- .size pos_step, .-pos_step
- .align 2
.type pool_ours, @function
pool_ours:
move.l %d2,-(%sp)
tst.b pool_direct.l
- jeq .L144
+ jeq .L136
move.l #1187521622,%a0
move.l (%a0),%d0
add.l #-1073741824,%d0
cmp.l #133169151,%d0
- jhi .L144
+ jhi .L136
move.l pool_bank,%d0
cmp.l (%a0),%d0
- jeq .L147
-.L144:
+ jeq .L139
+.L136:
move.l (%sp)+,%d2
clr.l %d0
rts
-.L147:
+.L139:
move.b 269161679,%d0
move.b pool_part,%d1
moveq #3,%d2
and.l %d2,%d0
mvz.b %d1,%d2
cmp.l %d2,%d0
- jne .L144
+ jne .L136
mvz.b 269161676,%d0
mvz.b pool_track,%d2
cmp.l %d0,%d2
- jne .L144
+ jne .L136
tst.b -2147483627.l
- jne .L144
+ jne .L136
ext.w %d1
move.l (%a0),%a0
add.l #585088,%a0
@@ -1841,13 +1745,13 @@ grain_chooser:
lea pool_ours,%a2
jsr (%a2)
tst.l %d0
- jne .L149
+ jne .L141
tst.b win_seen.l
- jne .L161
-.L149:
+ jne .L153
+.L141:
jsr (%a2)
tst.l %d0
- jeq .L151
+ jeq .L143
mvz.b pool_part,%d0
mvz.b pool_track,%d1
move.l 1187521622,%a0
@@ -1856,29 +1760,29 @@ grain_chooser:
add.l %d0,%a0
lea 34(%a0,%d1.l),%a0
cmp.l 36(%sp),%a0
- jeq .L152
-.L151:
+ jeq .L144
+.L143:
move.l (%sp)+,%d2
moveq #5,%d0
move.l (%sp)+,%a2
lea (20,%sp),%sp
rts
-.L152:
+.L144:
move.l 32(%sp),%d0
move.l (%sp)+,%d2
move.l (%sp)+,%a2
lea (20,%sp),%sp
rts
-.L161:
+.L153:
tst.l 1175351520
- jeq .L149
+ jeq .L141
move.l #1187521622,%a0
move.l (%a0),%d0
add.l #-1073741824,%d0
cmp.l #133169151,%d0
- jhi .L149
+ jhi .L141
tst.b -2147483627.l
- jne .L149
+ jne .L141
move.b 269161679,%d0
move.b 269161676,%d2
move.w %d0,%a1
@@ -1886,10 +1790,10 @@ grain_chooser:
mvz.b %d2,%d1
move.b %d2,19(%sp)
cmp.l %d1,%d0
- jeq .L149
+ jeq .L141
moveq #7,%d0
cmp.l %d1,%d0
- jcs .L149
+ jcs .L141
move.l %a1,%d2
moveq #3,%d0
and.l %d0,%d2
@@ -1908,13 +1812,13 @@ grain_chooser:
move.l 10(%sp),%d1
move.l 14(%sp),%a0
tst.l %d0
- jeq .L149
+ jeq .L141
move.l (%a0),%a1
add.l #585088,%a1
add.l %d2,%a1
lea 34(%a1,%d1.l),%a1
cmp.l 36(%sp),%a1
- jne .L149
+ jne .L141
move.b 19(%sp),%d2
moveq #1,%d0
move.l (%a0),pool_bank
@@ -1924,7 +1828,7 @@ grain_chooser:
move.b %d0,pool_direct
move.b %d2,win_track
move.b %d0,adopted
- jra .L149
+ jra .L141
.size grain_chooser, .-grain_chooser
.align 2
.type grain_pool_left, @function
@@ -1944,11 +1848,11 @@ os_text:
lea (32,%sp),%a6
sub.l %d1,%a1
move.l %d1,%a0
-.L165:
+.L157:
move.l (%a1,%a0.l),%d0
move.l %d0,(%a0)+
cmp.l %a0,%a6
- jne .L165
+ jne .L157
move.l 44(%sp),-(%sp)
pea -1.w
moveq #59,%d0
@@ -1978,19 +1882,19 @@ grain_setup_knob:
move.l %d2,16(%sp)
moveq #1,%d2
cmp.l 16(%sp),%d2
- jcs .L172
+ jcs .L164
move.l #1187521622,%a1
move.l (%a1),%a0
add.l #-1073741824,%a0
cmp.l #133169151,%a0
- jls .L182
-.L172:
+ jls .L174
+.L164:
move.l (%sp)+,%d2
clr.l %d0
move.l (%sp)+,%a2
lea (24,%sp),%sp
rts
-.L182:
+.L174:
moveq #3,%d2
and.l %d1,%d2
move.l (%a1),%a1
@@ -2014,7 +1918,7 @@ grain_setup_knob:
addq.l #8,%sp
move.l 8(%sp),%a1
tst.l %d0
- jeq .L172
+ jeq .L164
move.l 28(%sp),%d0
moveq #30,%d1
move.l 20(%sp),%a0
@@ -2022,9 +1926,9 @@ grain_setup_knob:
add.l #269110990,%a0
muls.l %d1,%d0
cmp.l 36(%sp),%d2
- jeq .L183
+ jeq .L175
add.l #64,%d0
-.L174:
+.L166:
add.l %d0,%a1
move.b (%a1),23(%sp)
add.l %d0,%a0
@@ -2033,9 +1937,9 @@ grain_setup_knob:
and.l %d1,%d0
add.l 40(%sp),%d0
cmp.l %d0,%d1
- jge .L175
+ jge .L167
moveq #127,%d0
-.L176:
+.L168:
moveq #1,%d2
clr.b %d1
move.b %d0,(%a0)
@@ -2068,14 +1972,14 @@ grain_setup_knob:
move.l %d1,(%a0)
moveq #1,%d1
move.l %d1,269452696
-.L184:
+.L176:
move.l (%sp)+,%d2
move.l (%sp)+,%a2
lea (24,%sp),%sp
rts
-.L175:
+.L167:
tst.l %d0
- jge .L176
+ jge .L168
moveq #1,%d2
clr.b %d1
clr.l %d0
@@ -2109,87 +2013,87 @@ grain_setup_knob:
move.l %d1,(%a0)
moveq #1,%d1
move.l %d1,269452696
- jra .L184
-.L183:
+ jra .L176
+.L175:
add.l #63,%d0
- jra .L174
+ jra .L166
.size grain_setup_knob, .-grain_setup_knob
.align 2
.type ptch_step, @function
ptch_step:
move.l %d2,-(%sp)
tst.l 8(%sp)
- jne .L209
+ jne .L201
tst.l 1187503398
- jeq .L188
+ jeq .L180
tst.l 12(%sp)
- jle .L189
+ jle .L181
moveq #63,%d0
cmp.l 16(%sp),%d0
- jlt .L205
+ jlt .L197
moveq #64,%d0
-.L185:
+.L177:
move.l (%sp)+,%d2
rts
-.L188:
+.L180:
moveq #63,%d1
cmp.l 16(%sp),%d1
- jge .L193
+ jge .L185
move.l 16(%sp),%d0
moveq #5,%d2
add.l #-62,%d0
divs.l %d2,%d0
-.L194:
+.L186:
tst.l 1187503662
- jeq .L195
+ jeq .L187
move.l 12(%sp),%d1
lsl.l #3,%d1
sub.l 12(%sp),%d1
move.l %d1,12(%sp)
-.L195:
+.L187:
move.l 12(%sp),%a0
add.l %d0,%a0
lea 64(%a0,%a0.l*4),%a0
moveq #124,%d1
move.l %a0,%d0
cmp.l %a0,%d1
- jlt .L205
-.L196:
+ jlt .L197
+.L188:
moveq #4,%d2
cmp.l %d0,%d2
- jle .L185
-.L203:
+ jle .L177
+.L195:
move.l (%sp)+,%d2
moveq #4,%d0
rts
-.L209:
+.L201:
move.l 16(%sp),%d0
add.l 12(%sp),%d0
move.l (%sp)+,%d2
rts
-.L193:
+.L185:
moveq #66,%d0
moveq #-5,%d2
sub.l 16(%sp),%d0
divs.l %d2,%d0
- jra .L194
-.L189:
+ jra .L186
+.L181:
tst.l 12(%sp)
- jne .L190
+ jne .L182
move.l 16(%sp),%d0
moveq #124,%d1
cmp.l %d0,%d1
- jge .L196
-.L205:
+ jge .L188
+.L197:
move.l (%sp)+,%d2
moveq #124,%d0
rts
-.L190:
+.L182:
moveq #64,%d0
cmp.l 16(%sp),%d0
- jge .L203
+ jge .L195
moveq #64,%d0
- jra .L185
+ jra .L177
.size ptch_step, .-ptch_step
.align 2
.type vfill.part.0, @function
@@ -2199,22 +2103,22 @@ vfill.part.0:
movem.l #252,(%sp)
move.l 40(%sp),%d4
tst.l %d0
- jlt .L221
-.L211:
+ jlt .L213
+.L203:
move.l 36(%sp),%a1
moveq #63,%d1
cmp.l %a1,%d1
- jge .L212
+ jge .L204
move.w #63,%a1
-.L212:
+.L204:
cmp.l %d0,%a1
- jlt .L210
+ jlt .L202
mvs.w 30(%sp),%d3
move.l fbp,%d6
moveq #1,%d5
lsl.l #3,%d3
addq.l #7,%d3
-.L217:
+.L209:
moveq #7,%d1
moveq #7,%d7
or.l %d0,%d1
@@ -2225,9 +2129,9 @@ vfill.part.0:
sub.l %d2,%a0
add.l %d6,%a0
cmp.l %d1,%a1
- jge .L214
+ jge .L206
move.l %a1,%d1
-.L214:
+.L206:
move.l %d1,%d2
sub.l %d0,%d2
addq.l #1,%d2
@@ -2237,29 +2141,29 @@ vfill.part.0:
subq.l #1,%d0
lsl.l %d7,%d0
tst.l %d4
- jeq .L215
+ jeq .L207
or.l %d0,%d2
move.l %d1,%d0
addq.l #1,%d0
move.b %d2,(%a0)
cmp.l %a1,%d0
- jle .L217
-.L210:
+ jle .L209
+.L202:
movem.l (%sp),#252
lea (24,%sp),%sp
rts
-.L215:
+.L207:
not.l %d0
and.l %d0,%d2
move.l %d1,%d0
addq.l #1,%d0
move.b %d2,(%a0)
cmp.l %a1,%d0
- jle .L217
- jra .L210
-.L221:
+ jle .L209
+ jra .L202
+.L213:
clr.l %d0
- jra .L211
+ jra .L203
.size vfill.part.0, .-vfill.part.0
.align 2
.type grain_pool_open, @function
@@ -2271,20 +2175,20 @@ grain_pool_open:
add.l #-1073741824,%d0
move.l %d2,-(%sp)
cmp.l #133169151,%d0
- jhi .L222
+ jhi .L214
tst.b -2147483627.l
- jne .L222
+ jne .L214
tst.l 1175346736
- jne .L222
+ jne .L214
move.l #1175351520,%a1
tst.l (%a1)
- jeq .L230
-.L222:
+ jeq .L222
+.L214:
move.l (%sp)+,%d2
move.l (%sp)+,%a2
lea (16,%sp),%sp
rts
-.L230:
+.L222:
move.b 269161679,%d1
move.b 269161676,%d2
move.l (%a0),%d0
@@ -2306,7 +2210,7 @@ grain_pool_open:
addq.l #8,%sp
move.l 14(%sp),%a0
tst.l %d0
- jeq .L222
+ jeq .L214
move.b 19(%sp),%d2
move.l (%a0),pool_bank
moveq #1,%d0
@@ -2319,9 +2223,9 @@ grain_pool_open:
jsr grain_stock_pool
move.l 10(%sp),%a1
tst.l (%a1)
- jne .L224
+ jne .L216
move.b %d2,pool_direct
-.L224:
+.L216:
pea -1.w
jsr 1074059592
addq.l #4,%sp
@@ -2331,89 +2235,543 @@ grain_pool_open:
rts
.size grain_pool_open, .-grain_pool_open
.align 2
- .type grain_page_any, @function
-grain_page_any:
- lea (-48,%sp),%sp
- movem.l #31996,(%sp)
- move.l #1196573006,%d0
- cmp.l page_built.l,%d0
- jeq .L232
- lea page,%a0
- move.l #1074606454,%a1
- move.l #page+458,%d1
- sub.l %a0,%a1
-.L233:
- move.b (%a1,%a0.l),%d0
- move.b %d0,(%a0)+
- cmp.l %d1,%a0
- jne .L233
- clr.w %d1
- move.l #1196576256,%d2
- move.l #4674113,%a2
- move.l #1314212929,%d0
- move.l %d2,page+60
- move.l %a2,page+64
- move.l %d0,page+68
- lea knobs,%a1
- lea page+150,%a5
- lea page+210,%a4
- lea page+211,%a6
- move.w %d1,page+76
- move.l #1375731712,%d1
- move.l %d1,page+72
-.L245:
- move.b (%a1),%d1
- moveq #11,%d2
- mvz.b %d1,%d4
- cmp.l %d4,%d2
- jcs .L234
- ext.w %d1
- move.b 2(%a1),%d5
- move.b 1(%a1),%d0
- move.l #page+78,%d7
- move.w %d1,%d6
- move.l 10(%a1),%d3
- lea (3,%a1),%a2
- mvz.b %d5,%d2
- move.b %d0,47(%sp)
+ .type turn_eighths.constprop.0, @function
+turn_eighths.constprop.0:
+ move.l %d2,-(%sp)
+ move.l 8(%sp),%d0
+ tst.l 1187503686
+ jeq .L224
+ moveq #56,%d1
+ muls.l %d1,%d0
+ add.l 12(%sp),%d0
+.L225:
+ cmp.l #1023,%d0
+ jle .L231
+ move.l #1023,%d0
+.L232:
+ move.l (%sp)+,%d2
+ rts
+.L231:
+ tst.l %d0
+ jge .L232
+ move.l (%sp)+,%d2
clr.l %d0
- mulu.w #6,%d6
- move.l %d2,%a3
- add.l %d6,%d7
- move.l %d7,%a0
-.L235:
- move.b (%a2,%d0.l),%d2
- jeq .L236
- move.b %d2,(%a0)+
- addq.l #1,%d0
- moveq #5,%d2
- cmp.l %d0,%d2
- jne .L235
-.L236:
+ rts
+.L224:
+ move.l -66600948,%d1
move.l %d0,%a0
- move.l #page+84,%d0
- add.l %d7,%a0
- add.l %d6,%d0
-.L238:
- clr.b (%a0)+
- cmp.l %d0,%a0
- jne .L238
- mvz.w %d1,%d1
- move.b 47(%sp),%d0
- lsl.l #2,%d1
- move.b %d0,(%a5,%d4.l)
- clr.l %d0
- move.l %d1,%a0
- add.l #page,%a0
- lea (162,%a0),%a2
-.L240:
- clr.b %d2
- move.b %d2,(%a2,%d0.l)
- addq.l #1,%d0
- moveq #4,%d2
- cmp.l %d0,%d2
- jne .L240
- clr.b %d0
+ move.l (last.1),%a1
+ move.l %d1,(last.1)
+ tst.l %d0
+ jlt .L235
+ moveq #1,%d2
+ cmp.l %a0,%d2
+ jge .L226
+.L229:
+ lsl.l #4,%d0
+.L228:
+ add.l 12(%sp),%d0
+ jra .L225
+.L226:
+ sub.l %a1,%d1
+ cmp.l #1583999,%d1
+ jls .L229
+ cmp.l #3959999,%d1
+ jhi .L230
+ lsl.l #3,%d0
+ add.l 12(%sp),%d0
+ jra .L225
+.L235:
+ move.l %d0,%d2
+ neg.l %d2
+ move.l %d2,%a0
+ moveq #1,%d2
+ cmp.l %a0,%d2
+ jlt .L229
+ jra .L226
+.L230:
+ cmp.l #9239999,%d1
+ jhi .L228
+ add.l %d0,%d0
+ add.l 12(%sp),%d0
+ jra .L225
+ .size turn_eighths.constprop.0, .-turn_eighths.constprop.0
+ .align 2
+ .type pos_step, @function
+pos_step:
+ lea (-60,%sp),%sp
+ movem.l #1036,(%sp)
+ move.l #1187521622,%a0
+ moveq #1,%d2
+ move.b 269161676,%d0
+ move.b 269161679,%d1
+ move.w %d0,%a1
+ move.l (%a0),%d0
+ cmp.l 64(%sp),%d2
+ jne .L237
+ move.l (%a0),%a0
+ add.l #-1073741824,%a0
+ cmp.l #133169151,%a0
+ jls .L277
+.L237:
+ move.l 72(%sp),%d0
+ add.l 68(%sp),%d0
+.L236:
+ movem.l (%sp),#1036
+ lea (60,%sp),%sp
+ rts
+.L277:
+ moveq #3,%d3
+ add.l #585088,%d0
+ and.l %d3,%d1
+ moveq #7,%d3
+ move.l %a1,%d2
+ and.l %d3,%d2
+ move.l %d2,-(%sp)
+ move.l %a1,%d2
+ and.l %d3,%d2
+ move.l #6322,%d3
+ muls.l %d1,%d3
+ add.l %d3,%d0
+ move.l %d2,32(%sp)
+ move.l %d3,28(%sp)
+ move.l %d0,40(%sp)
+ move.l %d0,-(%sp)
+ jsr ours
+ addq.l #8,%sp
+ tst.l %d0
+ jeq .L237
+ tst.w 1175263050.l
+ jeq .L240
+ move.l 1175263018,%d1
+ move.l %d1,48(%sp)
+ tst.l %d1
+ jne .L240
+ move.l #1175263052,%a0
+ moveq #48,%d2
+ cmp.l (%a0),%d2
+ jcc .L241
+ mvz.w (%a0),%d0
+ cmp.l %d0,%d2
+ jcs .L240
+.L241:
+ mvz.w 1175263050,%d3
+ move.l -66600948,%d1
+ move.l #1175263052,%a0
+ move.l (%a0),32(%sp)
+ moveq #48,%d0
+ move.l %d3,40(%sp)
+ cmp.l 32(%sp),%d0
+ jcc .L242
+ move.w (%a0),%d0
+ move.l %d0,32(%sp)
+.L242:
+ move.l %d1,%d0
+ sub.l (burst_at.4),%d0
+ cmp.l #396000,%d0
+ jhi .L243
+ move.l (done.3),%a0
+ move.l %a0,%d0
+ not.l %d0
+ and.l 40(%sp),%d0
+ tst.l %d0
+ jeq .L243
+ move.l %d0,40(%sp)
+ move.b 31(%sp),%d0
+ move.l 36(%sp),%a2
+ move.l %a0,48(%sp)
+ move.w #15,%a1
+ move.l %d1,(burst_at.4)
+ moveq #-1,%d1
+ move.l %d1,28(%sp)
+ ext.w %d0
+ move.w %d0,%d2
+ mulu.w #2330,%d0
+ move.l %d0,44(%sp)
+ mulu.w #30,%d2
+ move.l %d2,%a0
+ lea 49(%a0,%a2.l),%a0
+ move.l %d2,56(%sp)
+ move.l %a0,52(%sp)
+.L247:
+ move.l 40(%sp),%d0
+ move.l %a1,%d1
+ lsr.l %d1,%d0
+ moveq #63,%d2
+ move.l %d0,24(%sp)
+ move.l 24(%sp),%d3
+ move.l 32(%sp),%d0
+ add.l %a1,%d0
+ and.l %d2,%d0
+ btst #0,%d3
+ jeq .L245
+ move.l 1187521622,%a0
+ moveq #15,%d2
+ move.b 269161680,%d1
+ move.l 44(%sp),%a2
+ move.l #36568,%d3
+ lsl.l #5,%d0
+ lea 90(%a0,%a2.l),%a0
+ and.l %d2,%d1
+ muls.l %d3,%d1
+ add.l %d1,%a0
+ mvz.b (%a0,%d0.l),%d0
+ cmp.l #255,%d0
+ jeq .L278
+ cmp.l 72(%sp),%d0
+ jeq .L279
+.L245:
+ subq.l #1,%a1
+ moveq #-1,%d0
+ cmp.l %a1,%d0
+ jne .L247
+ tst.l 28(%sp)
+ jge .L248
+ moveq #15,%d1
+ move.l %d1,28(%sp)
+.L249:
+ move.l 24(%sp),%d2
+ move.l 28(%sp),%d3
+ btst %d3,%d2
+ jeq .L280
+.L248:
+ move.b 269161680,%d1
+ move.l 28(%sp),%d0
+ moveq #63,%d2
+ move.l #36568,%d3
+ move.l #1187521622,%a1
+ add.l 32(%sp),%d0
+ move.l (%a1),%a0
+ and.l %d2,%d0
+ moveq #15,%d2
+ and.l %d2,%d1
+ lea (17,%a0),%a0
+ moveq #7,%d2
+ move.l %a0,24(%sp)
+ move.l 44(%sp),%a0
+ move.l 24(%sp),%a2
+ lsl.l #5,%d0
+ muls.l %d3,%d1
+ add.l %d1,%a0
+ add.l %d0,%a0
+ move.l %a0,%d1
+ add.l #89,%d1
+ mvz.b (%a2,%d1.l),%d0
+ add.l #-119,%d0
+ cmp.l %d0,%d2
+ jcc .L252
+ move.l (%a1),%a1
+ addq.l #1,%a1
+ mvz.b (%a1,%d1.l),%d0
+ cmp.l #255,%d0
+ jeq .L251
+ clr.l %d0
+.L252:
+ move.l 72(%sp),%d1
+ lsl.l #3,%d1
+ move.l %d1,%a1
+ add.l %d0,%a1
+ tst.l 48(%sp)
+ jeq .L281
+ move.l %a1,%d1
+ add.l (moved.2),%d1
+ cmp.l #1023,%d1
+ jle .L255
+ move.l #1023,%d1
+.L254:
+ move.w #1,%a1
+ move.l 28(%sp),%d2
+ move.l %d1,%d0
+ move.l #268526008,%a2
+ asr.l #3,%d0
+ add.l %a0,%a2
+ move.l %a1,%d3
+ lsl.l %d2,%d3
+ move.l %d3,%a1
+ move.l %a1,%d2
+ or.l 48(%sp),%d2
+ moveq #7,%d3
+ and.l %d3,%d1
+ moveq #1,%d3
+ move.l %d2,(done.3)
+ move.l 1187521622,%a1
+ add.l #119,%d1
+ move.b %d1,106(%a0,%a1.l)
+ move.b %d1,(%a2)
+ add.l #635698,%a1
+ moveq #1,%d1
+ move.l %d1,(%a1)
+ move.l %d3,269452696
+.L283:
+ movem.l (%sp),#1036
+ lea (60,%sp),%sp
+ rts
+.L240:
+ tst.w 1175263050.l
+ jne .L257
+ tst.l 1175263018
+ jeq .L258
+.L257:
+ tst.l 1187503686
+ jeq .L259
+ move.l 68(%sp),%d0
+ lsl.l #3,%d0
+ sub.l 68(%sp),%d0
+ move.l %d0,68(%sp)
+.L259:
+ move.l 72(%sp),%d0
+ moveq #127,%d1
+ add.l 68(%sp),%d0
+ cmp.l %d0,%d1
+ jlt .L282
+ tst.l %d0
+ jge .L236
+ movem.l (%sp),#1036
+ clr.l %d0
+ lea (60,%sp),%sp
+ rts
+.L282:
+ movem.l (%sp),#1036
+ moveq #127,%d0
+ lea (60,%sp),%sp
+ rts
+.L258:
+ move.b 31(%sp),%d1
+ move.l 36(%sp),%a1
+ move.l 72(%sp),%d0
+ lsl.l #3,%d0
+ ext.w %d1
+ move.w %d1,%d2
+ mulu.w #30,%d2
+ move.l %d2,%a0
+ lea (485,%a0),%a0
+ add.l %a0,%a1
+ move.b (%a1),%d2
+ move.l %a1,20(%sp)
+ move.l %a0,28(%sp)
+ move.w %d2,%a1
+ moveq #7,%d2
+ move.l %a1,%d3
+ and.l %d2,%d3
+ move.l %d3,%a1
+ pea (%a1,%d0.l)
+ move.l 72(%sp),-(%sp)
+ move.l %d1,24(%sp)
+ jsr (turn_eighths.constprop.0)
+ move.l 24(%sp),%d1
+ move.l %d0,%a0
+ move.l %a0,%d3
+ and.l %d2,%d3
+ move.l 32(%sp),%a1
+ addq.l #8,%sp
+ mulu.w #72,%d1
+ add.l #269110990,%a1
+ move.l 20(%sp),%a2
+ asr.l #3,%d0
+ add.l #-2147481547,%d1
+ move.b %d3,%d2
+ move.b %d3,(%a2)
+ move.l 28(%sp),%d3
+ move.b %d2,(%a1,%d3.l)
+ move.l %d1,%a1
+ move.b %d2,(%a1)
+ movem.l (%sp),#1036
+ lea (60,%sp),%sp
+ rts
+.L280:
+ subq.l #1,%d3
+ move.l %d3,28(%sp)
+ addq.l #1,%d3
+ tst.l %d3
+ jne .L249
+ movem.l (%sp),#1036
+ move.l 72(%sp),%d0
+ lea (60,%sp),%sp
+ rts
+.L278:
+ move.l 52(%sp),%a0
+ mvz.b (%a0),%d0
+ cmp.l 72(%sp),%d0
+ jne .L245
+.L279:
+ move.l %a1,28(%sp)
+ jra .L245
+.L243:
+ move.b 31(%sp),%d0
+ move.l 36(%sp),%a2
+ move.l %d1,(burst_at.4)
+ moveq #-1,%d1
+ move.w #15,%a1
+ clr.l (done.3)
+ move.l %d1,28(%sp)
+ ext.w %d0
+ move.w %d0,%d2
+ mulu.w #2330,%d0
+ move.l %d0,44(%sp)
+ mulu.w #30,%d2
+ move.l %d2,%a0
+ lea 49(%a0,%a2.l),%a0
+ move.l %d2,56(%sp)
+ move.l %a0,52(%sp)
+ jra .L247
+.L255:
+ tst.l %d1
+ jge .L254
+ move.w #1,%a1
+ move.l 28(%sp),%d2
+ clr.l %d1
+ move.l %d1,%d0
+ move.l #268526008,%a2
+ add.l %a0,%a2
+ move.l %a1,%d3
+ asr.l #3,%d0
+ lsl.l %d2,%d3
+ move.l %d3,%a1
+ move.l %a1,%d2
+ or.l 48(%sp),%d2
+ moveq #7,%d3
+ and.l %d3,%d1
+ moveq #1,%d3
+ move.l %d2,(done.3)
+ move.l 1187521622,%a1
+ add.l #119,%d1
+ move.b %d1,106(%a0,%a1.l)
+ move.b %d1,(%a2)
+ add.l #635698,%a1
+ moveq #1,%d1
+ move.l %d1,(%a1)
+ move.l %d3,269452696
+ jra .L283
+.L281:
+ move.l %a1,-(%sp)
+ move.l #268526008,%a2
+ move.l 72(%sp),-(%sp)
+ move.l %a1,24(%sp)
+ move.l %a0,20(%sp)
+ jsr (turn_eighths.constprop.0)
+ move.l 24(%sp),%a1
+ addq.l #8,%sp
+ move.l %d0,%d2
+ sub.l %a1,%d2
+ move.w #1,%a1
+ move.l %d2,(moved.2)
+ move.l 28(%sp),%d2
+ move.l %d0,%d1
+ move.l %d1,%d0
+ asr.l #3,%d0
+ move.l %a1,%d3
+ lsl.l %d2,%d3
+ move.l 12(%sp),%a0
+ add.l %a0,%a2
+ move.l %d3,%a1
+ move.l %a1,%d2
+ or.l 48(%sp),%d2
+ moveq #7,%d3
+ and.l %d3,%d1
+ moveq #1,%d3
+ move.l %d2,(done.3)
+ move.l 1187521622,%a1
+ add.l #119,%d1
+ move.b %d1,106(%a0,%a1.l)
+ move.b %d1,(%a2)
+ add.l #635698,%a1
+ moveq #1,%d1
+ move.l %d1,(%a1)
+ move.l %d3,269452696
+ jra .L283
+.L251:
+ move.l 56(%sp),%a1
+ moveq #7,%d1
+ move.l 36(%sp),%a2
+ lea (485,%a1),%a1
+ move.b (%a2,%a1.l),%d0
+ and.l %d1,%d0
+ jra .L252
+ .size pos_step, .-pos_step
+ .align 2
+ .type grain_page_any, @function
+grain_page_any:
+ lea (-48,%sp),%sp
+ movem.l #31996,(%sp)
+ move.l #1196573006,%d0
+ cmp.l page_built.l,%d0
+ jeq .L285
+ lea page,%a0
+ move.l #1074606454,%a1
+ move.l #page+458,%d1
+ sub.l %a0,%a1
+.L286:
+ move.b (%a1,%a0.l),%d0
+ move.b %d0,(%a0)+
+ cmp.l %d1,%a0
+ jne .L286
+ clr.w %d1
+ move.l #1196576256,%d2
+ move.l #4674113,%a2
+ move.l #1314212929,%d0
+ move.l %d2,page+60
+ move.l %a2,page+64
+ move.l %d0,page+68
+ lea knobs,%a1
+ lea page+150,%a5
+ lea page+210,%a4
+ lea page+211,%a6
+ move.w %d1,page+76
+ move.l #1375731712,%d1
+ move.l %d1,page+72
+.L298:
+ move.b (%a1),%d1
+ moveq #11,%d2
+ mvz.b %d1,%d4
+ cmp.l %d4,%d2
+ jcs .L287
+ ext.w %d1
+ move.b 2(%a1),%d5
+ move.b 1(%a1),%d0
+ move.l #page+78,%d7
+ move.w %d1,%d6
+ move.l 10(%a1),%d3
+ lea (3,%a1),%a2
+ mvz.b %d5,%d2
+ move.b %d0,47(%sp)
+ clr.l %d0
+ mulu.w #6,%d6
+ move.l %d2,%a3
+ add.l %d6,%d7
+ move.l %d7,%a0
+.L288:
+ move.b (%a2,%d0.l),%d2
+ jeq .L289
+ move.b %d2,(%a0)+
+ addq.l #1,%d0
+ moveq #5,%d2
+ cmp.l %d0,%d2
+ jne .L288
+.L289:
+ move.l %d0,%a0
+ move.l #page+84,%d0
+ add.l %d7,%a0
+ add.l %d6,%d0
+.L291:
+ clr.b (%a0)+
+ cmp.l %d0,%a0
+ jne .L291
+ mvz.w %d1,%d1
+ move.b 47(%sp),%d0
+ lsl.l #2,%d1
+ move.b %d0,(%a5,%d4.l)
+ clr.l %d0
+ move.l %d1,%a0
+ add.l #page,%a0
+ lea (162,%a0),%a2
+.L293:
+ clr.b %d2
+ move.b %d2,(%a2,%d0.l)
+ addq.l #1,%d0
+ moveq #4,%d2
+ cmp.l %d0,%d2
+ jne .L293
+ clr.b %d0
lea page+212,%a2
move.b %d0,(%a4,%d1.l)
move.b %d0,(%a6,%d1.l)
@@ -2421,8 +2779,8 @@ grain_page_any:
lea page+213,%a2
move.b %d5,(%a2,%d1.l)
tst.l %d3
- jeq .L260
-.L242:
+ jeq .L313
+.L295:
move.l %d3,%d2
moveq #24,%d0
clr.w %d2
@@ -2443,8 +2801,8 @@ grain_page_any:
moveq #3,%d2
subq.l #2,%d0
cmp.l %d0,%d2
- jcs .L247
-.L262:
+ jcs .L300
+.L315:
lea (step.0),%a2
mvz.w (%a2,%d0.l*2),%d2
moveq #24,%d0
@@ -2466,18 +2824,18 @@ grain_page_any:
move.b %d2,(%a2,%d1.l)
lea page+307,%a2
move.b %d3,(%a2,%d1.l)
-.L244:
+.L297:
clr.b %d1
moveq #4,%d2
move.b %d1,(%a0,%d0.l)
addq.l #1,%d0
cmp.l %d0,%d2
- jne .L244
-.L234:
+ jne .L297
+.L287:
lea (14,%a1),%a1
cmp.l #knobs+168,%a1
- jne .L245
- clr.b %d0
+ jne .L298
+ moveq #5,%d0
moveq #17,%d1
move.w #5393,%d2
lea pos_step,%a2
@@ -2494,15 +2852,15 @@ grain_page_any:
move.l %d1,page+162
move.l %d2,page+334
move.l %d2,page+338
-.L232:
+.L285:
move.l #page+56,%d0
movem.l (%sp),#31996
lea (48,%sp),%sp
rts
-.L260:
+.L313:
moveq #2,%d0
cmp.l %a3,%d0
- jeq .L261
+ jeq .L314
clr.l %d3
move.l %d3,%d2
moveq #24,%d0
@@ -2524,8 +2882,8 @@ grain_page_any:
moveq #3,%d2
subq.l #2,%d0
cmp.l %d0,%d2
- jcc .L262
-.L247:
+ jcc .L315
+.L300:
clr.l %d2
moveq #24,%d0
move.l %d2,%d3
@@ -2545,10 +2903,10 @@ grain_page_any:
move.b %d2,(%a2,%d1.l)
lea page+307,%a2
move.b %d3,(%a2,%d1.l)
- jra .L244
-.L261:
+ jra .L297
+.L314:
move.l #1073987916,%d3
- jra .L242
+ jra .L295
.size grain_page_any, .-grain_page_any
.align 2
.type grain_page, @function
@@ -2569,192 +2927,181 @@ grain_setup_page:
.align 2
.type mix_other.constprop.0, @function
mix_other.constprop.0:
- link.w %fp,#-136
+ link.w %fp,#-116
move.l 36(%fp),%a1
movem.l #15612,(%sp)
move.l 8(%fp),%a5
tst.l %a1
- jeq .L267
- tst.l 20(%fp)
- sne %d0
+ jeq .L320
+ move.l %a1,%d0
+ move.l %a5,%a4
+ add.l %d0,%d0
lea (192,%a5),%a0
- move.l %a0,-38(%fp)
- move.l %a5,%a2
- move.l %a1,%d4
- neg.l %d0
- move.b %d0,-29(%fp)
- mvz.b %d0,%d0
- move.l %d0,-34(%fp)
-.L328:
- move.l 8(%a2),%d0
+ move.l %a0,-36(%fp)
+ move.l %a5,-68(%fp)
+ subq.l #1,%d0
+ move.l %d0,-32(%fp)
+.L387:
+ move.l 8(%a4),%d0
tst.l %d0
- jeq .L269
- move.l 20(%a2),%d6
- clr.l 20(%a2)
- cmp.l 32(%fp),%d6
- jcs .L270
- sub.l 32(%fp),%d6
- move.l %d6,20(%a2)
-.L269:
- lea (32,%a2),%a2
- cmp.l -38(%fp),%a2
- jne .L328
-.L267:
- movem.l -136(%fp),#15612
+ jeq .L322
+ move.l 20(%a4),%d7
+ clr.l 20(%a4)
+ cmp.l 32(%fp),%d7
+ jcs .L323
+ sub.l 32(%fp),%d7
+ move.l %d7,20(%a4)
+.L322:
+ lea (32,%a4),%a4
+ cmp.l -36(%fp),%a4
+ jne .L387
+.L320:
+ movem.l -116(%fp),#15612
unlk %fp
rts
-.L270:
+.L323:
move.l 32(%fp),%d1
- sub.l %d6,%d1
- move.l %d1,-74(%fp)
+ sub.l %d7,%d1
+ move.l %d1,-56(%fp)
cmp.l %d1,%d0
- jcc .L271
- move.l %d0,-74(%fp)
-.L271:
- sub.l -74(%fp),%d0
- move.l %d0,8(%a2)
- tst.l 24(%a2)
- jeq .L331
- mvz.b -29(%fp),%d0
+ jcc .L324
+ move.l %d0,-56(%fp)
+.L324:
+ sub.l -56(%fp),%d0
+ move.l %d0,8(%a4)
+ tst.l 24(%a4)
+ jeq .L390
+ tst.l 20(%fp)
+ sne %d0
+ move.l -68(%fp),%a0
+ move.l %a1,%d5
move.l 20(%fp),%d2
neg.l %d2
- move.l %d2,%a1
- move.l %a1,%a3
- move.l 16(%fp),%d1
- neg.l %d1
- move.l -34(%fp),%d2
- sub.l %d0,%d1
- move.l %d1,-46(%fp)
- move.l -46(%fp),%a4
- add.l -46(%fp),%d2
- move.l -46(%fp),%d3
- neg.l %d3
- move.l %d3,-54(%fp)
- move.l -46(%fp),%d5
- addq.l #4,%d5
- move.l %d2,-50(%fp)
- move.l %d5,-42(%fp)
- move.l %a2,-20(%fp)
-.L327:
- move.l -20(%fp),%a0
- move.l 4(%a0),%d1
- move.l 12(%a0),%d2
- move.l (%a0),%d3
- move.l 16(%a0),%a1
- move.l %d1,-78(%fp)
- move.l %d2,-82(%fp)
- cmp.l %d3,%d4
- jhi .L273
- moveq #8,%d5
- cmp.l -42(%fp),%d5
- jcc .L364
-.L275:
- move.l -20(%fp),%a0
- move.l 28(%a0),%d0
+ move.l %d2,%a5
+ move.l %a0,-16(%fp)
+ mvs.b %d0,%d0
+ move.l %d0,%a3
+ sub.l 16(%fp),%a3
+.L386:
+ move.l 4(%a4),%d1
+ move.l 12(%a4),%d2
+ move.l (%a4),%d3
+ move.l 16(%a4),%a1
+ move.l %d1,-64(%fp)
+ move.l %d2,-60(%fp)
+ cmp.l %d3,%d5
+ jhi .L326
+ move.l %a3,%d0
+ moveq #8,%d4
+ addq.l #4,%d0
+ cmp.l %d0,%d4
+ jcc .L430
+.L328:
+ move.l 28(%a4),%d0
move.l %d0,%d1
neg.l %d1
move.l %d1,%d2
- jpl .L374
+ jpl .L440
addq.l #1,%d2
-.L374:
+.L440:
asr.l #1,%d2
- move.l %d2,-66(%fp)
+ move.l %d2,-48(%fp)
tst.l %d0
- jlt .L365
+ jlt .L431
move.l %d0,%d0
- jpl .L375
+ jpl .L441
addq.l #1,%d0
-.L375:
- move.l -74(%fp),%d1
- move.l #32768,%d2
- clr.l -74(%fp)
- move.l %d1,-70(%fp)
+.L441:
+ move.l -56(%fp),%d2
+ move.l #32768,%d4
+ clr.l -56(%fp)
+ move.l %d2,-52(%fp)
asr.l #1,%d0
- sub.l %d0,%d2
- move.l %d2,-62(%fp)
-.L292:
- move.l -70(%fp),%d7
- add.l %d6,%d7
+ sub.l %d0,%d4
+ move.l %d4,-44(%fp)
+.L345:
+ move.l -52(%fp),%d6
+ add.l %d7,%d6
cmp.l %d6,%d7
- jls .L314
- move.l %d6,%d0
- move.l %a1,-28(%fp)
+ jcc .L367
+ move.l %d7,%d0
+ move.l %a4,-40(%fp)
lsl.l #3,%d0
- move.l -20(%fp),%a0
- move.l -78(%fp),%d2
- move.l -82(%fp),%d5
- move.l %a0,-58(%fp)
+ move.l -64(%fp),%d2
+ move.l %a1,%a4
+ move.l -60(%fp),%d4
move.l %d0,%a2
add.l 28(%fp),%a2
- cmp.l %d4,%d3
- jcs .L366
-.L315:
- move.l %a3,%d0
- add.l %d2,%d0
- cmp.l %d0,%d2
- shi %d2
- add.l %a4,%d3
- add.l -28(%fp),%d5
- addq.l #1,%d6
+ cmp.l %d5,%d3
+ jcs .L432
+.L368:
+ move.l %d2,%d0
+ add.l %a5,%d0
+ cmp.l %d2,%d0
+ scs %d2
+ add.l %a3,%d3
+ add.l %a4,%d4
+ addq.l #1,%d7
addq.l #8,%a2
mvs.b %d2,%d2
sub.l %d2,%d3
- cmp.l %d7,%d6
- jcc .L367
-.L333:
+ cmp.l %d6,%d7
+ jcc .L433
+.L393:
move.l %d0,%d2
- cmp.l %d4,%d3
- jcc .L315
-.L366:
+ cmp.l %d5,%d3
+ jcc .L368
+.L432:
+ move.l -16(%fp),%a0
move.l %d3,%d1
- sub.l 196(%a5),%d1
- cmp.l 200(%a5),%d1
- jcc .L316
- move.l 192(%a5),%a1
- move.l %a1,-24(%fp)
-.L317:
+ sub.l 196(%a0),%d1
+ cmp.l 200(%a0),%d1
+ jcc .L369
+ move.l 192(%a0),%a1
+ move.l %a1,-28(%fp)
+.L370:
move.l 12(%fp),%a0
mvz.b 4(%a0),%d0
move.l %d0,%a1
mvz.b 5(%a0),%d0
- move.l -24(%fp),%a0
- move.l %d0,-86(%fp)
+ move.l -28(%fp),%a0
+ move.l %d0,-68(%fp)
move.w %a1,%d0
- mulu.w -84(%fp),%d0
+ mulu.w -66(%fp),%d0
muls.l %d0,%d1
moveq #1,%d0
add.l %d1,%a0
mvs.w (%a0),%d1
- move.l %d1,-24(%fp)
- cmp.l -86(%fp),%d0
- jcc .L322
+ move.l %d1,-28(%fp)
+ cmp.l -68(%fp),%d0
+ jcc .L375
mvz.b (%a0,%a1.l),%d0
mvz.b 1(%a0,%a1.l),%d1
lsl.l #8,%d0
or.l %d1,%d0
mvs.w %d0,%d1
- move.l -24(%fp),%d0
+ move.l -28(%fp),%d0
add.l %d1,%d0
asr.l #1,%d0
- move.l %d0,-24(%fp)
-.L322:
+ move.l %d0,-28(%fp)
+.L375:
moveq #15,%d0
- add.l %a4,%d3
- move.l %d5,%d1
+ add.l %a3,%d3
+ move.l %d4,%d1
lsr.l %d0,%d1
move.l 24(%fp),%a0
- addq.l #1,%d6
- move.l -24(%fp),%d0
+ add.l %a4,%d4
+ addq.l #1,%d7
+ move.l -28(%fp),%d0
and.l #510,%d1
- add.l -28(%fp),%d5
mvz.w (%a0,%d1.l),%d1
muls.l %d1,%d0
moveq #15,%d1
asr.l %d1,%d0
- move.l -62(%fp),%d1
+ move.l -44(%fp),%d1
muls.l %d0,%d1
move.l %d1,%a1
- move.l -66(%fp),%d1
+ move.l -48(%fp),%d1
muls.l %d1,%d0
moveq #15,%d1
move.l %d0,%a0
@@ -2766,146 +3113,161 @@ mix_other.constprop.0:
move.l %a1,%d1
add.l %d1,(%a2)
add.l %d0,4(%a2)
- move.l %a3,%d0
- add.l %d2,%d0
+ move.l %d2,%d0
+ add.l %a5,%d0
addq.l #8,%a2
- cmp.l %d0,%d2
- shi %d2
+ cmp.l %d2,%d0
+ scs %d2
mvs.b %d2,%d2
sub.l %d2,%d3
- cmp.l %d7,%d6
- jcs .L333
-.L367:
- move.l -70(%fp),%d0
- move.l %a3,%d1
+ cmp.l %d6,%d7
+ jcs .L393
+.L433:
+ move.l -52(%fp),%d0
+ move.l %a5,%d1
subq.l #1,%d0
- muls.l %d0,%d1
- move.l -28(%fp),%a1
+ move.l %a4,%a1
move.l %a1,%d2
+ muls.l %d0,%d1
muls.l %d2,%d0
- move.l -58(%fp),%a0
- add.l -82(%fp),%a1
- move.l %a0,-20(%fp)
- move.l -78(%fp),%a0
- add.l %a3,%a0
+ add.l -60(%fp),%a1
+ move.l -64(%fp),%a0
+ add.l %a5,%a0
+ move.l -40(%fp),%a4
add.l %a0,%d1
add.l %a1,%d0
- move.l %d1,-78(%fp)
- move.l %d0,-82(%fp)
-.L314:
- move.l -20(%fp),%a0
- move.l %d7,%d6
- move.l -78(%fp),%d1
- move.l %d3,(%a0)
- move.l %d1,4(%a0)
-.L310:
- move.l -20(%fp),%a0
- move.l -82(%fp),%a1
- move.l (%a0),%d0
- move.l %a1,12(%a0)
- cmp.l %d4,%d0
- jcs .L324
- tst.l %a4
- jlt .L325
- remu.l %d4,%d1:%d0
- move.l %d1,(%a0)
-.L324:
- tst.l -74(%fp)
- jne .L327
-.L372:
- move.l -20(%fp),%a2
- lea (32,%a2),%a2
- cmp.l -38(%fp),%a2
- jne .L328
- jra .L267
-.L365:
+ move.l %d1,-64(%fp)
+ move.l %d0,-60(%fp)
+.L367:
+ move.l -64(%fp),%d4
+ move.l %d6,%d7
+ move.l %d3,(%a4)
+ move.l %d4,4(%a4)
+.L363:
+ move.l -60(%fp),%d6
+ move.l (%a4),%d0
+ move.l %d6,12(%a4)
+ cmp.l %d5,%d0
+ jcs .L377
+ move.l -16(%fp),%a0
+ moveq #3,%d2
+ mvz.b 242(%a0),%d1
+ cmp.l %d1,%d2
+ jeq .L338
+ subq.l #2,%d1
+ tst.l %d1
+ jeq .L377
+ tst.l %a3
+ jlt .L383
+ remu.l %d5,%d1:%d0
+ move.l %d1,(%a4)
+.L377:
+ tst.l -56(%fp)
+ jne .L386
+.L438:
+ move.l -16(%fp),%a1
+ lea (32,%a4),%a4
+ move.l %a1,-68(%fp)
+ move.l %d5,%a1
+ cmp.l -36(%fp),%a4
+ jne .L387
+ jra .L320
+.L431:
move.l %d1,%d0
- move.l #32768,%d2
+ move.l #32768,%d4
move.l %d0,%d0
- jpl .L376
+ jpl .L442
addq.l #1,%d0
-.L376:
- move.l -74(%fp),%d1
- clr.l -74(%fp)
- move.l %d1,-70(%fp)
+.L442:
+ move.l -56(%fp),%d2
+ clr.l -56(%fp)
+ move.l %d2,-52(%fp)
asr.l #1,%d0
- sub.l %d0,%d2
- move.l %d2,-62(%fp)
- jra .L292
-.L364:
- move.l %a4,%d1
- tst.l %a4
- jlt .L368
- move.l -74(%fp),%d5
+ sub.l %d0,%d4
+ move.l %d4,-44(%fp)
+ jra .L345
+.L430:
+ move.l %a3,%d1
+ tst.l %a3
+ jlt .L434
+ move.l -56(%fp),%d2
addq.l #1,%d1
move.l %d3,%d0
not.l %d0
- muls.l %d5,%d1
+ muls.l %d2,%d1
cmp.l %d0,%d1
sls %d0
neg.l %d0
tst.b %d0
- jeq .L275
-.L373:
- move.l %a3,%d1
- move.l %a3,%d0
- move.l %d3,-70(%fp)
- mvz.w %d1,%d1
- move.l -74(%fp),%d3
- move.l %d3,%d5
- move.l -46(%fp),%d7
- move.l -78(%fp),%d2
- muls.l %d3,%d7
- move.l %a1,%d3
- muls.l %d3,%d5
- mvz.w %d2,%d2
- move.l -74(%fp),%d3
- clr.w %d0
- swap %d0
- move.l -78(%fp),%d6
- muls.l %d3,%d1
- move.l -20(%fp),%a2
- clr.w %d6
- swap %d6
- add.l -82(%fp),%d5
- move.l -70(%fp),%a0
- add.l %d7,%a0
- add.l %d2,%d1
+ jeq .L328
+.L439:
+ move.l -56(%fp),%d6
+ move.l %a1,%d0
+ move.l -56(%fp),%d2
+ move.l %a5,%d1
+ mvz.w %d1,%d1
+ muls.l %d0,%d6
+ move.l %a3,%d0
+ muls.l %d2,%d0
+ move.l -64(%fp),%d4
+ mvz.w %d4,%d4
+ add.l -60(%fp),%d6
+ add.l %d3,%d0
+ move.l %a5,%d3
+ clr.w %d3
+ swap %d3
+ muls.l %d2,%d1
+ move.l %d6,12(%a4)
+ move.l %d4,%a0
+ move.l -64(%fp),%d4
+ add.l %a0,%d1
+ muls.l %d2,%d3
move.l %d1,%d2
+ clr.w %d4
+ swap %d4
clr.w %d2
swap %d2
- muls.l %d3,%d0
mvz.w %d1,%d1
- move.l %d5,12(%a2)
- add.l %d6,%d0
- add.l %d2,%d0
- move.l %d0,%d2
- swap %d0
- clr.w %d0
+ add.l %d4,%d3
+ add.l %d2,%d3
+ move.l %d3,%d2
+ swap %d3
+ clr.w %d3
clr.w %d2
swap %d2
- or.l %d1,%d0
- add.l %a0,%d2
- move.l %d2,(%a2)
- move.l %d0,4(%a2)
- cmp.l %d4,%d2
- jcs .L269
- tst.l -46(%fp)
- jlt .L285
- remu.l %d4,%d0:%d2
- lea (32,%a2),%a2
- move.l %d0,-32(%a2)
- cmp.l -38(%fp),%a2
- jne .L328
- jra .L267
-.L316:
+ or.l %d1,%d3
+ add.l %d2,%d0
+ move.l %d0,(%a4)
+ move.l %d3,4(%a4)
+ cmp.l %d5,%d0
+ jcs .L425
+ move.l -16(%fp),%a0
+ moveq #3,%d2
+ add.l -56(%fp),%d7
+ mvz.b 242(%a0),%d1
+ cmp.l %d1,%d2
+ jeq .L391
+ subq.l #2,%d1
+ tst.l %d1
+ jeq .L426
+ tst.l %a3
+ jlt .L339
+ remu.l %d5,%d1:%d0
+ move.l %a0,-68(%fp)
+ move.l %d5,%a1
+ lea (32,%a4),%a4
+ move.l %d1,-32(%a4)
+ cmp.l -36(%fp),%a4
+ jne .L387
+ jra .L320
+.L369:
move.l 12(%fp),%a1
clr.l -8(%fp)
move.l 6(%a1),%a0
move.l 10(%a1),%d0
move.l (%a1),-4(%fp)
tst.l %a0
- jeq .L318
+ jeq .L371
pea -4(%fp)
pea -8(%fp)
move.l %d3,-(%sp)
@@ -2913,196 +3275,205 @@ mix_other.constprop.0:
jsr (%a0)
lea (16,%sp),%sp
move.l -8(%fp),%a0
- move.l %d0,-24(%fp)
-.L319:
- move.l -24(%fp),%d0
- move.l %a0,196(%a5)
- move.l %d0,192(%a5)
+ move.l %d0,-28(%fp)
+.L372:
+ move.l -16(%fp),%a1
+ move.l -28(%fp),%d0
+ move.l %a0,196(%a1)
+ move.l %d0,192(%a1)
tst.l %d0
- jeq .L320
+ jeq .L373
move.l %d3,%d1
sub.l %a0,%d1
move.l -4(%fp),%a1
- move.l %a1,200(%a5)
+ move.l -16(%fp),%a0
+ move.l %a1,200(%a0)
cmp.l %a1,%d1
- jcs .L317
-.L320:
- clr.l 200(%a5)
- jra .L315
-.L273:
- tst.l %a4
- jlt .L276
- move.l -50(%fp),%d1
- move.l %d4,%d0
- move.l -74(%fp),%d7
- sub.l %d3,%d0
- muls.l %d7,%d1
- cmp.l %d0,%d1
- jcs .L278
- move.l -50(%fp),%d2
- subq.l #1,%d0
-.L361:
- divu.l %d2,%d0
- move.l -74(%fp),%d5
- addq.l #1,%d0
- move.l %d0,-70(%fp)
- cmp.l %d0,%d5
- jcc .L282
- move.l %d5,-70(%fp)
-.L282:
- move.l -20(%fp),%a0
- move.l -70(%fp),%d7
- move.l 28(%a0),%d0
+ jcs .L370
+.L373:
+ move.l -16(%fp),%a1
+ clr.l 200(%a1)
+ jra .L368
+.L326:
+ tst.l %a3
+ jlt .L329
+ tst.l %a5
+ sne %d0
+ move.l %a3,%d2
+ move.l %d5,%d1
+ sub.l %d3,%d1
+ mvs.b %d0,%d0
+ sub.l %d0,%d2
+ move.l -56(%fp),%d0
+ muls.l %d2,%d0
+ cmp.l %d1,%d0
+ jcs .L331
+ subq.l #1,%d1
+ divu.l %d2,%d1
+ move.l -56(%fp),%d6
+ addq.l #1,%d1
+ move.l %d1,-52(%fp)
+ cmp.l %d1,%d6
+ jcc .L333
+ move.l %d6,-52(%fp)
+.L333:
+ move.l -52(%fp),%d1
+ move.l 28(%a4),%d0
+ sub.l %d1,-56(%fp)
move.l %d0,%d1
neg.l %d1
move.l %d1,%d2
- jpl .L377
+ jpl .L443
addq.l #1,%d2
-.L377:
- sub.l %d7,-74(%fp)
+.L443:
asr.l #1,%d2
- move.l %d2,-66(%fp)
+ move.l %d2,-48(%fp)
tst.l %d0
- jlt .L369
-.L287:
+ jlt .L435
+.L340:
move.l %d0,%d0
- jpl .L378
+ jpl .L444
addq.l #1,%d0
-.L378:
+.L444:
move.l #32768,%d1
- move.l %a4,%d2
+ move.l %a3,%d2
asr.l #1,%d0
sub.l %d0,%d1
- move.l %d1,-62(%fp)
- tst.l %a4
- jlt .L370
-.L288:
+ move.l %d1,-44(%fp)
+ tst.l %a3
+ jlt .L436
+.L341:
cmp.l #65536,%d2
- jge .L292
-.L371:
+ jge .L345
+.L437:
+ move.l -16(%fp),%a0
move.l %d3,%d0
- sub.l 196(%a5),%d0
- cmp.l 200(%a5),%d0
- jcs .L293
+ sub.l 196(%a0),%d0
+ cmp.l 200(%a0),%d0
+ jcs .L346
move.l 12(%fp),%a2
clr.l -8(%fp)
move.l 6(%a2),%a0
move.l 10(%a2),%d0
move.l (%a2),-4(%fp)
tst.l %a0
- jeq .L294
+ jeq .L347
pea -4(%fp)
pea -8(%fp)
move.l %d3,-(%sp)
move.l %d0,-(%sp)
- move.l %a1,-90(%fp)
+ move.l %a1,-72(%fp)
jsr (%a0)
lea (16,%sp),%sp
move.l -8(%fp),%d1
- move.l -90(%fp),%a1
-.L295:
- move.l %d0,192(%a5)
- move.l %d1,196(%a5)
+ move.l -72(%fp),%a1
+.L348:
+ move.l -16(%fp),%a0
+ move.l %d0,192(%a0)
+ move.l %d1,196(%a0)
tst.l %d0
- jeq .L296
+ jeq .L349
move.l -4(%fp),%a0
move.l %d3,%d0
sub.l %d1,%d0
- move.l %a0,200(%a5)
+ move.l -16(%fp),%a2
+ move.l %a0,200(%a2)
cmp.l %a0,%d0
- jcc .L296
-.L293:
- tst.l %a4
- jlt .L298
- move.l -70(%fp),%d1
+ jcc .L349
+.L346:
+ tst.l %a3
+ jlt .L351
+ move.l -52(%fp),%d1
addq.l #1,%d2
muls.l %d1,%d2
move.l %d3,%d1
move.l %d2,%a0
add.l %d3,%a0
- cmp.l %d4,%a0
+ cmp.l %d5,%a0
scs %d0
neg.l %d0
-.L299:
+.L352:
tst.b %d0
- jeq .L292
- move.l 200(%a5),%d0
- move.l 196(%a5),%d2
+ jeq .L345
+ move.l -16(%fp),%a2
+ move.l 200(%a2),%d0
+ move.l 196(%a2),%d2
sub.l %d2,%d1
cmp.l %d1,%d0
- jls .L292
+ jls .L345
move.l %a0,%d1
sub.l %d2,%d1
cmp.l %d0,%d1
- jcc .L292
+ jcc .L345
move.l 12(%fp),%a0
move.b 4(%a0),%d1
- tst.l %a3
- jne .L300
+ tst.l %a5
+ jne .L353
moveq #1,%d0
- cmp.l %a4,%d0
- jeq .L301
- moveq #-1,%d5
- cmp.l %a4,%d5
- jeq .L301
-.L300:
- move.l -70(%fp),%d5
- add.l %d6,%d5
- move.l %d5,-24(%fp)
- cmp.l %d6,%d5
- jls .L311
+ cmp.l %a3,%d0
+ jeq .L354
+ moveq #-1,%d4
+ cmp.l %a3,%d4
+ jeq .L354
+.L353:
+ move.l -52(%fp),%d4
+ add.l %d7,%d4
+ move.l %d4,-24(%fp)
+ cmp.l %d4,%d7
+ jcc .L364
move.l 12(%fp),%a0
move.l %d3,%d0
mvz.b %d1,%d1
sub.l %d2,%d0
- mvz.b 5(%a0),%d5
- move.l %d6,%d2
+ mvz.b 5(%a0),%d4
+ move.l %d7,%d2
lsl.l #3,%d2
- move.l %a5,-16(%fp)
- mulu.w %d5,%d1
- move.l %d0,%d5
- move.l %a4,%d0
- move.l -78(%fp),%d6
- move.l %d4,-12(%fp)
- move.l -82(%fp),%d7
- move.l 28(%fp),%a2
+ move.l -16(%fp),%a0
+ mulu.w %d4,%d1
+ move.l %d0,%d4
+ move.l %a3,%d0
+ move.l %a4,-20(%fp)
+ move.l 24(%fp),%a4
+ move.l -64(%fp),%d6
+ move.l -60(%fp),%d7
+ move.l %a4,-76(%fp)
muls.l %d1,%d0
- muls.l %d1,%d5
+ muls.l %d1,%d4
+ move.l 28(%fp),%a2
add.l %d2,%a2
+ move.l %d5,-12(%fp)
move.l %d0,-28(%fp)
move.l -24(%fp),%d0
- add.l 192(%a5),%d5
+ add.l 192(%a0),%d4
add.l -28(%fp),%d1
lsl.l #3,%d0
- move.l 24(%fp),%a5
- move.l %d5,%a0
- move.l %d1,-58(%fp)
- move.l %a5,-94(%fp)
+ move.l %d4,%a0
+ move.l %d1,-40(%fp)
add.l 28(%fp),%d0
- move.l %d0,-86(%fp)
-.L313:
+ move.l %d0,-68(%fp)
+.L366:
moveq #15,%d1
move.l %d7,%d0
lsr.l %d1,%d0
move.l %d6,%d2
- add.l %a3,%d6
+ add.l %a5,%d6
add.l %a1,%d7
cmp.l %d2,%d6
scs %d1
and.l #510,%d0
- move.l -94(%fp),%a5
+ move.l -76(%fp),%a4
mvs.w (%a0),%d5
- move.l -58(%fp),%d4
+ move.l -40(%fp),%d4
mvs.b %d1,%d1
- mvz.w (%a5,%d0.l),%d0
- move.l %a4,%a5
- sub.l %d1,%a5
+ mvz.w (%a4,%d0.l),%d0
+ move.l %a3,%a4
+ sub.l %d1,%a4
moveq #15,%d1
- add.l %a5,%d3
+ add.l %a4,%d3
muls.l %d5,%d0
- move.l -66(%fp),%d5
+ move.l -48(%fp),%d5
asr.l %d1,%d0
- move.l -62(%fp),%d1
+ move.l -44(%fp),%d1
muls.l %d0,%d1
muls.l %d5,%d0
moveq #15,%d5
@@ -3111,261 +3482,317 @@ mix_other.constprop.0:
add.l %d1,(%a2)
add.l %d0,4(%a2)
cmp.l %d2,%d6
- jcs .L312
+ jcs .L365
move.l -28(%fp),%d4
-.L312:
+.L365:
add.l %d4,%a0
addq.l #8,%a2
- cmp.l -86(%fp),%a2
- jne .L313
- move.l -70(%fp),%d5
- move.l %a3,%d2
- subq.l #1,%d5
- muls.l %d5,%d2
- move.l %a1,%d7
- muls.l %d7,%d5
- move.l -78(%fp),%d0
- add.l %a3,%d0
- move.l -82(%fp),%d1
- add.l %a1,%d1
- move.l -16(%fp),%a5
- move.l -12(%fp),%d4
- add.l %d0,%d2
- move.l %d2,-78(%fp)
- add.l %d1,%d5
- move.l %d5,-82(%fp)
-.L311:
- move.l -20(%fp),%a0
- move.l -78(%fp),%d1
- move.l %d3,(%a0)
- move.l -24(%fp),%d6
- move.l %d1,4(%a0)
- jra .L310
-.L369:
+ cmp.l -68(%fp),%a2
+ jne .L366
+ move.l -52(%fp),%d2
+ move.l %a5,%d1
+ subq.l #1,%d2
+ muls.l %d2,%d1
+ move.l %a1,%d6
+ muls.l %d6,%d2
+ move.l -64(%fp),%d0
+ add.l %a5,%d0
+ move.l -60(%fp),%a0
+ add.l %a1,%a0
+ move.l -20(%fp),%a4
+ move.l -12(%fp),%d5
+ add.l %d0,%d1
+ move.l %d1,-64(%fp)
+ add.l %a0,%d2
+ move.l %d2,-60(%fp)
+.L364:
+ move.l -64(%fp),%d1
+ move.l %d3,(%a4)
+ move.l -24(%fp),%d7
+ move.l %d1,4(%a4)
+ jra .L363
+.L436:
+ neg.l %d2
+ cmp.l #65536,%d2
+ jge .L345
+ jra .L437
+.L435:
move.l %d1,%d0
move.l #32768,%d1
move.l %d0,%d0
- jpl .L379
+ jpl .L445
addq.l #1,%d0
-.L379:
- move.l %a4,%d2
+.L445:
+ move.l %a3,%d2
asr.l #1,%d0
sub.l %d0,%d1
- move.l %d1,-62(%fp)
- tst.l %a4
- jge .L288
-.L370:
- move.l -54(%fp),%d2
- cmp.l #65536,%d2
- jge .L292
- jra .L371
-.L318:
- move.l %d0,-24(%fp)
- jra .L319
-.L278:
- move.l -20(%fp),%a0
- move.l -74(%fp),%d7
- clr.l -74(%fp)
- move.l 28(%a0),%d0
+ move.l %d1,-44(%fp)
+ tst.l %a3
+ jge .L341
+ jra .L436
+.L371:
+ move.l %d0,-28(%fp)
+ jra .L372
+.L331:
+ move.l 28(%a4),%d0
move.l %d0,%d1
neg.l %d1
move.l %d1,%d2
- jpl .L380
+ jpl .L446
addq.l #1,%d2
-.L380:
- move.l %d7,-70(%fp)
+.L446:
+ move.l -56(%fp),%d6
+ clr.l -56(%fp)
+ move.l %d6,-52(%fp)
asr.l #1,%d2
- move.l %d2,-66(%fp)
+ move.l %d2,-48(%fp)
tst.l %d0
- jge .L287
- jra .L369
-.L276:
- move.l -54(%fp),%d0
- move.l -74(%fp),%d1
- muls.l %d1,%d0
- cmp.l %d3,%d0
- jls .L278
- move.l -54(%fp),%d2
- move.l %d3,%d0
- jra .L361
-.L325:
+ jge .L340
+ jra .L435
+.L329:
+ move.l -56(%fp),%d1
+ move.l %a3,%d0
+ neg.l %d0
+ muls.l %d0,%d1
+ cmp.l %d3,%d1
+ jls .L331
+ move.l %d3,%d1
+ divu.l %d0,%d1
+ move.l -56(%fp),%d2
+ addq.l #1,%d1
+ move.l %d1,-52(%fp)
+ cmp.l %d1,%d2
+ jcc .L335
+ move.l %d2,-52(%fp)
+.L335:
+ move.l 28(%a4),%d0
+ move.l %d0,%d1
+ neg.l %d1
+ move.l %d1,%d2
+ jpl .L447
+ addq.l #1,%d2
+.L447:
+ move.l -52(%fp),%d4
+ sub.l %d4,-56(%fp)
+ asr.l #1,%d2
+ move.l %d2,-48(%fp)
+ tst.l %d0
+ jge .L340
+ jra .L435
+.L391:
+ clr.l -56(%fp)
+.L338:
+ tst.l %a3
+ jlt .L379
+ move.l -32(%fp),%d1
+ sub.l %d0,%d1
+.L380:
+ cmp.l %d5,%d1
+ jcs .L381
+ move.l %d5,%d1
+ subq.l #1,%d1
+.L381:
+ tst.l %a5
+ sne %d0
+ move.l %a5,%d6
+ moveq #1,%d4
+ neg.l %d6
+ eor.l %d4,24(%a4)
+ move.l %d1,(%a4)
+ move.l %d6,%a5
+ mvs.b %d0,%d0
+ sub.l %a3,%d0
+ move.l %d0,%a3
+ tst.l -56(%fp)
+ jne .L386
+ jra .L438
+.L383:
neg.l %d0
- remu.l %d4,%d1:%d0
+ remu.l %d5,%d1:%d0
tst.l %d1
- jeq .L326
- move.l %d4,%d0
+ jeq .L385
+ move.l %d5,%d0
sub.l %d1,%d0
move.l %d0,%d1
-.L326:
- move.l -20(%fp),%a0
- move.l %d1,(%a0)
- tst.l -74(%fp)
- jne .L327
- jra .L372
-.L331:
- move.l 16(%fp),%d1
- move.l -34(%fp),%d2
- move.l 20(%fp),%a1
- move.l %a1,%a3
- move.l %d1,-46(%fp)
- add.l -46(%fp),%d2
- move.l -46(%fp),%d3
- neg.l %d3
- move.l -46(%fp),%d5
- addq.l #4,%d5
- move.l %d3,-54(%fp)
- move.l -46(%fp),%a4
- move.l %d2,-50(%fp)
- move.l %d5,-42(%fp)
- move.l %a2,-20(%fp)
- jra .L327
-.L368:
- move.l -74(%fp),%d2
+.L385:
+ move.l %d1,(%a4)
+ tst.l -56(%fp)
+ jne .L386
+ jra .L438
+.L379:
+ move.l %d0,%d1
+ not.l %d1
+ jra .L380
+.L390:
+ move.l -68(%fp),%a0
+ move.l %a1,%d5
+ move.l 16(%fp),%a3
+ move.l 20(%fp),%a5
+ move.l %a0,-16(%fp)
+ jra .L386
+.L434:
+ move.l -56(%fp),%d6
neg.l %d1
move.l %d3,%d0
- sub.l %d4,%d0
- muls.l %d2,%d1
+ sub.l %d5,%d0
+ muls.l %d6,%d1
cmp.l %d0,%d1
sls %d0
neg.l %d0
tst.b %d0
- jeq .L275
- jra .L373
-.L298:
- move.l -70(%fp),%d5
+ jeq .L328
+ jra .L439
+.L351:
+ move.l -52(%fp),%d4
move.l %d3,%d1
move.l %d3,%a0
- muls.l %d5,%d2
+ muls.l %d4,%d2
cmp.l %d3,%d2
sls %d0
sub.l %d2,%d1
neg.l %d0
- jra .L299
-.L296:
- clr.l 200(%a5)
- jra .L292
-.L294:
+ jra .L352
+.L349:
+ move.l -16(%fp),%a0
+ clr.l 200(%a0)
+ jra .L345
+.L347:
clr.l %d1
- jra .L295
-.L285:
- move.l %d2,%d3
- neg.l %d3
- remu.l %d4,%d0:%d3
- tst.l %d0
- jeq .L286
- move.l %d4,%d5
- sub.l %d0,%d5
- move.l %d5,(%a2)
- lea (32,%a2),%a2
- cmp.l -38(%fp),%a2
- jne .L328
- jra .L267
-.L286:
- clr.l (%a2)
- lea (32,%a2),%a2
- cmp.l -38(%fp),%a2
- jne .L328
- jra .L267
-.L301:
+ jra .L348
+.L425:
+ move.l -16(%fp),%a2
+ move.l %d5,%a1
+ lea (32,%a4),%a4
+ move.l %a2,-68(%fp)
+ cmp.l -36(%fp),%a4
+ jne .L387
+ jra .L320
+.L354:
mvz.b %d1,%d0
subq.l #2,%d0
tst.l %d0
- jne .L300
+ jne .L353
move.l 12(%fp),%a0
move.l %d3,%d1
sub.l %d2,%d1
- move.l %a4,%d5
+ move.l %a3,%d4
mvz.b 5(%a0),%d0
- move.l -20(%fp),%a2
- move.l -70(%fp),%d2
- add.l %d6,%d2
+ move.l -16(%fp),%a2
+ move.l -52(%fp),%d2
+ add.l %d7,%d2
muls.l %d0,%d1
- muls.l %d5,%d0
+ muls.l %d4,%d0
add.l %d1,%d1
- move.l %d0,%d7
- add.l %d7,%d7
+ move.l %d0,%d6
+ add.l %d6,%d6
move.l %d1,%a0
- add.l 192(%a5),%a0
- tst.l 28(%a2)
- jeq .L302
- cmp.l %d6,%d2
- jls .L306
+ add.l 192(%a2),%a0
+ tst.l 28(%a4)
+ jeq .L355
+ cmp.l %d7,%d2
+ jls .L359
move.l %d2,%d0
- lsl.l #3,%d6
+ lsl.l #3,%d7
lsl.l #3,%d0
move.l 28(%fp),%a2
- move.l -82(%fp),%d5
- move.l %a3,-78(%fp)
- move.l %d7,-58(%fp)
- lea 4(%a2,%d6.l),%a2
+ move.l -60(%fp),%d4
+ move.l %a3,-64(%fp)
+ move.l %d6,-40(%fp)
+ lea 4(%a2,%d7.l),%a2
add.l 28(%fp),%d0
- add.l 28(%fp),%d6
- move.l %d0,-86(%fp)
-.L309:
+ add.l 28(%fp),%d7
+ move.l %d0,-68(%fp)
+.L362:
moveq #15,%d1
- move.l %d5,%d0
+ move.l %d4,%d0
lsr.l %d1,%d0
move.l 24(%fp),%a3
- add.l %a1,%d5
+ add.l %a1,%d4
mvs.w (%a0),%d1
and.l #510,%d0
- move.l -66(%fp),%d7
- add.l -58(%fp),%a0
+ move.l -48(%fp),%d6
+ add.l -40(%fp),%a0
mvz.w (%a3,%d0.l),%d0
- move.l %d6,%a3
- addq.l #8,%d6
+ move.l %d7,%a3
+ addq.l #8,%d7
muls.l %d1,%d0
moveq #15,%d1
asr.l %d1,%d0
- move.l -62(%fp),%d1
+ move.l -44(%fp),%d1
muls.l %d0,%d1
- muls.l %d7,%d0
- moveq #15,%d7
- asr.l %d7,%d1
- asr.l %d7,%d0
+ muls.l %d6,%d0
+ moveq #15,%d6
+ asr.l %d6,%d1
+ asr.l %d6,%d0
add.l %d1,(%a3)
add.l %d0,(%a2)
addq.l #8,%a2
- cmp.l -86(%fp),%d6
- jne .L309
+ cmp.l -68(%fp),%d7
+ jne .L362
move.l %a1,%d1
- move.l -70(%fp),%d0
+ move.l -52(%fp),%d0
subq.l #1,%d0
muls.l %d1,%d0
- move.l -82(%fp),%d1
+ move.l -60(%fp),%d1
add.l %a1,%d1
- move.l -78(%fp),%a3
+ move.l -64(%fp),%a3
add.l %d1,%d0
- move.l %d0,-82(%fp)
-.L306:
- move.l -70(%fp),%d0
- move.l %a4,%d7
- move.l -20(%fp),%a0
- move.l %d2,%d6
- muls.l %d7,%d0
+ move.l %d0,-60(%fp)
+.L359:
+ move.l -52(%fp),%d0
+ move.l %a3,%d6
+ move.l %d2,%d7
+ muls.l %d6,%d0
add.l %d3,%d0
- move.l %d0,(%a0)
- jra .L310
-.L302:
- cmp.l %d6,%d2
- jls .L306
- lsl.l #3,%d6
+ move.l %d0,(%a4)
+ jra .L363
+.L426:
+ move.l -16(%fp),%a3
+ move.l %d5,%a1
+ lea (32,%a4),%a4
+ move.l %a3,-68(%fp)
+ cmp.l -36(%fp),%a4
+ jne .L387
+ jra .L320
+.L339:
+ neg.l %d0
+ remu.l %d5,%d1:%d0
+ tst.l %d1
+ jne .L394
+ move.l -16(%fp),%a0
+ move.l %d5,%a1
+ clr.l (%a4)
+ lea (32,%a4),%a4
+ move.l %a0,-68(%fp)
+ cmp.l -36(%fp),%a4
+ jne .L387
+ jra .L320
+.L394:
+ move.l %d5,%d0
+ sub.l %d1,%d0
+ clr.l -56(%fp)
+ move.l %d0,%d1
+ jra .L385
+.L355:
+ cmp.l %d7,%d2
+ jls .L359
+ lsl.l #3,%d7
move.l %d2,%d0
lsl.l #3,%d0
- move.l -82(%fp),%d5
+ move.l -60(%fp),%d4
move.l 28(%fp),%a2
- move.l %a3,-86(%fp)
- add.l %d6,%a2
- move.l 28(%fp),%d6
- add.l %d0,%d6
-.L307:
+ move.l %a3,-68(%fp)
+ add.l %d7,%a2
+ move.l 28(%fp),%d7
+ add.l %d0,%d7
+.L360:
moveq #15,%d1
- move.l %d5,%d0
+ move.l %d4,%d0
lsr.l %d1,%d0
move.l 24(%fp),%a3
- add.l %a1,%d5
+ add.l %a1,%d4
mvs.w (%a0),%d1
- add.l %d7,%a0
+ add.l %d6,%a0
and.l #510,%d0
mvz.w (%a3,%d0.l),%d0
muls.l %d1,%d0
@@ -3373,25 +3800,24 @@ mix_other.constprop.0:
asr.l %d1,%d0
add.l %d0,(%a2)
addq.l #8,%a2
- cmp.l %a2,%d6
- jne .L307
- move.l -70(%fp),%d0
- move.l %a1,%d5
+ cmp.l %a2,%d7
+ jne .L360
+ move.l -52(%fp),%d0
+ move.l %a1,%d4
subq.l #1,%d0
- muls.l %d5,%d0
- move.l -82(%fp),%d1
+ muls.l %d4,%d0
+ move.l -60(%fp),%d1
add.l %a1,%d1
- move.l %a4,%d7
- move.l %d2,%d6
- move.l -20(%fp),%a0
- move.l -86(%fp),%a3
+ move.l -68(%fp),%a3
+ move.l %a3,%d6
+ move.l %d2,%d7
add.l %d1,%d0
- move.l %d0,-82(%fp)
- move.l -70(%fp),%d0
- muls.l %d7,%d0
+ move.l %d0,-60(%fp)
+ move.l -52(%fp),%d0
+ muls.l %d6,%d0
add.l %d3,%d0
- move.l %d0,(%a0)
- jra .L310
+ move.l %d0,(%a4)
+ jra .L363
.size mix_other.constprop.0, .-mix_other.constprop.0
.align 2
.type stereo_paged, @function
@@ -3412,28 +3838,28 @@ stereo_paged:
mvs.b %d0,%d0
sub.l %d0,%d6
tst.l %d2
- jge .L383
+ jge .L450
move.l %d1,%d6
-.L383:
+.L450:
clr.l %d4
lea stereo_page,%a5
move.l %d6,%a4
-.L399:
+.L466:
move.l (%a6),%d6
move.l (%a3),%d1
cmp.l %d1,%d6
- jcc .L384
+ jcc .L451
move.l 4(%a2),%d7
move.l %d6,%d0
sub.l %d7,%d0
cmp.l 8(%a2),%d0
- jcs .L385
+ jcs .L452
move.l 6(%a3),%a0
move.l 10(%a3),%d0
clr.l 48(%sp)
move.l %d1,52(%sp)
tst.l %a0
- jeq .L386
+ jeq .L453
pea 52(%sp)
pea 52(%sp)
move.l %d6,-(%sp)
@@ -3441,22 +3867,22 @@ stereo_paged:
jsr (%a0)
move.l 64(%sp),%d7
lea (16,%sp),%sp
-.L387:
+.L454:
move.l %d0,(%a2)
move.l %d7,4(%a2)
tst.l %d0
- jeq .L388
+ jeq .L455
move.l 52(%sp),%d1
move.l %d6,%d0
sub.l %d7,%d0
move.l %d1,8(%a2)
cmp.l %d1,%d0
- jcc .L388
-.L385:
+ jcc .L455
+.L452:
move.l %d5,%a1
sub.l %d4,%a1
tst.l %d2
- jlt .L400
+ jlt .L467
move.l 8(%a2),%d1
subq.l #1,%d1
sub.l %d6,%d1
@@ -3466,17 +3892,17 @@ stereo_paged:
sub.l %d6,%a0
move.l %d1,44(%sp)
cmp.l %d1,%a0
- jcc .L391
+ jcc .L458
move.l %a0,44(%sp)
-.L391:
+.L458:
cmp.l #65536,%a4
- jcc .L393
+ jcc .L460
lea (-1,%a1),%a0
move.l %a0,%d6
move.l %a4,%d1
muls.l %d1,%d6
cmp.l 44(%sp),%d6
- jhi .L393
+ jhi .L460
lsl.l #3,%d4
move.l %a1,-(%sp)
move.l 88(%sp),%a0
@@ -3493,22 +3919,22 @@ stereo_paged:
move.l %a6,-(%sp)
jsr (%a5)
lea (36,%sp),%sp
-.L390:
+.L457:
cmp.l %d4,%d5
- jhi .L399
-.L409:
+ jhi .L466
+.L476:
movem.l (%sp),#31996
lea (56,%sp),%sp
rts
-.L388:
+.L455:
clr.l 8(%a2)
move.l (%a6),%d6
-.L384:
+.L451:
move.l 16(%a6),%d1
addq.l #1,%d4
move.l 4(%a6),%d0
#APP
-| 263 "gran.c" 1
+| 293 "gran.c" 1
add.l %d3,%d0
addx.l %d2,%d6
| 0 "" 2
@@ -3517,33 +3943,33 @@ stereo_paged:
move.l %d6,(%a6)
move.l %d0,4(%a6)
cmp.l %d4,%d5
- jhi .L399
- jra .L409
-.L393:
+ jhi .L466
+ jra .L476
+.L460:
moveq #1,%d6
cmp.l %a1,%d6
- jeq .L410
+ jeq .L477
move.l 8(%a2),%d1
move.l (%a3),%d6
sub.l %d7,%d6
cmp.l %d6,%d1
- jcc .L396
+ jcc .L463
move.l %d1,%d6
-.L396:
+.L463:
move.w #1,%a0
move.l 4(%a6),%d1
-.L398:
+.L465:
#APP
-| 263 "gran.c" 1
+| 293 "gran.c" 1
add.l %d3,%d1
addx.l %d2,%d0
| 0 "" 2
#NO_APP
cmp.l %d6,%d0
- jcc .L411
+ jcc .L478
addq.l #1,%a0
cmp.l %a1,%a0
- jne .L398
+ jne .L465
move.l %a1,%d6
add.l %d4,%d6
lsl.l #3,%d4
@@ -3561,11 +3987,11 @@ stereo_paged:
move.l %a6,-(%sp)
jsr (%a5)
lea (36,%sp),%sp
- jra .L390
-.L400:
+ jra .L457
+.L467:
move.l %d0,44(%sp)
- jra .L391
-.L411:
+ jra .L458
+.L478:
move.l %d4,%d6
move.l %a0,%a1
lsl.l #3,%d4
@@ -3584,11 +4010,11 @@ stereo_paged:
move.l %a6,-(%sp)
jsr (%a5)
lea (36,%sp),%sp
- jra .L390
-.L386:
+ jra .L457
+.L453:
clr.l %d7
- jra .L387
-.L410:
+ jra .L454
+.L477:
move.l %d4,%d6
addq.l #1,%d6
lsl.l #3,%d4
@@ -3606,10 +4032,10 @@ stereo_paged:
move.l %a6,-(%sp)
jsr (%a5)
lea (36,%sp),%sp
- jra .L390
+ jra .L457
.size stereo_paged, .-stereo_paged
.section .rodata.str1.1
-.LC6:
+.LC10:
.string "GR\001"
.text
.align 2
@@ -3621,30 +4047,30 @@ grain_assign:
movem.l #15388,(%sp)
move.l 52(%sp),%a0
cmp.l #133169151,%d0
- jhi .L413
+ jhi .L480
moveq #7,%d0
cmp.l 56(%sp),%d0
- jcs .L413
+ jcs .L480
clr.l %d1
sub.l %a1,%a1
-.L414:
+.L481:
move.l #1187521622,%a4
move.l (%a4),%d0
add.l #585088,%d0
add.l %d1,%d0
add.l #6322,%d1
cmp.l %a0,%d0
- jeq .L469
+ jeq .L536
addq.l #1,%a1
moveq #4,%d2
cmp.l %a1,%d2
- jne .L414
-.L413:
+ jne .L481
+.L480:
movem.l (%sp),#15388
moveq #-1,%d0
lea (48,%sp),%sp
rts
-.L469:
+.L536:
move.w %a1,%d1
moveq #30,%d3
mulu.w #6322,%d1
@@ -3666,28 +4092,28 @@ grain_assign:
move.l 28(%sp),%a0
move.l 32(%sp),%a1
tst.l %d0
- jeq .L420
+ jeq .L487
mvz.b pool_part,%d1
move.l (%a4),%d0
add.l #585088,%d0
mulu.w #6322,%d1
add.l %d1,%d0
cmp.l %a0,%d0
- jeq .L417
-.L420:
+ jeq .L484
+.L487:
tst.l 60(%sp)
- jne .L470
+ jne .L537
tst.l 44(%sp)
- jeq .L423
-.L424:
+ jeq .L490
+.L491:
clr.l %d1
-.L436:
+.L503:
move.l %d1,%d2
moveq #5,%d3
lea 48(%a2,%d1.l),%a4
add.l #1074606604,%d2
cmp.l %d1,%d3
- jcc .L435
+ jcc .L502
move.l %d1,%d4
moveq #6,%d3
remu.l %d3,%d0:%d4
@@ -3700,12 +4126,12 @@ grain_assign:
move.b %d2,(%a0,%d0.l)
moveq #12,%d0
cmp.l %d1,%d0
- jne .L436
-.L428:
+ jne .L503
+.L495:
clr.l 40(%sp)
-.L429:
+.L496:
move.l 60(%sp),%d1
- move.l #.LC6,%d0
+ move.l #.LC10,%d0
lea 60(%a0,%a2.l),%a5
move.l 36(%sp),%a4
sub.l %a0,%a4
@@ -3713,51 +4139,51 @@ grain_assign:
or.l 40(%sp),%d1
move.l %d1,36(%sp)
move.l %a5,%d1
-.L438:
+.L505:
tst.l 36(%sp)
- jne .L471
+ jne .L538
clr.b %d2
-.L437:
+.L504:
move.l %d1,%a5
addq.l #1,%d0
move.b %d2,(%a5)
move.b %d2,(%a4,%d1.l)
addq.l #1,%d1
- move.l #.LC6+3,%d2
+ move.l #.LC10+3,%d2
cmp.l %d2,%d0
- jne .L438
+ jne .L505
tst.l 60(%sp)
- jne .L439
+ jne .L506
tst.l 40(%sp)
- jne .L423
+ jne .L490
move.l %a2,%d0
add.l #63,%d0
lea (64,%a2),%a2
cmp.l %d0,%a2
- jcs .L423
+ jcs .L490
clr.b %d3
move.b %d3,(%a3,%d0.l)
move.b %d3,(%a0,%d0.l)
move.b %d3,(%a3,%a2.l)
move.b %d3,(%a0,%a2.l)
-.L423:
+.L490:
moveq #1,%d0
-.L472:
+.L539:
movem.l (%sp),#15388
lea (48,%sp),%sp
rts
-.L470:
+.L537:
tst.l 44(%sp)
- jne .L428
+ jne .L495
clr.l 40(%sp)
-.L427:
+.L494:
lea defaults,%a4
clr.l %d1
-.L432:
+.L499:
lea 48(%a2,%d1.l),%a5
moveq #5,%d2
cmp.l %d1,%d2
- jcc .L430
+ jcc .L497
move.l %d1,%d2
moveq #6,%d3
remu.l %d3,%d0:%d2
@@ -3770,13 +4196,13 @@ grain_assign:
move.b %d2,(%a3,%d0.l)
move.b %d2,(%a0,%d0.l)
cmp.l %d1,%d4
- jne .L432
+ jne .L499
tst.l 60(%sp)
- jne .L429
+ jne .L496
tst.l 40(%sp)
- jeq .L424
+ jeq .L491
move.l 60(%sp),%d1
- move.l #.LC6,%d0
+ move.l #.LC10,%d0
lea 60(%a0,%a2.l),%a5
move.l 36(%sp),%a4
sub.l %a0,%a4
@@ -3784,26 +4210,26 @@ grain_assign:
add.l #269110990,%a4
move.l %d1,36(%sp)
move.l %a5,%d1
- jra .L438
-.L471:
+ jra .L505
+.L538:
move.l %d0,%a5
move.b (%a5),%d2
- jra .L437
-.L439:
+ jra .L504
+.L506:
tst.l 44(%sp)
- jne .L423
+ jne .L490
move.l 56(%sp),%d4
mvz.b 34(%a0,%d4.l),%d0
subq.l #1,%d0
tst.l %d0
- jne .L423
+ jne .L490
move.b 269161679,%d0
moveq #3,%d2
and.l %d2,%d0
cmp.l %d0,%a1
- jne .L423
+ jne .L490
tst.b -2147483627.l
- jne .L423
+ jne .L490
move.b 269161678,%d0
move.l %d4,-(%sp)
move.l %a1,-(%sp)
@@ -3812,15 +4238,15 @@ grain_assign:
jsr 1073749784
lea (12,%sp),%sp
moveq #1,%d0
- jra .L472
-.L417:
+ jra .L539
+.L484:
mvz.b pool_track,%d0
cmp.l 56(%sp),%d0
- jne .L420
+ jne .L487
tst.l 44(%sp)
- jeq .L427
+ jeq .L494
move.l 44(%sp),%d3
- move.l #.LC6,%d0
+ move.l #.LC10,%d0
move.l 60(%sp),%d1
lea 60(%a0,%a2.l),%a5
move.l %d3,40(%sp)
@@ -3830,20 +4256,20 @@ grain_assign:
add.l #269110990,%a4
move.l %d1,36(%sp)
move.l %a5,%d1
- jra .L438
-.L430:
+ jra .L505
+.L497:
move.b (%a4)+,%d2
addq.l #1,%d1
move.b %d2,(%a3,%a5.l)
move.b %d2,(%a0,%a5.l)
- jra .L432
-.L435:
+ jra .L499
+.L502:
move.l %d2,%a5
addq.l #1,%d1
move.b (%a5),%d0
move.b %d0,(%a3,%a4.l)
move.b %d0,(%a0,%a4.l)
- jra .L436
+ jra .L503
.size grain_assign, .-grain_assign
.align 2
.globl grain_start
@@ -3855,36 +4281,36 @@ grain_start:
move.l -2147458392,%a0
move.l %d2,-(%sp)
cmp.l 8(%fp),%d0
- jcs .L474
+ jcs .L541
moveq #48,%d1
move.l 8(%fp),%d0
muls.l %d1,%d0
move.l %d0,%d1
add.l #-2147482352,%d1
cmp.l %d1,%a0
- jeq .L475
+ jeq .L542
add.l #-2147481968,%d0
cmp.l %a0,%d0
- jeq .L475
-.L474:
+ jeq .L542
+.L541:
move.l -52(%fp),%d2
clr.l %d0
move.l -48(%fp),%a2
unlk %fp
rts
-.L475:
+.L542:
move.l 8(%fp),%d2
moveq #1,%d0
move.b audition,%d1
lsl.l %d2,%d0
move.l 16(%fp),%d2
btst #5,%d2
- jeq .L477
+ jeq .L544
tst.l 1175351520
- jeq .L477
+ jeq .L544
mvz.b 269161676,%d2
cmp.l 8(%fp),%d2
- jne .L477
+ jne .L544
or.l %d1,%d0
lea (4,%a0),%a2
lea (24,%a0),%a1
@@ -3897,10 +4323,10 @@ grain_start:
mvz.b %d0,%d1
move.b %d0,audition
btst %d2,%d1
- jne .L488
-.L479:
+ jne .L555
+.L546:
pea -18(%fp)
- move.l #250,%d2
+ move.l #252,%d2
move.l %a0,-(%sp)
move.l %a0,-36(%fp)
move.l %a1,-40(%fp)
@@ -3929,7 +4355,7 @@ grain_start:
move.l -48(%fp),%a2
unlk %fp
rts
-.L477:
+.L544:
not.l %d0
and.l %d1,%d0
lea (4,%a0),%a2
@@ -3943,8 +4369,8 @@ grain_start:
mvz.b %d0,%d1
move.b %d0,audition
btst %d2,%d1
- jeq .L479
-.L488:
+ jeq .L546
+.L555:
pea -18(%fp)
move.l %a0,-(%sp)
move.l %a0,-36(%fp)
@@ -3970,6 +4396,87 @@ grain_start:
rts
.size grain_start, .-grain_start
.align 2
+ .type shown_value, @function
+shown_value:
+ mvz.w 1175263050,%d1
+ move.l %d2,-(%sp)
+ tst.l %d1
+ jeq .L557
+ moveq #15,%d2
+ move.l %d1,%d0
+ lsr.l %d2,%d0
+ jne .L558
+ moveq #15,%d0
+.L559:
+ subq.l #1,%d0
+ btst %d0,%d1
+ jeq .L559
+ move.l #1175263052,%a1
+ moveq #48,%d2
+ move.l (%a1),%d1
+ cmp.l %d1,%d2
+ jcc .L563
+ mvz.w (%a1),%d1
+ cmp.l %d1,%d2
+ jcs .L557
+.L563:
+ add.l %d1,%d0
+ tst.l %d0
+ jlt .L557
+ move.l #1187521622,%a1
+ move.l (%a1),%d1
+ add.l #-1073741824,%d1
+ cmp.l #133169151,%d1
+ jhi .L557
+.L573:
+ move.w 10(%sp),%d2
+ move.l (%a1),%a1
+ move.b -2147483644,%d1
+ move.l 16(%sp),%a0
+ lsl.l #5,%d0
+ lea 89(%a1,%a0.l),%a1
+ mulu.w #2330,%d2
+ move.l %d2,%a0
+ moveq #15,%d2
+ and.l %d2,%d1
+ move.l #36568,%d2
+ muls.l %d2,%d1
+ add.l %d1,%a1
+ add.l %a0,%a1
+ move.b (%a1,%d0.l),%d0
+ mvz.b %d0,%d1
+ cmp.l #255,%d1
+ jeq .L557
+ move.l (%sp)+,%d2
+ rts
+.L558:
+ move.l #1175263052,%a1
+ moveq #48,%d1
+ move.l (%a1),%d0
+ cmp.l %d0,%d1
+ jcc .L561
+ mvz.w (%a1),%d0
+ cmp.l %d0,%d1
+ jcc .L561
+.L557:
+ move.w 10(%sp),%d0
+ move.l 16(%sp),%a1
+ mulu.w #30,%d0
+ lea 48(%a1,%d0.l),%a0
+ move.l 12(%sp),%a1
+ move.l (%sp)+,%d2
+ move.b (%a1,%a0.l),%d0
+ rts
+.L561:
+ move.l #1187521622,%a1
+ add.l #15,%d0
+ move.l (%a1),%d1
+ add.l #-1073741824,%d1
+ cmp.l #133169151,%d1
+ jhi .L557
+ jra .L573
+ .size shown_value, .-shown_value
+ .align 2
.type open_source, @function
open_source:
lea (-48,%sp),%sp
@@ -3978,11 +4485,11 @@ open_source:
move.l 1074360194,%d1
move.l 1073742942,%d0
cmp.l #135,%d2
- jhi .L492
+ jhi .L577
move.l %d1,%a0
subq.l #1,%a0
cmp.l #14601,%a0
- jhi .L492
+ jhi .L577
move.w #14602,%a0
move.l %d0,%a1
add.l #-1084839392,%a1
@@ -3990,10 +4497,10 @@ open_source:
move.w %a0,%d3
mulu.w #6144,%d3
cmp.l %a1,%d3
- jcs .L492
+ jcs .L577
moveq #127,%d2
cmp.l 52(%sp),%d2
- jcs .L507
+ jcs .L592
move.l 52(%sp),%d3
moveq #44,%d2
move.l #1187586756,%a1
@@ -4009,17 +4516,17 @@ open_source:
move.l %d3,%a0
move.l (%a3),24(%sp)
cmp.l 16(%sp),%d2
- jcs .L492
-.L510:
+ jcs .L577
+.L595:
add.l #1187586764,%a0
tst.l (%a0)
- jne .L492
+ jne .L577
move.l 20(%sp),%a0
subq.l #1,%a0
cmp.l #44860415,%a0
- jhi .L492
+ jhi .L577
tst.l 24(%sp)
- jeq .L492
+ jeq .L577
move.l 52(%sp),%a0
add.l #296896553,%a0
move.l %a0,%d3
@@ -4027,7 +4534,7 @@ open_source:
move.l 24(%sp),%a2
move.l %d3,%a0
cmp.l (%a0),%a2
- jne .L492
+ jne .L577
move.l -2147456744,%a3
move.l -2147456748,%a0
move.l %a3,32(%sp)
@@ -4039,22 +4546,22 @@ open_source:
add.l #-1174405120,%d2
or.l %d2,%d3
cmp.l #33554431,%d3
- jhi .L492
+ jhi .L577
move.l 52(%sp),%a2
moveq #127,%d2
move.l (%a3,%a2.l*4),%a0
cmp.l %a2,%d2
- jcc .L495
+ jcc .L580
move.l %a2,%d3
add.l #-126,%d3
move.w %d3,%d2
move.l %d3,28(%sp)
mulu.w #14602,%d2
cmp.l %a0,%d2
- jne .L492
+ jne .L577
move.l #14601,%d3
move.l %d3,44(%sp)
-.L496:
+.L581:
move.l 16(%sp),%d3
lea frames_per_page,%a2
move.l 44(%sp),%d2
@@ -4066,7 +4573,7 @@ open_source:
move.l %d2,12(%a3)
move.l %a2,40(%sp)
tst.l 64(%sp)
- jeq .L508
+ jeq .L593
move.l 64(%sp),%a2
move.l 32(%sp),%a3
move.l %a0,20(%a2)
@@ -4089,10 +4596,10 @@ open_source:
move.l %a0,28(%a2)
move.l %a3,32(%a2)
move.l %a1,(%a2)
-.L498:
+.L583:
moveq #1,%d0
cmp.l 16(%sp),%d0
- jcc .L499
+ jcc .L584
and.l 16(%sp),%d0
moveq #2,%d1
move.l 56(%sp),%a2
@@ -4108,11 +4615,11 @@ open_source:
move.w %a0,%d2
move.b %d2,%d1
move.w %d1,4(%a2)
-.L489:
+.L574:
movem.l (%sp),#3084
lea (48,%sp),%sp
rts
-.L507:
+.L592:
move.w #1,%a1
move.l 52(%sp),%a0
move.l #-2147463394,%a2
@@ -4127,105 +4634,519 @@ open_source:
mulu.w #84,%d3
add.l %d3,%a2
move.l %d3,%a0
- add.l #-2147462722,%a0
- move.l %a2,16(%sp)
- tst.l %d2
- jne .L494
+ add.l #-2147462722,%a0
+ move.l %a2,16(%sp)
+ tst.l %d2
+ jne .L579
+ move.l %a0,%a1
+ move.l %a2,%a0
+ move.l %a1,16(%sp)
+.L579:
+ tst.b (%a0)
+ jeq .L594
+.L577:
+ movem.l (%sp),#3084
+ clr.l %d0
+ lea (48,%sp),%sp
+ rts
+.L594:
+ move.l 16(%sp),%a1
+ moveq #-3,%d2
+ mvz.b (%a1),%d3
+ and.l %d2,%d3
+ tst.l %d3
+ jne .L577
+ move.l 52(%sp),%d3
+ moveq #44,%d2
+ move.l #1187586756,%a1
+ move.l #1187586772,%a2
+ muls.l %d2,%d3
+ move.l #1187586776,%a3
+ moveq #3,%d2
+ add.l %d3,%a1
+ move.l (%a1),16(%sp)
+ add.l %d3,%a2
+ add.l %d3,%a3
+ move.l (%a2),20(%sp)
+ move.l %d3,%a0
+ move.l (%a3),24(%sp)
+ cmp.l 16(%sp),%d2
+ jcc .L595
+ jra .L577
+.L584:
+ moveq #1,%d1
+ cmp.l 16(%sp),%d1
+ jne .L586
+ moveq #3,%d1
+ move.w #2,%a0
+ move.l 56(%sp),%a2
+ moveq #1,%d0
+ move.l 60(%sp),%a3
+ lea stereo24_page,%a1
+ move.l 20(%sp),(%a2)
+ move.l %a1,6(%a2)
+ move.l %a3,10(%a2)
+ lsl.l #8,%d1
+ move.w %a0,%d2
+ move.b %d2,%d1
+ move.w %d1,4(%a2)
+ jra .L574
+.L580:
+ cmp.l #14602,%a0
+ jhi .L577
+ move.l #14602,%d2
+ sub.l %a0,%d2
+ move.l %d2,44(%sp)
+ jra .L581
+.L593:
+ move.l %d0,4(%a3)
+ move.l 52(%sp),%d3
+ move.l 28(%sp),%d0
+ move.l %a2,(%a3)
+ move.l %d3,16(%a3)
+ move.l %d0,8(%a3)
+ jra .L583
+.L586:
+ moveq #3,%d1
+ move.w #1,%a0
+ move.l 56(%sp),%a2
+ moveq #1,%d0
+ move.l 60(%sp),%a3
+ lea flex_page,%a1
+ move.l 20(%sp),(%a2)
+ move.l %a1,6(%a2)
+ move.l %a3,10(%a2)
+ lsl.l #8,%d1
+ move.w %a0,%d2
+ move.b %d2,%d1
+ move.w %d1,4(%a2)
+ jra .L574
+ .size open_source, .-open_source
+ .align 2
+ .type open_sample, @function
+open_sample:
+ clr.l -(%sp)
+ move.l 16(%sp),-(%sp)
+ move.l 16(%sp),-(%sp)
+ move.l 16(%sp),-(%sp)
+ jsr open_source
+ lea (16,%sp),%sp
+ rts
+ .size open_sample, .-open_sample
+ .align 2
+ .type grain_ui_tick, @function
+grain_ui_tick:
+ lea (-20,%sp),%sp
+ move.l 1187521622,%d0
+ add.l #-1073741824,%d0
+ movem.l #7180,(%sp)
+ cmp.l #133169151,%d0
+ jhi .L599
+ clr.l %d2
+.L603:
+ move.l 1187521622,%d1
+ add.l #585088,%d1
+ add.l %d2,%d1
+ move.l %d1,%a3
+ move.l %d1,%a0
+ move.l %d2,%a1
+ add.l #721,%d1
+ add.l #269111053,%a1
+ lea (34,%a3),%a3
+ lea (481,%a0),%a0
+.L602:
+ mvz.b (%a3),%d0
+ addq.l #1,%a3
+ subq.l #1,%d0
+ tst.l %d0
+ jeq .L617
+.L600:
+ lea (30,%a0),%a0
+ lea (30,%a1),%a1
+ cmp.l %d1,%a0
+ jne .L602
+.L621:
+ add.l #6322,%d2
+ cmp.l #25288,%d2
+ jne .L603
+.L599:
+ tst.l 1175351520
+ jne .L604
+ clr.b %d1
+ move.b %d1,win_seen
+ tst.b adopted.l
+ jne .L618
+.L605:
+ tst.b setup_visible.l
+ jne .L607
+ clr.b %d0
+ move.b %d0,setup_turned+1
+ move.b %d0,setup_turned
+.L607:
+ tst.b want_src_page.l
+ jeq .L608
+ clr.b %d1
+ pea 1.w
+ pea 34.w
+ move.b %d1,want_src_page
+ jsr 1074091808
+ addq.l #8,%sp
+.L608:
+ tst.b pool_direct.l
+ jne .L619
+.L598:
+ movem.l (%sp),#7180
+ lea (20,%sp),%sp
+ rts
+.L617:
+ mvz.b -421(%a0),%d0
+ lea (-421,%a0),%a2
+ moveq #71,%d3
+ cmp.l %d0,%d3
+ jne .L600
+ mvz.b 1(%a2),%d0
+ moveq #82,%d3
+ cmp.l %d0,%d3
+ jne .L600
+ mvz.b 2(%a2),%d0
+ moveq #1,%d3
+ cmp.l %d0,%d3
+ jne .L600
+ move.l %a0,%a2
+ move.l %a1,%a4
+ mvz.b (%a2)+,%d0
+ cmp.l %d0,%d3
+ jcc .L620
+ move.b (%a0),%d0
+ moveq #127,%d3
+ and.l %d3,%d0
+ move.b %d0,(%a4)+
+ move.b %d0,-418(%a0)
+ move.b (%a2),%d0
+ and.l %d3,%d0
+ move.b %d0,(%a4)
+ move.b %d0,-417(%a0)
+ clr.b %d0
+ move.b %d0,418(%a1)
+ clr.b (%a0)
+ move.b %d0,419(%a1)
+ clr.b (%a2)
+.L622:
+ lea (30,%a0),%a0
+ lea (30,%a1),%a1
+ cmp.l %d1,%a0
+ jne .L602
+ jra .L621
+.L604:
+ move.b 269161676,%d2
+ tst.b win_seen.l
+ jne .L606
+ moveq #1,%d3
+ move.b %d2,win_track
+ move.b %d3,win_seen
+ jra .L605
+.L619:
+ jsr pool_ours
+ tst.l %d0
+ jne .L598
+ clr.b %d3
+ move.b %d3,pool_direct
+ movem.l (%sp),#7180
+ lea (20,%sp),%sp
+ rts
+.L620:
+ mvz.b (%a2),%d0
+ cmp.l %d0,%d3
+ jcc .L600
+ move.b (%a0),%d0
+ moveq #127,%d3
+ and.l %d3,%d0
+ move.b %d0,(%a4)+
+ move.b %d0,-418(%a0)
+ move.b (%a2),%d0
+ and.l %d3,%d0
+ move.b %d0,(%a4)
+ move.b %d0,-417(%a0)
+ clr.b %d0
+ move.b %d0,418(%a1)
+ clr.b (%a0)
+ move.b %d0,419(%a1)
+ clr.b (%a2)
+ jra .L622
+.L618:
+ move.b %d1,adopted
+ move.b %d1,pool_direct
+ jra .L605
+.L606:
+ mvz.b %d2,%d0
+ moveq #7,%d1
+ cmp.l %d0,%d1
+ jcs .L605
+ move.l #1187521622,%a0
+ move.l (%a0),%d1
+ add.l #-1073741824,%d1
+ cmp.l #133169151,%d1
+ jhi .L605
+ move.b 269161679,%d1
+ move.l (%a0),%a0
+ move.l #6322,%d3
+ move.l %d0,-(%sp)
+ moveq #3,%d0
+ add.l #585088,%a0
+ and.l %d1,%d0
+ muls.l %d3,%d0
+ pea (%a0,%d0.l)
+ jsr ours
+ addq.l #8,%sp
+ tst.l %d0
+ jne .L605
+ move.b %d2,win_track
+ jra .L605
+ .size grain_ui_tick, .-grain_ui_tick
+ .align 2
+ .type ptch_text, @function
+ptch_text:
+ lea (-32,%sp),%sp
+ movem.l #17468,(%sp)
+ move.l 36(%sp),%a0
+ move.l 40(%sp),%d2
+ move.l %d2,%d0
+ add.l #-64,%d0
+ move.l %d0,%d1
+ add.l %d1,%d1
+ lea (1,%a0),%a1
+ btst #30,%d0
+ jne .L641
+ moveq #64,%d5
+ cmp.l %d2,%d5
+ jeq .L631
+ moveq #10,%d3
+ sub.l %a6,%a6
+ move.l %d1,%d0
+ divu.l %d3,%d0
+ rems.l %d3,%d4:%d1
+ move.b #43,(%a0)
+ move.l %sp,%d3
+ add.l #26,%d3
+ move.l %d3,%a0
+.L626:
+ move.l %d0,%d2
+ moveq #10,%d5
+ remu.l %d5,%d1:%d2
+ divu.l %d5,%d2
+ move.l %d0,%a2
+ addq.l #1,%a6
+ add.l #48,%d1
+ move.b %d1,(%a0)+
+ move.l %d2,%d0
+ moveq #9,%d1
+ cmp.l %a2,%d1
+ jcs .L626
+ lea (%a6,%d3.l),%a0
+ move.l %a1,%a2
+.L627:
+ move.b -(%a0),(%a2)+
+ cmp.l %a0,%d3
+ jne .L627
+ clr.b %d2
+ move.b %d2,(%a1,%a6.l)
+ tst.l %d4
+ jeq .L623
+ tst.b (%a1)
+ jeq .L642
+.L630:
+ addq.l #1,%a1
+ tst.b (%a1)
+ jne .L630
+.L642:
+ clr.b %d3
+ add.l #48,%d4
+ move.b #46,(%a1)
+ move.b %d4,1(%a1)
+ move.b %d3,2(%a1)
+.L623:
+ movem.l (%sp),#17468
+ lea (32,%sp),%sp
+ rts
+.L631:
+ move.l %sp,%d3
+ add.l #26,%d3
move.l %a0,%a1
- move.l %a2,%a0
- move.l %a1,16(%sp)
-.L494:
- tst.b (%a0)
- jeq .L509
-.L492:
- movem.l (%sp),#3084
+ clr.l %d4
clr.l %d0
- lea (48,%sp),%sp
- rts
-.L509:
- move.l 16(%sp),%a1
- moveq #-3,%d2
- mvz.b (%a1),%d3
- and.l %d2,%d3
- tst.l %d3
- jne .L492
- move.l 52(%sp),%d3
- moveq #44,%d2
- move.l #1187586756,%a1
- move.l #1187586772,%a2
- muls.l %d2,%d3
- move.l #1187586776,%a3
- moveq #3,%d2
- add.l %d3,%a1
- move.l (%a1),16(%sp)
- add.l %d3,%a2
- add.l %d3,%a3
- move.l (%a2),20(%sp)
+ sub.l %a6,%a6
move.l %d3,%a0
- move.l (%a3),24(%sp)
- cmp.l 16(%sp),%d2
- jcc .L510
- jra .L492
-.L499:
- moveq #1,%d1
- cmp.l 16(%sp),%d1
- jne .L501
- moveq #3,%d1
- move.w #2,%a0
- move.l 56(%sp),%a2
- moveq #1,%d0
- move.l 60(%sp),%a3
- lea stereo24_page,%a1
- move.l 20(%sp),(%a2)
- move.l %a1,6(%a2)
- move.l %a3,10(%a2)
- lsl.l #8,%d1
- move.w %a0,%d2
- move.b %d2,%d1
- move.w %d1,4(%a2)
- jra .L489
-.L495:
- cmp.l #14602,%a0
- jhi .L492
- move.l #14602,%d2
- sub.l %a0,%d2
- move.l %d2,44(%sp)
- jra .L496
-.L508:
- move.l %d0,4(%a3)
- move.l 52(%sp),%d3
- move.l 28(%sp),%d0
- move.l %a2,(%a3)
- move.l %d3,16(%a3)
- move.l %d0,8(%a3)
- jra .L498
-.L501:
- moveq #3,%d1
- move.w #1,%a0
- move.l 56(%sp),%a2
- moveq #1,%d0
- move.l 60(%sp),%a3
- lea flex_page,%a1
- move.l 20(%sp),(%a2)
- move.l %a1,6(%a2)
- move.l %a3,10(%a2)
- lsl.l #8,%d1
- move.w %a0,%d2
- move.b %d2,%d1
- move.w %d1,4(%a2)
- jra .L489
- .size open_source, .-open_source
+ jra .L626
+.L641:
+ neg.l %d1
+ moveq #10,%d3
+ sub.l %a6,%a6
+ move.l %d1,%d0
+ divu.l %d3,%d0
+ rems.l %d3,%d4:%d1
+ move.b #45,(%a0)
+ move.l %sp,%d3
+ add.l #26,%d3
+ move.l %d3,%a0
+ jra .L626
+ .size ptch_text, .-ptch_text
.align 2
- .type open_sample, @function
-open_sample:
- clr.l -(%sp)
- move.l 16(%sp),-(%sp)
- move.l 16(%sp),-(%sp)
- move.l 16(%sp),-(%sp)
- jsr open_source
- lea (16,%sp),%sp
+ .type shown_pos, @function
+shown_pos:
+ mvz.w 1175263050,%d1
+ move.l %d3,-(%sp)
+ move.l %d2,-(%sp)
+ tst.l %d1
+ jeq .L644
+ moveq #15,%d2
+ move.l %d1,%d0
+ lsr.l %d2,%d0
+ jne .L645
+ moveq #15,%d0
+.L646:
+ subq.l #1,%d0
+ btst %d0,%d1
+ jeq .L646
+ move.l #1175263052,%a0
+ moveq #48,%d2
+ move.l (%a0),%d1
+ cmp.l %d1,%d2
+ jcc .L649
+ mvz.w (%a0),%d1
+ cmp.l %d1,%d2
+ jcs .L644
+.L649:
+ add.l %d1,%d0
+ tst.l %d0
+ jge .L648
+.L644:
+ move.w 14(%sp),%d0
+ move.l 16(%sp),%a0
+ moveq #7,%d2
+ mulu.w #30,%d0
+ move.b 49(%a0,%d0.l),%d1
+ add.l #485,%d0
+ move.b (%a0,%d0.l),%d0
+ mvz.b %d1,%d1
+ and.l %d2,%d0
+ lsl.l #8,%d1
+ lsl.l #5,%d0
+ add.l %d1,%d0
+ cmp.l #32767,%d0
+ jhi .L674
+.L643:
+ move.l (%sp)+,%d2
+ move.l (%sp)+,%d3
+ rts
+.L645:
+ move.l #1175263052,%a0
+ moveq #48,%d3
+ cmp.l (%a0),%d3
+ jcc .L648
+ mvz.w (%a0),%d0
+ cmp.l %d0,%d3
+ jcs .L644
+.L648:
+ pea 1.w
+ move.l 20(%sp),-(%sp)
+ move.l 20(%sp),-(%sp)
+ jsr shown_value
+ lea (12,%sp),%sp
+ mvz.w 1175263050,%d2
+ tst.l %d2
+ jeq .L650
+ moveq #15,%d3
+ move.l %d2,%d1
+ lsr.l %d3,%d1
+ jne .L662
+ moveq #15,%d1
+.L652:
+ subq.l #1,%d1
+ btst %d1,%d2
+ jeq .L652
+.L651:
+ move.l #1175263052,%a0
+ moveq #48,%d3
+ move.l (%a0),%d2
+ cmp.l %d2,%d3
+ jcc .L653
+ mvz.w (%a0),%d2
+ cmp.l %d2,%d3
+ jcs .L650
+.L653:
+ add.l %d1,%d2
+.L654:
+ move.l #1187521622,%a0
+ move.l (%a0),%d1
+ add.l #-1073741824,%d1
+ cmp.l #133169151,%d1
+ jhi .L655
+ moveq #63,%d3
+ and.l %d3,%d2
+ move.w 14(%sp),%d3
+ move.l (%a0),%a0
+ move.b 269161680,%d1
+ lsl.l #5,%d2
+ mulu.w #2330,%d3
+ move.l %d3,%a1
+ moveq #15,%d3
+ and.l %d3,%d1
+ move.l #36568,%d3
+ muls.l %d3,%d1
+ lea 106(%a0,%d1.l),%a0
+ add.l %a1,%a0
+ mvz.b (%a0,%d2.l),%d1
+ moveq #7,%d2
+ add.l #-119,%d1
+ cmp.l %d1,%d2
+ jcc .L679
+.L655:
+ move.w 14(%sp),%d1
+ move.l 16(%sp),%a1
+ mvz.b %d0,%d0
+ mulu.w #30,%d1
+ lea 49(%a1,%d1.l),%a0
+ mvz.b (%a0),%d2
+ cmp.l %d0,%d2
+ jeq .L680
+ lsl.l #8,%d0
+ cmp.l #32767,%d0
+ jls .L643
+.L674:
+ move.l (%sp)+,%d2
+ move.l #32767,%d0
+ move.l (%sp)+,%d3
rts
- .size open_sample, .-open_sample
+.L679:
+ mvz.b %d0,%d0
+ lsl.l #5,%d1
+ lsl.l #8,%d0
+ add.l %d1,%d0
+ cmp.l #32767,%d0
+ jhi .L674
+ move.l (%sp)+,%d2
+ move.l (%sp)+,%d3
+ rts
+.L680:
+ move.b (%a0),%d2
+ add.l #485,%d1
+ move.b (%a1,%d1.l),%d0
+ mvz.b %d2,%d1
+ moveq #7,%d2
+ and.l %d2,%d0
+ lsl.l #8,%d1
+ lsl.l #5,%d0
+ add.l %d1,%d0
+ cmp.l #32767,%d0
+ jls .L643
+ jra .L674
+.L650:
+ moveq #-1,%d2
+ jra .L654
+.L662:
+ moveq #15,%d1
+ jra .L651
+ .size shown_pos, .-shown_pos
.align 2
.type wave_area, @function
wave_area:
@@ -4255,7 +5176,7 @@ wave_area:
move.l %d1,96(%sp)
lea (12,%sp),%sp
tst.l %d0
- jne .L514
+ jne .L682
move.l 124(%sp),%d0
moveq #14,%d2
lea live_at,%a0
@@ -4265,10 +5186,10 @@ wave_area:
lea dsmp,%a0
move.l live_tick,%d1
clr.l (%a0,%d0.l)
-.L515:
+.L683:
move.l 132(%sp),%d6
cmp.l 136(%sp),%d6
- jgt .L513
+ jgt .L681
moveq #7,%d0
and.l 84(%sp),%d0
move.w #7,%a1
@@ -4280,26 +5201,26 @@ wave_area:
moveq #1,%d1
lsl.l %d0,%d1
move.l 132(%sp),%d0
-.L539:
+.L711:
move.l %d0,%d3
moveq #127,%d5
lsl.l #3,%d3
cmp.l %d0,%d5
- jcs .L538
+ jcs .L710
lea (%a1,%d3.l),%a0
add.l %d2,%a0
move.b (%a0),%d3
or.l %d1,%d3
move.b %d3,(%a0)
-.L538:
+.L710:
addq.l #2,%d0
cmp.l %d4,%d0
- jle .L539
-.L513:
+ jle .L711
+.L681:
movem.l (%sp),#31996
lea (120,%sp),%sp
rts
-.L514:
+.L682:
move.l 124(%sp),%d7
moveq #14,%d5
move.l 124(%sp),%d6
@@ -4307,12 +5228,12 @@ wave_area:
muls.l %d5,%d7
move.l (%a0,%d6.l*4),%a0
lea dsmp,%a1
- move.l %a0,92(%sp)
+ move.l %a0,96(%sp)
move.l live_tick,%a0
move.l (%a1,%d7.l),%d1
- move.l %a0,100(%sp)
+ move.l %a0,108(%sp)
tst.l %d1
- jeq .L515
+ jeq .L683
moveq #20,%d0
muls.l %d0,%d6
lea dpages,%a1
@@ -4321,19 +5242,13 @@ wave_area:
move.l 16(%a1,%d6.l),%a0
move.l %d6,88(%sp)
cmp.l (%a2,%a4.l*4),%a0
- jne .L617
- move.l draws,%d0
- moveq #120,%d2
- lea (env_at.4),%a2
- move.l 124(%sp),%a4
- move.l %a2,96(%sp)
- sub.l (%a2,%a4.l*4),%d0
- cmp.l %d0,%d2
- jcc .L517
-.L516:
+ jeq .L775
+ lea (env_at.7),%a1
+ move.l %a1,92(%sp)
+.L684:
moveq #-1,%d3
cmp.l %a0,%d3
- jeq .L618
+ jeq .L784
mvz.w 126(%sp),%d3
move.l %d1,%d0
lsr.l #6,%d0
@@ -4352,7 +5267,7 @@ wave_area:
addq.l #1,%d6
move.l 56(%sp),%d2
addq.l #4,%d2
- clr.l 64(%sp)
+ clr.l 68(%sp)
move.l %d2,52(%sp)
move.l %d3,%a4
add.l #env_r,%a4
@@ -4360,11 +5275,11 @@ wave_area:
move.l %d3,%a2
clr.l %d6
add.l #env_l,%a2
- move.l 64(%sp),%d2
+ move.l 68(%sp),%d2
add.l #env_l+64,%d3
move.l %d0,76(%sp)
- move.l %a4,104(%sp)
- move.l %a4,68(%sp)
+ move.l %a4,100(%sp)
+ move.l %a4,64(%sp)
move.l 56(%sp),%a3
sub.l %a0,%a0
move.l %d3,72(%sp)
@@ -4373,20 +5288,20 @@ wave_area:
addq.l #5,%a3
move.l 56(%sp),%a4
clr.l %d7
- move.l %a2,108(%sp)
+ move.l %a2,104(%sp)
move.l %a2,60(%sp)
addq.l #6,%a4
move.l %d6,44(%sp)
-.L532:
+.L700:
clr.l 112(%sp)
move.l %d1,116(%sp)
cmp.l %d2,%d1
- jls .L529
-.L621:
+ jls .L697
+.L787:
move.l %d2,%a6
sub.l %a0,%a6
cmp.l %a6,%a1
- jhi .L522
+ jhi .L690
pea 116(%sp)
pea 116(%sp)
move.l %d2,-(%sp)
@@ -4397,11 +5312,11 @@ wave_area:
move.l 128(%sp),%a0
lea (16,%sp),%sp
tst.l %d0
- jeq .L581
+ jeq .L749
move.l 116(%sp),%a1
move.l %d2,%a6
sub.l %a0,%a6
-.L522:
+.L690:
move.l 52(%sp),%a2
move.l %a6,%d6
mvz.b (%a3),%d5
@@ -4414,160 +5329,109 @@ wave_area:
add.l %d0,%a6
move.w (%a6),%d1
cmp.l %d5,%d6
- jcc .L582
+ jcc .L750
mvz.b (%a6,%d4.l),%d5
mvz.b 1(%a6,%d4.l),%d4
lsl.l #8,%d5
or.l %d4,%d5
tst.w %d1
- jlt .L619
-.L525:
+ jlt .L785
+.L693:
mvz.w %d1,%d1
cmp.l 44(%sp),%d1
- jle .L526
+ jle .L694
move.l %d1,44(%sp)
-.L526:
+.L694:
mvs.w %d5,%d1
tst.w %d5
- jmi .L620
-.L527:
+ jmi .L786
+.L695:
cmp.l %d7,%d1
- jle .L523
+ jle .L691
move.l %d1,%d7
-.L523:
+.L691:
subq.l #1,%d3
tst.l %d3
- jeq .L529
+ jeq .L697
lea dsmp,%a2
move.l (%a2,%a5.l),%d1
add.l 48(%sp),%d2
clr.l 112(%sp)
move.l %d1,116(%sp)
cmp.l %d2,%d1
- jhi .L621
-.L529:
+ jhi .L787
+.L697:
move.l 44(%sp),%d6
asr.l #8,%d6
move.l 60(%sp),%a2
asr.l #8,%d7
- move.l 68(%sp),%a4
+ move.l 64(%sp),%a4
move.l 72(%sp),%d1
move.b %d6,(%a2)+
move.b %d7,(%a4)
addq.l #1,60(%sp)
cmp.l %a2,%d1
- jeq .L583
+ jeq .L751
move.l 76(%sp),%d2
addq.l #1,%a4
lea dsmp,%a2
clr.l %d6
- move.l %a4,68(%sp)
+ move.l %a4,64(%sp)
moveq #16,%d3
- add.l %d2,64(%sp)
+ add.l %d2,68(%sp)
move.l (%a2,%a5.l),%d1
clr.l %d7
move.l %d6,44(%sp)
move.l 56(%sp),%a4
addq.l #6,%a4
- move.l 64(%sp),%d2
- jra .L532
-.L617:
- lea (env_at.4),%a1
- move.l %a1,96(%sp)
- jra .L516
-.L619:
+ move.l 68(%sp),%d2
+ jra .L700
+.L785:
neg.l %d1
- jra .L525
-.L620:
+ jra .L693
+.L786:
neg.l %d1
- jra .L527
-.L583:
- move.l 104(%sp),%a1
- move.l %a5,%d7
- move.l 108(%sp),%a0
- moveq #1,%d2
- move.l 72(%sp),%d3
-.L531:
- mvz.b (%a0)+,%d0
- mvz.b (%a1)+,%d1
- cmp.l %d0,%d1
- jls .L533
- move.l %d1,%d0
-.L533:
- cmp.l %d2,%d0
- jls .L534
- move.l %d0,%d2
-.L534:
- cmp.l %d3,%a0
- jne .L531
- move.l 104(%sp),%a1
- move.l %d3,%d4
- move.l 108(%sp),%a0
-.L537:
- mvz.b (%a0)+,%d3
- clr.l %d0
- mulu.w #16129,%d3
- divu.l %d2,%d3
-.L535:
- move.l %d0,%d5
- addq.l #1,%d0
- move.l %d0,%d1
- muls.l %d0,%d1
- cmp.l %d1,%d3
- jcc .L535
- mvz.b (%a1),%d3
- move.b %d5,-1(%a0)
- clr.l %d0
- mulu.w #16129,%d3
- divu.l %d2,%d3
-.L536:
- move.l %d0,%d5
- addq.l #1,%d0
- move.l %d0,%d1
- muls.l %d0,%d1
- cmp.l %d1,%d3
- jcc .L536
- move.b %d5,(%a1)+
- cmp.l %d4,%a0
- jne .L537
- move.l 124(%sp),%a2
- move.l 96(%sp),%a0
- lea draws,%a1
- lea dsmp,%a4
- move.l (%a1),(%a0,%a2.l*4)
- tst.l (%a4,%d7.l)
- jeq .L515
- move.l 88(%sp),%a1
- lea dpages,%a0
- move.l 16(%a0,%a1.l),%a2
- move.l 124(%sp),%a1
- lea env_slot,%a0
- cmp.l (%a0,%a1.l*4),%a2
- jne .L515
-.L517:
+ jra .L695
+.L750:
+ move.w %d1,%d5
+ jpl .L693
+ jra .L785
+.L749:
+ sub.l %a1,%a1
+ jra .L691
+.L775:
+ move.l draws,%d0
+ moveq #120,%d2
+ move.l 124(%sp),%a4
+ lea (env_at.7),%a2
+ move.l %a2,92(%sp)
+ sub.l (%a2,%a4.l*4),%d0
+ cmp.l %d0,%d2
+ jcs .L684
lea dsmp,%a0
moveq #1,%d3
mvz.b 5(%a0,%d7.l),%d4
move.l 136(%sp),%a0
move.l 144(%sp),%d1
- move.l 92(%sp),%a1
+ move.l 96(%sp),%a1
addq.l #8,%a1
sub.l 132(%sp),%a0
sub.l 140(%sp),%d1
- move.l %a1,92(%sp)
+ move.l %a1,96(%sp)
move.l %a0,%d2
addq.l #1,%d2
move.l %d1,60(%sp)
move.l %d2,56(%sp)
cmp.l %d4,%d3
- jcc .L542
+ jcc .L714
+.L794:
move.l %d1,%d0
asr.l #2,%d0
move.l 140(%sp),%a6
add.l %d0,%a6
-.L543:
+.L715:
tst.l 56(%sp)
- jle .L544
+ jle .L716
move.l %d0,%d1
subq.l #1,%d1
move.l 144(%sp),%a5
@@ -4589,10 +5453,10 @@ wave_area:
add.l #env_l,%a1
move.l %a0,48(%sp)
move.l %a1,52(%sp)
-.L546:
+.L718:
moveq #127,%d0
cmp.l %d5,%d0
- jcs .L545
+ jcs .L717
move.l %a2,%d2
move.l %d6,%d1
divs.l %d2,%d1
@@ -4614,7 +5478,7 @@ wave_area:
lea (16,%sp),%sp
moveq #1,%d2
cmp.l %d4,%d2
- jcc .L545
+ jcc .L717
muls.w %d3,%d0
pea 1.w
divs.l %d7,%d0
@@ -4625,59 +5489,51 @@ wave_area:
move.l %d5,-(%sp)
jsr (%a3)
lea (16,%sp),%sp
-.L545:
+.L717:
add.l #64,%d6
addq.l #1,%d5
cmp.l %a4,%d5
- jne .L546
+ jne .L718
move.l 64(%sp),%d7
-.L544:
+.L716:
lea dsmp,%a0
- move.l 56(%sp),%d3
- move.l (%a0,%d7.l),%d0
- move.l %d0,%d1
- divu.l %d3,%d1
- move.l 100(%sp),%d5
- addq.l #1,%d1
- move.l %d1,56(%sp)
- cmp.l 92(%sp),%d5
- jcc .L547
- move.l 124(%sp),%d1
- moveq #12,%d6
- muls.l %d6,%d1
- move.l %d1,%a0
- add.l #live_w+2,%a0
- mvz.w (%a0),%d1
- cmp.l #32767,%d1
- jhi .L609
-.L549:
- move.l %d0,%d2
- lsr.l #6,%d2
- moveq #15,%d5
- moveq #9,%d6
- lsr.l %d5,%d0
+ move.l (%a0,%d7.l),%d3
+ move.l 128(%sp),-(%sp)
+ move.l 128(%sp),-(%sp)
+ move.l %d3,%d0
+ divu.l 64(%sp),%d0
+ addq.l #1,%d0
+ move.l %d0,64(%sp)
+ jsr shown_pos
+ move.l 148(%sp),%a3
+ addq.l #8,%sp
move.l fbp,%d5
- and.l #511,%d2
- move.l 140(%sp),%a3
addq.l #3,%a3
- move.l %d0,%d3
+ move.l %d3,%d1
+ lsr.l #6,%d1
+ move.l %d0,%d2
+ moveq #15,%d0
+ lsr.l %d0,%d3
move.l %a3,%d0
- muls.l %d1,%d3
- mulu.w %d1,%d2
- lsr.l %d6,%d2
+ and.l #511,%d1
+ muls.l %d2,%d3
+ mulu.w %d2,%d1
+ moveq #9,%d2
+ lsr.l %d2,%d1
+ move.l %d1,%d2
add.l %d3,%d2
move.l 56(%sp),%d3
divu.l %d3,%d2
move.l 144(%sp),%d1
add.l 132(%sp),%d2
-.L554:
+.L722:
moveq #127,%d6
cmp.l %d2,%d6
- jcc .L622
+ jcc .L788
addq.l #2,%d0
cmp.l %d1,%d0
- jle .L554
-.L553:
+ jle .L722
+.L721:
move.w #1,%a5
move.l %d2,%d6
move.l %d2,%d4
@@ -4686,12 +5542,12 @@ wave_area:
addq.l #3,%d4
add.l %d2,%a3
addq.l #6,%a4
-.L558:
+.L726:
move.l %d4,%a1
move.l %d6,%d0
subq.l #1,%d4
cmp.l %d6,%d4
- jlt .L555
+ jlt .L723
moveq #7,%d3
move.l %a3,%d1
sub.l %a1,%d1
@@ -4702,25 +5558,25 @@ wave_area:
lsl.l #3,%d1
move.l %d1,%a0
add.l %a4,%a0
-.L557:
+.L725:
moveq #127,%d1
cmp.l %d0,%d1
- jcs .L556
+ jcs .L724
move.b (%a0),%d1
or.l %d3,%d1
move.b %d1,(%a0)
-.L556:
+.L724:
addq.l #1,%d0
addq.l #8,%a0
cmp.l %d0,%a1
- jne .L557
-.L555:
+ jne .L725
+.L723:
addq.l #1,%d6
cmp.l %d2,%d4
- jne .L558
- move.l 100(%sp),%d2
- cmp.l 92(%sp),%d2
- jcc .L513
+ jne .L726
+ move.l 108(%sp),%d2
+ cmp.l 96(%sp),%d2
+ jcc .L681
move.l 88(%sp),%a2
lea dpages,%a0
lea 16(%a0,%a2.l),%a1
@@ -4728,7 +5584,7 @@ wave_area:
add.l #pages+16,%a0
move.l (%a0),%a4
cmp.l (%a1),%a4
- jne .L513
+ jne .L681
move.w 126(%sp),%d1
move.l 60(%sp),%d0
asr.l #1,%d0
@@ -4739,52 +5595,39 @@ wave_area:
move.l %d0,72(%sp)
move.l %d5,%a3
move.l %d7,76(%sp)
- mulu.w #250,%d1
+ mulu.w #252,%d1
move.l %d1,%a6
add.l #eng+160,%d1
add.l #eng,%a6
move.l %d1,60(%sp)
tst.l 8(%a6)
- jne .L623
-.L559:
+ jne .L789
+.L727:
cmp.l 60(%sp),%a6
- jeq .L513
+ jeq .L681
move.l 68(%sp),%a0
lea (32,%a6),%a6
move.l (%a0),%a1
move.l 64(%sp),%a0
cmp.l (%a0),%a1
- jne .L513
+ jne .L681
tst.l 8(%a6)
- jeq .L559
- jra .L623
-.L582:
- move.w %d1,%d5
- jpl .L525
- jra .L619
-.L581:
- sub.l %a1,%a1
- jra .L523
-.L542:
- move.l 60(%sp),%d0
- asr.l #1,%d0
- move.l 84(%sp),%a6
- jra .L543
-.L623:
+ jeq .L727
+.L789:
move.l 76(%sp),%a1
lea dsmp,%a0
move.l (%a6),%d1
move.l (%a0,%a1.l),%d0
cmp.l %d1,%d0
- jhi .L560
+ jhi .L728
move.l %d0,%d1
subq.l #1,%d1
-.L560:
+.L728:
move.l 72(%sp),%d0
lea (28,%a6),%a4
muls.l (%a4),%d0
tst.l %d0
- jlt .L624
+ jlt .L790
move.l 56(%sp),%d3
moveq #15,%d5
asr.l %d5,%d0
@@ -4795,7 +5638,7 @@ wave_area:
move.l %a0,%d3
move.l 132(%sp),%a0
lea -2(%a0,%d1.l),%a4
-.L578:
+.L746:
moveq #2,%d6
moveq #-2,%d0
cmp.l %a1,%d6
@@ -4813,17 +5656,17 @@ wave_area:
and.l %d2,%d4
lsl.l %d5,%d6
mvz.b %d4,%d4
-.L577:
+.L745:
moveq #1,%d2
cmp.l %d0,%d2
- jge .L625
-.L562:
+ jge .L791
+.L730:
moveq #127,%d5
cmp.l %d1,%d5
- jcs .L572
+ jcs .L740
moveq #63,%d2
cmp.l %d3,%d2
- jcs .L572
+ jcs .L740
mvz.w %d1,%d2
move.w #7,%a0
clr.l %d5
@@ -4833,32 +5676,32 @@ wave_area:
add.l %a3,%a0
move.b (%a0),%d2
tst.l %d5
- jeq .L574
-.L626:
+ jeq .L742
+.L792:
or.l %d6,%d2
move.b %d2,(%a0)
-.L572:
+.L740:
addq.l #1,%d0
moveq #3,%d5
cmp.l %d0,%d5
- jeq .L576
-.L627:
+ jeq .L744
+.L793:
addq.l #1,%d1
moveq #1,%d2
cmp.l %d0,%d2
- jlt .L562
-.L625:
+ jlt .L730
+.L791:
move.l %d0,%d2
moveq #1,%d5
neg.l %d2
cmp.l %d2,%d5
- jge .L563
+ jge .L731
moveq #127,%d2
cmp.l %d1,%d2
- jcs .L610
+ jcs .L777
moveq #63,%d5
cmp.l %d3,%d5
- jcs .L568
+ jcs .L736
move.l %d3,%d2
asr.l #3,%d2
move.l %a3,%a5
@@ -4876,8 +5719,8 @@ wave_area:
not.l %d2
and.l %d5,%d2
move.b %d2,(%a0)
- jra .L577
-.L624:
+ jra .L745
+.L790:
move.l 56(%sp),%d3
add.l #32767,%d0
moveq #15,%d5
@@ -4889,66 +5732,34 @@ wave_area:
move.l %a0,%d3
move.l 132(%sp),%a0
lea -2(%a0,%d1.l),%a4
- jra .L578
-.L547:
- move.w 126(%sp),%d1
- move.l 128(%sp),%a0
- moveq #7,%d3
- mulu.w #30,%d1
- move.b 49(%a0,%d1.l),%d2
- add.l #485,%d1
- move.b (%a0,%d1.l),%d1
- mvz.b %d2,%d2
- and.l %d3,%d1
- lsl.l #8,%d2
- lsl.l #5,%d1
- add.l %d2,%d1
- cmp.l #32767,%d1
- jls .L549
-.L609:
- move.l %d0,%d2
- lsr.l #6,%d2
- moveq #15,%d5
- moveq #9,%d6
- lsr.l %d5,%d0
- move.l #32767,%d1
- and.l #511,%d2
- move.l 140(%sp),%a3
- addq.l #3,%a3
- move.l %d0,%d3
- move.l %a3,%d0
- muls.l %d1,%d3
- move.l fbp,%d5
- mulu.w %d1,%d2
- lsr.l %d6,%d2
- add.l %d3,%d2
- move.l 56(%sp),%d3
- divu.l %d3,%d2
- move.l 144(%sp),%d1
- add.l 132(%sp),%d2
- jra .L554
-.L568:
+ jra .L746
+.L714:
+ move.l 60(%sp),%d0
+ asr.l #1,%d0
+ move.l 84(%sp),%a6
+ jra .L715
+.L736:
addq.l #1,%d1
moveq #-2,%d2
cmp.l %d0,%d2
- jeq .L584
+ jeq .L752
addq.l #1,%d0
cmp.l #128,%d1
- jne .L568
-.L610:
+ jne .L736
+.L777:
addq.l #1,%d1
addq.l #1,%d0
- jra .L577
-.L584:
+ jra .L745
+.L752:
moveq #-1,%d0
-.L563:
+.L731:
move.l %d4,%d5
moveq #127,%d2
cmp.l %d1,%d2
- jcs .L610
+ jcs .L777
moveq #63,%d2
cmp.l %d3,%d2
- jcs .L610
+ jcs .L777
mvz.w %d1,%d2
move.w #7,%a0
lsl.l #3,%d2
@@ -4957,8 +5768,8 @@ wave_area:
add.l %a3,%a0
move.b (%a0),%d2
tst.l %d5
- jne .L626
-.L574:
+ jne .L792
+.L742:
move.l %d6,%d5
not.l %d5
and.l %d5,%d2
@@ -4966,13 +5777,13 @@ wave_area:
moveq #3,%d5
move.b %d2,(%a0)
cmp.l %d0,%d5
- jne .L627
-.L576:
+ jne .L793
+.L744:
addq.l #1,%d3
subq.l #1,%a1
moveq #-3,%d6
cmp.l %a1,%d6
- jeq .L559
+ jeq .L727
moveq #2,%d6
moveq #-2,%d0
cmp.l %a1,%d6
@@ -4990,15 +5801,107 @@ wave_area:
and.l %d2,%d4
lsl.l %d5,%d6
mvz.b %d4,%d4
- jra .L577
-.L622:
+ jra .L745
+.L751:
+ move.l 100(%sp),%a1
+ move.l %a5,%d7
+ move.l 104(%sp),%a0
+ moveq #1,%d2
+ move.l 72(%sp),%d3
+.L699:
+ mvz.b (%a0)+,%d0
+ mvz.b (%a1)+,%d1
+ cmp.l %d0,%d1
+ jls .L701
+ move.l %d1,%d0
+.L701:
+ cmp.l %d2,%d0
+ jls .L702
+ move.l %d0,%d2
+.L702:
+ cmp.l %a0,%d3
+ jne .L699
+ move.l 100(%sp),%a3
+ move.l 104(%sp),%a1
+ move.l 72(%sp),%d4
+ lea quiet,%a0
+.L709:
+ mvz.b (%a1)+,%d3
+ clr.l %d0
+ mulu.w #16129,%d3
+ divu.l %d2,%d3
+.L703:
+ move.l %d0,%d5
+ addq.l #1,%d0
+ move.l %d0,%d1
+ muls.l %d0,%d1
+ cmp.l %d1,%d3
+ jcc .L703
+ moveq #60,%d3
+ cmp.l %d5,%d3
+ jcs .L705
+ move.b (%a0,%d5.l),%d5
+.L705:
+ mvz.b (%a3),%d3
+ move.b %d5,-1(%a1)
+ clr.l %d0
+ mulu.w #16129,%d3
+ divu.l %d2,%d3
+.L706:
+ move.l %d0,%d5
+ addq.l #1,%d0
+ move.l %d0,%d1
+ muls.l %d0,%d1
+ cmp.l %d1,%d3
+ jcc .L706
+ moveq #60,%d6
+ cmp.l %d5,%d6
+ jcs .L708
+ move.b (%a0,%d5.l),%d5
+.L708:
+ move.b %d5,(%a3)+
+ cmp.l %a1,%d4
+ jne .L709
+ move.l 124(%sp),%a2
+ move.l 92(%sp),%a0
+ lea draws,%a1
+ lea dsmp,%a4
+ move.l (%a1),(%a0,%a2.l*4)
+ tst.l (%a4,%d7.l)
+ jeq .L683
+ move.l 88(%sp),%a1
+ lea dpages,%a0
+ move.l 16(%a0,%a1.l),%a2
+ move.l 124(%sp),%a1
+ lea env_slot,%a0
+ cmp.l (%a0,%a1.l*4),%a2
+ jne .L683
+.L795:
+ lea dsmp,%a0
+ moveq #1,%d3
+ mvz.b 5(%a0,%d7.l),%d4
+ move.l 136(%sp),%a0
+ move.l 144(%sp),%d1
+ move.l 96(%sp),%a1
+ addq.l #8,%a1
+ sub.l 132(%sp),%a0
+ sub.l 140(%sp),%d1
+ move.l %a1,96(%sp)
+ move.l %a0,%d2
+ addq.l #1,%d2
+ move.l %d1,60(%sp)
+ move.l %d2,56(%sp)
+ cmp.l %d4,%d3
+ jcs .L794
+ jra .L714
+.L788:
move.l %d2,%d1
moveq #1,%d6
lsl.l #3,%d1
move.l 144(%sp),%a4
move.l %d1,%a1
addq.l #7,%a1
-.L552:
+.L720:
moveq #7,%d4
and.l %d0,%d4
move.l %d0,%d1
@@ -5013,7 +5916,7 @@ wave_area:
eor.l %d3,%d1
move.b %d1,(%a0)
cmp.l %a4,%d0
- jgt .L553
+ jgt .L721
moveq #7,%d4
and.l %d0,%d4
move.l %d0,%d1
@@ -5028,11 +5931,11 @@ wave_area:
eor.l %d3,%d1
move.b %d1,(%a0)
cmp.l %a4,%d0
- jle .L552
- jra .L553
-.L618:
+ jle .L720
+ jra .L721
+.L784:
move.l 124(%sp),%a1
- move.l 96(%sp),%a2
+ move.l 92(%sp),%a2
lea env_slot,%a0
lea draws,%a4
move.l %d3,(%a0,%a1.l*4)
@@ -5043,268 +5946,11 @@ wave_area:
move.l 124(%sp),%a1
lea env_slot,%a0
cmp.l (%a0,%a1.l*4),%a2
- jne .L515
- jra .L517
+ jne .L683
+ jra .L795
.size wave_area, .-wave_area
- .align 2
- .type grain_ui_tick, @function
-grain_ui_tick:
- lea (-20,%sp),%sp
- move.l 1187521622,%d0
- add.l #-1073741824,%d0
- movem.l #7180,(%sp)
- cmp.l #133169151,%d0
- jhi .L629
- clr.l %d2
-.L633:
- move.l 1187521622,%d1
- add.l #585088,%d1
- add.l %d2,%d1
- move.l %d1,%a3
- move.l %d1,%a0
- move.l %d2,%a1
- add.l #721,%d1
- add.l #269111053,%a1
- lea (34,%a3),%a3
- lea (481,%a0),%a0
-.L632:
- mvz.b (%a3),%d0
- addq.l #1,%a3
- subq.l #1,%d0
- tst.l %d0
- jeq .L647
-.L630:
- lea (30,%a0),%a0
- lea (30,%a1),%a1
- cmp.l %d1,%a0
- jne .L632
-.L651:
- add.l #6322,%d2
- cmp.l #25288,%d2
- jne .L633
-.L629:
- tst.l 1175351520
- jne .L634
- clr.b %d1
- move.b %d1,win_seen
- tst.b adopted.l
- jne .L648
-.L635:
- tst.b setup_visible.l
- jne .L637
- clr.b %d0
- move.b %d0,setup_turned+1
- move.b %d0,setup_turned
-.L637:
- tst.b want_src_page.l
- jeq .L638
- clr.b %d1
- pea 1.w
- pea 34.w
- move.b %d1,want_src_page
- jsr 1074091808
- addq.l #8,%sp
-.L638:
- tst.b pool_direct.l
- jne .L649
-.L628:
- movem.l (%sp),#7180
- lea (20,%sp),%sp
- rts
-.L647:
- mvz.b -421(%a0),%d0
- lea (-421,%a0),%a2
- moveq #71,%d3
- cmp.l %d0,%d3
- jne .L630
- mvz.b 1(%a2),%d0
- moveq #82,%d3
- cmp.l %d0,%d3
- jne .L630
- mvz.b 2(%a2),%d0
- moveq #1,%d3
- cmp.l %d0,%d3
- jne .L630
- move.l %a0,%a2
- move.l %a1,%a4
- mvz.b (%a2)+,%d0
- cmp.l %d0,%d3
- jcc .L650
- move.b (%a0),%d0
- moveq #127,%d3
- and.l %d3,%d0
- move.b %d0,(%a4)+
- move.b %d0,-418(%a0)
- move.b (%a2),%d0
- and.l %d3,%d0
- move.b %d0,(%a4)
- move.b %d0,-417(%a0)
- clr.b %d0
- move.b %d0,418(%a1)
- clr.b (%a0)
- move.b %d0,419(%a1)
- clr.b (%a2)
-.L652:
- lea (30,%a0),%a0
- lea (30,%a1),%a1
- cmp.l %d1,%a0
- jne .L632
- jra .L651
-.L634:
- move.b 269161676,%d2
- tst.b win_seen.l
- jne .L636
- moveq #1,%d3
- move.b %d2,win_track
- move.b %d3,win_seen
- jra .L635
-.L649:
- jsr pool_ours
- tst.l %d0
- jne .L628
- clr.b %d3
- move.b %d3,pool_direct
- movem.l (%sp),#7180
- lea (20,%sp),%sp
- rts
-.L650:
- mvz.b (%a2),%d0
- cmp.l %d0,%d3
- jcc .L630
- move.b (%a0),%d0
- moveq #127,%d3
- and.l %d3,%d0
- move.b %d0,(%a4)+
- move.b %d0,-418(%a0)
- move.b (%a2),%d0
- and.l %d3,%d0
- move.b %d0,(%a4)
- move.b %d0,-417(%a0)
- clr.b %d0
- move.b %d0,418(%a1)
- clr.b (%a0)
- move.b %d0,419(%a1)
- clr.b (%a2)
- jra .L652
-.L648:
- move.b %d1,adopted
- move.b %d1,pool_direct
- jra .L635
-.L636:
- mvz.b %d2,%d0
- moveq #7,%d1
- cmp.l %d0,%d1
- jcs .L635
- move.l #1187521622,%a0
- move.l (%a0),%d1
- add.l #-1073741824,%d1
- cmp.l #133169151,%d1
- jhi .L635
- move.b 269161679,%d1
- move.l (%a0),%a0
- move.l #6322,%d3
- move.l %d0,-(%sp)
- moveq #3,%d0
- add.l #585088,%a0
- and.l %d1,%d0
- muls.l %d3,%d0
- pea (%a0,%d0.l)
- jsr ours
- addq.l #8,%sp
- tst.l %d0
- jne .L635
- move.b %d2,win_track
- jra .L635
- .size grain_ui_tick, .-grain_ui_tick
- .align 2
- .type ptch_text, @function
-ptch_text:
- lea (-32,%sp),%sp
- movem.l #17468,(%sp)
- move.l 36(%sp),%a0
- move.l 40(%sp),%d2
- move.l %d2,%d0
- add.l #-64,%d0
- move.l %d0,%d1
- add.l %d1,%d1
- lea (1,%a0),%a1
- btst #30,%d0
- jne .L671
- moveq #64,%d5
- cmp.l %d2,%d5
- jeq .L661
- moveq #10,%d3
- sub.l %a6,%a6
- move.l %d1,%d0
- divu.l %d3,%d0
- rems.l %d3,%d4:%d1
- move.b #43,(%a0)
- move.l %sp,%d3
- add.l #26,%d3
- move.l %d3,%a0
-.L656:
- move.l %d0,%d2
- moveq #10,%d5
- remu.l %d5,%d1:%d2
- divu.l %d5,%d2
- move.l %d0,%a2
- addq.l #1,%a6
- add.l #48,%d1
- move.b %d1,(%a0)+
- move.l %d2,%d0
- moveq #9,%d1
- cmp.l %a2,%d1
- jcs .L656
- lea (%a6,%d3.l),%a0
- move.l %a1,%a2
-.L657:
- move.b -(%a0),(%a2)+
- cmp.l %a0,%d3
- jne .L657
- clr.b %d2
- move.b %d2,(%a1,%a6.l)
- tst.l %d4
- jeq .L653
- tst.b (%a1)
- jeq .L672
-.L660:
- addq.l #1,%a1
- tst.b (%a1)
- jne .L660
-.L672:
- clr.b %d3
- add.l #48,%d4
- move.b #46,(%a1)
- move.b %d4,1(%a1)
- move.b %d3,2(%a1)
-.L653:
- movem.l (%sp),#17468
- lea (32,%sp),%sp
- rts
-.L661:
- move.l %sp,%d3
- add.l #26,%d3
- move.l %a0,%a1
- clr.l %d4
- clr.l %d0
- sub.l %a6,%a6
- move.l %d3,%a0
- jra .L656
-.L671:
- neg.l %d1
- moveq #10,%d3
- sub.l %a6,%a6
- move.l %d1,%d0
- divu.l %d3,%d0
- rems.l %d3,%d4:%d1
- move.b #45,(%a0)
- move.l %sp,%d3
- add.l #26,%d3
- move.l %d3,%a0
- jra .L656
- .size ptch_text, .-ptch_text
.section .rodata.str1.1
-.LC7:
+.LC11:
.string "OFF"
.text
.align 2
@@ -5315,23 +5961,23 @@ pan_text:
movem.l #17436,(%sp)
move.l 32(%sp),%a0
tst.l %d0
- jgt .L674
+ jgt .L797
move.l %a0,%d0
addq.l #4,%d0
- lea .LC7,%a1
-.L675:
+ lea .LC11,%a1
+.L798:
move.b (%a1)+,(%a0)+
cmp.l %a0,%d0
- jne .L675
+ jne .L798
movem.l (%sp),#17436
lea (28,%sp),%sp
rts
-.L674:
+.L797:
move.l %sp,%d3
add.l #22,%d3
sub.l %a6,%a6
move.l %d3,%a1
-.L677:
+.L800:
move.l %d0,%d2
moveq #10,%d4
remu.l %d4,%d1:%d2
@@ -5343,13 +5989,13 @@ pan_text:
move.l %d2,%d0
moveq #9,%d1
cmp.l %a2,%d1
- jcs .L677
+ jcs .L800
lea (%a6,%d3.l),%a1
move.l %a0,%a2
-.L678:
+.L801:
move.b -(%a1),(%a2)+
cmp.l %a1,%d3
- jne .L678
+ jne .L801
clr.b %d4
move.b %d4,(%a0,%a6.l)
movem.l (%sp),#17436
@@ -5359,31 +6005,36 @@ pan_text:
.align 2
.type knob_value, @function
knob_value:
- lea (-36,%sp),%sp
- moveq #1,%d1
- movem.l #19484,(%sp)
- move.l 52(%sp),%a2
- move.l 40(%sp),%a6
- move.l 44(%sp),%d0
- move.l 48(%sp),%a0
- cmp.l %a2,%d1
- jeq .L715
- mulu.w #30,%d0
- moveq #2,%d1
- cmp.l %a2,%d1
- jeq .L716
- lea 48(%a2,%d0.l),%a1
- move.b (%a0,%a1.l),%d0
- tst.l %a2
- jeq .L717
+ lea (-40,%sp),%sp
+ move.l 56(%sp),%a0
+ movem.l #17436,(%sp)
+ move.l 44(%sp),%a6
+ moveq #1,%d2
+ move.l 48(%sp),%d0
+ move.l 52(%sp),%d1
+ cmp.l %a0,%d2
+ jeq .L833
+ moveq #2,%d2
+ cmp.l %a0,%d2
+ jeq .L834
+ move.l %a0,-(%sp)
+ move.l %d1,-(%sp)
+ move.l %d0,-(%sp)
+ move.l %a0,32(%sp)
+ jsr shown_value
+ lea (12,%sp),%sp
+ move.l 20(%sp),%a0
+ tst.l %a0
+ jeq .L835
mvz.b %d0,%d0
moveq #5,%d1
- cmp.l %a2,%d1
- jeq .L718
- lea (30,%sp),%a3
+ cmp.l %a0,%d1
+ jeq .L836
+ move.l %sp,%d4
+ add.l #34,%d4
sub.l %a1,%a1
- move.l %a3,%a0
-.L700:
+ move.l %d4,%a0
+.L819:
move.l %d0,%d3
moveq #10,%d2
remu.l %d2,%d1:%d3
@@ -5395,25 +6046,33 @@ knob_value:
moveq #9,%d3
move.b %d1,(%a0)+
cmp.l %d2,%d3
- jcs .L700
- lea (%a1,%a3.l),%a0
- move.l %a6,%a2
-.L701:
+ jcs .L819
+ lea (%a1,%d4.l),%a0
+ move.l %a6,%d0
+.L820:
+ move.l %d0,%a2
move.b -(%a0),(%a2)+
- cmp.l %a0,%a3
- jne .L701
-.L711:
- clr.b %d4
- move.b %d4,(%a6,%a1.l)
- movem.l (%sp),#19484
- lea (36,%sp),%sp
+ move.l %a2,%d0
+ cmp.l %a0,%d4
+ jne .L820
+.L829:
+ clr.b %d0
+ move.b %d0,(%a6,%a1.l)
+ movem.l (%sp),#17436
+ lea (40,%sp),%sp
rts
-.L716:
- mvz.b 50(%a0,%d0.l),%d0
- lea (30,%sp),%a3
+.L834:
+ pea 2.w
+ move.l %d1,-(%sp)
+ move.l %d0,-(%sp)
+ jsr shown_value
+ move.l %sp,%d4
+ add.l #46,%d4
+ lea (12,%sp),%sp
sub.l %a1,%a1
- move.l %a3,%a0
-.L696:
+ mvz.b %d0,%d0
+ move.l %d4,%a0
+.L815:
move.l %d0,%d3
moveq #10,%d2
remu.l %d2,%d1:%d3
@@ -5425,136 +6084,111 @@ knob_value:
moveq #9,%d3
move.b %d1,(%a0)+
cmp.l %d2,%d3
- jcs .L696
- lea (%a1,%a3.l),%a0
- move.l %a6,%a2
-.L697:
+ jcs .L815
+ lea (%a1,%d4.l),%a0
+ move.l %a6,%d0
+.L816:
+ move.l %d0,%a2
move.b -(%a0),(%a2)+
- cmp.l %a0,%a3
- jeq .L711
+ move.l %a2,%d0
+ cmp.l %a0,%d4
+ jeq .L829
+ move.l %d0,%a2
move.b -(%a0),(%a2)+
- cmp.l %a0,%a3
- jne .L697
- jra .L711
-.L715:
- lea live_at,%a1
- move.l (%a1,%d0.l*4),%d1
- addq.l #8,%d1
- cmp.l live_tick.l,%d1
- jls .L686
- moveq #12,%d2
- muls.l %d2,%d0
- move.l %d0,%a0
- add.l #live_w+2,%a0
- mvz.w (%a0),%d0
- cmp.l #32767,%d0
- jhi .L710
-.L688:
+ move.l %a2,%d0
+ cmp.l %a0,%d4
+ jne .L816
+ jra .L829
+.L833:
+ move.l %d1,-(%sp)
+ moveq #10,%d3
+ move.l %d0,-(%sp)
+ move.l %a0,28(%sp)
+ jsr shown_pos
+ clr.l %d2
+ lea (42,%sp),%a1
mulu.w #10,%d0
- moveq #10,%d4
- sub.l %a1,%a1
- move.l %sp,%d3
- add.l #30,%d3
- move.l %d3,%a0
+ move.l %a1,32(%sp)
+ addq.l #8,%sp
+ move.l 20(%sp),%a0
lsr.l #8,%d0
- move.l %d0,24(%sp)
- divu.l %d4,%d0
-.L690:
- move.l %d0,%d2
- moveq #10,%d4
- remu.l %d4,%d1:%d2
- divu.l %d4,%d2
- move.l %d0,%a3
- addq.l #1,%a1
- add.l #48,%d1
- move.b %d1,(%a0)+
- move.l %d2,%d0
- moveq #9,%d1
- cmp.l %a3,%d1
- jcs .L690
- lea (%a1,%d3.l),%a0
- move.l %a6,%a3
-.L691:
- move.b -(%a0),(%a3)+
- cmp.l %d3,%a0
- jne .L691
- clr.b %d2
- move.b %d2,(%a6,%a1.l)
+ move.l %d0,28(%sp)
+ move.l %d0,%d1
+ divu.l %d3,%d1
+.L809:
+ move.l %d1,%d4
+ moveq #10,%d3
+ remu.l %d3,%d0:%d4
+ divu.l %d3,%d4
+ addq.l #1,%d2
+ move.l %d1,%d3
+ add.l #48,%d0
+ move.b %d0,(%a1)+
+ move.l %d4,%d1
+ moveq #9,%d0
+ cmp.l %d3,%d0
+ jcs .L809
+ lea (34,%sp),%a1
+ add.l %d2,%a1
+ move.l %a6,%d1
+.L810:
+ move.l %d1,%a2
+ move.b -(%a1),(%a2)+
+ move.l %a2,%d1
+ cmp.l 24(%sp),%a1
+ jne .L810
+ clr.b %d0
+ move.b %d0,(%a6,%d2.l)
tst.b (%a6)
- jeq .L702
+ jeq .L821
lea (1,%a6),%a0
-.L693:
+.L812:
move.l %a0,%a1
tst.b (%a0)+
- jne .L693
+ jne .L812
move.l %a1,%d0
sub.l %a6,%d0
- move.l %d0,%a2
+ move.l %d0,%a0
move.l %d0,%d1
- move.l 24(%sp),%d0
+ move.l 28(%sp),%d0
moveq #10,%d3
- clr.b %d4
move.b #46,(%a1)
+ addq.l #1,%a0
remu.l %d3,%d2:%d0
- addq.l #1,%a2
+ clr.b %d0
addq.l #2,%d1
add.l #48,%d2
- move.b %d2,(%a6,%a2.l)
- move.b %d4,(%a6,%d1.l)
-.L719:
- movem.l (%sp),#19484
- lea (36,%sp),%sp
+ move.b %d2,(%a6,%a0.l)
+ move.b %d0,(%a6,%d1.l)
+.L837:
+ movem.l (%sp),#17436
+ lea (40,%sp),%sp
rts
-.L686:
- mulu.w #30,%d0
- moveq #7,%d3
- move.b 49(%a0,%d0.l),%d1
- add.l #485,%d0
- move.b (%a0,%d0.l),%d0
- mvz.b %d1,%d1
- and.l %d3,%d0
- lsl.l #8,%d1
- lsl.l #5,%d0
- add.l %d1,%d0
- cmp.l #32767,%d0
- jls .L688
-.L710:
- move.l #32767,%d0
- moveq #10,%d4
- mulu.w #10,%d0
- move.l %sp,%d3
- add.l #30,%d3
- sub.l %a1,%a1
- move.l %d3,%a0
- lsr.l #8,%d0
- move.l %d0,24(%sp)
- divu.l %d4,%d0
- jra .L690
-.L718:
- move.l %a6,40(%sp)
- movem.l (%sp),#19484
- move.l %d0,44(%sp)
- lea (36,%sp),%sp
- jra scan_text
-.L717:
- move.l %a6,40(%sp)
- movem.l (%sp),#19484
+.L835:
+ move.l %a6,44(%sp)
+ movem.l (%sp),#17436
mvz.b %d0,%d0
- move.l %d0,44(%sp)
- lea (36,%sp),%sp
+ move.l %d0,48(%sp)
+ lea (40,%sp),%sp
jra ptch_text
-.L702:
- move.l 24(%sp),%d0
+.L836:
+ move.l %a6,44(%sp)
+ movem.l (%sp),#17436
+ move.l %d0,48(%sp)
+ lea (40,%sp),%sp
+ jra scan_text
+.L821:
+ move.l 28(%sp),%d0
moveq #10,%d3
- clr.b %d4
move.l %a6,%a1
moveq #2,%d1
- remu.l %d3,%d2:%d0
move.b #46,(%a1)
+ remu.l %d3,%d2:%d0
+ clr.b %d0
add.l #48,%d2
- move.b %d2,(%a6,%a2.l)
- move.b %d4,(%a6,%d1.l)
- jra .L719
+ move.b %d2,(%a6,%a0.l)
+ move.b %d0,(%a6,%d1.l)
+ jra .L837
.size knob_value, .-knob_value
.align 2
.globl gran_init
@@ -5563,13 +6197,13 @@ gran_init:
move.l 4(%sp),%a1
move.l %a1,%d0
move.l %a1,%a0
- add.l #2008,%d0
-.L721:
+ add.l #2024,%d0
+.L839:
clr.b (%a0)+
cmp.l %a0,%d0
- jne .L721
+ jne .L839
move.l #625341585,%d0
- move.l %d0,2000(%a1)
+ move.l %d0,2016(%a1)
rts
.size gran_init, .-gran_init
.align 2
@@ -5579,14 +6213,14 @@ gran_trigger:
move.l 8(%sp),%d0
moveq #7,%d1
cmp.l %d0,%d1
- jcs .L725
- move.l #250,%d1
+ jcs .L843
+ move.l #252,%d1
muls.l %d1,%d0
move.l 4(%sp),%a0
add.l %d0,%a0
moveq #1,%d0
move.b %d0,241(%a0)
-.L725:
+.L843:
rts
.size gran_trigger, .-gran_trigger
.align 2
@@ -5598,12 +6232,12 @@ gran_params:
movem.l #3100,(%sp)
move.l 40(%sp),%a2
tst.l %a0
- jeq .L730
+ jeq .L848
move.l (%a0),%d2
tst.l %d2
- jeq .L730
+ jeq .L848
move.b (%a2),%d1
- jmi .L742
+ jmi .L860
mvz.b %d1,%d1
mvz.b 11(%a2),%d0
moveq #15,%d3
@@ -5613,7 +6247,7 @@ gran_params:
or.l %d0,%d1
move.l %d2,%d0
lsr.l %d3,%d0
- move.l #250,%d3
+ move.l #252,%d3
muls.l %d3,%d4
move.l %d4,%a1
move.l %d2,%d4
@@ -5629,11 +6263,11 @@ gran_params:
add.l %d3,%d1
move.l %d1,208(%a0)
move.b 3(%a2),%d1
- jmi .L743
-.L756:
+ jmi .L861
+.L874:
mvz.b %d1,%d1
lsl.l #8,%d1
-.L734:
+.L852:
move.w %d1,%d3
muls.l %d0,%d1
moveq #9,%d4
@@ -5650,20 +6284,20 @@ gran_params:
move.l %d1,216(%a3)
move.l (%a0),%d1
cmp.l %d1,%d2
- jhi .L735
+ jhi .L853
move.l %d1,%d0
remu.l %d2,%d3:%d0
move.l %d3,(%a0)
-.L735:
+.L853:
move.l 32(%sp),%a0
add.l %a1,%a0
move.l %d2,236(%a0)
moveq #127,%d4
mvz.b 1(%a2),%d1
cmp.l %d1,%d4
- jcc .L736
+ jcc .L854
moveq #127,%d1
-.L736:
+.L854:
lea gran_size,%a0
move.l (%a0,%d1.l*4),%d2
move.l 32(%sp),%a0
@@ -5673,36 +6307,36 @@ gran_params:
mvz.b %d1,%d0
move.l %d0,%a0
tst.b %d1
- jge .L737
+ jge .L855
moveq #127,%d1
move.w #127,%a0
-.L737:
+.L855:
tst.b 7(%a2)
- jeq .L738
+ jeq .L856
tst.l 48(%sp)
- jne .L755
-.L738:
+ jne .L873
+.L856:
lea gran_dens,%a2
mvz.w (%a2,%a0.l*2),%d1
move.l 32(%sp),%a0
add.l %a1,%a0
- clr.l 242(%a0)
+ clr.l 244(%a0)
move.l %d1,%d0
muls.l %d2,%d0
lsr.l #8,%d0
- jne .L751
+ jne .L869
moveq #1,%d0
-.L751:
+.L869:
movem.l (%sp),#3100
move.l %d0,224(%a0)
lea (28,%sp),%sp
rts
-.L742:
+.L860:
moveq #15,%d3
move.l 36(%sp),%d4
move.l %d2,%d0
lsr.l %d3,%d0
- move.l #250,%d3
+ move.l #252,%d3
muls.l %d3,%d4
move.l #32512,%d1
move.l %d1,%d3
@@ -5720,13 +6354,13 @@ gran_params:
add.l %d3,%d1
move.l %d1,208(%a0)
move.b 3(%a2),%d1
- jpl .L756
-.L743:
+ jpl .L874
+.L861:
move.l #32512,%d1
- jra .L734
-.L730:
+ jra .L852
+.L848:
move.l 36(%sp),%d1
- move.l #250,%d0
+ move.l #252,%d0
movem.l (%sp),#3100
move.l 32(%sp),%a0
muls.l %d0,%d1
@@ -5734,7 +6368,7 @@ gran_params:
clr.l 220(%a0)
lea (28,%sp),%sp
rts
-.L755:
+.L873:
ext.w %d1
lea gran_div,%a2
move.l 48(%sp),%d3
@@ -5743,37 +6377,37 @@ gran_params:
mulu.w #11,%d1
lsr.l #7,%d1
mvz.b (%a2,%d1.l),%d2
- cmp.l 242(%a0),%d3
- jeq .L757
-.L739:
+ cmp.l 244(%a0),%d3
+ jeq .L875
+.L857:
move.l 48(%sp),%d4
move.l #254016000,%d1
divu.l %d4,%d1
cmp.l %d1,%d2
- jhi .L744
+ jhi .L862
divu.l %d2,%d1
move.l 48(%sp),%d4
move.l 32(%sp),%a0
add.l %a1,%a0
- move.l %d2,246(%a0)
- move.l %d4,242(%a0)
+ move.l %d2,248(%a0)
+ move.l %d4,244(%a0)
move.l %d1,224(%a0)
-.L758:
+.L876:
movem.l (%sp),#3100
lea (28,%sp),%sp
rts
-.L744:
+.L862:
move.l 48(%sp),%d4
moveq #1,%d1
move.l 32(%sp),%a0
add.l %a1,%a0
move.l %d1,224(%a0)
- move.l %d4,242(%a0)
- move.l %d2,246(%a0)
- jra .L758
-.L757:
- cmp.l 246(%a0),%d2
- jne .L739
+ move.l %d4,244(%a0)
+ move.l %d2,248(%a0)
+ jra .L876
+.L875:
+ cmp.l 248(%a0),%d2
+ jne .L857
movem.l (%sp),#3100
lea (28,%sp),%sp
rts
@@ -5782,95 +6416,97 @@ gran_params:
.globl gran_render
.type gran_render, @function
gran_render:
- link.w %fp,#-356
- move.l 16(%fp),%a1
- move.l #250,%d0
+ link.w %fp,#-376
+ move.l 12(%fp),%d1
movem.l #15612,(%sp)
- move.l 12(%fp),%d2
- moveq #3,%d1
- move.l 8(%fp),%a0
- muls.l %d0,%d2
- move.l 20(%fp),%a4
- mvz.b 4(%a1),%d0
- cmp.l %d0,%d1
- jcs .L856
- lea gran_shapes,%a2
- move.l (%a2,%d0.l*4),%a2
- move.l %a2,-298(%fp)
-.L760:
- move.l 36(%fp),%d6
+ move.l #252,%d2
+ moveq #3,%d3
+ muls.l %d2,%d1
+ move.l 16(%fp),%a2
+ move.l 20(%fp),%a3
+ move.l %d1,-288(%fp)
+ mvz.b 4(%a2),%d0
+ cmp.l %d0,%d3
+ jcs .L996
+ lea gran_shapes,%a0
+ move.l (%a0,%d0.l*4),%a0
+ move.l %a0,-316(%fp)
+.L878:
+ move.l 36(%fp),%d7
moveq #32,%d0
- cmp.l %d6,%d0
- jcc .L761
- moveq #32,%d6
-.L761:
- tst.l %a4
- jeq .L920
- mvz.b 5(%a4),%d1
+ cmp.l %d7,%d0
+ jcc .L879
+ moveq #32,%d7
+.L879:
+ tst.l %a3
+ jeq .L1075
+ mvz.b 5(%a3),%d1
moveq #1,%d0
cmp.l %d1,%d0
- jcc .L921
+ jcc .L1076
move.l %d0,%a5
- tst.l 6(%a4)
- jeq .L922
-.L766:
- move.l (%a4),%d4
+ tst.l 6(%a3)
+ jeq .L1077
+.L884:
+ move.l (%a3),%a4
tst.l 36(%fp)
- jeq .L923
-.L763:
- lea (-256,%fp),%a2
+ jeq .L1078
+.L881:
+ move.l %fp,%d1
+ add.l #-256,%d1
clr.l %d0
- move.l %a2,%a3
-.L769:
- clr.l 4(%a3)
- clr.l (%a3)
+ move.l %d1,%a0
+.L887:
+ clr.l 4(%a0)
+ clr.l (%a0)
addq.l #1,%d0
- addq.l #8,%a3
- cmp.l %d0,%d6
- jhi .L769
- tst.l %d4
- jne .L771
+ addq.l #8,%a0
+ cmp.l %d0,%d7
+ jhi .L887
+ tst.l %a4
+ jne .L889
tst.l %a5
- jeq .L772
+ jeq .L890
move.l 32(%fp),%a3
+ move.l %d1,%a2
clr.l %d3
move.l #32767,%d5
move.l #-32768,%d4
-.L851:
+.L988:
move.l (%a2),%a1
move.l %a1,%d0
move.l 4(%a2),%a0
- move.l %a1,%d1
sub.l %a0,%d0
- add.l %a0,%d1
+ move.l %a0,%d1
+ add.l %a1,%d1
move.l %d0,%d2
- move.l %d1,%d7
+ move.l %d1,%d6
add.l #32768,%d2
- add.l #32768,%d7
- or.l %d7,%d2
+ add.l #32768,%d6
+ or.l %d6,%d2
cmp.l #65536,%d2
- jcs .L842
+ jcs .L979
cmp.l #-32768,%a1
- jge .L843
+ jge .L980
move.l %d4,%a1
-.L844:
+.L981:
cmp.l #-32768,%a0
- jge .L845
+ jge .L982
move.l %d4,%a0
-.L846:
+.L983:
move.l %a0,%d1
add.l %a1,%d1
cmp.l #-32768,%d1
- jge .L847
+ jge .L984
move.l %d4,%d1
-.L848:
+.L985:
move.l %a1,%d0
sub.l %a0,%d0
cmp.l #-32768,%d0
- jge .L849
-.L924:
+ jge .L986
+.L1079:
move.l %d4,%d0
-.L842:
+.L979:
swap %d1
clr.w %d1
swap %d0
@@ -5880,23 +6516,23 @@ gran_render:
addq.l #8,%a2
move.l %d1,-8(%a3)
move.l %d0,-4(%a3)
- cmp.l %d3,%d6
- jhi .L851
-.L759:
- movem.l -356(%fp),#15612
+ cmp.l %d3,%d7
+ jhi .L988
+.L877:
+ movem.l -376(%fp),#15612
unlk %fp
rts
-.L847:
+.L984:
cmp.l #32767,%d1
- jle .L848
+ jle .L985
move.l %a1,%d0
move.l %d5,%d1
sub.l %a0,%d0
cmp.l #-32768,%d0
- jlt .L924
-.L849:
+ jlt .L1079
+.L986:
cmp.l #32767,%d0
- jle .L842
+ jle .L979
move.l %d5,%d0
addq.l #8,%a3
swap %d1
@@ -5907,407 +6543,507 @@ gran_render:
addq.l #8,%a2
move.l %d1,-8(%a3)
move.l %d0,-4(%a3)
- cmp.l %d3,%d6
- jhi .L851
- jra .L759
-.L845:
+ cmp.l %d3,%d7
+ jhi .L988
+ jra .L877
+.L982:
cmp.l #32767,%a0
- jle .L846
+ jle .L983
move.l %d5,%a0
- jra .L846
-.L843:
+ jra .L983
+.L980:
cmp.l #32767,%a1
- jle .L844
+ jle .L981
move.l %d5,%a1
- jra .L844
-.L856:
- lea gran_hann,%a2
- move.l %a2,-298(%fp)
- jra .L760
-.L921:
+ jra .L981
+.L996:
+ lea gran_hann,%a0
+ move.l %a0,-316(%fp)
+ jra .L878
+.L1076:
clr.l %d0
move.l %d0,%a5
- tst.l 6(%a4)
- jne .L766
-.L922:
- tst.l 10(%a4)
- jne .L766
- clr.l %d4
+ tst.l 6(%a3)
+ jne .L884
+.L1077:
+ tst.l 10(%a3)
+ jne .L884
+ sub.l %a4,%a4
tst.l 36(%fp)
- jne .L763
- moveq #1,%d3
- cmp.l %d1,%d3
- jcs .L759
-.L764:
- clr.l %d4
-.L914:
- lea (-256,%fp),%a2
-.L772:
- move.l %d4,-(%sp)
- move.l %d6,-(%sp)
- move.l %a2,-(%sp)
- move.l -298(%fp),-(%sp)
+ jne .L881
+ moveq #1,%d2
+ cmp.l %d1,%d2
+ jcs .L877
+.L882:
+ sub.l %a4,%a4
+.L1069:
+ move.l %fp,%d1
+ add.l #-256,%d1
+.L890:
+ move.l %a4,-(%sp)
+ move.l %d7,-(%sp)
+ move.l %d1,-(%sp)
+ move.l -316(%fp),-(%sp)
move.l 28(%fp),-(%sp)
+ move.l 8(%fp),%a1
+ move.l -288(%fp),%a5
move.l 24(%fp),-(%sp)
- move.l %a4,-(%sp)
- pea (%a0,%d2.l)
+ move.l %a3,-(%sp)
+ pea (%a1,%a5.l)
jsr (mix_other.constprop.0)
lea (32,%sp),%sp
-.L841:
+.L978:
tst.l 36(%fp)
- jeq .L759
- lea (-256,%fp),%a2
- clr.l %d3
+ jeq .L877
+ move.l %fp,%d1
+ add.l #-256,%d1
move.l 32(%fp),%a3
+ move.l %d1,%a2
+ clr.l %d3
move.l #32767,%d5
move.l #-32768,%d4
- jra .L851
-.L923:
- tst.l %d4
- jeq .L925
-.L771:
- lea (%a0,%d2.l),%a2
- tst.b 241(%a2)
- jeq .L774
- move.w #256,%d7
- move.l %d2,%d0
+ jra .L988
+.L1078:
+ tst.l %a4
+ jeq .L1080
+.L889:
+ move.l 8(%fp),%a0
+ add.l -288(%fp),%a0
+ tst.b 241(%a0)
+ jeq .L892
+ move.w #256,%d1
+ move.l 8(%fp),%a1
+ clr.l %d3
+ move.l -288(%fp),%d0
add.l #240,%d0
- clr.l %d5
- move.w %d7,(%a0,%d0.l)
- clr.l 232(%a2)
- move.l 208(%a2),212(%a2)
- clr.l 228(%a2)
-.L775:
- lea (%a0,%d2.l),%a2
- move.l 220(%a2),%d0
- move.l %d0,-286(%fp)
- tst.l %d0
- jeq .L776
- cmp.l %d5,%d6
- jls .L926
- lea 8(%a0,%d2.l),%a3
- move.l %d4,-274(%fp)
- move.l %a3,-306(%fp)
- lea (208,%a2),%a3
- move.l %a3,-282(%fp)
- lea (212,%a2),%a3
- move.l %a3,-278(%fp)
- lea (228,%a2),%a3
- move.l %a3,-302(%fp)
- lea (216,%a2),%a3
- move.l %a3,-294(%fp)
- move.l -286(%fp),%a3
- lea (224,%a2),%a2
- move.l %a2,-290(%fp)
-.L797:
+ move.w %d1,(%a1,%d0.l)
+ clr.l 232(%a0)
+ move.l 208(%a0),212(%a0)
+ clr.l 228(%a0)
+.L893:
+ move.l 8(%fp),%a0
+ add.l -288(%fp),%a0
+ move.l 220(%a0),%d2
+ move.l %d2,-324(%fp)
+ tst.l %d2
+ jeq .L894
+ cmp.l %d3,%d7
+ jls .L895
+ tst.l 28(%fp)
+ sne %d1
+ move.l 24(%fp),%d0
+ mvs.b %d1,%d1
+ sub.l %d1,%d0
+ cmp.l 24(%fp),%d1
+ jne .L896
+ moveq #1,%d0
+.L896:
+ move.l 24(%fp),%d4
+ move.l 24(%fp),%d1
+ neg.l %d1
+ add.l %d4,%d4
+ subx.l %d4,%d4
+ neg.l %d4
+ move.l %d4,-268(%fp)
+ tst.l 24(%fp)
+ jge .L897
+ move.l -288(%fp),%a1
+ move.l 8(%fp),%a0
+ move.l %d1,-276(%fp)
+ move.l 8(%fp),%d0
+ lea 8(%a0,%a1.l),%a0
+ move.l -324(%fp),%d1
+ move.l %a4,-296(%fp)
+ add.l -288(%fp),%d0
+ move.l -276(%fp),%d2
+ move.l -288(%fp),%a4
+ move.l %a5,-330(%fp)
+ move.l %d0,%a1
+ lea (212,%a1),%a1
+ muls.l %d2,%d1
+ move.l %a0,-320(%fp)
+ move.l %a1,-284(%fp)
+ addq.l #4,%a1
+ move.l %d0,%a0
+ lea (208,%a0),%a0
+ move.l %a1,-308(%fp)
+ addq.l #8,%a1
+ move.l %a0,-280(%fp)
+ lea (20,%a0),%a0
+ move.l %a1,-300(%fp)
+ move.l %a0,-312(%fp)
+ lea (14,%a0),%a0
+ move.l 8(%fp),%a1
+ move.l %d1,-272(%fp)
+ move.l %a0,-304(%fp)
+.L899:
+ move.l -320(%fp),%a0
clr.l %d0
- move.l -306(%fp),%a2
-.L783:
- lea (32,%a2),%a2
- tst.l -32(%a2)
- jeq .L927
+ move.l -330(%fp),%a5
+.L904:
+ lea (32,%a0),%a0
+ move.l -32(%a0),%d1
+ tst.l %d1
+ jeq .L1081
addq.l #1,%d0
moveq #6,%d1
cmp.l %d0,%d1
- jne .L783
- lea (%a0,%d2.l),%a2
- move.l 224(%a2),%d1
- move.l %d6,%d3
- move.l -274(%fp),%d4
- sub.l %d5,%d3
- cmp.l %d3,%d1
- jcs .L928
+ jne .L904
+ move.l 8(%fp),%a0
+ move.l %d7,%d2
+ move.l -296(%fp),%a4
+ sub.l %d3,%d2
+ add.l -288(%fp),%a0
+ move.l 224(%a0),%d1
+ cmp.l %d2,%d1
+ jcs .L1082
move.l %d1,%d0
- sub.l %d6,%d0
- add.l %d0,%d5
-.L785:
- lea (%a0,%d2.l),%a2
- move.l %d5,204(%a2)
- move.b 9(%a1),%d0
- jeq .L779
- move.l (%a4),%d1
+ sub.l %d7,%d0
+ add.l %d0,%d3
+.L906:
+ move.l 8(%fp),%a0
+ add.l -288(%fp),%a0
+ move.l %d3,204(%a0)
+ move.b 9(%a2),%d0
+ jeq .L900
+ move.l (%a3),%d1
tst.l %d1
- jeq .L779
+ jeq .L900
ext.w %d0
- moveq #11,%d5
- lea (232,%a2),%a2
- move.l (%a2),%a1
- muls.w %d6,%d0
- move.l %d0,%d3
- lsl.l %d5,%d3
+ moveq #11,%d3
+ lea (232,%a0),%a0
+ move.l (%a0),%a1
+ muls.w %d7,%d0
+ move.l %d0,%d2
+ lsl.l %d3,%d2
btst #20,%d0
- jne .L798
- move.l %d3,%d5
- mvz.w %d5,%d5
- clr.w %d3
- swap %d3
- move.l %d5,%d0
- add.l %a1,%d0
- move.l %d0,%d5
- mvz.w %d0,%d0
- clr.w %d5
- swap %d5
- move.l %d0,(%a2)
+ jne .L928
+ move.l %d2,%d3
+ mvz.w %d3,%d3
+ clr.w %d2
+ swap %d2
move.l %d3,%d0
- add.l %d5,%d0
- cmp.l %d1,%d0
- jcs .L799
+ add.l %a1,%d0
move.l %d0,%d3
- remu.l %d1,%d7:%d3
- move.l %d7,%d0
-.L799:
- lea (%a0,%d2.l),%a1
- add.l 228(%a1),%d0
- lea (228,%a1),%a1
+ mvz.w %d0,%d0
+ clr.w %d3
+ swap %d3
+ move.l %d0,(%a0)
+ move.l %d2,%d0
+ add.l %d3,%d0
+ cmp.l %d1,%d0
+ jcs .L929
+ move.l %d0,%d2
+ remu.l %d1,%d4:%d2
+ move.l %d4,%d0
+.L929:
+ move.l 8(%fp),%a0
+ add.l -288(%fp),%a0
+ add.l 228(%a0),%d0
+ lea (228,%a0),%a0
cmp.l %d1,%d0
- jcs .L913
+ jcs .L1068
sub.l %d1,%d0
-.L913:
- move.l %d0,(%a1)
-.L779:
+.L1068:
+ move.l %d0,(%a0)
+.L900:
tst.l %a5
- jeq .L914
+ jeq .L1069
+ tst.l 24(%fp)
+ jlt .L1083
tst.l 28(%fp)
sne %d0
- tst.l 24(%fp)
- jlt .L929
- mvs.b %d0,%d1
- move.l 24(%fp),%d3
- neg.l %d0
- move.b %d0,-265(%fp)
- mvz.b %d0,%d0
- sub.l %d1,%d3
- move.l %d3,-286(%fp)
- move.l -286(%fp),%d5
- move.l %d6,%d1
- subq.l #1,%d1
- lea (%a0,%d2.l),%a1
- add.l #192,%d2
- muls.l %d1,%d5
- add.l %a0,%d2
- move.l %a1,%a2
- move.l %a1,%a3
- move.l %d0,-270(%fp)
- move.l %a1,-306(%fp)
- move.l %d2,-302(%fp)
- move.l %a1,-274(%fp)
- move.l %d5,-282(%fp)
- lea (196,%a2),%a2
- lea (200,%a3),%a3
- move.l %d6,-294(%fp)
-.L840:
- move.l -306(%fp),%a5
+ move.l %a4,%d6
+ move.l 24(%fp),%d1
+ move.l 8(%fp),%a0
+ move.l %d7,-312(%fp)
+ add.l -288(%fp),%a0
+ mvs.b %d0,%d0
+ move.l %a0,%a1
+ lea (242,%a1),%a1
+ move.l %a0,-324(%fp)
+ sub.l %d0,%d1
+ move.l %d1,-304(%fp)
+ move.l -304(%fp),%d2
+ move.l %d7,%d0
+ subq.l #1,%d0
+ move.l %a0,-300(%fp)
+ muls.l %d0,%d2
+ move.l -288(%fp),%d0
+ add.l #192,%d0
+ add.l 8(%fp),%d0
+ move.l %a1,-308(%fp)
+ move.l %d0,-320(%fp)
+ move.l %a4,%d0
+ add.l %d0,%d0
+ move.l %d2,-296(%fp)
+ subq.l #1,%d0
+ move.l %d0,-280(%fp)
+.L977:
+ move.l -324(%fp),%a5
move.l 8(%a5),%d0
tst.l %d0
- jeq .L807
- move.l 20(%a5),%d5
+ jeq .L937
+ move.l 20(%a5),%d7
clr.l 20(%a5)
- cmp.l -294(%fp),%d5
- jcs .L808
- sub.l -294(%fp),%d5
- move.l %d5,20(%a5)
-.L807:
+ cmp.l -312(%fp),%d7
+ jcs .L938
+ sub.l -312(%fp),%d7
+ move.l %d7,20(%a5)
+.L937:
moveq #32,%d0
- add.l %d0,-306(%fp)
- move.l -306(%fp),%a0
- cmp.l -302(%fp),%a0
- jne .L840
- move.l -294(%fp),%d6
- jra .L841
-.L920:
+ add.l %d0,-324(%fp)
+ move.l -324(%fp),%a0
+ cmp.l -320(%fp),%a0
+ jne .L977
+ move.l -312(%fp),%d7
+ jra .L978
+.L1075:
tst.l 36(%fp)
- jeq .L764
- lea (-256,%fp),%a2
- clr.l %d4
+ jeq .L882
+ move.l %fp,%d1
+ add.l #-256,%d1
+ sub.l %a4,%a4
sub.l %a5,%a5
clr.l %d0
- move.l %a2,%a3
- jra .L769
-.L774:
- move.l 204(%a2),%d5
- tst.b 240(%a2)
- jne .L775
-.L776:
- lea (%a0,%d2.l),%a1
- move.l %d5,204(%a1)
- jra .L779
-.L927:
- tst.b 8(%a1)
- jeq .L930
- move.l -278(%fp),%a2
- move.l (%a2),%d1
-.L786:
- move.l -302(%fp),%a2
- move.l (%a2),%d4
+ move.l %d1,%a0
+ jra .L887
+.L892:
+ move.l 204(%a0),%d3
+ tst.b 240(%a0)
+ jne .L893
+.L894:
+ move.l 8(%fp),%a0
+ add.l -288(%fp),%a0
+ move.l %d3,204(%a0)
+ jra .L900
+.L1081:
+ move.l %a5,-330(%fp)
+ tst.b 8(%a2)
+ jeq .L1084
+ move.l -284(%fp),%a0
+ move.l (%a0),%d5
+.L907:
+ move.l -312(%fp),%a0
+ move.l (%a0),%d4
tst.l %d4
- jeq .L788
- move.l (%a4),%d3
- add.l %d4,%d1
- cmp.l %d1,%d3
- jhi .L788
- sub.l %d3,%d1
-.L788:
- move.l -294(%fp),%a2
- move.l (%a2),%d7
- tst.l %d7
- jeq .L790
- move.l 2000(%a0),%d3
- move.l #1664525,%d4
- muls.l %d4,%d3
- move.l %d7,%d4
- clr.w %d4
- swap %d4
- move.l %d3,%a2
- move.l %d7,%d3
- lsr.l #5,%d3
- add.l #1013904223,%a2
- lsr.l #1,%d7
- move.l %a2,2000(%a0)
- move.l %d4,-286(%fp)
- move.l %a2,%d4
- clr.w %d4
- swap %d4
- move.l %d7,-270(%fp)
- moveq #11,%d7
- and.l #2047,%d3
- mulu.w %d4,%d3
- mulu.w -284(%fp),%d4
- lsr.l %d7,%d3
- add.l %d4,%d3
- add.l %d1,%d3
- move.l %d3,%d1
- sub.l -270(%fp),%d1
-.L790:
- move.l (%a4),%d3
- tst.l %d1
- jlt .L931
-.L791:
- cmp.l %d1,%d3
- jhi .L792
- sub.l %d3,%d1
- cmp.l %d1,%d3
- jhi .L792
- move.l %d3,%d1
- subq.l #1,%d1
-.L792:
- move.l #16777216,%d4
- move.l %a3,%d7
- divu.l %d7,%d4
+ jne .L908
+ move.l %d5,%a0
+.L909:
+ move.l -308(%fp),%a5
+ move.l (%a5),%d4
+ tst.l %d4
+ jeq .L911
+ move.l 2016(%a1),%d6
+ move.l %d4,%d5
+ clr.w %d5
+ swap %d5
+ move.l #1664525,%d2
+ muls.l %d2,%d6
+ move.l %d4,%d2
+ lsr.l #5,%d2
+ lsr.l #1,%d4
+ and.l #2047,%d2
+ add.l #1013904223,%d6
+ move.l %d5,%a5
+ move.l %d6,%d5
+ clr.w %d5
+ swap %d5
+ move.l %d6,2016(%a1)
+ move.w %a5,%d6
+ mulu.w %d5,%d2
+ mulu.w %d6,%d5
+ moveq #11,%d6
+ lsr.l %d6,%d2
+ add.l %d5,%d2
+ add.l %a0,%d2
+ move.l %d2,%a0
+ sub.l %d4,%a0
+.L911:
+ move.l -304(%fp),%a5
+ moveq #1,%d2
+ move.b (%a5),-325(%fp)
+ mvz.b -325(%fp),%d4
+ cmp.l %d4,%d2
+ jeq .L912
+ move.l -324(%fp),%d6
+ move.l #16777216,%d2
lsl.l #5,%d0
- move.l %d0,%d3
- add.l %d2,%d3
- move.l %d1,(%a0,%d3.l)
- lea (%a0,%d3.l),%a2
- clr.l 4(%a2)
- move.l %a3,8(%a2)
- clr.l 12(%a2)
- move.l %d4,16(%a2)
- move.l %d5,20(%a2)
- mvz.b 5(%a1),%d1
- tst.l %d1
- jeq .L793
- moveq #126,%d3
- cmp.l %d1,%d3
- jcs .L859
- move.l 2000(%a0),%d3
- move.l #1664525,%d4
- moveq #64,%d7
- muls.l %d4,%d3
- add.l #1013904223,%d3
- move.l %d3,2000(%a0)
- cmp.l %d1,%d7
- jeq .L860
- swap %d1
- clr.w %d1
- moveq #127,%d7
- clr.w %d3
- swap %d3
- add.l #63,%d1
- divu.l %d7,%d1
- moveq #1,%d4
- swap %d4
- sub.l %d1,%d4
- cmp.l %d3,%d4
- sls %d3
- mvs.b %d3,%d1
- neg.l %d1
-.L793:
- move.l %d0,%a2
- add.l %d2,%a2
- add.l %a0,%a2
- move.l %d1,24(%a2)
- clr.l 28(%a2)
- move.b 6(%a1),%d1
- jeq .L795
- move.l 2004(%a0),%d4
- move.l #1664525,%d3
+ divu.l %d6,%d2
+ move.l %a4,%d5
+ add.l %d0,%d5
+ move.l %a0,(%a1,%d5.l)
+ add.l %a1,%d5
+ move.l %d5,%a5
+ clr.l 4(%a5)
+ move.l %d6,8(%a5)
+ clr.l 12(%a5)
+ move.l %d2,16(%a5)
+ move.l %d3,20(%a5)
+ mvz.b 5(%a2),%d2
+ tst.l %d2
+ jeq .L1085
+ moveq #126,%d6
+ cmp.l %d2,%d6
+ jcs .L1086
+.L917:
+ move.l 2016(%a1),%d6
+ move.l #1664525,%d5
+ muls.l %d5,%d6
+ add.l #1013904223,%d6
+ move.l %d6,-334(%fp)
+ move.l %d6,2016(%a1)
+ moveq #64,%d6
+ cmp.l %d2,%d6
+ jeq .L999
+ swap %d2
+ clr.w %d2
+ moveq #127,%d5
+ move.l %d2,%a5
+ lea (63,%a5),%a5
+ move.l %a5,%d2
+ divu.l %d5,%d2
+ moveq #1,%d5
+ swap %d5
+ move.l -334(%fp),%d6
+ clr.w %d6
+ swap %d6
+ sub.l %d2,%d5
+ cmp.l %d6,%d5
+ sls %d6
+ moveq #1,%d5
+ mvs.b %d6,%d2
+ move.l %d0,%d6
+ add.l %a4,%d6
+ neg.l %d2
+ move.l %d2,24(%a1,%d6.l)
+ cmp.l %d4,%d5
+ jeq .L918
+.L919:
+ tst.l %a0
+ jlt .L921
+ move.l (%a3),%d1
+ cmp.l %d1,%a0
+ jcs .L1066
+ tst.l %d2
+ jeq .L993
+ subq.l #1,%d1
+.L921:
+ lea (%a4,%d0.l),%a0
+ subq.l #2,%d4
+ move.l %d1,(%a0,%a1.l)
+ tst.l %d4
+ jne .L918
+ cmp.l -268(%fp),%d2
+ jeq .L923
+ move.l %d1,%d2
+ addq.l #1,%d2
+.L924:
+ cmp.l -272(%fp),%d2
+ jcc .L918
+ cmp.l -276(%fp),%d2
+ jcs .L1002
+ move.l -276(%fp),%d4
+ move.l %d2,%d1
+ move.l #16777216,%d2
+ lea (%a4,%d0.l),%a0
+ divu.l %d4,%d1
+ add.l %a1,%a0
+ divu.l %d1,%d2
+ move.l %d1,8(%a0)
+ move.l %d2,16(%a0)
+.L918:
+ move.l %d0,%d1
+ add.l %a4,%d1
+ clr.l 28(%a1,%d1.l)
+ move.b 6(%a2),%d1
+ jeq .L926
+ move.l 2020(%a1),%d4
+ move.l #1664525,%d6
mvz.b %d1,%d1
- muls.l %d3,%d4
+ muls.l %d6,%d4
add.l #1013904223,%d4
- move.l %d4,%d3
- clr.w %d3
- swap %d3
- move.l %d4,2004(%a0)
+ move.l %d4,%d2
+ clr.w %d2
+ swap %d2
+ move.l %d4,2020(%a1)
moveq #126,%d4
- add.l #-32768,%d3
+ add.l #-32768,%d2
cmp.l %d1,%d4
- jcs .L796
- muls.l %d1,%d3
- moveq #127,%d7
- divs.l %d7,%d3
-.L796:
- add.l %d2,%d0
- move.l %d3,28(%a0,%d0.l)
-.L795:
- move.l -290(%fp),%a2
- add.l (%a2),%d5
- cmp.l %d5,%d6
- jhi .L797
- move.l -274(%fp),%d4
- sub.l %d6,%d5
- jra .L785
-.L931:
- add.l %d3,%d1
- jra .L791
-.L808:
- move.l -294(%fp),%d3
- sub.l %d5,%d3
+ jcs .L927
+ muls.l %d1,%d2
+ moveq #127,%d5
+ divs.l %d5,%d2
+.L927:
+ add.l %a4,%d0
+ move.l %d2,28(%a1,%d0.l)
+.L926:
+ move.l -300(%fp),%a0
+ add.l (%a0),%d3
+ cmp.l %d3,%d7
+ jhi .L899
+ move.l -296(%fp),%a4
+ sub.l %d7,%d3
+ move.l -330(%fp),%a5
+ jra .L906
+.L1086:
+ moveq #1,%d2
+ move.l %d2,24(%a5)
+ jra .L919
+.L1085:
+ clr.l 24(%a5)
+ tst.l %a0
+ jlt .L1006
+ move.l (%a3),%d1
+ cmp.l %d1,%a0
+ jcs .L1066
+.L993:
+ tst.b -325(%fp)
+ jne .L1001
+ move.l %d0,%d1
+ add.l %a4,%d1
+ clr.l (%a1,%d1.l)
+ jra .L918
+.L938:
+ move.l -312(%fp),%d3
+ sub.l %d7,%d3
cmp.l %d3,%d0
- jcc .L809
+ jcc .L939
move.l %d0,%d3
-.L809:
- move.l -306(%fp),%a0
+.L939:
+ move.l -324(%fp),%a0
sub.l %d3,%d0
move.l %d0,8(%a0)
tst.l 24(%a0)
- jeq .L861
- mvz.b -265(%fp),%d0
- move.l -274(%fp),%a0
- move.l 24(%fp),%d6
- neg.l %d6
- sub.l %d0,%d6
- move.l 28(%fp),%d7
- neg.l %d7
- move.l -270(%fp),%d1
- add.l %d6,%d1
- lea (192,%a0),%a0
- move.l %d1,-290(%fp)
- move.l %a0,-278(%fp)
- move.l %d7,-314(%fp)
-.L839:
- move.l -306(%fp),%a1
+ jeq .L1003
+ tst.l 28(%fp)
+ sne %d4
+ move.l -300(%fp),%a1
+ move.l -300(%fp),%a5
+ move.l -300(%fp),%a2
+ move.l 28(%fp),%d5
+ neg.l %d5
+ lea (192,%a1),%a1
+ lea (196,%a5),%a5
+ lea (200,%a2),%a2
+ move.l %a1,-292(%fp)
+ mvs.b %d4,%d4
+ sub.l 24(%fp),%d4
+ move.l %d5,-272(%fp)
+.L976:
+ move.l -324(%fp),%a1
move.l (%a1),%d2
- cmp.l %d2,%d4
- jhi .L811
-.L933:
- move.l %d6,%d0
+ cmp.l %d2,%d6
+ jhi .L941
+.L1089:
+ move.l %d4,%d0
moveq #8,%d1
addq.l #4,%d0
cmp.l %d0,%d1
- jcs .L813
- move.l %d6,%d1
- tst.l %d6
- jlt .L932
+ jcs .L943
+ move.l %d4,%d1
+ tst.l %d4
+ jlt .L1087
addq.l #1,%d1
muls.l %d3,%d1
move.l %d2,%d0
@@ -6316,1428 +7052,1792 @@ gran_render:
sls %d0
neg.l %d0
tst.b %d0
- jne .L855
-.L813:
- move.l %d3,%a5
+ jne .L1088
+.L943:
+ move.l %d3,%a4
clr.l %d3
-.L831:
- move.l %d5,%d0
+.L962:
+ move.l %d7,%d0
lsl.l #3,%d0
- move.l %a5,-(%sp)
+ move.l %a4,-(%sp)
lea (-256,%fp),%a1
pea (%a1,%d0.l)
- move.l -298(%fp),-(%sp)
- move.l -314(%fp),-(%sp)
- move.l %d6,-(%sp)
- move.l %a4,-(%sp)
- move.l -302(%fp),-(%sp)
- move.l -306(%fp),-(%sp)
+ move.l -316(%fp),-(%sp)
+ move.l -272(%fp),-(%sp)
+ move.l %d4,-(%sp)
+ move.l %a3,-(%sp)
+ move.l -320(%fp),-(%sp)
+ move.l -324(%fp),-(%sp)
jsr stereo_paged
lea (32,%sp),%sp
-.L834:
- add.l %a5,%d5
- move.l -306(%fp),%a5
- move.l (%a5),%d0
- cmp.l %d0,%d4
- jhi .L835
- tst.l %d6
- jlt .L836
- remu.l %d4,%d1:%d0
- move.l %d1,(%a5)
-.L835:
+.L966:
+ add.l %a4,%d7
+ move.l -324(%fp),%a0
+ move.l (%a0),%d0
+ cmp.l %d0,%d6
+ jhi .L967
+ move.l -308(%fp),%a1
+ moveq #3,%d2
+ mvz.b (%a1),%d1
+ cmp.l %d1,%d2
+ jeq .L956
+ subq.l #2,%d1
+ tst.l %d1
+ jeq .L967
+ tst.l %d4
+ jlt .L973
+ remu.l %d6,%d1:%d0
+ move.l -324(%fp),%a0
+ move.l %d1,(%a0)
+.L967:
tst.l %d3
- jeq .L807
-.L917:
- move.l -306(%fp),%a1
+ jeq .L937
+.L1072:
+ move.l -324(%fp),%a1
move.l (%a1),%d2
- cmp.l %d2,%d4
- jls .L933
-.L811:
- move.l %d2,%a0
- sub.l (%a2),%a0
- move.l (%a3),-310(%fp)
- tst.l %d6
- jlt .L814
- move.l -290(%fp),%d7
- move.l %d4,%d1
- sub.l %d2,%d1
- muls.l %d3,%d7
- cmp.l %d1,%d7
- jcs .L934
- move.l %d1,%d7
- subq.l #1,%d7
- move.l -290(%fp),%d1
- divu.l %d1,%d7
- move.l %d7,%a5
- addq.l #1,%a5
- cmp.l %a5,%d3
- jcc .L819
- move.l %d3,%a5
-.L819:
- sub.l %a5,%d3
- cmp.l -310(%fp),%a0
- jcc .L820
-.L821:
- add.l -282(%fp),%d2
-.L832:
- move.l -286(%fp),%d1
+ cmp.l %d2,%d6
+ jls .L1089
+.L941:
+ move.l %d2,%a1
+ sub.l (%a5),%a1
+ move.l (%a2),%a0
+ tst.l %d4
+ jlt .L944
+ tst.l -272(%fp)
+ sne %d1
+ move.l %d6,%d5
+ sub.l %d2,%d5
+ move.l %d5,-284(%fp)
+ move.l %d4,%d5
+ mvs.b %d1,%d1
+ sub.l %d1,%d5
+ move.l %d5,%d0
+ muls.l %d3,%d0
+ cmp.l -284(%fp),%d0
+ jcs .L1090
+ move.l -284(%fp),%a4
+ subq.l #1,%a4
+ move.l %a4,%d0
+ divu.l %d5,%d0
+ move.l %d0,%a4
+ addq.l #1,%a4
+ cmp.l %a4,%d3
+ jcc .L949
+ move.l %d3,%a4
+.L949:
+ sub.l %a4,%d3
+ cmp.l %a1,%a0
+ jls .L950
+.L951:
+ add.l -296(%fp),%d2
+.L963:
+ move.l -304(%fp),%d1
cmp.l #65536,%d1
- jcc .L831
- cmp.l %d2,%d4
- jls .L831
- move.l (%a2),%d0
+ jcc .L962
+ cmp.l %d2,%d6
+ jls .L962
+ move.l (%a5),%d0
sub.l %d0,%d2
- cmp.l (%a3),%d2
- jcc .L831
- move.l %d5,%d2
+ cmp.l (%a2),%d2
+ jcc .L962
+ move.l %d7,%d2
lsl.l #3,%d2
- move.l %a5,-(%sp)
- mvz.b 4(%a4),%d1
- lea (-256,%fp),%a1
- move.l -274(%fp),%a0
- pea (%a1,%d2.l)
- move.l -298(%fp),-(%sp)
- move.l -314(%fp),-(%sp)
- move.l %d6,-(%sp)
- move.l %d0,-(%sp)
- move.l %d1,-(%sp)
- move.l 192(%a0),-(%sp)
- move.l -306(%fp),-(%sp)
- jsr stereo_page
- lea (36,%sp),%sp
- jra .L834
-.L855:
- move.l -306(%fp),%a0
- move.l %d6,%d1
- move.l %d2,-290(%fp)
- move.l -314(%fp),%d7
- move.l %d7,%d0
- move.l 4(%a0),%d2
- move.l %d2,%d5
- mvz.w %d5,%d5
- muls.l %d3,%d1
- mvz.w %d0,%d0
- move.l -306(%fp),%a5
- clr.w %d7
- swap %d7
- add.l -290(%fp),%d1
- move.l %d5,%a0
- move.l %d2,%d5
- move.l 16(%a5),%d2
- muls.l %d3,%d0
+ move.l %a4,-(%sp)
+ mvz.b 4(%a3),%d1
+ lea (-256,%fp),%a1
+ move.l -300(%fp),%a0
+ pea (%a1,%d2.l)
+ move.l -316(%fp),-(%sp)
+ move.l -272(%fp),-(%sp)
+ move.l %d4,-(%sp)
+ move.l %d0,-(%sp)
+ move.l %d1,-(%sp)
+ move.l 192(%a0),-(%sp)
+ move.l -324(%fp),-(%sp)
+ jsr stereo_page
+ lea (36,%sp),%sp
+ jra .L966
+.L1088:
+ move.l -324(%fp),%a0
+ move.l 4(%a0),%d0
+ move.l %d0,%d1
+ mvz.w %d1,%d1
+ move.l %d0,%d5
+ move.l 16(%a0),%d0
clr.w %d5
swap %d5
- muls.l %d3,%d2
- muls.l %d3,%d7
- add.l %a0,%d0
- add.l %d2,12(%a5)
- move.l %d0,%d2
+ muls.l %d3,%d0
+ move.l %d1,%a1
+ move.l -272(%fp),%d1
+ move.l %d0,%a4
+ move.l %d3,%d0
+ muls.l %d4,%d0
+ mvz.w %d1,%d1
+ add.l %d2,%d0
+ move.l -272(%fp),%d2
+ move.l %d0,-276(%fp)
+ move.l %a4,%d0
+ muls.l %d3,%d1
clr.w %d2
swap %d2
- add.l %d5,%d7
- mvz.w %d0,%d0
- add.l %d2,%d7
- move.l %d7,%d2
- swap %d7
- clr.w %d7
- clr.w %d2
+ add.l %d0,12(%a0)
+ move.l -324(%fp),%a0
+ add.l %a1,%d1
+ move.l %d1,%d0
+ clr.w %d0
+ swap %d0
+ mvz.w %d1,%d1
+ muls.l %d3,%d2
+ add.l %d5,%d2
+ add.l %d0,%d2
+ move.l %d2,%d5
swap %d2
- or.l %d0,%d7
- add.l %d2,%d1
- move.l %d1,(%a5)
- move.l %d7,4(%a5)
- cmp.l %d1,%d4
- jhi .L807
- tst.l %d6
- jlt .L826
- remu.l %d4,%d0:%d1
- move.l %d0,(%a5)
- jra .L807
-.L852:
- move.l %d3,%a5
+ clr.w %d2
+ clr.w %d5
+ swap %d5
+ move.l -276(%fp),%d0
+ or.l %d1,%d2
+ add.l %d5,%d0
+ move.l %d0,(%a0)
+ move.l %d2,4(%a0)
+ cmp.l %d0,%d6
+ jhi .L937
+ move.l 8(%fp),%a0
+ add.l %d3,%d7
+ moveq #3,%d2
+ add.l -288(%fp),%a0
+ mvz.b 242(%a0),%d1
+ cmp.l %d1,%d2
+ jeq .L1004
+ subq.l #2,%d1
+ tst.l %d1
+ jeq .L937
+ tst.l %d4
+ jlt .L957
+ remu.l %d6,%d1:%d0
+ move.l -324(%fp),%a0
+ move.l %d1,(%a0)
+ jra .L937
+.L989:
+ move.l %d3,%a4
clr.l %d3
-.L820:
- move.l 6(%a4),%a0
- move.l 10(%a4),%d0
+.L950:
+ move.l 6(%a3),%a0
+ move.l 10(%a3),%d0
clr.l -264(%fp)
- move.l (%a4),-260(%fp)
+ move.l (%a3),-260(%fp)
tst.l %a0
- jeq .L827
+ jeq .L958
pea -260(%fp)
pea -264(%fp)
move.l %d2,-(%sp)
move.l %d0,-(%sp)
jsr (%a0)
lea (16,%sp),%sp
- move.l -278(%fp),%a0
+ move.l -292(%fp),%a1
move.l -264(%fp),%d1
- move.l %d0,(%a0)
- move.l %d1,(%a2)
+ move.l %d0,(%a1)
+ move.l %d1,(%a5)
tst.l %d0
- jeq .L829
-.L936:
+ jeq .L960
+.L1092:
move.l -260(%fp),%d0
move.l %d2,%a0
sub.l %d1,%a0
- move.l %d0,(%a3)
+ move.l %d0,(%a2)
cmp.l %d0,%a0
- jcc .L829
- tst.l %d6
- jge .L821
- sub.l -282(%fp),%d2
- jra .L832
-.L814:
- move.l %d6,%d0
- neg.l %d0
- move.l %d0,%a1
+ jcc .L960
+ tst.l %d4
+ jge .L951
+ sub.l -296(%fp),%d2
+ jra .L963
+.L944:
+ move.l %d4,%d1
+ neg.l %d1
+ move.l %d1,%d0
muls.l %d3,%d0
+ move.l %d1,-284(%fp)
cmp.l %d2,%d0
- jls .L935
+ jls .L1091
+ move.l -284(%fp),%d5
move.l %d2,%d0
- move.l %a1,%d1
- divu.l %d1,%d0
- move.l %d0,%a5
- addq.l #1,%a5
- cmp.l %a5,%d3
- jcc .L822
- move.l %d3,%a5
-.L822:
- sub.l %a5,%d3
- cmp.l -310(%fp),%a0
- jcc .L820
- sub.l -282(%fp),%d2
- jra .L832
-.L827:
- move.l -278(%fp),%a0
+ divu.l %d5,%d0
+ move.l %d0,%a4
+ addq.l #1,%a4
+ cmp.l %a4,%d3
+ jcc .L952
+ move.l %d3,%a4
+.L952:
+ sub.l %a4,%d3
+ cmp.l %a1,%a0
+ jls .L950
+ sub.l -296(%fp),%d2
+ jra .L963
+.L958:
+ move.l -292(%fp),%a1
clr.l %d1
- move.l %d0,(%a0)
- move.l %d1,(%a2)
+ move.l %d0,(%a1)
+ move.l %d1,(%a5)
tst.l %d0
- jne .L936
-.L829:
- move.l %d5,%d0
- clr.l (%a3)
- move.l %a5,-(%sp)
+ jne .L1092
+.L960:
+ move.l %d7,%d0
+ clr.l (%a2)
+ move.l %a4,-(%sp)
lsl.l #3,%d0
lea (-256,%fp),%a1
pea (%a1,%d0.l)
- move.l -298(%fp),-(%sp)
- move.l -314(%fp),-(%sp)
- move.l %d6,-(%sp)
- move.l %a4,-(%sp)
- move.l -302(%fp),-(%sp)
- move.l -306(%fp),-(%sp)
+ move.l -316(%fp),-(%sp)
+ move.l -272(%fp),-(%sp)
+ move.l %d4,-(%sp)
+ move.l %a3,-(%sp)
+ move.l -320(%fp),-(%sp)
+ move.l -324(%fp),-(%sp)
jsr stereo_paged
lea (32,%sp),%sp
- jra .L834
-.L836:
+ jra .L966
+.L1004:
+ clr.l %d3
+.L956:
+ tst.l %d4
+ jlt .L969
+ move.l -280(%fp),%d1
+ sub.l %d0,%d1
+.L970:
+ cmp.l %d1,%d6
+ jhi .L971
+ move.l %d6,%d1
+ subq.l #1,%d1
+.L971:
+ tst.l -272(%fp)
+ sne %d0
+ move.l -324(%fp),%a0
+ moveq #1,%d5
+ move.l %d1,(%a0)
+ move.l -272(%fp),%d1
+ neg.l %d1
+ eor.l %d5,24(%a0)
+ move.l %d1,-272(%fp)
+ mvs.b %d0,%d0
+ sub.l %d4,%d0
+ move.l %d0,%d4
+ tst.l %d3
+ jne .L1072
+ jra .L937
+.L1090:
+ cmp.l %a1,%a0
+ jls .L989
+ move.l %d3,%a4
+ clr.l %d3
+ add.l -296(%fp),%d2
+ jra .L963
+.L1091:
+ cmp.l %a1,%a0
+ jls .L989
+ move.l %d3,%a4
+ clr.l %d3
+ sub.l -296(%fp),%d2
+ jra .L963
+.L908:
+ move.l (%a3),%d2
+ move.l %d5,%a0
+ add.l %d4,%a0
+ cmp.l %a0,%d2
+ jhi .L909
+ sub.l %d2,%a0
+ jra .L909
+.L1084:
+ move.l -280(%fp),%a5
+ move.l (%a5),%d5
+ jra .L907
+.L973:
neg.l %d0
- remu.l %d4,%d1:%d0
+ remu.l %d6,%d1:%d0
tst.l %d1
- jeq .L838
- move.l %d4,%d0
+ jeq .L975
+ move.l %d6,%d0
sub.l %d1,%d0
move.l %d0,%d1
-.L838:
- move.l -306(%fp),%a0
+.L975:
+ move.l -324(%fp),%a0
move.l %d1,(%a0)
tst.l %d3
- jne .L917
- jra .L807
-.L934:
- cmp.l -310(%fp),%a0
- jcc .L852
- move.l %d3,%a5
- clr.l %d3
- add.l -282(%fp),%d2
- jra .L832
-.L935:
- cmp.l -310(%fp),%a0
- jcc .L852
- move.l %d3,%a5
- clr.l %d3
- sub.l -282(%fp),%d2
- jra .L832
-.L930:
- move.l -282(%fp),%a2
- move.l (%a2),%d1
- jra .L786
-.L861:
- move.l -274(%fp),%a0
- move.l 28(%fp),%d7
- move.l 24(%fp),%d6
- move.l -270(%fp),%d1
- add.l %d6,%d1
- lea (192,%a0),%a0
- move.l %d1,-290(%fp)
- move.l %a0,-278(%fp)
- move.l %d7,-314(%fp)
- jra .L839
-.L932:
+ jne .L1072
+ jra .L937
+.L969:
+ move.l %d0,%d1
+ not.l %d1
+ jra .L970
+.L1003:
+ move.l -300(%fp),%a1
+ move.l 28(%fp),%d5
+ move.l -300(%fp),%a5
+ move.l -300(%fp),%a2
+ lea (192,%a1),%a1
+ move.l 24(%fp),%d4
+ lea (196,%a5),%a5
+ lea (200,%a2),%a2
+ move.l %a1,-292(%fp)
+ move.l %d5,-272(%fp)
+ jra .L976
+.L912:
+ move.l (%a3),%d2
+ tst.l %a0
+ jlt .L1093
+.L915:
+ cmp.l %a0,%d2
+ jhi .L916
+ sub.l %d2,%a0
+ cmp.l %a0,%d2
+ jhi .L916
+ move.l %d2,%a0
+ subq.l #1,%a0
+.L916:
+ move.l -324(%fp),%d5
+ move.l #16777216,%d2
+ lsl.l #5,%d0
+ divu.l %d5,%d2
+ move.l %a4,%d5
+ add.l %d0,%d5
+ move.l %a0,(%a1,%d5.l)
+ lea (%a1,%d5.l),%a5
+ move.l -324(%fp),%d5
+ clr.l 4(%a5)
+ clr.l 12(%a5)
+ move.l %d5,8(%a5)
+ move.l %d2,16(%a5)
+ move.l %d3,20(%a5)
+ move.l %a5,-292(%fp)
+ mvz.b 5(%a2),%d2
+ tst.l %d2
+ jeq .L1094
+ moveq #126,%d5
+ cmp.l %d2,%d5
+ jcc .L917
+ move.l -292(%fp),%a0
+ moveq #1,%d6
+ move.l %d6,24(%a0)
+ jra .L918
+.L1093:
+ add.l %d2,%a0
+ jra .L915
+.L1087:
neg.l %d1
muls.l %d3,%d1
move.l %d2,%d0
- sub.l %d4,%d0
+ sub.l %d6,%d0
cmp.l %d0,%d1
sls %d0
neg.l %d0
tst.b %d0
- jeq .L813
- jra .L855
-.L859:
+ jeq .L943
+ jra .L1088
+.L1066:
+ move.l %a0,%d1
+ jra .L921
+.L999:
+ move.l -334(%fp),%d6
+ move.l #32768,%d5
+ clr.w %d6
+ swap %d6
+ cmp.l %d6,%d5
+ sls %d6
+ moveq #1,%d5
+ mvs.b %d6,%d2
+ move.l %d0,%d6
+ add.l %a4,%d6
+ neg.l %d2
+ move.l %d2,24(%a1,%d6.l)
+ cmp.l %d4,%d5
+ jne .L919
+ jra .L918
+.L1094:
+ move.l -292(%fp),%a0
+ clr.l 24(%a0)
+ jra .L918
+.L923:
+ move.l (%a3),%d2
+ sub.l %d1,%d2
+ jra .L924
+.L1006:
+ clr.l %d1
+ jra .L921
+.L1002:
+ lea (%a4,%d0.l),%a0
moveq #1,%d1
- jra .L793
-.L860:
- clr.w %d3
- swap %d3
- move.l #32768,%d4
- cmp.l %d3,%d4
- sls %d3
- mvs.b %d3,%d1
- neg.l %d1
- jra .L793
-.L929:
- move.l 24(%fp),%d7
- neg.l %d7
- move.l %d7,-286(%fp)
- move.l -286(%fp),%d5
- move.l %d6,%d1
+ add.l %a1,%a0
+ move.l #16777216,%d2
+ move.l %d1,8(%a0)
+ move.l %d2,16(%a0)
+ jra .L918
+.L1083:
+ move.l 24(%fp),%d6
+ neg.l %d6
+ move.l %d6,-304(%fp)
+ move.l -304(%fp),%d2
+ move.l %d7,%d0
+ subq.l #1,%d0
+ move.l 8(%fp),%a0
+ move.l %a4,%d6
+ muls.l %d0,%d2
+ move.l -288(%fp),%d0
+ add.l #192,%d0
+ add.l 8(%fp),%d0
+ add.l -288(%fp),%a0
+ move.l %d7,-312(%fp)
+ move.l %d0,-320(%fp)
+ move.l %a4,%d0
+ move.l %a0,%a1
+ lea (242,%a1),%a1
+ add.l %d0,%d0
+ move.l %d2,-296(%fp)
+ move.l %a0,-324(%fp)
+ move.l %a0,-300(%fp)
+ move.l %a1,-308(%fp)
+ subq.l #1,%d0
+ move.l %d0,-280(%fp)
+ jra .L977
+.L897:
+ move.l -288(%fp),%a1
+ move.l 8(%fp),%a0
+ move.l %d0,-276(%fp)
+ move.l 8(%fp),%d0
+ lea 8(%a0,%a1.l),%a0
+ move.l -324(%fp),%d1
+ move.l %a4,-296(%fp)
+ add.l -288(%fp),%d0
+ move.l -276(%fp),%d2
+ move.l -288(%fp),%a4
+ move.l %a5,-330(%fp)
+ muls.l %d2,%d1
+ move.l %d0,%a1
+ lea (212,%a1),%a1
+ move.l %a0,-320(%fp)
+ move.l %d0,%a0
+ lea (208,%a0),%a0
+ move.l %a1,-284(%fp)
+ addq.l #4,%a1
+ move.l %a0,-280(%fp)
+ lea (20,%a0),%a0
+ move.l %a1,-308(%fp)
+ addq.l #8,%a1
+ move.l %a0,-312(%fp)
+ lea (14,%a0),%a0
+ move.l %a1,-300(%fp)
+ move.l 8(%fp),%a1
+ move.l %d1,-272(%fp)
+ move.l %a0,-304(%fp)
+ jra .L899
+.L1001:
+ clr.l %d2
subq.l #1,%d1
- neg.l %d0
- muls.l %d1,%d5
- move.b %d0,-265(%fp)
- mvz.b %d0,%d0
- lea (%a0,%d2.l),%a1
- add.l #192,%d2
- add.l %a0,%d2
- move.l %a1,%a2
- move.l %a1,%a3
- move.l %d0,-270(%fp)
- move.l %d5,-282(%fp)
- move.l %a1,-306(%fp)
- move.l %d2,-302(%fp)
- move.l %a1,-274(%fp)
- lea (196,%a2),%a2
- lea (200,%a3),%a3
- move.l %d6,-294(%fp)
- jra .L840
-.L826:
- neg.l %d1
- remu.l %d4,%d0:%d1
- tst.l %d0
- jeq .L837
- move.l -306(%fp),%a0
- move.l %d4,%d1
- sub.l %d0,%d1
- move.l %d1,(%a0)
- jra .L807
-.L925:
- moveq #1,%d5
- cmp.l %d1,%d5
- jcc .L914
- movem.l -356(%fp),#15612
+ jra .L921
+.L1080:
+ moveq #1,%d3
+ cmp.l %d1,%d3
+ jcc .L1069
+ movem.l -376(%fp),#15612
unlk %fp
rts
-.L837:
- move.l -306(%fp),%a1
+.L957:
+ neg.l %d0
+ remu.l %d6,%d1:%d0
+ tst.l %d1
+ jne .L1005
+ move.l -324(%fp),%a1
clr.l (%a1)
- jra .L807
+ jra .L937
+.L1082:
+ remu.l %d1,%d3:%d2
+ tst.l %d3
+ jeq .L906
+ sub.l %d3,%d1
+ move.l %d1,%d3
+ jra .L906
.L928:
- remu.l %d1,%d5:%d3
- tst.l %d5
- jeq .L785
- sub.l %d5,%d1
- move.l %d1,%d5
- jra .L785
-.L798:
- move.l %d3,%d0
+ move.l %d2,%d0
neg.l %d0
- move.l %d0,%d3
- mvz.w %d3,%d3
+ move.l %d0,%d2
+ mvz.w %d2,%d2
clr.w %d0
swap %d0
- cmp.l %d3,%a1
- jcc .L801
+ cmp.l %d2,%a1
+ jcc .L931
add.l #65536,%a1
addq.l #1,%d0
-.L801:
- lea (%a0,%d2.l),%a2
- sub.l %d3,%a1
- move.l %a1,232(%a2)
+.L931:
+ move.l 8(%fp),%a0
+ sub.l %d2,%a1
+ add.l -288(%fp),%a0
+ move.l %a1,232(%a0)
cmp.l %d1,%d0
- jcs .L802
- move.l %d0,%d3
- remu.l %d1,%d5:%d3
+ jcs .L932
+ move.l %d0,%d2
+ remu.l %d1,%d5:%d2
move.l %d5,%d0
-.L802:
- lea (%a0,%d2.l),%a1
- move.l 228(%a1),%a1
- cmp.l %a1,%d0
- jls .L912
- add.l %d1,%a1
-.L912:
- sub.l %d0,%a1
- lea (%a0,%d2.l),%a2
- move.l %a1,228(%a2)
- jra .L779
-.L926:
- sub.l %d6,%d5
- jra .L785
+.L932:
+ move.l 8(%fp),%a0
+ add.l -288(%fp),%a0
+ move.l 228(%a0),%a0
+ cmp.l %a0,%d0
+ jls .L1067
+ add.l %d1,%a0
+.L1067:
+ move.l 8(%fp),%a1
+ sub.l %d0,%a0
+ add.l -288(%fp),%a1
+ move.l %a0,228(%a1)
+ jra .L900
+.L1005:
+ move.l %d6,%d0
+ sub.l %d1,%d0
+ clr.l %d3
+ move.l %d0,%d1
+ jra .L975
+.L895:
+ sub.l %d7,%d3
+ jra .L906
.size gran_render, .-gran_render
.align 2
.globl grain_render
.type grain_render, @function
grain_render:
link.w %fp,#-136
- move.l -2147458392,%a0
moveq #7,%d0
movem.l #3084,(%sp)
- move.l %a0,-120(%fp)
+ move.l -2147458392,%a0
cmp.l 8(%fp),%d0
- jcs .L938
+ jcs .L1096
move.l 8(%fp),%d0
moveq #48,%d1
muls.l %d1,%d0
move.l %d0,%d1
add.l #-2147482352,%d1
cmp.l %d1,%a0
- jeq .L939
+ jeq .L1097
add.l #-2147481968,%d0
cmp.l %a0,%d0
- jeq .L939
-.L938:
+ jeq .L1097
+.L1096:
movem.l -136(%fp),#3084
clr.l %d1
move.l %d1,%d0
unlk %fp
rts
-.L939:
+.L1097:
move.l 20(%fp),%d2
cmp.l 16(%fp),%d2
- jcs .L938
+ jcs .L1096
moveq #16,%d3
cmp.l %d2,%d3
- jcs .L938
- move.l -120(%fp),%a1
- move.l #-2147476352,%a0
- move.l -120(%fp),%a2
- mvz.b audition,%d0
- move.l 8(%fp),%d2
- move.l (%a0),-76(%fp)
- move.l -120(%fp),%a3
- addq.l #4,%a3
- move.l -120(%fp),%d1
- addq.l #8,%d1
- lea (24,%a1),%a1
- lea (28,%a2),%a2
- move.l %a1,-96(%fp)
- move.l %a2,-92(%fp)
- move.l %a3,-88(%fp)
- move.l %d1,-84(%fp)
- btst %d2,%d0
- jne .L1003
+ jcs .L1096
+ move.l #-2147476352,%a2
+ move.l (%a2),%a1
+ lea (24,%a0),%a3
+ lea (28,%a0),%a2
+ mvz.b audition,%d0
+ move.l %a3,-100(%fp)
+ move.l %a2,-96(%fp)
+ move.l 8(%fp),%d1
+ lea (4,%a0),%a3
+ lea (8,%a0),%a2
+ move.l %a3,-92(%fp)
+ move.l %a2,-88(%fp)
+ btst %d1,%d0
+ jne .L1169
move.l 8(%fp),%d1
move.l #168,%d2
pea -18(%fp)
- move.l -120(%fp),-(%sp)
+ move.l %a0,-(%sp)
muls.l %d2,%d1
- move.l %a0,-116(%fp)
- move.l %d1,-80(%fp)
+ moveq #1,%d3
+ move.l %a0,-120(%fp)
+ move.l %a1,-116(%fp)
+ lea grain_skip,%a2
+ move.l %d1,-84(%fp)
jsr view_open
+ move.l 8(%fp),%a3
+ move.b %d3,(%a2,%a3.l)
move.l 20(%fp),-(%sp)
move.l 16(%fp),-(%sp)
move.l 12(%fp),-(%sp)
- move.l 8(%fp),-(%sp)
+ move.l %a3,-(%sp)
jsr 1073758216
lea (24,%sp),%sp
- move.l -80(%fp),%a1
- add.l #-2147464744,%a1
- move.l -116(%fp),%a0
move.l %d0,%d1
- tst.b (%a1)
- jne .L1004
-.L942:
+ clr.b %d0
+ move.b %d0,(%a2,%a3.l)
+ move.l -84(%fp),%d0
+ add.l #-2147464744,%d0
+ move.l %d0,%a2
move.l -120(%fp),%a0
- move.l -88(%fp),%a1
- move.l -84(%fp),%a2
+ move.l -116(%fp),%a1
+ tst.b (%a2)
+ jne .L1170
+.L1100:
+ move.l -2147476352,%d0
+ moveq #15,%d2
+ sub.l %a1,%d0
+ cmp.l %d0,%d2
+ jcc .L1126
+ move.l (%a1),%d3
+ mvz.b %d3,%d3
+ move.l %d3,-112(%fp)
+ addq.l #2,%d3
+ lsl.l #3,%d3
+ cmp.l %d3,%d0
+ jcs .L1126
+ cmp.l #336,%d0
+ jhi .L1126
+ move.l -112(%fp),%d0
+ add.l %d0,%d0
+ move.l %d0,-108(%fp)
+ tst.l -112(%fp)
+ jeq .L1126
+ lea (16,%a1),%a1
+ clr.l %d0
+.L1127:
+ clr.l (%a1)+
+ addq.l #1,%d0
+ cmp.l -108(%fp),%d0
+ jne .L1127
+.L1126:
move.l -18(%fp),(%a0)
- move.l -96(%fp),%a3
- move.l -14(%fp),(%a1)
move.l -92(%fp),%a0
- move.l -10(%fp),(%a2)
- move.l -6(%fp),(%a3)
- move.w -2(%fp),(%a0)
-.L1007:
+ move.l -88(%fp),%a1
+ move.l -100(%fp),%a2
+ move.l -14(%fp),(%a0)
+ move.l -96(%fp),%a3
+ move.l -10(%fp),(%a1)
+ move.l -6(%fp),(%a2)
+ move.w -2(%fp),(%a3)
+.L1173:
move.l %d1,%d0
movem.l -136(%fp),#3084
unlk %fp
rts
-.L1003:
+.L1169:
pea -18(%fp)
- move.l -120(%fp),-(%sp)
+ move.l %a0,-(%sp)
+ move.l %a0,-120(%fp)
jsr plain_view
- move.l 20(%fp),-(%sp)
+ move.l %d2,-(%sp)
move.l 16(%fp),-(%sp)
move.l 12(%fp),-(%sp)
- move.l %d2,-(%sp)
+ move.l 8(%fp),-(%sp)
jsr 1073758216
- move.l -96(%fp),%a2
lea (24,%sp),%sp
move.l -120(%fp),%a0
- move.l -84(%fp),%a1
+ move.l -96(%fp),%a1
move.l %d0,%d1
move.l %d1,%d0
move.l -18(%fp),(%a0)
move.l -14(%fp),(%a3)
- move.l -92(%fp),%a3
- move.l -10(%fp),(%a1)
- move.l -6(%fp),(%a2)
- move.w -2(%fp),(%a3)
+ move.l -10(%fp),(%a2)
movem.l -136(%fp),#3084
+ move.l -100(%fp),%a0
+ move.l -6(%fp),(%a0)
+ move.w -2(%fp),(%a1)
unlk %fp
rts
-.L1004:
- move.l -120(%fp),%d0
- move.l -76(%fp),%a1
- move.l (%a0),-104(%fp)
+.L1170:
+ move.l %a0,%d0
+ move.l #-2147476352,%a3
lsl.l #3,%d0
- sub.l -120(%fp),%d0
+ move.l (%a3),-108(%fp)
+ move.l %a1,%d2
+ sub.l %a0,%d0
add.l #-1760,%d0
- sub.l %d0,%a1
- cmp.l #320,%a1
- jhi .L942
- move.l -104(%fp),%a0
- sub.l %d0,%a0
- cmp.l #336,%a0
- jhi .L942
- lea (16,%a1),%a1
- cmp.l %a0,%a1
- jhi .L942
- move.l -76(%fp),%a0
- move.l (%a0),%a1
- move.l %a1,%d0
+ sub.l %d0,%d2
+ move.l %d2,-112(%fp)
+ cmp.l #320,%d2
+ jhi .L1100
+ move.l -108(%fp),%d3
+ sub.l %d0,%d3
+ move.l %d3,-104(%fp)
+ cmp.l #336,%d3
+ jhi .L1100
+ move.l %d2,%d0
+ add.l #16,%d0
+ cmp.l %d3,%d0
+ jhi .L1100
+ move.l (%a1),-104(%fp)
+ move.l -104(%fp),%d0
lsr.l #8,%d0
- jeq .L942
+ jeq .L1100
tst.b %d0
- jeq .L942
+ jeq .L1100
cmp.l #255,%d0
- jls .L966
+ jls .L1128
move.l %d0,%d2
and.l #65280,%d2
tst.l %d2
- jeq .L942
+ jeq .L1100
cmp.l #65536,%d0
- jcs .L967
+ jcs .L1129
moveq #24,%d0
-.L943:
- move.w %a1,%d3
- move.l %a1,%d2
+.L1101:
+ move.l -104(%fp),%d2
+ mvz.b -101(%fp),%d3
mvz.b %d2,%d2
- move.l -104(%fp),%a0
- sub.l -76(%fp),%a0
- mvz.b %d3,%d3
- move.l %d2,-28(%fp)
- move.l %d3,-64(%fp)
- lsl.l #3,%d3
- add.l %d3,%d0
- cmp.l %a0,%d0
- jne .L942
- move.l %d2,%d0
+ move.l %d3,-68(%fp)
+ move.l -108(%fp),%d3
+ sub.l %a1,%d3
+ move.l %d2,-104(%fp)
+ move.l -68(%fp),%d2
+ lsl.l #3,%d2
+ add.l %d2,%d0
+ cmp.l %d3,%d0
+ jne .L1100
+ move.l -104(%fp),%d0
moveq #31,%d3
subq.l #1,%d0
cmp.l %d0,%d3
- jcs .L942
+ jcs .L1100
move.l 8(%fp),%d2
moveq #20,%d3
- move.l -76(%fp),%a1
- move.l -80(%fp),%a0
- add.l #-2147464740,%a0
- muls.l %d3,%d2
- move.l #250,%d3
lea (16,%a1),%a1
- move.l (%a0),%a0
- move.l %a1,-76(%fp)
- move.l %d2,-108(%fp)
+ move.l %a1,-32(%fp)
+ muls.l %d3,%d2
+ move.l #252,%d3
+ move.l -84(%fp),%a2
+ add.l #-2147464740,%a2
+ move.l %d2,-112(%fp)
move.l 8(%fp),%d2
- move.l -108(%fp),%d0
+ move.l -112(%fp),%d0
add.l #pages+16,%d0
- move.l %d0,%a2
muls.l %d3,%d2
- move.l (%a2),%d0
move.l %d2,%a1
add.l #eng+200,%a1
- move.l %d2,-52(%fp)
- clr.l (%a1)
- tst.l %a0
- jeq .L996
+ move.l %a1,-84(%fp)
+ move.l -84(%fp),%a3
+ move.l (%a2),%a1
+ move.l %d0,%a2
+ move.l (%a2),%d0
+ move.l %d2,-72(%fp)
+ clr.l (%a3)
+ tst.l %a1
+ jeq .L1162
move.l 8(%fp),%d2
moveq #14,%d3
+ lea bindings,%a3
muls.l %d3,%d2
moveq #36,%d3
- move.l %d2,%a1
- add.l #smp,%a1
+ move.l %d2,-84(%fp)
move.l 8(%fp),%d2
- move.l %a1,-80(%fp)
- lea bindings,%a1
+ move.l -84(%fp),%a2
+ add.l #smp,%a2
+ move.l %a2,-52(%fp)
muls.l %d3,%d2
- move.l %d2,-104(%fp)
- cmp.l (%a1,%d2.l),%a0
- jeq .L1005
- add.l #-1187586756,%a0
- cmp.l #5983,%a0
- jhi .L996
- moveq #44,%d2
- move.l %a0,%d0
- divu.l %d2,%d0
- move.w %d0,%d2
- mulu.w #44,%d2
- cmp.l %a0,%d2
- jeq .L951
-.L996:
- clr.l -80(%fp)
-.L945:
+ move.l %d2,-108(%fp)
+ cmp.l (%a3,%d2.l),%a1
+ jeq .L1171
+ add.l #-1187586756,%a1
+ cmp.l #5983,%a1
+ jhi .L1162
+ moveq #44,%d3
+ move.l %a1,%d0
+ divu.l %d3,%d0
+ move.w %d0,%d3
+ mulu.w #44,%d3
+ cmp.l %a1,%d3
+ jeq .L1109
+.L1162:
+ clr.l -52(%fp)
+.L1103:
move.w -16(%fp),%d2
move.l 1187521622,%d0
- move.l %d0,%a0
+ move.l %d0,%a1
mvz.w -14(%fp),%d3
- add.l #-1073741824,%a0
- move.l %d3,-104(%fp)
- move.w %d2,-108(%fp)
+ add.l #-1073741824,%a1
+ move.l %d3,-112(%fp)
+ move.w %d2,-84(%fp)
mvz.w %d2,%d2
- move.l %d2,%a1
- cmp.l #133169151,%a0
- jhi .L968
+ move.l %d2,-108(%fp)
+ cmp.l #133169151,%a1
+ jhi .L1130
move.b -2147483645,%d3
- move.b -1(%fp),%d2
+ move.l 8(%fp),%d2
add.l #585088,%d0
- move.w %d3,%a0
- move.l 8(%fp),%d3
- move.b %d2,-97(%fp)
- moveq #30,%d2
- muls.l %d2,%d3
- moveq #3,%d2
- move.l %d3,-68(%fp)
- move.l %a0,%d3
- and.l %d2,%d3
- moveq #7,%d2
- move.l %d3,%a0
- move.b -97(%fp),%d3
- and.l %d2,%d3
- move.l #6322,%d2
- move.l %d3,-100(%fp)
- move.l %a0,%d3
- muls.l %d2,%d3
- move.l -68(%fp),%a0
- add.l %d3,%d0
- add.l %d0,%a0
- tst.l -100(%fp)
- jeq .L955
- tst.b -107(%fp)
- jne .L955
- move.l %a1,%d3
+ move.b %d3,-77(%fp)
+ moveq #72,%d3
+ muls.l %d3,%d2
+ moveq #30,%d3
+ move.l %d2,%a1
+ add.l #-2147481567,%a1
+ move.l 8(%fp),%d2
+ move.l %a1,-76(%fp)
+ move.l -76(%fp),%a2
+ muls.l %d3,%d2
+ moveq #3,%d3
+ move.l %d2,-60(%fp)
+ move.b -77(%fp),%d2
+ and.l %d3,%d2
+ move.l #6322,%d3
+ move.l %d2,%a1
+ mvz.b (%a2),%d2
+ move.l %d2,-80(%fp)
+ move.l %a1,%d2
+ muls.l %d3,%d2
+ moveq #7,%d3
+ move.l %d2,%a1
+ add.l %a1,%d0
+ move.l -80(%fp),%d2
+ add.l #-119,%d2
+ move.l -60(%fp),%a1
+ add.l %d0,%a1
+ move.l %d2,-80(%fp)
+ cmp.l %d2,%d3
+ jcc .L1112
+ move.b -1(%fp),%d0
+ and.l %d3,%d0
+ tst.l %d0
+ jeq .L1114
+ tst.b -83(%fp)
+ jne .L1114
+ move.l -108(%fp),%d3
lsr.l #8,%d3
- mvz.b 49(%a0),%d0
- cmp.l %d3,%d0
- jeq .L1006
-.L955:
- move.b 63(%a0),%d0
- move.b 64(%a0),%d2
+ mvz.b 49(%a1),%d2
+ cmp.l %d3,%d2
+ jeq .L1172
+.L1114:
+ move.b 63(%a1),%d0
+ move.b 64(%a1),%d2
moveq #127,%d3
and.l %d0,%d3
- move.w %d2,%a0
+ move.w %d2,%a1
moveq #127,%d2
- move.b %d3,-41(%fp)
- move.l %a0,%d0
+ move.b %d3,-53(%fp)
+ move.l %a1,%d0
and.l %d2,%d0
- move.b %d0,-69(%fp)
-.L953:
- move.l %a1,-100(%fp)
- cmp.l #32767,%a1
- jls .L957
+ move.b %d0,-61(%fp)
+.L1111:
+ move.l -108(%fp),%d2
+ cmp.l #32767,%d2
+ jls .L1116
move.l #32767,%d3
- move.l %d3,-100(%fp)
-.L957:
- move.l -104(%fp),%d0
+ move.l %d3,-108(%fp)
+.L1116:
+ move.l -112(%fp),%d0
cmp.l #32767,%d0
- jls .L958
+ jls .L1117
move.l #32767,%d2
- move.l %d2,-104(%fp)
-.L958:
+ move.l %d2,-112(%fp)
+.L1117:
move.l -18(%fp),%d0
- move.l 8(%fp),%d3
- move.b -3(%fp),%d2
- lea live_at,%a0
+ move.b -2(%fp),%d3
+ move.l 8(%fp),%d2
+ lea live_at,%a1
and.l #-65536,%d0
- lsl.l #5,%d3
- move.l 8(%fp),%a2
- lea live_tick,%a1
- move.l -10(%fp),%a3
- move.l (%a1),(%a0,%a2.l*4)
- move.l %a3,-32(%fp)
- move.b %d2,-40(%fp)
- move.b -69(%fp),%d2
- move.l %d3,-108(%fp)
- or.l -100(%fp),%d0
+ lsl.l #5,%d2
+ move.l 8(%fp),%a3
+ lea live_tick,%a2
+ move.l (%a2),(%a1,%a3.l*4)
+ move.b %d3,-76(%fp)
mvz.w -12(%fp),%d3
- move.l -108(%fp),%a0
- add.l #prepared,%a0
- move.l %d3,-68(%fp)
- move.b %d2,6(%a0)
- move.l %d0,-56(%fp)
- move.l -104(%fp),%d0
+ or.l -108(%fp),%d0
+ move.l %d3,-80(%fp)
+ move.l %d2,-84(%fp)
+ move.l -10(%fp),%d2
+ move.l -84(%fp),%a1
+ add.l #prepared,%a1
+ move.l %d2,-40(%fp)
+ move.b -61(%fp),%d2
+ mvz.b -76(%fp),%d3
+ move.l %d0,-36(%fp)
+ move.l -112(%fp),%d0
swap %d0
clr.w %d0
- or.l %d3,%d0
- move.l %d0,-48(%fp)
- move.b -41(%fp),%d0
- move.b %d0,5(%a0)
- tst.b -40(%fp)
- jeq .L969
- move.l -2147477476,%d3
- move.l %d3,-60(%fp)
-.L959:
- tst.l -80(%fp)
- jeq .L960
- move.l -80(%fp),%a0
+ move.b %d2,6(%a1)
+ or.l -80(%fp),%d0
+ move.l %d0,-44(%fp)
+ move.b -53(%fp),%d0
+ move.b %d0,5(%a1)
+ moveq #3,%d0
+ cmp.l %d3,%d0
+ jcc .L1118
+ clr.b %d2
+ move.b %d2,-76(%fp)
+.L1118:
+ move.b -3(%fp),%d3
+ move.l -72(%fp),%d0
+ add.l #eng+242,%d0
+ move.l %d0,%a1
+ move.b -76(%fp),(%a1)
+ move.b %d3,-60(%fp)
+ jeq .L1131
+ move.l -2147477476,%a2
+ move.l %a2,-48(%fp)
+.L1119:
+ tst.l -52(%fp)
+ jeq .L1120
+ move.l -52(%fp),%a3
move.l -6(%fp),%a2
- move.l (%a0),-72(%fp)
- move.l -72(%fp),%d2
- move.l -108(%fp),%a1
+ move.l (%a3),-64(%fp)
+ move.l -64(%fp),%d2
+ move.l -84(%fp),%a1
add.l #prepared,%a1
move.w -18(%fp),%d0
- move.l %a1,-64(%fp)
- move.l %a2,-44(%fp)
+ move.l %a1,-76(%fp)
+ move.l %a2,-24(%fp)
cmp.l 12(%a1),%d2
- jeq .L991
+ jeq .L1157
move.l 8(%fp),%d3
moveq #12,%d2
mvz.w %d0,%d0
lea live_w,%a1
muls.l %d2,%d3
- move.l %d3,%a0
-.L961:
- move.l -56(%fp),%d2
- move.l %d0,%d3
- lsr.l #8,%d3
- lea (%a1,%a0.l),%a2
- move.l %d2,(%a1,%a0.l)
- moveq #127,%d2
- and.l %d2,%d3
- move.l -32(%fp),%a0
- move.l -72(%fp),%d2
- move.l %a0,8(%a2)
- move.l -44(%fp),%a0
- move.l -108(%fp),%a1
+ move.l %d3,-68(%fp)
+.L1121:
+ move.l -36(%fp),%d2
+ move.l %a1,%a2
+ move.l -68(%fp),%d3
+ add.l -68(%fp),%a2
+ move.l %d2,(%a1,%d3.l)
+ moveq #127,%d3
+ move.l %d0,%d2
+ lsr.l #8,%d2
+ move.l -84(%fp),%a1
add.l #prepared,%a1
- move.l %d2,12(%a1)
- moveq #123,%d2
- move.l %a0,20(%a1)
- move.l %d3,-56(%fp)
+ and.l %d3,%d2
+ move.l -40(%fp),%d3
+ move.l %d3,8(%a2)
move.l -48(%fp),%d3
- move.l %d3,4(%a2)
- move.l -60(%fp),%d3
move.l %d3,16(%a1)
- cmp.l -56(%fp),%d2
- jcs .L970
+ move.l %d2,-72(%fp)
+ move.l -44(%fp),%d2
+ move.l %d2,4(%a2)
+ move.l -64(%fp),%d2
+ move.l -24(%fp),%a2
+ move.l %d2,12(%a1)
+ moveq #123,%d2
+ move.l %a2,20(%a1)
+ cmp.l -72(%fp),%d2
+ jcs .L1132
moveq #14,%d3
moveq #1,%d2
lsr.l %d3,%d0
and.l %d0,%d2
- move.l %d2,-48(%fp)
-.L964:
- move.l -104(%fp),%d2
+ move.l %d2,-44(%fp)
+.L1124:
+ move.l -112(%fp),%d2
lsr.l #8,%d2
- move.l -104(%fp),%d3
- lea fraction.11,%a2
+ move.l -112(%fp),%d3
+ move.l -108(%fp),%d0
+ lsr.l #8,%d0
+ lea fraction.16,%a2
move.l %d2,%a1
- move.l -68(%fp),%d2
+ move.l -80(%fp),%d2
lsl.l #8,%d3
- move.l -100(%fp),%d0
- lsr.l #8,%d0
and.l #65280,%d2
- move.l %d3,%a0
+ move.w %d3,-110(%fp)
moveq #24,%d3
- lsl.l %d3,%d0
- move.l %d2,-68(%fp)
+ move.l %d2,-80(%fp)
move.l %a1,%d2
swap %d2
clr.w %d2
- move.l -108(%fp),%a1
+ lsl.l %d3,%d0
+ move.l -44(%fp),%d3
+ move.l -84(%fp),%a1
add.l #prepared,%a1
- move.l -48(%fp),%d3
move.l %d3,24(%a1)
- move.l %d2,-104(%fp)
- move.l -56(%fp),%d2
- or.l -104(%fp),%d0
+ move.l %d2,-68(%fp)
+ move.l -72(%fp),%d2
+ or.l -68(%fp),%d0
lea (%a2,%d2.l*4),%a3
- move.w %a0,%d2
+ move.b -105(%fp),%d2
lea prepared,%a2
- or.l -68(%fp),%d0
+ or.l -80(%fp),%d0
move.l (%a3),28(%a1)
- move.b -97(%fp),%d2
- move.l -108(%fp),%a3
- move.w %d2,%a0
+ move.b %d2,-109(%fp)
moveq #127,%d2
- move.w %a0,10(%a2,%a3.l)
+ move.w -110(%fp),%d3
+ move.l -84(%fp),%a3
+ move.w %d3,10(%a2,%a3.l)
move.b -10(%fp),%d0
move.l %d0,(%a2,%a3.l)
mvz.b -8(%fp),%d0
move.b -6(%fp),4(%a1)
cmp.l %d0,%d2
- jcs .L971
- jeq .L972
- move.b -40(%fp),%d3
- move.l -108(%fp),%a0
+ jcs .L1133
+ jeq .L1134
+ move.b -60(%fp),%d3
+ move.l -84(%fp),%a1
add.l #-64,%d0
- add.l #prepared,%a0
- move.b %d0,9(%a0)
- move.b %d3,7(%a0)
- move.l -60(%fp),-(%sp)
- move.l -80(%fp),-(%sp)
- move.l -64(%fp),-(%sp)
+ add.l #prepared,%a1
+ move.b %d0,9(%a1)
+ move.b %d3,7(%a1)
+ move.l -48(%fp),-(%sp)
+ move.l -52(%fp),-(%sp)
+ move.l -76(%fp),-(%sp)
move.l 8(%fp),-(%sp)
pea eng
move.l %d1,-116(%fp)
+ move.l %a0,-120(%fp)
jsr gran_params
lea (20,%sp),%sp
+ move.l -120(%fp),%a0
move.l -116(%fp),%d1
-.L962:
- move.l -28(%fp),-(%sp)
+.L1122:
+ move.l -104(%fp),-(%sp)
+ move.l -32(%fp),-(%sp)
+ move.l -84(%fp),%a1
+ add.l #prepared,%a1
+ move.l 28(%a1),-(%sp)
+ move.l 24(%a1),-(%sp)
+ move.l -52(%fp),-(%sp)
move.l -76(%fp),-(%sp)
- move.l -108(%fp),%a0
- add.l #prepared,%a0
- move.l 28(%a0),-(%sp)
- move.l 24(%a0),-(%sp)
- move.l -80(%fp),-(%sp)
- move.l -64(%fp),-(%sp)
move.l 8(%fp),-(%sp)
pea eng
move.l %d1,-116(%fp)
+ move.l %a0,-120(%fp)
jsr gran_render
lea (32,%sp),%sp
move.l -116(%fp),%d1
-.L1009:
move.l -120(%fp),%a0
- move.l -88(%fp),%a1
- move.l -84(%fp),%a2
+.L1175:
move.l -18(%fp),(%a0)
- move.l -96(%fp),%a3
- move.l -14(%fp),(%a1)
move.l -92(%fp),%a0
- move.l -10(%fp),(%a2)
- move.l -6(%fp),(%a3)
- move.w -2(%fp),(%a0)
- jra .L1007
-.L1005:
+ move.l -88(%fp),%a1
+ move.l -100(%fp),%a2
+ move.l -14(%fp),(%a0)
+ move.l -96(%fp),%a3
+ move.l -10(%fp),(%a1)
+ move.l -6(%fp),(%a2)
+ move.w -2(%fp),(%a3)
+ jra .L1173
+.L1171:
moveq #127,%d2
cmp.l %d0,%d2
- jcs .L1008
-.L947:
- tst.l 8(%a0)
- jne .L996
- move.l -104(%fp),%a1
- add.l #bindings,%a1
- move.l 24(%a1),%a2
- cmp.l (%a0),%a2
- jne .L951
- move.l 28(%a1),%a3
- cmp.l 16(%a0),%a3
- jne .L951
- move.l 20(%a0),%a0
- move.l %a0,-100(%fp)
- cmp.l 32(%a1),%a0
- jne .L951
- move.l %d0,%a0
- add.l #296896553,%a0
- move.l %a0,%d2
- lsl.l #2,%d2
- move.l -100(%fp),%d3
- move.l %d2,%a0
- cmp.l (%a0),%d3
- jne .L951
- move.l 16(%a1),%a0
- cmp.l 1074360194.l,%a0
- jne .L951
- move.l 12(%a1),%a2
- cmp.l 1073742942.l,%a2
- jne .L951
- move.l -2147456744,%a0
- cmp.l 4(%a1),%a0
- jne .L951
- move.l 8(%a1),%a3
- cmp.l -2147456748.l,%a3
- jne .L951
+ jcs .L1174
+.L1105:
+ tst.l 8(%a1)
+ jne .L1162
+ lea bindings,%a2
+ add.l -108(%fp),%a2
+ move.l 24(%a2),%a3
+ move.l %a2,-84(%fp)
+ cmp.l (%a1),%a3
+ jne .L1109
+ move.l 28(%a2),%d2
+ cmp.l 16(%a1),%d2
+ jne .L1109
move.l 20(%a1),%a1
- cmp.l (%a0,%d0.l*4),%a1
- jeq .L945
-.L951:
- move.l -104(%fp),%a1
- lea bindings,%a0
+ move.l %a1,-80(%fp)
+ cmp.l 32(%a2),%a1
+ jne .L1109
+ move.l %d0,%a1
+ add.l #296896553,%a1
+ move.l %a1,%d3
+ lsl.l #2,%d3
+ move.l -80(%fp),%a2
+ move.l %d3,%a1
+ cmp.l (%a1),%a2
+ jne .L1109
+ move.l -84(%fp),%a3
+ move.l 16(%a3),%a3
+ cmp.l 1074360194.l,%a3
+ jne .L1109
+ move.l -84(%fp),%a1
+ move.l 12(%a1),%a1
+ cmp.l 1073742942.l,%a1
+ jne .L1109
+ move.l -2147456744,%a1
+ move.l -84(%fp),%a2
+ cmp.l 4(%a2),%a1
+ jne .L1109
+ move.l 8(%a2),%a3
+ cmp.l -2147456748.l,%a3
+ jne .L1109
+ move.l 20(%a2),%d2
+ cmp.l (%a1,%d0.l*4),%d2
+ jeq .L1103
+.L1109:
move.l -108(%fp),%a2
- add.l #pages,%a2
- clr.l (%a0,%a1.l)
- add.l %a0,%a1
- move.l %a1,-(%sp)
+ lea bindings,%a1
+ move.l -112(%fp),%a3
+ add.l #pages,%a3
+ clr.l (%a1,%a2.l)
+ add.l %a1,%a2
move.l %a2,-(%sp)
- move.l -80(%fp),-(%sp)
+ move.l %a3,-(%sp)
+ move.l -52(%fp),-(%sp)
move.l %d0,-(%sp)
move.l %d1,-116(%fp)
+ move.l %a0,-120(%fp)
jsr open_source
lea (16,%sp),%sp
move.l -116(%fp),%d1
+ move.l -120(%fp),%a0
tst.l %d0
- jne .L945
- clr.l -80(%fp)
- jra .L945
-.L1006:
- move.l -100(%fp),%d0
- moveq #127,%d3
+ jne .L1103
+ clr.l -52(%fp)
+ jra .L1103
+.L1172:
lsl.l #5,%d0
- add.l %d0,%a1
- move.b 63(%a0),%d0
- move.b 64(%a0),%d2
+ moveq #127,%d3
+ add.l %d0,-108(%fp)
+ move.b 63(%a1),%d0
+ move.b 64(%a1),%d2
and.l %d0,%d3
- move.w %d2,%a0
+ move.w %d2,%a1
moveq #127,%d2
- move.b %d3,-41(%fp)
- move.l %a0,%d0
+ move.b %d3,-53(%fp)
+ move.l %a1,%d0
and.l %d2,%d0
- move.b %d0,-69(%fp)
- jra .L953
-.L966:
+ move.b %d0,-61(%fp)
+ jra .L1111
+.L1128:
moveq #16,%d0
- jra .L943
-.L969:
- clr.l -60(%fp)
- jra .L959
-.L968:
+ jra .L1101
+.L1130:
clr.b %d3
clr.b %d0
- move.b %d3,-69(%fp)
- move.b %d0,-41(%fp)
- jra .L953
-.L960:
- move.l 8(%fp),%d3
- moveq #12,%d0
- move.l -64(%fp),%d2
- move.l -108(%fp),%a1
- muls.l %d0,%d3
- add.l %d2,%d2
- lea prepared,%a0
+ move.b %d3,-61(%fp)
+ move.b %d0,-53(%fp)
+ jra .L1111
+.L1131:
+ clr.l -48(%fp)
+ jra .L1119
+.L1120:
+ move.l 8(%fp),%d2
+ moveq #12,%d3
+ move.l -84(%fp),%a2
clr.l %d0
- clr.l 12(%a0,%a1.l)
+ lea prepared,%a1
+ muls.l %d3,%d2
+ clr.l 12(%a1,%a2.l)
+ move.l -36(%fp),%d3
lea live_w,%a3
- move.l %d3,-112(%fp)
- move.l %d3,%a1
- add.l #live_w,%a1
- move.l -56(%fp),%d3
+ move.l %d2,-112(%fp)
+ move.l -68(%fp),%d2
move.l -112(%fp),%a2
- move.l %d2,%a0
- move.l -48(%fp),%d2
+ move.l -112(%fp),%a1
+ add.l #live_w,%a1
+ add.l %d2,%d2
move.l %d3,(%a2,%a3.l)
- move.l -32(%fp),%d3
- move.l %d2,4(%a1)
+ move.l -40(%fp),%d3
move.l %d3,8(%a1)
- move.l -76(%fp),%a1
-.L963:
+ move.l %d2,-108(%fp)
+ move.l -44(%fp),%d2
+ move.l %d2,4(%a1)
+ move.l -32(%fp),%a1
+.L1123:
clr.l (%a1)+
addq.l #1,%d0
- cmp.l %d0,%a0
- jls .L942
+ cmp.l -108(%fp),%d0
+ jcc .L1126
clr.l (%a1)+
addq.l #1,%d0
- cmp.l %d0,%a0
- jhi .L963
- jra .L942
-.L971:
+ cmp.l -108(%fp),%d0
+ jcs .L1123
+ jra .L1126
+.L1133:
clr.b %d0
- move.b -40(%fp),%d3
- move.l -108(%fp),%a0
- add.l #prepared,%a0
- move.b %d0,9(%a0)
- move.b %d3,7(%a0)
- move.l -60(%fp),-(%sp)
- move.l -80(%fp),-(%sp)
- move.l -64(%fp),-(%sp)
+ move.b -60(%fp),%d3
+ move.l -84(%fp),%a1
+ add.l #prepared,%a1
+ move.b %d0,9(%a1)
+ move.b %d3,7(%a1)
+ move.l -48(%fp),-(%sp)
+ move.l -52(%fp),-(%sp)
+ move.l -76(%fp),-(%sp)
move.l 8(%fp),-(%sp)
pea eng
move.l %d1,-116(%fp)
+ move.l %a0,-120(%fp)
jsr gran_params
lea (20,%sp),%sp
+ move.l -120(%fp),%a0
move.l -116(%fp),%d1
- jra .L962
-.L970:
+ jra .L1122
+.L1132:
moveq #2,%d3
- move.l %d3,-48(%fp)
- jra .L964
-.L991:
- move.l -60(%fp),%a1
- move.l -64(%fp),%a0
- cmp.l 16(%a0),%a1
- jeq .L992
-.L998:
+ move.l %d3,-44(%fp)
+ jra .L1124
+.L1112:
+ tst.b -83(%fp)
+ jne .L1114
+ move.l -80(%fp),%d0
+ moveq #127,%d3
+ lsl.l #5,%d0
+ add.l %d0,-108(%fp)
+ move.b 63(%a1),%d0
+ move.b 64(%a1),%d2
+ and.l %d0,%d3
+ move.w %d2,%a1
+ moveq #127,%d2
+ move.b %d3,-53(%fp)
+ move.l %a1,%d0
+ and.l %d2,%d0
+ move.b %d0,-61(%fp)
+ jra .L1111
+.L1157:
+ move.l -48(%fp),%a2
+ move.l -76(%fp),%a1
+ cmp.l 16(%a1),%a2
+ jeq .L1158
+.L1164:
move.l 8(%fp),%d2
moveq #12,%d3
mvz.w %d0,%d0
lea live_w,%a1
muls.l %d3,%d2
- move.l %d2,%a0
- jra .L961
-.L992:
- move.l -44(%fp),%a1
- move.l -64(%fp),%a0
- cmp.l 20(%a0),%a1
- jne .L998
+ move.l %d2,-68(%fp)
+ jra .L1121
+.L1158:
+ move.l -24(%fp),%a2
+ move.l -76(%fp),%a1
+ cmp.l 20(%a1),%a2
+ jne .L1164
move.l 8(%fp),%d2
moveq #12,%d3
lea live_w,%a1
+ move.l %a1,%a2
muls.l %d3,%d2
- lea (%a1,%d2.l),%a2
- move.l %d2,%a0
- move.l -48(%fp),%d2
- move.l %a2,-36(%fp)
+ add.l %d2,%a2
+ move.l %d2,-68(%fp)
+ move.l -44(%fp),%d2
+ move.l %a2,-56(%fp)
cmp.l 4(%a2),%d2
- jeq .L994
-.L997:
+ jeq .L1160
+.L1163:
mvz.w %d0,%d0
- jra .L961
-.L994:
- move.l -32(%fp),%a3
- move.l -36(%fp),%a2
+ jra .L1121
+.L1160:
+ move.l -40(%fp),%a3
+ move.l -56(%fp),%a2
cmp.l 8(%a2),%a3
- jne .L997
- mvz.w (%a1,%a0.l),%d2
+ jne .L1163
+ move.l -68(%fp),%d2
mvz.w %d0,%d0
- cmp.l %d2,%d0
- jne .L961
- move.l -36(%fp),%a0
- addq.l #2,%a0
- mvz.w (%a0),%d0
- move.l %a0,-36(%fp)
- cmp.l -100(%fp),%d0
- jeq .L962
+ mvz.w (%a1,%d2.l),%d2
+ cmp.l %d0,%d2
+ jne .L1121
+ move.l -56(%fp),%a1
+ addq.l #2,%a1
+ mvz.w (%a1),%d0
+ move.l %a1,-56(%fp)
+ cmp.l -108(%fp),%d0
+ jeq .L1122
moveq #15,%d3
- move.l -72(%fp),%d2
+ move.l -64(%fp),%d2
lsr.l %d3,%d2
- move.l -72(%fp),%d0
+ move.l -72(%fp),%a2
+ add.l #eng+208,%a2
+ move.l -108(%fp),%d3
+ move.l %a2,-80(%fp)
+ move.l %d2,%a1
+ move.l -108(%fp),%d2
+ lsr.l #8,%d2
+ move.l -64(%fp),%d0
lsr.l #6,%d0
- move.l -36(%fp),%a2
lea prepared,%a3
- move.l %d2,%a0
- move.l %a0,%d3
- move.l -100(%fp),%d2
- lsr.l #8,%d2
+ move.l -56(%fp),%a2
+ move.l %d2,-112(%fp)
+ move.l %a1,%d2
+ muls.l %d3,%d2
+ move.w %d3,(%a2)
+ lea (-109,%fp),%a2
and.l #511,%d0
- move.l -52(%fp),%a1
- add.l #eng+208,%a1
- move.l -108(%fp),%a0
- add.l #prepared,%a0
- move.l %d2,-104(%fp)
- move.l -100(%fp),%d2
- muls.l %d2,%d3
- move.w %d2,(%a2)
- move.l -108(%fp),%d2
- lea (-101,%fp),%a2
- mulu.w -98(%fp),%d0
+ move.l %d2,%a1
+ move.l -84(%fp),%d2
move.b (%a2),(%a3,%d2.l)
- move.l -64(%fp),%a2
+ move.l -76(%fp),%a2
moveq #9,%d2
+ mulu.w -106(%fp),%d0
+ lea (-105,%fp),%a3
lsr.l %d2,%d0
- lea (-97,%fp),%a3
- add.l %d3,%d0
- move.l %d0,(%a1)
move.b (%a3),11(%a2)
- move.l -28(%fp),-(%sp)
+ move.l -80(%fp),%a2
+ add.l %a1,%d0
+ move.l %d0,(%a2)
+ move.l -84(%fp),%a1
+ add.l #prepared,%a1
+ move.l -104(%fp),-(%sp)
+ move.l -32(%fp),-(%sp)
+ move.l 28(%a1),-(%sp)
+ move.l 24(%a1),-(%sp)
+ move.l -52(%fp),-(%sp)
move.l -76(%fp),-(%sp)
- move.l 28(%a0),-(%sp)
- move.l 24(%a0),-(%sp)
- move.l -80(%fp),-(%sp)
- move.l -64(%fp),-(%sp)
move.l 8(%fp),-(%sp)
pea eng
move.l %d1,-116(%fp)
+ move.l %a0,-120(%fp)
jsr gran_render
lea (32,%sp),%sp
move.l -116(%fp),%d1
- jra .L1009
-.L967:
+ move.l -120(%fp),%a0
+ jra .L1175
+.L1129:
moveq #20,%d0
- jra .L943
-.L1008:
- move.w #1,%a1
+ jra .L1101
+.L1174:
move.l %d0,%d3
+ moveq #1,%d2
add.l #-128,%d3
- move.l #-2147463394,%a2
- move.l %a1,%d2
lsl.l %d3,%d2
- move.l %d2,-40(%fp)
+ move.l %d2,-76(%fp)
moveq #84,%d2
muls.l %d2,%d3
- move.l -40(%fp),%d2
+ move.l -76(%fp),%d2
and.l -2147463400,%d2
- move.l %d3,%a1
- add.l %d3,%a2
- add.l #-2147462722,%a1
- move.l %a2,-100(%fp)
- move.l %a1,-68(%fp)
+ move.l %d3,%a2
+ move.l %d3,%a3
+ add.l #-2147463394,%a2
+ add.l #-2147462722,%a3
+ move.l %a2,-80(%fp)
+ move.l %a3,-84(%fp)
tst.l %d2
- jne .L948
- move.l -68(%fp),%a1
- move.l %a2,-68(%fp)
- move.l %a1,-100(%fp)
-.L948:
- move.l -68(%fp),%a1
- tst.b (%a1)
- jne .L996
- move.l -100(%fp),%a2
+ jne .L1106
+ move.l %a2,-84(%fp)
+ move.l %a3,-80(%fp)
+.L1106:
+ move.l -84(%fp),%a2
+ tst.b (%a2)
+ jne .L1162
+ move.l -80(%fp),%a2
moveq #-3,%d3
mvz.b (%a2),%d2
- and.l %d3,%d2
- tst.l %d2
- jeq .L947
- clr.l -80(%fp)
- jra .L945
-.L972:
+ and.l %d2,%d3
+ tst.l %d3
+ jeq .L1105
+ clr.l -52(%fp)
+ jra .L1103
+.L1134:
moveq #64,%d0
- move.b -40(%fp),%d3
- move.l -108(%fp),%a0
- add.l #prepared,%a0
- move.b %d0,9(%a0)
- move.b %d3,7(%a0)
- move.l -60(%fp),-(%sp)
- move.l -80(%fp),-(%sp)
- move.l -64(%fp),-(%sp)
+ move.b -60(%fp),%d3
+ move.l -84(%fp),%a1
+ add.l #prepared,%a1
+ move.b %d0,9(%a1)
+ move.b %d3,7(%a1)
+ move.l -48(%fp),-(%sp)
+ move.l -52(%fp),-(%sp)
+ move.l -76(%fp),-(%sp)
move.l 8(%fp),-(%sp)
pea eng
move.l %d1,-116(%fp)
+ move.l %a0,-120(%fp)
jsr gran_params
lea (20,%sp),%sp
+ move.l -120(%fp),%a0
move.l -116(%fp),%d1
- jra .L962
+ jra .L1122
.size grain_render, .-grain_render
.align 2
.globl grain_draw
.type grain_draw, @function
grain_draw:
lea (-168,%sp),%sp
- move.l draws,%a0
- move.l %a0,%d1
- movem.l #17532,(%sp)
- addq.l #1,%d1
+ movem.l #17468,(%sp)
+ move.l draws,%d2
+ addq.l #1,%d2
move.l 172(%sp),%a6
+ move.l %d2,draws
addq.l #1,live_tick
- move.l %d1,draws
tst.l 1187503134
- jeq .L1095
- tst.b src_was.10.l
- seq %d4
+ jeq .L1276
+ tst.b src_was.15.l
+ seq %d3
moveq #1,%d0
- mvs.b %d4,%d4
- neg.l %d4
-.L1011:
- move.b %d0,src_was.10
- move.l #1187521622,%a1
- move.b (was_setup.9),%d5
- move.b 269161676,%d3
- move.l (%a1),%d0
+ mvs.b %d3,%d3
+ neg.l %d3
+.L1177:
+ move.b was_setup.14,%d1
+ move.b %d0,src_was.15
+ move.l #1187521622,%a0
+ move.b %d1,34(%sp)
+ move.b 269161676,%d4
+ move.l (%a0),%d0
add.l #-1073741824,%d0
+ move.w %d4,%a1
cmp.l #133169151,%d0
- jhi .L1012
+ jhi .L1178
tst.b -2147483627.l
- jne .L1012
+ jne .L1178
tst.b 1187502296.l
- jne .L1012
+ jne .L1178
tst.l 1175351520
- jne .L1012
- move.l 1175346736,%d2
- tst.l %d2
- jeq .L1156
-.L1012:
- clr.b %d0
- move.b %d0,(was_setup.9)
- move.b %d0,setup_visible
-.L1014:
- tst.l %d4
- jeq .L1016
+ jne .L1178
+ move.l 1175346736,%d1
+ tst.l %d1
+ jeq .L1353
+.L1178:
+ clr.b %d5
+ move.b %d5,was_setup.14
+ move.b %d5,setup_visible
+.L1180:
+ tst.l %d3
+ jeq .L1182
move.b 269161676,%d0
tst.b full.l
- jeq .L1017
- clr.b %d0
- move.b %d0,full
-.L1016:
+ jeq .L1183
+ clr.b %d1
+ move.b %d1,full
+.L1182:
move.l src_seen,%d0
add.l #30,%d0
- cmp.l %d1,%d0
- jcs .L1010
- move.l #1187521622,%a1
- move.l (%a1),%d0
+ cmp.l %d2,%d0
+ jcs .L1176
+ move.l #1187521622,%a0
+ move.l (%a0),%d0
add.l #-1073741824,%d0
cmp.l #133169151,%d0
- jhi .L1010
+ jhi .L1176
tst.b -2147483627.l
- jne .L1010
+ jne .L1176
move.l setup_seen,%d0
addq.l #3,%d0
- cmp.l %d1,%d0
- jcc .L1010
+ cmp.l %d2,%d0
+ jcc .L1176
tst.b 1187502296.l
- jne .L1157
+ jne .L1354
move.b 1175456539,%d0
- moveq #6,%d2
- and.l %d2,%d0
+ moveq #6,%d1
+ and.l %d1,%d0
tst.b %d0
- jne .L1010
+ jne .L1176
tst.l 1175351520
- jne .L1010
- move.l 1175346736,%d3
- move.l %d3,52(%sp)
- tst.l %d3
- jeq .L1158
-.L1010:
- movem.l (%sp),#17532
+ jne .L1176
+ move.l 1175346736,%d2
+ move.l %d2,70(%sp)
+ tst.l %d2
+ jeq .L1355
+.L1176:
+ movem.l (%sp),#17468
lea (168,%sp),%sp
rts
-.L1095:
+.L1276:
clr.b %d0
- clr.l %d4
- jra .L1011
-.L1017:
- tst.b %d5
- jeq .L1016
- move.l #1187521622,%a1
- move.l (%a1),%d2
- add.l #-1073741824,%d2
- cmp.l #133169151,%d2
- jhi .L1016
+ clr.l %d3
+ jra .L1177
+.L1183:
+ tst.b 34(%sp)
+ jeq .L1182
+ move.l #1187521622,%a0
+ move.l (%a0),%d1
+ add.l #-1073741824,%d1
+ cmp.l #133169151,%d1
+ jhi .L1182
tst.b -2147483627.l
- jne .L1016
- move.b 269161679,%d2
+ jne .L1182
+ move.b 269161679,%d1
moveq #7,%d3
and.l %d0,%d3
moveq #3,%d0
move.l #6322,%d4
- move.l (%a1),%a1
- add.l #585088,%a1
- and.l %d2,%d0
+ move.l (%a0),%a0
+ add.l #585088,%a0
+ and.l %d1,%d0
move.l %d3,-(%sp)
muls.l %d4,%d0
- pea (%a1,%d0.l)
- move.l %d1,40(%sp)
- move.l %a0,36(%sp)
+ pea (%a0,%d0.l)
jsr ours
addq.l #8,%sp
- move.l 32(%sp),%d1
- move.l 28(%sp),%a0
tst.l %d0
- jeq .L1016
- moveq #1,%d6
- move.b %d6,full
- jra .L1016
-.L1157:
+ jeq .L1182
+ moveq #1,%d5
+ move.b %d5,full
+ jra .L1182
+.L1354:
clr.b %d0
- movem.l (%sp),#17532
+ movem.l (%sp),#17468
move.b %d0,full
lea (168,%sp),%sp
rts
-.L1158:
+.L1355:
move.b 269161676,%d2
- moveq #7,%d4
- moveq #3,%d6
+ moveq #7,%d3
+ moveq #3,%d4
move.b 269161679,%d0
- move.l (%a1),%a1
- move.l #6322,%d3
- add.l #585088,%a1
- and.l %d2,%d4
- and.l %d6,%d0
- move.l %d4,44(%sp)
- mvz.b %d4,%d2
- move.b 47(%sp),%d4
- muls.l %d3,%d0
- move.l %d2,48(%sp)
- add.l %a1,%d0
- move.b %d4,76(%sp)
- move.l %d2,-(%sp)
- move.l %d0,60(%sp)
+ move.l (%a0),%d1
+ add.l #585088,%d1
+ and.l %d2,%d3
+ move.l #6322,%d2
+ and.l %d4,%d0
+ move.l %d3,42(%sp)
+ mvz.b %d3,%d5
+ move.b 45(%sp),%d3
+ muls.l %d2,%d0
+ move.l %d5,50(%sp)
+ add.l %d1,%d0
+ move.b %d3,82(%sp)
+ move.l %d5,-(%sp)
+ move.l %d0,66(%sp)
move.l %d0,-(%sp)
- move.l %d1,40(%sp)
- move.l %a0,36(%sp)
jsr ours
- move.l %d0,96(%sp)
+ move.l %d0,98(%sp)
addq.l #8,%sp
- move.l 32(%sp),%d1
- move.l 28(%sp),%a0
tst.l %d0
- jeq .L1010
+ jeq .L1176
+ moveq #54,%d4
move.l %a6,fbp
- move.l #439,%d5
- moveq #54,%d0
-.L1020:
- moveq #8,%d2
-.L1024:
- move.l %d2,%d4
- asr.l #3,%d4
- moveq #7,%d3
- and.l %d2,%d3
- addq.l #1,%d2
- move.l %d4,%a1
- move.l %d5,%d4
- sub.l %a1,%d4
- mvz.b (%a6,%d4.l),%d4
- btst %d3,%d4
- jeq .L1159
- moveq #49,%d6
- cmp.l %d2,%d6
- jne .L1024
- move.w #983,%a1
- moveq #122,%d2
- move.l %d2,40(%sp)
-.L1094:
- moveq #8,%d2
-.L1028:
- move.l %d2,%d3
- asr.l #3,%d3
- moveq #7,%d4
- move.l %a1,%d5
- and.l %d2,%d4
- sub.l %d3,%d5
- addq.l #1,%d2
- mvz.b (%a6,%d5.l),%d3
- btst %d4,%d3
- jeq .L1160
- moveq #49,%d6
- cmp.l %d2,%d6
- jne .L1028
- moveq #-1,%d4
+ move.l #439,%d1
+ move.l %d4,38(%sp)
+.L1186:
+ moveq #8,%d0
+.L1190:
+ move.l %d0,%d3
+ asr.l #3,%d3
+ moveq #7,%d2
+ move.l %d1,%a1
+ and.l %d0,%d2
+ sub.l %d3,%a1
+ addq.l #1,%d0
+ mvz.b (%a6,%a1.l),%d3
+ btst %d2,%d3
+ jeq .L1356
+ moveq #49,%d5
+ cmp.l %d0,%d5
+ jne .L1190
+ move.w #983,%a1
+ moveq #122,%d5
+ move.l %d5,%d3
+.L1275:
+ moveq #8,%d0
+.L1194:
+ move.l %d0,%d1
+ asr.l #3,%d1
+ moveq #7,%d2
+ and.l %d0,%d2
+ move.l %a1,%a0
+ addq.l #1,%d0
+ sub.l %d1,%a0
+ mvz.b (%a6,%a0.l),%d1
+ btst %d2,%d1
+ jeq .L1357
+ moveq #49,%d4
cmp.l %d0,%d4
- jeq .L1010
- mvz.w %d0,%d3
- move.l 40(%sp),%a1
- move.l %d0,%d4
+ jne .L1194
+ move.l %d3,34(%sp)
+ moveq #-1,%d0
+ cmp.l 38(%sp),%d0
+ jeq .L1176
+ mvz.w 40(%sp),%d0
+ move.l 38(%sp),%a0
clr.l %d2
- addq.l #2,%d4
- lsl.l #3,%d3
- subq.l #2,%a1
- lea 16(%a6,%d3.l),%a2
- move.l %a2,%d5
-.L1029:
- move.l %d5,%a2
- moveq #1,%d6
- mvz.b (%a2),%d3
- addq.l #1,%d4
- addq.l #8,%d5
- lsr.l #3,%d3
- and.l %d6,%d3
- add.l %d3,%d2
- cmp.l %d4,%a1
- jgt .L1029
+ addq.l #2,%a0
+ move.l 34(%sp),%d1
+ subq.l #2,%d1
+ lsl.l #3,%d0
+ lea 16(%a6,%d0.l),%a1
+.L1195:
+ mvz.b (%a1),%d0
+ moveq #1,%d3
+ addq.l #1,%a0
+ addq.l #8,%a1
+ lsr.l #3,%d0
+ and.l %d3,%d0
+ add.l %d0,%d2
+ cmp.l %a0,%d1
+ jgt .L1195
add.l %d2,%d2
- moveq #-4,%d3
- sub.l %d0,%d3
- add.l 40(%sp),%d3
- cmp.l %d2,%d3
- jgt .L1010
- move.l 40(%sp),%a1
- move.l %d0,WX0
- move.l %a1,WX1
+ moveq #-4,%d0
+ sub.l 38(%sp),%d0
+ add.l 34(%sp),%d0
+ cmp.l %d2,%d0
+ jgt .L1176
+ move.l 38(%sp),%d4
+ move.l 34(%sp),%d5
+ move.l %d4,WX0
+ move.l %d5,WX1
tst.l 1175351520
- jne .L1030
- clr.b %d2
- move.b %d2,pool_direct
-.L1030:
- move.b 47(%sp),%d2
- move.l 56(%sp),%a2
- clr.l %d5
- clr.b %d3
- lea (61,%a0),%a1
- move.l %a1,92(%sp)
+ jne .L1196
+ clr.b %d0
+ move.b %d0,pool_direct
+.L1196:
+ mvz.w 1175263050,%d2
+ tst.l %d2
+ jeq .L1197
+ moveq #15,%d1
+ move.l %d2,%d0
+ lsr.l %d1,%d0
+ jne .L1277
+ moveq #15,%d0
+.L1199:
+ subq.l #1,%d0
+ btst %d0,%d2
+ jeq .L1199
+.L1198:
+ move.l #1175263052,%d2
+ moveq #48,%d1
+ move.l %d2,%a1
+ move.l (%a1),%a0
+ cmp.l %a0,%d1
+ jcc .L1200
+ mvz.w (%a1),%d2
+ move.l %d2,%a0
+ cmp.l %d2,%d1
+ jcs .L1197
+.L1200:
+ add.l %d0,%a0
+.L1201:
+ mvz.w 1175263050,%d2
+ move.l last_step.13,%a2
+ moveq #48,%d1
+ move.l %d2,54(%sp)
+ move.l #1175263052,%d2
+ move.l %d2,%a1
+ move.l (%a1),%d0
+ move.l %a2,58(%sp)
+ cmp.l %d0,%d1
+ jcs .L1202
+ tst.l 54(%sp)
+ jeq .L1203
+.L1204:
+ move.l 1187521622,%d2
+ add.l #-1073741824,%d2
+ cmp.l #133169151,%d2
+ jhi .L1203
+ move.b 45(%sp),%d2
+ mvz.w %d0,%d0
+ clr.l %d3
+ lsl.l #5,%d0
ext.w %d2
- move.b %d3,36(%sp)
- move.l #known.8,%d3
move.w %d2,%d4
- mulu.w #6,%d2
- add.l #last_val,%d2
- move.l %d2,%a1
- move.l %a6,%d2
- mulu.w #30,%d4
- lea 48(%a2,%d4.l),%a2
- move.l %d4,%a6
- move.l %d1,%d4
- move.l %d0,%d1
- move.l %a2,84(%sp)
-.L1034:
- move.l 84(%sp),%a2
- mvz.b (%a1,%d5.l),%d6
- move.b (%a2,%d5.l),%d0
- move.l %d6,64(%sp)
- mvz.b %d0,%d6
- cmp.l 64(%sp),%d6
- jeq .L1032
- move.l 48(%sp),%a2
- move.b %d0,(%a1,%d5.l)
- tst.b (%a2,%d3.l)
- jeq .L1032
- moveq #1,%d0
- move.b 76(%sp),%d6
- move.b %d5,60(%sp)
- move.b %d0,36(%sp)
- move.b %d6,80(%sp)
- move.l 92(%sp),%d6
- move.l %d6,72(%sp)
-.L1032:
- addq.l #1,%d5
+ move.w %d2,94(%sp)
+ move.l %d0,46(%sp)
+ move.l %a0,%d2
+ mulu.w #2330,%d4
+ move.l %d4,78(%sp)
+.L1209:
+ moveq #1,%d5
+ lsl.l %d3,%d5
+ move.l 54(%sp),%d0
+ move.l #1187521622,%a0
+ move.l %d5,86(%sp)
+ btst %d3,%d0
+ jeq .L1207
+ move.b 269161680,%d0
+ moveq #15,%d4
+ move.l #36568,%d5
+ move.l 78(%sp),%a1
+ move.l (%a0),%d1
+ addq.l #1,%d1
+ move.l %d1,66(%sp)
+ move.l had.12,%d1
+ and.l %d4,%d0
+ muls.l %d5,%d0
+ add.l %d0,%a1
+ add.l 46(%sp),%a1
+ lea (89,%a1),%a2
+ move.l %a2,74(%sp)
+ move.l 66(%sp),%a2
+ move.l 74(%sp),%d4
+ mvz.b (%a2,%d4.l),%d0
+ cmp.l #255,%d0
+ jeq .L1208
+ or.l 86(%sp),%d1
+ move.l %d1,had.12
+.L1207:
+ moveq #32,%d1
+ addq.l #1,%d3
+ add.l %d1,46(%sp)
+ moveq #16,%d4
+ cmp.l %d3,%d4
+ jne .L1209
+ move.l %d2,%a0
+ move.w 94(%sp),%d2
+.L1206:
+ move.l %a0,last_step.13
+ cmp.l 58(%sp),%a0
+ jeq .L1210
+ clr.l show_until
+.L1210:
+ move.w %d2,%d0
+ clr.l %d3
+ mulu.w #6,%d0
+ move.l %d0,%a1
+ add.l #last_val,%a1
+ move.l %a1,46(%sp)
+.L1212:
+ move.l %d3,-(%sp)
+ move.l 66(%sp),-(%sp)
+ move.l 58(%sp),-(%sp)
+ move.l %a0,38(%sp)
+ jsr shown_value
+ move.l 58(%sp),%a2
+ lea (12,%sp),%sp
+ mvz.b (%a2,%d3.l),%d1
+ move.l 26(%sp),%a0
+ move.l %d1,%a1
+ mvz.b %d0,%d1
+ cmp.l %a1,%d1
+ jeq .L1211
+ move.b %d0,(%a2,%d3.l)
+ move.l 50(%sp),%a2
+ lea known.11,%a1
+ tst.b (%a1,%a2.l)
+ jeq .L1211
+ cmp.l 58(%sp),%a0
+ jeq .L1358
+.L1211:
+ addq.l #1,%d3
moveq #6,%d0
- cmp.l %d5,%d0
- jne .L1034
- move.l %d1,%d0
- move.l %d4,%d1
- move.l %a6,%d4
- move.l %d2,%a6
- tst.b 36(%sp)
- jeq .L1035
- move.b 80(%sp),%d2
- move.b 60(%sp),%d6
- move.l 72(%sp),%a1
- move.l %a1,show_until
- move.b %d2,show_t
- move.b %d6,show_k
-.L1035:
- move.l 56(%sp),%a2
- move.l %d4,%d2
- add.l #485,%d2
- move.l 48(%sp),%d4
- move.b (%a2,%d2.l),%d2
- lea (last_fine.7),%a1
- mvz.b (%a1,%d4.l),%d5
- moveq #7,%d4
- and.l %d2,%d4
- cmp.l %d5,%d4
- jeq .L1151
- move.l 48(%sp),%a2
- move.b %d4,(%a1,%a2.l)
- tst.b (%a2,%d3.l)
- jeq .L1151
- moveq #1,%d2
- move.l 48(%sp),%a2
- lea (47,%sp),%a1
- move.b (%a1),show_t
- lea (61,%a0),%a0
- move.l %a0,show_until
- move.b %d2,show_k
- move.b %d2,(%a2,%d3.l)
-.L1039:
- cmp.l show_until.l,%d1
- jcc .L1040
- mvz.b show_k,%d2
- move.l %d2,60(%sp)
-.L1042:
+ cmp.l %d3,%d0
+ jne .L1212
+ move.w %d2,%d0
+ move.l 62(%sp),%a1
+ moveq #7,%d1
+ mulu.w #30,%d0
+ add.l #485,%d0
+ move.b (%a1,%d0.l),%d0
+ and.l %d1,%d0
+ tst.l %a0
+ jlt .L1214
+ move.l #1187521622,%a1
+ move.l (%a1),%d3
+ add.l #-1073741824,%d3
+ cmp.l #133169151,%d3
+ jhi .L1214
+ move.l (%a1),%a1
+ moveq #15,%d1
+ move.b 269161680,%d3
+ moveq #63,%d4
+ move.l #36568,%d5
+ mulu.w #2330,%d2
+ and.l %d3,%d1
+ move.l %a0,%d3
+ and.l %d4,%d3
+ muls.l %d5,%d1
+ lsl.l #5,%d3
+ lea 106(%a1,%d1.l),%a1
+ moveq #7,%d1
+ add.l %a1,%d2
+ move.l %d2,%a1
+ move.b (%a1,%d3.l),%d2
+ mvz.b %d2,%d3
+ add.l #-119,%d3
+ cmp.l %d3,%d1
+ jcs .L1214
+ add.l #-119,%d2
+ move.b %d2,%d0
+.L1214:
+ cmp.l 58(%sp),%a0
+ jeq .L1216
+ move.l 50(%sp),%d2
+ lea last_fine.10,%a0
+ moveq #1,%d1
+ move.b %d0,(%a0,%d2.l)
+ move.b show_t,%d0
+ move.l 50(%sp),%a1
+ lea known.11,%a0
+ move.b %d1,(%a0,%a1.l)
+ mvz.b %d0,%d0
+ cmp.l %a1,%d0
+ jeq .L1220
+.L1221:
+ moveq #-1,%d1
+ move.l %d1,58(%sp)
+.L1223:
tst.b full.l
- jne .L1161
- move.l %d0,%d3
- addq.l #1,%d3
- move.l 40(%sp),%d5
- move.l %d3,%d2
- sub.l %d0,%d5
-.L1071:
+ jne .L1359
+ move.l 34(%sp),%d3
+ move.l 38(%sp),%a6
+ addq.l #1,%a6
+ move.l %a6,%d2
+ sub.l 38(%sp),%d3
+.L1252:
clr.l -(%sp)
pea 56.w
pea 9.w
@@ -7745,111 +8845,120 @@ grain_draw:
jsr (vfill.part.0)
addq.l #1,%d2
lea (16,%sp),%sp
- cmp.l 40(%sp),%d2
- jlt .L1071
+ cmp.l 34(%sp),%d2
+ jlt .L1252
moveq #3,%d4
- divs.l %d4,%d5
+ divs.l %d4,%d3
lea os_text,%a0
- move.l %a0,36(%sp)
- move.l %d3,%d0
- move.l 52(%sp),%d3
-.L1089:
+ move.l %a0,34(%sp)
+ move.l %a6,%d0
+ move.l %d3,42(%sp)
+ move.l 70(%sp),%d3
+.L1270:
move.l %d3,%d1
moveq #3,%d2
remu.l %d2,%d4:%d1
- moveq #2,%d6
+ move.l %d0,%a6
+ moveq #2,%d5
move.w %d4,%d1
- move.l %d4,40(%sp)
- move.l %d0,%d4
- muls.w %d5,%d1
- add.l %d1,%d4
- cmp.l %d3,%d6
- jcs .L1072
- cmp.l 60(%sp),%d3
- jeq .L1098
+ move.l %d4,38(%sp)
+ muls.w 44(%sp),%d1
+ add.l %d1,%a6
+ cmp.l %d3,%d5
+ jcs .L1253
+ cmp.l 58(%sp),%d3
+ jeq .L1280
addq.l #1,%d3
- jra .L1089
-.L1156:
+ jra .L1270
+.L1353:
+ move.l %a1,%d5
+ moveq #7,%d4
+ and.l %d4,%d5
move.b 269161679,%d0
- moveq #7,%d6
- and.l %d3,%d6
- moveq #3,%d3
- move.l (%a1),%a1
- add.l #585088,%a1
- and.l %d3,%d0
- move.l %d6,-(%sp)
- move.l #6322,%d6
- muls.l %d6,%d0
- pea (%a1,%d0.l)
- move.l %d1,40(%sp)
- move.l %a0,36(%sp)
+ move.l (%a0),%a0
+ move.l #6322,%d4
+ add.l #585088,%a0
+ move.l %d5,-(%sp)
+ moveq #3,%d5
+ and.l %d5,%d0
+ muls.l %d4,%d0
+ pea (%a0,%d0.l)
+ move.l %d1,38(%sp)
jsr ours
addq.l #8,%sp
- move.l 32(%sp),%d1
- move.l 28(%sp),%a0
+ move.l 30(%sp),%d1
tst.l %d0
- jeq .L1012
- move.l %a6,%d3
- add.l #880,%d3
- lea (160,%a6),%a1
-.L1015:
- mvz.b (%a1),%d0
- moveq #1,%d6
- addq.l #8,%a1
+ jeq .L1178
+ lea (160,%a6),%a0
+ lea (880,%a6),%a1
+.L1181:
+ mvz.b (%a0),%d0
+ moveq #1,%d4
+ addq.l #8,%a0
lsr.l #3,%d0
- and.l %d6,%d0
- add.l %d0,%d2
- cmp.l %d3,%a1
- jne .L1015
- moveq #44,%d3
- cmp.l %d2,%d3
+ and.l %d4,%d0
+ add.l %d0,%d1
+ cmp.l %a1,%a0
+ jne .L1181
+ moveq #44,%d5
+ cmp.l %d1,%d5
scc %d0
neg.l %d0
- move.b %d0,(was_setup.9)
+ move.b %d0,was_setup.14
move.b %d0,setup_visible
- cmp.l %d2,%d3
- jcs .L1014
+ cmp.l %d1,%d5
+ jcs .L1180
tst.l 1175351520
- jne .L1014
- clr.b %d6
- move.b %d6,pool_direct
- jra .L1014
-.L1160:
- subq.l #1,40(%sp)
+ jne .L1180
+ clr.b %d0
+ move.b %d0,pool_direct
+ jra .L1180
+.L1357:
+ subq.l #1,%d3
subq.l #8,%a1
- moveq #107,%d6
- cmp.l 40(%sp),%d6
- jeq .L1010
- moveq #8,%d2
- jra .L1028
-.L1159:
- addq.l #1,%d0
- addq.l #8,%d5
+ moveq #107,%d1
+ cmp.l %d3,%d1
+ jeq .L1176
+ moveq #8,%d0
+ jra .L1194
+.L1356:
+ addq.l #1,38(%sp)
+ addq.l #8,%d1
moveq #67,%d2
- cmp.l %d0,%d2
- jne .L1020
- moveq #122,%d2
- moveq #-1,%d0
+ cmp.l 38(%sp),%d2
+ jne .L1186
+ moveq #-1,%d3
+ moveq #122,%d5
+ move.l %d3,38(%sp)
move.w #983,%a1
- move.l %d2,40(%sp)
- jra .L1094
-.L1151:
- move.b show_t,%d2
- moveq #1,%d4
- move.l 48(%sp),%a0
- mvz.b %d2,%d2
- move.b %d4,(%a0,%d3.l)
- cmp.l %a0,%d2
- jeq .L1039
-.L1040:
- moveq #-1,%d1
- move.l %d1,60(%sp)
- jra .L1042
-.L1072:
+ move.l %d5,%d3
+ jra .L1275
+.L1202:
+ move.w (%a1),%d0
+ tst.l 54(%sp)
+ jeq .L1203
+ mvz.w %d0,%d0
+ moveq #48,%d1
+ cmp.l %d0,%d1
+ jcc .L1204
+.L1203:
+ move.b 45(%sp),%d2
+ clr.l had.12
+ ext.w %d2
+ jra .L1206
+.L1358:
+ move.b 82(%sp),%d1
+ move.l draws,%a1
+ move.b %d3,show_k
+ lea (60,%a1),%a1
+ move.l %a1,show_until
+ move.b %d1,show_t
+ jra .L1211
+.L1253:
moveq #51,%d2
- cmp.l 60(%sp),%d3
- jeq .L1073
- lea (names.6),%a0
+ cmp.l 58(%sp),%d3
+ jeq .L1254
+ lea (names.9),%a0
move.l (%a0,%d3.l*4),%d2
move.l %d2,-(%sp)
pea -1.w
@@ -7859,165 +8968,219 @@ grain_draw:
pea 51.w
move.l %d0,%d1
tst.l %d0
- jlt .L1162
- move.l %d5,%d0
+ jlt .L1360
+ move.l 62(%sp),%d0
sub.l %d1,%d0
move.l %d0,%d0
- jpl .L1170
+ jpl .L1368
addq.l #1,%d0
-.L1170:
+.L1368:
asr.l #1,%d0
- move.l %d0,%a1
- pea (%a1,%d4.l)
- move.l 60(%sp),%a2
- jsr (%a2)
+ pea (%a6,%d0.l)
+ move.l 58(%sp),%a1
+ jsr (%a1)
lea (24,%sp),%sp
- tst.l 40(%sp)
- jne .L1163
-.L1081:
- move.l WX0,%d0
+ tst.l 38(%sp)
+ jne .L1361
+.L1262:
+ move.l WX0,%a0
addq.l #1,%d3
- moveq #6,%d4
- cmp.l %d3,%d4
- jeq .L1088
+ moveq #6,%d0
+ move.l %a0,38(%sp)
+ cmp.l %d3,%d0
+ jeq .L1269
+ move.l %a0,%d0
addq.l #1,%d0
- jra .L1089
-.L1163:
+ jra .L1270
+.L1361:
+ move.l fbp,%d2
+ move.l %a6,%d0
move.w #56,%a0
- move.l fbp,%a6
- move.l %d4,%d0
moveq #50,%d1
subq.l #1,%d0
-.L1087:
- moveq #127,%d2
- cmp.l %d0,%d2
- jcc .L1164
+ move.l %d2,46(%sp)
+.L1268:
+ moveq #127,%d4
+ cmp.l %d0,%d4
+ jcc .L1362
addq.l #2,%d1
cmp.l %d1,%a0
- jge .L1087
- jra .L1081
-.L1162:
+ jge .L1268
+ jra .L1262
+.L1360:
clr.l %d1
- move.l %d5,%d0
+ move.l 62(%sp),%d0
sub.l %d1,%d0
move.l %d0,%d0
- jpl .L1171
+ jpl .L1369
addq.l #1,%d0
-.L1171:
+.L1369:
asr.l #1,%d0
- move.l %d0,%a1
- pea (%a1,%d4.l)
- move.l 60(%sp),%a2
- jsr (%a2)
+ pea (%a6,%d0.l)
+ move.l 58(%sp),%a1
+ jsr (%a1)
lea (24,%sp),%sp
- tst.l 40(%sp)
- jeq .L1081
- jra .L1163
-.L1088:
+ tst.l 38(%sp)
+ jeq .L1262
+ jra .L1361
+.L1269:
move.l WX1,%a6
- addq.l #1,%d0
- cmp.l %a6,%d0
- jge .L1090
- move.l %d0,%d6
- move.l %d0,%d1
- lsl.l #3,%d6
+ move.l 38(%sp),%d1
+ addq.l #1,%d1
+ cmp.l %a6,%d1
+ jge .L1271
+ move.l %d1,%d3
+ move.l %d1,%d0
+ lsl.l #3,%d3
move.l fbp,%d2
- move.l %d6,%a0
+ move.l %d3,%a0
lea 1(%a0,%d2.l),%a1
lea 6(%a0,%d2.l),%a0
-.L1092:
- moveq #127,%d2
- cmp.l %d1,%d2
- jcs .L1091
+.L1273:
+ moveq #127,%d4
+ cmp.l %d0,%d4
+ jcs .L1272
move.b (%a0),%d2
- moveq #2,%d3
- or.l %d3,%d2
+ moveq #2,%d5
+ or.l %d5,%d2
move.b %d2,(%a0)
move.b (%a1),%d2
- or.l %d3,%d2
+ or.l %d5,%d2
move.b %d2,(%a1)
-.L1091:
- addq.l #2,%d1
+.L1272:
+ addq.l #2,%d0
lea (16,%a1),%a1
lea (16,%a0),%a0
- cmp.l %d1,%a6
- jgt .L1092
-.L1090:
+ cmp.l %d0,%a6
+ jgt .L1273
+.L1271:
pea 47.w
pea 10.w
pea -1(%a6)
- move.l %d0,-(%sp)
- move.l 72(%sp),-(%sp)
- move.l 68(%sp),-(%sp)
+ move.l %d1,-(%sp)
+ move.l 78(%sp),-(%sp)
+ move.l 70(%sp),-(%sp)
jsr wave_area
lea (24,%sp),%sp
- movem.l (%sp),#17532
+ movem.l (%sp),#17468
lea (168,%sp),%sp
rts
-.L1098:
+.L1362:
+ lsl.l #3,%d0
+ move.w #1,%a6
+ move.l %d3,%d2
+ addq.l #7,%d0
+ move.l %d0,38(%sp)
+.L1267:
+ move.l %d1,%d0
+ asr.l #3,%d0
+ move.l 38(%sp),%a1
+ moveq #7,%d3
+ and.l %d1,%d3
+ addq.l #2,%d1
+ sub.l %d0,%a1
+ add.l 46(%sp),%a1
+ move.l %a6,%d0
+ move.b (%a1),57(%sp)
+ lsl.l %d3,%d0
+ move.b 57(%sp),%d5
+ or.l %d5,%d0
+ move.b %d0,(%a1)
+ cmp.l %d1,%a0
+ jge .L1267
+ move.l %d2,%d3
+ jra .L1262
+.L1216:
+ move.l 50(%sp),%d4
+ lea last_fine.10,%a0
+ mvz.b %d0,%d2
+ mvz.b (%a0,%d4.l),%d3
+ cmp.l %d3,%d2
+ jeq .L1348
+ move.l 50(%sp),%d5
+ move.b %d0,(%a0,%d5.l)
+ lea known.11,%a0
+ tst.b (%a0,%d5.l)
+ jeq .L1348
+ moveq #1,%d0
+ move.l 50(%sp),%a2
+ lea known.11,%a1
+ lea (45,%sp),%a0
+ move.b (%a0),show_t
+ move.l draws,%a0
+ lea (60,%a0),%a0
+ move.l %a0,show_until
+ move.b %d0,show_k
+ move.b %d0,(%a1,%a2.l)
+.L1220:
+ move.l draws,%a2
+ cmp.l show_until.l,%a2
+ jcc .L1221
+ mvz.b show_k,%d2
+ move.l %d2,58(%sp)
+ jra .L1223
+.L1280:
moveq #3,%d2
-.L1073:
+.L1254:
move.l %d3,-(%sp)
- move.l 60(%sp),-(%sp)
- move.l 56(%sp),-(%sp)
- lea (116,%sp),%a6
- move.l %a6,-(%sp)
+ move.l 66(%sp),-(%sp)
+ move.l 58(%sp),-(%sp)
+ pea 116(%sp)
jsr knob_value
+ move.l 58(%sp),%a1
lea (16,%sp),%sp
- move.l %d4,%a1
- lea -1(%a1,%d5.l),%a0
- cmp.l %a0,%d4
- jge .L1076
+ lea -1(%a6,%a1.l),%a0
+ cmp.l %a0,%a6
+ jge .L1257
move.l %d2,%d0
subq.l #1,%d0
move.l %d2,%a2
addq.l #5,%a2
- move.l %d0,52(%sp)
- move.l %a2,44(%sp)
- move.l %d4,%d0
-.L1078:
+ move.l %d0,54(%sp)
+ move.l %a2,46(%sp)
+ move.l %a6,%d0
+.L1259:
moveq #127,%d1
cmp.l %d0,%d1
- jcs .L1077
+ jcs .L1258
clr.l -(%sp)
- move.l 48(%sp),-(%sp)
- move.l 60(%sp),-(%sp)
+ move.l 50(%sp),-(%sp)
+ move.l 62(%sp),-(%sp)
move.l %d0,-(%sp)
- move.l %d0,48(%sp)
- move.l %a0,44(%sp)
+ move.l %d0,46(%sp)
+ move.l %a0,42(%sp)
jsr (vfill.part.0)
lea (16,%sp),%sp
- move.l 28(%sp),%a0
- move.l 32(%sp),%d0
-.L1077:
+ move.l 26(%sp),%a0
+ move.l 30(%sp),%d0
+.L1258:
addq.l #1,%d0
cmp.l %a0,%d0
- jne .L1078
-.L1076:
- move.l %a6,-(%sp)
+ jne .L1259
+.L1257:
+ pea 104(%sp)
pea -1.w
move.l #1074505846,-(%sp)
jsr 1073819440
- move.l %a6,-(%sp)
+ pea 116(%sp)
move.l %d2,-(%sp)
move.l %d0,%d1
tst.l %d0
- jlt .L1165
-.L1082:
- move.l %d5,%d0
+ jlt .L1363
+.L1263:
+ move.l 62(%sp),%d0
sub.l %d1,%d0
move.l %d0,%d0
- jpl .L1172
+ jpl .L1370
addq.l #1,%d0
-.L1172:
+.L1370:
asr.l #1,%d0
- move.l %d0,%a0
- pea (%a0,%d4.l)
- move.l 60(%sp),%a1
- jsr (%a1)
+ pea (%a6,%d0.l)
+ move.l 58(%sp),%a2
+ jsr (%a2)
lea (24,%sp),%sp
- tst.l 40(%sp)
- jeq .L1081
+ tst.l 38(%sp)
+ jeq .L1262
moveq #3,%d1
cmp.l %d2,%d1
seq %d0
@@ -8025,46 +9188,51 @@ grain_draw:
subq.l #1,%d1
neg.l %d0
tst.b %d0
- jeq .L1083
+ jeq .L1264
move.w #8,%a0
cmp.l %d1,%a0
- jlt .L1081
-.L1155:
- move.l %d4,%d0
+ jlt .L1262
+.L1352:
+ move.l fbp,%d2
+ move.l %a6,%d0
subq.l #1,%d0
- move.l fbp,%a6
- jra .L1087
-.L1165:
+ move.l %d2,46(%sp)
+ jra .L1268
+.L1363:
clr.l %d1
- jra .L1082
-.L1164:
- lsl.l #3,%d0
- move.l %d5,%d2
- moveq #1,%d4
- move.l %d3,%d5
- addq.l #7,%d0
- move.l %d0,40(%sp)
-.L1086:
- move.l %d1,%d0
- asr.l #3,%d0
- move.l 40(%sp),%a1
- moveq #7,%d3
- and.l %d1,%d3
- addq.l #2,%d1
- sub.l %d0,%a1
- add.l %a6,%a1
- move.b (%a1),47(%sp)
- move.l %d4,%d0
+ jra .L1263
+.L1208:
+ moveq #1,%d0
lsl.l %d3,%d0
- move.b 47(%sp),%d3
- or.l %d3,%d0
- move.b %d0,(%a1)
- cmp.l %d1,%a0
- jge .L1086
- move.l %d5,%d3
- move.l %d2,%d5
- jra .L1081
-.L1161:
+ btst %d3,%d1
+ jeq .L1207
+ not.l %d0
+ and.l %d1,%d0
+ move.l #268526008,%a2
+ moveq #7,%d1
+ add.l %a1,%a2
+ move.l %a2,66(%sp)
+ move.l 74(%sp),%a2
+ move.l %d0,had.12
+ move.l (%a0),%d0
+ add.l #17,%d0
+ mvz.b (%a2,%d0.l),%d0
+ add.l #-119,%d0
+ cmp.l %d0,%d1
+ jcs .L1207
+ st %d4
+ move.l (%a0),%d0
+ move.l 66(%sp),%a0
+ move.b %d4,106(%a1,%d0.l)
+ move.b #-1,(%a0)
+ add.l #635698,%d0
+ move.l %d0,%a1
+ moveq #1,%d0
+ move.l %d0,(%a1)
+ moveq #1,%d0
+ move.l %d0,269452696
+ jra .L1207
+.L1359:
move.l %sp,%d0
add.l #104,%d0
move.l %a6,%d1
@@ -8072,101 +9240,102 @@ grain_draw:
move.l %d0,%a1
add.l #348,%d1
add.l #168,%d2
-.L1044:
+.L1225:
sub.l %a0,%a0
-.L1045:
+.L1226:
lea (%a0,%d1.l),%a2
moveq #4,%d3
move.b (%a2),(%a1,%a0.l)
addq.l #1,%a0
cmp.l %a0,%d3
- jne .L1045
+ jne .L1226
addq.l #8,%d1
addq.l #4,%a1
cmp.l %d2,%a1
- jne .L1044
+ jne .L1225
move.l %a6,%d1
move.l %a6,%a0
add.l #1024,%d1
-.L1047:
+.L1228:
clr.b (%a0)+
cmp.l %d1,%a0
- jne .L1047
+ jne .L1228
move.l %a6,%d1
addq.l #8,%d1
-.L1048:
+.L1229:
move.l %d1,%a0
move.l %d0,%a1
subq.l #4,%a0
-.L1049:
+.L1230:
move.b (%a1)+,(%a0)+
cmp.l %d1,%a0
- jne .L1049
+ jne .L1230
addq.l #4,%d0
addq.l #8,%d1
- cmp.l %d0,%d2
- jne .L1048
- moveq #8,%d5
+ cmp.l %d2,%d0
+ jne .L1229
+ moveq #8,%d3
clr.l %d1
moveq #1,%d2
-.L1050:
- moveq #7,%d3
- sub.l %a0,%a0
- or.l %d1,%d3
+.L1231:
move.l %d1,%d0
asr.l #3,%d0
- subq.l #1,%d5
+ move.w #135,%a0
+ moveq #7,%d4
+ subq.l #1,%d3
+ or.l %d1,%d4
sub.l %d0,%a0
add.l %a6,%a0
- move.b 135(%a0),%d4
- move.l %d3,%d0
+ move.b (%a0),37(%sp)
+ move.l %d4,%d0
sub.l %d1,%d0
move.l %d0,%d1
move.l %d2,%d0
addq.l #1,%d1
lsl.l %d1,%d0
- move.l %d3,%d1
+ move.b 37(%sp),%d5
+ move.l %d4,%d1
addq.l #1,%d1
subq.l #1,%d0
- or.l %d4,%d0
- move.b %d0,135(%a0)
- tst.l %d5
- jne .L1050
- moveq #84,%d4
- clr.b %d6
- move.l 44(%sp),%d0
+ or.l %d5,%d0
+ move.b %d0,(%a0)
+ tst.l %d3
+ jne .L1231
+ moveq #84,%d1
+ clr.b %d2
+ move.l 42(%sp),%d0
add.l #49,%d0
move.b %d0,97(%sp)
- move.b %d4,96(%sp)
- move.b %d6,98(%sp)
- move.l %sp,%d4
- add.l #96,%d4
- move.l %d4,-(%sp)
+ move.b %d1,96(%sp)
+ move.b %d2,98(%sp)
+ pea 96(%sp)
pea -1.w
move.l #1074505846,-(%sp)
jsr 1073819440
- move.l %d4,-(%sp)
+ pea 108(%sp)
pea 56.w
move.l %d0,%d1
tst.l %d0
- jlt .L1166
+ jlt .L1364
moveq #16,%d0
sub.l %d1,%d0
move.l %d0,%d0
- jpl .L1173
+ jpl .L1371
addq.l #1,%d0
-.L1173:
- lea os_text,%a0
- move.l %a0,56(%sp)
+.L1371:
+ move.l #os_text,%d4
+ move.l %d4,54(%sp)
+ move.l %d4,%a0
asr.l #1,%d0
move.l %d0,-(%sp)
jsr (%a0)
move.w #7,%a1
move.l fbp,%a6
lea (24,%sp),%sp
-.L1052:
+ move.l %d3,38(%sp)
+.L1233:
moveq #54,%d0
-.L1053:
+.L1234:
moveq #7,%d3
and.l %d0,%d3
move.l %d0,%d1
@@ -8182,73 +9351,74 @@ grain_draw:
move.b %d1,(%a0)
moveq #63,%d1
cmp.l %d0,%d1
- jne .L1053
+ jne .L1234
addq.l #8,%a1
cmp.l #135,%a1
- jne .L1052
- lea (names.5),%a0
- move.l %a0,80(%sp)
-.L1069:
- move.l %d5,%d0
+ jne .L1233
+ move.l 38(%sp),%d3
+ lea (names.8),%a0
+ move.l %a0,74(%sp)
+.L1250:
+ move.l %d3,%d0
moveq #3,%d1
remu.l %d1,%d2:%d0
- moveq #2,%d6
- move.w %d2,%d3
- move.l %d2,52(%sp)
- muls.w #36,%d3
- move.l %d3,40(%sp)
- cmp.l %d5,%d6
- jcs .L1097
- move.l 88(%sp),%d2
- move.l %d5,-(%sp)
- move.l 60(%sp),-(%sp)
- move.l 56(%sp),-(%sp)
- move.l %d4,-(%sp)
+ moveq #2,%d5
+ move.w %d2,%d4
+ move.l %d2,46(%sp)
+ muls.w #36,%d4
+ move.l %d4,38(%sp)
+ cmp.l %d3,%d5
+ jcs .L1279
+ move.l 90(%sp),%d2
+ move.l %d3,-(%sp)
+ move.l 66(%sp),-(%sp)
+ move.l 58(%sp),-(%sp)
+ pea 108(%sp)
jsr knob_value
- move.l %d4,-(%sp)
+ pea 112(%sp)
pea -1.w
move.l #1074505846,-(%sp)
jsr 1073819440
- move.l 108(%sp),%a0
- addq.l #4,108(%sp)
- move.l %d0,%d3
+ move.l 102(%sp),%a0
+ addq.l #4,102(%sp)
+ move.l %d0,%a6
move.l (%a0)+,-(%sp)
move.l %d2,-(%sp)
- move.l 76(%sp),%a1
+ move.l 74(%sp),%a1
pea 20(%a1)
- move.l 76(%sp),%a2
+ move.l 74(%sp),%a2
jsr (%a2)
- lea (36,%sp),%sp
- move.l %d4,(%sp)
+ lea (40,%sp),%sp
+ pea 96(%sp)
move.l %d2,-(%sp)
- move.l 48(%sp),%d1
- move.l %d3,%d0
+ move.l 46(%sp),%d1
+ move.l %a6,%d0
add.l #52,%d1
- tst.l %d3
- jlt .L1167
-.L1056:
+ tst.l %a6
+ jlt .L1365
+.L1237:
sub.l %d0,%d1
move.l %d1,-(%sp)
- move.l 48(%sp),%a0
+ move.l 46(%sp),%a0
jsr (%a0)
lea (12,%sp),%sp
- cmp.l 60(%sp),%d5
- jeq .L1168
-.L1057:
- tst.l 52(%sp)
- jne .L1169
-.L1065:
- addq.l #1,%d5
- moveq #6,%d0
- cmp.l %d5,%d0
- jne .L1069
+ cmp.l 58(%sp),%d3
+ jeq .L1366
+.L1238:
+ tst.l 46(%sp)
+ jne .L1367
+.L1246:
+ addq.l #1,%d3
+ moveq #6,%d5
+ cmp.l %d3,%d5
+ jne .L1250
move.l fbp,%d0
move.l %d0,%a0
move.l %d0,%a1
add.l #1032,%d0
lea (152,%a0),%a0
lea (159,%a1),%a1
-.L1070:
+.L1251:
move.b (%a1),%d1
moveq #-128,%d2
moveq #1,%d3
@@ -8260,122 +9430,156 @@ grain_draw:
or.l %d3,%d1
move.b %d1,-16(%a0)
cmp.l %a0,%d0
- jne .L1070
+ jne .L1251
pea 54.w
pea 9.w
pea 127.w
pea 19.w
- move.l 72(%sp),-(%sp)
- move.l 68(%sp),-(%sp)
+ move.l 78(%sp),-(%sp)
+ move.l 70(%sp),-(%sp)
jsr wave_area
lea (24,%sp),%sp
- movem.l (%sp),#17532
+ movem.l (%sp),#17468
lea (168,%sp),%sp
rts
-.L1083:
+.L1348:
+ move.b show_t,%d0
+ moveq #1,%d1
+ move.l 50(%sp),%a1
+ lea known.11,%a0
+ mvz.b %d0,%d0
+ move.b %d1,(%a0,%a1.l)
+ cmp.l %a1,%d0
+ jne .L1221
+ jra .L1220
+.L1277:
+ moveq #15,%d0
+ jra .L1198
+.L1197:
+ move.w #-1,%a0
+ jra .L1201
+.L1264:
move.w #56,%a0
cmp.l %d1,%a0
- jge .L1155
- jra .L1081
-.L1097:
- move.l %d5,-(%sp)
+ jge .L1352
+ jra .L1262
+.L1364:
+ clr.l %d1
+ moveq #16,%d0
+ sub.l %d1,%d0
+ move.l %d0,%d0
+ jpl .L1372
+ addq.l #1,%d0
+.L1372:
+ move.l #os_text,%d4
+ move.l %d4,54(%sp)
+ move.l %d4,%a0
+ asr.l #1,%d0
+ move.l %d0,-(%sp)
+ jsr (%a0)
+ lea (24,%sp),%sp
+ move.w #7,%a1
+ move.l %d3,38(%sp)
+ move.l fbp,%a6
+ jra .L1233
+.L1279:
+ move.l %d3,-(%sp)
moveq #58,%d2
- move.l 60(%sp),-(%sp)
- move.l 56(%sp),-(%sp)
- move.l %d4,-(%sp)
+ move.l 66(%sp),-(%sp)
+ move.l 58(%sp),-(%sp)
+ pea 108(%sp)
jsr knob_value
- move.l %d4,-(%sp)
+ pea 112(%sp)
pea -1.w
move.l #1074505846,-(%sp)
jsr 1073819440
- move.l 108(%sp),%a0
- addq.l #4,108(%sp)
- move.l %d0,%d3
+ move.l 102(%sp),%a0
+ addq.l #4,102(%sp)
+ move.l %d0,%a6
move.l (%a0)+,-(%sp)
move.l %d2,-(%sp)
- move.l 76(%sp),%a1
+ move.l 74(%sp),%a1
pea 20(%a1)
- move.l 76(%sp),%a2
+ move.l 74(%sp),%a2
jsr (%a2)
- lea (36,%sp),%sp
- move.l %d4,(%sp)
+ lea (40,%sp),%sp
+ pea 96(%sp)
move.l %d2,-(%sp)
- move.l 48(%sp),%d1
- move.l %d3,%d0
+ move.l 46(%sp),%d1
+ move.l %a6,%d0
add.l #52,%d1
- tst.l %d3
- jge .L1056
- jra .L1167
-.L1169:
- moveq #1,%d3
- cmp.l %d2,%d3
+ tst.l %a6
+ jge .L1237
+ jra .L1365
+.L1367:
+ moveq #1,%d4
+ cmp.l %d2,%d4
seq %d0
subq.l #1,%d2
neg.l %d0
tst.b %d0
- jeq .L1066
+ jeq .L1247
moveq #6,%d1
-.L1067:
- cmp.l %d2,%d1
- jlt .L1065
- move.l 40(%sp),%d0
- move.l fbp,%a1
+.L1248:
+ cmp.l %d1,%d2
+ jgt .L1246
+ move.l 38(%sp),%d0
+ move.l %d3,%a1
+ move.l fbp,%a6
lsl.l #3,%d0
add.l #151,%d0
- move.l %d0,%a6
- move.l %d5,%d0
- move.l %d1,%d5
-.L1068:
- move.l %d2,%d3
- asr.l #3,%d3
- move.l %a6,%a0
- moveq #7,%d1
- and.l %d2,%d1
+ move.l %d0,%d3
+.L1249:
+ move.l %d2,%d0
+ asr.l #3,%d0
+ move.l %d3,%a0
+ moveq #7,%d5
+ and.l %d2,%d5
addq.l #2,%d2
- sub.l %d3,%a0
- add.l %a1,%a0
- move.b (%a0),43(%sp)
- moveq #1,%d3
- lsl.l %d1,%d3
- move.b 43(%sp),%d6
- or.l %d6,%d3
- move.b %d3,(%a0)
- cmp.l %d2,%d5
- jge .L1068
- move.l %d0,%d5
- jra .L1065
-.L1168:
+ sub.l %d0,%a0
+ add.l %a6,%a0
+ move.b (%a0),45(%sp)
+ moveq #1,%d0
+ lsl.l %d5,%d0
+ move.b 45(%sp),%d4
+ or.l %d4,%d0
+ move.b %d0,(%a0)
+ cmp.l %d1,%d2
+ jle .L1249
+ move.l %a1,%d3
+ jra .L1246
+.L1366:
moveq #1,%d1
cmp.l %d2,%d1
seq %d0
move.l %d2,%a1
subq.l #1,%a1
- move.l %a1,76(%sp)
- move.l %d0,%d3
- neg.l %d3
- move.b %d3,75(%sp)
- jeq .L1058
- move.w 54(%sp),%d0
+ move.l %a1,54(%sp)
+ move.l %d0,%d4
+ neg.l %d4
+ move.b %d4,73(%sp)
+ jeq .L1239
+ move.w 48(%sp),%d0
move.l fbp,%d1
- moveq #6,%d6
- move.l %d5,84(%sp)
- move.l %d6,64(%sp)
- move.l %d1,44(%sp)
- move.l %d2,%d5
+ moveq #6,%d5
+ move.l %d5,78(%sp)
+ move.l %d2,82(%sp)
+ move.l %d1,42(%sp)
+ move.l %d3,86(%sp)
mulu.w #288,%d0
move.l %d0,%a1
add.l #439,%d0
lea (159,%a1),%a1
- move.l %d0,68(%sp)
-.L1064:
- move.l 64(%sp),%d2
- cmp.l 76(%sp),%d2
- jlt .L1060
- tst.b 75(%sp)
- jeq .L1061
+ move.l %d0,66(%sp)
+.L1245:
+ move.l 78(%sp),%d2
+ cmp.l 54(%sp),%d2
+ jlt .L1241
+ tst.b 73(%sp)
+ jeq .L1242
move.w #7,%a6
- move.l 76(%sp),%d0
-.L1063:
+ move.l 54(%sp),%d0
+.L1244:
moveq #7,%d3
and.l %d0,%d3
move.l %d0,%d1
@@ -8383,71 +9587,54 @@ grain_draw:
move.l %a1,%a0
addq.l #1,%d0
sub.l %d1,%a0
- add.l 44(%sp),%a0
+ add.l 42(%sp),%a0
moveq #1,%d1
move.b (%a0),%d2
lsl.l %d3,%d1
eor.l %d2,%d1
move.b %d1,(%a0)
cmp.l %d0,%a6
- jne .L1063
-.L1060:
+ jne .L1244
+.L1241:
addq.l #8,%a1
- cmp.l 68(%sp),%a1
- jne .L1064
- move.l %d5,%d2
- move.l 84(%sp),%d5
- tst.l 52(%sp)
- jeq .L1065
- jra .L1169
-.L1167:
+ cmp.l 66(%sp),%a1
+ jne .L1245
+ move.l 82(%sp),%d2
+ move.l 86(%sp),%d3
+ tst.l 46(%sp)
+ jeq .L1246
+ jra .L1367
+.L1247:
+ moveq #63,%d1
+ jra .L1248
+.L1365:
clr.l %d0
sub.l %d0,%d1
move.l %d1,-(%sp)
- move.l 48(%sp),%a0
+ move.l 46(%sp),%a0
jsr (%a0)
lea (12,%sp),%sp
- cmp.l 60(%sp),%d5
- jne .L1057
- jra .L1168
-.L1061:
+ cmp.l 58(%sp),%d3
+ jne .L1238
+ jra .L1366
+.L1242:
move.w #64,%a6
- move.l 76(%sp),%d0
- jra .L1063
-.L1058:
+ move.l 54(%sp),%d0
+ jra .L1244
+.L1239:
moveq #63,%d0
- move.l %d0,64(%sp)
- move.w 54(%sp),%d0
+ move.l %d0,78(%sp)
+ move.w 48(%sp),%d0
move.l fbp,%d1
- move.l %d5,84(%sp)
- move.l %d2,%d5
- move.l %d1,44(%sp)
+ move.l %d2,82(%sp)
+ move.l %d3,86(%sp)
+ move.l %d1,42(%sp)
mulu.w #288,%d0
move.l %d0,%a1
add.l #439,%d0
lea (159,%a1),%a1
- move.l %d0,68(%sp)
- jra .L1064
-.L1166:
- clr.l %d1
- moveq #16,%d0
- sub.l %d1,%d0
- move.l %d0,%d0
- jpl .L1174
- addq.l #1,%d0
-.L1174:
- lea os_text,%a0
- move.l %a0,56(%sp)
- asr.l #1,%d0
- move.l %d0,-(%sp)
- jsr (%a0)
- move.w #7,%a1
- move.l fbp,%a6
- lea (24,%sp),%sp
- jra .L1052
-.L1066:
- moveq #63,%d1
- jra .L1067
+ move.l %d0,66(%sp)
+ jra .L1245
.size grain_draw, .-grain_draw
.section .rodata
.align 2
@@ -8460,45 +9647,60 @@ step.0:
.word 0
.local last.1
.comm last.1,4,2
- .local env_at.4
- .comm env_at.4,32,2
+ .local moved.2
+ .comm moved.2,4,2
+ .local done.3
+ .comm done.3,4,2
+ .local burst_at.4
+ .comm burst_at.4,4,2
+ .local env_at.7
+ .comm env_at.7,32,2
.section .rodata.str1.1
-.LC8:
+.LC12:
.string "PTCH"
-.LC9:
+.LC13:
.string "POS"
-.LC10:
+.LC14:
.string "SIZE"
-.LC11:
+.LC15:
.string "DENS"
-.LC12:
+.LC16:
.string "SPRY"
-.LC13:
+.LC17:
.string "SCAN"
.section .rodata
.align 2
- .type names.5, @object
- .size names.5, 24
-names.5:
- .long .LC8
- .long .LC9
- .long .LC10
- .long .LC11
+ .type names.8, @object
+ .size names.8, 24
+names.8:
.long .LC12
.long .LC13
- .set names.6,names.5
- .local last_fine.7
- .comm last_fine.7,8,1
- .local known.8
- .comm known.8,8,1
- .local was_setup.9
- .comm was_setup.9,1,1
- .local src_was.10
- .comm src_was.10,1,1
+ .long .LC14
+ .long .LC15
+ .long .LC16
+ .long .LC17
+ .set names.9,names.8
+ .local last_fine.10
+ .comm last_fine.10,8,1
+ .local known.11
+ .comm known.11,8,1
+ .local had.12
+ .comm had.12,4,2
+ .data
+ .align 2
+ .type last_step.13, @object
+ .size last_step.13, 4
+last_step.13:
+ .long -1
+ .local was_setup.14
+ .comm was_setup.14,1,1
+ .local src_was.15
+ .comm src_was.15,1,1
+ .section .rodata
.align 2
- .type fraction.11, @object
- .size fraction.11, 512
-fraction.11:
+ .type fraction.16, @object
+ .size fraction.16, 512
+fraction.16:
.long 2050506731
.long 2074332471
.long 2098435054
@@ -8638,7 +9840,7 @@ grain_machine_start:
.long grain_start
.globl grain_machine
.section .rodata.str1.1
-.LC14:
+.LC18:
.string "GRAIN"
.section .rodata
.align 2
@@ -8649,7 +9851,7 @@ grain_machine:
.ascii "GR"
.byte 1
.byte 1
- .long .LC14
+ .long .LC18
.long 851
.zero 4
.long defaults
@@ -8680,6 +9882,12 @@ show_k:
.byte -1
.local last_val
.comm last_val,48,1
+ .section .rodata
+ .type quiet, @object
+ .size quiet, 61
+quiet:
+ .base64 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAECBAUHCQsMDhASFBYYGhweICIkJikrLS8yNDc5Ow=="
+ .data
.align 2
.type env_slot, @object
.size env_slot, 32
@@ -8817,11 +10025,11 @@ knobs:
.long mode_text
.byte 10
.byte 0
- .byte 1
- .string ""
- .zero 5
+ .byte 4
+ .string "EDGE"
.zero 1
- .long blank_text
+ .zero 1
+ .long edge_text
.byte 11
.byte 0
.byte 1
@@ -8829,6 +10037,12 @@ knobs:
.zero 5
.zero 1
.long blank_text
+ .globl grain_skip
+ .section .bss
+ .type grain_skip, @object
+ .size grain_skip, 8
+grain_skip:
+ .zero 8
.local prepared
.comm prepared,256,4
.data
@@ -8865,9 +10079,9 @@ frames_per_page:
.data
.align 2
.type eng, @object
- .size eng, 2008
+ .size eng, 2024
eng:
- .zero 2000
+ .zero 2016
.long 625341585
.zero 4
.section .rodata
diff --git a/sdk/octatrack/modules/grain/grain_machine.c b/sdk/octatrack/modules/grain/grain_machine.c
index 049bb64e0c..5aff1b5851 100644
--- a/sdk/octatrack/modules/grain/grain_machine.c
+++ b/sdk/octatrack/modules/grain/grain_machine.c
@@ -246,6 +246,32 @@ static void plain_view(uintptr_t fp, View *v)
U16(fp + 28u) = U8(FLEX_DEFAULTS + 11u); /* TSTR OFF (byte 28), TSNS from the factory values */
}
#define BANK 0x46c82456u
+/* Los octavos de un p-lock de POS: en la casilla 17 del paso (la del XVOL, que stock no deja bloquear ni valida), como
+ * 119 + octavo (119..126). 127 es el XVOL de fabrica y 0xff, sin bloqueo. Stock la aplica a la via (+17) en su paso y
+ * vuelve a 127 en el siguiente sin bloqueo. El crossfader y la Part no cambian. */
+#define FINE_LOCK 17u
+#define FINE_BASE 119u
+#define LIVE_LANE(t) (0x80000810u + (t) * 72u)
+#define CS1_PATTERNS 0x1001614eu
+static int fine_of(unsigned v) { return v >= FINE_BASE && v < FINE_BASE + 8u ? (int)(v - FINE_BASE) : -1; }
+/* El desplazamiento, dentro del banco, de los 32 octetos del paso s de la pista t en el patron que se edita */
+static uint32_t lock_at(unsigned t, unsigned s)
+{
+ return (U8(0x100b14d0u) & 15u) * 0x8ed8u + t * 0x91au + 0x59u + (s & 63u) * 32u;
+}
+static void lock_put(unsigned at, uint8_t v)
+{
+ uintptr_t b = U32(BANK);
+ U8(b + at) = v;
+ U8(CS1_PATTERNS + at) = v; /* la copia con pila, como el editor de locks de stock */
+ U32(b + 0x9b332u) = 1; U32(0x100f8598u) = 1;
+}
+static uint32_t first_step(void)
+{
+ uint32_t first = U32(0x460d174cu);
+ if (first > 48u) first = U16(0x460d174cu);
+ return first;
+}
static int bank_ok(void);
static volatile uint8_t *part_at(unsigned i);
/* Lo que GRAIN guarda en la Part pasa por si solo la comprobacion de stock (regla de Modwerk, docs/ADD_A_MODULE.md):
@@ -318,7 +344,9 @@ static Prepared *prepare_frame(unsigned track, const View *v, const GranSample *
const volatile uint8_t *row = (const volatile uint8_t *)(bank + 0x8ed80u +
(U8(0x80000003u) & 3u) * 6322u + track * 30u);
unsigned fine = v->setup[5] & 7u;
- if (fine && !(pos & 255u) && (pos >> 8) == row[0x31u]) pos += fine << 5;
+ int locked = fine_of(U8(LIVE_LANE(track) + FINE_LOCK));
+ if (locked >= 0) { if (!(pos & 255u)) pos += (unsigned)locked << 5; }
+ else if (fine && !(pos & 255u) && (pos >> 8) == row[0x31u]) pos += fine << 5;
dir = row[NB_DIR(0)] & 127u;
pan = row[NB_PAN(0)] & 127u;
}
@@ -330,6 +358,8 @@ static Prepared *prepare_frame(unsigned track, const View *v, const GranSample *
live_at[track] = live_tick;
p->dir = dir;
p->pan = pan;
+ /* EDGE: SETUP E (TSTR, 0..3 pasa la comprobacion de stock). Fuera de 0..3 (una Part antigua) vale CLMP. */
+ gran_set_edge(&eng, track, v->setup[4]);
unsigned sync = v->setup[3];
uint32_t tempo = sync ? U32(TEMPO24) : 0u;
if (sample && c->count == sample->count && c->tempo24 == tempo &&
@@ -380,6 +410,17 @@ int grain_start(unsigned track, unsigned sample, unsigned flags)
return result;
}
+/* La copia del PCM del lector FLEX (0x400041c4: jsr 0x40007960 y su limpieza de pila, 8 octetos). Grain la sobrescribe entera,
+ * asi que durante su propio render FLEX no se hace: el resto del lector (posicion, bucle, cabecera del paquete) corre igual.
+ * Argumentos en la pila: destino, ping, pista, fuentes, frames, bandera. El mismo punto que envuelve POLY8 (Jannik, MIT):
+ * los dos modulos no pueden instalarse juntos mientras la base no tenga un evento para el. */
+volatile uint8_t grain_skip[8];
+__asm__(".text\n\t.even\n\t.globl grain_copy\ngrain_copy:\n\t"
+ "move.l 8(%sp),%d0\n\tmoveq #7,%d1\n\tcmp.l %d1,%d0\n\tbhi.s 1f\n\t"
+ "lea grain_skip,%a0\n\ttst.b (0,%a0,%d0.l)\n\tbne.s 2f\n"
+ "1:\tjsr 0x40007960\n"
+ "2:\tlea 24(%sp),%sp\n\tjmp 0x400041cc\n");
+
/* La interrupcion de frame, dos veces por frame por pista nuestra: hasta 16 frames de salida por llamada. */
int grain_render(unsigned track, unsigned ping, unsigned start, unsigned end)
{
@@ -394,7 +435,10 @@ int grain_render(unsigned track, unsigned ping, unsigned start, unsigned end)
return plain;
}
view_open(fp, &v);
+ unsigned filled = 0;
+ grain_skip[track & 7u] = 1;
int result = FLEX_RENDER(track, ping, start, end);
+ grain_skip[track & 7u] = 0;
if (U8(voice)) {
int32_t *pcm = 0;
unsigned sources = packet(fp, before, &pcm);
@@ -405,8 +449,14 @@ int grain_render(unsigned track, unsigned ping, unsigned start, unsigned end)
gran_render(&eng, track, &c->params, sample, c->whole, c->frac, pcm, sources);
} else
for (unsigned i = 0; i < 2u * sources; ++i) pcm[i] = 0; /* sample ilegible: silencio */
+ filled = 1;
}
}
+ if (!filled) { /* nadie ha escrito el PCM (voz recien terminada, paquete raro): silencio, nunca restos del buffer */
+ uint32_t made = U32(CURSOR) - before, n = made >= 16u ? U32(before) & 255u : 0u;
+ if (made >= 16u + 8u * n && made <= 336u)
+ for (unsigned i = 0; i < 2u * n; ++i) ((int32_t *)(before + 16u))[i] = 0;
+ }
view_close(fp, &v);
return result;
}
@@ -422,6 +472,7 @@ static void number(char *out, unsigned n)
static void word(char *out, const char *text) { while ((*out++ = *text++)) {} }
static void shape_text(char *out, int v) { word(out, v <= 0 ? "NORM" : v == 1 ? "TRI" : v == 2 ? "PERC" : "SQR"); }
static void mode_text(char *out, int v) { word(out, v <= 0 ? "RAND" : "SYNC"); }
+static void edge_text(char *out, int v) { word(out, v <= 0 ? "CLMP" : v == 1 ? "WRAP" : v == 2 ? "STOP" : "BNCE"); }
static void pan_text(char *out, int v) { if (v <= 0) word(out, "OFF"); else number(out, (unsigned)v); }
/* SCAN: valor del mando - 64, en 1/32: "-2.00" .. "+2.00" (1.00 = la velocidad del sample, 2.00 = el doble). Con 0..127 el
* ultimo paso quedaba en 63/32 = 1.96; el tope (127) vale ahora +2.00 exacto y el resto no cambia. */
@@ -446,7 +497,7 @@ static const struct { uint8_t slot, start, count; char name[6]; void (*text)(cha
{1, 0, 128, "POS", 0}, {2, 64, 128, "SIZE", 0}, {3, 64, 128, "DENS", 0}, {4, 0, 128, "SPRY", 0},
{5, 64, 128, "SCAN", scan_text},
{6, 0, 4, "SHAP", shape_text}, {7, 0, 128, "DIR", 0}, {8, 0, 128, "PAN", pan_text}, {9, 0, 2, "MODE", mode_text},
- {10, 0, 1, "", blank_text}, {11, 0, 1, "", blank_text}};
+ {10, 0, 4, "EDGE", edge_text}, {11, 0, 1, "", blank_text}};
static uint8_t defaults[12];
static uint8_t page[MODWERK_PAGE_BYTES] __attribute__((aligned(4)));
static uint32_t page_built;
@@ -466,18 +517,17 @@ static uint32_t grain_page(const volatile uint8_t *slot)
* Part lo que devuelve (ev_knob_store, 0x40055170; octabam lo usa para el cuantizador de PTCH). La parte entera es el
* octeto de POS de siempre; los octavos (0..7) van en SETUP F (Part + 0x1e0 + 30 t + 5), oculto, cuyo rango de FLEX
* (TSNS, 0..127) pasa el validador de stock. Despacio (un detent) avanza un octavo; deprisa, numeros enteros.
- * Girando con un trig pulsado (p-lock) no pasa por aqui: el p-lock es entero. */
+ * Girando con un trig pulsado o grabando en vivo (p-lock) tambien pasa por aqui, y lo que devuelve es el bloqueo: ahi un
+ * detent es una unidad entera y no se toca la Part (0.2.0 y anteriores escribian los octavos en la Part y el bloqueo solo
+ * avanzaba cada 8 detents lentos). */
+#define HELD_TRIGS U16(0x460d174au) /* un bit por trig pulsado en grabacion de rejilla (octabam STEP_LOCKS.md) */
+#define LIVE_REC U32(0x460d172au) /* distinto de 0 grabando en vivo */
static int bank_ok(void);
static volatile uint8_t *part_at(unsigned i);
static int ours(const volatile uint8_t *p, unsigned t);
-static int pos_step(int slot, int detents, int value)
+/* e octavos mas un giro: el paso de siempre de POS (calibrado), para la Part y para el p-lock */
+static int turn_eighths(int slot, int detents, int e)
{
- unsigned t = U8(0x100b14ccu) & 7u, pi = U8(0x100b14cfu) & 3u;
- volatile uint8_t *part = part_at(pi);
- /* POS (slot 1): octavos en SETUP F (indice 5); SIZE (slot 2): en SETUP E (indice 4), tambien oculto (author, 19/11) */
- if (slot != 1 || !bank_ok() || !ours(part, t)) return value + detents;
- unsigned ix = slot == 1 ? 5u : 4u, at = 0x1e0u + 30u * t + ix;
- int e = value * 8 + (part[at] & 7);
/* con el mando pulsado, como el paso de serie (0x4003240c): cada detent vale 7 numeros enteros; el estado de la tecla
* del mando (0x38 + slot) esta en 0x46c7d8ee + 24 * (slot + 56) */
if (U32(0x46c7d8eeu + 24u * (unsigned)(slot + 56))) e += detents * 7 * 8;
@@ -497,6 +547,49 @@ static int pos_step(int slot, int detents, int value)
}
if (e < 0) e = 0;
if (e > 127 * 8 + 7) e = 127 * 8 + 7;
+ return e;
+}
+static int pos_step(int slot, int detents, int value)
+{
+ unsigned t = U8(0x100b14ccu) & 7u, pi = U8(0x100b14cfu) & 3u;
+ volatile uint8_t *part = part_at(pi);
+ /* POS (slot 1): octavos en SETUP F (indice 5); SIZE (slot 2): en SETUP E (indice 4), tambien oculto (author, 19/11) */
+ if (slot != 1 || !bank_ok() || !ours(part, t)) return value + detents;
+ if (HELD_TRIGS && !LIVE_REC && first_step() <= 48u) {
+ /* p-lock en rejilla: los mismos pasos que sin trig; el entero lo guarda stock y el octavo, la casilla 17.
+ * Stock llama una vez por cada paso pulsado, seguidas y con el valor de ese paso: aqui se reconoce el paso y las
+ * llamadas de un mismo giro (menos de 3 ms) se mueven lo mismo, sin contar como giro rapido. */
+ static uint32_t burst_at;
+ static unsigned done;
+ static int moved;
+ unsigned mask = HELD_TRIGS;
+ uint32_t now = U32(0xfc07c00cu), first = first_step();
+ if (now - burst_at > 3u * 132000u || !(mask & ~done)) done = 0;
+ burst_at = now;
+ int pick = -1;
+ for (int k = 15; k >= 0; --k) {
+ if (!((mask & ~done) >> k & 1u)) continue;
+ uint8_t v = U8(U32(BANK) + lock_at(t, first + (unsigned)k) + 1u);
+ if ((v == 0xffu ? part[0x30u + 30u * t + 1u] : v) == value) pick = k;
+ }
+ for (int k = 15; pick < 0 && k >= 0; --k) if ((mask & ~done) >> k & 1u) pick = k;
+ if (pick < 0) return value;
+ uint32_t at = lock_at(t, first + (unsigned)pick);
+ int f = fine_of(U8(U32(BANK) + at + FINE_LOCK));
+ if (f < 0) f = U8(U32(BANK) + at + 1u) == 0xffu ? part[0x1e0u + 30u * t + 5u] & 7 : 0;
+ int e = value * 8 + f;
+ if (!done) { int to = turn_eighths(slot, detents, e); moved = to - e; e = to; }
+ else { e += moved; e = e < 0 ? 0 : e > 127 * 8 + 7 ? 127 * 8 + 7 : e; }
+ done |= 1u << pick;
+ lock_put(at + FINE_LOCK, (uint8_t)(FINE_BASE + (e & 7)));
+ return e >> 3;
+ }
+ if (HELD_TRIGS || LIVE_REC) { /* grabando en vivo: un entero por detent (7 con el mando pulsado) */
+ int v = value + detents * (U32(0x46c7d8eeu + 24u * (unsigned)(slot + 56)) ? 7 : 1);
+ return v < 0 ? 0 : v > 127 ? 127 : v;
+ }
+ unsigned ix = slot == 1 ? 5u : 4u, at = 0x1e0u + 30u * t + ix;
+ int e = turn_eighths(slot, detents, value * 8 + (part[at] & 7));
uint8_t fine = (uint8_t)(e & 7);
part[at] = fine;
U8(0x100a4eceu + pi * 6322u + at) = fine; /* la copia de la Part en SRAM, como put12 */
@@ -560,7 +653,7 @@ static uint32_t grain_page_any(void)
modwerk_page_control(page, knobs[k].slot, knobs[k].name, knobs[k].start, knobs[k].count, knobs[k].text);
/* SETUP E y F vacios: su cifra en la palabra de dibujo de p8..p11 (P+0x18a, p8 en el nibble bajo) a 0, como las
* casillas «---» de THRU/NEIGHBOR (octabam docs/firmware/PARAM_PAGES.md; FLEX = 0x00001751: LEN 1 RATE 5 TSTR 7 TSNS 1) */
- page[0x38 + 0x18a + 2] = 0;
+ page[0x38 + 0x18a + 2] = 0x05; /* EDGE (p10) como MODE (p9, la cifra 5: un texto a elegir); p11 sigue vacio */
/* sin el lacito de las escenas (bit 2 de la cifra de dibujo: une el mando con el de su izquierda; en FLEX, STRT/LEN y
* RTRG/RTIM). P+0x18e = 0x55311311 (p0 en el nibble bajo): p2 (SIZE) y p5 (SCAN) pasan de 3 a 1 (author, 19/11) */
page[0x38 + 0x18e + 1] = 0x11; page[0x38 + 0x18e + 2] = 0x11;
@@ -760,6 +853,14 @@ static unsigned slen(const char *s) { unsigned n = 0; while (s[n]) ++n; return n
/* la forma de la onda del sample (pico por columna), calculada una vez por sample */
static uint8_t env_l[8][COLS], env_r[8][COLS];
static uint32_t env_slot[8] = { 0xffffffffu, 0xffffffffu, 0xffffffffu, 0xffffffffu, 0xffffffffu, 0xffffffffu, 0xffffffffu, 0xffffffffu };
+/* Quiet parts draw thin: below -25 dB of the peak a line, from -13 dB up as before, a ramp between. The index is the
+ * square-root height (0..60). */
+static const uint8_t quiet[61] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+ 2, 4, 5, 7, 9, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30,
+ 32, 34, 36, 38, 41, 43, 45, 47, 50, 52, 55, 57, 59
+};
static void envelope(unsigned t)
{
GranSample *s = &dsmp[t];
@@ -798,7 +899,7 @@ static void envelope(unsigned t)
uint8_t *e = ch ? &env_r[t][c] : &env_l[t][c];
unsigned q = (unsigned)*e * 16129u / peak, r = 0; /* 127^2 * v / pico; su raiz entera */
while ((r + 1u) * (r + 1u) <= q) ++r;
- *e = (uint8_t)r;
+ *e = (uint8_t)(r <= 60u ? quiet[r] : r);
}
}
@@ -845,13 +946,48 @@ static unsigned part_pos(volatile uint8_t *part, unsigned t)
unsigned w = ((unsigned)part[0x30u + 30u * t + 1] << 8) + 32u * (part[0x1e0u + 30u * t + 5u] & 7u);
return w > 0x7fffu ? 0x7fffu : w;
}
-/* SIZE de la Part con sus octavos (SETUP E), en 1/256 */
+/* SIZE de la Part, en 1/256 (SETUP E guarda EDGE, no octavos de SIZE) */
static unsigned part_size(volatile uint8_t *part, unsigned t)
{
- unsigned w = ((unsigned)part[0x30u + 30u * t + 2] << 8) + 32u * (part[0x1e0u + 30u * t + 4u] & 7u);
+ unsigned w = (unsigned)part[0x30u + 30u * t + 2] << 8;
return w > 0x7fffu ? 0x7fffu : w;
}
+/* El paso del trig pulsado en grabacion de rejilla (el mas alto si hay varios), o -1. 0x460d174c: el primer paso de la
+ * pagina de pasos a la vista. */
+static int held_step(void)
+{
+ unsigned mask = HELD_TRIGS, bit = 15;
+ if (!mask) return -1;
+ while (!(mask >> bit & 1u)) --bit;
+ uint32_t first = U32(0x460d174cu);
+ if (first > 48u) first = U16(0x460d174cu);
+ return first > 48u ? -1 : (int)(first + bit);
+}
+/* El valor que ensena la pantalla para el mando k (0..5, pagina PLAYBACK): con un trig pulsado, su p-lock si lo tiene
+ * (patron + t * 0x91a + 0x59 + paso * 32 + k; 0xff = sin bloqueo); si no, el de la Part. */
+static uint8_t shown_value(unsigned t, volatile uint8_t *part, unsigned k)
+{
+ int step = held_step();
+ if (step >= 0 && bank_ok()) {
+ uint8_t v = U8(U32(BANK) + (U8(0x80000004u) & 15u) * 0x8ed8u + t * 0x91au + 0x59u + (unsigned)step * 32u + k);
+ if (v != 0xffu) return v;
+ }
+ return part[0x30u + 30u * t + k];
+}
+/* The POS shown, in 1/256: with a trig held its lock (or the Part), else the Part. */
+static unsigned shown_pos(unsigned t, volatile uint8_t *part)
+{
+ if (held_step() >= 0) {
+ uint8_t v = shown_value(t, part, 1);
+ int step = held_step(), f = bank_ok() ? fine_of(U8(U32(BANK) + lock_at(t, (unsigned)step) + FINE_LOCK)) : -1;
+ unsigned w = f >= 0 ? ((unsigned)v << 8) + 32u * (unsigned)f :
+ v == part[0x30u + 30u * t + 1] ? part_pos(part, t) : (unsigned)v << 8;
+ return w > 0x7fffu ? 0x7fffu : w;
+ }
+ return part_pos(part, t); /* the line stays on the knob, as on the Tonverk: an LFO moves only the grains */
+}
+
/* La onda del sample de la pista con la linea de POS y los granos vivos, en las columnas x0..x1 y las filas top..bot:
* la misma en la pagina SRC y en la pantalla completa. Azul sobre blanco, una centrada (mono) o L arriba y R abajo
* (estereo). */
@@ -879,8 +1015,8 @@ static void wave_area(unsigned t, volatile uint8_t *part, int x0, int x1, int to
if (st) vfill(x, mr - hr, mr + hr, 1);
}
/* POS: linea de puntos y triangulito, FIJA donde esta POS; con SCAN son los granos los que corren (author, 18/11).
- * POS de lo que suena (con escenas y LFOs) mientras suena; si no, el de la Part; misma cuenta que el motor */
- uint32_t step = s->count / (uint32_t)width + 1u, pw = live ? live_w[t].w[1] : part_pos(part, t);
+ * The knob or the held trig, never what plays; the same arithmetic as the engine */
+ uint32_t step = s->count / (uint32_t)width + 1u, pw = shown_pos(t, part);
uint32_t at = gran_position(s->count, pw > 0x7fffu ? 0x7fffu : pw);
int px = x0 + (int)(at / step);
for (int y = top + 3; y <= bot; y += 2) /* en inverso: se ve tambien encima de la onda */
@@ -898,12 +1034,12 @@ static void wave_area(unsigned t, volatile uint8_t *part, int x0, int x1, int to
}
}
-/* El valor de un mando para la pantalla: POS con sus octavos (lo que suena, si suena), el resto con value_text */
+/* El valor de un mando para la pantalla: POS con sus octavos, el resto con value_text */
static void knob_value(char *buf, unsigned t, volatile uint8_t *part, unsigned k)
{
- if (k == 1) pos_text(buf, live_at[t] + 8u > live_tick ? live_w[t].w[1] : part_pos(part, t));
- else if (k == 2) number(buf, part[0x30u + 30u * t + 2]); /* SIZE 0..127, entera como la lee el motor (author, 19/11) */
- else value_text(buf, k, part[0x30u + 30u * t + k]);
+ if (k == 1) pos_text(buf, shown_pos(t, part));
+ else if (k == 2) number(buf, shown_value(t, part, 2)); /* SIZE 0..127, entera como la lee el motor (author, 19/11) */
+ else value_text(buf, k, shown_value(t, part, k));
}
/* ---- la pantalla completa (maqueta A, elegida el 19/11) ----
@@ -1026,16 +1162,40 @@ void grain_draw(unsigned char *frame)
if (!U32(POOL_WINDOW)) pool_direct = 0; /* la pagina SRC a la vista: el pool, cerrado */
/* valores de los mandos (los de la Part): el que cambia se muestra un segundo */
static uint8_t known[8]; /* la primera lectura de una pista no cuenta como giro (salia «0.00» al entrar) */
+ static int last_step = -1;
+ int step_now = held_step(), same_step = step_now == last_step; /* pulsar o soltar un trig no es girar un mando */
+ { /* un paso pulsado que pierde su lock de POS pierde tambien el octavo */
+ static unsigned had;
+ unsigned mask = HELD_TRIGS;
+ uint32_t first = first_step();
+ if (!mask || first > 48u || !bank_ok()) had = 0;
+ else for (unsigned k = 0; k < 16u; ++k) {
+ if (!(mask >> k & 1u)) continue;
+ uint32_t at = lock_at(t, first + k);
+ if (U8(U32(BANK) + at + 1u) != 0xffu) had |= 1u << k;
+ else if (had >> k & 1u) {
+ had &= ~(1u << k);
+ if (fine_of(U8(U32(BANK) + at + FINE_LOCK)) >= 0) lock_put(at + FINE_LOCK, 0xffu);
+ }
+ }
+ }
+ last_step = step_now;
+ if (!same_step) show_until = 0;
for (unsigned k = 0; k < 6; ++k) {
- uint8_t v = part[0x30u + 30u * t + k];
+ uint8_t v = shown_value(t, part, k);
if (v != last_val[t][k]) {
last_val[t][k] = v;
- if (known[t]) { show_k = (uint8_t)k; show_t = (uint8_t)t; show_until = draws + 60u; }
+ if (known[t] && same_step) { show_k = (uint8_t)k; show_t = (uint8_t)t; show_until = draws + 60u; }
}
}
{ /* un octavo de POS tambien es un giro de POS */
static uint8_t last_fine[8];
uint8_t f = part[0x1e0u + 30u * t + 5u] & 7u;
+ if (step_now >= 0 && bank_ok()) {
+ int lf = fine_of(U8(U32(BANK) + lock_at(t, (unsigned)step_now) + FINE_LOCK));
+ if (lf >= 0) f = (uint8_t)lf;
+ }
+ if (!same_step) last_fine[t] = f;
if (f != last_fine[t]) { last_fine[t] = f; if (known[t]) { show_k = 1; show_t = (uint8_t)t; show_until = draws + 60u; } }
}
known[t] = 1;
diff --git a/sdk/octatrack/modules/grain/gran.c b/sdk/octatrack/modules/grain/gran.c
index 815dc6a78d..95e47e1dbf 100644
--- a/sdk/octatrack/modules/grain/gran.c
+++ b/sdk/octatrack/modules/grain/gran.c
@@ -112,7 +112,8 @@ static uint32_t gran_dir(GranEngine *e, unsigned dir)
return (e->seed >> 16) >= 65536u - thr;
}
-static void gran_spawn(GranEngine *e, GranTrack *t, const GranParams *p, const GranSample *s, unsigned n)
+static void gran_spawn(GranEngine *e, GranTrack *t, const GranParams *p, const GranSample *s, unsigned n,
+ int32_t whole, uint32_t frac)
{
uint32_t d6 = t->cd;
@@ -152,15 +153,18 @@ static void gran_spawn(GranEngine *e, GranTrack *t, const GranParams *p, const G
at += (int32_t)scaled_product(t->spray >> 5, r, 11);
at -= (int32_t)(t->spray >> 1);
}
- /* The sample is a ring, as in typical granular engines (the author, 22 November 2026): a grain born past the
- * end starts near the beginning and one born before the beginning starts near the end. POS is below count and
- * SPRY's offset is within +-count/2, so one correction is enough; the last test only guards very short samples. */
- if (at < 0)
- at += (int32_t)s->count;
- if ((uint32_t)at >= s->count)
- at -= (int32_t)s->count;
- if ((uint32_t)at >= s->count)
- at = (int32_t)s->count - 1;
+ /* EDGE WRAP: the sample is a ring, as in typical granular engines (the author, 22 November 2026): a grain born
+ * past the end starts near the beginning and one born before the beginning starts near the end. POS is below
+ * count and SPRY's offset is within +-count/2, so one correction is enough; the last test only guards very
+ * short samples. With CLMP and BNCE the birth is fixed once the direction is known (below). */
+ if (t->edge == GRAN_EDGE_WRAP) {
+ if (at < 0)
+ at += (int32_t)s->count;
+ if ((uint32_t)at >= s->count)
+ at -= (int32_t)s->count;
+ if ((uint32_t)at >= s->count)
+ at = (int32_t)s->count - 1;
+ }
g->idx = (uint32_t)at;
g->fr = 0;
g->left = t->len;
@@ -168,6 +172,32 @@ static void gran_spawn(GranEngine *e, GranTrack *t, const GranParams *p, const G
g->phs = 0x1000000u / t->len;
g->start = d6;
g->rev = gran_dir(e, p->dir);
+ if (t->edge != GRAN_EDGE_WRAP) {
+ /* CLMP, BNCE and STOP: a grain is born inside the sample. What POS plus SPRY pushes past an edge stays on
+ * that edge: at the end, a forward CLMP grain reads on from the beginning (the end and the beginning are the
+ * same point); a backward, bouncing or stopping one starts on the last frame (as in 0.1.1). */
+ if (at < 0)
+ at = 0;
+ else if ((uint32_t)at >= s->count)
+ at = (g->rev || t->edge != GRAN_EDGE_CLAMP) ? (int32_t)s->count - 1 : 0;
+ g->idx = (uint32_t)at;
+ }
+ if (t->edge == GRAN_EDGE_STOP) {
+ /* STOP: a grain that would reach an edge before its window ends is shortened so that the window ends there. The
+ * 0.1.1 grain was cut by the edge in the middle of its window, which clicked (the author, 23 November 2026).
+ * The frames the cursor can still read, in output frames: a pitch up reads several a frame, and a grain
+ * going backwards (its own direction against the note's step) leaves by the start. */
+ uint32_t room = (g->rev ^ (whole < 0 ? 1u : 0u)) ? g->idx + 1u : s->count - g->idx;
+ uint32_t adv = whole < 0 ? 0u - (uint32_t)whole : (uint32_t)whole + (frac != 0);
+ if (!adv) adv = 1u;
+ /* A multiplication and a compare for every grain; the divisions only for a grain that does reach the edge. */
+ if (room < g->left * adv) {
+ room /= adv;
+ if (!room) room = 1;
+ g->left = room;
+ g->phs = 0x1000000u / room;
+ }
+ }
g->pan = 0; /* v018: paneo al azar dentro de +-PAN/16 */
if (p->pan) { /* PAN 0..127: 127 da exactamente el PAN maximo del original */
uint32_t amt = p->pan > 127 ? 127 : p->pan;
@@ -691,7 +721,18 @@ static inline __attribute__((always_inline)) void mix_voices(GranTrack *t, const
mix_grain(t, s, g, w, f, win, mix, start, seg, count, stereo, packed, step, span);
start += seg; m -= seg;
if (g->idx >= count && count) {
- if (w >= 0) g->idx %= count;
+ if (t->edge == GRAN_EDGE_BOUNCE) {
+ /* BNCE: reflect about the edge that was crossed and turn the grain round (its step is negated the
+ * way a reverse grain's is). A reflection that would leave the sample lands on its last frame. */
+ uint32_t r = w >= 0 ? 2u * count - 1u - g->idx : 0u - g->idx - 1u;
+ g->idx = r < count ? r : count - 1u;
+ g->rev ^= 1u;
+ w = -w - (f != 0);
+ f = 0u - f;
+ } else if (t->edge == GRAN_EDGE_STOP) {
+ /* STOP: the cursor stays outside the sample, where frames read as silence (mix_grain advances a grain
+ * that is out of range without reading), as in 0.1.1. */
+ } else if (w >= 0) g->idx %= count;
else { uint32_t d = (0u - g->idx) % count; g->idx = d ? count - d : 0u; }
}
}
@@ -719,7 +760,7 @@ void gran_render(GranEngine *e, unsigned track, const GranParams *p, const GranS
for (unsigned i = 0; i < n; ++i)
mix[i].mid = mix[i].side = 0;
if (count)
- gran_spawn(e, t, p, s, n);
+ gran_spawn(e, t, p, s, n, whole, frac);
if (GRAN_PTR_PATH && stereo)
mix_voices(t, s, whole, frac, win, mix, n, count, 1, 1);
else
diff --git a/sdk/octatrack/modules/grain/gran.h b/sdk/octatrack/modules/grain/gran.h
index ff8fc12de8..aa80587e1b 100644
--- a/sdk/octatrack/modules/grain/gran.h
+++ b/sdk/octatrack/modules/grain/gran.h
@@ -33,6 +33,11 @@ typedef struct {
* entera (sw_gran: asrl #8), asi que un ajuste copiado del original suena igual */
uint8_t posf; /* fraccion de POS en 1/256 (escenas, LFOs); 0 = POS entera, igual que el original */
} GranParams;
+/* EDGE. CLMP: el grano nace dentro del sample (lo que se sale por un lado se queda en su borde) y, ya sonando, sigue por el
+ * otro lado al llegar a un borde. WRAP: el sample es un anillo, tambien en el nacimiento (0.1.2). BNCE: nace como en CLMP y,
+ * al llegar a un borde, rebota y vuelve en sentido contrario. STOP: nace como en CLMP (lo que se sale por el final, en el
+ * ultimo frame) y, al llegar a un borde, el grano se queda sin sample y calla: como Grain 0.1.0 y 0.1.1. */
+enum { GRAN_EDGE_CLAMP = 0, GRAN_EDGE_WRAP = 1, GRAN_EDGE_STOP = 2, GRAN_EDGE_BOUNCE = 3 };
typedef struct {
uint32_t idx, fr, left, ph, phs, start, rev;
@@ -52,6 +57,7 @@ typedef struct {
uint32_t scan, scanf; /* SCAN: lo que ha corrido el cabezal desde la nota (frames, y fraccion Q16) */
uint32_t count; /* largo del sample (para la pantalla) */
uint8_t on, trig;
+ uint8_t edge; /* EDGE (GRAN_EDGE_*), fijado con gran_set_edge; no va en GranParams para no mover su forma */
uint32_t sync_tempo24, sync_division; /* cached inputs for the current SYNC spacing */
} GranTrack;
@@ -61,6 +67,12 @@ typedef struct {
uint32_t pseed; /* gp_seed del PAN (azar propio) */
} GranEngine;
+/* EDGE de una pista: 0 CLMP, 1 WRAP, 2 STOP, 3 BNCE; mas alla de 3 (una Part antigua) vale CLMP. */
+static inline void gran_set_edge(GranEngine *e, unsigned track, unsigned edge)
+{
+ if (track < GRAN_TRACKS)
+ e->t[track].edge = edge > GRAN_EDGE_BOUNCE ? GRAN_EDGE_CLAMP : (uint8_t)edge;
+}
void gran_init(GranEngine *e);
/* Una nota: el primer grano sale en la primera muestra del siguiente bloque. */
void gran_trigger(GranEngine *e, unsigned track);
diff --git a/sdk/octatrack/modules/grain/host_test.c b/sdk/octatrack/modules/grain/host_test.c
index 1c6afe5a86..92ce4b5c0d 100755
--- a/sdk/octatrack/modules/grain/host_test.c
+++ b/sdk/octatrack/modules/grain/host_test.c
@@ -74,6 +74,7 @@ int main(int argc, char **argv)
for (int i = 0; base + i < argc && i < 10; ++i) pv[i] = (uint8_t)atoi(argv[base + i]); /* ... sync freeze scan */
static GranEngine e;
gran_init(&e);
+ if (getenv("EDGE")) gran_set_edge(&e, 0, (unsigned)atoi(getenv("EDGE")));
gran_trigger(&e, 0);
const unsigned secs = 8, total = 44100 * secs;
FILE *f = fopen(outp, "wb");
diff --git a/sdk/octatrack/modules/grain/manifest.py b/sdk/octatrack/modules/grain/manifest.py
index 0496c59e8d..ba016044ba 100755
--- a/sdk/octatrack/modules/grain/manifest.py
+++ b/sdk/octatrack/modules/grain/manifest.py
@@ -7,12 +7,14 @@
applies the pitch itself. A page with the waveform and the grains is drawn over SRC, and a full-screen page over the
third press of PLAYBACK.
-No stock code is patched: the machine joins the base's machine list and START dispatch through runtime.json
-(ot_machines, ot_machine_starts) and draws through module_draw. Everything GRAIN keeps in a Part passes stock's own
+The machine joins the base's machine list and START dispatch through runtime.json (ot_machines, ot_machine_starts)
+and draws through module_draw. One stock site is patched (0x400041c4, also wrapped by POLY8, so the two conflict): while
+Grain renders its own voice, the FLEX reader's PCM copy is skipped. Everything GRAIN keeps in a Part passes stock's own
power-on check. The connection to stock follows AMIGA (Jannik Assfalg, MIT).
"""
-from remix.schema import Category, Gate, Kind, Linked, Module, Proof
+from remix.schema import Category, Detour, Gate, Kind, Linked, Module, Proof
+from remix.stock_guard import stock_guard
MODULE = Module(
name="grain",
@@ -27,5 +29,9 @@
linked=(
Linked("grain", "modules/grain/grain_core.s", cpu="5475", dram=True),
),
+ detours=(
+ Detour(0x400041C4, stock_guard(0x400041C4, 8, "935fcfbfbcb323efa9fe7bada6974a125a8ea86989b79c535d556fc72d4d138d"),
+ "grain", "grain_copy", "Skip the FLEX reader's PCM copy while Grain renders its own", pad_to=8),
+ ),
gates=(Gate("modules/grain/test_grain.py", remix_arg=False),),
)
diff --git a/sdk/octatrack/modules/grain/media/capture.json b/sdk/octatrack/modules/grain/media/capture.json
index bd594f8ef6..393cb2ee8f 100755
--- a/sdk/octatrack/modules/grain/media/capture.json
+++ b/sdk/octatrack/modules/grain/media/capture.json
@@ -1,15 +1,15 @@
{
"firmware": "1.40C",
- "moduleVersion": "0.1.2-experimental",
+ "moduleVersion": "0.2.0-experimental",
"hardware": false,
"model": "MKII (emulated)",
- "capturedOn": "2026-11-22",
+ "capturedOn": "2026-11-23",
"capturedBy": "AForceTrulyEvil",
"imageSha256": "6536f3ae90dc503e271e7b0cc32fa9950ffb1f836ce729ba760e64fbf9e532e8",
"baseIdentity": null,
- "packageSha256": "f961b458deb9f93bad68435630b4c55110d3d0ef732bdfc7886df461a6250f66",
- "sourceRevision": "46e3ad7aea36f3c2a695537dc9d8015f24d65ab7",
- "setup": "Captured from the headless emulator ot_emu in MKII mode, booted on a development twin of a Modwerk base built from this repository's main at 633ff3e9e (imageSha256 is that twin's MAIN image), with the Grain 0.1.2-experimental package built in the pinned toolchain installed through the development session. Each picture is the emulator's framebuffer read by the session's png step: 128x64 at integer scale 2 (256x128), converted to two grey levels in an 8-bit greyscale PNG, not edited otherwise. See each image. Not hardware captures.",
+ "packageSha256": "e8d7c794905a2ff05a1f44f4d5a221263a8668f4fbf1f1e407a9f849701ae6d1",
+ "sourceRevision": "8f2cb3914708d46453276127797ff5549c8f1d88",
+ "setup": "Captured from the headless emulator ot_emu in MKII mode, booted on a development twin of a Modwerk base built from this repository's main at 633ff3e9e (imageSha256 is that twin's MAIN image), with the Grain 0.2.0-experimental package built in the pinned toolchain installed through the development session. Each picture is the emulator's framebuffer read by the session's png step: 128x64 at integer scale 2 (256x128), converted to two grey levels in an 8-bit greyscale PNG, not edited otherwise. See each image. Not hardware captures.",
"palette": {
"on": [
24,
@@ -25,28 +25,28 @@
"images": [
{
"path": "grain-machine-list.png",
- "sha256": "62f105c4f7c6c32931abf128252dc56c03b06b345a872bb86b00b4e860ad89b1",
+ "sha256": "9bc279818ebc501d5170e4a7de67fd2d202f42ed7a089df42571c0b0c603ab58",
"scale": 2,
"page": "Machine list (SRC SETUP)",
"state": "Track 1 on FLEX, the cursor moved down to GRAIN in the machine list."
},
{
"path": "grain-src.png",
- "sha256": "cd69da666c8fe0310dd3f84d9d828871b8b4111d4fc96e1204e2aaebaebfbbbe",
+ "sha256": "716cf85d20a5f60501a9865f18cde89112119d7a46411889f06851efb12bf690",
"scale": 2,
"page": "SRC",
"state": "Track 1 on Grain with a Flex sample, playing: the SRC page with a cloud of live grains. Settings: DENS 127, SPRY 50, SIZE 95, PAN 108 (85 %), POS 44.9, with a stereo sample made for the capture; the grains show as small squares, with a dark frame where they fall inside the waveform."
},
{
"path": "grain-src-setup.png",
- "sha256": "f4bf4b6af36c651f2b764054e0d49c37551218f178719ccba6f1629f1e45b40f",
+ "sha256": "13fb7149dd1c3a2f117b63f5a44ea026e3954c8885f16f726b1b6c4b0251284d",
"scale": 2,
"page": "SRC SETUP",
- "state": "Track 1 on Grain with a Flex sample, at the defaults: SRC SETUP."
+ "state": "Track 1 on Grain with a Flex sample, at the defaults: SRC SETUP, with EDGE on CLMP."
},
{
"path": "grain-full-screen.png",
- "sha256": "d123245b2f8f859506ea466d6e5dd27435ec28680f6596779d57ef5962912f38",
+ "sha256": "5b82f3ce5419de340544a743565c62a77b484a1804d3bb56d700b58eed78ee62",
"scale": 2,
"page": "Full-screen page",
"state": "Track 1 on Grain with a Flex sample, playing: the full-screen page with a cloud of live grains. Settings: DENS 127, SPRY 50, SIZE 95, PAN 108 (85 %), POS 44.9, with a stereo sample made for the capture; the grains show as small squares, with a dark frame where they fall inside the waveform."
diff --git a/sdk/octatrack/modules/grain/media/grain-full-screen.png b/sdk/octatrack/modules/grain/media/grain-full-screen.png
index 3f7ccce92f..45fbcf4e7a 100755
Binary files a/sdk/octatrack/modules/grain/media/grain-full-screen.png and b/sdk/octatrack/modules/grain/media/grain-full-screen.png differ
diff --git a/sdk/octatrack/modules/grain/media/grain-machine-list.png b/sdk/octatrack/modules/grain/media/grain-machine-list.png
index 2cbd674040..2221c9ffd9 100755
Binary files a/sdk/octatrack/modules/grain/media/grain-machine-list.png and b/sdk/octatrack/modules/grain/media/grain-machine-list.png differ
diff --git a/sdk/octatrack/modules/grain/media/grain-src-setup.png b/sdk/octatrack/modules/grain/media/grain-src-setup.png
index 123ffa2659..6728a0143d 100755
Binary files a/sdk/octatrack/modules/grain/media/grain-src-setup.png and b/sdk/octatrack/modules/grain/media/grain-src-setup.png differ
diff --git a/sdk/octatrack/modules/grain/media/grain-src.png b/sdk/octatrack/modules/grain/media/grain-src.png
index 2c7813e484..6b9fd91df3 100755
Binary files a/sdk/octatrack/modules/grain/media/grain-src.png and b/sdk/octatrack/modules/grain/media/grain-src.png differ
diff --git a/sdk/octatrack/modules/grain/octamod.module.json b/sdk/octatrack/modules/grain/octamod.module.json
index 8fe9bdcec3..ef7aae50d1 100755
--- a/sdk/octatrack/modules/grain/octamod.module.json
+++ b/sdk/octatrack/modules/grain/octamod.module.json
@@ -3,7 +3,7 @@
"id": "grain",
"key": "GRAIN",
"name": "Grain",
- "version": "0.1.3-experimental",
+ "version": "0.2.0-experimental",
"category": "machines",
"author": {
"github": "AForceTrulyEvil",
@@ -27,7 +27,8 @@
"DIR sets the share of grains that play backwards, from none to all; SCAN runs a read head through the sample, forwards or backwards.",
"POS moves in fine steps that speed up as you turn faster, and a pressed knob jumps by seven.",
"A waveform view with the POS line and the live grains on the SRC page, and a full-screen page for precise work.",
- "Everything is kept in the Part in values stock's own power-on check accepts, so a project is never lost with or without the module."
+ "Everything is kept in the Part in values stock's own power-on check accepts, so a project is never lost with or without the module.",
+ "EDGE chooses what happens when a grain reaches the start or end of the sample: CLMP, WRAP, STOP or BNCE."
],
"usage": [
"Double-tap a track key (or open SRC SETUP), choose GRAIN in the machine list and press YES, then pick a Flex sample.",
@@ -112,35 +113,50 @@
"RAND",
"SYNC"
]
+ },
+ {
+ "name": "EDGE",
+ "default": 0,
+ "count": 4,
+ "doc": "What happens at the start and end of the sample. CLMP: SPRY can't push a grain past an end, and a grain that runs off one end carries on from the other. WRAP: the sample is a loop, so a grain pushed or running off one end comes out of the other (as in 0.1.2). STOP: SPRY can't push a grain past an end, and a grain that reaches an end stops there. BNCE: SPRY can't push a grain past an end, and a grain that reaches an end plays back the other way. Turn several detents to change a value. SRC SETUP knob E.",
+ "labels": [
+ "CLMP",
+ "WRAP",
+ "STOP",
+ "BNCE"
+ ]
}
],
"compatibility": {
"firmware": "1.40C",
"location": "Track machine",
- "conflicts": [],
+ "conflicts": [
+ "poly8"
+ ],
"uiClaims": [],
"limitations": [
"Experimental. Earlier builds ran on an MKI and MKII. TESTING.md identifies the build and the remaining hardware checks.",
"The base reserves 35 CPU points per Grain track. With dense 24-bit stereo, 20-channel USB capture and musical MIDI, six-voice Grain still skipped renders on both tested tracks. A busy Part can refuse the first Grain track.",
"Up to six grains sound at once; with all six sounding, a grain that is due is not born.",
"A sample the module cannot read, or one that is still loading, plays silence. Changing the sample while a note plays stops it, as on a Flex track.",
- "POS locked on a trig takes whole numbers; the fine eighths are for turning the knob. A scene or an LFO moves POS smoothly between values.",
+ "POS locked on a trig keeps its eighths, in the spare lock byte stock uses for the sample slot's XVOL. A scene or an LFO moves POS smoothly between values.",
"SRC page: a waveform view with the POS line and the grains replaces the six knob dials. Hold SCENE A or B for stock's knobs.",
"A third press of PLAYBACK, from SRC SETUP, opens the full-screen page instead of going back to SRC; another press closes it. FUNC and PLAYBACK still open SRC SETUP.",
"A project opened without the module plays Grain tracks as FLEX at stock's defaults.",
- "After the sample pool was opened on a Grain track from a page other than SRC and closed, FUNC+SRC cannot pick FLEX or STATIC until the SRC page is shown or another track is selected. A double tap on the track key and LEFT changes the machine."
+ "After the sample pool was opened on a Grain track from a page other than SRC and closed, FUNC+SRC cannot pick FLEX or STATIC until the SRC page is shown or another track is selected. A double tap on the track key and LEFT changes the machine.",
+ "A project saved with 0.1.2 opens with EDGE on CLMP: a grain that SPRY threw past an edge is born on that edge instead of wrapping. EDGE on WRAP restores 0.1.2's sound, and STOP the sound of 0.1.0 and 0.1.1 without the click."
],
"effectId": null
},
"resources": {
- "recorded": "2026-11-21",
+ "recorded": "2026-11-24",
"storage": {
"label": "Module image and memory",
- "display": "31,808 bytes of static runtime memory",
- "value": 31808,
+ "display": "33,012 bytes of static runtime memory",
+ "value": 33012,
"unit": "bytes",
"method": "static",
- "conditions": "Package f961b458 loads 28,944 bytes of code and data and declares 2,864 bytes of BSS. The deepest Grain-only audio path uses 768 stack bytes including return addresses and saved frame pointers (grain_render 176, gran_render 392, stereo_paged 92 and stereo_page 84 by GCC's stack-usage report, plus four return addresses and the frame pointers link.w saves). Stock calls, interrupt nesting and loader overhead are additional.",
+ "conditions": "Package e8d7c794 loads 30,148 bytes of code and data and declares 2,864 bytes of BSS. The deepest Grain-only audio path uses 780 stack bytes including return addresses and saved frame pointers (grain_render 168, gran_render 412, stereo_paged 92 and stereo_page 84 by GCC's stack-usage report, plus four return addresses and the frame pointers link.w saves). Stock calls, interrupt nesting and loader overhead are additional.",
"source": "TESTING.md"
},
"processing": {
@@ -169,7 +185,7 @@
"memory": {
"level": "minimal",
"basis": "source-estimate",
- "rationale": "The 30,308-byte package loads 28,944 bytes of code and data and reserves 2,864 bytes of zero-initialized state. It reads the existing Flex sample pages. Stack and loader overhead are additional.",
+ "rationale": "The 31,524-byte package loads 30,148 bytes of code and data and reserves 2,864 bytes of zero-initialized state. It reads the existing Flex sample pages. Stack and loader overhead are additional.",
"source": "TESTING.md"
}
},
@@ -194,7 +210,7 @@
},
"tests": {
"report": "TESTING.md",
- "summary": "0.1.2 package f961b458, on the author's MKI with the official base 6d23e888 and a card set of seven modules: the set loaded; PTCH, the edges, the pool and the audition behaved as described, and the clipping case played clean. Stock CPU meter, Grain on one track, 24-bit stereo, PTCH +24, DENS and SPRY at maximum, idle 49.5 %: 70-71 % with a 0.03 MB kick, 68-69 % with a 1.55 MB sample; the long sample at PTCH 0 read 66-67 %. No dropouts heard; skipped renders were not counted. Project saved, power cycled and reloaded with this exact package (f961b458): Grain, its settings and the sound came back as left. Historical, 0.1.1 and earlier: 0.1.1 package 1b3728c0 differs from the unit-tested build c841ea87 only by its meter cost (reserved[1]). On the MKII, c841ea87 kept Grain rendering with the pool open and took the plain Flex path only for a FUNC+YES audition, until the next trig. 0.1.0 package ff5ac017, card-free in RAM: Grain played T1, FLEX could be picked after a pool jump, and Grain kept its engine with the pool open on another track. Its audio path differs from the timed builds only by the pool check: with USB audio capture closed, six-voice Grain played T1 and T5 with no skipped renders and no frame over the deadline. A 240 BPM, 1,096 messages/s MIDI flood left nothing sounding after STOP. It was kept over USB beside other modules, restored after a power cycle and removed again (side-first build db843bc2). The optional twenty-channel USB layout still overruns. Listening, project reload and a full module set remain open.",
+ "summary": "The published package db1cb96a differs from the measured 520215cb only in the waveform view's display code. 0.2.0 final package 520215cb on the author's MKI: frame-cost curve 16.1 % first and 8.6 % each further instance; admitted on an empty pattern, refused on the medium one (105.3 %). The POS lock byte test (copy, paste, clear, Flex and Static with the lock kept, crossfader moved) showed no volume jump. The full scripted test procedure was not run. Earlier builds: 0.2.0 package e8d7c794, 0e4bebd4's engine on 0.1.3: the two loops that run for every sample compile to the same instructions as in 0.1.2, and the EDGE code runs only when a grain is born or reaches an edge. On the author's MKI, with the official base 6d23e888 and a card set of seven modules, an eight-tone sample showed the notes the host renders predict in CLMP, WRAP and BNCE (package 8a4555de), and STOP played as expected. A later build (0e4bebd4) loaded, played and passed the rest of the release checklist. Stock CPU meter, DENS and SPRY at maximum, PTCH +24, all four EDGE modes: 65 to 68 %, about 66 to 67 % on average. Not recorded: a unit run of the final package, the frame-cost curve for 0.2.0 and the MKII. Previous release, 0.1.2 package f961b458, on the author's MKI with the official base 6d23e888 and a card set of seven modules: the set loaded; PTCH, the edges, the pool and the audition behaved as described, and the clipping case played clean. Stock CPU meter, Grain on one track, 24-bit stereo, PTCH +24, DENS and SPRY at maximum, idle 49.5 %: 70-71 % with a 0.03 MB kick, 68-69 % with a 1.55 MB sample; the long sample at PTCH 0 read 66-67 %. No dropouts heard; skipped renders were not counted. Project saved, power cycled and reloaded with this exact package (f961b458): Grain, its settings and the sound came back as left. Historical, 0.1.1 and earlier: 0.1.1 package 1b3728c0 differs from the unit-tested build c841ea87 only by its meter cost (reserved[1]). On the MKII, c841ea87 kept Grain rendering with the pool open and took the plain Flex path only for a FUNC+YES audition, until the next trig. 0.1.0 package ff5ac017, card-free in RAM: Grain played T1, FLEX could be picked after a pool jump, and Grain kept its engine with the pool open on another track. Its audio path differs from the timed builds only by the pool check: with USB audio capture closed, six-voice Grain played T1 and T5 with no skipped renders and no frame over the deadline. A 240 BPM, 1,096 messages/s MIDI flood left nothing sounding after STOP. It was kept over USB beside other modules, restored after a power cycle and removed again (side-first build db843bc2). The optional twenty-channel USB layout still overruns. Listening, project reload and a full module set remain open.",
"hardwareStatus": "reported",
"evidenceRevision": "db1e077309f4c538a1b1b672960c345c22b07ead",
"gates": [
@@ -208,7 +224,7 @@
"Double-tap a track key, choose GRAIN in the machine list and press YES, then double-tap again and pick a Flex sample.",
"Put a trig on the track and play. Press SRC and turn POS: the grains move through the sample, and the waveform shows where. Turn SIZE down for a fine mist and up for long overlapping grains.",
"Turn SPRY up to scatter the grains around POS, and DENS up to thicken the cloud. Turn SCAN to let the read head run through the sample by itself.",
- "Press SRC twice for SRC SETUP: turn PAN for a spread across the stereo field, DIR for a share of backward grains, SHAP to change the grain window, and MODE to SYNC to lock the grains to the tempo.",
+ "Press SRC twice for SRC SETUP: turn PAN for a spread across the stereo field, DIR for a share of backward grains, SHAP to change the grain window, MODE to SYNC to lock the grains to the tempo, and EDGE to choose what happens when a grain reaches the start or end of the sample.",
"Press SRC once more from SRC SETUP for the full-screen page, with a larger waveform and every value beside its name, for precise settings.",
"Press SRC again to leave the full-screen page. Press STOP to stop playback."
]
@@ -240,9 +256,9 @@
"page": "Machine list (SRC SETUP)",
"shows": "location",
"firmware": "1.40C",
- "moduleVersion": "0.1.2-experimental",
+ "moduleVersion": "0.2.0-experimental",
"imageSha256": "6536f3ae90dc503e271e7b0cc32fa9950ffb1f836ce729ba760e64fbf9e532e8",
- "setup": "Captured from the headless emulator ot_emu in MKII mode, booted on a development twin of a Modwerk base built from this repository's main at 633ff3e9e (imageSha256 is that twin's MAIN image), with the Grain 0.1.2-experimental package built in the pinned toolchain installed through the development session. Each picture is the emulator's framebuffer read by the session's png step: 128x64 at integer scale 2 (256x128), converted to two grey levels in an 8-bit greyscale PNG, not edited otherwise. Track 1 on FLEX, the cursor moved down to GRAIN in the machine list. Not hardware captures."
+ "setup": "Captured from the headless emulator ot_emu in MKII mode, booted on a development twin of a Modwerk base built from this repository's main at 633ff3e9e (imageSha256 is that twin's MAIN image), with the Grain 0.2.0-experimental package built in the pinned toolchain installed through the development session. Each picture is the emulator's framebuffer read by the session's png step: 128x64 at integer scale 2 (256x128), converted to two grey levels in an 8-bit greyscale PNG, not edited otherwise. Track 1 on FLEX, the cursor moved down to GRAIN in the machine list. Not hardware captures."
}
},
{
@@ -257,16 +273,16 @@
"page": "SRC",
"shows": "controls",
"firmware": "1.40C",
- "moduleVersion": "0.1.2-experimental",
+ "moduleVersion": "0.2.0-experimental",
"imageSha256": "6536f3ae90dc503e271e7b0cc32fa9950ffb1f836ce729ba760e64fbf9e532e8",
- "setup": "Captured from the headless emulator ot_emu in MKII mode, booted on a development twin of a Modwerk base built from this repository's main at 633ff3e9e (imageSha256 is that twin's MAIN image), with the Grain 0.1.2-experimental package built in the pinned toolchain installed through the development session. Each picture is the emulator's framebuffer read by the session's png step: 128x64 at integer scale 2 (256x128), converted to two grey levels in an 8-bit greyscale PNG, not edited otherwise. Track 1 on Grain with a Flex sample, playing: the SRC page with a cloud of live grains. Settings: DENS 127, SPRY 50, SIZE 95, PAN 108 (85 %), POS 44.9, with a stereo sample made for the capture; the grains show as small squares, with a dark frame where they fall inside the waveform. Not hardware captures."
+ "setup": "Captured from the headless emulator ot_emu in MKII mode, booted on a development twin of a Modwerk base built from this repository's main at 633ff3e9e (imageSha256 is that twin's MAIN image), with the Grain 0.2.0-experimental package built in the pinned toolchain installed through the development session. Each picture is the emulator's framebuffer read by the session's png step: 128x64 at integer scale 2 (256x128), converted to two grey levels in an 8-bit greyscale PNG, not edited otherwise. Track 1 on Grain with a Flex sample, playing: the SRC page with a cloud of live grains. Settings: DENS 127, SPRY 50, SIZE 95, PAN 108 (85 %), POS 44.9, with a stereo sample made for the capture; the grains show as small squares, with a dark frame where they fall inside the waveform. Not hardware captures."
}
},
{
"path": "media/grain-src-setup.png",
"captureType": "emulator",
- "caption": "SRC SETUP (press SRC twice). SHAP: the grain's window, how soft or sharp each grain starts and ends. DIR: at 0 every grain plays forwards; as it rises, more and more grains play backwards, 64 is half and half, and at 127 all play backwards. PAN: random spread across the stereo field. MODE: RAND places grains at random times; SYNC locks them to the tempo, and DENS then picks the note division.",
- "alt": "Octatrack SRC SETUP page of a Grain track: GRAIN marked in the machine list, SHAP NORM, DIR and PAN dials, and MODE RAND.",
+ "caption": "SRC SETUP (press SRC twice). SHAP: the grain's window. DIR: the share of grains that play backwards, from none (0) to all (127). PAN: random spread across the stereo field. MODE: RAND places grains at random times; SYNC locks them to the tempo. EDGE: what grains do at the start and end of the sample.",
+ "alt": "Octatrack SRC SETUP page of a Grain track: GRAIN marked in the machine list, SHAP NORM, DIR and PAN dials, MODE RAND and EDGE CLMP.",
"credit": "A Force Truly Evil; underlying Octatrack UI by Elektron",
"license": "LicenseRef-OT-UI-Documentation",
"source": "original",
@@ -274,9 +290,9 @@
"page": "SRC SETUP",
"shows": "controls",
"firmware": "1.40C",
- "moduleVersion": "0.1.2-experimental",
+ "moduleVersion": "0.2.0-experimental",
"imageSha256": "6536f3ae90dc503e271e7b0cc32fa9950ffb1f836ce729ba760e64fbf9e532e8",
- "setup": "Captured from the headless emulator ot_emu in MKII mode, booted on a development twin of a Modwerk base built from this repository's main at 633ff3e9e (imageSha256 is that twin's MAIN image), with the Grain 0.1.2-experimental package built in the pinned toolchain installed through the development session. Each picture is the emulator's framebuffer read by the session's png step: 128x64 at integer scale 2 (256x128), converted to two grey levels in an 8-bit greyscale PNG, not edited otherwise. Track 1 on Grain with a Flex sample, at the defaults: SRC SETUP. Not hardware captures."
+ "setup": "Captured from the headless emulator ot_emu in MKII mode, booted on a development twin of a Modwerk base built from this repository's main at 633ff3e9e (imageSha256 is that twin's MAIN image), with the Grain 0.2.0-experimental package built in the pinned toolchain installed through the development session. Each picture is the emulator's framebuffer read by the session's png step: 128x64 at integer scale 2 (256x128), converted to two grey levels in an 8-bit greyscale PNG, not edited otherwise. Track 1 on Grain with a Flex sample, at the defaults: SRC SETUP, with EDGE on CLMP. Not hardware captures."
}
},
{
@@ -291,9 +307,9 @@
"page": "Full-screen page",
"shows": "controls",
"firmware": "1.40C",
- "moduleVersion": "0.1.2-experimental",
+ "moduleVersion": "0.2.0-experimental",
"imageSha256": "6536f3ae90dc503e271e7b0cc32fa9950ffb1f836ce729ba760e64fbf9e532e8",
- "setup": "Captured from the headless emulator ot_emu in MKII mode, booted on a development twin of a Modwerk base built from this repository's main at 633ff3e9e (imageSha256 is that twin's MAIN image), with the Grain 0.1.2-experimental package built in the pinned toolchain installed through the development session. Each picture is the emulator's framebuffer read by the session's png step: 128x64 at integer scale 2 (256x128), converted to two grey levels in an 8-bit greyscale PNG, not edited otherwise. Track 1 on Grain with a Flex sample, playing: the full-screen page with a cloud of live grains. Settings: DENS 127, SPRY 50, SIZE 95, PAN 108 (85 %), POS 44.9, with a stereo sample made for the capture; the grains show as small squares, with a dark frame where they fall inside the waveform. Not hardware captures."
+ "setup": "Captured from the headless emulator ot_emu in MKII mode, booted on a development twin of a Modwerk base built from this repository's main at 633ff3e9e (imageSha256 is that twin's MAIN image), with the Grain 0.2.0-experimental package built in the pinned toolchain installed through the development session. Each picture is the emulator's framebuffer read by the session's png step: 128x64 at integer scale 2 (256x128), converted to two grey levels in an 8-bit greyscale PNG, not edited otherwise. Track 1 on Grain with a Flex sample, playing: the full-screen page with a cloud of live grains. Settings: DENS 127, SPRY 50, SIZE 95, PAN 108 (85 %), POS 44.9, with a stereo sample made for the capture; the grains show as small squares, with a dark frame where they fall inside the waveform. Not hardware captures."
}
},
{
diff --git a/sdk/octatrack/modules/grain/range_test.c b/sdk/octatrack/modules/grain/range_test.c
index 6dcd7da57e..e1ada266d3 100644
--- a/sdk/octatrack/modules/grain/range_test.c
+++ b/sdk/octatrack/modules/grain/range_test.c
@@ -31,6 +31,7 @@ static int check_sample(uint32_t count)
uint32_t pos = (uint64_t)(count >> 6) * pos_word >> 9;
uint32_t width = (uint64_t)(count >> 6) * (params.spray << 8) >> 9;
gran_init(&engine);
+ gran_set_edge(&engine, 0, GRAN_EDGE_WRAP);
engine.seed += dial * 7171u;
uint32_t random = (engine.seed * 1664525u + 1013904223u) >> 16;
int32_t expected = (int32_t)pos + (int32_t)((uint64_t)random * (width >> 5) >> 11)
@@ -96,10 +97,102 @@ static int check_ring(int reverse)
return 0;
}
+/* EDGE CLMP and BNCE (0.2.0): a grain is born inside the sample, and BNCE turns a grain round at an edge. */
+static int check_edge(void)
+{
+ const uint32_t count = 32768;
+ GranSample sample = {.count = count, .bytes = 2, .channels = 1, .locate = read_frame};
+ static const unsigned birth_modes[3] = { GRAN_EDGE_CLAMP, GRAN_EDGE_BOUNCE, GRAN_EDGE_STOP };
+ for (unsigned mi = 0; mi < 3u; ++mi) {
+ unsigned mode = birth_modes[mi];
+ unsigned zeros = 0, tops = 0, born = 0;
+ for (unsigned seed = 0; seed < 400; ++seed) {
+ for (unsigned end = 0; end <= 1; ++end) {
+ /* POS at the start or at the last frame with SPRY at its widest: half the births fall off an edge. */
+ GranParams params = {.pos = end ? 127 : 0, .posf = end ? 255 : 0, .spray = 127};
+ GranEngine engine;
+ gran_init(&engine);
+ gran_set_edge(&engine, 0, mode);
+ engine.seed += seed * 7171u;
+ gran_params(&engine, 0, ¶ms, &sample, 120 * 24);
+ gran_trigger(&engine, 0);
+ int32_t out[2];
+ first_read = UINT32_MAX;
+ gran_render(&engine, 0, ¶ms, &sample, 1, 0, out, 1);
+ uint32_t r = first_read;
+ if (r >= count) { fprintf(stderr, "EDGE %u: read %" PRIu32 " outside the sample\n", mode, r); return 1; }
+ ++born;
+ /* At the start, nothing can be born in the far half: the grains that fall off the start stay on frame 0. */
+ if (!end && r > count / 2u + 2u) { fprintf(stderr, "EDGE %u: a grain at POS 0 was born at %" PRIu32 "\n", mode, r); return 1; }
+ /* At the end, the grains that fall off the end start at 0 (CLMP, forward) or on the last frame (BNCE): never in between. */
+ if (end && r > 2u && r < count / 2u - 2u) { fprintf(stderr, "EDGE %u: a grain at the end was born at %" PRIu32 "\n", mode, r); return 1; }
+ zeros += r == 0; tops += r == count - 1u;
+ }
+ }
+ if (mode == GRAN_EDGE_CLAMP && !zeros) { fputs("EDGE CLMP: no grain stayed on an edge\n", stderr); return 1; }
+ if (mode != GRAN_EDGE_CLAMP && !tops) { fprintf(stderr, "EDGE %u: no grain stayed on the last frame\n", mode); return 1; }
+ (void)born;
+ }
+ /* BNCE turns a grain round at the end (forwards) and at the start (backwards), reading the edge frame twice. */
+ for (int reverse = 0; reverse <= 1; ++reverse) {
+ GranSample logged = {.count = count, .bytes = 2, .channels = 1, .locate = log_frame};
+ GranParams params = {.pos = reverse ? 0 : 127, .posf = reverse ? 0 : 255, .size = 20, .dens = 0,
+ .dir = reverse ? 127 : 0};
+ GranEngine engine;
+ gran_init(&engine);
+ gran_set_edge(&engine, 0, GRAN_EDGE_BOUNCE);
+ gran_params(&engine, 0, ¶ms, &logged, 120 * 24);
+ gran_trigger(&engine, 0);
+ ring_n = 0;
+ int32_t out[32];
+ gran_render(&engine, 0, ¶ms, &logged, 1, 0, out, 8);
+ const uint32_t want[3] = {reverse ? 0u : count - 1u, reverse ? 1u : count - 2u, reverse ? 2u : count - 3u};
+ for (unsigned i = 0; i < 3; ++i)
+ if (ring_n <= i || ring_log[i] != want[i]) {
+ fprintf(stderr, "BNCE %s: read %u was %" PRIu32 ", expected %" PRIu32 "\n", reverse ? "backwards" : "forwards",
+ i, ring_n > i ? ring_log[i] : 0u, want[i]);
+ return 1;
+ }
+ }
+ /* STOP: a grain that reaches an edge reads nothing more (forwards past the end, backwards past the start). */
+ for (int reverse = 0; reverse <= 1; ++reverse) {
+ GranSample logged = {.count = count, .bytes = 2, .channels = 1, .locate = log_frame};
+ GranParams params = {.pos = reverse ? 0 : 127, .posf = reverse ? 0 : 255, .size = 20, .dens = 0,
+ .dir = reverse ? 127 : 0};
+ GranEngine engine;
+ gran_init(&engine);
+ gran_set_edge(&engine, 0, GRAN_EDGE_STOP);
+ gran_params(&engine, 0, ¶ms, &logged, 120 * 24);
+ gran_trigger(&engine, 0);
+ ring_n = 0;
+ int32_t out[32];
+ gran_render(&engine, 0, ¶ms, &logged, 1, 0, out, 8);
+ if (ring_n != 1 || ring_log[0] != (reverse ? 0u : count - 1u)) {
+ fprintf(stderr, "STOP %s: %u frames read, the first %" PRIu32 "\n", reverse ? "backwards" : "forwards", ring_n, ring_n ? ring_log[0] : 0u);
+ return 1;
+ }
+ }
+ /* CLMP keeps the ring for a grain that is already sounding. */
+ GranSample logged = {.count = count, .bytes = 2, .channels = 1, .locate = log_frame};
+ GranParams params = {.pos = 127, .posf = 255, .size = 20, .dens = 0};
+ GranEngine engine;
+ gran_init(&engine);
+ gran_set_edge(&engine, 0, GRAN_EDGE_CLAMP);
+ gran_params(&engine, 0, ¶ms, &logged, 120 * 24);
+ gran_trigger(&engine, 0);
+ ring_n = 0;
+ int32_t out[32];
+ gran_render(&engine, 0, ¶ms, &logged, 1, 0, out, 8);
+ if (ring_n < 3 || ring_log[0] != count - 1u || ring_log[1] != 0u || ring_log[2] != 1u) { fputs("CLMP: a sounding grain did not carry on at the beginning\n", stderr); return 1; }
+ return 0;
+}
+
int main(void)
{
if (check_ring(0) || check_ring(1)) return 1;
puts("[PASS] A grain reading past the end continues at the beginning, and one reading back past the beginning at the end");
+ if (check_edge()) return 1;
+ puts("[PASS] EDGE: CLMP, BNCE and STOP are born inside the sample; BNCE turns round at an edge, STOP stops there, CLMP carries on");
/* One frame, partial pages, both sides of the former overflow, a
* four-minute file at 44.1 kHz and the largest supported Flex sample. */
const uint32_t lengths[] = {1, 88201, 7938000, 8388608, 8388672, 10584000, 44860416};
diff --git a/sdk/octatrack/modules/grain/verify.py b/sdk/octatrack/modules/grain/verify.py
index 84e3fbcb97..b71ff3ead9 100755
--- a/sdk/octatrack/modules/grain/verify.py
+++ b/sdk/octatrack/modules/grain/verify.py
@@ -37,10 +37,15 @@ def check(name, ok, detail=''):
if not CC:
sys.exit('[SKIP] no C compiler: the host gate did not run')
-REFERENCES = { # 0.1.2: the sample is a ring, so grains crossing an edge now read the other side, and every grain is 3 dB lower; settings (pos size dens spray shape dir pan sync) -> SHA-256 of the 8 s stereo render
- 'default': ((), 'ffafa70b40fee69e868b8d14749ddaa0754a2d67fcd4d75eba45526628d47314'),
- 'perc-sync': (('40', '40', '70', '20', '2', '0', '0', '1'), '9c4ba3c3429c80ec79aa93a43120f9380522763d6223b697491dc290c6f12762'),
- 'pan-dir': (('40', '70', '110', '50', '0', '64', '127', '0'), '2fe9531b4c53c71aa0f9cd2f3e5ea40083ca8ad49dff6f08311b16bb61e9adb3'),
+# 0.1.2 renders (EDGE WRAP, the sample is a ring and every grain is 3 dB lower) and 0.2.0 renders of CLMP, BNCE and STOP; settings
+# (pos size dens spray shape dir pan sync) and EDGE -> SHA-256 of the 8 s stereo render
+REFERENCES = {
+ 'default': ((), '1', 'ffafa70b40fee69e868b8d14749ddaa0754a2d67fcd4d75eba45526628d47314'),
+ 'perc-sync': (('40', '40', '70', '20', '2', '0', '0', '1'), '1', '9c4ba3c3429c80ec79aa93a43120f9380522763d6223b697491dc290c6f12762'),
+ 'pan-dir': (('40', '70', '110', '50', '0', '64', '127', '0'), '1', '2fe9531b4c53c71aa0f9cd2f3e5ea40083ca8ad49dff6f08311b16bb61e9adb3'),
+ 'clamp-spray': (('40', '70', '110', '127', '0', '64', '0', '0'), '0', '38374c95b9662ca6f285a20674ef88c1d32db2bc42161630e50903dd4038d5dd'),
+ 'bounce-spray': (('40', '70', '110', '127', '0', '64', '0', '0'), '3', 'f56eb94eeff6d832269df640c67a3746ee5af3ed14f0e42bb1f0348a8c6d84b5'),
+ 'stop-spray': (('40', '70', '110', '127', '0', '64', '0', '0'), '2', 'eea4956fec1d6dd071db44550a0f0e4db5357e55b52c5799077ddfbf32dbce66'),
}
CASES = [('40', '70', '90', '30', '0', '0', '0', '0'), ('40', '70', '110', '50', '0', '64', '0', '0'),
('40', '70', '110', '50', '0', '0', '127', '0'), ('40', '70', '110', '50', '0', '127', '80', '0'),
@@ -76,17 +81,21 @@ def run(exe, out, args=(), source=None, env=None):
stereo_input(source)
for pw, pf in PITCHES:
for i, args in enumerate(CASES):
- env = {'PW': pw, 'PF': pf}
- a = run(fast, td / 'a.wav', args, source, env)
- b = run(plain, td / 'b.wav', args, source, env)
- check(f'stereo, pitch {pw} {pf}, case {i + 1}: optimized paths match the plain ones', a == b)
+ for edge in ('0', '1', '2', '3'):
+ env = {'PW': pw, 'PF': pf, 'EDGE': edge}
+ a = run(fast, td / 'a.wav', args, source, env)
+ b = run(plain, td / 'b.wav', args, source, env)
+ check(f'stereo, pitch {pw} {pf}, case {i + 1}, EDGE {edge}: optimized paths match the plain ones', a == b)
for i, args in enumerate(CASES[:3]): # the same on a mono tone
- a = run(fast, td / 'a.wav', args)
- b = run(plain, td / 'b.wav', args)
- check(f'mono, case {i + 1}: optimized paths match the plain ones', a == b)
-
- for name, (args, digest) in REFERENCES.items():
- got = hashlib.sha256(run(fast, td / 'r.wav', args)).hexdigest()
+ for edge in ('0', '1', '2', '3'):
+ a = run(fast, td / 'a.wav', args, env={'EDGE': edge})
+ b = run(plain, td / 'b.wav', args, env={'EDGE': edge})
+ check(f'mono, case {i + 1}, EDGE {edge}: optimized paths match the plain ones', a == b)
+
+ for name, (args, edge, digest) in REFERENCES.items():
+ got = hashlib.sha256(run(fast, td / 'r.wav', args, env={'EDGE': edge})).hexdigest()
+ if os.environ.get('PRINT_REFS'):
+ print(name, got)
if got == digest:
check(f'reference render {name}', True)
else: # the tone itself depends on the host's libm
diff --git a/src/catalog/module-documents.json b/src/catalog/module-documents.json
index 4556e9e37d..eccff8cb3b 100644
--- a/src/catalog/module-documents.json
+++ b/src/catalog/module-documents.json
@@ -16680,7 +16680,7 @@
"id": "grain",
"key": "GRAIN",
"name": "Grain",
- "version": "0.1.3-experimental",
+ "version": "0.2.0-experimental",
"category": "machines",
"access": {
"location": "The track's machine list (double-tap TRACK, or SRC SETUP)",
@@ -16718,7 +16718,8 @@
"DIR sets the share of grains that play backwards, from none to all; SCAN runs a read head through the sample, forwards or backwards.",
"POS moves in fine steps that speed up as you turn faster, and a pressed knob jumps by seven.",
"A waveform view with the POS line and the live grains on the SRC page, and a full-screen page for precise work.",
- "Everything is kept in the Part in values stock's own power-on check accepts, so a project is never lost with or without the module."
+ "Everything is kept in the Part in values stock's own power-on check accepts, so a project is never lost with or without the module.",
+ "EDGE chooses what happens when a grain reaches the start or end of the sample: CLMP, WRAP, STOP or BNCE."
],
"usage": [
"Double-tap a track key (or open SRC SETUP), choose GRAIN in the machine list and press YES, then pick a Flex sample.",
@@ -16803,35 +16804,50 @@
"RAND",
"SYNC"
]
+ },
+ {
+ "name": "EDGE",
+ "default": 0,
+ "count": 4,
+ "doc": "What happens at the start and end of the sample. CLMP: SPRY can't push a grain past an end, and a grain that runs off one end carries on from the other. WRAP: the sample is a loop, so a grain pushed or running off one end comes out of the other (as in 0.1.2). STOP: SPRY can't push a grain past an end, and a grain that reaches an end stops there. BNCE: SPRY can't push a grain past an end, and a grain that reaches an end plays back the other way. Turn several detents to change a value. SRC SETUP knob E.",
+ "labels": [
+ "CLMP",
+ "WRAP",
+ "STOP",
+ "BNCE"
+ ]
}
],
"compatibility": {
"firmware": "1.40C",
"effectId": null,
"location": "Track machine",
- "conflicts": [],
+ "conflicts": [
+ "poly8"
+ ],
"uiClaims": [],
"limitations": [
"Experimental. Earlier builds ran on an MKI and MKII. TESTING.md identifies the build and the remaining hardware checks.",
"The base reserves 35 CPU points per Grain track. With dense 24-bit stereo, 20-channel USB capture and musical MIDI, six-voice Grain still skipped renders on both tested tracks. A busy Part can refuse the first Grain track.",
"Up to six grains sound at once; with all six sounding, a grain that is due is not born.",
"A sample the module cannot read, or one that is still loading, plays silence. Changing the sample while a note plays stops it, as on a Flex track.",
- "POS locked on a trig takes whole numbers; the fine eighths are for turning the knob. A scene or an LFO moves POS smoothly between values.",
+ "POS locked on a trig keeps its eighths, in the spare lock byte stock uses for the sample slot's XVOL. A scene or an LFO moves POS smoothly between values.",
"SRC page: a waveform view with the POS line and the grains replaces the six knob dials. Hold SCENE A or B for stock's knobs.",
"A third press of PLAYBACK, from SRC SETUP, opens the full-screen page instead of going back to SRC; another press closes it. FUNC and PLAYBACK still open SRC SETUP.",
"A project opened without the module plays Grain tracks as FLEX at stock's defaults.",
- "After the sample pool was opened on a Grain track from a page other than SRC and closed, FUNC+SRC cannot pick FLEX or STATIC until the SRC page is shown or another track is selected. A double tap on the track key and LEFT changes the machine."
+ "After the sample pool was opened on a Grain track from a page other than SRC and closed, FUNC+SRC cannot pick FLEX or STATIC until the SRC page is shown or another track is selected. A double tap on the track key and LEFT changes the machine.",
+ "A project saved with 0.1.2 opens with EDGE on CLMP: a grain that SPRY threw past an edge is born on that edge instead of wrapping. EDGE on WRAP restores 0.1.2's sound, and STOP the sound of 0.1.0 and 0.1.1 without the click."
]
},
"resources": {
- "recorded": "2026-11-21",
+ "recorded": "2026-11-24",
"storage": {
"label": "Module image and memory",
- "display": "31,808 bytes of static runtime memory",
- "value": 31808,
+ "display": "33,012 bytes of static runtime memory",
+ "value": 33012,
"unit": "bytes",
"method": "static",
- "conditions": "Package f961b458 loads 28,944 bytes of code and data and declares 2,864 bytes of BSS. The deepest Grain-only audio path uses 768 stack bytes including return addresses and saved frame pointers (grain_render 176, gran_render 392, stereo_paged 92 and stereo_page 84 by GCC's stack-usage report, plus four return addresses and the frame pointers link.w saves). Stock calls, interrupt nesting and loader overhead are additional.",
+ "conditions": "Package e8d7c794 loads 30,148 bytes of code and data and declares 2,864 bytes of BSS. The deepest Grain-only audio path uses 780 stack bytes including return addresses and saved frame pointers (grain_render 168, gran_render 412, stereo_paged 92 and stereo_page 84 by GCC's stack-usage report, plus four return addresses and the frame pointers link.w saves). Stock calls, interrupt nesting and loader overhead are additional.",
"source": "TESTING.md"
},
"processing": {
@@ -16860,7 +16876,7 @@
"memory": {
"level": "minimal",
"basis": "source-estimate",
- "rationale": "The 30,308-byte package loads 28,944 bytes of code and data and reserves 2,864 bytes of zero-initialized state. It reads the existing Flex sample pages. Stack and loader overhead are additional.",
+ "rationale": "The 31,524-byte package loads 30,148 bytes of code and data and reserves 2,864 bytes of zero-initialized state. It reads the existing Flex sample pages. Stack and loader overhead are additional.",
"source": "TESTING.md"
}
},
@@ -16885,7 +16901,7 @@
},
"tests": {
"report": "TESTING.md",
- "summary": "0.1.2 package f961b458, on the author's MKI with the official base 6d23e888 and a card set of seven modules: the set loaded; PTCH, the edges, the pool and the audition behaved as described, and the clipping case played clean. Stock CPU meter, Grain on one track, 24-bit stereo, PTCH +24, DENS and SPRY at maximum, idle 49.5 %: 70-71 % with a 0.03 MB kick, 68-69 % with a 1.55 MB sample; the long sample at PTCH 0 read 66-67 %. No dropouts heard; skipped renders were not counted. Project saved, power cycled and reloaded with this exact package (f961b458): Grain, its settings and the sound came back as left. Historical, 0.1.1 and earlier: 0.1.1 package 1b3728c0 differs from the unit-tested build c841ea87 only by its meter cost (reserved[1]). On the MKII, c841ea87 kept Grain rendering with the pool open and took the plain Flex path only for a FUNC+YES audition, until the next trig. 0.1.0 package ff5ac017, card-free in RAM: Grain played T1, FLEX could be picked after a pool jump, and Grain kept its engine with the pool open on another track. Its audio path differs from the timed builds only by the pool check: with USB audio capture closed, six-voice Grain played T1 and T5 with no skipped renders and no frame over the deadline. A 240 BPM, 1,096 messages/s MIDI flood left nothing sounding after STOP. It was kept over USB beside other modules, restored after a power cycle and removed again (side-first build db843bc2). The optional twenty-channel USB layout still overruns. Listening, project reload and a full module set remain open.",
+ "summary": "The published package db1cb96a differs from the measured 520215cb only in the waveform view's display code. 0.2.0 final package 520215cb on the author's MKI: frame-cost curve 16.1 % first and 8.6 % each further instance; admitted on an empty pattern, refused on the medium one (105.3 %). The POS lock byte test (copy, paste, clear, Flex and Static with the lock kept, crossfader moved) showed no volume jump. The full scripted test procedure was not run. Earlier builds: 0.2.0 package e8d7c794, 0e4bebd4's engine on 0.1.3: the two loops that run for every sample compile to the same instructions as in 0.1.2, and the EDGE code runs only when a grain is born or reaches an edge. On the author's MKI, with the official base 6d23e888 and a card set of seven modules, an eight-tone sample showed the notes the host renders predict in CLMP, WRAP and BNCE (package 8a4555de), and STOP played as expected. A later build (0e4bebd4) loaded, played and passed the rest of the release checklist. Stock CPU meter, DENS and SPRY at maximum, PTCH +24, all four EDGE modes: 65 to 68 %, about 66 to 67 % on average. Not recorded: a unit run of the final package, the frame-cost curve for 0.2.0 and the MKII. Previous release, 0.1.2 package f961b458, on the author's MKI with the official base 6d23e888 and a card set of seven modules: the set loaded; PTCH, the edges, the pool and the audition behaved as described, and the clipping case played clean. Stock CPU meter, Grain on one track, 24-bit stereo, PTCH +24, DENS and SPRY at maximum, idle 49.5 %: 70-71 % with a 0.03 MB kick, 68-69 % with a 1.55 MB sample; the long sample at PTCH 0 read 66-67 %. No dropouts heard; skipped renders were not counted. Project saved, power cycled and reloaded with this exact package (f961b458): Grain, its settings and the sound came back as left. Historical, 0.1.1 and earlier: 0.1.1 package 1b3728c0 differs from the unit-tested build c841ea87 only by its meter cost (reserved[1]). On the MKII, c841ea87 kept Grain rendering with the pool open and took the plain Flex path only for a FUNC+YES audition, until the next trig. 0.1.0 package ff5ac017, card-free in RAM: Grain played T1, FLEX could be picked after a pool jump, and Grain kept its engine with the pool open on another track. Its audio path differs from the timed builds only by the pool check: with USB audio capture closed, six-voice Grain played T1 and T5 with no skipped renders and no frame over the deadline. A 240 BPM, 1,096 messages/s MIDI flood left nothing sounding after STOP. It was kept over USB beside other modules, restored after a power cycle and removed again (side-first build db843bc2). The optional twenty-channel USB layout still overruns. Listening, project reload and a full module set remain open.",
"hardwareStatus": "reported",
"evidenceRevision": "db1e077309f4c538a1b1b672960c345c22b07ead",
"gates": [
@@ -16899,7 +16915,7 @@
"Double-tap a track key, choose GRAIN in the machine list and press YES, then double-tap again and pick a Flex sample.",
"Put a trig on the track and play. Press SRC and turn POS: the grains move through the sample, and the waveform shows where. Turn SIZE down for a fine mist and up for long overlapping grains.",
"Turn SPRY up to scatter the grains around POS, and DENS up to thicken the cloud. Turn SCAN to let the read head run through the sample by itself.",
- "Press SRC twice for SRC SETUP: turn PAN for a spread across the stereo field, DIR for a share of backward grains, SHAP to change the grain window, and MODE to SYNC to lock the grains to the tempo.",
+ "Press SRC twice for SRC SETUP: turn PAN for a spread across the stereo field, DIR for a share of backward grains, SHAP to change the grain window, MODE to SYNC to lock the grains to the tempo, and EDGE to choose what happens when a grain reaches the start or end of the sample.",
"Press SRC once more from SRC SETUP for the full-screen page, with a larger waveform and every value beside its name, for precise settings.",
"Press SRC again to leave the full-screen page. Press STOP to stop playback."
]
@@ -16931,9 +16947,9 @@
"page": "Machine list (SRC SETUP)",
"shows": "location",
"firmware": "1.40C",
- "moduleVersion": "0.1.2-experimental",
+ "moduleVersion": "0.2.0-experimental",
"imageSha256": "6536f3ae90dc503e271e7b0cc32fa9950ffb1f836ce729ba760e64fbf9e532e8",
- "setup": "Captured from the headless emulator ot_emu in MKII mode, booted on a development twin of a Modwerk base built from this repository's main at 633ff3e9e (imageSha256 is that twin's MAIN image), with the Grain 0.1.2-experimental package built in the pinned toolchain installed through the development session. Each picture is the emulator's framebuffer read by the session's png step: 128x64 at integer scale 2 (256x128), converted to two grey levels in an 8-bit greyscale PNG, not edited otherwise. Track 1 on FLEX, the cursor moved down to GRAIN in the machine list. Not hardware captures."
+ "setup": "Captured from the headless emulator ot_emu in MKII mode, booted on a development twin of a Modwerk base built from this repository's main at 633ff3e9e (imageSha256 is that twin's MAIN image), with the Grain 0.2.0-experimental package built in the pinned toolchain installed through the development session. Each picture is the emulator's framebuffer read by the session's png step: 128x64 at integer scale 2 (256x128), converted to two grey levels in an 8-bit greyscale PNG, not edited otherwise. Track 1 on FLEX, the cursor moved down to GRAIN in the machine list. Not hardware captures."
}
},
{
@@ -16948,16 +16964,16 @@
"page": "SRC",
"shows": "controls",
"firmware": "1.40C",
- "moduleVersion": "0.1.2-experimental",
+ "moduleVersion": "0.2.0-experimental",
"imageSha256": "6536f3ae90dc503e271e7b0cc32fa9950ffb1f836ce729ba760e64fbf9e532e8",
- "setup": "Captured from the headless emulator ot_emu in MKII mode, booted on a development twin of a Modwerk base built from this repository's main at 633ff3e9e (imageSha256 is that twin's MAIN image), with the Grain 0.1.2-experimental package built in the pinned toolchain installed through the development session. Each picture is the emulator's framebuffer read by the session's png step: 128x64 at integer scale 2 (256x128), converted to two grey levels in an 8-bit greyscale PNG, not edited otherwise. Track 1 on Grain with a Flex sample, playing: the SRC page with a cloud of live grains. Settings: DENS 127, SPRY 50, SIZE 95, PAN 108 (85 %), POS 44.9, with a stereo sample made for the capture; the grains show as small squares, with a dark frame where they fall inside the waveform. Not hardware captures."
+ "setup": "Captured from the headless emulator ot_emu in MKII mode, booted on a development twin of a Modwerk base built from this repository's main at 633ff3e9e (imageSha256 is that twin's MAIN image), with the Grain 0.2.0-experimental package built in the pinned toolchain installed through the development session. Each picture is the emulator's framebuffer read by the session's png step: 128x64 at integer scale 2 (256x128), converted to two grey levels in an 8-bit greyscale PNG, not edited otherwise. Track 1 on Grain with a Flex sample, playing: the SRC page with a cloud of live grains. Settings: DENS 127, SPRY 50, SIZE 95, PAN 108 (85 %), POS 44.9, with a stereo sample made for the capture; the grains show as small squares, with a dark frame where they fall inside the waveform. Not hardware captures."
}
},
{
"path": "media/grain-src-setup.png",
"captureType": "emulator",
- "caption": "SRC SETUP (press SRC twice). SHAP: the grain's window, how soft or sharp each grain starts and ends. DIR: at 0 every grain plays forwards; as it rises, more and more grains play backwards, 64 is half and half, and at 127 all play backwards. PAN: random spread across the stereo field. MODE: RAND places grains at random times; SYNC locks them to the tempo, and DENS then picks the note division.",
- "alt": "Octatrack SRC SETUP page of a Grain track: GRAIN marked in the machine list, SHAP NORM, DIR and PAN dials, and MODE RAND.",
+ "caption": "SRC SETUP (press SRC twice). SHAP: the grain's window. DIR: the share of grains that play backwards, from none (0) to all (127). PAN: random spread across the stereo field. MODE: RAND places grains at random times; SYNC locks them to the tempo. EDGE: what grains do at the start and end of the sample.",
+ "alt": "Octatrack SRC SETUP page of a Grain track: GRAIN marked in the machine list, SHAP NORM, DIR and PAN dials, MODE RAND and EDGE CLMP.",
"credit": "A Force Truly Evil; underlying Octatrack UI by Elektron",
"license": "LicenseRef-OT-UI-Documentation",
"source": "original",
@@ -16965,9 +16981,9 @@
"page": "SRC SETUP",
"shows": "controls",
"firmware": "1.40C",
- "moduleVersion": "0.1.2-experimental",
+ "moduleVersion": "0.2.0-experimental",
"imageSha256": "6536f3ae90dc503e271e7b0cc32fa9950ffb1f836ce729ba760e64fbf9e532e8",
- "setup": "Captured from the headless emulator ot_emu in MKII mode, booted on a development twin of a Modwerk base built from this repository's main at 633ff3e9e (imageSha256 is that twin's MAIN image), with the Grain 0.1.2-experimental package built in the pinned toolchain installed through the development session. Each picture is the emulator's framebuffer read by the session's png step: 128x64 at integer scale 2 (256x128), converted to two grey levels in an 8-bit greyscale PNG, not edited otherwise. Track 1 on Grain with a Flex sample, at the defaults: SRC SETUP. Not hardware captures."
+ "setup": "Captured from the headless emulator ot_emu in MKII mode, booted on a development twin of a Modwerk base built from this repository's main at 633ff3e9e (imageSha256 is that twin's MAIN image), with the Grain 0.2.0-experimental package built in the pinned toolchain installed through the development session. Each picture is the emulator's framebuffer read by the session's png step: 128x64 at integer scale 2 (256x128), converted to two grey levels in an 8-bit greyscale PNG, not edited otherwise. Track 1 on Grain with a Flex sample, at the defaults: SRC SETUP, with EDGE on CLMP. Not hardware captures."
}
},
{
@@ -16982,9 +16998,9 @@
"page": "Full-screen page",
"shows": "controls",
"firmware": "1.40C",
- "moduleVersion": "0.1.2-experimental",
+ "moduleVersion": "0.2.0-experimental",
"imageSha256": "6536f3ae90dc503e271e7b0cc32fa9950ffb1f836ce729ba760e64fbf9e532e8",
- "setup": "Captured from the headless emulator ot_emu in MKII mode, booted on a development twin of a Modwerk base built from this repository's main at 633ff3e9e (imageSha256 is that twin's MAIN image), with the Grain 0.1.2-experimental package built in the pinned toolchain installed through the development session. Each picture is the emulator's framebuffer read by the session's png step: 128x64 at integer scale 2 (256x128), converted to two grey levels in an 8-bit greyscale PNG, not edited otherwise. Track 1 on Grain with a Flex sample, playing: the full-screen page with a cloud of live grains. Settings: DENS 127, SPRY 50, SIZE 95, PAN 108 (85 %), POS 44.9, with a stereo sample made for the capture; the grains show as small squares, with a dark frame where they fall inside the waveform. Not hardware captures."
+ "setup": "Captured from the headless emulator ot_emu in MKII mode, booted on a development twin of a Modwerk base built from this repository's main at 633ff3e9e (imageSha256 is that twin's MAIN image), with the Grain 0.2.0-experimental package built in the pinned toolchain installed through the development session. Each picture is the emulator's framebuffer read by the session's png step: 128x64 at integer scale 2 (256x128), converted to two grey levels in an 8-bit greyscale PNG, not edited otherwise. Track 1 on Grain with a Flex sample, playing: the full-screen page with a cloud of live grains. Settings: DENS 127, SPRY 50, SIZE 95, PAN 108 (85 %), POS 44.9, with a stereo sample made for the capture; the grains show as small squares, with a dark frame where they fall inside the waveform. Not hardware captures."
}
},
{
diff --git a/src/community/module-changelogs/grain.json b/src/community/module-changelogs/grain.json
index 41a47c6cea..149e22f581 100644
--- a/src/community/module-changelogs/grain.json
+++ b/src/community/module-changelogs/grain.json
@@ -1,4 +1,15 @@
[
+ {
+ "version": "0.2.0-experimental",
+ "date": "2026-11-24",
+ "changes": [
+ "New EDGE knob (SRC SETUP E) for the sample's ends: CLMP (default) keeps SPRY inside, WRAP loops as 0.1.2, STOP ends the grain without a click, BNCE plays it back.",
+ "Projects saved with 0.1.2 or 0.1.3 open in CLMP and can sound different near the sample's start and end; set EDGE to WRAP to restore their sound.",
+ "Recording a Grain track into a Flex buffer no longer overloads the audio (gaps and a click in the take), and a Grain track uses less processor time.",
+ "A POS lock on a trig now moves one unit per step of the knob, keeps its eighths, shows on screen and leaves the Part alone.",
+ "Grain and POLY8 can no longer be installed together."
+ ]
+ },
{
"version": "0.1.3-experimental",
"date": "2026-11-23",
diff --git a/src/engine/assets/octatrack-module-packages.json b/src/engine/assets/octatrack-module-packages.json
index 99bd90bb3f..3d6101ddb0 100644
--- a/src/engine/assets/octatrack-module-packages.json
+++ b/src/engine/assets/octatrack-module-packages.json
@@ -850,17 +850,17 @@
"unitName": "Grain",
"octabam": true,
"usbOnly": true,
- "version": "0.1.3-experimental",
- "path": "octatrack-modules/grain/0.1.3-experimental.mwrm",
+ "version": "0.2.0-experimental",
+ "path": "octatrack-modules/grain/0.2.0-experimental.mwrm",
"abi": 8,
- "features": 128,
- "sites": 0,
+ "features": 129,
+ "sites": 1,
"copies": 0,
"fills": 0,
"name": "Grain",
"module": "2c224021",
- "bytes": 30424,
- "sha256": "07b6e497b3513a7d9b1d32c278e26c0385d068e5d4a5dc2e1d96be04d916d865"
+ "bytes": 34170,
+ "sha256": "db1cb96a163450ce79cc9e361e4c41e94c431735d2df5d1139797cb4686cfe12"
},
{
"id": "seq",