# HG changeset patch # User thib # Date 1218469961 0 # Node ID 38226842bac8ddc68c9a1f53cd9c420d7a3c60e3 # Parent 8da1d92ac8f870b21dd796ad5866e02695de7c77 Fixed new_pt in global calls diff --git a/scn2k/scn2k_impl.cc b/scn2k/scn2k_impl.cc --- a/scn2k/scn2k_impl.cc +++ b/scn2k/scn2k_impl.cc @@ -535,14 +535,14 @@ void Scn2k::SysExec(Cmd& cmd) { if (cmd.cmd1 == 0 && cmd.cmd2 == 1) { if (cmd.cmd3 == 0x0b) { // global jump int call_no = 0; - if (cmd.args.size() >= 2) call_no = cmd.args[1].value; + if (cmd.args.size() >= 2) call_no = cmd.args[1].value; eprintf("global jump to %d\n",cmd.args[0].value); if (! ChangeScript(cmd.args[0].value, call_no)) return; // 読み込めない; abort. cmd.clear(); } else if (cmd.cmd3 == 0x0c || cmd.cmd3 == 0x12) { // call (0x12 の方は微妙) int new_scn = cmd.args[0].value; int new_pt = 0; - if (cmd.args.size() >= 1) { // subroutine number が付く + if (cmd.args.size() >= 2) { // subroutine number が付く // 引数が付くのもあるらしい new_pt = cmd.args[1].value; }