![]() |
Routines |
| Prev: 43575 | Up: Map | Next: 43735 |
|
Used by the routine at BuildShip.
Makes the ship taller by the height of the item that it carries, and adjusts its position, according to whether bit 6 of the item at 51460 says that the item is carried above the ship or below it. Then the ship is drawn.
|
||||
| AttachItemToShip | 43668 | LD A,(51460) | The item the ship is about to pick up. | |
| 43671 | LD B,A | B=A. | ||
| 43672 | LD A,(49577) | The height of the ship. | ||
| 43675 | LD C,A | C=A. | ||
| 43676 | LD (IX+9),8 | Store 8 at offset 9 of IX. | ||
| 43680 | LD E,3 | E=3. | ||
| 43682 | LD HL,63161 | The ship work area. | ||
| 43685 | LD A,5 | A=5. | ||
| 43687 | BIT 6,B | Jump to AttachItemToShip_Store if bit 6 of B is set. | ||
| 43689 | JR NZ,AttachItemToShip_Store | |||
| 43691 | LD HL,63191 | The right-hand picture in the ship work area. | ||
| 43694 | LD E,253 | E=253. | ||
| 43696 | NEG | Negate A. | ||
| 43698 | LD (IX+9),248 | Store 248 at offset 9 of IX. | ||
| AttachItemToShip_Store | 43702 | LD (49578),HL | Update the ship buffer address. | |
| 43705 | ADD A,C | A gains C. | ||
| 43706 | LD (49577),A | Update the height of the ship. | ||
| 43709 | LD A,(23608) | The ship row. | ||
| 43712 | ADD A,E | A gains E. | ||
| 43713 | LD (23608),A | Update the ship row. | ||
| 43716 | LD A,(IX+9) | Read offset 9 of IX. | ||
| 43719 | ADD A,(IX+30) | Add the byte at offset 30 of IX to A. | ||
| 43722 | LD (IX+30),A | Write A to offset 30 of IX. | ||
| 43725 | LD (IX+7),0 | Store 0 at offset 7 of IX. | ||
| 43729 | CALL MoveObject | Call MoveObject. | ||
| 43732 | JP SetShipSpeeds | Jump to SetShipSpeeds. | ||
| Prev: 43575 | Up: Map | Next: 43735 |