Prev: AE8F Up: Map Next: AECF
AEA1: Flash Score Label
Used by the routine at GamePlayEntry.
Used while the game is waiting to start the active player. Makes a low tone every sixteen frames and flashes the score label of the active player ("1UP" or "2UP").
Input
HL Address of the delay counter in GameDelayTimer
ScoreLabelFlash AEA1 LD A,(HL) Fetch the start-of-turn delay.
AEA2 AND %00001111 Keep only bits 0-3.
AEA4 CALL Z,PlayLowTone Play the low tone if the start-of-turn delay is a multiple of 10 (every sixteenth frame).
AEA7 LD A,($969E) Jump to FlashScoreLabel2UP to flash the 2UP score label if 2UP is the active player (Flag_ActivePlayer is not zero).
AEAA AND A
AEAB JR NZ,FlashScoreLabel2UP
Flash 1UP score label.
AEAD LD HL,$0010 HL=00,10 (position of the 1UP score label).
Set flash state for the 3-attributes of the score label.
FlashText AEB0 CALL AttributeAddress Find the attribute address of the score label.
AEB3 LD B,$03 Set the letter counter in B to 03 (one for each letter of a score label).
FlashText_Loop AEB5 LD A,(HL) Fetch the attribute byte.
AEB6 OR %10000000 Ensure bit 7 is set (the flash bit).
AEB8 LD (HL),A Write the attribute byte back.
AEB9 INC HL Move onto the next attribute.
AEBA DJNZ FlashText_Loop Decrease the letter counter by one and loop back to FlashText_Loop until all three letters have been flashed.
AEBC RET Return.
This entry point is used by the routine at GamePlayEntry.
Unset flash state for the 3-attributes of the score label.
UnsetFlashText AEBD CALL AttributeAddress Find the attribute address of the score label.
AEC0 LD B,$03 Set the letter counter in B to 03 (one for each letter of a score label).
UnsetFlashText_Loop AEC2 LD A,(HL) Fetch the attribute byte.
AEC3 AND %01111111 Keep only bits 0-6 (i.e. everything except the flash bit).
AEC5 LD (HL),A Write the attribute byte back.
AEC6 INC HL Move onto the next attribute.
AEC7 DJNZ UnsetFlashText_Loop Decrease the letter counter by one and loop back to UnsetFlashText_Loop until all three letters have been unflashed.
AEC9 RET Return.
Flash 2UP score label.
FlashScoreLabel2UP AECA LD HL,$00D8 HL=00,D8 (position of the 2UP score label).
AECD JR FlashText Jump to FlashText.
View the equivalent code in;
Prev: AE8F Up: Map Next: AECF