-### UCF file for FPGA-MOONCRST on XC2S200E
-#
+CONFIG PART = XC3SD1800A-FG676-4;
+
+NET I_CLK_125M TNM_NET = clk_ref_grp;
+TIMESPEC TS01 = PERIOD : clk_ref_grp : 8.00 : PRIORITY 1; #125 MHz
+
+TIMESPEC TS11=FROM:PADS:TO:FFS : 30 ns;
+TIMESPEC TS12=FROM:FFS:TO:PADS : 30 ns;
+
#---------- MasterClock 18.432MHz ----------
NET "I_CLK_125M" LOC = "F13" | IOSTANDARD = LVCMOS33;
#-------------------------------------------
wire W_CLK_6M,WB_CLK_6M;\r
wire W_STARS_CLK;\r
\r
-dcm clockgen(\r
+mc_dcm clockgen(\r
.CLKIN_IN(I_CLK_125M),\r
.RST_IN(! W_RESETn),\r
.CLKFX_OUT(I_CLK_18432M)\r
//assign O_ROM_WEn = 1'b1;\r
\r
galaxian_roms ROMS(\r
-.I_CLK_18432M(I_CLK_18432M),\r
.I_CLK_12M(WB_CLK_12M),\r
.I_ADDR(ROM_A),\r
.O_DATA(ROM_D)\r
wire [7:0]W_VF_CNT = I_V_CNT[7:0]^{8{I_V_FLIP}};\r
\r
assign O_8HF = W_HF_CNT[3];\r
-assign O_1VF = I_V_CNT[0]^1'b1; //XXX: breaks when flipped\r
+assign O_1VF = W_VF_CNT[0];\r
\r
reg [7:0]W_OBJ_D;\r
wire [3:0]W_6J_DA = {I_H_FLIP , W_HF_CNT[7],W_HF_CNT[3],I_H_CNT[2]};\r
module galaxian_roms(
-I_CLK_18432M,
I_CLK_12M,
I_ADDR,
O_DATA
);
input I_CLK_12M;
-input I_CLK_18432M;
input [18:0]I_ADDR;
output [7:0]O_DATA;
//CPU-Roms
wire [7:0]U_ROM_D;
-reg [10:0]U_ROM_A;
GALAXIAN_U U_ROM(
.CLK(I_CLK_12M),
-.ADDR(U_ROM_A),
+.ADDR(I_ADDR[10:0]),
.DATA(U_ROM_D),
.ENA(1'b1)
);
wire [7:0]V_ROM_D;
-reg [10:0]V_ROM_A;
GALAXIAN_V V_ROM(
.CLK(I_CLK_12M),
-.ADDR(V_ROM_A),
+.ADDR(I_ADDR[10:0]),
.DATA(V_ROM_D),
.ENA(1'b1)
);
wire [7:0]W_ROM_D;
-reg [10:0]W_ROM_A;
GALAXIAN_W W_ROM(
.CLK(I_CLK_12M),
-.ADDR(W_ROM_A),
+.ADDR(I_ADDR[10:0]),
.DATA(W_ROM_D),
.ENA(1'b1)
);
wire [7:0]Y_ROM_D;
-reg [10:0]Y_ROM_A;
GALAXIAN_Y Y_ROM(
.CLK(I_CLK_12M),
-.ADDR(Y_ROM_A),
+.ADDR(I_ADDR[10:0]),
.DATA(Y_ROM_D),
.ENA(1'b1)
);
//7L CPU-Rom
wire [7:0]L_ROM_D;
-reg [10:0]L_ROM_A;
GALAXIAN_7L L_ROM(
.CLK(I_CLK_12M),
-.ADDR(L_ROM_A),
+.ADDR(I_ADDR[10:0]),
.DATA(L_ROM_D),
.ENA(1'b1)
);
//1K VID-Rom
wire [7:0]K_ROM_D;
-reg [10:0]K_ROM_A;
GALAXIAN_1K K_ROM(
.CLK(I_CLK_12M),
-.ADDR(K_ROM_A),
+.ADDR(I_ADDR[10:0]),
.DATA(K_ROM_D),
.ENA(1'b1)
);
//1H VID-Rom
wire [7:0]H_ROM_D;
-reg [10:0]H_ROM_A;
GALAXIAN_1H H_ROM(
.CLK(I_CLK_12M),
-.ADDR(H_ROM_A),
+.ADDR(I_ADDR[10:0]),
.DATA(H_ROM_D),
.ENA(1'b1)
);
// 0x04000 - 0x047FF 1k.bin VID-ROM
// 0x05000 - 0x057FF 1h.bin VID-ROM
// 0x10000 - 0x3FFFF mc_wav_2.bin Sound(Wav)Data
-always
+always@(I_ADDR or U_ROM_D or V_ROM_D or W_ROM_D or Y_ROM_D or L_ROM_D or K_ROM_D or H_ROM_D)
begin
if (I_ADDR <= 18'h7ff) begin
//u
- U_ROM_A <= I_ADDR[10:0];
DATA_OUT <= U_ROM_D;
end
- if (I_ADDR >= 18'h800 && I_ADDR <= 18'hfff) begin
+ else if (I_ADDR >= 18'h800 && I_ADDR <= 18'hfff) begin
//v
- V_ROM_A <= I_ADDR[10:0];
DATA_OUT <= V_ROM_D;
end
- if (I_ADDR >= 18'h1000 && I_ADDR <= 18'h17ff) begin
+ else if (I_ADDR >= 18'h1000 && I_ADDR <= 18'h17ff) begin
//w
- W_ROM_A <= I_ADDR[10:0];
DATA_OUT <= W_ROM_D;
end
- if (I_ADDR >= 18'h1800 && I_ADDR <= 18'h1fff) begin
+ else if (I_ADDR >= 18'h1800 && I_ADDR <= 18'h1fff) begin
//y
- Y_ROM_A <= I_ADDR[10:0];
DATA_OUT <= Y_ROM_D;
end
- if (I_ADDR >= 18'h2000 && I_ADDR <= 18'h27ff) begin
+ else if (I_ADDR >= 18'h2000 && I_ADDR <= 18'h27ff) begin
//7l
- L_ROM_A <= I_ADDR[10:0];
DATA_OUT <= L_ROM_D;
end
- if (I_ADDR >= 18'h4000 && I_ADDR <= 18'h47ff) begin
+ else if (I_ADDR >= 18'h4000 && I_ADDR <= 18'h47ff) begin
//1k
- K_ROM_A <= I_ADDR[10:0];
DATA_OUT <= K_ROM_D;
end
- if (I_ADDR >= 18'h5000 && I_ADDR <= 18'h57ff) begin
+ else if (I_ADDR >= 18'h5000 && I_ADDR <= 18'h57ff) begin
//1h
- H_ROM_A <= I_ADDR[10:0];
DATA_OUT <= H_ROM_D;
end
- if (I_ADDR >= 18'h10000 && I_ADDR <= 18'h3fff) begin
+ else if (I_ADDR >= 18'h10000 && I_ADDR <= 18'h3fff) begin
//sound
DATA_OUT <= 8'h00;
end
+ else begin
+ DATA_OUT <= 8'h00;
+ end
end
assign O_DATA = DATA_OUT;