1
0
mirror of https://github.com/Gehstock/Mist_FPGA.git synced 2026-01-19 01:16:58 +00:00

Merge pull request #29 from gyurco/master

Demolition Derby updates + release
This commit is contained in:
Marcel 2019-12-15 15:21:03 +01:00 committed by GitHub
commit 17e35babb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 99 additions and 19 deletions

View File

@ -1,4 +1,11 @@
WIP Missing "Turbo Cheap Squeak" Board
Demolition Derby MiST port
- support for 3/4 players
- DDERBY.ROM is needed on the SD Card. Can be created from MAME ROM filewith:
# cat demo_drby_pro_0 demo_drby_pro_1 demo_drby_pro_2 demo_drby_pro_3 tcs_u5.bin tcs_u4.bin \
demo_derby_fg0_a4.a4 demo_derby_fg4_a3.a3 demo_derby_fg1_a6.a6 demo_derby_fg5_a5.a5 \
demo_derby_fg2_a8.a8 demo_derby_fg6_a7.a7 demo_derby_fg3_a10.a10 demo_derby_fg7_a9.a9 > DDERBY.ROM
---------------------------------------------------------------------------------

View File

@ -54,10 +54,17 @@ localparam CONF_STR = {
"O5,Blend,Off,On;",
"O6,Service,Off,On;",
"O7,Swap Joystick,Off,On;",
"O8,Players,2,4;",
"O9,Difficulty,Normal,Hard;",
"OA,Trophy Girl,Full,Limited;",
"T0,Reset;",
"V,v1.1.",`BUILD_DATE
};
wire players4 = status[8];
wire difficulty = status[9];
wire girl = status[10];
assign LED = ~ioctl_downl;
assign SDRAM_CLK = clk_mem;
assign SDRAM_CKE = 1;
@ -77,6 +84,8 @@ wire [1:0] buttons;
wire [1:0] switches;
wire [7:0] joy_0;
wire [7:0] joy_1;
wire [7:0] joy_2;
wire [7:0] joy_3;
wire scandoublerD;
wire ypbpr;
wire [9:0] audio;
@ -126,7 +135,7 @@ sdram sdram(
.cpu1_addr ( ioctl_downl ? 16'hffff : {1'b0, rom_addr[15:1]} ),
.cpu1_q ( rom_do ),
.cpu2_addr ( ioctl_downl ? 16'hffff : (16'h8000 + snd_addr[14:1]) ),//Turbo Cheap Squeak
.cpu2_addr ( cpu2_addr ),//Turbo Cheap Squeak
.cpu2_q ( snd_do ),
// port2 for sprite graphics
@ -142,6 +151,8 @@ sdram sdram(
.sp_q ( sp_do )
);
reg [15:0] cpu2_addr;
// ROM download controller
always @(posedge clk_sys) begin
reg ioctl_wr_last = 0;
@ -153,6 +164,8 @@ always @(posedge clk_sys) begin
port2_req <= ~port2_req;
end
end
// register for better timings
cpu2_addr <= ioctl_downl ? 16'hffff : (16'h8000 + snd_addr[14:1]);
end
// reset signal generation
@ -194,6 +207,28 @@ spinner spinner2 (
.spin_angle(wheel2)
);
wire [5:0] wheel3;
spinner spinner3 (
.clock_40(clk_sys),
.reset(reset),
.btn_acc(),
.btn_left(m_left3),
.btn_right(m_right3),
.ctc_zc_to_2(vs),
.spin_angle(wheel3)
);
wire [5:0] wheel4;
spinner spinner4 (
.clock_40(clk_sys),
.reset(reset),
.btn_acc(),
.btn_left(m_left4),
.btn_right(m_right4),
.ctc_zc_to_2(vs),
.spin_angle(wheel4)
);
dderby dderby(
.clock_40(clk_sys),
.reset(reset),
@ -208,12 +243,12 @@ dderby dderby(
.separate_audio(1'b0),
.audio_out(audio),
.coin1(btn_coin),
.coin2(1'b0),
.coin3(1'b0),
.coin4(1'b0),
.coin2(btn_coin),
.coin3(btn_coin),
.coin4(btn_coin),
.start4(1'b0),
.start3(1'b0),
.start4(btn_four_players),
.start3(btn_three_players),
.start2(btn_two_players),
.start1(btn_one_player),
@ -221,16 +256,18 @@ dderby dderby(
.p1_fire2(m_fire1b),
.p2_fire1(m_fire2),
.p2_fire2(m_fire2b),
.p3_fire1(m_fire1),
.p3_fire2(m_fire1b),
.p4_fire1(m_fire2),
.p4_fire2(m_fire2b),
.p3_fire1(m_fire3),
.p3_fire2(m_fire3b),
.p4_fire1(m_fire4),
.p4_fire2(m_fire4b),
.wheel1(wheel1),
.wheel2(wheel2),
.wheel3(wheel3),
.wheel4(wheel4),
.service(status[6]),
.dipsw(~{3'b000, girl, 1'b0, difficulty, players4}), // NU, coins/credit, girl, free play, difficulty, 2player
.cpu_rom_addr ( rom_addr ),
.cpu_rom_do ( rom_addr[0] ? rom_do[15:8] : rom_do[7:0] ),
.snd_rom_addr ( snd_addr ),
@ -286,6 +323,8 @@ user_io(
.key_code (key_code ),
.joystick_0 (joy_0 ),
.joystick_1 (joy_1 ),
.joystick_2 (joy_2 ),
.joystick_3 (joy_3 ),
.status (status )
);
@ -311,8 +350,20 @@ wire m_right2 = joystick_1[0];
wire m_fire2 = joystick_1[4];
wire m_fire2b = joystick_1[5];
wire m_left3 = joy_2[1];
wire m_right3 = joy_2[0];
wire m_fire3 = joy_2[4];
wire m_fire3b = joy_2[5];
wire m_left4 = joy_3[1];
wire m_right4 = joy_3[0];
wire m_fire4 = joy_3[4];
wire m_fire4b = joy_3[5];
reg btn_one_player = 0;
reg btn_two_players = 0;
reg btn_three_players = 0;
reg btn_four_players = 0;
reg btn_left = 0;
reg btn_right = 0;
//reg btn_down = 0;
@ -335,6 +386,8 @@ always @(posedge clk_sys) begin
'h76: btn_coin <= key_pressed; // ESC
'h05: btn_one_player <= key_pressed; // F1
'h06: btn_two_players <= key_pressed; // F2
'h04: btn_three_players <= key_pressed; // F3
'h0C: btn_four_players <= key_pressed; // F4
// 'h14: btn_fire3 <= key_pressed; // ctrl
'h11: btn_fire2 <= key_pressed; // alt
'h29: btn_fire1 <= key_pressed; // Space

View File

@ -158,8 +158,10 @@ port(
start3 : in std_logic;
start4 : in std_logic;
wheel1 : in std_logic_vector(5 downto 0);
wheel2 : in std_logic_vector(5 downto 0);
wheel2 : in std_logic_vector(5 downto 0);
wheel3 : in std_logic_vector(5 downto 0);
wheel4 : in std_logic_vector(5 downto 0);
p1_fire1 : in std_logic;
p1_fire2 : in std_logic;
p2_fire1 : in std_logic;
@ -169,6 +171,8 @@ port(
p4_fire1 : in std_logic;
p4_fire2 : in std_logic;
dipsw : in std_logic_vector(7 downto 0); -- NU, coins/credit, girl, free play, difficulty, 2player
cpu_rom_addr : out std_logic_vector(15 downto 0);
cpu_rom_do : in std_logic_vector(7 downto 0);
snd_rom_addr : out std_logic_vector(13 downto 0);
@ -318,7 +322,8 @@ architecture struct of dderby is
-- SSIO signals
signal ssio_iowe : std_logic;
signal ssio_do : std_logic_vector(7 downto 0);
signal input_sel : std_logic;
signal input_0 : std_logic_vector(7 downto 0);
signal input_1 : std_logic_vector(7 downto 0);
signal input_2 : std_logic_vector(7 downto 0);
@ -473,10 +478,25 @@ end process;
--------------------
-- players inputs --
--------------------
process (clock_vid, reset)
begin
if reset='1' then
input_sel <= '0';
elsif rising_edge(clock_vid) then
if output_4(7) = '1' then
input_sel <= '0';
elsif output_4(6) = '1' then
input_sel <= '1';
end if;
end if;
end process;
input_0 <= '1' & '1' & not service & '1' & not start2 & not start1 & not coin2 & not coin1;
input_1 <= not wheel1 & not p1_fire2 & not p1_fire1;
input_2 <= not wheel2 & not p2_fire2 & not p2_fire1;
input_3 <= "11111111";
input_1 <= not wheel1 & not p1_fire2 & not p1_fire1 when input_sel = '0' else
not wheel3 & not p1_fire2 & not p1_fire1;
input_2 <= not wheel2 & not p2_fire2 & not p2_fire1 when input_sel = '0' else
not wheel4 & not p2_fire2 & not p2_fire1;
input_3 <= dipsw;
input_4 <= not p4_fire2 & not p4_fire1 & not p3_fire2 & not p3_fire1 & not start4 & not start3 & not coin4 & not coin3;
------------------------------------------
@ -681,7 +701,7 @@ begin
end case;
end if;
sp_palette_addr <= sp_col(1 downto 0) & sp_vid;
sp_palette_addr <= not sp_col(1 downto 0) & sp_vid;
end if;