mirror of
https://github.com/badvision/jace.git
synced 2024-12-02 20:49:49 +00:00
Better-sounding noise generator, Halls of Doom in Ultima 5 sounds much better
This commit is contained in:
parent
e01a3049c2
commit
72dc7b5318
@ -39,6 +39,7 @@ public class NoiseGenerator extends TimedGenerator {
|
|||||||
}
|
}
|
||||||
public static final int bit17 = 0x010000;
|
public static final int bit17 = 0x010000;
|
||||||
public void updateRng() {
|
public void updateRng() {
|
||||||
|
// noise = (noise >> 1) ^ ((noise & 1) ? 0x14000 : 0);
|
||||||
int newBit17 = (rng & 0x04) > 0 == (rng & 0x01) > 0 ? bit17 : 0;
|
int newBit17 = (rng & 0x04) > 0 == (rng & 0x01) > 0 ? bit17 : 0;
|
||||||
rng = newBit17 + (rng >> 1);
|
rng = newBit17 + (rng >> 1);
|
||||||
}
|
}
|
||||||
|
@ -207,6 +207,7 @@ public class PSG {
|
|||||||
/* Also, note that period = 0 is the same as period = 1. This is mentioned */
|
/* Also, note that period = 0 is the same as period = 1. This is mentioned */
|
||||||
/* in the YM2203 data sheets. However, this does NOT apply to the Envelope */
|
/* in the YM2203 data sheets. However, this does NOT apply to the Envelope */
|
||||||
/* period. In that case, period = 0 is half as period = 1. */
|
/* period. In that case, period = 0 is half as period = 1. */
|
||||||
|
value = value & 0x0ff;
|
||||||
switch (r) {
|
switch (r) {
|
||||||
case ACoarse:
|
case ACoarse:
|
||||||
case AFine:
|
case AFine:
|
||||||
@ -221,7 +222,8 @@ public class PSG {
|
|||||||
channels.get(2).setPeriod(getReg(Reg.CFine) + (getReg(Reg.CCoarse) << 8));
|
channels.get(2).setPeriod(getReg(Reg.CFine) + (getReg(Reg.CCoarse) << 8));
|
||||||
break;
|
break;
|
||||||
case NoisePeriod:
|
case NoisePeriod:
|
||||||
noiseGenerator.setPeriod(value);
|
if (value == 0) value = 32;
|
||||||
|
noiseGenerator.setPeriod(value+16);
|
||||||
noiseGenerator.counter = 0;
|
noiseGenerator.counter = 0;
|
||||||
break;
|
break;
|
||||||
case Enable:
|
case Enable:
|
||||||
|
Loading…
Reference in New Issue
Block a user