1
0
mirror of https://github.com/Gehstock/Mist_FPGA.git synced 2026-01-22 18:31:06 +00:00

Add Dogfight Game on Two Tigers

This commit is contained in:
Gehstock 2019-11-11 10:59:22 +01:00
parent dff4a5a120
commit c86b08dab5
4 changed files with 55 additions and 44 deletions

View File

@ -11,6 +11,9 @@
Down : Down
Fire : Space
Bomb : ALT
Player 1 Keyboard or Joystick1
Player 2 Joystick2
---------------------------------------------------------------------------------
-- DE10_lite Top level for Kick (Midway MCR) by Dar (darfpga@aol.fr) (19/10/2019)
-- http://darfpga.blogspot.fr

View File

@ -52,7 +52,7 @@ localparam CONF_STR = {
"O34,Scanlines,Off,25%,50%,75%;",
"O5,Blend,Off,On;",
"O6,Service,Off,On;",
"O7,Allow Continue,Off,On;",
//"O7,Spinner Speed,Low,High;",
"T0,Reset;",
"V,v1.0.",`BUILD_DATE
};
@ -179,18 +179,21 @@ satans_hollow satans_hollow(
.audio_out_r(audio_r),
.coin1(btn_coin),
.coin2(1'b0),
.start3(),//dogfight
.start3(btn_dogfight),
.start2(btn_two_players),
.start1(btn_one_player),
.up(m_up),
.down(m_down),
.fire(m_fire),
.bomb(m_bomb),
.speed(1),
.cont(status[7]),
.cocktail(0),
.coin_meters(1),
.up1(m_up1),
.down1(m_down1),
.fire1(m_fire1),
.bomb1(m_bomb1),
.up2(m_up2),
.down2(m_down2),
.fire2(m_fire2),
.bomb2(m_bomb2),
.speed(status[7]),
.service(status[6]),
.cpu_rom_addr ( rom_addr ),
.cpu_rom_do ( rom_addr[0] ? rom_do[15:8] : rom_do[7:0] ),
@ -261,22 +264,21 @@ dac_r(
.dac_o(AUDIO_R)
);
wire m_up = btn_up | joystick_0[3] | joystick_1[3];
wire m_down = btn_down | joystick_0[2] | joystick_1[2];
//wire m_left = btn_left | joystick_0[1] | joystick_1[1];
//wire m_right = btn_right | joystick_0[0] | joystick_1[0];
wire m_fire = btn_fire1 | joystick_0[4] | joystick_1[4];
wire m_bomb = btn_fire2 | joystick_0[5] | joystick_1[5];
wire m_up1 = btn_up | joystick_0[3];
wire m_down1 = btn_down | joystick_0[2];
wire m_fire1 = btn_fire1 | joystick_0[4];
wire m_bomb1 = btn_fire2 | joystick_0[5];
wire m_up2 = joystick_1[3];
wire m_down2 = joystick_1[2];
wire m_fire2 = joystick_1[4];
wire m_bomb2 = joystick_1[5];
reg btn_one_player = 0;
reg btn_two_players = 0;
reg btn_left = 0;
reg btn_right = 0;
reg btn_dogfight = 0;
reg btn_down = 0;
reg btn_up = 0;
reg btn_f = 0;
reg btn_g = 0;
reg btn_t = 0;
reg btn_fire1 = 0;
reg btn_fire2 = 0;
//reg btn_fire3 = 0;
@ -290,12 +292,10 @@ always @(posedge clk_sys) begin
case(key_code)
'h75: btn_up <= key_pressed; // up
'h72: btn_down <= key_pressed; // down
'h6B: btn_left <= key_pressed; // left
'h74: btn_right <= key_pressed; // right
'h76: btn_coin <= key_pressed; // ESC
'h05: btn_one_player <= key_pressed; // F1
'h06: btn_two_players <= key_pressed; // F2
// 'h14: btn_fire3 <= key_pressed; // ctrl
'h04: btn_dogfight <= key_pressed; // F3
'h11: btn_fire2 <= key_pressed; // alt
'h29: btn_fire1 <= key_pressed; // Space
endcase

View File

@ -148,17 +148,18 @@ port(
start1 : in std_logic;
start2 : in std_logic;
start3 : in std_logic;
up : in std_logic;
down : in std_logic;
speed : in std_logic;
fire : in std_logic;
bomb : in std_logic;
up1 : in std_logic;
down1 : in std_logic;
fire1 : in std_logic;
bomb1 : in std_logic;
up2 : in std_logic;
down2 : in std_logic;
fire2 : in std_logic;
bomb2 : in std_logic;
coin_meters : in std_logic;
cocktail : in std_logic;
cont : in std_logic;
service : in std_logic;
dbg_cpu_addr : out std_logic_vector(15 downto 0);
@ -306,10 +307,11 @@ architecture struct of satans_hollow is
signal input_4 : std_logic_vector(7 downto 0);
signal vga_s_r : std_logic;
signal spin_count : std_logic_vector(9 downto 0);
signal spin_count1 : std_logic_vector(9 downto 0);
signal spin_count2 : std_logic_vector(9 downto 0);
signal vga_vs : std_logic;
signal angle : std_logic_vector(6 downto 0);
signal angle_c : std_logic_vector(6 downto 0);
signal angle1 : std_logic_vector(6 downto 0);
signal angle2 : std_logic_vector(6 downto 0);
begin
clock_vid <= clock_40;
@ -324,19 +326,25 @@ begin
if vga_s_r ='0' and vga_vs = '1' then
if speed = '0' then
if down = '1' then spin_count <= spin_count - 30; end if;
if up = '1' then spin_count <= spin_count + 30; end if;
if down1 = '1' then spin_count1 <= spin_count1 - 30; end if;
if up1 = '1' then spin_count1 <= spin_count1 + 30; end if;
if down2 = '1' then spin_count2 <= spin_count2 - 30; end if;
if up2 = '1' then spin_count2 <= spin_count2 + 30; end if;
else
if down = '1' then spin_count <= spin_count - 40; end if;
if up = '1' then spin_count <= spin_count + 40; end if;
if down1 = '1' then spin_count1 <= spin_count1 - 40; end if;
if up1 = '1' then spin_count1 <= spin_count1 + 40; end if;
if down2 = '1' then spin_count2 <= spin_count2 - 40; end if;
if up2 = '1' then spin_count2 <= spin_count2 + 40; end if;
end if;
end if;
end if;
end process;
angle <= spin_count(9 downto 3);
angle_c <= spin_count(9 downto 3);
angle1 <= spin_count1(9 downto 3);
angle2 <= spin_count2(9 downto 3);
-- make enables clock from clock_vid
process (clock_vid, reset)
begin
@ -426,10 +434,10 @@ end process;
--------------------
-- "11" for test & tilt & unused
input_0 <= not service & "11" & not start3 & not start2 & not start1 & not coin2 & not coin1;
input_1 <= '1' & angle;
input_2 <= "1111" & not bomb & not fire & not bomb & not fire;
input_1 <= '1' & angle1;
input_2 <= "1111" & not bomb2 & not fire2 & not bomb1 & not fire1;
input_3 <= x"ff";
input_4 <= '1' & angle;
input_4 <= '1' & angle2;
------------------------------------------