Overview
Comment: | Implement NewXY and XYDir instructions. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
9aec3201e3d022f9d79766f526a3f4e5 |
User & Date: | user on 2021-02-10 04:59:19 |
Other Links: | manifest | tags |
Context
2021-02-10
| ||
05:02 | Implement the ,Loc instruction. check-in: 225cba49fa user: user tags: trunk | |
04:59 | Implement NewXY and XYDir instructions. check-in: 9aec3201e3 user: user tags: trunk | |
04:52 | Add an example configuration file. check-in: 8fd8c63a9e user: user tags: trunk | |
Changes
Modified class.doc from [eb7b165753] to [7468fdc695].
︙ | |||
1202 1203 1204 1205 1206 1207 1208 | 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 | + + + - + | NewX ( oldx dir -- newx ) Advance the number in the direction as though it is a X coordinate. If the direction is north or south, leaves it alone, but if it is east or west then it is increased or decreased by one. The output is never less than zero nor exceeding the playfield width by more than one. NewXY ( oldx oldy dir -- newx newy ) NewX and NewY together. |
︙ | |||
1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 | 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 | + + + | 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. 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. |
︙ |
Modified exec.c from [3483fb1cee] to [51f022bade].
︙ | |||
1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 | 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 | + | case OP_MOVETO_CD: NoIgnore(); StackReq(3,0); t3=Pop(); Numeric(t3); t2=Pop(); Numeric(t2); i=v_object(Pop()); move_to(obj,i,t2.u,t3.u); break; case OP_MSG: StackReq(0,1); Push(MVALUE(msgvars.msg)); break; case OP_MUL: StackReq(2,1); t2=Pop(); Numeric(t2); t1=Pop(); Numeric(t1); Push(NVALUE(t1.u*t2.u)); break; case OP_MUL_C: StackReq(2,1); t2=Pop(); Numeric(t2); t1=Pop(); Numeric(t1); Push(NVALUE(t1.s*t2.s)); break; case OP_NE: StackReq(2,1); t2=Pop(); t1=Pop(); Push(NVALUE(v_equal(t1,t2)?0:1)); break; case OP_NEG: StackReq(1,1); t1=Pop(); Numeric(t1); t1.s=-t1.s; Push(t1); break; case OP_NEWX: StackReq(2,1); t2=Pop(); Numeric(t2); t1=Pop(); Numeric(t1); Push(NVALUE(new_x(t1.u,t2.u))); break; case OP_NEWXY: StackReq(3,1); t3=Pop(); Numeric(t3); t2=Pop(); Numeric(t2); t1=Pop(); Numeric(t1); Push(NVALUE(new_x(t1.u,t3.u))); Push(NVALUE(new_y(t2.u,t3.u))); break; case OP_NEWY: StackReq(2,1); t2=Pop(); Numeric(t2); t1=Pop(); Numeric(t1); Push(NVALUE(new_y(t1.u,t2.u))); break; case OP_NEXT: StackReq(0,1); ptr=v_next(code,ptr); break; case OP_NIP: StackReq(2,1); t1=Pop(); Pop(); Push(t1); break; case OP_OBJABOVE: StackReq(0,1); i=obj_above(obj); Push(OVALUE(i)); break; case OP_OBJABOVE_C: StackReq(1,1); i=obj_above(v_object(Pop())); Push(OVALUE(i)); break; case OP_OBJBELOW: StackReq(0,1); i=obj_below(obj); Push(OVALUE(i)); break; case OP_OBJBELOW_C: StackReq(1,1); i=obj_below(v_object(Pop())); Push(OVALUE(i)); break; |
︙ | |||
1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 | 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 | + | 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; 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_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; #define MiscVar(a,b) \ case a: StackReq(0,1); Push(o->b); break; \ case a+0x0800: StackReq(1,1); Push(GetVariableOf(b,)); break; \ |
︙ |
Modified instruc from [ad8994f3d8] to [cba4030e74].
︙ | |||
219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | + + | LocateMe LoseLevel MaxInventory ; error if more than that many slots in inventory .,Move .,MovePlus "Move+" ; obj.Inertia+=Strength instead of obj.Inertia=Strength .,MoveTo ; the internal MoveTo() function NewX NewXY NewY ,ObjAbove ,ObjBelow ObjBottomAt ObjClassAt ,ObjDir ObjLayerAt ObjTopAt PopUp *PopUpArgs ; for (PopUp [number]) QueueTurn ; queue another turn that automatically occurs after this one .,Send .,SendEx ; send with three arguments SetInventory Sound Synchronize Trace VolumeAt WinLevel ,XDir XYDir ,YDir ; Specials *Function *Local *Label *String *Int16 *Int32 |
Modified instruc.h from [0ce4d3ad81] to [fef41e8e89].
︙ | |||
323 324 325 326 327 328 329 | 323 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 | + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | #define OP_MOVEPLUS_D 41111 #define OP_MOVEPLUS_CD 43159 #define OP_MOVETO 32920 #define OP_MOVETO_C 34968 #define OP_MOVETO_D 41112 #define OP_MOVETO_CD 43160 #define OP_NEWX 32921 #define OP_NEWXY 32922 |
︙ | |||
497 498 499 500 501 502 503 | 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 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 | + - + - - - - - - - + + + + + + + - - + + - - - + + + - + - + - + - + - - + + + - + | {"MoveTo",10584216}, {"Moved",8618089}, {"Msg",8421488}, {"N",9437186}, {"NE",9437185}, {"NW",9437187}, {"NewX",8421529}, {"NewXY",8421530}, |
︙ | |||
646 647 648 649 650 651 652 | 650 651 652 653 654 655 656 657 658 | - + | {"s?",8421425}, {"swap",8421378}, {"then",8683529}, {"tuck",8421380}, {"until",8683533}, {"while",8683534}, }; |