private void OneLineDisassembler() { int i; if (this.ASMTextBox.Text.Length < 8) {//命令は最低でも8バイトでないとダメ. for (i = this.ASMTextBox.Text.Length; i < 8; i++) { this.ASMTextBox.Text += "0"; } } //文字列からバイト列に byte[] selectedByteData = U.convertStringDumpToByte(this.ASMTextBox.Text); if (selectedByteData.Length < 4) { return; } string hint = this.ScriptCodeName.Text; //バイト列をイベント命令としてDisassembler. EventScript.OneCode code = Program.ProcsScript.DisAseemble(selectedByteData, 0, hint); //命令を選択. this.ScriptCodeName.Text = EventScript.makeCommandComboText(code.Script, false); //引数 int n = 0; for (i = 0; i < 2; i++, n++) { if (n >= code.Script.Args.Length) { break; } EventScript.Arg arg = code.Script.Args[n]; uint v = EventScript.GetArgValue(code, arg); if (EventScript.IsFixedArg(arg)) {//固定長になっているところは入力できないようにする. i--; continue; } EventScriptForm.SetOneScriptEditSetTables(ScriptEditSetTables[i], arg, v); } for (; i < 2; i++) { //使わないパラメータはあっかりーんする EventScriptForm.HideOneScriptEditSetTables(ScriptEditSetTables[i]); } int y = ShowFloatingControlpanelInner(code, this.Script.SelectedIndex); ControlPanel.Location = new Point(ControlPanel.Location.X, y); }
public static uint GetScriptLabelID(EventScript.OneCode code) { for (int i = 0; i < code.Script.Args.Length; i++) { EventScript.Arg arg = code.Script.Args[i]; if (arg.Type == EventScript.ArgType.LABEL_CONDITIONAL) { uint v = EventScript.GetArgValue(code, arg); return(v); } } return(U.NOT_FOUND); }
static uint GetScriptConditionalID(EventScript.OneCode code) { for (int i = 0; i < code.Script.Args.Length; i++) { EventScript.Arg arg = code.Script.Args[i]; if (arg.Type == EventScript.ArgType.IF_CONDITIONAL || arg.Type == EventScript.ArgType.GOTO_CONDITIONAL) { uint v = EventScript.GetArgValue(code, arg); return(v); } } return(U.NOT_FOUND); }
static uint GetScriptSomeLabel(EventScript.OneCode code) { if (code.Script.Has == EventScript.ScriptHas.LABEL_CONDITIONAL || code.Script.Has == EventScript.ScriptHas.IF_CONDITIONAL || code.Script.Has == EventScript.ScriptHas.GOTO_CONDITIONAL ) { for (int i = 0; i < code.Script.Args.Length; i++) { EventScript.Arg arg = code.Script.Args[i]; if (arg.Type == EventScript.ArgType.LABEL_CONDITIONAL || arg.Type == EventScript.ArgType.IF_CONDITIONAL || arg.Type == EventScript.ArgType.GOTO_CONDITIONAL ) { uint v = EventScript.GetArgValue(code, arg); return(v); } } } return(U.NOT_FOUND); }