Prev: EC39 Up: Map Next: ECAF
EC5A: Static Animation
Used by the routine at Game_Initialisation.
static
StaticAnimation EC5A LD B,$4B B=4B.
StaticAnimation_0 EC5C PUSH BC Stash BC on the stack.
EC5D LD B,$04 B=04.
EC5F LD C,$16 C=16.
StaticAnimation_1 EC61 LD A,R A=the contents of the Memory Refresh Register.
EC63 AND %00001111 Keep only bits 0-3.
EC65 LD D,A D=A.
EC66 LD A,R E=the contents of the Memory Refresh Register.
EC68 LD E,A
EC69 PUSH BC Stash BC on the stack.
EC6A CALL Calculate_ScreenBlockAddress Call Calculate_ScreenBlockAddress.
EC6D EX DE,HL Exchange the DE and HL registers.
EC6E LD B,$08 B=08.
StaticAnimation_2 EC70 PUSH BC Stash BC and DE on the stack.
EC71 PUSH DE
EC72 LD BC,$000A BC=000A.
EC75 LDIR LDIR.
EC77 POP DE Restore DE from the stack.
EC78 INC D Increment D by one.
EC79 POP BC Restore BC from the stack.
EC7A DJNZ StaticAnimation_2 Decrease counter by one and loop back to StaticAnimation_2 until counter is zero.
EC7C POP BC Restore BC from the stack.
EC7D INC B Increment B by one.
EC7E LD A,$0C Jump to StaticAnimation_1 if B is not equal to 0C.
EC80 CP B
EC81 JR NZ,StaticAnimation_1
EC83 LD H,$05 H=05.
EC85 LD BC,$012C BC=012C.
StaticAnimation_3 EC88 LD A,(HL) A=*HL.
EC89 AND %00011000 Keep only bits 3-4.
EC8B OR %00000101 Set bits 0, 2.
EC8D OUT ($FE),A Set border to the colour held by A.
EC8F INC HL Increment HL by one.
EC90 DEC BC Decrease BC by one.
EC91 LD A,B Jump to StaticAnimation_3 if BC is not zero.
EC92 OR C
EC93 JR NZ,StaticAnimation_3
EC95 POP BC Restore BC from the stack.
EC96 DJNZ StaticAnimation_0 Decrease counter by one and loop back to StaticAnimation_0 until counter is zero.
Now clear the display.
EC98 LD HL,$5896 HL=5896 (attribute buffer location).
EC9B LD DE,$0020 DE=0020.
EC9E LD B,$08 B=08.
StaticAnimation_4 ECA0 PUSH HL Stash HL and BC on the stack.
ECA1 PUSH BC
ECA2 LD B,$0A B=0A.
StaticAnimation_5 ECA4 LD (HL),$00 Write 00 to *HL.
ECA6 INC HL Increment HL by one.
ECA7 DJNZ StaticAnimation_5 Decrease counter by one and loop back to StaticAnimation_5 until counter is zero.
ECA9 POP BC Restore BC and HL from the stack.
ECAA POP HL
ECAB ADD HL,DE HL+=DE.
ECAC DJNZ StaticAnimation_4 Decrease counter by one and loop back to StaticAnimation_4 until counter is zero.
ECAE RET Return.
Prev: EC39 Up: Map Next: ECAF