Prev: 44216 Up: Map Next: 44253
44225: Flash border and screen and decrease Magic Knight's magic level if level is at least C
Used by the routines at 43950, 44001, 44063, 44100 and 44198.
Input
C Cost of spell
Output
A Magic Knight's magic level if less than C, otherwise zero
F Carry flag set if Magic Knight's magic level is less than C, reset otherwise
44225 LD A,(24771) Load Magic Knight's current magic level into A...
44228 AND 127 ...
44230 CP C If this is less than C...
44231 RET C ...then return
44232 LD A,(24771) Load B with unused bit...
44235 AND 128 ...
44237 LD B,A ...
44238 LD A,(24771) Load Magic Knight's current magic level into A...
44241 AND 127 ...
44243 SUB C ...subtract C...
44244 OR B ...combine with unused bit...
44245 LD (24771),A ...and store
44248 CALL 64548 Flash border and screen (as in cast a spell)
44251 XOR A Set A to zero
44252 RET Return
Prev: 44216 Up: Map Next: 44253