![]() |
Routines |
| Prev: AA37 | Up: Map | Next: AAD7 |
|
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 C904 says that the item is carried above the ship or below it. Then the ship is drawn.
|
||||
| AttachItemToShip | AA94 | LD A,($C904) | The item the ship is about to pick up. | |
| AA97 | LD B,A | B=A. | ||
| AA98 | LD A,($C1A9) | The height of the ship. | ||
| AA9B | LD C,A | C=A. | ||
| AA9C | LD (IX+$09),$08 | Store 08 at offset 09 of IX. | ||
| AAA0 | LD E,$03 | E=03. | ||
| AAA2 | LD HL,$F6B9 | The ship work area. | ||
| AAA5 | LD A,$05 | A=05. | ||
| AAA7 | BIT 6,B | Jump to AttachItemToShip_Store if bit 6 of B is set. | ||
| AAA9 | JR NZ,AttachItemToShip_Store | |||
| AAAB | LD HL,$F6D7 | The right-hand picture in the ship work area. | ||
| AAAE | LD E,$FD | E=FD. | ||
| AAB0 | NEG | Negate A. | ||
| AAB2 | LD (IX+$09),$F8 | Store F8 at offset 09 of IX. | ||
| AttachItemToShip_Store | AAB6 | LD ($C1AA),HL | Update the ship buffer address. | |
| AAB9 | ADD A,C | A gains C. | ||
| AABA | LD ($C1A9),A | Update the height of the ship. | ||
| AABD | LD A,($5C38) | The ship row. | ||
| AAC0 | ADD A,E | A gains E. | ||
| AAC1 | LD ($5C38),A | Update the ship row. | ||
| AAC4 | LD A,(IX+$09) | Read offset 09 of IX. | ||
| AAC7 | ADD A,(IX+$1E) | Add the byte at offset 1E of IX to A. | ||
| AACA | LD (IX+$1E),A | Write A to offset 1E of IX. | ||
| AACD | LD (IX+$07),$00 | Store 00 at offset 07 of IX. | ||
| AAD1 | CALL MoveObject | Call MoveObject. | ||
| AAD4 | JP SetShipSpeeds | Jump to SetShipSpeeds. | ||
| Prev: AA37 | Up: Map | Next: AAD7 |