Prev: E581 Up: Map Next: E6BC
E5F4: Handler: Items
Used by the routine at InitialiseGame.
Handler_Items E5F4 LD IX,($5BE0) IX=*ReferenceItems.
Are we done?
Handler_Items_Loop E5F8 LD A,(IX+$00) Return if the terminator character has been received instead of a co-ordinate (FF).
E5FB CP $FF
E5FD RET Z
E5FE LD C,A C=A.
E5FF LD B,(IX+$01) B=*IX+01.
E602 LD A,(IX+$05) Jump to Handler_Items_Next if this item has already been "collected".
E605 CP $00
E607 JR Z,Handler_Items_Next
E609 LD A,($F232) A=*F232.
E60C DEC A Decrease A by one.
E60D CP B Jump to Handler_Items_Next if A is not equal to B.
E60E JR NZ,Handler_Items_Next
E610 LD A,($F231) A=*TablePlayerAttributes.
E613 SUB C A-=C.
E614 JR Z,Item_Collected Jump to Item_Collected if A is either zero or FF.
E616 CP $FF
E618 JR Z,Item_Collected
Handler_Items_Next E61A LD DE,$0007 IX+=0007.
E61D ADD IX,DE
E61F JR Handler_Items_Loop Jump to Handler_Items_Loop.
Item_Collected E621 CALL Controller_BombCheck Call Controller_BombCheck.
E624 LD A,$04 Write 04 to *SoundFlag_General.
E626 LD ($FFFE),A
E629 LD A,$00 A=00.
E62B LD D,$02 DE=Set the sprite width/ height (02/ 02).
E62D LD E,$02
E62F PUSH DE Stash DE on the stack.
E630 CALL $E72F Call E72F.
E633 CALL $0DD9 Call CL_SET.
E636 POP DE Restore DE from the stack.
E637 LD HL,$9F6C Write 9F6C (Graphics_MaskSprite) to *CHARS.
E63A LD ($5C36),HL
E63D LD A,$20 A=20.
E63F CALL PrintSprite Call PrintSprite.
E642 LD (IX+$05),$00 Write "collected" (00) to (*IX+05).
E646 LD A,$10 Set INK: YELLOW (06).
E648 RST $10
E649 LD A,$06
E64B RST $10
E64C LD A,$11 Set PAPER: *Active_BorderColour.
E64E RST $10
E64F LD A,($5BD0)
E652 RST $10
Restore the default ZX Spectrum font.
E653 LD HL,$3C00 Write 3C00 (CHARSET-0100) to *CHARS.
E656 LD ($5C36),HL
E659 LD C,$13 Set up the screen buffer location 13/01 using CL_SET.
E65B LD B,$01
E65D CALL $0DD9
E660 LD BC,($5BF4) Increment *PlayerBooty by one.
E664 INC BC
E665 LD ($5BF4),BC
E669 CALL $1A1B Call OUT_NUM_1.
E66C LD C,$05 Set up the screen buffer location 05/01 using CL_SET.
E66E LD B,$01
E670 CALL $0DD9
E673 LD BC,($5BF2) Decrease *PlayerTreasure by one.
E677 DEC BC
E678 LD ($5BF2),BC
E67C LD A,B Jump to Handler_Items_0 if B is not equal to 00.
E67D CP $00
E67F JR NZ,Handler_Items_0
E681 LD A,C Jump to Handler_Items_0 if C is not equal to 32.
E682 CP $32
E684 JR NZ,Handler_Items_0
E686 LD A,($5BD3) Write *CurrentRoom to *GoldenKeyRoom.
E689 LD ($5BFC),A
E68C LD A,(IX+$00) Write *IX+00 to *PositionGoldenKey.
E68F LD ($5BFD),A
E692 LD A,(IX+$01) A=*IX+01.
E695 INC A Increment A by one.
E696 LD ($5BFE),A Write A to *5BFE.
Handler_Items_0 E699 LD A,C Compare C with 00.
E69A CP $00
E69C PUSH AF Stash AF on the stack.
E69D CALL NZ,$1A1B Call OUT_NUM_1 if C was not zero on line Handler_Items_0.
E6A0 LD A,$20 A=ASCII "space" (20).
E6A2 CALL PrintColourCharacter Call PrintColourCharacter.
E6A5 POP AF Restore AF from the stack.
E6A6 RET NZ Return if {} is not zero.
E6A7 LD A,$2D Write 2D to *TimerGoldenKey.
E6A9 LD ($5BFF),A
E6AC LD BC,$0014 Write 0014 to *TimerGoldenKey_FrameSkip.
E6AF LD ($5BFA),BC
Restore the default ZX Spectrum font.
E6B3 LD HL,$3C00 Write 3C00 (CHARSET-0100) to *CHARS.
E6B6 LD ($5C36),HL
E6B9 JP PrintFindTheGoldKey Jump to PrintFindTheGoldKey.
Prev: E581 Up: Map Next: E6BC