nesdev.com
http://forums.nesdev.com/

DMG / CGB Gameboy sound on Nintendo DS - how it works ?
http://forums.nesdev.com/viewtopic.php?f=20&t=15601
Page 1 of 2

Author:  Dr.Wily [ Thu Mar 02, 2017 3:02 am ]
Post subject:  DMG / CGB Gameboy sound on Nintendo DS - how it works ?

Simples questions :

How works the DMG APU on Nintendo DS when a GBA game is used ?
Is there a real Gameboy hardware APU in Nintendo DS or it's just emulation ?
In DS mode, is DS games can use Gameboy channels ? (2 pulses, 1 wave, 1 noise)

Author:  Bregalad [ Thu Mar 02, 2017 3:05 am ]
Post subject:  Re: DMG / CGB Gameboy sound on Nintendo DS - how it works ?

I always wondered that as well. I know the DS' sound channels have an option to generate square waves or white noise without requiring samples, but my understanding is that this mode is sparsely used by DS games. I don't know whether this was used to support GB(C)'s sound backwards compatibility or not. In all cases, compatibility seems complete and I've yet to see games which sounds any different on a DS than on a GBA (the same cannot be said about GBA emulators...) I could be wrong, though.

Author:  Dr.Wily [ Thu Mar 02, 2017 4:03 am ]
Post subject:  Re: DMG / CGB Gameboy sound on Nintendo DS - how it works ?

Quote:
I know the DS' sound channels have an option to generate square waves or white noise without requiring samples


Yes, DS' channels 8-13 generate some "PSG" like sounds. Channels 14-15 can generate white noise. But the DMG APU has specifics features like the wave channel who use a builtin wave patern memory of 16 bytes and a noise channel who use LSFR. These features are very specific to the Gameboy APU, especially the wave channel where the sounding depend of the revision of the CPU. I don't know if it's possible to emulate these features on DS.

Author:  tepples [ Thu Mar 02, 2017 6:51 am ]
Post subject:  Re: DMG / CGB Gameboy sound on Nintendo DS - how it works ?

I think those are available only while GBA mode is active, just as 2bpp 160x144 video is available only in GBC mode on a GBA.

Author:  Dr.Wily [ Thu Mar 02, 2017 8:12 am ]
Post subject:  Re: DMG / CGB Gameboy sound on Nintendo DS - how it works ?

Quote:
I think those are available only while GBA mode is active, just as 2bpp 160x144 video is available only in GBC mode on a GBA.


Thanks tepples. But the gameboy APU in DS is hardware or software ?

Author:  tepples [ Thu Mar 02, 2017 8:47 am ]
Post subject:  Re: DMG / CGB Gameboy sound on Nintendo DS - how it works ?

I'd guess hardware. But given that the PlayStation 2 emulates the original's GTE+GPU partially in software, I can't say for sure. To be 100 percent sure would require fuming nitric acid and microphotography.

Let's take a step back and talk about the goal you're seeking. Are you looking for behavior differences between GBC tone generators on a GBA in GBA mode and GBC tone generators on a DS in GBA mode?

Author:  Dr.Wily [ Thu Mar 02, 2017 9:18 am ]
Post subject:  Re: DMG / CGB Gameboy sound on Nintendo DS - how it works ?

Quote:
Are you looking for behavior differences between GBC tone generators on a GBA in GBA mode and GBC tone generators on a DS in GBA mode?


None of them. My purpose is to know how DS produces Gameboy sound, if this machine is reliable for compose music with orriginal Gameboy feeling.
All Gameboy models handle sound differently (especialy channel 3). I need to know if the orriginal tone generator circuitery in the Gameboy is the same as one present (or not) in DS.

Author:  Dwedit [ Thu Mar 02, 2017 10:19 am ]
Post subject:  Re: DMG / CGB Gameboy sound on Nintendo DS - how it works ?

Supposedly, the DS mixes sound at 1,048,576Hz 24-bit, then cuts that down to 32768Hz 10-bit with PWM. But I've found that PSG sounds really bad on the DS, it sounds very aliased. So you'd get better sound with a software mixer that synthesizes sound at 32768Hz.
If it's mixing 16 channels at ~1MHz, it's probably playing all 16 sound channels in series for left and right channels, then downsampling with PWM. It wouldn't be playing PSG sound at anything faster than 32768Hz.

There is a GBA sound chip in there too, but it's completely inaccessible in DS mode.

I bet they kept PSG sound in there (DS MODE) just for the Pokemon cries.

Author:  tepples [ Thu Mar 02, 2017 10:23 am ]
Post subject:  Re: DMG / CGB Gameboy sound on Nintendo DS - how it works ?

Dwedit wrote:
I bet they kept PSG sound in there just for the Pokemon cries.

That plus Nintendo knew how much CPU and programmer time was associated with software mixing. Some games (such as Doom and Pinobee) use the GBC channels for music and the GBA channels for PCM sound streamed directly from ROM rather than mixed in RAM, and even games with a software mixer (such as Mario Kart Super Circuit) run some instruments on the PSG.

Author:  Dwedit [ Thu Mar 02, 2017 10:25 am ]
Post subject:  Re: DMG / CGB Gameboy sound on Nintendo DS - how it works ?

Was actually talking about DS mode there, not GBA mode, sorry if I wasn't clear enough. But the pokemon cries are still the same in DS games as they were in the GBC games.

Author:  lidnariq [ Thu Mar 02, 2017 11:45 am ]
Post subject:  Re: DMG / CGB Gameboy sound on Nintendo DS - how it works ?

Dwedit wrote:
But I've found that PSG sounds really bad on the DS, it sounds very aliased.
Nocash's description of how the PSG is mixed into the audio on the GBA seems like it would also produce horrible aliasing...

Author:  Dwedit [ Thu Mar 02, 2017 12:55 pm ]
Post subject:  Re: DMG / CGB Gameboy sound on Nintendo DS - how it works ?

On a GBA you can request a PWM update rate of 131,072Hz with 7-bit audio, or even 262,144Hz with 6-bit audio. You can't do that on a DS.
I guess someone could try to figure out the quantization noise you'd get with aliased sampling at 131072Hz, but it's a lot less than the artifacts you'd get at 32768Hz.

Author:  Bregalad [ Thu Mar 02, 2017 11:56 pm ]
Post subject:  Re: DMG / CGB Gameboy sound on Nintendo DS - how it works ?

Dwedit wrote:
On a GBA you can request a PWM update rate of 131,072Hz with 7-bit audio, or even 262,144Hz with 6-bit audio. You can't do that on a DS.

I am not 100% sure, but I guess you can in GBA mode / i.e. a DS in GBA mode behaves like a geniune GBA in this regard.

Author:  Dr.Wily [ Fri Mar 03, 2017 7:13 am ]
Post subject:  Re: DMG / CGB Gameboy sound on Nintendo DS - how it works ?

tepples wrote:
Some games (such as Doom and Pinobee) use the GBC channels for music and the GBA channels for PCM sound


Many GBA games use pulse channels. On top of my head I think at Harmony of Dissonance, Kururin, Gradius Gen, Bubble Bobble - Old & New , Advance War, Contra Advance, Final Fantasy IV Advance and as you said Mario Kart.
This is not few games and the DS handles pretty well these channels. But how ?
I know that the 8080 is built in GBA SOC. But the DMG part has been removed in the DS, Nintendo would have left only the Gameboy sound circuitery ?

Dwedit wrote:
But I've found that PSG sounds really bad on the DS, it sounds very aliased.


Yes, pulse channels seems more roughness than genuine Gameboy sound (include the GBA). That's why I wonder if the Gameboy channels are hardware or software on Nintendo DS.

EDIT : maybe you can move this post in GBDev section...

Author:  Shonumi [ Sat Mar 04, 2017 12:07 pm ]
Post subject:  Re: DMG / CGB Gameboy sound on Nintendo DS - how it works ?

Dr. Wily wrote:
This is not few games and the DS handles pretty well these channels. But how ?


Hasn't this been answered already? As far as we know, when the NDS switches to GBA mode, it just uses the GBA sound chip. The NDS has a lot of hardware bits inside it for handling GBA compatibility.

Dr. Wily wrote:
I know that the 8080 is built in GBA SOC. But the DMG part has been removed in the DS, Nintendo would have left only the Gameboy sound circuitery ?


There's no need for the old DMG sound hardware because the GBA sound hardware is almost functionally identical for the PSG channels. Obviously there are some differences in the wave channel (e.g. you can have 64 samples instead of 32), but that's optional. Unless you're into chip tunes (in which case, almost every Game Boy model produces slightly different quality sound) the GBA can mimic DMG sound. And by that extension, the NDS can mimic DMG sound if you're playing in GBA mode.

I wouldn't say that the NDS (in GBA mode) can exactly, 100% recreate the waveforms you'd get from an original DMG, but it should be close enough if you're not very selective. But if you plan to use an NDS in GBA mode, you might as well just use a GBA instead.

Page 1 of 2 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/