One chip MSX improvement project

Page 65/118
58 | 59 | 60 | 61 | 62 | 63 | 64 | | 66 | 67 | 68 | 69 | 70

By vanfanel

Champion (446)

vanfanel's picture

16-01-2013, 13:27

@KdL: Got latest caro sources to compile with the latest "fix" removed. But, how can I add the MSX3 rom files to the resulting POF file using Quartus II? Maybe it's the same for both boards, so I'm sure you can help me with this Smile

By vanfanel

Champion (446)

vanfanel's picture

16-01-2013, 14:59

Ok, got it working, too, with the included msx3 hex.

@KdL: Now I would like to know why psg_wave.vhd in the DE1 port is SO different from the 1ChipMSX version you included in your latest sources:

KdL's sources:

  ----------------------------------------------------------------
  -- Noise generator 
  ----------------------------------------------------------------
  process(clk21m, reset)

    variable PsgCntNoise : std_logic_vector(4 downto 0);
    variable PsgGenNoise : std_logic_vector(17 downto 0);

  begin

    if (reset = '1') then

      PsgCntNoise := (others => '0');
      PsgGenNoise := (others => '1');

    elsif (clk21m'event and clk21m = '1') then

      -- Base frequency : 112kHz = 3.58MHz / 16 / 2
      if (PsgClkEna(4 downto 0) = "00000" and clkena = '1') then

        -- Noise frequency counter
        if (PsgCntNoise /= "00000") then
          PsgCntNoise := PsgCntNoise - 1;
        elsif (PsgFreqNoise /= "00000") then
          PsgCntNoise := PsgFreqNoise - 1;
        end if;

        -- (Maximum-length linear shift register sequence)
        -- f(x) = x^17 + x^14 + 1
        if (PsgCntNoise = "00000") then

          for I in 17 downto 1 loop
            PsgGenNoise(I) := PsgGenNoise(I - 1);
          end loop;

          if (PsgGenNoise = "00000000000000000") then
            PsgGenNoise(0) := '1';                                          -- Error trap
          else
            PsgGenNoise(0) := PsgGenNoise(17) xor PsgGenNoise(14);          -- Normal work
          end if;

        end if;

      end if;

    end if;

    PsgNoise <= PsgGenNoise(17);

  end process;

Caro's sources:

	----------------------------------------------------------------
	-- Noise generator 
	----------------------------------------------------------------
	process( reset, clk21m )
	begin
		if( reset = '1' )then
			ff_freq_cnt_noise <= (others => '0');
		elsif( clk21m'event and clk21m = '1' )then
			if( w_112khz = '1' )then	-- fix caro
--			if( w_56khz = '1' )then
				-- Noise frequency counter
				if( ff_freq_cnt_noise( 4 downto 1 ) = "0000" )then
					ff_freq_cnt_noise <= ff_noise_freq;
				else
					ff_freq_cnt_noise <= ff_freq_cnt_noise - 1;
				end if;
			end if;
		end if;
	end process;

	process( reset, clk21m )
	begin
		if( reset = '1' )then
			ff_noise_gen <= (others => '1');
		elsif( clk21m'event and clk21m = '1' )then
			if( w_112khz = '1' )then	-- fix caro
--			if( w_56khz = '1' )then
				-- 18bit maximum length code 
				if (ff_freq_cnt_noise = "00001") then
					ff_noise_gen( 17 downto 1 ) <= ff_noise_gen( 16 downto 0 );
					ff_noise_gen( 0 )	    <= ff_noise_gen( 16 ) xor ff_noise_gen( 13 );
				end if;
			end if;
		end if;
	end process;

	w_noise <= ff_noise_gen( 17 );

So, wasn't DE1 port supposed to share PSG code with 1ChipMSX?

By KdL

Paragon (1434)

KdL's picture

16-01-2013, 18:10

Hi vanfanel.
I've tested the PSG module of caro with 1chipMSX and sounds fine for me.
For a test with DE1, you can replace the psg from ocm-pld 3.2 beta9 copying the "psg.vhd" and "psg_wave.vhd" simply.

The great work of HRA is not completed and his sources are not fine in some cases.
This is a personal opinion and it is the reason that I still use the original "psg_wave.vhd" code for PSG.

Extra notes:
The VDP TH9958 (by HRA) is very bad over the H-SYNC and V-SYNC signals ("work in progress here...") with flickering (like MKID), freezing (like U.R. NOP screen @60Hz), bad capturing MIDI-IN from Music Module, many unsupported function like VGA @50Hz and others.

By vanfanel

Champion (446)

vanfanel's picture

16-01-2013, 19:22

@KdL : I got the "psg.vhd" and "psg_wave.vhd" from your sources working combined caro's DE1 sources!! Thanks A LOT for your help!! Big smile
Now percussion is back on the DE1 port: Vampire Killer and Zombie Monsters sound as intended again (but the Eggerland high pitch sound is back, too.. well, better to have PSG percussions back in these games BA-team ).

About the extra notes: I prefer almost-perfect MSX2 compatibility than MSX2+ with problems, so.. do you recommend me using the /src/video files from your sources, too?

By KdL

Paragon (1434)

KdL's picture

16-01-2013, 23:47

you can use v9938 model with very few modifications

By vanfanel

Champion (446)

vanfanel's picture

17-01-2013, 00:08

Is it really worth it? Is it more compatible? The only game I couldn't get to work with V9958 is "The Eidolon". Does it work with V9938?

By KdL

Paragon (1434)

KdL's picture

17-01-2013, 23:41

The Eidolon don't work yet and no idea to fix it! Sad
But we can wait for a future VDP improvement and bug fixed version.

By vanfanel

Champion (446)

vanfanel's picture

17-01-2013, 23:59

@KdL: About the high pitch noise in Eggerland Mistery, I recall you said it didn't appear in your OCM-PLD v3.2 BETA9 release.
So, what other sound parts could I take from your design to try them on the Altera DE1? Filters maybe? Are the files directly compatible like psg files?

By KdL

Paragon (1434)

KdL's picture

18-01-2013, 02:57

You can check all connections to the DACout signal, that is the internal audio of 1chipMSX. Hannibal

By x-nen Aivalahostia

Paragon (1483)

x-nen Aivalahostia's picture

18-01-2013, 10:43

@Caro and @Kdl: through konamito web page, I met an interesting Aricle that explains how to create an "Virtual MSX disk drive",
http://codinglab.blogspot.be/2013/01/virtual-msx-disk-drive....
lack much information, but i thik that is a good thig to add to OCM or DE1/DE0

Thanks

Page 65/118
58 | 59 | 60 | 61 | 62 | 63 | 64 | | 66 | 67 | 68 | 69 | 70