private void nes_set_chip_option(byte ChipID) { nes_state info = NESAPUData[ChipID]; byte CurOpt; if ((NesOptions & 0x8000) != 0) { return; } // switch (EMU_CORE) // { //# ifdef ENABLE_ALL_CORES // case EC_MAME: // // no options for MAME's NES core // break; //#endif // case EC_NSFPLAY: // shared APU/DMC options for (CurOpt = 0; CurOpt < 2; CurOpt++) { nes_apu.NES_APU_np_SetOption(info.chip_apu, CurOpt, (NesOptions >> CurOpt) & 0x01); nes_dmc.NES_DMC_np_SetOption(info.chip_dmc, CurOpt, (NesOptions >> CurOpt) & 0x01); } // APU-only options for (; CurOpt < 4; CurOpt++) { nes_apu.NES_APU_np_SetOption(info.chip_apu, CurOpt - 2 + 2, (NesOptions >> CurOpt) & 0x01); } // DMC-only options for (; CurOpt < 10; CurOpt++) { nes_dmc.NES_DMC_np_SetOption(info.chip_dmc, CurOpt - 4 + 2, (NesOptions >> CurOpt) & 0x01); } // break; // } if (info.chip_fds != null) { // FDS options // I skip the Cutoff frequency here, since it's not a boolean value. for (CurOpt = 12; CurOpt < 14; CurOpt++) { nes_fds.NES_FDS_SetOption(info.chip_fds, CurOpt - 12 + 1, (NesOptions >> CurOpt) & 0x01); } } return; }
public override void SetOption(int id, int val) { apu.NES_APU_np_SetOption(chip, id, val); }