Prev: C394 Up: Map Next: C3A4
C397: Move the sun or moon on
Used by the routine at draw_and_copy_rects.
Called by the renderer (draw_and_copy_rects) as it finishes a frame; every eighth frame it moves the sun or moon one pixel to the right across its window in the bottom right of the screen and redraws the window. The object doing the moving is the 32-byte record at sun_moon_scratchpad, laid out like an entry in the object table.
print_sun_moon C397 LD A,($5BA2) every eighth frame
C39A AND $07
C39C RET NZ
C39D LD IX,sun_moon_scratchpad one pixel right (+$1A is the pixel X)
C3A1 INC (IX+$1A)
Prev: C394 Up: Map Next: C3A4