-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Added emulation for Roland SA sound chips #13209
Conversation
src/devices/sound/roland_sa.cpp
Outdated
DEFINE_DEVICE_TYPE(ROLAND_SA, roland_sa_device, "roland_sa", "Roland SA CPU-B Sound Generator") | ||
|
||
// LUT for the address speed | ||
uint32_t env_table[] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those are way too generic names to put as globals. Please plonk them as static const class members.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, good point. Let me know if this it better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put it as static constexpr in the cpp file now, hope that works, otherwise sorry for the misunderstanding
src/devices/sound/roland_sa.cpp
Outdated
|
||
// LUT for bits 5/6/7/8 of the subphase | ||
uint16_t addr_table[] = {0x1e0, 0x080, 0x060, 0x04d, 0x040, 0x036, 0x02d, 0x026, | ||
0x020, 0x01b, 0x016, 0x011, 0x00d, 0x00a, 0x006, 0x003}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's the other one
|
||
void roland_sa_device::device_start() | ||
{ | ||
m_stream = stream_alloc(0, 2, 20000, STREAM_SYNCHRONOUS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why synchronous?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To properly work, the CPU needs to be able to receive interrupts from the envelopes, and if the buffer size is too big they will be received too late. This way the CPU can react to interrupts after every sample.
Haven't found a better way to do that unfortunately, do you have any suggestion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's a good reason.
What I mean is a "static const uint32_t env_table[];" in the class header and "const uint32_t roland_sa_device::env_table[] = {" in the cpp. Very usual. |
@galibert got it, done! |
* Sound chip * Fix indent * Fix * Fx * Constants
Adds emulation for the sound chips found in the Roland CPU-B board of SA-synthesis digital pianos (MKS-20, RD1000, ...).