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

Kozmik Kroozr: update inputs

This commit is contained in:
Gyorgy Szombathelyi 2019-12-21 17:22:25 +01:00
parent 264346ff3c
commit 2c76002a76
5 changed files with 37 additions and 42 deletions

View File

@ -1,8 +0,0 @@
{ "" "" "" "Node: satans_hollow:satans_hollow\|satans_hollow_sound_board:sound_board\|YM2149:ay_3_8910_2\|env_reset was determined to be a clock but was found without an associated clock assignment." { } { } 0 332060 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "Node: satans_hollow:satans_hollow\|satans_hollow_sound_board:sound_board\|YM2149:ay_3_8910_1\|env_reset was determined to be a clock but was found without an associated clock assignment." { } { } 0 332060 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "22 pins must meet Altera requirements for 3.3-, 3.0-, and 2.5-V interfaces. For more information, refer to AN 447: Interfacing Cyclone III Devices with 3.3/3.0/2.5-V LVTTL/LVCMOS I/O Systems." { } { } 0 169177 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "Node: reset was determined to be a clock but was found without an associated clock assignment." { } { } 0 332060 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "TimeQuest Timing Analyzer is analyzing 6 combinational loops as latches." { } { } 0 335093 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "PCI-clamp diode is not supported in this mode. The following 1 pins must meet the Altera requirements for 3.3V, 3.0V, and 2.5V interfaces if they are connected to devices other than the supported configuration devices. In these cases, Altera recommends termination method as specified in the Application Note 447." { } { } 0 169203 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "PLL \"pll_mist:pll\|altpll:altpll_component\|pll_mist_altpll:auto_generated\|pll1\" has parameters clk1_multiply_by and clk1_divide_by specified but port CLK\[1\] is not connected" { } { } 0 15899 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "Some pins have incomplete I/O assignments. Refer to the I/O Assignment Warnings report for details" { } { } 0 15714 "" 0 0 "Quartus II" 0 -1 0 ""}

View File

@ -4,8 +4,9 @@
-- 10 November 2019
--
-- VGA/TV
-- Control Kroozr with the mouse, shot with the joystick
-- Control Kroozr with the mouse, shot with the left button, turn on shield with the right.
-- The weapon can be rotated with the joystick (or left/right arrow keys).
--
---------------------------------------------------------------------------------
-- DE10_lite Top level for Kick (Midway MCR) by Dar (darfpga@aol.fr) (19/10/2019)
-- http://darfpga.blogspot.fr

View File

@ -80,6 +80,8 @@ wire [5:0] joystick_1;
wire signed [8:0] mouse_x;
wire signed [8:0] mouse_y;
wire mouse_strobe;
wire [7:0] mouse_flags;
reg [1:0] mouse_btns;
wire scandoublerD;
wire ypbpr;
wire [15:0] audio_l, audio_r;
@ -142,6 +144,7 @@ sdram sdram(
.snd_q ( snd_do )
);
// ROM download ctrl.
always @(posedge clk_sys) begin
reg ioctl_wr_last = 0;
@ -154,6 +157,7 @@ always @(posedge clk_sys) begin
end
end
// Reset gen.
reg reset = 1;
reg rom_loaded = 0;
always @(posedge clk_sys) begin
@ -164,18 +168,19 @@ always @(posedge clk_sys) begin
reset <= status[0] | buttons[1] | ~rom_loaded;
end
reg signed [10:0] x_pos;
reg signed [10:0] y_pos;
/// Controllers
reg signed [9:0] x_pos;
reg signed [9:0] y_pos;
wire signed [8:0] move_x = rotate ? -mouse_y : mouse_x;
wire signed [8:0] move_y = rotate ? mouse_x : mouse_y;
wire signed [9:0] x_pos_new = x_pos - move_x;
wire signed [9:0] y_pos_new = y_pos + move_y;
always @(posedge clk_sys) begin
if (mouse_strobe) begin
if (rotate) begin
x_pos <= x_pos - mouse_y;
y_pos <= y_pos + mouse_x;
end else begin
x_pos <= x_pos + mouse_x;
y_pos <= y_pos + mouse_y;
end
mouse_btns <= mouse_flags[1:0];
if (!((move_x[8] & ~x_pos[9] & x_pos_new[9]) || (~move_x[8] & x_pos[9] & ~x_pos_new[9]))) x_pos <= x_pos_new;
if (!((move_y[8] & y_pos[9] & ~y_pos_new[9]) || (~move_y[8] & ~y_pos[9] & y_pos_new[9]))) y_pos <= y_pos_new;
end
end
@ -190,7 +195,7 @@ spinner spinner (
.spin_angle(spin_angle)
);
// Main core
satans_hollow satans_hollow(
.clock_40(clk_sys),
.reset(reset),
@ -210,9 +215,9 @@ satans_hollow satans_hollow(
.start2(btn_two_players),
.start1(btn_one_player),
//Controls
.analog_x(x_pos[10:3]),
.analog_y(y_pos[10:3]),
.spinner(spin_angle),//todo
.analog_x({x_pos[9],x_pos[9],x_pos[7:2]}),
.analog_y({y_pos[9],y_pos[9],y_pos[7:2]}),
.spinner(~spin_angle[6:3]),
.fire1(m_fire),
.fire2(m_bomb),//shield
.cocktail(0),
@ -224,6 +229,7 @@ satans_hollow satans_hollow(
.snd_rom_do ( snd_addr[0] ? snd_do[15:8] : snd_do[7:0] )
);
// Video out
wire vs_out;
wire hs_out;
assign VGA_VS = scandoublerD | vs_out;
@ -253,6 +259,7 @@ mist_video #(.COLOR_DEPTH(3 ), .SD_HCNT_WIDTH(10)) mist_video(
.ypbpr ( ypbpr )
);
// MiST IO controller
user_io #(
.STRLEN(($size(CONF_STR)>>3)))
user_io(
@ -274,9 +281,11 @@ user_io(
.mouse_x (mouse_x ),
.mouse_y (mouse_y ),
.mouse_strobe (mouse_strobe ),
.mouse_flags (mouse_flags ),
.status (status )
);
// DAC
dac #(
.C_bits(16))
dac_l(
@ -295,13 +304,12 @@ dac_r(
.dac_o(AUDIO_R)
);
// Rotated Normal
//wire m_up = rotate ? btn_right | joystick_0[0] | joystick_1[0] : btn_up | joystick_0[3] | joystick_1[3];
//wire m_down = rotate ? btn_left | joystick_0[1] | joystick_1[1] : btn_down | joystick_0[2] | joystick_1[2];
wire m_left = rotate ? btn_up | joystick_0[3] | joystick_1[3] : btn_left | joystick_0[1] | joystick_1[1];
wire m_right = rotate ? btn_down | joystick_0[2] | joystick_1[2] : 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];
// Controls
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] | mouse_btns[0];
wire m_bomb = btn_fire2 | joystick_0[5] | joystick_1[5] | mouse_btns[1];
reg btn_one_player = 0;
reg btn_two_players = 0;
reg btn_left = 0;

View File

@ -160,8 +160,7 @@ port(
fire2 : in std_logic;
analog_x : in std_logic_vector(7 downto 0);
analog_y : in std_logic_vector(7 downto 0);
dail : in std_logic_vector(7 downto 0);
spinner : in std_logic_vector(6 downto 0);
spinner : in std_logic_vector(3 downto 0);
cocktail : in std_logic;
service : in std_logic;
@ -211,7 +210,7 @@ architecture struct of satans_hollow is
signal ctc_counter_0_int : std_logic;
signal ctc_counter_1_we : std_logic;
-- signal ctc_counter_1_trg : std_logic;
signal ctc_counter_1_trg : std_logic;
signal ctc_counter_1_do : std_logic_vector(7 downto 0);
signal ctc_counter_1_int : std_logic;
@ -302,7 +301,6 @@ architecture struct of satans_hollow is
signal input_2 : std_logic_vector(7 downto 0);
signal input_3 : std_logic_vector(7 downto 0);
signal input_4 : std_logic_vector(7 downto 0);
signal input_dail : std_logic_vector(7 downto 0);
begin
@ -366,7 +364,7 @@ begin
-- back porch 48/25*20 = 38
video_blankn <= '0';
if hcnt >= 2+16 and hcnt < 514+16 and
vcnt >= 2 and vcnt < 481 then video_blankn <= '1';end if;
vcnt >= 2 and vcnt < 480 then video_blankn <= '1';end if;
else -- interlaced mode
@ -444,11 +442,10 @@ end process;
-- players inputs --
--------------------
input_0 <= not service & "11" & not fire1 & not start2 & not start1 & not coin2 & not coin1;
input_1 <= not fire2 & spinner;
input_1 <= not fire2 & spinner(3) & "000" & spinner(2 downto 0);
input_2 <= analog_x;
input_3 <= '1' & cocktail & "111111" ;
input_4 <= analog_y;
--input_dail <= dail;
------------------------------------------
@ -705,7 +702,7 @@ port map(
clk_trg => '0',
d_out => ctc_counter_0_do,
zc_to => open, -- zc/to #0 (pin 7) connected to clk_trg #1 (pin 22) on schematics (seems to be not used)
zc_to => ctc_counter_1_trg, -- zc/to #0 (pin 7) connected to clk_trg #1 (pin 22) on schematics (seems to be not used)
int_pulse => ctc_counter_0_int
);
@ -719,7 +716,7 @@ port map(
d_in => cpu_do,
load_data => ctc_counter_1_we,
clk_trg => '0',
clk_trg => ctc_counter_1_trg,
d_out => ctc_counter_1_do,
zc_to => open,
@ -870,7 +867,6 @@ port map(
input_2 => input_2,
input_3 => input_3,
input_4 => input_4,
input_dail => input_dail,
separate_audio => separate_audio,
audio_out_l => audio_out_l,

View File

@ -68,7 +68,6 @@ port(
input_2 : in std_logic_vector(7 downto 0);
input_3 : in std_logic_vector(7 downto 0);
input_4 : in std_logic_vector(7 downto 0);
input_dail : in std_logic_vector(7 downto 0);
separate_audio : in std_logic;
audio_out_l : out std_logic_vector(15 downto 0);
@ -234,7 +233,6 @@ ssio_do <= input_0 when main_cpu_addr(2 downto 0) = "000" else -- Input 0 --
input_2 when main_cpu_addr(2 downto 0) = "010" else -- Input 2
input_3 when main_cpu_addr(2 downto 0) = "011" else -- Input 3 -- sw1 dip
input_4 when main_cpu_addr(2 downto 0) = "100" else -- Input 4
input_dail when main_cpu_addr(2 downto 0) = "110" else
ssio_status when main_cpu_addr(2 downto 0) = "111" else -- ssio status
x"FF";