Skip to content

Commit

Permalink
Move hsync a bit left for better centering
Browse files Browse the repository at this point in the history
  • Loading branch information
gyurco committed Nov 12, 2018
1 parent fc308fa commit 0acb148
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions esemsx3/src/video/vdp_ntsc_pal.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -180,27 +180,34 @@ BEGIN
END PROCESS;

-- GENERATE H SYNC PULSE
-- MiST changes: move hsync left for better centering
PROCESS( RESET, CLK21M )
BEGIN
IF( RESET = '1' )THEN
FF_HSYNC_N <= '0';
ELSIF( CLK21M'EVENT AND CLK21M = '1' )THEN
IF( FF_SSTATE = SSTATE_A )THEN
IF( (HCOUNTERIN = 1) OR (HCOUNTERIN = CLOCKS_PER_LINE/2+1) ) THEN
IF( (HCOUNTERIN = CLOCKS_PER_LINE-20) OR (HCOUNTERIN = CLOCKS_PER_LINE/2-20) ) THEN -- MiST
-- IF( (HCOUNTERIN = 1) OR (HCOUNTERIN = CLOCKS_PER_LINE/2+1) ) THEN
FF_HSYNC_N <= '0'; -- PULSE ON
ELSIF( (HCOUNTERIN = 51) OR (HCOUNTERIN = CLOCKS_PER_LINE/2+51) ) THEN
ELSIF( (HCOUNTERIN = 31) OR (HCOUNTERIN = CLOCKS_PER_LINE/2+31) ) THEN -- MiST
-- ELSIF( (HCOUNTERIN = 51) OR (HCOUNTERIN = CLOCKS_PER_LINE/2+51) ) THEN
FF_HSYNC_N <= '1'; -- PULSE OFF
END IF;
ELSIF( FF_SSTATE = SSTATE_B )THEN
IF( (HCOUNTERIN = CLOCKS_PER_LINE-100+1 ) OR (HCOUNTERIN = CLOCKS_PER_LINE/2-100+1) ) THEN
IF( (HCOUNTERIN = CLOCKS_PER_LINE-120+1 ) OR (HCOUNTERIN = CLOCKS_PER_LINE/2-120+1) ) THEN -- MiST
-- IF( (HCOUNTERIN = CLOCKS_PER_LINE-100+1 ) OR (HCOUNTERIN = CLOCKS_PER_LINE/2-100+1) ) THEN
FF_HSYNC_N <= '0'; -- PULSE ON
ELSIF( (HCOUNTERIN = 1) OR (HCOUNTERIN = CLOCKS_PER_LINE/2+1) ) THEN
ELSIF( (HCOUNTERIN = CLOCKS_PER_LINE - 20) OR (HCOUNTERIN = CLOCKS_PER_LINE/2-20) ) THEN -- MiST
-- ELSIF( (HCOUNTERIN = 1) OR (HCOUNTERIN = CLOCKS_PER_LINE/2+1) ) THEN
FF_HSYNC_N <= '1'; -- PULSE OFF
END IF;
ELSIF( FF_SSTATE = SSTATE_C )THEN
IF( HCOUNTERIN = 1 )THEN
IF( HCOUNTERIN = CLOCKS_PER_LINE - 20 )THEN -- MiST
-- IF( HCOUNTERIN = 1 )THEN
FF_HSYNC_N <= '0'; -- PULSE ON
ELSIF( HCOUNTERIN = 101 )THEN
ELSIF( HCOUNTERIN = 81 )THEN -- Mist
-- ELSIF( HCOUNTERIN = 101 )THEN
FF_HSYNC_N <= '1'; -- PULSE OFF
END IF;
END IF;
Expand Down

0 comments on commit 0acb148

Please sign in to comment.