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

06-sound-sample no sound on real hardware with NEOSD #64

Closed
khelkun opened this issue Sep 18, 2021 · 7 comments
Closed

06-sound-sample no sound on real hardware with NEOSD #64

khelkun opened this issue Sep 18, 2021 · 7 comments

Comments

@khelkun
Copy link
Contributor

khelkun commented Sep 18, 2021

We've been trying to run 06-sound-sample on Neogeo AES with a NEOSD cartdige.
Someone has already achieved this successfully?

We use neosdconv and it works fine with game roms downloaded from the web. But the 06-sound-sample rom does not have sound although the graphics are there and the buttons trigger on screen.

The issue is presumably about the sound driver MROM.

I thought the problem could be the driver signature which I assume to be the driver ID declared here. So I tried to replace it with %Ver 3.0 by MAKOTO.04/03/10 to SK% which is the "Puzzle De Pon!" sound driver signature according to the wiki.

But it seems this lead is not the right one. Would you have any other ideas or tests to perform please?

@dciabrin
Copy link
Owner

This might very well be a timing issue in the code on real hardware. I started this default sound driver from scratch so it's very likely that the z80 code does not wait long enough on the ym2612 or something along those line.
There's no particular logic for sound driver check/enforcement in the hardware, so tweaking the driver ID won't change anything. I don't think that NEOSD would do any check on it either.

@khelkun
Copy link
Contributor Author

khelkun commented Sep 20, 2021

So this may be related to prepare_wait_in_ram_opcode macro and its usage in the MROM init and the snd_command_01_prepare_for_rom_switch?

@dciabrin
Copy link
Owner

So this may be related to prepare_wait_in_ram_opcode macro and its usage in the MROM init and the snd_command_01_prepare_for_rom_switch?

So I think that this one shouldn't but the culprit, because unless it's buggy it's just meant to make the z80 read its code from RAM, to leave time to the m68k to initialize everything and switch to whatever z80 code bank is needed.

I'm more thinking something is wrong in https://github.com/dciabrin/ngdevkit/blob/f845e9c40fb9c8f6ee562933fb08a311785667ae/nullsound/driver/ym2610.s, because successive calls to the ym2610 have to respect some latency [1,2] to be effectively honored by the ym2610. And usually the emulators aren't that sensible to that, so we're overlooking some bugs on the real hardware.

[1] http://www.ajworld.net/neogeodev/ym2610am2.html#Status
[2] http://www.ajworld.net/neogeodev/ym2610am2.html#RegWriting

@dciabrin
Copy link
Owner

Also https://wiki.neogeodev.org/index.php?title=Z80/YM2610_interface is probably a more specific answer to my previous comment.

@khelkun
Copy link
Contributor Author

khelkun commented Sep 22, 2021

Cool that seems to be the right lead. I'l try to fix this and send you a PR if I succeed. thanks

@dciabrin
Copy link
Owner

After an awfully long hiatus, I just noticed that example 06 doesn't seem to run on MAME either. So while it's nothing close to being fixed, at least it doesn't require me from getting my hands on a neosd to test that on real hardware.

@dciabrin
Copy link
Owner

dciabrin commented Jun 7, 2023

OK I think 859fc94 should fix this issue. It looks like the z80 was never initialized properly so it couldn't receive NMI when the 68k was triggering a sound command.
I don't have a way to test this fix on real hardware, but Mame is usually pretty spot on for NeoGeo, so I believe this patch should fix the original issue.
Closing accordingly.

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

2 participants