1 //---------------------------------------------------------------------
2 // FPGA MOONCRESTA INPORT
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.
14 // 2004-4-30 galaxian modify by K.DEGAWA
15 //---------------------------------------------------------------------
18 //---------------------------------------------------------------
20 // 1 COIN/1 PLAY 1'b0 1'b0
21 // 2 COIN/1 PLAY 1'b1 1'b0
22 // 1 COIN/2 PLAY 1'b0 1'b1
23 // FREE PLAY 1'b1 1'b1
43 I_1P_START, // ACTIVE HI
44 I_2P_START, // ACTIVE HI
71 wire W_TABLE = 0; // UP TYPE = 0;
73 wire [5:0]W_DIP_D = {1'b0,1'b1,1'b0,1'b0,1'b0,1'b0};
74 wire [7:0]W_SW0_DI = { 1'b0, 1'b0, W_TABLE, I_1P_SH, I_1P_RI, I_1P_LE, I_COIN2, I_COIN1};
75 wire [7:0]W_SW1_DI = {W_DIP_D[1],W_DIP_D[0], 1'b0, I_2P_SH, I_2P_RI, I_2P_LE,I_2P_START,I_1P_START};
76 wire [7:0]W_DIP_DI = { 1'b0, 1'b0, 1'b0, 1'b0,W_DIP_D[5],W_DIP_D[4],W_DIP_D[3],W_DIP_D[2]};
78 wire [7:0]W_SW0_DO = I_SW0_OEn ? 8'h00 : W_SW0_DI;
79 wire [7:0]W_SW1_DO = I_SW1_OEn ? 8'h00 : W_SW1_DI;
80 wire [7:0]W_DIP_DO = I_DIP_OEn ? 8'h00 : W_DIP_DI;
82 assign O_D = W_SW0_DO | W_SW1_DO | W_DIP_DO ;