Overview
Comment: | Implement XStep and YStep instructions. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
a6d1d398e580929c5150e06a49ec425f |
User & Date: | user on 2022-02-13 19:32:54 |
Other Links: | manifest | tags |
Context
2022-02-14
| ||
08:01 | Several minor corrections to documentation. No code changes. check-in: 3a60ccaef6 user: user tags: trunk | |
2022-02-13
| ||
19:32 | Implement XStep and YStep instructions. check-in: a6d1d398e5 user: user tags: trunk | |
2022-02-12
| ||
00:59 | Fix connection moving so that HIT/HITBY during the second phase are sorted and that even if one fails, it will try all of them in order that shoving etc will be all or nothing. check-in: 28294a20b2 user: user tags: trunk | |
Changes
Modified class.doc from [72f1aea5b1] to [36fb7b963b].
︙ | |||
1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 | 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 | + + + + + + + + + + + + + + + + + + | XDir ( dir -- newx ) Finds the X coordinate of the cell in the specified direction. ,XDir ( obj dir -- newx ) Finds the X coordinate of the cell in the specified direction of the specified object. XStep ( dir -- result ) Will be -1 or 0 or +1 depending on the direction; this is the X step difference for the specified direction. If it is a relative direction, it is relative to the Self object. ,XStep ( obj dir -- result ) Similar to XStep but relative directions are relative to the specified object, instead of necessarily Self. XYDir ( dir -- newx newy ) Finds the X and Y coordinates of the cell in the given direction. YDir ( dir -- newy ) Finds the Y coordinate of the cell in the given direction. ,YDir ( obj dir -- newy ) Finds the Y coordinate of the cell in the specified direction of the specified object. YStep ( dir -- result ) Will be -1 or 0 or +1 depending on the direction; this is the Y step difference for the specified direction. If it is a relative direction, it is relative to the Self object. ,YStep ( obj dir -- result ) Similar to YStep but relative directions are relative to the specified object, instead of necessarily Self. === Block instructions === These are block flow controls. They include bodies of other instructions. and <body> then ( any -- any ) Takes a value from the stack. If it is false, leaves it there and skips the |
︙ |
Modified exec.c from [369c2612d9] to [1fd1cfcc25].
︙ | |||
3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 | 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 | + + + + | case OP_WEIGHT_EC: NoIgnore(); StackReq(2,0); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i!=VOIDLINK) objects[i]->weight=t1.u; break; case OP_WEIGHT_EC16: NoIgnore(); StackReq(2,0); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i!=VOIDLINK) objects[i]->weight=t1.u&0xFFFF; break; case OP_WINLEVEL: key_ignored=0; gameover=1; Throw(0); break; case OP_XDIR: StackReq(1,1); t1=Pop(); Numeric(t1); Push(NVALUE(o->x+x_delta[resolve_dir(obj,t1.u)])); break; case OP_XDIR_C: StackReq(2,1); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i==VOIDLINK) Push(NVALUE(0)); else Push(NVALUE(objects[i]->x+x_delta[resolve_dir(i,t1.u)])); break; case OP_XLOC: StackReq(0,1); Push(NVALUE(o->x)); break; case OP_XLOC_C: StackReq(1,1); Push(GetVariableOf(x,NVALUE)); break; case OP_XSTEP: StackReq(1,1); t1=Pop(); Numeric(t1); Push(NVALUE(x_delta[resolve_dir(obj,t1.u)])); break; case OP_XSTEP_C: StackReq(2,1); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i==VOIDLINK) Push(NVALUE(0)); else Push(NVALUE(x_delta[resolve_dir(i,t1.u)])); break; case OP_XYDIR: StackReq(1,2); t1=Pop(); Numeric(t1); i=resolve_dir(obj,t1.u); Push(NVALUE(o->x+x_delta[i])); Push(NVALUE(o->y+y_delta[i])); break; case OP_YDIR: StackReq(1,1); t1=Pop(); Numeric(t1); Push(NVALUE(o->y+y_delta[resolve_dir(obj,t1.u)])); break; case OP_YDIR_C: StackReq(2,1); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i==VOIDLINK) Push(NVALUE(0)); else Push(NVALUE(objects[i]->y+y_delta[resolve_dir(i,t1.u)])); break; case OP_YLOC: StackReq(0,1); Push(NVALUE(o->y)); break; case OP_YLOC_C: StackReq(1,1); Push(GetVariableOf(y,NVALUE)); break; case OP_YSTEP: StackReq(1,1); t1=Pop(); Numeric(t1); Push(NVALUE(y_delta[resolve_dir(obj,t1.u)])); break; case OP_YSTEP_C: StackReq(2,1); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i==VOIDLINK) Push(NVALUE(0)); else Push(NVALUE(y_delta[resolve_dir(i,t1.u)])); break; #define MiscVar(a,b) \ case a: StackReq(0,1); Push(o->b); break; \ case a+0x0800: StackReq(1,1); Push(GetVariableOf(b,)); break; \ case a+0x1000: NoIgnore(); StackReq(1,0); o->b=Pop(); break; \ case a+0x1001: NoIgnore(); StackReq(1,0); t1=Pop(); if(!t1.t) t1.u&=0xFFFF; o->b=t1; break; \ case a+0x1800: NoIgnore(); StackReq(2,0); t1=Pop(); i=v_object(Pop()); if(i!=VOIDLINK) objects[i]->b=t1; break; \ case a+0x1801: NoIgnore(); StackReq(2,0); t1=Pop(); if(!t1.t) t1.u&=0xFFFF; i=v_object(Pop()); if(i!=VOIDLINK) objects[i]->b=t1; break; |
︙ |
Modified instruc from [9a205534d1] to [67de8ba826].
︙ | |||
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 | 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | + + | ,Target Trace Trigger TriggerAt VolumeAt WinLevel ,XDir ,XStep XYDir ,YDir ,YStep ; Operations with marks mark "_" tmark in nin -mbegin |
︙ |
Modified instruc.h from [bdabcd4ee7] to [c6eaacfc4c].
︙ | |||
423 424 425 426 427 428 429 | 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 | + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - + + + - - - + + + | #define OP_TRACE 32979 #define OP_TRIGGER 32980 #define OP_TRIGGERAT 32981 #define OP_VOLUMEAT 32982 #define OP_WINLEVEL 32983 #define OP_XDIR 32984 #define OP_XDIR_C 35032 #define OP_XSTEP 32985 #define OP_XSTEP_C 35033 |
︙ | |||
542 543 544 545 546 547 548 | 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 | - + | {"CodePage",8683656}, {"CollisionLayers",8487036}, {"Coloc",8487074}, {"Compatible",8487035}, {"Connect",8487075}, {"Connection",8618104}, {"Control",8421514}, |
︙ | |||
564 565 566 567 568 569 570 | 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 | - + - + - + | {"Departed",8618091}, {"Departures",8618093}, {"Destroy",10584232}, {"Destroyed",8487033}, {"Dir",8618054}, {"Distance",9142346}, {"Done",8618103}, |
︙ | |||
658 659 660 661 662 663 664 | 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 | - - + + - + - + - + - - + + | {"ObjClassAt",8421570}, {"ObjDir",8487107}, {"ObjLayerAt",8421572}, {"ObjMovingTo",8421573}, {"ObjTopAt",8421574}, {"Order",8683657}, {"Others",8683666}, |
︙ | |||
727 728 729 730 731 732 733 | 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 | + - + - + + - + | {"VolumeAt",8421590}, {"W",9437188}, {"WAHOO",8389400}, {"WHACK",8389423}, {"Weight",9142352}, {"WinLevel",8421591}, {"XDir",8487128}, {"XStep",8487129}, |
︙ | |||
777 778 779 780 781 782 783 | 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 | - - - + + + - + - + - + - + - + - + - + | {"bit9",8423401}, {"bnot",8421418}, {"bor",8421416}, {"bxor",8421417}, {"c?",8421433}, {"case",8683542}, {"chain",8421536}, |