.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 ; 2 sta DRAW_PAGE ; 3 sta RANDOM_POINTER ; 3 ldy #(NUMSTARS-1) ; 2 init_stars: jsr random_star ; 6 dey ; 2 bpl init_stars ; 2nt/3 ;=========================== ;=========================== ; Main Loop ;=========================== ;=========================== starfield_loop: ;=============== ; clear screen ;=============== jsr clear_top ; 6+ ; 6047 ;=============== ; draw stars ;=============== ; start at 15 and count down (rather than 0 and count up) ldx #(NUMSTARS-1) ; 2 draw_stars: stx XX ; 3 ;================ ; calculate color ;================ lda #$ff ; want if z<16, color = 5 ; 2 sta COLOR ; if 16