]>
Commit | Line | Data |
---|---|---|
782690d0 | 1 | module galaxian_roms( |
556154d1 | 2 | I_ROM_CLK, |
782690d0 MG |
3 | I_ADDR, |
4 | O_DATA | |
5 | ); | |
6 | ||
556154d1 | 7 | input I_ROM_CLK; |
782690d0 MG |
8 | input [18:0]I_ADDR; |
9 | output [7:0]O_DATA; | |
10 | ||
11 | //CPU-Roms | |
12 | wire [7:0]U_ROM_D; | |
782690d0 MG |
13 | |
14 | GALAXIAN_U U_ROM( | |
556154d1 | 15 | .CLK(I_ROM_CLK), |
b884ab49 | 16 | .ADDR(I_ADDR[10:0]), |
782690d0 MG |
17 | .DATA(U_ROM_D), |
18 | .ENA(1'b1) | |
19 | ); | |
20 | ||
21 | wire [7:0]V_ROM_D; | |
782690d0 MG |
22 | |
23 | GALAXIAN_V V_ROM( | |
556154d1 | 24 | .CLK(I_ROM_CLK), |
b884ab49 | 25 | .ADDR(I_ADDR[10:0]), |
782690d0 MG |
26 | .DATA(V_ROM_D), |
27 | .ENA(1'b1) | |
28 | ); | |
29 | ||
30 | wire [7:0]W_ROM_D; | |
782690d0 MG |
31 | |
32 | GALAXIAN_W W_ROM( | |
556154d1 | 33 | .CLK(I_ROM_CLK), |
b884ab49 | 34 | .ADDR(I_ADDR[10:0]), |
782690d0 MG |
35 | .DATA(W_ROM_D), |
36 | .ENA(1'b1) | |
37 | ); | |
38 | ||
39 | wire [7:0]Y_ROM_D; | |
782690d0 MG |
40 | |
41 | GALAXIAN_Y Y_ROM( | |
556154d1 | 42 | .CLK(I_ROM_CLK), |
b884ab49 | 43 | .ADDR(I_ADDR[10:0]), |
782690d0 MG |
44 | .DATA(Y_ROM_D), |
45 | .ENA(1'b1) | |
46 | ); | |
47 | ||
48 | //7L CPU-Rom | |
49 | wire [7:0]L_ROM_D; | |
782690d0 MG |
50 | |
51 | GALAXIAN_7L L_ROM( | |
556154d1 | 52 | .CLK(I_ROM_CLK), |
b884ab49 | 53 | .ADDR(I_ADDR[10:0]), |
782690d0 MG |
54 | .DATA(L_ROM_D), |
55 | .ENA(1'b1) | |
56 | ); | |
57 | ||
58 | //1K VID-Rom | |
59 | wire [7:0]K_ROM_D; | |
782690d0 MG |
60 | |
61 | GALAXIAN_1K K_ROM( | |
556154d1 | 62 | .CLK(I_ROM_CLK), |
b884ab49 | 63 | .ADDR(I_ADDR[10:0]), |
782690d0 MG |
64 | .DATA(K_ROM_D), |
65 | .ENA(1'b1) | |
66 | ); | |
67 | ||
68 | //1H VID-Rom | |
69 | wire [7:0]H_ROM_D; | |
782690d0 MG |
70 | |
71 | GALAXIAN_1H H_ROM( | |
556154d1 | 72 | .CLK(I_ROM_CLK), |
b884ab49 | 73 | .ADDR(I_ADDR[10:0]), |
782690d0 MG |
74 | .DATA(H_ROM_D), |
75 | .ENA(1'b1) | |
76 | ); | |
77 | ||
78 | reg [7:0]DATA_OUT; | |
37f1bdd7 | 79 | reg [7:0]DATA_OUT2; |
782690d0 MG |
80 | |
81 | // address map | |
82 | //-------------------------------------------------- | |
83 | // 0x00000 - 0x007FF galmidw.u CPU-ROM | |
84 | // 0x00800 - 0x00FFF galmidw.v CPU-ROM | |
85 | // 0x01000 - 0x017FF galmidw.w CPU-ROM | |
86 | // 0x01800 - 0x01FFF galmidw.y CPU-ROM | |
87 | // 0x02000 - 0x027FF 7l CPU-ROM | |
88 | // 0x04000 - 0x047FF 1k.bin VID-ROM | |
89 | // 0x05000 - 0x057FF 1h.bin VID-ROM | |
90 | // 0x10000 - 0x3FFFF mc_wav_2.bin Sound(Wav)Data | |
556154d1 | 91 | always@(posedge I_ROM_CLK) |
782690d0 MG |
92 | begin |
93 | if (I_ADDR <= 18'h7ff) begin | |
94 | //u | |
782690d0 MG |
95 | DATA_OUT <= U_ROM_D; |
96 | end | |
b884ab49 | 97 | else if (I_ADDR >= 18'h800 && I_ADDR <= 18'hfff) begin |
782690d0 | 98 | //v |
782690d0 MG |
99 | DATA_OUT <= V_ROM_D; |
100 | end | |
b884ab49 | 101 | else if (I_ADDR >= 18'h1000 && I_ADDR <= 18'h17ff) begin |
782690d0 | 102 | //w |
782690d0 MG |
103 | DATA_OUT <= W_ROM_D; |
104 | end | |
b884ab49 | 105 | else if (I_ADDR >= 18'h1800 && I_ADDR <= 18'h1fff) begin |
782690d0 | 106 | //y |
782690d0 MG |
107 | DATA_OUT <= Y_ROM_D; |
108 | end | |
b884ab49 | 109 | else if (I_ADDR >= 18'h2000 && I_ADDR <= 18'h27ff) begin |
782690d0 | 110 | //7l |
782690d0 MG |
111 | DATA_OUT <= L_ROM_D; |
112 | end | |
b884ab49 | 113 | else if (I_ADDR >= 18'h4000 && I_ADDR <= 18'h47ff) begin |
782690d0 | 114 | //1k |
782690d0 MG |
115 | DATA_OUT <= K_ROM_D; |
116 | end | |
b884ab49 | 117 | else if (I_ADDR >= 18'h5000 && I_ADDR <= 18'h57ff) begin |
782690d0 | 118 | //1h |
782690d0 MG |
119 | DATA_OUT <= H_ROM_D; |
120 | end | |
b884ab49 | 121 | else if (I_ADDR >= 18'h10000 && I_ADDR <= 18'h3fff) begin |
ccb8c4aa MG |
122 | //sound |
123 | DATA_OUT <= 8'h00; | |
124 | end | |
b884ab49 | 125 | else begin |
475bf7e7 | 126 | DATA_OUT <= DATA_OUT; |
b884ab49 | 127 | end |
782690d0 MG |
128 | end |
129 | ||
556154d1 | 130 | assign O_DATA = DATA_OUT; |
782690d0 MG |
131 | |
132 | endmodule |