Prev: 40540 Up: Map Next: 40562
40548: Choose Flame Colour
Used by the routine at HandlerFlame.
Chooses a colour for the flame from the low bits of the random seed at RandomNumber. The result is a bright ink colour from red to white.
Output
A The colour
ChooseFlameColour 40548 LD A,(38549) Fetch the random seed from RandomNumber.
40551 AND %00000111 Keep only bits 0-2.
40553 CP 2 Jump to ChooseFlameColour_Bright if the colour is 2 or more.
40555 JR NC,ChooseFlameColour_Bright
40557 OR %00000110 Set bits 1-2.
ChooseFlameColour_Bright 40559 OR %01000000 Set bit 6 (bright).
40561 RET Return.
Prev: 40540 Up: Map Next: 40562