public YM3812ChannelStats GetChannelStats(int ChannelID) { ChanelLimiter(ref ChannelID); YM3812ChannelStats result = Channels[ChannelID]; result.Block = Block(ChannelID); result.KeyOn = KeyOn(ChannelID); result.Connection = Connection(ChannelID); result.Feedback = Feedback(ChannelID); result.FNumber = FNumber(ChannelID); result.Freq = Freq(ChannelID); result.OPR1 = GetOperatorStats(result.OPR1.OperatorID); result.OPR2 = GetOperatorStats(result.OPR2.OperatorID); return(result); }
public YM3812() { for (int i = 1; i < 19; i++) { Operators[i] = new YM3812OperatorStats(); Operators[i].OperatorID = i; } for (int i = 0; i < 9; i++) { Channels[i] = new YM3812ChannelStats(); Channels[i].ChannelID = i; Channels[i].OPR1 = Operators[GetOPR1ID(i)]; Channels[i].OPR2 = Operators[GetOPR2ID(i)]; } }
static void DrawChannelStat(YM3812ChannelStats cs) { int hp = 20 * cs.ChannelID + 15; Console.SetCursorPosition(hp, 1); Console.Write(cs.ChannelID); Console.SetCursorPosition(hp, 2); Console.Write(cs.Freq.ToString("0000.00")); Console.SetCursorPosition(hp, 3); Console.Write(Tools.FrequencyToNote(cs.Freq)); Console.SetCursorPosition(hp, 4); Console.Write(cs.KeyOn ? "On" : " "); Console.SetCursorPosition(hp, 6); Console.Write(cs.Connection == 0 ? "FM" : " "); Console.SetCursorPosition(hp, 7); Console.Write(cs.Feedback); DrawOPStat(cs.OPR1, hp, 9); DrawOPStat(cs.OPR2, hp + 10, 9); }