Prev: 62072 Up: Map Next: 62310
62178: Call time-dependent routines (main interrupt routine)
Used by the routine at 65524.
Input
IY 23610
62178 CALL 62959 Store all registers on the stack
62181 BIT 0,(IY+65) If game-in-progress flag is reset...
62185 JP Z,62288 ...then skip ahead to 62288
62188 CALL 64687 If do-not-draw-storm-cloud flag is reset then draw Storm Cloud
62191 LD A,(23441) If redraw-Magic-Knight-on-next-interrupt flag is set...
62194 OR A ...
62195 CALL NZ,61823 ...then erase Magic Knight from display, advance his current position then redraw
62198 CALL 62330 Update game time, time left and move characters if appropriate
62201 LD A,(23403) Load B with MSB of Off-White-Knight-sent-to-sleep flag...
62204 AND 128 ...
62206 LD B,A ...
62207 LD A,(24782) Set Off-White Knight's asleep flag...
62210 OR B ...if MSB of Off-White-Knight-sent-to-sleep flag is set...
62211 LD (24782),A ...
The instructions between 62214 and 62252 (inclusive) are not used in the 48k version of Stormbringer. These instructions relate to the LOCATE A CHARACTER functionality that is present in the 128k version of Stormbringer - see trivia
62214 LD BC,(23471) Load x- & y- coordinate of top-left character of currently glowing "locate compass" component into BC
62218 LD A,B If this is zero (i.e. compass not glowing because Magic Knight isn't "locating")...
62219 OR C ...
62220 JR Z,62255 ...then skip ahead to 62255
62222 LD A,(23436) Load compass-glow-update flag into A
62225 INC A Invert compass-glow-update flag
62226 AND 1 Store back at 23436 and if compass-glow-update flag is set...
62228 LD (23436),A ...
62231 JR NZ,62255 ...then skip over glow attribute update section to 62255 (don't update glowing attributes this time)
62233 CALL 63219 Load HL with attribute file address for coordinates (C, B)
62236 CALL 62317 Update glowing blocks' attribute to next colour in sequence and load into E
62239 CALL 62310 Write current attribute for a glowing block to attribute file (HL) and advance HL
62242 CALL 62310 Write current attribute for a glowing block to attribute file (HL) and advance HL
62245 LD BC,30 Advance attribute file address (HL) down to next row, to the block immediately below the first one updated at instruction 62239
62248 ADD HL,BC
62249 CALL 62310 Write current attribute for a glowing block to attribute file (HL) and advance HL
62252 CALL 62310 Write current attribute for a glowing block to attribute file (HL) and advance HL
62255 BIT 1,(IY+65) If disable-in-game-glow flag is set...
62259 JP NZ,62302 ...then skip to end of interrupt routine
62262 LD IX,23368 Point IX at table of glowing attribute file addresses
62266 CALL 62317 Update glowing blocks' attribute to next colour in sequence and load into E
62269 LD L,(IX+0) Load a glowing attribute file address into HL...
62272 LD H,(IX+1) ...
62275 LD A,L If HL is zero...
62276 OR H ...
62277 JR Z,62288 ...then jump to 62288 (to exit loop)
62279 CALL 62310 Write current attribute for a glowing block to attribute file (HL) and advance HL
62282 INC IX Advance to next attribute file address in list of glowing blocks...
62284 INC IX ...
62286 JR 62269 Jump back to 62269 to update next block
62288 LD HL,(23672) Load HL with current value in lowest two bytes of frame counter...
62291 INC HL ...increase...
62292 LD (23672),HL ...and write back to memory
62295 LD A,H If these are not both zero...
62296 OR L ...
62297 JR NZ,62302 ...then skip ahead to 62302
62299 INC (IY+64) Increase most significant byte of frame counter
62302 CALL 703 Call ROM routine to read keyboard
62305 CALL 62987 Restore all registers from the stack
62308 EI Enable interrupts
62309 RET Return
Prev: 62072 Up: Map Next: 62310