![]() |
Routines |
| Prev: 54717 | Up: Map | Next: 54855 |
|
Used by the routine at TestEntityPair.
Deals with an entity touching an entity of the type 15. Nothing happens while the counter in the high nibble of field 22 of the other entity is running, or while its frame (the low five bits of field 1) is below 4. Frames 4 and 5 burst the touching entity (see StartBurst) and free the other entity. Frames of 6 or more are collected if the touching entity is the player: 256 points are added to the score and the other entity starts to disappear. Frame 7 also gives an extra life, which is printed, and plays the rising sweep. Frame 8 gives 2304 more points, and the other frames give 336 more points and fill the first gauge. Purpose of the individual frames is not yet known.
|
||||||||||
| CollectItem | 54751 | LD A,(IY+22) | Read field 22 of the other entity. | |||||||
| 54754 | AND %11110000 | Keep the counter in bits 4-7. | ||||||||
| 54756 | RET NZ | Return if the counter is running. | ||||||||
| 54757 | LD A,(IY+1) | Fetch the frame of the other entity. | ||||||||
| 54760 | AND %00011111 | Keep the number of the frame. | ||||||||
| 54762 | CP 4 | Compare it with 4. | ||||||||
| 54764 | RET C | Return if the frame is lower. | ||||||||
| 54765 | CP 6 | Jump to CollectItem_Collect if the frame is 6 or more. | ||||||||
| 54767 | JR NC,CollectItem_Collect | |||||||||
| 54769 | CALL StartBurst | Burst the touching entity. | ||||||||
| 54772 | LD (IY+0),0 | Free the other entity... | ||||||||
| 54776 | LD (IY+1),128 | ...and hide it. | ||||||||
| 54780 | RET | Return. | ||||||||
| CollectItem_Collect | 54781 | LD A,(IX+0) | Fetch the type of the touching entity. | |||||||
| 54784 | DEC A | Decrease it by one. | ||||||||
| 54785 | RET NZ | Return if it is not the player. | ||||||||
| 54786 | LD BC,256 | Set the points to 256. | ||||||||
| 54789 | CALL AddScore | Add them to the score. | ||||||||
| 54792 | SET 7,(IY+22) | Start the counter in field 22 of the other entity. | ||||||||
| 54796 | LD (IY+32),15 | Set field 32 of the other entity to 15. | ||||||||
| 54800 | LD A,(IY+1) | Fetch the frame of the other entity. | ||||||||
| 54803 | AND %00011111 | Keep the number of the frame. | ||||||||
| 54805 | CP 7 | Jump to CollectItem_Frame if it is not the frame that gives an extra life. | ||||||||
| 54807 | JR NZ,CollectItem_Frame | |||||||||
|
This entry point is used by the routines at AddScore and PrintScore.
|
||||||||||
| CollectItem_ExtraLife | 54809 | LD A,(57054) | Fetch the number of lives. | |||||||
| 54812 | INC A | Add one. | ||||||||
| 54813 | LD (57054),A | Store it. | ||||||||
| 54816 | DEC A | Take away one to find the number of lives that are to be shown. | ||||||||
| 54817 | CALL GetDigits | Convert it into digits. | ||||||||
| 54820 | LD (57769),HL | Store them in the text record of the lives. | ||||||||
| 54823 | LD DE,57765 | Point DE at LivesTextPlayerOne_Record. | ||||||||
| 54826 | CALL PrintText | Print it. | ||||||||
| 54829 | JP PlayRisingSweep | Jump to PlayRisingSweep. | ||||||||
| CollectItem_Frame | 54832 | CP 8 | Jump to CollectItem_Other if it is not that frame. | |||||||
| 54834 | JR NZ,CollectItem_Other | |||||||||
| 54836 | LD BC,2304 | Set the points to 2304. | ||||||||
| 54839 | JP AddScore | Jump to AddScore. | ||||||||
| CollectItem_Other | 54842 | LD BC,336 | Set the points to 336. | |||||||
| 54845 | CALL AddScore | Add them to the score. | ||||||||
| 54848 | LD HL,24576 | HL is 24576 a full gauge. | ||||||||
| 54851 | LD (42399),HL | Fill the first gauge. | ||||||||
| 54854 | RET | Return. | ||||||||
| Prev: 54717 | Up: Map | Next: 54855 |