![]() |
Routines |
| Prev: D94F | Up: Map | Next: D9A3 |
|
Used by the routines at UpdateCreature and UpdateMonster.
Sets the sprite of an object from the direction that it is facing. Bit 1 of the type is set from the direction, bit 0 is flipped, and the flip flag is set from the direction, with both the sprite and the flip changed when the view is rotated.
|
||||||||
| SetSpriteFromDirection | D978 | LD A,($BBBA) | Fetch whether the view is turned round, and double it. | |||||
| D97B | ADD A,A | |||||||
| D97C | LD B,A | |||||||
| D97D | LD A,(IX+$06) | Work out bit 1 of the type from the direction. | ||||||
| D980 | SUB $40 | |||||||
| D982 | RLCA | |||||||
| D983 | RLCA | |||||||
| D984 | AND $02 | |||||||
| D986 | LD C,A | |||||||
| D987 | LD A,(IX+$00) | Set bit 1 of the type from the direction, flip bit 0 to change the frame, and flip bit 1 as well if the view is rotated. | ||||||
| D98A | AND $FD | |||||||
| D98C | OR C | |||||||
| D98D | XOR $01 | |||||||
| D98F | XOR B | |||||||
| D990 | LD (IX+$00),A | |||||||
| D993 | LD A,(IX+$06) | Fetch the direction of the object, and keep bit 6. | ||||||
| D996 | AND $40 | |||||||
| D998 | LD C,A | |||||||
| D999 | LD A,(IX+$07) | Set the flip flag of the object from it. | ||||||
| D99C | AND $BF | |||||||
| D99E | OR C | |||||||
| D99F | LD (IX+$07),A | |||||||
| D9A2 | RET | Return. | ||||||
| Prev: D94F | Up: Map | Next: D9A3 |