sonicretro / s1disasm

Sonic 1 Disassembly
335 stars 97 forks source link

Correct sound queue titles #61

Open AlexField442 opened 2 years ago

AlexField442 commented 2 years ago

This is more of a suggestion, but shouldn't we use "PlayMusic" and "PlaySound" instead of "PlaySound" and "PlaySound_Special"? I'm saying this because, although used interchangably in Sonic 1, the Nick Arcade symbol tables suggest they are meant to be specific, while the labels here suggest they're meant for "sounds" and "special sounds".

(search "bgmset" and "soundset"; their locations match-up near perfectly with Sonic 1

Clownacy commented 2 years ago

If only those symbols contained a name for the 'PlaySound_Unused' function... Looking at the official "Sound-Source" code, the three queues are generic: none are specifically intended for music or sounds; they're just for queuing multiple requests in a single frame. Section 2 of 'md11.txt' backs this up:

2: How to make a request

 Set the request number in the kyflag below. If there is a possibility that more than one request number is set from interrupt to interrupt, there are three buffers for requests, so check whether they are 0 or not in order before setting them. Please do so. (The sound clears all three buffers to zero each time a CALL is made.)

      kyflag equ $fff00a
       (buf1 equ $fff00a)
       (buf2 equ $fff00b)
       (buf3 equ $fff00c)

With that in mind, the idea that each queue is for music, SFX, and whatever the third thing would have been (background SFX?), seems to be entirely Sonic Team's.

The third sound queue is broken in Sonic 1, because of a bug in the sound driver. It was fixed in Sonic 2 (after the Nick Arcade prototype), and the third PlaySound function (erroneously known as 'PlaySoundStereo' in the Sonic 2 disassembly) finally started being used. Strangely, the leftover Big Ring object from Sonic 1 was modified to use PlaySoundStereo. In Sonic 3, the second and third PlaySound functions were merged together. The third queue's usage in Sonic 2 and Sonic 3 suggest that it was always intended for sounds, so its name could have been something like 'soundset2', but I guess we can't know for sure.