public static void initial(byte[] mucompcmbin, enmFormat format) { uint samplingBuffer = 1024; MDSound.MDSound.Chip[] chips = new MDSound.MDSound.Chip[1]; MDSound.MDSound.Chip chip = null; chip = new MDSound.MDSound.Chip(); chip.type = MDSound.MDSound.enmInstrumentType.YM2608; chip.ID = 0; MDSound.ym2608 ym2608 = new MDSound.ym2608(); chip.Instrument = ym2608; chip.Update = ym2608.Update; chip.Start = ym2608.Start; chip.Stop = ym2608.Stop; chip.Reset = ym2608.Reset; chip.SamplingRate = format == enmFormat.VGM ? vgmSamplingRate : xgmSamplingRate; chip.Clock = 7987200; chip.Volume = 0; chip.Option = null; chips[0] = chip; mds = new MDSound.MDSound(format == enmFormat.VGM ? vgmSamplingRate : xgmSamplingRate, samplingBuffer, chips); mds.WriteYM2608(0, 0, 0x2d, 0x00); mds.WriteYM2608(0, 0, 0x29, 0x82); mds.WriteYM2608(0, 0, 0x07, 0x38); byte[] adpcmBuffer = mds.GetADPCMBufferYM2608(0); lstMucomPCMInfo = setPCMData(mucompcmbin, adpcmBuffer); }
private static void OPNAWrite(ChipDatum dat) { if (dat != null && dat.addtionalData != null) { MmlDatum md = (MmlDatum)dat.addtionalData; if (md.linePos != null) { Log.WriteLine(LogLevel.TRACE, string.Format("! r{0} c{1}" , md.linePos.row , md.linePos.col )); } } //Log.WriteLine(LogLevel.TRACE, string.Format("FM P{2} Out:Adr[{0:x02}] val[{1:x02}]", (int)dat.address, (int)dat.data,dat.port)); mds.WriteYM2608(0, (byte)dat.port, (byte)dat.address, (byte)dat.data); }
private static void OPNAWrite(Driver.OPNAData dat) { mds.WriteYM2608(0, dat.port, dat.address, dat.data); }