public static void Update(NesState aNesState, MidiSynthesizer aSynthesizer) //public static void Update( NesState aNesState, CoreSynthesizer[] aSynthesizer ) { aNesState.apuRegister.REG4002 = ( UInt16 )(aNesState.memory.GetDataWord(0x4002) & 0x07FF); aNesState.apuRegister.REG4006 = ( UInt16 )(aNesState.memory.GetDataWord(0x4006) & 0x07FF); aNesState.apuRegister.REG400a = ( UInt16 )(aNesState.memory.GetDataWord(0x400a) & 0x07FF); // ???`?g1???????? if (aNesState.memory.IsWrite(0x4002) == true || aNesState.memory.IsWrite(0x4003) == true) { StartCannelSquare(aSynthesizer, aNesState.apuRegister.REG4002, 0x00); } // ???`?g2???????? if (aNesState.memory.IsWrite(0x4006) == true || aNesState.memory.IsWrite(0x4007) == true) { StartCannelSquare(aSynthesizer, aNesState.apuRegister.REG4006, 0x01); } // ?O?p?g???????? if (aNesState.memory.IsWrite(0x400a) == true || aNesState.memory.IsWrite(0x400b) == true) { StartCannelTryangle(aSynthesizer, aNesState.apuRegister.REG400a, 0x02); } }
public PlayerNsf(string aFilePath) { MusicNsf lMusic = ( MusicNsf )LoaderMusic.Load(aFilePath); Logger.LogNormal("Load"); midiSynthesizer = new MidiSynthesizer(); midiSynthesizer.SetVolume(( UInt16 )0x4000); midiSynthesizer.MonoModeOn(1); nesState = new NesState(lMusic); NesCpu.InitNsf(nesState); float lVolume = ( float )(40.0d * Math.Log10(0.5f)); volume = ( float )Math.Pow(10.0d, lVolume / 20.0d); Init(); }