Next Generation Emulation banner
1 - 4 of 4 Posts

· Registered
Joined
·
831 Posts
Sure! But it sounds like sometimes the frequency is wrong (sound too low-pitched). That's all. Apart from that's it's perfect.

EDIT: ah, also, still no PSG support. But that's only minor. PSG isn't used that much in DS games.
 

· Registered
Joined
·
831 Posts
Maybe the frequency calculation formula is wrong?

The frequency calculation formula should be something like that, according to GBATek :

Code:
sound_freq = -16756991 / timer
Where :
* sound_freq is the frequency of the sound
* 16756991 is half the ARM7 clock in hz
* timer is the timer value of the channel.

Then, you calculate the value the sample cursor should be incremented by at each sample as follows :

Code:
inc_value = sound_freq / mixing_freq
Where :
* inc_value is the value the sample cursor...
* sound_freq is the sound frequency in hz
* mixing_freq is the mixing frequency in hz (in the current case, 22050 or 44100)
 

· Registered
Joined
·
831 Posts
See SPU_Write<Word/Long> and SPU_KeyOn for frequency calculation. It's the lines where a value is assigned to thischan.sampinc . But the frequency calculation formula used in DeSmuME isn't accurate (uses 16777216 instead of 16756991). But it doesn't affect the sound output.

The bug could also be a channel that is started whereas it shouldn't be, case where its start address would point to bad memory, causing bad sound to be played.

It could also be an emulation bug causing memory corruption or something else.
 
1 - 4 of 4 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top