Users browsing this thread: 1 Guest(s)
How to fix custom song glitches on emlators.

#1
Posts: 3,966
Threads: 279
Thanks Received: 234
Thanks Given: 56
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
Gi Nattak and I have been trying to understand why some custom song glitches on emulators (and real hardware) except zsnes. The reason is simple: the instruments data overflow sometimes in the SPC-700 RAM in part of the RAM where it doesn't belong to. This will happen when your instruments use too much space total in memory. The reason why the glitch doesn't appear in zsnes is because zsnes runs the SMP (audio CPU) completely out of sync with the CPU.

With some testing, Gi Nattak found that the total of blocks (9 bytes each) used by all samples in one song must not exceed 3746. You can see how much blocks an instrument use in FF3usME.

For quick reference, here's the size of the original samples:

Code:
## size name
-------------------------
01 0337 FF6 Spanish Guitar
02 0129 FF6 Electric Bass
03 0489 FF6 Pan Flute
04 0554 FF6 Sitar
05 0663 FF6 Cello
06 0573 FF6 Choir
07 0123 FF6 Flute
08 0237 FF6 Clarinet
09 0379 FF6 Unusual Synth (Atma)
0A 0169 FF6 Oboe
0B 0116 FF6 Rock Organ
0C 0785 FF6 Piano
0D 1046 FF6 Strings
0E 0120 FF6 Trumpet
0F 0081 FF6 Hi Hat Closed
10 0900 FF6 Shadow's picked string
11 0537 FF6 Hi Hat Open
12 0477 FF6 Crash Cymbal
13 0375 FF6 Breath (like Narshe)
14 0250 FF6 Snare
15 0212 FF6 Snapping fingers
16 0400 FF6 Timpani
17 0750 FF6 Conga Drum
18 0197 FF6 Floor Bass
19 0178 FF6 Picked String
1A 0262 FF6 Trombone
1B 0106 FF6 Harp
1C 0146 FF6 Bass Guitar
1D 0108 FF6 Picked String?
1E 0444 FF6 Distortion Guitar
1F 0139 FF6 Ocarina
20 0350 FF6 Marimba
21 0500 FF6 Snare (hard hit)
22 0137 FF6 Kick
23 0050 FF6 Cow Bell
24 0605 FF6 Tubular Bell
25 0389 FF6 Church Organ
26 0192 FF6 Woot
27 0359 FF6 Synth
28 0313 FF6 More Synth
29 0222 FF6 Even More Synth
2A 0098 FF6 Snapping Fingers
2B 0081 FF6 ?? Synth
2C 0492 FF6 Contrabass
2D 0412 FF6 Maracas
2E 0334 FF6 Conga Drum
2F 0243 FF6 Shaker
30 0281 FF6 Wood Block
31 0485 FF6 Bright Piano
32 0373 FF6 Acoustic Guitar
33 0351 FF6 Bagpipe
34 0367 FF6 Pan Flute
35 0292 FF6 Violin
36 0143 FF6 Bottle Blow
37 0625 FF6 Tambourine
38 0414 FF6 Male Voice
39 0496 FF6 Low Male Voice
3A 0344 FF6 Female Voice
3B 0299 FF6 Pipe Organ
3C 0460 FF6 Metal Bang
3D 0450 FF6 Metal Clank
3E 0195 FF6 Xylophone
3F 0717 FF6 Crowd Noise
  Find
Quote  
[-] The following 1 user says Thank You to madsiur for this post:
  • SSJ Rick (06-30-2015)

#2
Posts: 1,633
Threads: 56
Thanks Received: 13
Thanks Given: 84
Joined: Apr 2014
Reputation: 12
Status
Atma
I didn't remember string were the heaviest, oh well...
Just saying, are the special instruments counted for the block limit?

With special instruments i mean those:
@0x00 = a 'buzzing-bee' kind of synth.
@0x01 = a weird futuristic sounding brass.
@0x02 = a less shrill version of 0x01.
@0x03 = a lower octave sci-fi sound.
@0x04 = a static percussion sound.
@0x05 = a sawtooth synth. I like this one the best.
@0x06 = a higher octave slightly more funky sawtooth.
@0x07 = soft static. (Zozo's rain sound)
@0x08 = sounds like a saxophone on crack.

Thinking to that better i don't even know their size...


THE GREATEST CHALLENGE OF ALL TIMES AWAITS:
http://www.ff6hacking.com/forums/showthr...p?tid=2593
DO YOU HAVE WHAT IT TAKES TO SLAY A GOD?
------------------------------------------------------------------------
Tenkarider's project #2 is started: FF6 Curse of the Madsiur Joke (CotMJ)
http://www.ff6hacking.com/forums/showthr...p?tid=2755
What happens when Madsiur tweaks your account? This full game hack will show that!
  Find
Quote  

#3
Posts: 2,548
Threads: 98
Thanks Received: 147
Thanks Given: 156
Joined: Aug 2009
Reputation: 52
Status
Nattak\'d
No those are FF6's waveform generated samples, they don't take up any instrument block space because they only exist in the song data, not in the instrument data. Meaning they don't need to be set as an instrument like the other real instruments, just placed directly in the song data.


We are born, live, die and then do the same thing over again.
Quote  

#4
Posts: 3,966
Threads: 279
Thanks Received: 234
Thanks Given: 56
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
(06-28-2015, 07:46 PM)Tenkarider Wrote: No those are FF6's waveform generated samples, they don't take up any instrument block space because they only exist in the song data, not in the instrument data.

I would have thought they take some place in the SPC-700 RAM... They probably do, but maybe not in the memory reserved to brr samples...

Have you tested this?
  Find
Quote  

#5
Posts: 2,548
Threads: 98
Thanks Received: 147
Thanks Given: 156
Joined: Aug 2009
Reputation: 52
Status
Nattak\'d
Test them how? You mean like see if using them can produce glitches in songs, like having it up to the max of 3700 and then adding them into the song data as well?

But no I haven't, all I know is they are more or less basically built into the sound engine and aren't set in the 32 byte instrument data like the other instruments so I doubt they would take any memory from the RAM used for the instruments, to be a cause for the glichiness, but I'm not positive.


We are born, live, die and then do the same thing over again.
Quote  

#6
Posts: 3,966
Threads: 279
Thanks Received: 234
Thanks Given: 56
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
(06-28-2015, 09:17 PM)Gi Nattak Wrote: Test them how? You mean like see if using them can produce glitches in songs, like having it up to the max of 3700 and then adding them into the song data as well?

Yes.

(06-28-2015, 09:17 PM)Gi Nattak Wrote: But no I haven't, all I know is they are more or less basically built into the sound engine.

I'm pretty sure they are taken from somewhere in the ROM and aren't build in the SPC-700 or DSP but I'm not sure where they come from...
  Find
Quote  

#7
Posts: 1,633
Threads: 56
Thanks Received: 13
Thanks Given: 84
Joined: Apr 2014
Reputation: 12
Status
Atma
In the case they really don't take space... anyone knows how to store new instruments in that zone? since the normal instruments start from 0x20, then shouldn't that mean that there are empty slots from 0x09 to 0x19(or it was 0x1F) ?
When i tested "empty slots" no sound came out from them, so i guess they are usable slots indeed...


THE GREATEST CHALLENGE OF ALL TIMES AWAITS:
http://www.ff6hacking.com/forums/showthr...p?tid=2593
DO YOU HAVE WHAT IT TAKES TO SLAY A GOD?
------------------------------------------------------------------------
Tenkarider's project #2 is started: FF6 Curse of the Madsiur Joke (CotMJ)
http://www.ff6hacking.com/forums/showthr...p?tid=2755
What happens when Madsiur tweaks your account? This full game hack will show that!
  Find
Quote  

#8
Posts: 110
Threads: 4
Thanks Received: 4
Thanks Given: 1
Joined: Jan 2012
Reputation: 4
Status
None
So basically the instrument patch has to be scrapped for any kind of emulation accuracy, unless a workaround can be found to load two or more instrument banks separately on an as-needed basis (which would be pretty complex).
  Find
Quote  

#9
Posts: 3,966
Threads: 279
Thanks Received: 234
Thanks Given: 56
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
(06-29-2015, 11:12 AM)dn Wrote: So basically the instrument patch has to be scrapped for any kind of emulation accuracy, unless a workaround can be found to load two or more instrument banks separately on an as-needed basis (which would be pretty complex).

No. I did not expressed myself clearly. That limit is for each song (I edited the first post). In fact having the RS3 instruments can help in a lot of songs, since they generally take less place than their FF6 counterparts.

(06-29-2015, 02:49 AM)Tenkarider Wrote: In the case they really don't take space...

I think this is a fast assumption, the only way to really know is to test it.
  Find
Quote  

#10
Posts: 2,548
Threads: 98
Thanks Received: 147
Thanks Given: 156
Joined: Aug 2009
Reputation: 52
Status
Nattak\'d
After getting a song's (Dancing Mad) instrument block usage right to 3700 and then adding in a ton of waveform generated ones into the song data, the glitch did not happen. They might take up space I suppose, but I think it's a matter of them (brr) having to be in the instrument 32 byte data where it can overflow, and since they are not, no glitch.


We are born, live, die and then do the same thing over again.
Quote  
[-] The following 1 user says Thank You to Gi Nattak for this post:
  • madsiur (06-29-2015)



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite