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

OPZ can not handle key on/off properly #20

Open
110-kenichi opened this issue Oct 4, 2021 · 9 comments
Open

OPZ can not handle key on/off properly #20

110-kenichi opened this issue Oct 4, 2021 · 9 comments
Labels
question Further information is requested

Comments

@110-kenichi
Copy link

The following code in the opz_registers::write(uint16_t, uint8_t, uint32_t, uint32_t) is not correct.

// handle writes to the key on index
if ((index & 0xf8) == 0x20 && bitfield(index, 0, 3) == bitfield(m_regdata[0x08], 0, 3))

OPZ does not see the 0x08 register for key on/off . So. change it like the following.

// handle writes to the key on index
if ((index & 0xf8) == 0x20)
@110-kenichi
Copy link
Author

Sorry, this info is not correct.

The following URL information is not perfect.
http://sr4.sakura.ne.jp/fmsound/opz.html

・Panpot, Key on/off register is same as OPM/OPP.
・Ch volume register(#0 -#7) does not exist on OPZ.

@aaronsgiles
Copy link
Owner

aaronsgiles commented Oct 4, 2021

What is the evidence for this change? The document referenced is not correct.

The current implementation is based on actual behavior of what the TX-81Z writes in emulation. Until I see strong evidence of different behavior that is still compatible with the way the TX-81Z programs the chip, I'm reluctant to make any changes here.

@110-kenichi
Copy link
Author

We do not have an application manual of YM2414.

So, I've contact FITOM author ”madscient” to check correctly implementing of the OPZ.

Do you know FITOM project?
https://sites.google.com/site/fitomproject/

He said that "I checked the registers one by one and created a FITOM. My implementing is correct."

See this thread.
https://twitter.com/SNDR_SNDL/status/1445013048628944899

I think the behavior of the TX-81Z is due to the software sound driver.

@110-kenichi
Copy link
Author

He said that this source contains OPZ driver that is derived from OPM and the driver can drive OPZ properly.

https://github.com/madscient/FITOMApp/blob/primary/FITOMApp/OPM.cpp

@110-kenichi
Copy link
Author

He created a document about YM2414 (Tentative ver)

https://sites.google.com/site/undocumentedsoundchips/yamaha/ym2414

@110-kenichi
Copy link
Author

110-kenichi commented Oct 29, 2021

My friend replaced a chip from YM2151 to YM2414.
https://twitter.com/sdhizumi/status/1453924274989793280

YM2414 can output LR ch properly by YM2151 driver except MONO ch.

@aaronsgiles
Copy link
Owner

If that is a legitimate (true) YM2414, then it is possible that key on/off can also be triggered like a YM2151. I will be interested to see if the YM2414 shown works in the TX-81Z.

The firmware of the TX-81Z uses the documented sequence in my code to send key on/off, and not the YM2151 way. If this is true, then ymfm will need to be updated to support both ways.

@110-kenichi
Copy link
Author

I see. Thanks.

@110-kenichi
Copy link
Author

FYI: Here is an Output Level algorithm of TX81Z(not YM2414) sound driver.

https://nornand.hatenablog.com/entry/2020/11/21/201911

@aaronsgiles aaronsgiles added the question Further information is requested label Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants