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

Added emulation for Roland SA sound chips #13209

Merged
merged 5 commits into from
Jan 11, 2025
Merged

Conversation

giulioz
Copy link
Contributor

@giulioz giulioz commented Jan 10, 2025

Adds emulation for the sound chips found in the Roland CPU-B board of SA-synthesis digital pianos (MKS-20, RD1000, ...).

  • IC19 R06-0001 (Fujitsu MB60VH142)
  • IC9 R06-0002 (Fujitsu MB60V141)
  • IC8 R06-0003 (Fujitsu MB61V125)

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[] = {
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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


// 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};
Copy link
Member

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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why synchronous?

Copy link
Contributor Author

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?

Copy link
Member

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.

@galibert
Copy link
Member

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.

@giulioz
Copy link
Contributor Author

giulioz commented Jan 10, 2025

@galibert got it, done!

@galibert galibert merged commit 9b67884 into mamedev:master Jan 11, 2025
5 checks passed
boamaod pushed a commit to boamaod/mame that referenced this pull request Jan 18, 2025
* Sound chip

* Fix indent

* Fix

* Fx

* Constants
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

Successfully merging this pull request may close these issues.

2 participants