Shauing wrote: ↑July 24th, 2021, 12:22 pm
I'm curious about something here. Several games have an echo flag activated (as shown here on the SPC Player of a Sunset Riders song):
SPCEcho.png
But Prince of Persia SNES doesn't seem to have it activated (or have one), as I checked on all 8 channels of every music track SPC. I'm curious as if it can be activated/or does even it have an echo capacity?
Supposedly on the music format there some commands for something related to echo but apparently nothing that activates the echo flag.
Well, almost a month later I found an answer to this. Turns out the original game has a bug in the echo implementation. More or less for what I understood, the intended EON (Echo Enable) bits got overwritten, thus no echo is heard.
This flaw was discovered by KungFuFurby from the SNESLab Discord, where I had submitted a cover of Mozart's ''Ave Verum Corpus'' utilizing custom samples and using the PoP SNES music engine. I wondered there if the echo flag could be activated somehow at all, perhaps maybe by an undiscovered command. KungFuFurby entered the conversation by commenting on my use of the Prince of Persia music engine as another Arsys developed game ''Battle Zeque Den'', uses a similar (if not the same) music engine.
So then for the next few days, KungFuFurby and I went discussing and looking into the music engine for PoP, mainly looking for what each music command did by looking into the SPC700 ASM itself and consulting documentation and files from here on the forum related to SNES PoP's music engine and eventually KungFuFurby found out and pointed the flawed portion of the code here:
Code: Select all
0893: f3 ce 6d BBC7 $ce,$0903
0896: ab ce INCZ $ce
0898: d0 69 BNE $0903
089a: e4 2f MOVZ A,$2f ; muted channels?
089c: 48 ff EOR A,#$ff
089e: 24 d0 ANDZ A,$d0
08a0: c4 b2 MOVZ $b2,A ; current command L
08a2: e4 2f MOVZ A,$2f ; muted channels?
08a4: 24 d1 ANDZ A,$d1
08a6: 04 b2 ORZ A,$b2 ; current command L
08a8: f0 04 BEQ $08ae
08aa: b2 cf SET5 $cf ; current FLG (Nn) noise freq
08ac: 2f 17 BRA $08c5
We're off to $08C5.
08c5: e4 cf MOVZ A,$cf ; current FLG (Nn) noise freq
08c7: 8d 6c MOV Y,#$6c
08c9: 3f b1 09 CALL $09b1 ; set register Y to A
08cc: 8d 4d MOV Y,#$4d
08ce: 3f b1 09 CALL $09b1 ; set register Y to A
''The accumulator is overwritten here, meaning the true EON bits never get written''.
KungFuFurby also kindly provided a fix for this, which can be applied over the original ROM:
''Replace E4 CF 8D 6C 3F B1 09 8D 4D 3F B1 09
with 2D EB CF E8 6C DA F2 EE E8 4D DA F2
and the EON bits should be working again''.
The explanation of the fix:
''The main thing I did was to save the old accumulator containing the EON flags upon arrival, then retrieved them after writing to the FLG DSP register so that they would be written correctly''.
This also means the soundtrack has not been heard in its intended way for almost 30 years! (Differences are for the most part subtle, but some tracks do feature a somewhat very audible echo).
Here I provide an example of just the percussion as well as the lead instrument track of Level 19 music, first as how we hear it in the final game (Original), and then with its intended echo; subtle, but noticeable.
Stage 9 - Track 3 (Original):
https://www.dropbox.com/s/7xvnfrdn57iyp ... 9.mp3?dl=0
Stage 9 - Track 3 (With Intended Echo):
https://www.dropbox.com/s/cd5ndqrsuu41y ... 9.mp3?dl=0
Stage 9 - Track 6 (Original):
https://www.dropbox.com/s/f7fzvw9w8k08g ... 9.mp3?dl=0
Stage 9 - Track 6 (With Intended Echo):
https://www.dropbox.com/s/yqmo96wlbyv06 ... 9.mp3?dl=0