Prev: 33300 Up: Map Next: 33700
33313: Rotate Coordinates
Rotates (DE,HL) by the sine/cosine pair at Sine.
Input
DE First coordinate
HL Second coordinate
Output
DE Rotated first coordinate
HL Rotated second coordinate
Rotate_Coordinates 33313 LD (60938),DE Write the first coordinate to *First_Coordinate.
33317 LD (60940),HL Write the second coordinate to *Second_Coordinate.
33320 LD A,(60931) Fetch *Cosine.
33323 CALL Multiply Call Multiply.
33326 PUSH HL Stash the product on the stack.
33327 LD DE,(60940) Fetch *Second_Coordinate.
33331 LD A,(60930) Fetch *Sine.
33334 CALL Multiply Call Multiply.
33337 POP DE Restore the product from the stack.
33338 ADD HL,DE Add the products.
33339 PUSH HL Stash the rotated first coordinate on the stack.
33340 LD DE,(60938) Fetch *First_Coordinate.
33344 LD A,(60930) Fetch *Sine.
33347 CALL Multiply Call Multiply.
33350 PUSH HL Stash the product on the stack.
33351 LD DE,(60940) Fetch *Second_Coordinate.
33355 LD A,(60931) Fetch *Cosine.
33358 CALL Multiply Call Multiply.
33361 POP DE Restore the product from the stack.
33362 AND A Subtract the products.
33363 SBC HL,DE
33365 POP DE Restore the rotated first coordinate from the stack.
33366 RET Return.
33367 NOP
33368 NOP
33369 NOP
This entry point is used by the routine at Process_Draw_List.
Rotate_Coordinates_0 33370 LD HL,(60986)
33373 AND A
33374 SBC HL,DE
33376 ADD HL,BC
33377 EX DE,HL
33378 LD HL,(60946)
33381 AND A
33382 SBC HL,DE
33384 LD (61020),HL
33387 ADD HL,DE
33388 ADD HL,DE
33389 LD (61008),HL
33392 RET
33393 NOP
33394 NOP
33395 NOP
33396 NOP
33397 NOP
33398 NOP
33399 NOP
This entry point is used by the routines at Process_Draw_List and Clear_Work_Buffers.
Rotate_Coordinates_1 33400 LD H,236
33402 LD L,A
33403 LD C,(HL)
33404 ADD A,64
33406 LD L,A
33407 LD B,(HL)
33408 LD (60932),BC
33412 RET
This entry point is used by the routines at Process_Draw_List and Clear_Work_Buffers.
Rotate_Coordinates_2 33413 LD D,A
33414 LD (60938),DE
33418 LD A,(60933)
33421 CALL Multiply_11
33424 PUSH HL
33425 LD A,(60939)
33428 LD E,A
33429 LD A,(60932)
33432 CALL Multiply_11
33435 POP DE
33436 ADD HL,DE
33437 PUSH HL
33438 LD A,(60938)
33441 LD E,A
33442 LD A,(60932)
33445 CALL Multiply_11
33448 PUSH HL
33449 LD A,(60939)
33452 LD E,A
33453 LD A,(60933)
33456 CALL Multiply_11
33459 POP DE
33460 AND A
33461 SBC HL,DE
33463 POP DE
33464 RET
33465 NOP
33466 NOP
33467 NOP
33468 DEC B
33469 LD C,E
33470 SBC A,L
33471 RET NZ
33472 DEC B
33473 LD C,D
33474 LD D,C
33475 JR NZ,Rotate_Coordinates_3
33477 LD C,D
33478 LD D,C
33479 JR NZ,33488
33481 LD A,E
Rotate_Coordinates_3 33482 SBC A,C
33483 RET NZ
33484 DEC B
33485 LD A,(BC)
33486 LD DE,1344
33489 LD A,(BC)
33490 LD DE,1344
33493 LD A,(BC)
33494 LD DE,1312
33497 LD A,D
33498 DEC E
33499 JR NZ,33539
33501 CALL PE,20079
33504 ADD A,64
33506 LD L,A
33507 LD B,(HL)
33508 LD (60934),BC
33512 RET
This entry point is used by the routines at Process_Draw_List, Clear_Work_Buffers, Draw_Object_Slots and Set_View_Angles.
Rotate_Coordinates_4 33513 LD D,A
33514 LD (60938),DE
33518 LD A,(60935)
33521 CALL Multiply_11
33524 PUSH HL
33525 LD A,(60939)
33528 LD E,A
33529 LD A,(60934)
33532 CALL Multiply_11
33535 POP DE
33536 ADD HL,DE
33537 PUSH HL
33538 LD A,(60938)
33541 LD E,A
33542 LD A,(60934)
33545 CALL Multiply_11
33548 PUSH HL
33549 LD A,(60939)
33552 LD E,A
33553 LD A,(60935)
33556 CALL Multiply_11
33559 POP DE
33560 AND A
33561 SBC HL,DE
33563 POP DE
33564 RET
33565 NOP
33566 NOP
33567 NOP
33568 NOP
33569 NOP
33570 NOP
33571 NOP
33572 NOP
33573 NOP
33574 NOP
33575 NOP
33576 NOP
33577 NOP
33578 NOP
33579 NOP
This entry point is used by the routine at Initialise_Next_Phase.
Rotate_Coordinates_5 33580 LD HL,33468
33583 JR Rotate_Coordinates_7
This entry point is used by the routine at Pause_Transition.
Rotate_Coordinates_6 33585 LD HL,46768
Rotate_Coordinates_7 33588 LD A,3
33590 LD (57710),A
33593 CALL Move_Slot_Table_20
33596 RET
33597 NOP
33598 NOP
33599 NOP
This entry point is used by the routines at Run_Other_Phase, Process_Draw_List, Clear_Work_Buffers and Set_View_Angles.
Rotate_Coordinates_8 33600 LD H,236
33602 LD L,A
33603 LD C,(HL)
33604 ADD A,64
33606 LD L,A
33607 LD B,(HL)
33608 LD (60936),BC
33612 RET
This entry point is used by the routines at Run_Other_Phase, Process_Draw_List, Clear_Work_Buffers and Set_View_Angles.
Rotate_Coordinates_9 33613 LD D,A
33614 LD (60938),DE
33618 LD A,(60937)
33621 CALL Multiply_11
33624 PUSH HL
33625 LD A,(60939)
33628 LD E,A
33629 LD A,(60936)
33632 CALL Multiply_11
33635 POP DE
33636 ADD HL,DE
33637 PUSH HL
33638 LD A,(60938)
33641 LD E,A
33642 LD A,(60936)
33645 CALL Multiply_11
33648 PUSH HL
33649 LD A,(60939)
33652 LD E,A
33653 LD A,(60937)
33656 CALL Multiply_11
33659 POP DE
33660 AND A
33661 SBC HL,DE
33663 POP DE
33664 RET
33665 NOP
33666 NOP
33667 NOP
33668 NOP
33669 LD A,(HL)
33670 INC BC
33671 RST 56
33672 RRCA
33673 RST 56
33674 LD D,207
33676 SCF
33677 RST 8
33678 SCF
33679 LD A,A
33680 LD (HL),C
33681 EI
33682 HALT
33683 DEFB 221
33684 HALT
33685 RST 56
33686 POP AF
33687 RST 32
33688 EI
33689 IN A,(187)
33691 RST 32
33692 CP L
33693 RST 56
33694 RET M
33695 RST 56
33696 OR 127
33698 LD (HL),A
33699 LD H,(HL)
Prev: 33300 Up: Map Next: 33700