Prev: 56069 Up: Map Next: 56358
56265: Handler: Inventory Items
Used by the routine at Dispatch_Handlers.
Picks up a two-byte record when the player stands on it.
Handler_InventoryItems 56265 LD HL,31856 Write Buffer_ActiveFont to *CHARS.
56268 LD (23606),HL
56271 LD IX,(25638) IX=*ReferenceInventoryItems.
56275 LD A,(25764) C=*Player.
56278 LD C,A Copy the player column into C.
Handler_InventoryItems_Loop 56279 LD A,(IX+0) Return if the terminator 255 is reached.
56282 CP 255
56284 RET Z Jump to Handler_InventoryItems_Next if this item is already taken.
56285 BIT 7,A
56287 JR NZ,Handler_InventoryItems_Next Jump to Handler_InventoryItems_Next unless the player column matches.
56289 CP C
56290 JR Z,Handler_InventoryItems_Row
56292 INC A
56293 CP C
56294 JR NZ,Handler_InventoryItems_Next
Handler_InventoryItems_Row 56296 LD A,(25765) Jump to Handler_InventoryItems_Next unless the player row matches.
56299 CP (IX+1)
56302 JR NZ,Handler_InventoryItems_Next Clear a 2 by 2 hole in the tile buffer.
56304 LD C,(IX+0)
56307 LD B,(IX+1)
56310 CALL JumpTable_ConvertCoordinate
56313 LD DE,24014 Mark the record collected.
56316 ADD HL,DE
56317 LD BC,514
56320 LD A,200
56322 CALL JumpTable_FillAttributes Increase *CollectedCount by one.
56325 LD A,(IX+0)
56328 OR 128
56330 LD (IX+0),A Call Sound_Pickup (pickup sound).
56333 LD A,(25761)
56336 INC A
56337 LD (25761),A
56340 LD BC,50 Jump to Print_CollectionBar.
56343 LD DE,25
56346 CALL Sound_Pickup
56349 JP Print_CollectionBar
Handler_InventoryItems_Next 56352 INC IX Increase IX by two.
56354 INC IX
56356 JR Handler_InventoryItems_Loop Jump to Handler_InventoryItems_Loop.
Prev: 56069 Up: Map Next: 56358