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

VGM export incompatible with hardware in faster environments #156

Closed
iyatemu opened this issue Oct 8, 2019 · 3 comments
Closed

VGM export incompatible with hardware in faster environments #156

iyatemu opened this issue Oct 8, 2019 · 3 comments

Comments

@iyatemu
Copy link

iyatemu commented Oct 8, 2019

This has only been observed when exporting VGMs for play on MSX. S98 playback and SCCI performance have not been evaluated.

When exporting VGMs, the drum key-on/off register is not treated as it should be
ex. 0?100101 = key on BD + TOP + RIM

Instead, writes to the register are treated as if the drums are in separate channels
ex.
0?000001 = key on BD
0?000100 = key on TOP
0?100000 = key on RIM
Excerpts from VGM2TXT:

0x000041B9: 56 10 04    YM2608:ADPCM A: Key On: --2---
0x000041BC: 56 1B CD    YM2608:ADPCM A: Ch 3: Stereo: LR, Volume: 0x0D = 21%
0x000041BF: 56 10 08    YM2608:ADPCM A: Key On: ---3--

and

0x00004123: 56 10 01    YM2608:ADPCM A: Key On: 0-----
0x00004126: 56 1B C0    YM2608:ADPCM A: Ch 3: Stereo: LR, Volume: 0x00 = 7%
0x00004129: 56 10 08    YM2608:ADPCM A: Key On: ---3--

As these writes are immediate to one another, this violates the access time requirements on faster systems like an MSX Turbo-R and likely any PC-98 (though S98 playback has not been tested), and drums fail to play or stop properly. MSX, MSX2, and MSX2+ are all slow enough that the speed limit is not met. All writes to the drum register should be simultaneous in one frame and not sequential for proper hardware playback on faster systems.

@ValleyBell
Copy link

IMO this is not an issue of a tracker.
Instead, the VGM player has to take care of checking the BUSY bit in the status register and wait as long as required.

Also, nitpicking, but when writing to the ADPCM A Key On/Off register you don't set the "state", but you trigger on/off for certain channels. This is different from the key on/off registers in the FM and SSG part.
Thus the sequence of writing reg 010h data 04h followed by reg 010h data 08h has the same effect as writing reg 010h data 0Ch. When you want to turn off a channel, you have to explicitly trigger that using e.g. reg 010h data 84h.

@rerrahkr
Copy link
Member

rerrahkr commented Oct 8, 2019

Thank you for your reports and advice.
Your idea has the advantage of reducing not only the number of writes but also the amount of data. I will try to fix the drum key on/off that seems not difficult.

@rerrahkr
Copy link
Member

rerrahkr commented Oct 9, 2019

I fixed it at 0568f20.

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

No branches or pull requests

3 participants