Prev: C3FF Up: Map Next: C432
C419: A new day
Adds one to the day count at $5BB9, which is kept in binary-coded decimal for printing. Reaching day 40 ends the game (game_over); otherwise the new number is printed and copied to the screen, and the sun's window redrawn.
inc_days C419 LD HL,$5BB9 days + 1, in BCD
C41C LD A,(HL)
C41D ADD A,$01
C41F DAA
C420 LD (HL),A
C421 CP $40 forty days: game over
C423 JP Z,game_over
C426 CALL print_days copy the 16 by 8 pixel patch holding the number, at pixel (120, 0), to the screen
C429 LD BC,$0078
C42C CALL blit_2x8
C42F JP display_frame redraw the window with the new sun
Prev: C3FF Up: Map Next: C432