Overview
Comment: | Implement TraceStack and ,TraceStack instructions. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
189af944e7c2e6fd68c6799022c093ab |
User & Date: | user on 2022-03-22 02:14:35 |
Other Links: | manifest | tags |
Context
2022-03-23
| ||
00:46 | Some corrections of the logic of making up level tables from title strings containing data entry. check-in: 79b77f8924 user: user tags: trunk | |
2022-03-22
| ||
02:14 | Implement TraceStack and ,TraceStack instructions. check-in: 189af944e7 user: user tags: trunk | |
2022-03-09
| ||
05:01 | Correct the implementation of BroadcastAnd check-in: cb7aff32a7 user: user tags: trunk | |
Changes
Modified class.doc from [5667a2b6a0] to [8111c6bd50].
︙ | ︙ | |||
1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 | Otherwise, the value remains and true is added above it on the stack. Trace ( obj arg1 arg2 -- ) If tracing is enabled, sends the three values and some other information on stdout. If tracing is disabled, does nothing. This is intended to be used for debugging class codes. Trigger ( obj message -- ) ** Call a message for a pending trigger for the specified object immediately instead of waiting for its turn in the trigger phase. Only has an effect if the object does not have the Compatible flag. The message must be MOVED, DEPARTED, or ARRIVED; otherwise it is an error. If that trigger is pending, it will clear the trigger and send it like it does during the trigger phase, setting Arg1 as appropriate, but From is set to the object | > > > > > > > > | 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 | Otherwise, the value remains and true is added above it on the stack. Trace ( obj arg1 arg2 -- ) If tracing is enabled, sends the three values and some other information on stdout. If tracing is disabled, does nothing. This is intended to be used for debugging class codes. TraceStack ( -- ) If tracing is enabled, list the entire operand stack on stdout (including items below the current message frame, if any). Items are listed from top to bottom, each preceded by the index number. ,TraceStack ( count -- ) This is like TraceStack but is limited to specified count. Trigger ( obj message -- ) ** Call a message for a pending trigger for the specified object immediately instead of waiting for its turn in the trigger phase. Only has an effect if the object does not have the Compatible flag. The message must be MOVED, DEPARTED, or ARRIVED; otherwise it is an error. If that trigger is pending, it will clear the trigger and send it like it does during the trigger phase, setting Arg1 as appropriate, but From is set to the object |
︙ | ︙ |
Modified exec.c from [6470854eef] to [171c864429].
︙ | ︙ | |||
1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 | o=objects[t0.u]; printf(" [$%s %d %d]",classes[o->class]->name,o->x,o->y); } o=objects[obj]; printf(" : %u %u [$%s %d %d]",o->generation,obj,classes[o->class]->name,o->x,o->y); printf(" : %u %u : %u %u\n",t1.t,t1.u,t2.t,t2.u); } static void flush_object(Uint32 n) { Object*o=objects[n]; o->arrived=o->departed=0; o->oflags&=~(OF_MOVED|OF_BUSY|OF_USERSIGNAL|OF_MOVING); o->inertia=0; } | > > > > > > > > > > > > > > | 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 | o=objects[t0.u]; printf(" [$%s %d %d]",classes[o->class]->name,o->x,o->y); } o=objects[obj]; printf(" : %u %u [$%s %d %d]",o->generation,obj,classes[o->class]->name,o->x,o->y); printf(" : %u %u : %u %u\n",t1.t,t1.u,t2.t,t2.u); } static void trace_stack_list(int n) { int b; if(!main_options['t']) return; if(!traceprefix) { optionquery[1]=Q_tracePrefix; traceprefix=xrm_get_resource(resourcedb,optionquery,optionquery,2); if(!traceprefix) traceprefix=""; } b=vstackptr-n; if(b<0) b=0; n=vstackptr; while(n-->b) printf("%s<%d> : %u %u\n",traceprefix,n,vstack[n].t,vstack[n].u); } static void flush_object(Uint32 n) { Object*o=objects[n]; o->arrived=o->departed=0; o->oflags&=~(OF_MOVED|OF_BUSY|OF_USERSIGNAL|OF_MOVING); o->inertia=0; } |
︙ | ︙ | |||
3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 | case OP_TEMPERATURE_C: StackReq(1,1); Push(GetVariableOrAttributeOf(temperature,NVALUE)); break; case OP_TEMPERATURE_E: NoIgnore(); StackReq(1,0); t1=Pop(); Numeric(t1); o->temperature=t1.u; break; case OP_TEMPERATURE_E16: NoIgnore(); StackReq(1,0); t1=Pop(); Numeric(t1); o->temperature=t1.u&0xFFFF; break; case OP_TEMPERATURE_EC: NoIgnore(); StackReq(2,0); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i!=VOIDLINK) objects[i]->temperature=t1.u; break; case OP_TEMPERATURE_EC16: NoIgnore(); StackReq(2,0); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i!=VOIDLINK) objects[i]->temperature=t1.u&0xFFFF; break; case OP_TMARK: StackReq(1,2); t1=Pop(); if(t1.t==TY_MARK) { Push(NVALUE(0)); } else { Push(t1); Push(NVALUE(1)); } break; case OP_TRACE: StackReq(3,0); trace_stack(obj); break; case OP_TRIGGER: NoIgnore(); StackReq(2,0); t1=Pop(); i=v_object(Pop()); if(i!=VOIDLINK) v_trigger(obj,i,t1); break; case OP_TRIGGERAT: NoIgnore(); StackReq(3,0); t3=Pop(); t2=Pop(); Numeric(t2); t1=Pop(); Numeric(t1); v_trigger_at(obj,t1.u,t2.u,t3); break; case OP_TUCK: StackReq(2,3); t2=Pop(); t1=Pop(); Push(t2); Push(t1); Push(t2); break; case OP_UNIQ: StackReq(2,3); t1=Pop(); i=v_uniq(t1); if(i) Push(t1); Push(NVALUE(i)); break; case OP_USERSIGNAL: StackReq(0,1); if(o->oflags&OF_USERSIGNAL) Push(NVALUE(1)); else Push(NVALUE(0)); break; case OP_USERSIGNAL_C: StackReq(1,1); GetFlagOf(OF_USERSIGNAL); break; case OP_USERSIGNAL_E: NoIgnore(); StackReq(1,0); if(v_bool(Pop())) o->oflags|=OF_USERSIGNAL; else o->oflags&=~OF_USERSIGNAL; break; | > > | 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 | case OP_TEMPERATURE_C: StackReq(1,1); Push(GetVariableOrAttributeOf(temperature,NVALUE)); break; case OP_TEMPERATURE_E: NoIgnore(); StackReq(1,0); t1=Pop(); Numeric(t1); o->temperature=t1.u; break; case OP_TEMPERATURE_E16: NoIgnore(); StackReq(1,0); t1=Pop(); Numeric(t1); o->temperature=t1.u&0xFFFF; break; case OP_TEMPERATURE_EC: NoIgnore(); StackReq(2,0); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i!=VOIDLINK) objects[i]->temperature=t1.u; break; case OP_TEMPERATURE_EC16: NoIgnore(); StackReq(2,0); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i!=VOIDLINK) objects[i]->temperature=t1.u&0xFFFF; break; case OP_TMARK: StackReq(1,2); t1=Pop(); if(t1.t==TY_MARK) { Push(NVALUE(0)); } else { Push(t1); Push(NVALUE(1)); } break; case OP_TRACE: StackReq(3,0); trace_stack(obj); break; case OP_TRACESTACK: trace_stack_list(vstackptr); break; case OP_TRACESTACK_C: StackReq(1,0); t1=Pop(); Numeric(t1); trace_stack_list(t1.u); break; case OP_TRIGGER: NoIgnore(); StackReq(2,0); t1=Pop(); i=v_object(Pop()); if(i!=VOIDLINK) v_trigger(obj,i,t1); break; case OP_TRIGGERAT: NoIgnore(); StackReq(3,0); t3=Pop(); t2=Pop(); Numeric(t2); t1=Pop(); Numeric(t1); v_trigger_at(obj,t1.u,t2.u,t3); break; case OP_TUCK: StackReq(2,3); t2=Pop(); t1=Pop(); Push(t2); Push(t1); Push(t2); break; case OP_UNIQ: StackReq(2,3); t1=Pop(); i=v_uniq(t1); if(i) Push(t1); Push(NVALUE(i)); break; case OP_USERSIGNAL: StackReq(0,1); if(o->oflags&OF_USERSIGNAL) Push(NVALUE(1)); else Push(NVALUE(0)); break; case OP_USERSIGNAL_C: StackReq(1,1); GetFlagOf(OF_USERSIGNAL); break; case OP_USERSIGNAL_E: NoIgnore(); StackReq(1,0); if(v_bool(Pop())) o->oflags|=OF_USERSIGNAL; else o->oflags&=~OF_USERSIGNAL; break; |
︙ | ︙ |
Modified instruc from [becda5ce14] to [9080651e62].
︙ | ︙ | |||
281 282 283 284 285 286 287 288 289 290 291 292 293 294 | SetInventory Sound Sweep SweepEx Synchronize ,Target Trace Trigger TriggerAt VolumeAt WinLevel ,XDir ,XStep XYDir | > | 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 | SetInventory Sound Sweep SweepEx Synchronize ,Target Trace ,TraceStack Trigger TriggerAt VolumeAt WinLevel ,XDir ,XStep XYDir |
︙ | ︙ |
Modified instruc.h from [364162f345] to [67fc3e7eb1].
︙ | ︙ | |||
421 422 423 424 425 426 427 | #define OP_SOUND 32976 #define OP_SWEEP 32977 #define OP_SWEEPEX 32978 #define OP_SYNCHRONIZE 32979 #define OP_TARGET 32980 #define OP_TARGET_C 35028 #define OP_TRACE 32981 | > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 | #define OP_SOUND 32976 #define OP_SWEEP 32977 #define OP_SWEEPEX 32978 #define OP_SYNCHRONIZE 32979 #define OP_TARGET 32980 #define OP_TARGET_C 35028 #define OP_TRACE 32981 #define OP_TRACESTACK 32982 #define OP_TRACESTACK_C 35030 #define OP_TRIGGER 32983 #define OP_TRIGGERAT 32984 #define OP_VOLUMEAT 32985 #define OP_WINLEVEL 32986 #define OP_XDIR 32987 #define OP_XDIR_C 35035 #define OP_XSTEP 32988 #define OP_XSTEP_C 35036 #define OP_XYDIR 32989 #define OP_YDIR 32990 #define OP_YDIR_C 35038 #define OP_YSTEP 32991 #define OP_YSTEP_C 35039 #define OP_MARK 32992 #define OP_TMARK 32993 #define OP_IN 32994 #define OP_NIN 32995 #define OP_MBEGIN 32996 #define OP_FLIP 32997 #define OP_COUNT 32998 #define OP_CLEAR 32999 #define OP_UNIQ 33000 #define OP_ARRAY 33001 #define OP_GETARRAY 33002 #define OP_INITARRAY 33003 #define OP_SETARRAY 33004 #define OP_ARRAYCELL 33005 #define OP_ARRAYSLICE 33006 #define OP_COPYARRAY 33007 #define OP_DOTPRODUCT 33008 #define OP_PATTERN 33009 #define OP_PATTERN_C 35057 #define OP_PATTERN_E 37105 #define OP_PATTERN_EC 39153 #define OP_PATTERNS 33010 #define OP_PATTERNS_C 35058 #define OP_PATTERNS_E 37106 #define OP_PATTERNS_EC 39154 #define OP_ROOK 33011 #define OP_BISHOP 33012 #define OP_QUEEN 33013 #define OP_CUT 33014 #define OP_BIZARRO 33015 #define OP_BIZARRO_C 35063 #define OP_BIZARRO_E 37111 #define OP_BIZARRO_EC 39159 #define OP_BIZARROSWAP 33016 #define OP_BIZARROSWAP_D 41208 #define OP_SWAPWORLD 33017 #define OP_ABSTRACT 33018 #define OP_SUPER 33019 #define OP_SUPER_C 35067 #define OP_FUNCTION 33020 #define OP_LOCAL 33021 #define OP_LABEL 33022 #define OP_STRING 33023 #define OP_INT16 33024 #define OP_INT32 33025 #define OP_DISPATCH 33026 #define OP_USERFLAG 33027 #ifdef HEROMESH_CLASS static const Op_Names op_names[]={ {"*",8486943}, {"+",8421405}, {"+Move",10584252}, {"-",8421406}, {"-Move",10584253}, {"-rot",8421382}, {".",10518528}, {"/",8486944}, {"ANHH",8389394}, {"ARRIVED",8389124}, {"Abstract",8683770}, {"Animate",8552596}, {"AnimateDead",8552597}, {"Arg1",8552576}, {"Arg2",8552577}, {"Arg3",8552578}, {"Array",8683753}, {"ArrayCell",8421613}, {"ArraySlice",8421614}, {"Arrivals",8618092}, {"Arrived",8618090}, {"Assassinate",8487062}, {"B",9437196}, {"BANG",8389380}, {"BEDOINGNG",8389406}, {"BEEDEEP",8389404}, {"BEGIN_TURN",8389123}, {"BLOCKED",8389144}, {"BOOOM",8389410}, {"BOUNCE",8389415}, {"BRRREEET",8389396}, {"BRRRT",8389395}, {"BUZZER",8389420}, {"BWEEP",8389397}, {"Background",8683655}, {"Bishop",8683764}, {"Bizarro",8618231}, {"BizarroSwap",10518776}, {"Broadcast",10518679}, {"BroadcastAnd",8421528}, {"BroadcastAndEx",8421529}, {"BroadcastEx",10518683}, {"BroadcastList",8421532}, {"BroadcastListEx",8421533}, {"BroadcastSum",8421534}, |
︙ | ︙ | |||
550 551 552 553 554 555 556 | {"CodePage",8683656}, {"CollisionLayers",8487036}, {"Coloc",8487074}, {"Compatible",8487035}, {"Connect",8487075}, {"Connection",8618104}, {"Control",8421514}, | | | 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 | {"CodePage",8683656}, {"CollisionLayers",8487036}, {"Coloc",8487074}, {"Compatible",8487035}, {"Connect",8487075}, {"Connection",8618104}, {"Control",8421514}, {"CopyArray",8421615}, {"Create",10518692}, {"DEEP_POP",8389417}, {"DEPARTED",8389125}, {"DESTROY",8389122}, {"DESTROYED",8389136}, {"DINK",8389390}, {"DOOR",8389378}, |
︙ | ︙ | |||
572 573 574 575 576 577 578 | {"Departed",8618091}, {"Departures",8618093}, {"Destroy",10584232}, {"Destroyed",8487033}, {"Dir",8618054}, {"Distance",9142346}, {"Done",8618103}, | | | | | 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 615 616 617 618 619 620 621 | {"Departed",8618091}, {"Departures",8618093}, {"Destroy",10584232}, {"Destroyed",8487033}, {"Dir",8618054}, {"Distance",9142346}, {"Done",8618103}, {"DotProduct",8421616}, {"E",9437184}, {"END_TURN",8389139}, {"EditorHelp",8683665}, {"F",9437192}, {"FAROUT",8389421}, {"FFFFTT",8389399}, {"FLOATED",8389132}, {"FROG",8389383}, {"FakeMove",8487081}, {"FindConnection",8487082}, {"Finished",8552582}, {"FlushClass",8421547}, {"FlushObj",8487084}, {"From",8421503}, {"GLASS",8389379}, {"GLISSANT",8389419}, {"GetArray",8421610}, {"GetInventory",8421549}, {"HAWK",8389425}, {"HEARTBEAT",8389407}, {"HIT",8389134}, {"HITBY",8389135}, {"Hard",8618072}, {"Height",9142354}, {"HeightAt",8421550}, {"Help",8683664}, {"HitMe",8421551}, {"INIT",8389120}, {"IgnoreKey",8421552}, {"Image",8618055}, {"InPlace",8683662}, {"Inertia",9142344}, {"InitArray",8421611}, {"Input",8683660}, {"IntMove",10584241}, {"Invisible",8618095}, {"JAYAYAYNG",8389416}, {"JUMPED",8389128}, {"JumpTo",10584242}, {"KEWEL",8389422}, |
︙ | ︙ | |||
669 670 671 672 673 674 675 | {"ObjClassAt",8421572}, {"ObjDir",8487109}, {"ObjLayerAt",8421574}, {"ObjMovingTo",8421575}, {"ObjTopAt",8421576}, {"Order",8683657}, {"Others",8683666}, | | | | | | | | > | | | | | | | | | | | 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 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 | {"ObjClassAt",8421572}, {"ObjDir",8487109}, {"ObjLayerAt",8421574}, {"ObjMovingTo",8421575}, {"ObjTopAt",8421576}, {"Order",8683657}, {"Others",8683666}, {"P",8880369}, {"P*",8880370}, {"PLAYERMOVING",8389133}, {"POSTINIT",8389138}, {"POUR",8389377}, {"POWER",8389386}, {"Player",8487034}, {"PopUp",8421577}, {"Queen",8683765}, {"Quiz",8683661}, {"R",9437198}, {"RATCHET1",8389418}, {"RATCHET2",8389412}, {"RATTLE",8389403}, {"RB",9437197}, {"RF",9437199}, {"Rel",8487115}, {"Rook",8683763}, {"S",9437190}, {"SE",9437191}, {"SMALL_POP",8389389}, {"SPLASH",8389376}, {"STEAM",8389424}, {"STOP",8388608}, {"SUBS",8683667}, {"SUNK",8389131}, {"SW",9437189}, {"Seek",8487116}, {"Self",8421501}, {"Send",10584269}, {"SendEx",10584270}, {"SetArray",8421612}, {"SetInventory",8421583}, {"Shape",8618051}, {"ShapeDir",8618074}, {"Sharp",8618073}, {"Shovable",8618075}, {"Sound",8421584}, {"Stealthy",8618100}, {"Strength",9142358}, {"Super",8487163}, {"SwapWorld",8421625}, {"Sweep",8421585}, {"SweepEx",8421586}, {"Synchronize",8421587}, {"TAHTASHH",8389409}, {"THMP_thmp",8389405}, {"THWIT",8389384}, {"TICK",8389391}, {"Target",8487124}, {"Temperature",9142337}, {"Trace",8421589}, {"TraceStack",8487126}, {"Trigger",8421591}, {"TriggerAt",8421592}, {"UH_OH",8389382}, {"UNCORK",8389414}, {"UNHH",8389381}, {"UserSignal",8618097}, {"UserState",8618098}, {"VACUUM",8389411}, {"VisualOnly",8618099}, {"Volume",9142350}, {"VolumeAt",8421593}, {"W",9437188}, {"WAHOO",8389400}, {"WHACK",8389423}, {"Weight",9142352}, {"WinLevel",8421594}, {"XDir",8487131}, {"XStep",8487132}, {"XYDir",8421597}, {"Xloc",8486980}, {"YDir",8487134}, {"YEEHAW",8389401}, {"YStep",8487135}, {"Yloc",8486981}, {"_",8421600}, {"a?",8421439}, {"again",8683533}, {"and",8683544}, {"band",8421415}, {"begin",8683532}, {"bit",8683563}, {"bit0",8388609}, |
︙ | ︙ | |||
790 791 792 793 794 795 796 | {"bit9",8423401}, {"bnot",8421418}, {"bor",8421416}, {"bxor",8421417}, {"c?",8421433}, {"case",8683542}, {"chain",8421536}, | | | | | | | | | | | | 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 847 848 849 850 851 852 853 854 855 856 | {"bit9",8423401}, {"bnot",8421418}, {"bor",8421416}, {"bxor",8421417}, {"c?",8421433}, {"case",8683542}, {"chain",8421536}, {"clear",8421607}, {"count",8421606}, {"cut",8683766}, {"cz?",8421434}, {"dup",8421377}, {"else",8683530}, {"eq",8421424}, {"eq2",8421425}, {"exec",8486940}, {"flip",8421605}, {"for",8683537}, {"fork",8683545}, {"ge",8486965}, {"gt",8486963}, {"if",8683529}, {"in",8421602}, {"is",8421431}, {"land",8421420}, {"le",8486966}, {"link",8683547}, {"lnot",8421423}, {"lor",8421421}, {"lsh",8421413}, {"lt",8486964}, {"lxor",8421422}, {"m?",8421435}, {"max",8486948}, {"mbegin",8683748}, {"min",8486947}, {"mod",8486945}, {"n?",8421432}, {"ne",8421426}, {"neg",8421410}, {"next",8683538}, {"nin",8421603}, {"nip",8421379}, {"o?",8421437}, {"or",8683543}, {"over",8421384}, {"oz?",8421438}, {"pick",8421383}, {"repeat",8683536}, {"ret",8421397}, {"rot",8421381}, {"rsh",8486950}, {"rtn",8683546}, {"s?",8421436}, {"swap",8421378}, {"then",8683531}, {"tmark",8421601}, {"tuck",8421380}, {"uniq",8421608}, {"until",8683534}, {"while",8683535}, }; #define N_OP_NAMES 362 #endif |