Prev: 31769 Up: Map Next: 31919
31888: Flash Menu Selection
Used by the routine at GameInitialisation.
Updates three consecutive entries of the menu attribute table so that only the selected entry has its flash (bit 7) set. After the first rotation, bits 0-1 of A hold the number of the selected entry (0 to 2), which counts down as each entry is processed; the entry where it reaches zero is flashed.
Input
A Options, with the selection in bits 1-2
B Number of entries (always 3)
HL First attribute table entry
Output
HL Entry after the last one updated
FlashSelection 31888 RRCA Rotate A right, which brings the selection into bits 0-1.
FlashSelection_Loop 31889 AND %00000011 Keep only bits 0-1.
31891 JR Z,FlashSelection_Selected Jump to FlashSelection_Selected if this is the selected entry, which is when the selection number has counted down to zero.
31893 CALL FlashSelection_Clear Call FlashSelection_Clear to stop this entry flashing.
FlashSelection_Next 31896 DEC A Decrease the selection number by one.
31897 DJNZ FlashSelection_Loop Decrease the entry counter by one and loop back to FlashSelection_Loop until all three entries have been updated.
31899 RET Return.
FlashSelection_Selected 31900 CALL FlashSelection_Set Call FlashSelection_Set to make this entry flash.
31903 JR FlashSelection_Next Jump back to FlashSelection_Next to move on to the next menu entry.
These instructions are never used.
31905 SET 7,(HL) Set bit 7 of *HL.
31907 INC HL Move HL on to the next menu entry.
Stop one entry flashing and move on to the next.
FlashSelection_Clear 31908 RES 7,(HL) Reset bit 7 of *HL.
31910 INC HL Move HL on to the next menu entry.
31911 RET Return.
These instructions are never used.
31912 RES 7,(HL) Reset bit 7 of *HL.
31914 INC HL Move HL on to the next menu entry.
Make one entry flash and move on to the next.
FlashSelection_Set 31915 SET 7,(HL) Set bit 7 of *HL.
31917 INC HL Move HL on to the next menu entry.
31918 RET Return.
Prev: 31769 Up: Map Next: 31919