comparison scn2k/scn2k_impl.cc @ 6:2c890434e30f

Add call_no in global jumps
author thib
date Mon, 04 Aug 2008 16:22:51 +0000
parents 223b71206888
children 55b577e5f5b5
comparison
equal deleted inserted replaced
5:aa0577c1a494 6:2c890434e30f
532 } 532 }
533 } 533 }
534 if (cmd.cmd_type != CMD_OTHER) return; 534 if (cmd.cmd_type != CMD_OTHER) return;
535 if (cmd.cmd1 == 0 && cmd.cmd2 == 1) { 535 if (cmd.cmd1 == 0 && cmd.cmd2 == 1) {
536 if (cmd.cmd3 == 0x0b) { // global jump 536 if (cmd.cmd3 == 0x0b) { // global jump
537 int call_no = 0;
538 if (cmd.args.size() >= 2) call_no = cmd.args[1].value;
537 eprintf("global jump to %d\n",cmd.args[0].value); 539 eprintf("global jump to %d\n",cmd.args[0].value);
538 if (! ChangeScript(cmd.args[0].value, 0)) return; // 読み込めない; abort. 540 if (! ChangeScript(cmd.args[0].value, call_no)) return; // 読み込めない; abort.
539 cmd.clear(); 541 cmd.clear();
540 } else if (cmd.cmd3 == 0x0c || cmd.cmd3 == 0x12) { // call (0x12 の方は微妙) 542 } else if (cmd.cmd3 == 0x0c || cmd.cmd3 == 0x12) { // call (0x12 の方は微妙)
541 int new_scn = cmd.args[0].value; 543 int new_scn = cmd.args[0].value;
542 int new_pt = 0; 544 int new_pt = 0;
543 if (cmd.args.size() >= 1) { // subroutine number が付く 545 if (cmd.args.size() >= 1) { // subroutine number が付く