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

audio emulation innacuracies #5

Open
jvsTSX opened this issue May 23, 2024 · 0 comments
Open

audio emulation innacuracies #5

jvsTSX opened this issue May 23, 2024 · 0 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@jvsTSX
Copy link
Contributor

jvsTSX commented May 23, 2024

1 - the Timer 1 base clock comes from the CPU's clock making it go high pitched on RC clock mode and nearly supersonic on CF clock mode, the emulator just sets the Timer 1 base clock to quartz/6 always regardless of the CPU clock

  • fixing this should fix shenmue's goodies startup music and timing since Timer 0 and its prescaler follows this same behaviour, EVMU appears to treat it as a clock multiplier (?)

2 - the Timer 1 mode 3 is not implemented, with this mode you can set a clock double function by setting the enable bits to "01" making the range on quartz mode /6 to go from F-1 trough F-8 instead of F-1 trough F-7.

  • no game appears to use this behaviour

2.1 - additionally this mode adds another sound layer that makes a sort of strobe pattern, it's very audible on quartz mode and always follows the pitch of T1LR, setting T1HR has no effects on it unless you set it to $FF which will mute the pattern, the pattern have octaves that can be enabled or disabled trough the T1HC register, "1" bits will enable the octave while "0" bits will mask it out, up to 8 octaves can be heard assuming T1HR is below $80, the way the octaves stack is by each octave being around 90 degrees out of phase with each other, making a pattern like this
octave 1 __|___|___|___|___|___|___|___|_
octave 0 ____|_______|_______|_______|___
result = __|_|_|___|_|_|___|_|_|___|_|_|_
the output appears to be ORed with the PWM output

  • no game appears uses this mode

3 - the sample rate output of the emulator assumes quartz output only, the hardware should emit up to 2MHz tones using the clock double mode

  • changing sample rate to a higher number and use resampling for higher tones should create an output closer to that of the real machine, however the VMU seems to have a strong high-pass on the ports even with direct speaker wire recordings

4 - direct sound mode is not emulated, toggling Port 1 bit 7 with the corresponding P1DDR set to "0" does not alter the sound output

  • i don't know of any games that use this

5 - the PWM comparator seems to compare itself on every timer cycle instead of only once

  • fixing this should allow pac-man to output audio
@gyrovorbis gyrovorbis added bug Something isn't working enhancement New feature or request labels May 23, 2024
@gyrovorbis gyrovorbis self-assigned this May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants