diff --git a/src/engine/platform/sound/t6w28/T6W28_Apu.cpp b/src/engine/platform/sound/t6w28/T6W28_Apu.cpp index 3f1c28fe1..49a26969d 100644 --- a/src/engine/platform/sound/t6w28/T6W28_Apu.cpp +++ b/src/engine/platform/sound/t6w28/T6W28_Apu.cpp @@ -145,8 +145,8 @@ static const int noise_periods [3] = { 0x100, 0x200, 0x400 }; void T6W28_Noise::reset() { period = &noise_periods [0]; - shifter = 0x4000; - tap = 13; + shifter = 0xfffe; + tap = 12; period_extra = 0; T6W28_Osc::reset(); } @@ -201,9 +201,13 @@ void T6W28_Noise::run( sms_time_t time, sms_time_t end_time ) do { - int changed = (l_shifter + 1) & 2; // set if prev and next bits differ - l_shifter = (((l_shifter << 14) ^ (l_shifter << tap)) & 0x4000) | (l_shifter >> 1); - if ( changed ) + int prev_l_shifter=l_shifter; + if (tap==16) { + 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; 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; int const tap_disabled = 16; - noise.tap = (data & 0x04) ? 13 : tap_disabled; - noise.shifter = 0x4000; + noise.tap = (data & 0x04) ? 12 : tap_disabled; + noise.shifter = 0xfffe; } } diff --git a/src/gui/about.cpp b/src/gui/about.cpp index 52766a864..b0e03cc01 100644 --- a/src/gui/about.cpp +++ b/src/gui/about.cpp @@ -146,7 +146,7 @@ const char* aboutLine[]={ _N("MAME µPD1771C-017 HLE core by David Viens"), _N("SAASound by Dave Hooper and Simon Owen"), _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("SNES DSP core by Blargg"), _N("puNES (NES, MMC5 and FDS) by FHorse (modified version)"), diff --git a/src/main.cpp b/src/main.cpp index 679b22698..1e3450a87 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -327,7 +327,7 @@ TAParamResult pVersion(String) { printf("- SAASound by Dave Hooper and Simon Owen (BSD 3-clause)\n"); printf("- SameBoy by Lior Halphon (MIT)\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("- SNES DSP core by Blargg (LGPLv2.1)\n"); printf("- puNES (modified version) by FHorse (GPLv2)\n");