Commit 682eef2
Use the actual MOS envelope volume formula
att = (127 - amp) >> 3 — sixteen 8-wide BBC-amp cells mapped to the
SN76489's 4-bit attenuation. Reproduces env1's trace exactly: AD=-10 from
amp 121 produces atts 0, 2, 3, 4, 5, 7, 8, 9, 10, 12, 13, 14, 15 with
skips at 1, 6, 11 — caused by the per-tick step crossing 8-wide cell
boundaries unevenly, not by any non-linear lookup table.
The `setChannelXVolume` MOS routine I was reading earlier is the static-
amp path (BASIC SOUND with negative amplitude); envelope playback uses
this simpler formula. Source: jsbeeb-mcp trace agent's debug notes.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 653b0c3 commit 682eef2
1 file changed
Lines changed: 14 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
97 | | - | |
| 96 | + | |
| 97 | + | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
109 | 108 | | |
110 | 109 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
115 | 113 | | |
116 | | - | |
| 114 | + | |
117 | 115 | | |
118 | 116 | | |
119 | 117 | | |
| |||
0 commit comments