]>
Commit | Line | Data |
---|---|---|
782690d0 MG |
1 | //===============================================================================\r |
2 | // FPGA MOONCRESTA COLOR-PALETTE\r | |
3 | //\r | |
4 | // Version : 2.00\r | |
5 | //\r | |
6 | // Copyright(c) 2004 Katsumi Degawa , All rights reserved\r | |
7 | //\r | |
8 | // Important !\r | |
9 | //\r | |
10 | // This program is freeware for non-commercial use. \r | |
11 | // An author does no guarantee about this program.\r | |
12 | // You can use this under your own risk.\r | |
13 | //\r | |
14 | // 2004- 9-18 added Xilinx Device. K.Degawa\r | |
15 | //================================================================================\r | |
16 | `include "src/mc_conf.v"\r | |
17 | \r | |
18 | module mc_col_pal(\r | |
19 | \r | |
20 | I_CLK_12M,\r | |
21 | I_CLK_6M,\r | |
22 | I_VID,\r | |
23 | I_COL,\r | |
24 | I_C_BLnX,\r | |
25 | \r | |
26 | O_C_BLX,\r | |
27 | O_STARS_OFFn,\r | |
28 | O_R,\r | |
29 | O_G,\r | |
30 | O_B\r | |
31 | \r | |
32 | );\r | |
33 | \r | |
34 | input I_CLK_12M;\r | |
35 | input I_CLK_6M;\r | |
36 | input [1:0]I_VID;\r | |
37 | input [2:0]I_COL;\r | |
38 | input I_C_BLnX;\r | |
39 | \r | |
40 | output O_C_BLX;\r | |
41 | output O_STARS_OFFn;\r | |
42 | output [2:0]O_R;\r | |
43 | output [2:0]O_G;\r | |
44 | output [1:0]O_B;\r | |
45 | \r | |
46 | //--- Parts 6M --------------------------------------------------------\r | |
47 | wire [6:0]W_6M_DI = {I_COL[2:0],I_VID[1:0],~(I_VID[0]|I_VID[1]),I_C_BLnX};\r | |
48 | reg [6:0]W_6M_DO;\r | |
49 | \r | |
50 | wire W_6M_CLR = W_6M_DI[0]|W_6M_DO[0];\r | |
51 | assign O_C_BLX = ~(W_6M_DI[0]|W_6M_DO[0]);\r | |
52 | assign O_STARS_OFFn = W_6M_DO[1];\r | |
53 | \r | |
54 | always@(posedge I_CLK_6M or negedge W_6M_CLR)\r | |
55 | begin\r | |
56 | if(W_6M_CLR==1'b0)\r | |
57 | W_6M_DO <= 7'h00;\r | |
58 | else\r | |
59 | W_6M_DO <= W_6M_DI;\r | |
60 | end\r | |
61 | //--- COL ROM --------------------------------------------------------\r | |
62 | wire [4:0]W_COL_ROM_A = W_6M_DO[6:2];\r | |
63 | wire [7:0]W_COL_ROM_DO;\r | |
64 | wire W_COL_ROM_OEn = W_6M_DO[1];\r | |
65 | \r | |
66 | `ifdef DEVICE_CYCLONE\r | |
67 | mc_col_rom COL_ROM(\r | |
68 | \r | |
69 | .I_CLK(I_CLK_12M),\r | |
70 | .I_ADDR(W_COL_ROM_A),\r | |
71 | .O_DO(W_COL_ROM_DO),\r | |
72 | .I_OEn(W_COL_ROM_OEn)\r | |
73 | \r | |
74 | );\r | |
75 | `endif\r | |
76 | `ifdef DEVICE_SPARTAN2E\r | |
77 | GALAXIAN_6L COL_ROM(\r | |
78 | .CLK(I_CLK_12M),\r | |
79 | .ADDR(W_COL_ROM_A),\r | |
80 | .DATA(W_COL_ROM_DO),\r | |
81 | .ENA(1'b1)\r | |
82 | );\r | |
83 | //RAMB4_S8 col_rom00(\r | |
84 | //\r | |
85 | //.CLK(I_CLK_12M),\r | |
86 | //.ADDR({4'b0000,W_COL_ROM_A[4:0]}),\r | |
87 | //.DI(8'h00),\r | |
88 | //.DO(W_COL_ROM_DO),\r | |
89 | //.EN(1'b1),\r | |
90 | //.WE(1'b0),\r | |
91 | //.RST(1'b0)\r | |
92 | //\r | |
93 | //);\r | |
94 | `endif\r | |
95 | //--- VID OUT --------------------------------------------------------\r | |
96 | assign O_R[0] = W_COL_ROM_DO[2];\r | |
97 | assign O_R[1] = W_COL_ROM_DO[1];\r | |
98 | assign O_R[2] = W_COL_ROM_DO[0];\r | |
99 | \r | |
100 | assign O_G[0] = W_COL_ROM_DO[5];\r | |
101 | assign O_G[1] = W_COL_ROM_DO[4];\r | |
102 | assign O_G[2] = W_COL_ROM_DO[3];\r | |
103 | \r | |
104 | assign O_B[0] = W_COL_ROM_DO[7];\r | |
105 | assign O_B[1] = W_COL_ROM_DO[6];\r | |
106 | \r | |
107 | \r | |
108 | endmodule\r |