Overview
Comment: | Add a Replace instruction. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
1190f331f1318b4fbe3ef7d9a786efe4 |
User & Date: | user on 2022-08-17 06:54:47 |
Other Links: | manifest | tags |
Context
2022-08-17
| ||
07:06 | Implement retz and retnz instruction check-in: 30f75aecc8 user: user tags: trunk | |
06:54 | Add a Replace instruction. check-in: 1190f331f1 user: user tags: trunk | |
01:15 | Implement hue/shade filter in dependent pictures. check-in: 0aa4ff0fdf user: user tags: trunk | |
Changes
Modified class.doc from [8be8c0732b] to [9478fd2ce1].
︙ | |||
1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 | 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 | + + + + + + + + | Resolves a relative direction to an absolute direction. ,Rel ( obj dir -- dir ) Resolves a relative direction to an absolute direction, using the direction of the specified object as the base. If zero is specified instead of a valid object, then the result is the same as the input. Replace ( class x y image dir -- obj ) ** Similar to Create, except that it also destroys any objects in the target location with any matching CollisionLayers bits, and clears the Bizarro flag of the created object. You may also specify an object instead of a class; in this case, it moves that object, but otherwise acts like above. In the case of an existing object, it will update the Image and Dir (which can now be relative) if the movement is successful. ret ( -- ) Exit the current subroutine. If this is a message block, it must either leave the stack as it is, or leave it but with one extra value pushed which will be the return value from the message call. (This is implied at the end of a code block.) For a user defined function call, or a subroutine call, these restrictions are not applicable. |
︙ |
Modified exec.c from [70a50aa204] to [2484f1b5a0].
︙ | |||
1728 1729 1730 1731 1732 1733 1734 | 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 | + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | if(c.t!=TY_CLASS && (c.t!=TY_NUMBER || c.u)) Throw("Type mismatch"); return NVALUE(broadcast(from,c.u,msg.u,arg1,arg2,arg3,s)); } static inline Value v_create(Uint32 from,Value cl,Value x,Value y,Value im,Value d) { Uint32 n; if(!cl.t && !cl.u) return NVALUE(0); if(cl.t!=TY_CLASS || x.t || y.t || im.t || d.t) Throw("Type mismatch"); n=create(from,cl.u,x.u,y.u,im.u,d.u); return OVALUE(n); } static inline Value v_replace(Uint32 from,Value cl,Value x,Value y,Value im,Value d) { Uint8 c; Uint32 n; Object*o; if(!cl.t && !cl.u) return NVALUE(0); |
︙ | |||
3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 | 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 | + + | case OP_QN: StackReq(1,1); t1=Pop(); NotSound(t1); if(t1.t==TY_NUMBER) Push(NVALUE(1)); else Push(NVALUE(0)); break; case OP_QO: StackReq(1,1); t1=Pop(); NotSound(t1); if(t1.t>TY_MAXTYPE) Push(NVALUE(1)); else Push(NVALUE(0)); break; case OP_QOZ: StackReq(1,1); t1=Pop(); NotSound(t1); if(t1.t>TY_MAXTYPE || (t1.t==TY_NUMBER && !t1.u)) Push(NVALUE(1)); else Push(NVALUE(0)); break; case OP_QS: StackReq(1,1); t1=Pop(); NotSound(t1); if(t1.t==TY_STRING || t1.t==TY_LEVELSTRING) Push(NVALUE(1)); else Push(NVALUE(0)); break; case OP_QUEEN: StackReq(0,1); Numeric(msgvars.arg1); i="\x06\x01\x07\x05\x03\x04\x02\x00"[msgvars.arg1.u&7]; Push(NVALUE(i)); break; case OP_REL: StackReq(1,1); t1=Pop(); Numeric(t1); i=resolve_dir(obj,t1.u); Push(NVALUE(i)); break; case OP_REL_C: StackReq(2,1); t2=Pop(); Numeric(t2); t1=Pop(); i=v_object(t1); i=(i==VOIDLINK?t2.u:resolve_dir(i,t2.u)); Push(NVALUE(i)); break; case OP_REPLACE: NoIgnore(); StackReq(5,1); t5=Pop(); t4=Pop(); t3=Pop(); t2=Pop(); t1=Pop(); Push(v_replace(obj,t1,t2,t3,t4,t5)); break; case OP_REPLACE_D: NoIgnore(); StackReq(5,0); t5=Pop(); t4=Pop(); t3=Pop(); t2=Pop(); t1=Pop(); v_replace(obj,t1,t2,t3,t4,t5); break; case OP_RET: return; case OP_ROT: StackReq(3,3); t3=Pop(); t2=Pop(); t1=Pop(); Push(t2); Push(t3); Push(t1); break; case OP_ROTBACK: StackReq(3,3); t3=Pop(); t2=Pop(); t1=Pop(); Push(t3); Push(t1); Push(t2); break; case OP_RSH: StackReq(2,1); t2=Pop(); Numeric(t2); t1=Pop(); Numeric(t1); Push(NVALUE(t2.u&~31?0:t1.u>>t2.u)); break; case OP_RSH_C: StackReq(2,1); t2=Pop(); Numeric(t2); t1=Pop(); Numeric(t1); Push(NVALUE(t2.u&~31?(t1.s<0?-1:0):t1.s>>t2.u)); break; case OP_SEEK: StackReq(1,1); t1=Pop(); i=obj_seek(obj,v_object(t1)); Push(NVALUE(i)); break; case OP_SEEK_C: StackReq(2,1); t2=Pop(); t1=Pop(); i=obj_seek(v_object(t1),v_object(t2)); Push(NVALUE(i)); break; |
︙ |
Modified instruc from [b6ee0a25e7] to [2ef3b5d8bc].
︙ | |||
274 275 276 277 278 279 280 281 282 283 284 285 286 287 | 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 | + | ,ObjDir ObjLayerAt ObjMovingTo ObjTopAt PopUp *PopUpArgs ; for (PopUp [number]) ,Rel .Replace ,Seek .,Send .,SendEx ; send with three arguments SetInventory Sound Sweep SweepEx |
︙ |
Modified instruc.h from [191c31ad7e] to [601dd2e738].
︙ | |||
410 411 412 413 414 415 416 | 410 411 412 413 414 415 416 417 418 419 420 421 422 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 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 | + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - + + + - - - + + + | #define OP_OBJLAYERAT 32969 #define OP_OBJMOVINGTO 32970 #define OP_OBJTOPAT 32971 #define OP_POPUP 32972 #define OP_POPUPARGS 32973 #define OP_REL 32974 #define OP_REL_C 35022 #define OP_REPLACE 32975 #define OP_REPLACE_D 41167 |
︙ | |||
566 567 568 569 570 571 572 | 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 | - + | {"CodePage",8683658}, {"CollisionLayers",8487037}, {"Coloc",8487077}, {"Compatible",8487036}, {"Connect",8487078}, {"Connection",8618105}, {"Control",8421516}, |
︙ | |||
589 590 591 592 593 594 595 | 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 | - + - + - + | {"Departed",8618092}, {"Departures",8618094}, {"Destroy",10584235}, {"Destroyed",8487034}, {"Dir",8618055}, {"Distance",9142347}, {"Done",8618104}, |
︙ | |||
687 688 689 690 691 692 693 | 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 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 | - - + + - + + - + - + - - - - + + + + - + - - - - - + + + + + - + - - - - + + + + - + - + - - - - + + + + - + - + - + | {"ObjClassAt",8421575}, {"ObjDir",8487112}, {"ObjLayerAt",8421577}, {"ObjMovingTo",8421578}, {"ObjTopAt",8421579}, {"Order",8683659}, {"Others",8683669}, |
︙ | |||
810 811 812 813 814 815 816 | 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 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 | - - - + + + - + - + - + - + - + - + - + | {"bit9",8423401}, {"bnot",8421419}, {"bor",8421417}, {"bxor",8421418}, {"c?",8421434}, {"case",8683542}, {"chain",8421539}, |