public SPCDetermineDrawBoard() { InitializeComponent(); var secondY = (this.chartControl1.Diagram as DevExpress.XtraCharts.XYDiagram2D).GetAllAxesY()[1]; secondY.CustomLabels.Clear(); var commands = SPCCommand.GetCommandArray(); foreach (var command in commands) { secondY.CustomLabels.Add(new DevExpress.XtraCharts.CustomAxisLabel(command.Title, command.ID.ToString())); } }
public string Interpret(SPCCommand ssc) { string[] vars = new string[16]; switch (ssc.Opcode) { case 0xCD: case 0xCE: if (ssc.Type < 2) { vars[0] = Lists.Numerize(Lists.SoundNames[ssc.Param1], ssc.Param1, 3); } else { vars[0] = Lists.Numerize(Lists.BattleSoundNames[ssc.Param1], ssc.Param1, 3); } break; case 0xC6: case 0xC8: case 0xD1: case 0xD4: case 0xD9: case 0xDA: case 0xDB: case 0xDC: case 0xDD: case 0xE0: case 0xE2: case 0xE7: case 0xF6: vars[0] = ssc.Param1.ToString(); break; case 0xDE: vars[0] = Lists.Numerize(Lists.SampleNames[ssc.Param1], ssc.Param1, 3); break; case 0xDF: if (!Bits.GetBit(ssc.Param1, 4)) { vars[0] = (ssc.Param1 & 0x0F).ToString(); } else { vars[0] = (-((ssc.Param1 ^ 0x1F) + 1)).ToString(); } vars[1] = (ssc.Param2 >> 5).ToString(); break; case 0xCF: case 0xE3: case 0xEC: case 0xED: case 0xF2: vars[0] = ((sbyte)ssc.Param1).ToString(); break; case 0xE4: case 0xE5: vars[0] = ssc.Param1.ToString(); vars[1] = ((sbyte)ssc.Param2).ToString(); break; case 0xE8: case 0xE9: case 0xF0: case 0xF1: case 0xF4: vars[0] = ssc.Param1.ToString(); vars[1] = ssc.Param2.ToString(); if (ssc.Opcode == 0xF1) { vars[2] = ssc.Param3.ToString(); } break; case 0xFC: vars[0] = ssc.Param1.ToString(); vars[1] = ssc.Param2.ToString(); vars[2] = ssc.Param3.ToString(); break; default: if (ssc.Opcode < 0xC4) { return(new Note(ssc).ToString()); } break; } string command = SPCCommands[ssc.Opcode]; if (command == "") { command = "UNKSPCCMD {{" + BitConverter.ToString(ssc.CommandData) + "}}"; } return(string.Format(command, vars)); }