One chip MSX improvement project

Page 70/118
63 | 64 | 65 | 66 | 67 | 68 | 69 | | 71 | 72 | 73 | 74 | 75

By Ace

Resident (53)

Ace's picture

21-04-2013, 16:27

Ace wrote:

For me, it's simpler to do this as I know no VHDL, but have a lot of experience building various electronic circuits.

I think I can *partially* eat my words now as I decided to go ahead and mess around with Caro's DE0 source files (which, by the way, are outdated as they're from the March 30th release and not the March 31st release where the Eggerland high-pitched noise fix was removed) and I think I found out why the noise channel sounds wrong. It is due to this line:

ff_noise_gen( 0 ) <= ff_noise_gen( 16 ) xor ff_noise_gen( 13 );

If I modify it like this:

ff_noise_gen( 0 ) <= ff_noise_gen( 17 ) xor ff_noise_gen( 12 );

The noise, at least in the Konami games I play (all Gradius games and the Metal Gear games, mainly), sounds a lot closer to the real AY-3-8910.

Could someone test this out to see if it causes a problem with the noise channel in any games?

By vanfanel

Champion (446)

vanfanel's picture

21-04-2013, 17:04

I could test it but on the DE1, would it be the same? I don't have a DE0.

By Ace

Resident (53)

Ace's picture

21-04-2013, 17:38

If the code for the noise generator is the same, I don't see why not.

However, I'm having a hard time eliminating the Eggerland fix from the March 30th source code. Replacing the 2 lines in the noise generator that are like this:

if( w_112khz = '1' )then

With this:

if( w_56khz = '1' )then

Still results in the same missing noise bug that occurred with the Eggerland fix. Is there something I missed?

EDIT: Forgot to mention something. There appears to be some volume balance errors with the SCC chip. I found this video clip of Salamander recorded off a Sony HitBit F1-XV which shows the game doesn't quite sound the same on the DE0 and DE1: https://www.youtube.com/watch?v=SUL8rkAO3qg

I'm not sure if there's an imperfection with the FPGA implementation of the SCC or if the implementation is correct, but the volume levels of the 5 channels are off.

By vanfanel

Champion (446)

vanfanel's picture

21-04-2013, 17:44

I also changed these lines to "if( w_112khz = '1' )then" lines to eliminate the eggerland fix and I also got the "missing noise" back, but that would make the Eggerland high-pitch noise back.
So it was like this:
-With w_112khz, I got full noise, but Eggeland had this ear-piercing high-tone problem.
-With w_56khz, Eggerland would sound perfect, but I got missing noise.
That's was on an Altera DE1 board.

By Ace

Resident (53)

Ace's picture

21-04-2013, 19:13

Wait a minute, did I get that backwards? I thought full noise was with w_56khz? Let me change that back to w_112khz.

EDIT: Okay, what is with my DE0? Every time I reprogram the board, it almost never saves the last SOF file I program on the chip.

EDIT 2: Oops! It looks like what I suggested only works with w_56khz. If I put w_112KHz, the noise becomes inaccurate again.

EDIT 3: With w_112KHz, the code needs to be this for correct noise:

ff_noise_gen( 0 ) <= ff_noise_gen( 17 ) xor ff_noise_gen( 13 );

Caro's source code needs to be updated. Nothing I do to the March 30th source code works to get the missing noise back.

EDIT 4: Vanfanel, do you have the psg_wave.vhd file from before the Eggerland fix (DE0 or DE1 doesn't matter)? I'd like to take a look at that to see why I can't undo the Eggerland fix on the March 30th source code.

By vanfanel

Champion (446)

vanfanel's picture

21-04-2013, 19:42

@Ace: no, I don't have any old sources. In fact I'm not using the DE1 as an MSX anymore but as an Amiga computer, because I thought sound was impossible to fix. It was either missing percussions (noise) or high pitch problems.
However, there's KdL's work, wich uses the same PSG implementation without CARO's fixes. You can get the latest package including sources here:

1ChipMSX 04/01/2013 sources
Navigate to /esemsx3/src/sound/psg to find the file you're looking for. It's "Eggerland-fix-free" as KdL never encountered that problem on the original 1ChipMSX. You should be able to use KdL's PSG implementation in the DE0 port with no problems: I used his PSG implementation overwritting CARO's implementation time ago and it compiled and ran fine on the DE1.
The strange thing is that original 1ChipMSX board (the one for wich KdL's implementation is intended) shows a VERY good PSG implementation with full noise and no high pitch noises. I hope we can fix this mistery :D

By Ace

Resident (53)

Ace's picture

21-04-2013, 20:00

I think that's about the only thing I can do right now. I'll compile Caro's code with KdL's PSG implementation and see what that gives.

I take it nobody's tried to use the real 1ChipMSX's PSG source files on the DE0 or DE1?

EDIT: Using KdL's PSG implementation and the real 1ChipMSX PSG implementation results in this error:

Error: Actual width (10) of port "wave" on instance "psg:U30" is not compatible with the formal port width (8) declared by the instantiated entity

The error is on this section of emsx_top.vhd according to Quartus II:

  U30 : psg
    port map(clk21m, reset, clkena, PsgReq, Open, wrt, adr, PsgDbi, dbo, 
             pJoyA, pStrA, pJoyB, pStrB, Kana, CmtIn, KeyMode, PsgAmp);

By vanfanel

Champion (446)

vanfanel's picture

21-04-2013, 20:03

@Ace: KdL's implementation, the one I pointed you to, is 1ChipMSX's implementation, so if you overwrite psg_wave.vhd with KdL's implementation you will be using 1ChipMSX's psg_wave.vhd. I already tried and it worked fine on the DE1, but I still got the Eggerland problem (but full noise).

I swear it worked before. Can you overwrite psg.vhd too and try to compile again?

By caro

Champion (512)

caro's picture

21-04-2013, 20:45

I tried to use both versions of the file psg_wave.vhd, and from Hara,
is the current version I'm using and the version that uses the KDL.
Version of the KDL suffers a strange noise in the game Egerland,
and Hara lack of treble.
Also, in the latest I increased capacity output wave 10 as a result
of the summation of three eight-bit audio signals in the channels
A, B and C should be at least 10 bits.

By Ace

Resident (53)

Ace's picture

21-04-2013, 22:45

vanfanel wrote:

Can you overwrite psg.vhd too and try to compile again?

I overwrote both psg.vhd and psg_wave.vhd when I got the error. Not quite sure what happened here, but it's not working for me on the DE0. I'll see what I can do about that.

I do think Caro should put his March 31st source code onto his site.

Page 70/118
63 | 64 | 65 | 66 | 67 | 68 | 69 | | 71 | 72 | 73 | 74 | 75