Routines |
Prev: F409 | Up: Map | Next: F491 |
|
||||
F43C | LD A,$09 | Is flag 9 (wall built) set? | ||
F43E | CALL $EC1D | |||
F441 | JR Z,$F479 | Jump forward if it is. | ||
F443 | LD A,$06 | Is flag 6 (battery charged) set? | ||
F445 | CALL $EC1D | |||
F448 | JR Z,$F479 | Jump forward if it is. | ||
F44A | LD A,($BD01) | Is the battery the first item in the room? | ||
F44D | CP $04 | |||
F44F | JR NZ,$F479 | Jump forward if it isn't. | ||
F451 | LD A,(IY+$05) | Get the x co-ordinate. | ||
F454 | SUB $42 | Is it by the fork lift? | ||
F456 | CP $FC | |||
F458 | JR C,$F479 | Jump foward if it isn't. | ||
The fork lift truck has a charged battery and the player is standing by the lift, so it can be activated.
|
||||
F45A | LD A,($AF88) | Get the fork lift's position. | ||
F45D | SUB (IY+$0A) | Is the player standing on it? | ||
F460 | SUB $22 | |||
F462 | CP $FC | |||
F464 | JR C,$F479 | Jump forward if they aren't. | ||
The player is standing on the fork lift, so move it.
|
||||
F466 | LD A,($AF88) | Get the fork lift's position. | ||
F469 | SUB $02 | Move it up two positions. | ||
F46B | CP $78 | Restrict the height to 78 | ||
F46D | JR NC,$F471 | |||
F46F | LD A,$78 | |||
F471 | LD ($AF88),A | Set the new height. | ||
F474 | SUB $20 | Set the player's y co-ordinate above the lift. | ||
F476 | LD (IY+$0A),A | |||
F479 | LD A,($AF88) | Get the fork lift's position. | ||
F47C | LD B,$10 | Invert it to get a y co-ordinate on screen. | ||
F47E | CP $B8 | |||
F480 | JR Z,$F484 | |||
F482 | LD B,$0E | |||
F484 | SUB B | |||
F485 | LD H,A | Set the y co-ordinate. | ||
F486 | LD L,$40 | x co-ordinate is always 40. | ||
F488 | LD ($A838),HL | Set the position of the fork lift. | ||
F48B | LD A,$2B | Set the ID of the fork lift. (88D8) | ||
F48D | CALL $A83D | Draw the object and return. | ||
F490 | RET |
Prev: F409 | Up: Map | Next: F491 |