Overview
Comment: | Implement three new instructions: HitMe Sweep SweepEx |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
a9bed7792c92ada3dac9233f64e2b2f1 |
User & Date: | user on 2021-10-07 05:51:30 |
Other Links: | manifest | tags |
Context
2021-10-08
| ||
02:27 | Begin implementation of (Order) block (currently incomplete and doesn't work). check-in: a50cf8eac3 user: user tags: trunk | |
2021-10-07
| ||
05:51 | Implement three new instructions: HitMe Sweep SweepEx check-in: a9bed7792c user: user tags: trunk | |
05:50 | Add a FAQ entry relating to MIME types. check-in: 6f7620efc8 user: user tags: trunk | |
Changes
Modified class.doc from [8288aabc43] to [4e7a27a3af].
︙ | |||
1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 | 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 | + + + + + + + + + + | ,gt ( in1 in2 -- bool ) Test if first input is greater than second input (signed). HeightAt ( x y -- height ) Finds the greatest height among objects at the specified location. HitMe ( dir -- bool ) ** Checks hardness/sharpness and shoving like is done by Move, subject to From and Arg3. The direction is a direction relative to From, not to Self. The result is 1 if shoving or sharpness is successful, or 0 otherwise. This will update Arg3,including at least setting the low three bits; the new value of Arg3 may then be used as the return value from HITBY. It is intended that this instruction is used inside of a HITBY block, in case you want to do some of your own processing. The Comaptible and VisualOnly flags of this object are not checked. IgnoreKey ( -- ) There is no effect outside of the input phase. During the input phase, indicates that this input is not part of the solution, so it will not be entered into the replay. It is an error to ignore inputs which do cause state changes. Pop-up messages are still allowed, and unlike in EKS Hero Mesh they will not break replayability; the key to dismiss a non-quiz popup is not entered into the replay list, and the key to |
︙ | |||
1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 | 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 | + + + + + + + + + + + + + | Same as Super but return to this code after it is finished. swap ( x y -- y x ) SwapWorld ( -- ) ** Exchange the entire game with the bizarro world. Sometimes, this might fail due to CollisionLayers bits; in this case, it is an error. Sweep ( xstart ystart xend yend order msg arg1 arg2 -- ) Send a message to all objects in the specified rectangle, given its corners. The coordinates are treated as signed, so you can safely make a surrounding rectangle with a specified radius if wanted. If all of the coordinates are out of range and not on opposite sides of the playfield, no messages are sent. The order of sending the messages is starting at the start coordinates and ending at the end cordinates, regardless of which are greater than the others; if the order is true then it does vertical movement first and if false then horizontal movement first. SweepEx ( xstart ystart xend yend order msg arg1 arg2 arg3 -- ) Same as Sweep but three message arguments. Synchronize ( slot startimage -- ) ** Start a synchronized animation. Give the slot number of the animation, and the starting image number. The length and speed are defined in a global definition, and the animation is always a non-oscillating loop. Target ( -- bool ) |
︙ |
Modified exec.c from [534ed95552] to [85a769bf13].
︙ | |||
2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 | 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | n=playfield[x+y*64-65]; while(n!=VOIDLINK) { m=objects[n]->up; v_trigger(from,n,v); n=m; } } static void v_sweep(Uint32 from,Value arg3) { Value arg2=Pop(); Value arg1=Pop(); Value v=Pop(); Uint8 hv=v_bool(Pop()); Uint16 msg=v.u; Uint8 x0,y0,x1,y1,x,y; Uint32 m,n; if(v.t!=TY_MESSAGE) Throw("Type mismatch"); v=Pop(); if(v.t) Throw("Type mismatch"); y1=(v.s<0?0:v.s>pfheight?pfheight+1:v.s); v=Pop(); if(v.t) Throw("Type mismatch"); x1=(v.s<0?0:v.s>pfheight?pfheight+1:v.s); v=Pop(); if(v.t) Throw("Type mismatch"); y0=(v.s<0?0:v.s>pfheight?pfheight+1:v.s); v=Pop(); if(v.t) Throw("Type mismatch"); x0=(v.s<0?0:v.s>pfheight?pfheight+1:v.s); if((!x0 && !x1) || (!y0 && !y1) || (x0>pfwidth && x1>pfwidth) || (y0>pfheight && y1>pfheight)) return; if(!x0) x0=1; if(!x1) x1=1; if(!y0) y0=1; if(!y1) y1=1; if(x0>pfwidth) x0=pfwidth; if(y0>pfheight) y0=pfheight; if(x1>pfwidth) x1=pfwidth; if(y1>pfheight) y1=pfheight; for(x=x0,y=y0;;) { n=playfield[x+y*64-65]; while(n!=VOIDLINK) { m=objects[n]->up; send_message(from,n,msg,arg1,arg2,arg3); n=m; } if(x==x1 && y==y1) break; if(hv) { if(y==y1) y=y0,x+=(x1>x0?1:-1); else y+=(y1>y0?1:-1); } else { if(x==x1) x=x0,y+=(y1>y0?1:-1); else x+=(x1>x0?1:-1); } } } static Uint32 v_hitme(Uint32 objE,Uint16 dir) { Object*o; Object*oE=objects[objE]; Uint32 hit=msgvars.arg3.u&~0x8000; if(msgvars.from==VOIDLINK) return 0; if(msgvars.arg3.t) Throw("Type mismatch in HitMe"); o=objects[msgvars.from]; if(dir>7) dir=(o->dir+dir)&7; if(!(dir&1) && !(hit&0x122)) { if(o->sharp[dir>>1]>oE->hard[(dir^4)>>1] && !v_bool(destroy(msgvars.from,objE,2))) hit|=0x8004; if(oE->sharp[(dir^4)>>1]>o->hard[dir>>1] && !v_bool(destroy(objE,msgvars.from,1))) hit|=0x4C; } if(!(hit&0x344) && (oE->shovable&(1<<dir)) && o->inertia>=oE->weight) { oE->inertia=o->inertia; if(move_dir(msgvars.from,objE,dir)) { if(!(oE->oflags&OF_DESTROYED)) o->inertia=oE->inertia; hit|=0x8000; } } msgvars.arg3.u=hit|7; return (hit&0x8008)==0x8000?1:0; } // Here is where the execution of a Free Hero Mesh bytecode subroutine is executed. #define NoIgnore() do{ changed=1; }while(0) #define GetVariableOf(a,b) (i=v_object(Pop()),i==VOIDLINK?NVALUE(0):b(objects[i]->a)) #define GetVariableOrAttributeOf(a,b) (t2=Pop(),t2.t==TY_CLASS?NVALUE(classes[t2.u]->a):(i=v_object(t2),i==VOIDLINK?NVALUE(0):b(objects[i]->a))) #define Numeric(a) do{ if((a).t!=TY_NUMBER) Throw("Type mismatch"); }while(0) #define DivideBy(a) do{ Numeric(a); if(!(a).u) Throw("Division by zero"); }while(0) |
︙ | |||
2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 | 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 | + | case OP_HEIGHT: StackReq(0,1); Push(NVALUE(o->height)); break; case OP_HEIGHT_C: StackReq(1,1); Push(GetVariableOrAttributeOf(height,NVALUE)); break; case OP_HEIGHT_E: NoIgnore(); StackReq(1,0); t1=Pop(); Numeric(t1); o->height=t1.u; break; case OP_HEIGHT_E16: NoIgnore(); StackReq(1,0); t1=Pop(); Numeric(t1); o->height=t1.u&0xFFFF; break; case OP_HEIGHT_EC: NoIgnore(); StackReq(2,0); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i!=VOIDLINK) objects[i]->height=t1.u; break; case OP_HEIGHT_EC16: NoIgnore(); StackReq(2,0); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i!=VOIDLINK) objects[i]->height=t1.u&0xFFFF; break; case OP_HEIGHTAT: StackReq(2,1); t2=Pop(); Numeric(t2); t1=Pop(); Numeric(t1); Push(NVALUE(height_at(t1.u,t2.u))); break; case OP_HITME: NoIgnore(); StackReq(1,1); t1=Pop(); Numeric(t1); i=v_hitme(obj,t1.u); break; case OP_IF: StackReq(1,0); if(v_bool(Pop())) ptr++; else ptr=code[ptr]; break; case OP_IGNOREKEY: if(current_key) key_ignored=all_flushed=1; break; case OP_IMAGE: StackReq(0,1); Push(NVALUE(o->image)); break; case OP_IMAGE_C: StackReq(1,1); Push(GetVariableOf(image,NVALUE)); break; case OP_IMAGE_E: NoIgnore(); StackReq(1,0); t1=Pop(); Numeric(t1); o->image=t1.u; break; case OP_IMAGE_EC: NoIgnore(); StackReq(2,0); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i!=VOIDLINK) objects[i]->image=t1.u; break; case OP_IN: StackReq(2,1); i=v_in(); Push(NVALUE(i?1:0)); break; |
︙ | |||
2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 | 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 | + + | case OP_STRING: StackReq(0,1); Push(UVALUE(code[ptr++],TY_STRING)); break; case OP_SOUND: StackReq(2,0); t2=Pop(); t1=Pop(); break; // Sound not implemented at this time case OP_SUB: StackReq(2,1); t2=Pop(); Numeric(t2); t1=Pop(); Numeric(t1); Push(NVALUE(t1.u-t2.u)); break; case OP_SUPER: i=code[1]; code=classes[i]->codes; ptr=get_message_ptr(i,msgvars.msg); if(ptr==0xFFFF) break; break; case OP_SUPER_C: i=code[1]; j=get_message_ptr(i,msgvars.msg); if(j!=0xFFFF) execute_program(classes[i]->codes,j,obj); break; case OP_SWAP: StackReq(2,2); t1=Pop(); t2=Pop(); Push(t1); Push(t2); break; case OP_SWAPWORLD: NoIgnore(); swap_world(); break; case OP_SWEEP: StackReq(8,0); v_sweep(obj,NVALUE(0)); break; case OP_SWEEPEX: StackReq(9,0); t1=Pop(); v_sweep(obj,t1); break; case OP_SYNCHRONIZE: StackReq(2,0); t2=Pop(); Numeric(t2); t1=Pop(); Numeric(t1); animate_sync(obj,t1.u,t2.u); break; case OP_TARGET: StackReq(0,1); Push(NVALUE(v_target(obj)?1:0)); break; case OP_TARGET_C: StackReq(1,1); i=v_object(Pop()); Push(NVALUE(v_target(i)?1:0)); break; case OP_TEMPERATURE: StackReq(0,1); Push(NVALUE(o->temperature)); break; 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; |
︙ |
Modified instruc from [11f44e42de] to [7ec365e6c8].
︙ | |||
229 230 231 232 233 234 235 236 237 238 239 240 241 242 | 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | + | DelInventory Delta .,Destroy FlushClass ,FlushObj GetInventory HeightAt HitMe IgnoreKey .,IntMove ; move without initializing Inertia .,JumpTo ,Loc ; same as: Xloc Yloc LocateMe LoseLevel ,Manhattan |
︙ | |||
261 262 263 264 265 266 267 268 269 270 271 272 273 274 | 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 | + + | *PopUpArgs ; for (PopUp [number]) ,Rel ,Seek .,Send .,SendEx ; send with three arguments SetInventory Sound Sweep SweepEx Synchronize ,Target Trace Trigger TriggerAt VolumeAt WinLevel |
︙ |
Modified instruc.h from [2cbce0738d] to [2667fe2918].
︙ | |||
324 325 326 327 328 329 330 | 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 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 | + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - - - + + + - - - + + + | #define OP_DESTROY_D 41119 #define OP_DESTROY_CD 43167 #define OP_FLUSHCLASS 32928 #define OP_FLUSHOBJ 32929 #define OP_FLUSHOBJ_C 34977 #define OP_GETINVENTORY 32930 #define OP_HEIGHTAT 32931 #define OP_HITME 32932 |
︙ | |||
515 516 517 518 519 520 521 | 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 | - + | {"Chebyshev",8487065}, {"Class",8486972}, {"Climb",9142352}, {"CodePage",8683651}, {"CollisionLayers",8487031}, {"Coloc",8487066}, {"Compatible",8487030}, |
︙ | |||
537 538 539 540 541 542 543 | 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 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 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 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 718 719 | - + - + + - + - + - + - + - - - + + + - - + + - - + + - + - - - + + + - - - - - - - - + + + + + + + + - - + + - - + + - - + + - + - - - - + + + + - + - - - + + + + + - + - - - + + + - + - - - + + + - + - + | {"Departed",8618087}, {"Departures",8618089}, {"Destroy",10584223}, {"Destroyed",8487028}, {"Dir",8618050}, {"Distance",9142342}, {"Done",8618099}, |
︙ | |||
744 745 746 747 748 749 750 | 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 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 | - - - + + + - + - + - + - + - + - + - + | {"bit9",8423401}, {"bnot",8421414}, {"bor",8421412}, {"bxor",8421413}, {"c?",8421429}, {"case",8683542}, {"chain",8421528}, |