Prev: 54053 Up: Map Next: 54120
54065: Flash the 'MAGIC' text in the bottom left (if Maroc has picked up a spell) and trigger sound effect
Used by the routine at 51178.
Input
HL Address pointer (60092/60094) to first byte of one of the data sets at 31744 (the one after the last set copied in the previous routine)
Jump here from 51152 after copying graphics data to banks at 31744
If Maroc picks up a spell, the 'Magic' text in the bottom left changes colour for a short time, and a sound is played
flashing indicator when Maroc picks up a spell
54065 LD HL,(60094) Address pointer to start of next data set (at 31744)
54068 LD (HL),255 Add end-of-data marker to the first byte of the set
54070 LD (60274),HL Copy address pointer into store
Check if the post-scroll-pickup effect (colour/sound) needs to be actioned:
54073 LD A,(60576) This is the counter byte for flashing the 'MAGIC' text in the bottom left of the screen.
54076 CP 0
54078 JR Z,54120 If it's zero, no need for flashing & playing sound - skip to the next routine
Change the colour of the 'Magic' text in the bottom left of the screen and play a sound.
54080 DEC A Decrement the 'flashing' counter, and re-store
54081 LD (60576),A
54084 JR NZ,54088 Check if now zero
54086 LD A,48 If so, reset the final colour change to yellow (INK 0, PAPER 6), otherwise the counter would make it INK 0, PAPER 0 (invisible).
At the start of the game the lower part of 'MAGIC' is white, but will subsequently be yellow once the first spell is collected (see the animated image on this page).
Change the colour of the word 'MAGIC':
54088 LD DE,28 Prepare an offset of 28 character spaces ready to move down to the next line of the screen
54091 LD C,2 2 character rows to colour
54093 LD HL,23234 Screen display address for the top left of the word 'MAGIC'
54096 LD B,4 4 characters wide
54098 LD (HL),A Colour the character square (colour = counter byte value)
54099 INC HL Move right one character square
54100 DJNZ 54098 Repeat x 4
54102 ADD HL,DE Jump down to the next character row, over to the left again
54103 DEC C Decrement the row counter
54104 JR NZ,54096 ...And repeat for 2 rows
Play sound effect:
54106 LD C,128 Outer loop - duration counter
54108 LD A,16 Speaker bit 4 (16)
Speaker toggle loop:
54110 XOR 16 Toggle speaker bit
54112 OUT (254),A Output sound
54114 LD B,C Get duration counter
54115 DJNZ 54115 ...short pause for duration value of counter
54117 DEC C Decrement duration counter
54118 JR NZ,54110 Repeat loop until sound duration counter = 0
Prev: 54053 Up: Map Next: 54120