Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does jt10_acc.v discard FM data for channels 0 and 4? #74

Open
kunichiko opened this issue Jul 17, 2023 · 3 comments
Open

Why does jt10_acc.v discard FM data for channels 0 and 4? #74

kunichiko opened this issue Jul 17, 2023 · 3 comments
Labels

Comments

@kunichiko
Copy link

I used this core in 6-channel mode (by setting .num_ch(6)), but I noticed that the sound of some channels was slightly different from the real chip.

Upon further investigation, I came across the following comment:

// uses channels 0 and 4 for ADPCM data, throwing away FM data for those channels

At this line, there is a comment stating uses channels 0 and 4 for ADPCM data, throwing away FM data for those channels.

However, I wanted to utilize all 6 FM channels, so I commented out lines 82 to 103, and it seems to be working fine now.

Could you please explain why jt10_acc.v discards some FM data?"

@jotego
Copy link
Owner

jotego commented Jul 17, 2023

As the comment says, the original Yamaha chip did that. I am not sure about YM2608 you're looking at. Maybe that one used all six channels. Review carefully Yamaha's documentation before assuming the behavior was different.

@kunichiko
Copy link
Author

@jotego
Thank you for your response.

I've reviewed the comment written in the source code, but I couldn't find any reference to that behavior in the YM2610 application manual. Could you kindly provide the source of your information?

Additionally, I believe your intention is that the jt10 acts as a YM2610, not a YM2610B. It's worth noting that the YM2610 has four FM channels, while the YM2610B has six.

Based on my understanding, I would like to propose the following idea:

When the parameter .num_ch(4) is passed, it should function as a YM2610.
When the parameter .num_ch(6) is passed, it should function as a YM2610B.

Please let me know your thoughts on this suggestion.

@kunichiko
Copy link
Author

kunichiko commented Jul 21, 2023

To organize my thoughts, I have created the following table for the DT/MULTI register:

Port0 (A1=0)
        Jt12      YM2610    YM2610B(YM2608)
REG$30  op0:ch0   N/A       OP1:CH1
REG$31  op0:ch1   OP1:CH1   OP1:CH2
REG$32  op0:ch2   OP1:CH2   OP1:CH3
REG$33  N/A       N/A       N/A
REG$34  op2:ch0   N/A       OP3:CH1
REG$35  op2:ch1   OP3:CH1   OP3:CH2
REG$36  op2:ch2   OP3:CH2   OP3:CH3
REG$37  N/A       N/A       N/A
REG$38  op1:ch0   N/A       OP2:CH1
REG$39  op1:ch1   OP2:CH1   OP2:CH2
REG$3A  op1:ch2   OP2:CH2   OP2:CH3
REG$3B  N/A       N/A       N/A
REG$3C  op3:ch0   N/A       OP2:CH1
REG$3D  op3:ch1   OP4:CH1   OP4:CH2
REG$3E  op3:ch2   OP4:CH2   OP4:CH3
REG$3F  N/A       N/A       N/A
Port1 (A1=1)
        Jt12      YM2610    YM2610B(YM2608)
REG$30  op0:ch4   N/A       OP1:CH4
REG$31  op0:ch5   OP1:CH3   OP1:CH5
REG$32  op0:ch6   OP1:CH4   OP1:CH6
REG$33  N/A       N/A       N/A
REG$34  op2:ch4   N/A       OP3:CH4
REG$35  op2:ch5   OP3:CH3   OP3:CH5
REG$36  op2:ch6   OP3:CH4   OP3:CH6
REG$37  N/A       N/A       N/A
REG$38  op1:ch4   N/A       OP2:CH4
REG$39  op1:ch5   OP2:CH3   OP2:CH5
REG$3A  op1:ch6   OP2:CH4   OP2:CH6
REG$3B  N/A       N/A       N/A
REG$3C  op3:ch4   N/A       OP2:CH4
REG$3D  op3:ch5   OP4:CH3   OP4:CH5
REG$3E  op3:ch6   OP4:CH4   OP4:CH6
REG$3F  N/A       N/A       N/A

This is an example of the table for the DT/MULTI register, and there are other similar registers like that.

Regarding the current implementation, the case statement you wrote discards FM data only at op0:ch0 and op0:ch4. Therefore, I believe the other operators of ch0 and ch4 are still valid (e.g., op1:ch0, op2:ch4, etc.).

Therefore when I use all of the six FM channels, YM2608(YM2610B)'s CH1 and CH4 produces odd sound.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants