public override void Write(int _fullAddress, byte _val, bool _internal) { byte xval = Read(_fullAddress, true); base.Write(_fullAddress, _val, _internal); int ofs = _fullAddress - BaseAddress; ofs %= 32; _fullAddress = BaseAddress + ofs; // voices if ((ofs >= 0) && (ofs < 21)) { int currVoice = 0; if (ofs >= 7) { currVoice = 1; } if (ofs >= 14) { currVoice = 2; } SIDVoice v = GetVoice(currVoice); v.Write(_fullAddress - BaseAddress, _val); } switch (_fullAddress) { case 0xd417: { FilterSettings = GetFilterSettings(); break; } case 0xd418: { FilterSettings = GetFilterSettings(); SetSIDVolume(FilterSettings.Volume); SIDVoice v = GetVoice(2); v.Mute = FilterSettings.Voice3Muted; break; } } }
public SIDChip_FilterSettings GetFilterSettings() { SIDChip_FilterSettings filter = new SIDChip_FilterSettings(); filter.Resonance = (Read(0xd417, true) & 0x0f) / 15.0f; filter.Voice1FilterEnabled = ((Read(0xd417, true) & BIT.B1) > 0); filter.Voice2FilterEnabled = ((Read(0xd417, true) & BIT.B2) > 0); filter.Voice3FilterEnabled = ((Read(0xd417, true) & BIT.B3) > 0); filter.Volume = (Read(0xd418, true) & 0x0f) / 15.0f; filter.HighpassEnabled = ((Read(0xd418, true) & 64) > 0); filter.BandpassEnabled = ((Read(0xd418, true) & 32) > 0); filter.LowpassEnabled = ((Read(0xd418, true) & 16) > 0); filter.Voice3Muted = ((Read(0xd418, true) & 128) > 0); return(filter); }