Prev: E46C Up: Map Next: E63A
E51D: Animate Introduction
Used by the routine at Initialise_Game.
Animates the bats and moon on the introduction screen until a key is pressed or *PauseTimer reaches zero.
Animate_Introduction E51D LD BC,$0A14 Call Play_Tune with note length 0A14.
E520 CALL Play_Tune
E523 LD BC,($6470) Decrease *PauseTimer and jump to Start_DemoGame when it is zero.
E527 DEC BC
E528 LD A,B
E529 OR C
E52A JP Z,Start_DemoGame
E52D LD ($6470),BC Call JumpTable_Delay when *SkipDelayFlag is set.
E531 LD A,($647C)
E534 OR A
E535 LD B,$19
E537 CALL NZ,JumpTable_Delay
Advance the four frame pointers and draw them across the moon.
E53A LD HL,($E632) HL=*Pointer_IntroFrame1.
E53D LD DE,$0004 Add 0004.
E540 ADD HL,DE
E541 LD DE,$D4C1 Jump to Animate_Introduction_Frame1 unless the pointer has reached SourceCodeRemnants.
E544 PUSH HL
E545 XOR A
E546 SBC HL,DE
E548 POP HL
E549 JR NZ,Animate_Introduction_Frame1
E54B LD HL,$D381 Reset the pointer to Graphics_IntroductionFrames.
Animate_Introduction_Frame1 E54E LD ($E632),HL Write HL to *Pointer_IntroFrame1.
E551 LD DE,$4066 Draw that frame at 4066.
E554 CALL Draw_IntroUDG
E557 LD HL,($E634) HL=*Pointer_IntroFrame2.
E55A LD DE,$0002 Subtract 0002.
E55D XOR A
E55E SBC HL,DE
E560 PUSH HL Jump to Animate_Introduction_Frame2 unless the pointer has reached D37F.
E561 LD DE,$D37F
E564 SBC HL,DE
E566 POP HL
E567 JR NZ,Animate_Introduction_Frame2
E569 LD HL,$D4C1 Reset the pointer to SourceCodeRemnants.
Animate_Introduction_Frame2 E56C LD ($E634),HL Write HL to *Pointer_IntroFrame2.
E56F LD DE,$4068 Draw that frame at 4068.
E572 CALL Draw_IntroUDG
E575 LD HL,($E636) HL=*Pointer_IntroFrame3.
E578 INC HL Advance the pointer by two.
E579 INC HL
E57A PUSH HL Jump to Animate_Introduction_Frame3 unless the pointer has reached SourceCodeRemnants.
E57B LD DE,$D4C1
E57E XOR A
E57F SBC HL,DE
E581 POP HL
E582 JR NZ,Animate_Introduction_Frame3
E584 LD HL,$D381 Reset the pointer to Graphics_IntroductionFrames.
Animate_Introduction_Frame3 E587 LD ($E636),HL Write HL to *Pointer_IntroFrame3.
E58A LD DE,$406A Draw that frame at 406A.
E58D CALL Draw_IntroUDG
E590 LD HL,($E638) HL=*Pointer_IntroFrame4.
E593 LD DE,$0004 Subtract 0004.
E596 XOR A
E597 SBC HL,DE
E599 PUSH HL Jump to Animate_Introduction_Frame4 unless the pointer has reached Graphics_IntroductionFrames.
E59A LD DE,$D381
E59D SBC HL,DE
E59F POP HL
E5A0 JR NZ,Animate_Introduction_Frame4
E5A2 LD HL,$D4C1 Reset the pointer to SourceCodeRemnants.
Animate_Introduction_Frame4 E5A5 LD ($E638),HL Write HL to *Pointer_IntroFrame4.
E5A8 LD DE,$406C Draw that frame at 406C.
E5AB CALL Draw_IntroUDG
Occasionally stamp a spark on the moon.
E5AE CALL JumpTable_GetRandomNumber Call JumpTable_GetRandomNumber.
E5B1 CP $40 Jump to Animate_Introduction_Bat if the value is 40 or higher.
E5B3 JR NC,Animate_Introduction_Bat
E5B5 CP $20 Point HL at Graphics_IntroSpark when the value is 20 or higher.
E5B7 LD HL,$E5EA
E5BA JR NC,Animate_Introduction_Spark Otherwise use the second spark at E5EE.
E5BC LD HL,$E5EE
Animate_Introduction_Spark E5BF LD DE,$40D7 Point at 40D7 and copy 04 pixel rows.
E5C2 LD B,$04
Animate_Introduction_SparkLoop E5C4 LD A,(HL) Copy one pixel row and loop back to Animate_Introduction_SparkLoop until all four rows are written.
E5C5 LD (DE),A
E5C6 INC HL
E5C7 INC D
E5C8 DJNZ Animate_Introduction_SparkLoop
Occasionally stamp a bat lower down the screen.
Animate_Introduction_Bat E5CA CALL JumpTable_GetRandomNumber Call JumpTable_GetRandomNumber.
E5CD CP $40 Jump to Animate_Introduction_Key if the value is 40 or higher.
E5CF JR NC,Animate_Introduction_Key
E5D1 LD HL,$E5F2 Point HL at Graphics_IntroBatA when the value is 20 or higher.
E5D4 CP $20
E5D6 JR NC,Animate_Introduction_BatDraw
E5D8 LD HL,$E612 Otherwise use Graphics_IntroBatB.
Animate_Introduction_BatDraw E5DB LD DE,$481D Draw that bat at 481D.
E5DE CALL Draw_IntroUDG
Animate_Introduction_Key E5E1 CALL $028E Jump to Animate_Introduction if no key is pressed.
E5E4 LD A,E
E5E5 INC A
E5E6 JP Z,Animate_Introduction
E5E9 RET Return.
Graphics_IntroSpark E5EA DEFB $FB,$F9,$F8,$F8,$F8,$F8,$F8,$FB
intro-spark
Graphics_IntroBatA E5F2 DEFB $00,$00,$00,$00,$00,$08,$00,$1C
intro-bat-1
E5FA DEFB $00,$1C,$00,$3E,$00,$3E,$00,$03
E602 DEFB $3F,$FB,$7F,$F3,$7C,$07,$7F,$9E
E60A DEFB $1F,$BE,$00,$1C,$06,$1C,$00,$08
Graphics_IntroBatB E612 DEFB $00,$00,$00,$00,$00,$10,$00,$38
intro-bat-2
E61A DEFB $00,$38,$00,$7C,$00,$7C,$00,$06
E622 DEFB $7F,$F6,$FF,$E6,$F8,$0E,$FF,$3C
E62A DEFB $3F,$7C,$00,$38,$0C,$38,$00,$10
Pointer_IntroFrame1 E632 DEFW Graphics_IntroductionFrames
Pointer_IntroFrame2 E634 DEFW Graphics_IntroductionFrame2
Pointer_IntroFrame3 E636 DEFW Graphics_IntroductionFrame3
Pointer_IntroFrame4 E638 DEFW Graphics_IntroductionFrame4
View the equivalent code in Booty.
Prev: E46C Up: Map Next: E63A