| Routines

7C02: Print the inventory

Used by the routines at 5D37, 5D63, 7854, F2E2 and F862. Prints the safe key, Science Lab storeroom key, frog, water pistol and stinkbombs, depending on which of these items ERIC has in his possession. (The mouse inventory is handled separately at 7BC2.)
7C02 | LD HL,$7FEA | L=0xEA (LSB of the display file address for the first slot in the inventory: 50EA)
7C05 | LD C,$06 | Clear the six slots in the current on-screen inventory
7C07 | LD H,$50
7C09 | LD B,$08
7C0B | LD (HL),$00
7C0D | INC H
7C0E | DJNZ $7C0B
7C10 | INC L
7C11 | DEC C
7C12 | JR NZ,$7C07
7C14 | LD DE,$50EA | DE=display file address for the first slot in the inventory
7C17 | LD BC,$98E8 | The safe key UDG is at 98E8
7C1A | LD HL,$7FEB | 7FEB holds the inventory flags
7C1D | LD A,$06 | INK 6
7C1F | BIT 0,(HL) | Has ERIC got the safe key?
7C21 | CALL NZ,$7C64 | Print it if so
7C24 | INC B | BC=99E8: Science Lab storeroom key UDG
7C25 | LD A,$07 | INK 7
7C27 | BIT 1,(HL) | Has ERIC got the Science Lab storeroom key?
7C29 | CALL NZ,$7C64 | Print it if so
7C2C | LD A,$04 | INK 4
7C2E | INC B | BC=9AE8: frog UDG
7C2F | BIT 2,(HL) | Has ERIC got the frog?
7C31 | CALL NZ,$7C64 | Print it if so
7C34 | INC B | BC=9BE8: water pistol UDG (left half)
7C35 | BIT 3,(HL) | Has ERIC got the water pistol?
7C37 | JR Z,$7C4B | Jump if not
7C39 | LD A,$05 | INK 5 for the water-filled pistol
7C3B | BIT 4,(HL) | Has ERIC got the water pistol with sherry in it?
7C3D | JR Z,$7C41 | Jump if not
7C3F | LD A,$43 | INK 3: BRIGHT 1 for the sherry-filled pistol
7C41 | PUSH AF |
7C42 | CALL $7C64 | Print the left half of the water pistol
7C45 | POP AF |
7C46 | INC B | BC=9CE8: water pistol UDG (right half)
7C47 | CALL $7C64 | Print the right half of the water pistol
7C4A | DEC B |
7C4B | INC B |
7C4C | INC B | BC=9DE8: 3 stinkbombs UDG
7C4D | LD A,$07 | INK 7
7C4F | BIT 5,(HL) | Has ERIC got 3 stinkbombs?
7C51 | JR NZ,$7C5D | Jump if so
7C53 | INC B | BC=9EE8: 2 stinkbombs UDG
7C54 | BIT 6,(HL) | Has ERIC got 2 stinkbombs?
7C56 | JR NZ,$7C5D | Jump if so
7C58 | BIT 7,(HL) | Has ERIC got 1 stinkbomb?
7C5A | JR Z,$7C60 | Jump if not
7C5C | INC B | BC=9FE8: 1 stinkbomb UDG
7C5D | CALL $7C64 | Print the stinkbombs
7C60 | LD H,$D2 | 0xD2=ERIC
7C62 | RET |