T6W28: fix noise emulation
thanks to Burnt Fishy and The Beesh-Spweesh! for information
This commit is contained in:
parent
3b37a5334a
commit
ee64dd6a16
|
@ -145,8 +145,8 @@ static const int noise_periods [3] = { 0x100, 0x200, 0x400 };
|
||||||
void T6W28_Noise::reset()
|
void T6W28_Noise::reset()
|
||||||
{
|
{
|
||||||
period = &noise_periods [0];
|
period = &noise_periods [0];
|
||||||
shifter = 0x4000;
|
shifter = 0xfffe;
|
||||||
tap = 13;
|
tap = 12;
|
||||||
period_extra = 0;
|
period_extra = 0;
|
||||||
T6W28_Osc::reset();
|
T6W28_Osc::reset();
|
||||||
}
|
}
|
||||||
|
@ -201,9 +201,13 @@ void T6W28_Noise::run( sms_time_t time, sms_time_t end_time )
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
int changed = (l_shifter + 1) & 2; // set if prev and next bits differ
|
int prev_l_shifter=l_shifter;
|
||||||
l_shifter = (((l_shifter << 14) ^ (l_shifter << tap)) & 0x4000) | (l_shifter >> 1);
|
if (tap==16) {
|
||||||
if ( changed )
|
l_shifter = ((l_shifter >> 14) & 1) | (l_shifter << 1);
|
||||||
|
} else {
|
||||||
|
l_shifter = ((((l_shifter >> 15)&1) ^ ((l_shifter >> 12)&1)) & 1) | (l_shifter << 1);
|
||||||
|
}
|
||||||
|
if ( (prev_l_shifter^l_shifter)&1 )
|
||||||
{
|
{
|
||||||
delta_left = -delta_left;
|
delta_left = -delta_left;
|
||||||
blip_add_delta( output_left, time, delta_left );
|
blip_add_delta( output_left, time, delta_left );
|
||||||
|
@ -370,8 +374,8 @@ void T6W28_Apu::write_data_right( sms_time_t time, int data )
|
||||||
noise.period = &noise.period_extra;
|
noise.period = &noise.period_extra;
|
||||||
|
|
||||||
int const tap_disabled = 16;
|
int const tap_disabled = 16;
|
||||||
noise.tap = (data & 0x04) ? 13 : tap_disabled;
|
noise.tap = (data & 0x04) ? 12 : tap_disabled;
|
||||||
noise.shifter = 0x4000;
|
noise.shifter = 0xfffe;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -146,7 +146,7 @@ const char* aboutLine[]={
|
||||||
_N("MAME µPD1771C-017 HLE core by David Viens"),
|
_N("MAME µPD1771C-017 HLE core by David Viens"),
|
||||||
_N("SAASound by Dave Hooper and Simon Owen"),
|
_N("SAASound by Dave Hooper and Simon Owen"),
|
||||||
_N("SameBoy by Lior Halphon"),
|
_N("SameBoy by Lior Halphon"),
|
||||||
_N("Mednafen PCE, WonderSwan, T6W28 and Virtual Boy audio cores"),
|
_N("Mednafen PCE, WonderSwan, T6W28 (modified) and Virtual Boy audio cores"),
|
||||||
_N("WonderSwan new core by asiekierka"),
|
_N("WonderSwan new core by asiekierka"),
|
||||||
_N("SNES DSP core by Blargg"),
|
_N("SNES DSP core by Blargg"),
|
||||||
_N("puNES (NES, MMC5 and FDS) by FHorse (modified version)"),
|
_N("puNES (NES, MMC5 and FDS) by FHorse (modified version)"),
|
||||||
|
|
|
@ -327,7 +327,7 @@ TAParamResult pVersion(String) {
|
||||||
printf("- SAASound by Dave Hooper and Simon Owen (BSD 3-clause)\n");
|
printf("- SAASound by Dave Hooper and Simon Owen (BSD 3-clause)\n");
|
||||||
printf("- SameBoy by Lior Halphon (MIT)\n");
|
printf("- SameBoy by Lior Halphon (MIT)\n");
|
||||||
printf("- Mednafen PCE, WonderSwan and Virtual Boy by Mednafen Team (GPLv2)\n");
|
printf("- Mednafen PCE, WonderSwan and Virtual Boy by Mednafen Team (GPLv2)\n");
|
||||||
printf("- Mednafen T6W28 by Blargg (GPLv2)\n");
|
printf("- Mednafen T6W28 (modified version) by Blargg (GPLv2)\n");
|
||||||
printf("- WonderSwan new core by asiekierka (zlib license)\n");
|
printf("- WonderSwan new core by asiekierka (zlib license)\n");
|
||||||
printf("- SNES DSP core by Blargg (LGPLv2.1)\n");
|
printf("- SNES DSP core by Blargg (LGPLv2.1)\n");
|
||||||
printf("- puNES (modified version) by FHorse (GPLv2)\n");
|
printf("- puNES (modified version) by FHorse (GPLv2)\n");
|
||||||
|
|
Loading…
Reference in a new issue