Routines |
Prev: A92C | Up: Map | Next: AA7F |
|
||||||||
AA30 | PUSH HL | Remember HL. | ||||||
AA31 | CALL $AA8C | Get the static object buffer for this room. | ||||||
AA34 | INC HL | Move to the flags and put them in A. | ||||||
AA35 | INC HL | |||||||
AA36 | INC HL | |||||||
AA37 | LD A,(HL) | |||||||
AA38 | AND (IY-$28) | Is the current character allowed to pick it up? | ||||||
AA3B | JR Z,$AA74 | Jump foward if they aren't. | ||||||
The object the player is standing next to can be picked up, so do it.
|
||||||||
AA3D | LD A,(HL) | Get the flag again. | ||||||
AA3E | AND $80 | Is bit 7 set? | ||||||
AA40 | JR Z,$AA49 | Jump if it isn't. | ||||||
AA42 | PUSH HL | Is the buffer at iy pointing to the current character? | ||||||
AA43 | CALL $A921 | |||||||
AA46 | POP HL | |||||||
AA47 | JR NZ,$AA74 | Jump forward if it isn't. | ||||||
The object can only be collected by this player, and can be done.
|
||||||||
AA49 | LD A,(HL) | Put the flags in A. | ||||||
AA4A | RES 7,A | Turn off bit 7. | ||||||
AA4C | LD D,A | Store this in D. | ||||||
AA4D | LD A,(HL) | Put the flags in A. | ||||||
AA4E | AND $80 | Turn off bit 7. | ||||||
AA50 | OR (IY-$32) | Merge it with the flags at BC35. | ||||||
AA53 | LD (HL),A | Set this as the new value to use. | ||||||
AA54 | LD A,(IY-$37) | Swap these flags with the values starting at BC3A. | ||||||
AA57 | LD (IY-$32),A | |||||||
AA5A | LD (IY-$37),D | |||||||
AA5D | LD A,(IY+$55) | Set A to the second item held by this player. | ||||||
AA60 | DEC HL | Move back to the start of the object buffer. | ||||||
AA61 | DEC HL | |||||||
AA62 | DEC HL | |||||||
AA63 | LD E,(HL) | Put the old object ID in E. | ||||||
AA64 | LD (HL),A | Replace it with this one. | ||||||
AA65 | LD A,(IY+$50) | Set A to the first item held by this player. | ||||||
AA68 | LD (IY+$55),A | Set it at the second item. | ||||||
AA6B | LD (IY+$50),E | Set the item that was in the room as the second item. | ||||||
AA6E | CALL $A921 | Is the buffer at IY pointing to the current character? | ||||||
AA71 | CALL Z,$E41D | If so, need to update the inventory. | ||||||
AA74 | LD A,($B951) | Is the player in the current room? | ||||||
AA77 | CP (IY+$0F) | |||||||
AA7A | CALL Z,$AA7F | If so, play the "item swapped" sound. | ||||||
AA7D | POP HL | Restore HL and return. | ||||||
AA7E | RET |
Prev: A92C | Up: Map | Next: AA7F |