Donkey Kong: Walking Sound Hack?
-
- Posts: 89
- Joined: Thu Jul 30, 2020 1:05 pm
- Has thanked: 14 times
- Been thanked: 27 times
Re: Donkey Kong: Walking Sound Hack?
I'm also an EE.
Look at the DK schematic, TKG4-14-CPU page 3. In the bottom right, you'll see an NE556 surrounded by a lot of analog buffers, resistors, transistors, capacitors. These make sounds directly like a Jupiter 8, and are mixed in with the digital sounds (from the MB8884 after the DAC).
https://arcarc.xmission.com/PDF_Arcade_ ... TKG-4).pdf
The Fantom (I had a Fantom G6) is PCM sample based. Everything it can do is based on its giant WAV memory.
Roland's Aira line use ACB (analog circuit behaviour) which is basically what MAME uses, and what we should be talking about for DK.
Here's the MAME audio driver for DK:
https://github.com/mamedev/mame/blob/d3 ... /dkong.cpp
You will notice that it starts off with a list of nodes and then the exact components from the schematic. MAME itself has what is basically an entire SPICE solver that can simulate the entire audio schematic continuously, which requires a lot of CPU power. Maybe you remember using Multisim or something back in school where doing a transient analysis of the first 1/10th of a second required 10 or more seconds to solve.
Info on how analog audio simulation was only added in in MAME 0.224 about a year ago:
https://www.reddit.com/r/emulation/comm ... s_and_70s/
Elsewhere in the forums I've been advocating for the use of the new MT32-Pi-Lite official board (which attaches to a Rasp Pi) to be used to basically run MAME's audio drivers and pipe the sound back to the DE10 to be mixed in, similar to how MT32 does it. So far no experts have weighed in on that.
Look at the DK schematic, TKG4-14-CPU page 3. In the bottom right, you'll see an NE556 surrounded by a lot of analog buffers, resistors, transistors, capacitors. These make sounds directly like a Jupiter 8, and are mixed in with the digital sounds (from the MB8884 after the DAC).
https://arcarc.xmission.com/PDF_Arcade_ ... TKG-4).pdf
The Fantom (I had a Fantom G6) is PCM sample based. Everything it can do is based on its giant WAV memory.
Roland's Aira line use ACB (analog circuit behaviour) which is basically what MAME uses, and what we should be talking about for DK.
Here's the MAME audio driver for DK:
https://github.com/mamedev/mame/blob/d3 ... /dkong.cpp
You will notice that it starts off with a list of nodes and then the exact components from the schematic. MAME itself has what is basically an entire SPICE solver that can simulate the entire audio schematic continuously, which requires a lot of CPU power. Maybe you remember using Multisim or something back in school where doing a transient analysis of the first 1/10th of a second required 10 or more seconds to solve.
Info on how analog audio simulation was only added in in MAME 0.224 about a year ago:
https://www.reddit.com/r/emulation/comm ... s_and_70s/
Elsewhere in the forums I've been advocating for the use of the new MT32-Pi-Lite official board (which attaches to a Rasp Pi) to be used to basically run MAME's audio drivers and pipe the sound back to the DE10 to be mixed in, similar to how MT32 does it. So far no experts have weighed in on that.
Re: Donkey Kong: Walking Sound Hack?
I think you guys should trust the MAME analog audio for making comparisons.
The team that created that audio code worked on it for close to a decade and had full access to all the original golden age cabinets (they even flew across the world at times to check out bootleg versions and other rare cabinets). They took into account the aging components and other factors. I'm not even sure it would be possible to duplicate their effort again today.
The team that created that audio code worked on it for close to a decade and had full access to all the original golden age cabinets (they even flew across the world at times to check out bootleg versions and other rare cabinets). They took into account the aging components and other factors. I'm not even sure it would be possible to duplicate their effort again today.
-
- Core Developer
- Posts: 547
- Joined: Sun May 24, 2020 9:30 pm
- Has thanked: 20 times
- Been thanked: 145 times
Re: Donkey Kong: Walking Sound Hack?
My issue with "trusting" MAME sounds (or anything) is that each board/system/module is built to a different standard, and there really doesn't seem to be a "known issues/limitations" list anywhere. Trusting MAME has gotten many an emulator/core author in trouble in the past because of bad axiomatic thinking.
Perhaps Donkey Kong is in a much better state than other boards, as it sounds like significant effort has gone into more research on these specific items.
As was mentioned earlier in the thread, if MAME can programmatically produce a more accurate simulated output, so can MiSTer. It's more a question of who is willing to implement it in the core.
Perhaps Donkey Kong is in a much better state than other boards, as it sounds like significant effort has gone into more research on these specific items.
As was mentioned earlier in the thread, if MAME can programmatically produce a more accurate simulated output, so can MiSTer. It's more a question of who is willing to implement it in the core.
Re: Donkey Kong: Walking Sound Hack?
Analog sound was a project within a project for MAME with it's own team working on it. It was all recreated at the circuit level, unlike most of the other code in MAME.
I'm just saying that trusting it is going to be easier than the alternative, which is duplicating that entire effort which we know took them almost a decade.
I'm just saying that trusting it is going to be easier than the alternative, which is duplicating that entire effort which we know took them almost a decade.
-
- Top Contributor
- Posts: 1311
- Joined: Mon Jul 06, 2020 9:37 pm
- Has thanked: 634 times
- Been thanked: 308 times
Re: Donkey Kong: Walking Sound Hack?
I agree that using the Mame source code as a resource makes total sense given the amount of effort that went into it. The big question in my mind at this point is how much processing power does it take and how powerful is the FPGA compared to the Arm side of the MiSTer. I have compiled the newer versions of Mame on my Raspberry Pi 3 (and maybe also the 4 but I don't remember) specifically for the new Donkey Kong sound and when I played the game, it was clear that the Pi was not fast enough. This led me to a short time of using a PC instead of the Pi and eventually I discovered the MiSTer and I haven't really touched Mame since, except for a few games that are not on the MiSTer. I don't know how the Arm compares to a Pi 3, but only a subset of the Mame code would be needed. I suspect that the relatively massive FPGA in the MiSTer could be programmed in a way to specifically handle the Donkey Kong math very efficiently using more of the FPGA to get the job done quicker. As I mentioned previously, a lower sample rate could be used if the computing power requirements are too high for perfect sound. If the Arm side of the MiSTer is used, then the Mame code could be almost used directly, but I don't know if the Arm side is fast enough, and it is using a computer instead of dedicated FPGA so it is theoretically less efficient. Clock speed is also a major difference between the FPGA side and the Arm side, but again the FPGA can do things in parallel giving it a massive potential advantage.
Re: Donkey Kong: Walking Sound Hack?
For those that say "it should be possible. someone should just do it."
That is a sign that maybe this is a place for you to insert yourself- you should research it and see about implementing it. Maybe you will discover why it hasn't been done before.
That does NOT mean try to nominate someone else to do it for you. That is not the right approach. This is done as a hobby only. Nobody wants another job.
Modeling analog behavior requires heavy math and a CPU which an FPGA does not have unless you build one for it to use.
The MiSTer does have the ARM you can use as a coprocessor, but that is a very advanced programming project to interface that to a core.
That is a sign that maybe this is a place for you to insert yourself- you should research it and see about implementing it. Maybe you will discover why it hasn't been done before.
That does NOT mean try to nominate someone else to do it for you. That is not the right approach. This is done as a hobby only. Nobody wants another job.
Modeling analog behavior requires heavy math and a CPU which an FPGA does not have unless you build one for it to use.
The MiSTer does have the ARM you can use as a coprocessor, but that is a very advanced programming project to interface that to a core.
-
- Top Contributor
- Posts: 1441
- Joined: Mon May 25, 2020 7:54 pm
- Has thanked: 496 times
- Been thanked: 467 times
Re: Donkey Kong: Walking Sound Hack?
Has anybody actually said that though?
Also, it's not really always "just a hobby" anymore, not in the high-yielding Patreons era. That does not of course mean that anybody, not even patrons, can demand anything or expect their requests and wishes to be fulfiled, but it's not quite like the old days either. If people here want to raise a bounty for a specific issue and somebody capable might want to take it up, then it's an entirely different cup of tea.
CRT SCR$ Project - building a collection of high-quality photos of CRT displays
CRT ART Books - retro-gaming books with authentic CRT photos
-
- Top Contributor
- Posts: 1321
- Joined: Thu Jun 11, 2020 2:31 am
- Has thanked: 15 times
- Been thanked: 213 times
Re: Donkey Kong: Walking Sound Hack?
@rcade nobody has said OR implied that to the best of my knowledge, but it's quite correct that it ABSOLUTELY _can_ be done in the same manner it was for MAME, as I pointed out over a year ago. Using digital technology to simulate discrete analog components is nothing new. Just because I, for example, don't have the skill to do so doesn't mean it can't be done, and if it hasn't been done due to lack of interest, lack of time, lack of skill, lack of funding, or lack of giving a shit...that's a whole other thing that I personally won't be getting into as too painfully obvious to mention. There are, however, those 'experts' on the forum that are POSITIVE it *can't be done* because analog != digital, and I figure they are owed having their ignorance dispelled, at least.
For those who say "yeah, but MAME has it easier, it's software!!!"...no. Just no. MAME's discrete simulation actually has the deck stacked against it because it's necessarily serial and run in-line with all the other emulation code in a single thread. Discrete components, of course, have the advantage of (potential) parallelism, where FPGA truly shines and the performance bottleneck is no longer a factor. Now as to whether FPGA gating on the DE-10 specifically is fast enough to execute the Spice-like simulation, that's a whole other question...and one I'm ill-equipped to answer, as is anyone else until it's tried someday.
#rant off
For those who say "yeah, but MAME has it easier, it's software!!!"...no. Just no. MAME's discrete simulation actually has the deck stacked against it because it's necessarily serial and run in-line with all the other emulation code in a single thread. Discrete components, of course, have the advantage of (potential) parallelism, where FPGA truly shines and the performance bottleneck is no longer a factor. Now as to whether FPGA gating on the DE-10 specifically is fast enough to execute the Spice-like simulation, that's a whole other question...and one I'm ill-equipped to answer, as is anyone else until it's tried someday.
#rant off
-
- Top Contributor
- Posts: 1311
- Joined: Mon Jul 06, 2020 9:37 pm
- Has thanked: 634 times
- Been thanked: 308 times
Re: Donkey Kong: Walking Sound Hack?
I think we all or most of us are on the same page now, where we weren't before. Short-term mission accomplished. Hopefully someday, someone with the skills and interest will give this an attempt. It would be an amazing accomplishment and much appreciated.
Exactly.Modeling analog behavior requires heavy math and a CPU which an FPGA does not have unless you build one for it to use.
The MiSTer does have the ARM you can use as a coprocessor, but that is a very advanced programming project to interface that to a core.
-
- Top Contributor
- Posts: 1311
- Joined: Mon Jul 06, 2020 9:37 pm
- Has thanked: 634 times
- Been thanked: 308 times
Re: Donkey Kong: Walking Sound Hack?
This is interesting: https://opencores.org/projects/fpu designed to go with this: https://opencores.org/projects/or1k_old
Basically what is really needed is to replace the analog circuits with digital ones that produce the analog signal that can be mixed with the other digital sound. A black box with inputs and outputs. How this gets done in FPGA is very flexible but requires math components obviously. Needing some kind of CPU is questionable, but there needs to be something to manage everything. I haven't really thought it through so I am just sort of thinking out loud.
Also, I was thinking that LUT's (lookup tables) might be an option since the same calculations might be used over and over again. Just pre-calculate everything and store the results for reference later, or even create new samples using the Mame code but for each specific sound that might ever happen that can be mixed together inside the MiSTer as the sounds are called upon.
Basically what is really needed is to replace the analog circuits with digital ones that produce the analog signal that can be mixed with the other digital sound. A black box with inputs and outputs. How this gets done in FPGA is very flexible but requires math components obviously. Needing some kind of CPU is questionable, but there needs to be something to manage everything. I haven't really thought it through so I am just sort of thinking out loud.
Also, I was thinking that LUT's (lookup tables) might be an option since the same calculations might be used over and over again. Just pre-calculate everything and store the results for reference later, or even create new samples using the Mame code but for each specific sound that might ever happen that can be mixed together inside the MiSTer as the sounds are called upon.
- pgimeno
- Top Contributor
- Posts: 709
- Joined: Thu Jun 11, 2020 9:44 am
- Has thanked: 277 times
- Been thanked: 226 times
Re: Donkey Kong: Walking Sound Hack?
This post from the classic synths thread might give ideas, or at least raise the hopes: viewtopic.php?p=37414#p37414
Converters I've written: Floppy DIM/FDI/FDD/HDM to D88, D88 to XDF, Tape SVI 318/328 CAS to WAV
-
- Top Contributor
- Posts: 1311
- Joined: Mon Jul 06, 2020 9:37 pm
- Has thanked: 634 times
- Been thanked: 308 times
Re: Donkey Kong: Walking Sound Hack?
The article linked there looks promising!: https://www.researchgate.net/publicatio ... it_Designs
Re: Donkey Kong: Walking Sound Hack?
Another sound issue I've noticed. The 'boom' sound when mario gets hit by an object or when DK is beating his chest is missing when you are walking. If you are standing still you can hear it. The original arcade game you can always hear it.
-
- Core Developer
- Posts: 20
- Joined: Tue Mar 29, 2022 10:07 pm
- Has thanked: 14 times
- Been thanked: 61 times
Re: Donkey Kong: Walking Sound Hack?
I'd like to have a look at the DK analog sound implementation.
It'll probably be an analog modeled sound, because a SPICE-like simulation is not realistic to implement as of now.
I've tried the LiveSPICE project that I had to port to Linux, but it's not fast enough on a raspberry pi 3b to simulate an entire analog sound PCB, just a couple of elements, wasn't helpful.
About the mame sounds system, I know there are two versions that do some kind of element-wise simulation of the electronics.
One of them is called "discrete" sound, and they say it sounds good. I haven't personally heard it. But if it's really that good, it might be worth trying to port it, or even to make a custom on-fpga chip for it to be able to run it fast enough. I can do some investigation.
The other one I'm not sure what's it's called, but that's what's used in their battlezone/red baron emulators, and it is not accurate.
Some sounds are literally wrong and the others are very low fidelity, kind of like an 8 bit version of the sounds.
One way or another, it would be nice to find some way to make implementation of analog sound in MiSTer easier.
It'll probably be an analog modeled sound, because a SPICE-like simulation is not realistic to implement as of now.
I've tried the LiveSPICE project that I had to port to Linux, but it's not fast enough on a raspberry pi 3b to simulate an entire analog sound PCB, just a couple of elements, wasn't helpful.
About the mame sounds system, I know there are two versions that do some kind of element-wise simulation of the electronics.
One of them is called "discrete" sound, and they say it sounds good. I haven't personally heard it. But if it's really that good, it might be worth trying to port it, or even to make a custom on-fpga chip for it to be able to run it fast enough. I can do some investigation.
The other one I'm not sure what's it's called, but that's what's used in their battlezone/red baron emulators, and it is not accurate.
Some sounds are literally wrong and the others are very low fidelity, kind of like an 8 bit version of the sounds.
One way or another, it would be nice to find some way to make implementation of analog sound in MiSTer easier.
-
- Core Developer
- Posts: 20
- Joined: Tue Mar 29, 2022 10:07 pm
- Has thanked: 14 times
- Been thanked: 61 times
Re: Donkey Kong: Walking Sound Hack?
Well, I've started on MiSTer Discrete.
https://github.com/jopdorp/MiSTer-Discrete
It's not finished, but the Donkey Kong walk sound is implemented and alive!
You can hear the output from my dk_walk core here:
https://github.com/jopdorp/MiSTer-Discr ... v?raw=true
Still have to integrate it with the Donkey Kong core
https://github.com/jopdorp/MiSTer-Discrete
It's not finished, but the Donkey Kong walk sound is implemented and alive!
You can hear the output from my dk_walk core here:
https://github.com/jopdorp/MiSTer-Discr ... v?raw=true
Still have to integrate it with the Donkey Kong core
- HerrBerzerk
- Posts: 273
- Joined: Tue Feb 01, 2022 1:45 pm
- Has thanked: 121 times
- Been thanked: 39 times
Re: Donkey Kong: Walking Sound Hack?
As I understand it, this is fantastic. Do you create subsystems for analog sounds, like the 6 Sounds in Asteroids or the Galaxian background or explosion sound and they can get linked to the cores then? While all the new arcade cores work fine, especially the classic arcade cores all need some love.
-
- Core Developer
- Posts: 20
- Joined: Tue Mar 29, 2022 10:07 pm
- Has thanked: 14 times
- Been thanked: 61 times
Re: Donkey Kong: Walking Sound Hack?
I'm still integrating the walk sound with the DK core right now, then I think I'll do another another iteration on the circuit simulation, see if I can implement a general circuit solver. to solve everything except capacitors, inductors and opamps, which are implemented as high/low pass filters.
Then I'll finish the DK core first.
After finishing the first core, others should become considerably less work.
I like Asteroids, so that might be a good contender for the next one
Then I'll finish the DK core first.
After finishing the first core, others should become considerably less work.
I like Asteroids, so that might be a good contender for the next one
-
- Core Developer
- Posts: 20
- Joined: Tue Mar 29, 2022 10:07 pm
- Has thanked: 14 times
- Been thanked: 61 times
Re: Donkey Kong: Walking Sound Hack?
The walk sound is integrated into the DK core.
The release pullrequest is pending, but you can already download the build here:
https://github.com/jopdorp/Arcade-Donke ... 220429.rbf
It is great to see so much enthusiasm around the analog sounds of these arcades!
Persuaded by the enthusiasm here and on the Discord, I've created a Patreon, to help me be able to spend more time on these projects.
https://www.patreon.com/jopdorp
If you like the work, and want me to support me to keep on building these analog sound implementations, become a patron
The release pullrequest is pending, but you can already download the build here:
https://github.com/jopdorp/Arcade-Donke ... 220429.rbf
It is great to see so much enthusiasm around the analog sounds of these arcades!
Persuaded by the enthusiasm here and on the Discord, I've created a Patreon, to help me be able to spend more time on these projects.
https://www.patreon.com/jopdorp
If you like the work, and want me to support me to keep on building these analog sound implementations, become a patron
Re: Donkey Kong: Walking Sound Hack?
This is truly amazing, a dream come true. Will become a patron today!jopdorp wrote: ↑Sat Apr 30, 2022 8:12 am The walk sound is integrated into the DK core.
The release pullrequest is pending, but you can already download the build here:
https://github.com/jopdorp/Arcade-Donke ... 220429.rbf
It is great to see so much enthusiasm around the analog sounds of these arcades!
Persuaded by the enthusiasm here and on the Discord, I've created a Patreon, to help me be able to spend more time on these projects.
https://www.patreon.com/jopdorp
If you like the work, and want me to support me to keep on building these analog sound implementations, become a patron
- HerrBerzerk
- Posts: 273
- Joined: Tue Feb 01, 2022 1:45 pm
- Has thanked: 121 times
- Been thanked: 39 times
Re: Donkey Kong: Walking Sound Hack?
Also became Patreon, we need someone who cares for those old arcade cores that all have wrong sounds like Galaxian, Frogger and many many more.
Re: Donkey Kong: Walking Sound Hack?
This release doesn't work at all for me. I'm using the 4/29 rbf along with the included mra. Upon launch the game just sits there glitching and playing the mario death sound over and over.jopdorp wrote: ↑Sat Apr 30, 2022 8:12 am The walk sound is integrated into the DK core.
The release pullrequest is pending, but you can already download the build here:
https://github.com/jopdorp/Arcade-Donke ... 220429.rbf
It is great to see so much enthusiasm around the analog sounds of these arcades!
Persuaded by the enthusiasm here and on the Discord, I've created a Patreon, to help me be able to spend more time on these projects.
https://www.patreon.com/jopdorp
If you like the work, and want me to support me to keep on building these analog sound implementations, become a patron
-
- Core Developer
- Posts: 20
- Joined: Tue Mar 29, 2022 10:07 pm
- Has thanked: 14 times
- Been thanked: 61 times
Re: Donkey Kong: Walking Sound Hack?
Thank you for reporting this, do you have any more information for me to reproduce?mario64 wrote: ↑Sat Apr 30, 2022 2:47 pmThis release doesn't work at all for me. I'm using the 4/29 rbf along with the included mra. Upon launch the game just sits there glitching and playing the mario death sound over and over.jopdorp wrote: ↑Sat Apr 30, 2022 8:12 am The walk sound is integrated into the DK core.
The release pullrequest is pending, but you can already download the build here:
https://github.com/jopdorp/Arcade-Donke ... 220429.rbf
It is great to see so much enthusiasm around the analog sounds of these arcades!
Persuaded by the enthusiasm here and on the Discord, I've created a Patreon, to help me be able to spend more time on these projects.
https://www.patreon.com/jopdorp
If you like the work, and want me to support me to keep on building these analog sound implementations, become a patron
What addons are you using, power adapter, does it also happen when you don't have any expansion boards and peripherals attached?
- pgimeno
- Top Contributor
- Posts: 709
- Joined: Thu Jun 11, 2020 9:44 am
- Has thanked: 277 times
- Been thanked: 226 times
Re: Donkey Kong: Walking Sound Hack?
Works quite well for me.
There's a very minor bug, that you could argue is more of a style thing than a bug. In this change:
the 3'b000 should have become a 2'b00. It won't make a difference; I'm not sure if Quartus will be issuing a warning for it but if it does, it's an easily avoidable warning
I'd also check how is W_6H_Q[0] generated, to see if it needs cleanup.
It's a bit confusing that the patch is already committed to master, but the PR is still open. What happened there?
There's a very minor bug, that you could argue is more of a style thing than a bug. In this change:
Code: Select all
- .I_SW(I_DKJR ? 3'b000 : W_6H_Q[2:0])
+ .I_SW(I_DKJR ? 3'b000 : W_6H_Q[2:1])
I'd also check how is W_6H_Q[0] generated, to see if it needs cleanup.
It's a bit confusing that the patch is already committed to master, but the PR is still open. What happened there?
Converters I've written: Floppy DIM/FDI/FDD/HDM to D88, D88 to XDF, Tape SVI 318/328 CAS to WAV
Re: Donkey Kong: Walking Sound Hack?
I commented on the original PR that got merged. I'm in the camp that was slightly bothered by the samples in that they can't reproduce the random nature of how the walking sound is actually produced. I'd think though that anyone sensitive enough to want an improvement in the existing walking sound would not be convinced that this is an improvement. It sounds too high pitched and squeaky compared to the original. The existing samples are closer to correct. I'm not sure why it sounds so off based on the modeling approach taken which is closer to what actually happens and I haven't seen much negative feedback. I hope everyone concerned can try it out for themselves and sanity check my assessment before this gets released.