Prev: C3C3 Up: Map Next: C419
C3FF: Swap the sun and moon
Used by the routine at display_sun_moon_frame.
The end of a day or a night. Type 88 is the sun and type 89 the moon; flipping bit 0 swaps them, recolours the window (colour_sun_moon) and starts the new one at the left again. Setting $5BB1 to 1 asks the player's handler to transform (chk_and_init_transform): knight by day, werewolf by night. When the moon has just given way to the sun a new day has begun, and inc_days counts it.
Input
IX sun_moon_scratchpad
toggle_day_night C3FF LD A,(IX+$00) sun to moon or moon to sun
C402 XOR $01
C404 LD (IX+$00),A
C407 CALL colour_sun_moon yellow for the sun, white for the moon
C40A LD (IX+$1A),$B0 back to the left of the window
C40E LD A,$01 the player must transform
C410 LD ($5BB1),A
C413 LD A,(sun_moon_scratchpad) moon: nothing more to do
C416 AND $01
C418 RET NZ
Prev: C3C3 Up: Map Next: C419