M articles/psg_sample.php +20 -23
@@ 58,41 58,38 @@
<p>One thing that this email fails to mention is that the volume control of the PSG operates on a logarithmic scale. Every 2 volume decrements cut the output volume in half. Because of this, you cannot just take the most significant 4 bits of an existing sample and send it to the PSG. Instead, you have to map the values to a logarithmic scale. The formula for this scale is:</p>
-<table class="spacycells">
-<tr>
-<th>Formula (MathML)</th>
-<th>Formula (non-MathML)</th>
-</tr>
-<tr>
-<td>
-<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+<figure>
+<math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow>
<mi>y</mi>
<mo>=</mo>
<msup>
<mn>2</mn>
<mrow>
+ <mphantom><mo mathsize="0">^</mo></mphantom>
<mo>-</mo>
- <mfenced>
- <mrow>
- <mfrac>
- <mrow>
- <mn>15</mn>
- <mo>−</mo>
- <mi>n</mi>
+ <mphantom><mo mathsize="0">(</mo></mphantom>
+ <mrow>
+ <mfrac>
+ <mrow>
+ <mphantom><mo mathsize="0">(</mo></mphantom>
+ <mn>15</mn>
+ <mo>−</mo>
+ <mi>n</mi>
+ <mphantom><mo mathsize="0">)</mo></mphantom>
+ </mrow>
+ <mrow>
+ <mphantom><mo mathsize="0">/</mo></mphantom>
+ <mn>2</mn>
</mrow>
- <mn>2</mn>
- </mfrac>
- </mrow>
- </mfenced>
+ </mfrac>
+ </mrow>
+ <mphantom><mo mathsize="0">)</mo></mphantom>
</mrow>
</msup>
</mrow>
</math>
-</td>
-<td>y = 2^-((15-n)/2)</td>
-</tr>
-</table>
+</figure>
<p>Where <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mi>n</mi></math> is the volume, a value from 0 … 15. There is one exception: 0. When the volume is zero, so is the output.</p>
M css/map.css +5 -0
@@ 29,6 29,11 @@ body {
padding: 0;
}
+math {
+ font-family: serif;
+ font-size: 18px;
+}
+
/* Header layout */
M resources/sound/yamaha_ym2164.php +8 -6
@@ 34,8 34,9 @@ on the OPP should be shifted right by 1
Since the specified period is negated, make sure to shift in a “1” into
the leftmost bit when you do so.</p>
+<figure>
<p>
- <math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow>
<msub>
<mi>T</mi>
@@ 45,7 46,7 @@ the leftmost bit when you do so.</p>
<mo>=</mo>
<mfrac>
<mrow>
- <mphantom><mo>(</mo></mphantom>
+ <mphantom mathsize="0"><mo>(</mo></mphantom>
<mn>2048</mn>
<mo>*</mo>
<mo>(</mo>
@@ 55,10 56,10 @@ the leftmost bit when you do so.</p>
<mi>CLKB</mi>
</mrow>
<mo>)</mo>
- <mphantom><mo>)</mo></mphantom>
+ <mphantom mathsize="0"><mo>)</mo></mphantom>
</mrow>
<mrow>
- <mphantom><mo>/</mo></mphantom>
+ <mphantom mathsize="0"><mo>/</mo></mphantom>
<mi>ϕM</mi>
</mrow>
</mfrac>
@@ 67,10 68,11 @@ the leftmost bit when you do so.</p>
</p>
<p>
- <math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
- <mi>ϕM</mi> <mo>=</mo> <mn>3579545</mn><mtext> Hz</mtext>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mi>ϕM</mi> <mo>=</mo> <mn>3579545</mn> <mo rspace="thickmathspace">⁢</mo><mi>Hz</mi>
</math>
</p>
+</figure>
<p>Lastly, the OPP has 8 undocumented registers at addresses 0-7. These
are initialised to 10H by the SFG-05 BIOS. Their function is as of yet