Prev: E771 Up: Map Next: E992
E775: Routine at E775
Used by the routines at D352 and Handler_Bombs.
E775 LD A,($E75D) A=*Tile_Horizontal_Position.
E778 LD ($E762),A Write A to *E762.
E77B INC A Increment A by one.
E77C LD ($E763),A Write A to *E763.
E77F LD A,($E75E) A=*Tile_Vertical_Position.
E782 LD ($E764),A Write A to *E764.
E785 INC A Increment A by one.
E786 LD ($E765),A Write A to *E765.
E789 LD A,($E75D) B=*Tile_Horizontal_Position.
E78C LD B,A
E78D LD A,($E75E) C=*Tile_Vertical_Position.
E790 LD C,A
E791 CALL Calculate_PositionToAttributeAddress Call Calculate_PositionToAttributeAddress.
E794 LD E,$7F E=7F.
E796 PUSH HL Stash HL on the stack.
E797 LD A,(HL) A=*HL.
E798 LD (HL),E Write E to *HL.
E799 LD ($E766),A Write A to *E766.
E79C INC HL Increment HL by one.
E79D LD A,(HL) A=*HL.
E79E LD (HL),E Write E to *HL.
E79F LD ($E767),A Write A to *E767.
E7A2 LD BC,$001F HL+=001F.
E7A5 ADD HL,BC
E7A6 LD A,(HL) A=*HL.
E7A7 LD (HL),E Write E to *HL.
E7A8 LD ($E768),A Write A to *E768.
E7AB INC HL Increment HL by one.
E7AC LD A,(HL) A=*HL.
E7AD LD (HL),E Write E to *HL.
E7AE LD ($E769),A Write A to *E769.
E7B1 CALL $E9A5 Call E9A5.
E7B4 HALT Halt operation (suspend CPU until the next interrupt).
E7B5 POP HL Restore HL from the stack.
E7B6 LD A,($E766) Write *E766 to *HL.
E7B9 LD (HL),A
E7BA INC HL Increment HL by one.
E7BB LD A,($E767) Write *E767 to *HL.
E7BE LD (HL),A
E7BF LD BC,$001F HL+=001F.
E7C2 ADD HL,BC
E7C3 LD A,($E768) Write *E768 to *HL.
E7C6 LD (HL),A
E7C7 INC HL Increment HL by one.
E7C8 LD A,($E769) Write *E769 to *HL.
E7CB LD (HL),A
This entry point is used by the routine at D352.
E7CC LD D,$00 D=00.
E7CE LD A,($E762) A=*E762.
E7D1 CP $00 Jump to E7DB if A is equal to 00.
E7D3 JR Z,$E7DB
E7D5 DEC A Decrease A by one.
E7D6 LD ($E762),A Write A to *E762.
E7D9 SET 1,D Set bit 1 of D.
E7DB LD A,($E763) A=*E763.
E7DE CP $17 Jump to E7E8 if A is equal to 17.
E7E0 JR Z,$E7E8
E7E2 INC A Increment A by one.
E7E3 LD ($E763),A Write A to *E763.
E7E6 SET 2,D Set bit 2 of D.
E7E8 LD A,($E765) A=*E765.
E7EB CP $1F Jump to E7F5 if A is equal to 1F.
E7ED JR Z,$E7F5
E7EF INC A Increment A by one.
E7F0 LD ($E765),A Write A to *E765.
E7F3 SET 3,D Set bit 3 of D.
E7F5 LD A,($E764) A=*E764.
E7F8 CP $00 Jump to E802 if A is equal to 00.
E7FA JR Z,$E802
E7FC DEC A Decrease A by one.
E7FD LD ($E764),A Write A to *E764.
E800 SET 4,D Set bit 4 of D.
E802 LD A,D A=D.
E803 CP $00 Return if A is equal to 00.
E805 RET Z
E806 LD B,$02 B=02.
E808 LD E,$52 E=52.
E80A PUSH BC Stash BC on the stack.
E80B BIT 1,D Test bit 1 of D.
E80D JR Z,$E859 Jump to E859 if A is zero.
E80F LD A,($E762) B=*E762.
E812 LD B,A
E813 LD A,($E75E) C=*Tile_Vertical_Position.
E816 LD C,A
E817 CALL Calculate_PositionToAttributeAddress Call Calculate_PositionToAttributeAddress.
E81A POP BC Restore BC from the stack.
E81B PUSH BC Stash BC on the stack.
E81C LD A,B Jump to E82C if B is equal to 02.
E81D CP $02
E81F JR Z,$E82C
E821 LD A,($E766) Write *E766 to *HL.
E824 LD (HL),A
E825 INC HL Increment HL by one.
E826 LD A,($E767) Write *E767 to *HL.
E829 LD (HL),A
E82A JR $E837 Jump to E837.
E82C LD A,(HL) Write *HL to *E766.
E82D LD ($E766),A
E830 LD (HL),E Write E to *HL.
E831 INC HL Increment HL by one.
E832 LD A,(HL) Write *HLto *E767.
E833 LD ($E767),A
E836 LD (HL),E Write E to *HL.
E837 BIT 3,D Test bit 3 of D.
E839 JP Z,$E8BC Jump to E8BC if HL is zero.
E83C LD A,($E762) B=*E762.
E83F LD B,A
E840 LD A,($E765) C=*E765.
E843 LD C,A
E844 CALL Calculate_PositionToAttributeAddress Call Calculate_PositionToAttributeAddress.
E847 POP BC Restore BC from the stack.
E848 PUSH BC Stash BC on the stack.
E849 LD A,B Jump to E854 if B is equal to 02.
E84A CP $02
E84C JR Z,$E854
E84E LD A,($E768) Write *E768 to *HL.
E851 LD (HL),A
E852 JR $E859 Jump to E859.
E854 LD A,(HL) Write *HL to *E768.
E855 LD ($E768),A
E858 LD (HL),E Write E to *HL.
E859 BIT 3,D Test bit 3 of D.
E85B JR Z,$E8BC Jump to E8BC if A is zero.
E85D LD A,($E75D) B=*Tile_Horizontal_Position.
E860 LD B,A
E861 LD A,($E765) C=*E765.
E864 LD C,A
E865 CALL Calculate_PositionToAttributeAddress Call Calculate_PositionToAttributeAddress.
E868 POP BC Restore BC from the stack.
E869 PUSH BC Stash BC on the stack.
E86A LD A,B Jump to E885 if B is equal to 02.
E86B CP $02
E86D JR Z,$E885
E86F LD A,($E769) Write *E769 to *HL.
E872 LD (HL),A
E873 LD A,($E75D) B=*Tile_Horizontal_Position.
E876 LD B,A
E877 INC B Increment B by one.
E878 LD A,($E765) C=*E765.
E87B LD C,A
E87C CALL Calculate_PositionToAttributeAddress Call Calculate_PositionToAttributeAddress.
E87F LD A,($E76A) Write *E76A to *HL.
E882 LD (HL),A
E883 JR $E89B Jump to E89B.
E885 LD A,(HL) Write *HL to *E769.
E886 LD ($E769),A
E889 LD (HL),E Write E to *HL.
E88A LD A,($E75D) B=*Tile_Horizontal_Position.
E88D LD B,A
E88E INC B Increment B by one.
E88F LD A,($E765) C=*E765.
E892 LD C,A
E893 CALL Calculate_PositionToAttributeAddress Call Calculate_PositionToAttributeAddress.
E896 LD A,(HL) Write *HL to *E76A.
E897 LD ($E76A),A
E89A LD (HL),E Write E to *HL.
E89B BIT 2,D Test bit 2 of D.
E89D JR Z,$E90A Jump to E90A if B is zero.
E89F LD A,($E763) B=*E763.
E8A2 LD B,A
E8A3 LD A,($E765) C=*E765.
E8A6 LD C,A
E8A7 CALL Calculate_PositionToAttributeAddress Call Calculate_PositionToAttributeAddress.
E8AA POP BC Restore BC from the stack.
E8AB PUSH BC Stash BC on the stack.
E8AC LD A,B Jump to E8B7 if B is equal to 02.
E8AD CP $02
E8AF JR Z,$E8B7
E8B1 LD A,($E76B) Write *E76B to *HL.
E8B4 LD (HL),A
E8B5 JR $E8BC Jump to E8BC.
E8B7 LD A,(HL) Write *HL to *E76B.
E8B8 LD ($E76B),A
E8BB LD (HL),E Write E to *HL.
E8BC BIT 2,D Test bit 2 of D.
E8BE JR Z,$E90A Jump to E90A if A is zero.
E8C0 LD A,($E763) B=*E763.
E8C3 LD B,A
E8C4 LD A,($E75E) C=*Tile_Vertical_Position.
E8C7 LD C,A
E8C8 CALL Calculate_PositionToAttributeAddress Call Calculate_PositionToAttributeAddress.
E8CB POP BC Restore BC from the stack.
E8CC PUSH BC Stash BC on the stack.
E8CD LD A,B Jump to E8DD if B is equal to 02.
E8CE CP $02
E8D0 JR Z,$E8DD
E8D2 LD A,($E76C) Write *E76C to *HL.
E8D5 LD (HL),A
E8D6 INC HL Increment HL by one.
E8D7 LD A,($E76D) Write *E76D to *HL.
E8DA LD (HL),A
E8DB JR $E8E8 Jump to E8E8.
E8DD LD A,(HL) Write *HL to *E76C.
E8DE LD ($E76C),A
E8E1 LD (HL),E Write E to *HL.
E8E2 INC HL Increment HL by one.
E8E3 LD A,(HL) Write *HL to *E76D.
E8E4 LD ($E76D),A
E8E7 LD (HL),E Write E to *HL.
E8E8 BIT 4,D Test bit 4 of D.
E8EA JP Z,$E96D Jump to E96D if HL is zero.
E8ED LD A,($E763) B=*E763.
E8F0 LD B,A
E8F1 LD A,($E764) C=*E764.
E8F4 LD C,A
E8F5 CALL Calculate_PositionToAttributeAddress Call Calculate_PositionToAttributeAddress.
E8F8 POP BC Restore BC from the stack.
E8F9 PUSH BC Stash BC on the stack.
E8FA LD A,B Jump to E905 if B is equal to 02.
E8FB CP $02
E8FD JR Z,$E905
E8FF LD A,($E76E) Write *E76E to *HL.
E902 LD (HL),A
E903 JR $E90A Jump to E90A.
E905 LD A,(HL) Write *HL to *E76E.
E906 LD ($E76E),A
E909 LD (HL),E Write E to *HL.
E90A BIT 4,D Test bit 4 of D.
E90C JR Z,$E96D Jump to E96D if A is zero.
E90E LD A,($E75D) B=*Tile_Horizontal_Position.
E911 LD B,A
E912 LD A,($E764) C=*E764.
E915 LD C,A
E916 CALL Calculate_PositionToAttributeAddress Call Calculate_PositionToAttributeAddress.
E919 POP BC Restore BC from the stack.
E91A PUSH BC Stash BC on the stack.
E91B LD A,B Jump to E936 if B is equal to 02.
E91C CP $02
E91E JR Z,$E936
E920 LD A,($E76F) Write *E76F to *HL.
E923 LD (HL),A
E924 LD A,($E75D) B=*Tile_Horizontal_Position.
E927 LD B,A
E928 INC B Increment B by one.
E929 LD A,($E764) C=*E764.
E92C LD C,A
E92D CALL Calculate_PositionToAttributeAddress Call Calculate_PositionToAttributeAddress.
E930 LD A,($E770) Write *E770 to *HL.
E933 LD (HL),A
E934 JR $E94C Jump to E94C.
E936 LD A,(HL) Write *HL to *E76F.
E937 LD ($E76F),A
E93A LD (HL),E Write E to *HL.
E93B LD A,($E75D) B=*Tile_Horizontal_Position.
E93E LD B,A
E93F INC B Increment B by one.
E940 LD A,($E764) C=*E764.
E943 LD C,A
E944 CALL Calculate_PositionToAttributeAddress Call Calculate_PositionToAttributeAddress.
E947 LD A,(HL) Write *HL to *E770.
E948 LD ($E770),A
E94B LD (HL),E Write E to *HL.
E94C BIT 1,D Test bit 1 of D.
E94E JR Z,$E96D Jump to E96D if B is zero.
E950 LD A,($E762) B=*E762.
E953 LD B,A
E954 LD A,($E764) C=*E764.
E957 LD C,A
E958 CALL Calculate_PositionToAttributeAddress Call Calculate_PositionToAttributeAddress.
E95B POP BC Restore BC from the stack.
E95C PUSH BC Stash BC on the stack.
E95D LD A,B Jump to E968 if B is equal to 02.
E95E CP $02
E960 JR Z,$E968
E962 LD A,($E771) Write *E771 to *HL.
E965 LD (HL),A
E966 JR $E96D Jump to E96D.
E968 LD A,(HL) Write *HL to *E771.
E969 LD ($E771),A
E96C LD (HL),E Write E to *HL.
E96D LD A,R A=the contents of the Memory Refresh Register.
E96F LD L,A L=A.
E970 LD H,$0A H=0A.
E972 LD A,($E763) B=*E763.
E975 LD B,A
E976 LD A,$18 A=18.
E978 SUB B A-=B.
E979 LD B,A B=A.
E97A LD A,(HL) A=*HL.
E97B AND %00011000 Keep only bits 3-4.
E97D OR %00000101 Set bits 0, 2.
E97F OUT ($FE),A Set border to the colour held by A.
E981 INC HL Increment HL by one.
E982 DJNZ $E97A Decrease counter by one and loop back to E97A until counter is zero.
E984 POP BC Restore BC from the stack.
E985 LD A,B A=B.
E986 CP $02 Jump to E98B if A is not equal to 02.
E988 JR NZ,$E98B
E98A HALT Halt operation (suspend CPU until the next interrupt).
E98B DEC B Decrease B by one.
E98C JP NZ,$E80A Jump to E80A if B is not zero.
E98F JP $E7CC Jump to E7CC.
Prev: E771 Up: Map Next: E992