Overview
Comment: | Add the flip instruction. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
f292d8781edba89d978cfb8354372a16 |
User & Date: | user on 2021-03-31 19:26:10 |
Other Links: | manifest | tags |
Context
2021-04-01
| ||
04:00 | Change the sounds.js to use the sound names instead of numbers (although this does not find all of the sounds; also, it may be reverted if needed) check-in: 2b1740ba7c user: user tags: trunk | |
2021-03-31
| ||
19:26 | Add the flip instruction. check-in: f292d8781e user: user tags: trunk | |
07:04 | Remove the unimplemented QueueTurn instruction. check-in: e6516c4496 user: user tags: trunk | |
Changes
Modified class.doc from [f3236ff0c1] to [e05ea8d8f3].
︙ | |||
1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 | 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 | + + + | =Finished ( number -- ) Write to the Finished variable. Only the low 8-bits are used. When set to nonzero then the beginning and ending phases are skipped (see above), but if IgnoreKey is used, then all phases are skipped, regardless of the value of this flag. flip ( mark ... -- mark ... ) Reverses everything above the mark on the stack. FlushClass ( class -- ) ** Resets the Arrived, Busy, Departed, Inertia, Moved, and UserSignal flags of all objects of the specified class to zero. If the class is -1, then all objects are flushed in this way, and during the input phase, it also skips the beginning and ending phases if the class is -1. FlushObj ( -- ) ** |
︙ |
Modified exec.c from [6e356ea1be] to [371fab5994].
︙ | |||
1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 | 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 | + + + + + + + + + + + + + + | static inline Uint32 chebyshev(Uint32 a,Uint32 b) { Uint32 i,j; if(a==VOIDLINK || b==VOIDLINK) return 0; i=abs(objects[a]->x-objects[b]->x); j=abs(objects[a]->y-objects[b]->y); return i>j?i:j; } static inline void v_flip(void) { int p=vstackptr; int n; Value v; while(p-- && vstack[p].t!=TY_MARK); if(!p) Throw("No mark"); p++; for(n=0;n<(vstackptr-p)/2;n++) { v=vstack[p+n]; vstack[p+n]=vstack[vstackptr-n-1]; vstack[vstackptr-n-1]=v; } } // 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) |
︙ | |||
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 1596 | + | case OP_DONE_EC: StackReq(2,0); SetFlagOf(OF_DONE); break; case OP_DROP: StackReq(1,0); Pop(); break; case OP_DROP_D: StackReq(2,0); Pop(); Pop(); break; case OP_DUP: StackReq(1,2); t1=Pop(); Push(t1); Push(t1); break; case OP_EQ: StackReq(2,1); t2=Pop(); t1=Pop(); Push(NVALUE(v_equal(t1,t2)?1:0)); break; case OP_FINISHED: StackReq(0,1); Push(NVALUE(all_flushed)); break; case OP_FINISHED_E: StackReq(1,0); t1=Pop(); Numeric(t1); all_flushed=t1.u; break; case OP_FLIP: v_flip(); break; case OP_FLUSHCLASS: NoIgnore(); StackReq(1,0); t1=Pop(); if(t1.t==TY_CLASS) flush_class(t1.u); else if(t1.t==TY_NUMBER && t1.s==-1) flush_all(); else if(t1.t) Throw("Type mismatch"); break; case OP_FLUSHOBJ: NoIgnore(); flush_object(obj); break; case OP_FLUSHOBJ_C: NoIgnore(); StackReq(1,0); i=v_object(Pop()); if(i!=VOIDLINK) flush_object(i); break; case OP_FOR: NoIgnore(); StackReq(3,1); t3=Pop(); t2=Pop(); t1=Pop(); ptr=v_for(code,ptr,t1,t2,t3); break; case OP_FROM: StackReq(0,1); Push(OVALUE(msgvars.from)); break; case OP_FUNCTION: execute_program(classes[0]->codes,functions[code[ptr++]],obj); break; case OP_GE: StackReq(2,1); t2=Pop(); t1=Pop(); Push(NVALUE(v_unsigned_greater(t2,t1)?0:1)); break; |
︙ |
Modified instruc from [44f9c7e8d7] to [0d803850a1].
︙ | |||
258 259 260 261 262 263 264 265 266 267 268 269 270 271 | 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | + | ; Operations with marks mark "_" tmark in nin -mbegin flip ; Arrays -Array GetArray InitArray SetArray ArrayCell |
︙ |
Modified instruc.h from [f43425eb5f] to [6d4bc1a2f8].
︙ | |||
375 376 377 378 379 380 381 | 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 | + - - - - - - - - - - - - - + + + + + + + + + + + + + - - + + | #define OP_YDIR 32953 #define OP_YDIR_C 35001 #define OP_MARK 32954 #define OP_TMARK 32955 #define OP_IN 32956 #define OP_NIN 32957 #define OP_MBEGIN 32958 #define OP_FLIP 32959 |
︙ | |||
473 474 475 476 477 478 479 | 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 | - + - + | {"FROG",8389383}, {"Finished",8552571}, {"FlushClass",8421522}, {"FlushObj",8487059}, {"From",8421492}, {"GLASS",8389379}, {"GLISSANT",8389419}, |
︙ | |||
572 573 574 575 576 577 578 | 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 | - + | {"SUBS",8683651}, {"SUNK",8389131}, {"SW",9437189}, {"Seek",8487086}, {"Self",8421490}, {"Send",10584239}, {"SendEx",10584240}, |
︙ | |||
656 657 658 659 660 661 662 663 664 665 666 667 668 669 | 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 | + | {"c?",8421424}, {"chain",8421516}, {"cz?",8421425}, {"dup",8421377}, {"el",8683532}, {"else",8683530}, {"eq",8421416}, {"flip",8421567}, {"for",8683538}, {"ge",8486956}, {"gt",8486954}, {"if",8683529}, {"in",8421564}, {"is",8421422}, {"land",8421412}, |
︙ | |||
694 695 696 697 698 699 700 | 696 697 698 699 700 701 702 703 704 | - + | {"swap",8421378}, {"then",8683531}, {"tmark",8421563}, {"tuck",8421380}, {"until",8683535}, {"while",8683536}, }; |