.include "zp.inc" ;=========== ; CONSTANTS ;=========== NUMSTARS EQU 16 ;===================== ; Starfield ;===================== ;================================ ; Clear screen and setup graphics ;================================ jsr clear_screens ; clear top/bottom of page 0/1 jsr set_gr_page0 ; Initialize the 2kB of multiply lookup tables jsr init_multiply_tables ;=============== ; Init Variables ;=============== lda #0 sta DRAW_PAGE sta RANDOM_POINTER ldy #(NUMSTARS-1) init_stars: jsr random_star dey bpl init_stars ;=========================== ;=========================== ; Main Loop ;=========================== ;=========================== starfield_loop: ;=============== ; clear screen ;=============== jsr clear_top ;=============== ; draw stars ;=============== ; start at 15 and count down (rather than 0 and count up) ldx #(NUMSTARS-1) draw_stars: stx XX ;================ ; calculate color ;================ lda #$ff ; want if z<16, color = 5 sta COLOR ; if 16