1 //===============================================================================
2 // FPGA MOONCRESTA STARS
6 // Copyright(c) 2004 Katsumi Degawa , All rights reserved
10 // This program is freeware for non-commercial use.
11 // An author does no guarantee about this program.
12 // You can use this under your own risk.
15 //================================================================================
54 wire W_V_SYNCn = ~I_V_SYNC;
56 wire CLK_1C = ~(I_CLK_18M & I_CLK_6M & W_V_SYNCn & I_256HnX);
59 always@(posedge CLK_1C or negedge W_V_SYNCn)
61 if(W_V_SYNCn==1'b0)begin
71 wire CLK_1AB = ~(CLK_1C |(~(I_H_FLIP|W_1C_Q2))) ;
75 wire W_3B = W_2D_Qn^W_1AB_Q[4];
77 always@(posedge CLK_1AB or negedge I_STARS_ON)
79 if(I_STARS_ON==1'b0)begin
84 W_1AB_Q <= {W_1AB_Q[14:0],W_3B};
85 W_2D_Qn <= ~W_1AB_Q[15];
89 wire W_2A = ~(& W_1AB_Q[7:0]);
90 wire W_4P = ~(( I_8HF ^ I_1VF ) & W_2D_Qn & I_STARS_OFFn);
92 assign O_R[2] = 1'b0 ;
93 assign O_R[1] = (W_2A|W_4P) ? 1'b0 : W_1AB_Q[8] ;
94 assign O_R[0] = (W_2A|W_4P) ? 1'b0 : W_1AB_Q[9] ;
96 assign O_G[2] = 1'b0 ;
97 assign O_G[1] = (W_2A|W_4P) ? 1'b0 : W_1AB_Q[10] ;
98 assign O_G[0] = (W_2A|W_4P) ? 1'b0 : W_1AB_Q[11] ;
100 assign O_B[1] = (W_2A|W_4P) ? 1'b0 : W_1AB_Q[12] ;
101 assign O_B[0] = (W_2A|W_4P) ? 1'b0 : W_1AB_Q[13] ;
104 always@(posedge I_2V) noise <= W_2D_Qn ;
105 assign O_NOISE = noise ;