![]() |
Routines |
| Prev: 37244 | Up: Map | Next: 37470 |
|
Adds the points for an object to the score of player one. The points come from the table at PointsTable, indexed by the type of the object. Objects of type 13 and 27 are worth 592 points. The points are doubled if bit 3 of the second flags of the object is set.
|
||||||||
| ScoreDestroyedObject | 37428 | LD A,(IX+0) | Fetch the type of the object. | |||||
| 37431 | CP 13 | Jump to ScoreDestroyedObject_Fixed if it is 13. | ||||||
| 37433 | JR Z,ScoreDestroyedObject_Fixed | |||||||
| 37435 | CP 27 | Jump to ScoreDestroyedObject_Table if it is not 27. | ||||||
| 37437 | JR NZ,ScoreDestroyedObject_Table | |||||||
| ScoreDestroyedObject_Fixed | 37439 | LD BC,592 | Set the points to 592. | |||||
| 37442 | JR AddToScore | Jump to AddToScore. | ||||||
| ScoreDestroyedObject_Table | 37444 | SUB 19 | Subtract 19 from the type. | |||||
| 37446 | ADD A,A | Double it. | ||||||
| 37447 | LD HL,37532 | Use the table at PointsTable. | ||||||
| 37450 | CALL AddAToHL | Add the offset to the address. | ||||||
| 37453 | LD B,(HL) | Fetch the points into BC. | ||||||
| 37454 | INC HL | |||||||
| 37455 | LD C,(HL) | |||||||
| 37456 | BIT 3,(IX+23) | Jump to AddToScore if bit 3 of the second set of flags is clear. | ||||||
| 37460 | JR Z,AddToScore | |||||||
| 37462 | LD A,C | Double the points. | ||||||
| 37463 | ADD A,A | |||||||
| 37464 | DAA | |||||||
| 37465 | LD C,A | |||||||
| 37466 | LD A,B | |||||||
| 37467 | ADC A,B | |||||||
| 37468 | DAA | |||||||
| 37469 | LD B,A | Keep the result in B. | ||||||
|
Continue on to AddToScore.
|
||||||||
| Prev: 37244 | Up: Map | Next: 37470 |