mirror of
https://github.com/Gehstock/Mist_FPGA.git
synced 2026-01-19 09:18:02 +00:00
add Color Overlay
This commit is contained in:
parent
c23fc0a76c
commit
128399ddf5
Binary file not shown.
@ -165,10 +165,10 @@ set_global_assignment -name OUTPUT_IO_TIMING_FAR_END_VMEAS "HALF SIGNAL SWING" -
|
||||
set_global_assignment -name PARTITION_NETLIST_TYPE SOURCE -section_id Top
|
||||
set_global_assignment -name PARTITION_FITTER_PRESERVATION_LEVEL PLACEMENT_AND_ROUTING -section_id Top
|
||||
set_global_assignment -name PARTITION_COLOR 16764057 -section_id Top
|
||||
set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top
|
||||
|
||||
# end DESIGN_PARTITION(Top)
|
||||
# -------------------------
|
||||
|
||||
# end ENTITY(super_breakout_mist)
|
||||
# -------------------------------
|
||||
# -------------------------------
|
||||
set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top
|
||||
@ -1,2 +1,2 @@
|
||||
`define BUILD_DATE "190307"
|
||||
`define BUILD_TIME "171907"
|
||||
`define BUILD_DATE "190321"
|
||||
`define BUILD_TIME "004002"
|
||||
|
||||
@ -42,11 +42,11 @@ port(
|
||||
Counter_O : out std_logic; -- Coin counter output (Active high)
|
||||
Audio_O : out std_logic_vector(7 downto 0); -- PWM audio, low pass filter is desirable but not really necessary for the simple SFX in this game
|
||||
Video_O : out std_logic;
|
||||
Video_RGB : out std_logic_vector(7 downto 0);
|
||||
HS : out std_logic;
|
||||
VS : out std_logic;
|
||||
HB : out std_logic;
|
||||
VB : out std_logic;
|
||||
CompSync_O : out std_logic); -- Composite sync, sum this through a 1k resistor to composite video
|
||||
VB : out std_logic); -- Composite sync, sum this through a 1k resistor to composite video
|
||||
end super_breakout;
|
||||
|
||||
architecture rtl of super_breakout is
|
||||
@ -65,6 +65,7 @@ signal Inputs : std_logic_vector(1 downto 0);
|
||||
|
||||
-- Video timing signals
|
||||
signal Hcount : std_logic_vector(8 downto 0) := (others => '0');
|
||||
signal hcolor : std_logic_vector(7 downto 0);
|
||||
signal H256 : std_logic;
|
||||
signal H256_s : std_logic;
|
||||
signal H256_n : std_logic;
|
||||
@ -80,6 +81,7 @@ signal H2 : std_logic;
|
||||
signal H1 : std_logic;
|
||||
|
||||
signal Vcount : std_logic_vector(7 downto 0) := (others => '0');
|
||||
signal Video : std_logic;
|
||||
signal V128 : std_logic;
|
||||
signal V64 : std_logic;
|
||||
signal V32 : std_logic;
|
||||
@ -135,6 +137,7 @@ port map(
|
||||
clk_6 => clk_6,
|
||||
hcount => hcount,
|
||||
vcount => vcount,
|
||||
hcolor => hcolor,
|
||||
hsync => hsync,
|
||||
hblank => hblank,
|
||||
vblank_s => vblank_s,
|
||||
@ -244,11 +247,75 @@ port map(
|
||||
);
|
||||
|
||||
-- Video mixer
|
||||
Video_O <= not(Playfield_n and Ball1_n and Ball2_n and Ball3_n);
|
||||
CompSync_O <= CompSync_n_s;
|
||||
HS <= Hsync;
|
||||
VS <= Vsync;
|
||||
HB <= Hblank;
|
||||
VB <= Vblank;
|
||||
|
||||
Video_O <= not(Playfield_n and Ball1_n and Ball2_n and Ball3_n);
|
||||
-- r 3 g 3 b 2
|
||||
-- https://github.com/mamedev/mame/blob/master/src/mame/layout/sbrkout.lay
|
||||
|
||||
process (hcolor,Playfield_n , Ball1_n , Ball2_n , Ball3_n, Video, hcount)
|
||||
begin
|
||||
Video <= not(Playfield_n and Ball1_n and Ball2_n and Ball3_n);
|
||||
-- check for the wrap around (126)
|
||||
if ((unsigned(hcolor) >=121 ) and (unsigned(hcolor) <=128) and (hcount(8)='0')) then
|
||||
if (Video='1') then
|
||||
Video_RGB <= "01001011";
|
||||
else
|
||||
Video_RGB <= "00000000";
|
||||
end if;
|
||||
-- Blue Bar / Top
|
||||
elsif ( (unsigned(hcolor) >=0 ) and (unsigned(hcolor) <= 33) ) then
|
||||
if (Video='1') then
|
||||
Video_RGB <= "01001011";
|
||||
else
|
||||
Video_RGB <= "00000000";
|
||||
end if;
|
||||
-- Orange Bar
|
||||
elsif (( unsigned(hcolor) >=34 ) and (unsigned(hcolor) <=65)) then
|
||||
if (Video='1') then
|
||||
Video_RGB <= "11110000";
|
||||
else
|
||||
Video_RGB <= "00000000";
|
||||
end if;
|
||||
-- Green Bar
|
||||
elsif (( unsigned(hcolor) >=66 ) and (unsigned(hcolor) <=97)) then
|
||||
if (Video='1') then
|
||||
Video_RGB <= "01011001";
|
||||
else
|
||||
Video_RGB <= "00000000";
|
||||
end if;
|
||||
-- Yellow Bar
|
||||
elsif ((unsigned(hcolor) >=98 ) and (unsigned(hcolor) <=129)) then
|
||||
if (Video='1') then
|
||||
Video_RGB <= "11111101";
|
||||
else
|
||||
Video_RGB <= "00000000";
|
||||
end if;
|
||||
-- Blue for paddle line
|
||||
elsif (( unsigned(hcolor) >=224) and (unsigned(hcolor) <=230)) then
|
||||
if (Video='1') then
|
||||
Video_RGB <= "01001011";
|
||||
else
|
||||
Video_RGB <= "00000000";
|
||||
end if;
|
||||
--elsif (( unsigned(hcolor) >=256) and (unsigned(hcolor) <=264)) then
|
||||
-- if (Video='1') then
|
||||
-- Video_RGB <= "11111111";
|
||||
-- Video_RGB <= "11100000";
|
||||
-- else
|
||||
-- Video_RGB <= "00000000";
|
||||
-- end if;
|
||||
else
|
||||
if (Video='1') then
|
||||
Video_RGB <= "11111111";
|
||||
else
|
||||
Video_RGB <= "00000000";
|
||||
end if;
|
||||
end if;
|
||||
end process;
|
||||
|
||||
|
||||
end rtl;
|
||||
@ -23,8 +23,9 @@ localparam CONF_STR = {
|
||||
"O1,Test Mode,Off,On;",
|
||||
"O2,Rotate Controls,Off,On;",
|
||||
"O34,Scanlines,Off,25%,50%,75%;",
|
||||
"O5,Color,On,Off;",
|
||||
"T6,Reset;",
|
||||
"V,v1.20.",`BUILD_DATE
|
||||
"V,v1.25.",`BUILD_DATE
|
||||
};
|
||||
|
||||
assign AUDIO_R = AUDIO_L;
|
||||
@ -48,9 +49,9 @@ wire scandoublerD;
|
||||
wire ypbpr;
|
||||
wire [10:0] ps2_key;
|
||||
wire [7:0] audio;
|
||||
wire Video_O;
|
||||
wire vb, hb;
|
||||
wire blankn = ~(hb | vb);
|
||||
wire video;
|
||||
wire [2:0] r,g;
|
||||
wire [1:0] b;
|
||||
wire hs, vs;
|
||||
|
||||
super_breakout super_breakout(
|
||||
@ -58,9 +59,8 @@ super_breakout super_breakout(
|
||||
.Reset_n(~(status[0] | status[6] | buttons[1])),
|
||||
.HS(hs),
|
||||
.VS(vs),
|
||||
.VB(vb),
|
||||
.HB(hb),
|
||||
.Video_O(Video_O),
|
||||
.Video_O(video),
|
||||
.Video_RGB({r,g,b}),
|
||||
.Audio_O(audio),
|
||||
.Coin1_I(~btn_coin),
|
||||
.Coin2_I(1'b1),
|
||||
@ -96,9 +96,9 @@ video_mixer video_mixer(
|
||||
.SPI_SCK(SPI_SCK),
|
||||
.SPI_SS3(SPI_SS3),
|
||||
.SPI_DI(SPI_DI),
|
||||
.R(blankn ? {6{Video_O}} : 0),
|
||||
.G(blankn ? {6{Video_O}} : 0),
|
||||
.B(blankn ? {6{Video_O}} : 0),
|
||||
.R(~status[5] ? r : {video,video,video}),
|
||||
.G(~status[5] ? g : {video,video,video}),
|
||||
.B(~status[5] ? {b,1'b0} : {video,video,video}),
|
||||
.HSync(hs),
|
||||
.VSync(vs),
|
||||
.VGA_R(VGA_R),
|
||||
|
||||
@ -25,6 +25,7 @@ port(
|
||||
clk_6 : out std_logic;
|
||||
hcount : out std_logic_vector(8 downto 0);
|
||||
vcount : out std_logic_vector(7 downto 0);
|
||||
hcolor : out std_logic_vector(7 downto 0);
|
||||
hsync : out std_logic;
|
||||
hblank : out std_logic;
|
||||
vblank_s : out std_logic;
|
||||
@ -159,6 +160,7 @@ begin
|
||||
end process;
|
||||
|
||||
-- Assign various signals
|
||||
hcolor <= 255 - h_counter(8 downto 1);
|
||||
clk_6 <= h_counter(0);
|
||||
H1 <= h_counter(1);
|
||||
H2 <= h_counter(2);
|
||||
|
||||
@ -20,8 +20,8 @@
|
||||
|
||||
module video_mixer
|
||||
#(
|
||||
parameter LINE_LENGTH = 768,
|
||||
parameter HALF_DEPTH = 0,
|
||||
parameter LINE_LENGTH = 480,
|
||||
parameter HALF_DEPTH = 1,
|
||||
|
||||
parameter OSD_COLOR = 3'd4,
|
||||
parameter OSD_X_OFFSET = 10'd0,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user