øAslickproductions.org/forum/index.php?PHPSESSID=so1iojs5ocdn0o2vf0tti7fbu6&topic=163.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index565c.htmlslickproductions.org/forum/index.php?PHPSESSID=so1iojs5ocdn0o2vf0tti7fbu6&board=14.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index565c.html.zxÛôg^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿȰUôOKtext/htmlISO-8859-1gzip8:ÖôÿÿÿÿÿÿÿÿTue, 10 Mar 2020 20:29:38 GMT0ó°° ®0®P®€§²ð®Úôg^ÿÿÿÿÿÿÿÿ¦(ô FF4 SPC Core info

Author Topic: FF4 SPC Core info  (Read 10604 times)

JCE3000GT

  • Master of FF4
  • *
  • Posts: 1,429
  • Gender: Male
  • Vladof
    • View Profile
    • BlitzKrieg Innovations
FF4 SPC Core info
« on: December 18, 2007, 05:02:25 PM »
SPC Instrument Index (without header) - 2400F
BRR Samples (without header) - 2498A


SPC Song sequences (offsets with header):

3770E-      Nothing [00]
37727-      Final Fantasy [01]
37AE8-      Wishing Tower    [02]
37BE6-      Fanfare (Dummy) [03]
37D0F-      Yellow Chocobo [04]
3804A-      Black Chocobo [05]
3830C-      Underworld [06]
38871-      Zeromus [07]
393E4-      Victory Fanfare [08]
3963C-      Town [09]
39837-      Rydia [0A]
39C1C-      Boss Music [0B]
3A435-      Mt. Ordeals [0C]
3A7D0-      Overworld [0D]
3ABDB-      Big Whale [0E]
3B092-      Sad Music [0F]

3B1FA-      Tent/Cabin [10]
3B2BC-      Golbez [11]
3B5A3-      Sorrow [12]
3B785-      Rosa [13]
3BAF5-      Baron Castle [14]
3BDAF-      The Prelude [15]
3C361-      Suspicions [16]
3C503-      Tower of Zot [17]
3C8CE-      Airship [18]
3CC15-      Tower of Bab-il [19]
3CFA3-      Fight 2 [1A]
3D463-      Within the Giant [1B]
3D8AD-      Cave of Summoned Monsters [1C]
3DAEA-      Destruction [1D]
3DD10-      Lunar Path [1E]
3DF4D-      Surprise! [1F]

3E043-      Dwarf Castle [20]
3E255-      Palom/Porom [21]
3E508-      Calcobrena [22]
3E6A7-      Hurry! [23]
3E8F7-      Cid [24]
3EC78-      Into the Darkness [25]
3F13A-      Dancing Music [26]
3F411-      Fight 1 [27]
3F8D4-      Castle Eblan [28]
3FAE4-      Character Joined! [29]
3FBFF-      Character Died [2A]
3FCE3-      Chocobo Forest [2B]
3FDC7-      Opening [2C]
40139-      Sad 2 [2D]
40227-      Castle Fabul [2E]
40435-      Fanfare (Became a Paladin) [2F]

40666-      Lard Ass Chocobo [30]
407A2-      Moon's Surface [31]
40A84-      Toroia [32]
40E4C-      Mysidia [33]
41163-      Lunar Subterrane [34]
41462-      Ending Part 1 [35]
41F76-      Ending Part 2 [36]
42E5C-      Ending Part 3 [37]


SPC Song Sequence info:
Header:
01-02 = Length of sequence
03-18 = Channel pointer

Commands:
D2 xx yy zz   Fade in tempo, the higher the xx yy the slower the song, zz is the rate in which it fades in

DA xx      set octave to xx
DB xx      change instrument to xx
DC xx      Set transpose
DD xx      Increment transpose
DE xx      change volume of current instrument to xx
DF      
E0 xx      Length of the next following note(s) is xx?      
E1      
E2   

EA      

F0      Repeat last measure?
   
F2 xx yy   
F3 xx yy   

==========================================================

Samples:

01   Strings
02   Harp?
03   Grand Piano
04   Harp
05   Pipe Organ
06   Trumpet
07   Flute
08   Xylophone
09   Bass Guitar
0A   Timpani
0B   Electric Piano
0C   Snare Drum
0D   Kick Drum
0E   Snare Drum (hard)
0F   Conga Drum
10   Cymbals (loop)
11   Hihat
12   Cowbell
13   Shaker
14   Whistle
15   Conga Drum
16   Chocobo


« Last Edit: June 26, 2008, 09:51:22 PM by JCE3000GT »

JCE3000GT

  • Master of FF4
  • *
  • Posts: 1,429
  • Gender: Male
  • Vladof
    • View Profile
    • BlitzKrieg Innovations
Re: SPC Core info
« Reply #1 on: December 22, 2007, 01:45:10 PM »
Added samples.  Now its time for me to add FF4 to my SPC Index Editor program.  :omghax:

Gemini

  • FF4 Hacker
  • *
  • Posts: 31
  • Gender: Male
  • Broom broom
    • View Profile
Re: SPC Core info
« Reply #2 on: January 09, 2008, 08:54:01 AM »
:omg:
What an incredible amount of information for the songs! I've been looking for those for a long time, and finally somebody picked the task and located all the midi data. :D Great job dude. Now I can probably force my FF4 Psx not to use streaming for all the tracks.
:hmm:

JCE3000GT

  • Master of FF4
  • *
  • Posts: 1,429
  • Gender: Male
  • Vladof
    • View Profile
    • BlitzKrieg Innovations
Re: SPC Core info
« Reply #3 on: January 09, 2008, 05:29:01 PM »
:omg:
What an incredible amount of information for the songs! I've been looking for those for a long time, and finally somebody picked the task and located all the midi data. :D Great job dude. Now I can probably force my FF4 Psx not to use streaming for all the tracks.
:hmm:

 :laugh:  No problem man, if you'll notice I've documented other games as well.  And does this mean I get some sort of credit for your project.  yay me likes credits.

* JCE3000GT wishes for an MQ port.   :cycle:

Gemini

  • FF4 Hacker
  • *
  • Posts: 31
  • Gender: Male
  • Broom broom
    • View Profile
Re: SPC Core info
« Reply #4 on: January 09, 2008, 06:18:33 PM »
No problem man, if you'll notice I've documented other games as well. And does this mean I get some sort of credit for your project.  yay me likes credits.
Speaking of which, I still need to look into SPU code. pSX Author mentioned SPC code can converted into C and recycled on the Playstation to obtain an accurate reproduction of the original sound engine, but I really don't have a clue on how that works (nor the SPU or the SPC >_>). If you could help me on that matter, you would be considered part of the staff, not just a small name in the SPECIAL THANKS list.
 :wink:

Deathlike2

  • FF4 R&D Master
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: SPC Core info
« Reply #5 on: January 09, 2008, 06:25:54 PM »
IIRC, pSXAuthor has mentioned before that the sound hardware on the PS is a better version of the SPC found on the SNES. In theory, you should be able to do almost the same stuff on the SNES's SPC just as you would on the PS. Sony is responsible for creating the SPC core on the SNES, and the PS one is effectively SPC++ IMO.
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

JCE3000GT

  • Master of FF4
  • *
  • Posts: 1,429
  • Gender: Male
  • Vladof
    • View Profile
    • BlitzKrieg Innovations
Re: SPC Core info
« Reply #6 on: January 09, 2008, 06:45:27 PM »
IIRC, pSXAuthor has mentioned before that the sound hardware on the PS is a better version of the SPC found on the SNES. In theory, you should be able to do almost the same stuff on the SNES's SPC just as you would on the PS. Sony is responsible for creating the SPC core on the SNES, and the PS one is effectively SPC++ IMO.

So, I wonder if you could just simply copy over the core from FF4 and have the PSX just load it into its APU memory?  I'm not a programmer so I don't really know what I'm talking about in that sense.

Gemini

  • FF4 Hacker
  • *
  • Posts: 31
  • Gender: Male
  • Broom broom
    • View Profile
Re: SPC Core info
« Reply #7 on: January 09, 2008, 09:57:12 PM »
The SPU can't understand SPC code, so a direct binary copy wouldn't work.

JCE3000GT

  • Master of FF4
  • *
  • Posts: 1,429
  • Gender: Male
  • Vladof
    • View Profile
    • BlitzKrieg Innovations
Re: SPC Core info
« Reply #8 on: June 25, 2008, 07:54:42 PM »
*nump*

Move to SPC Hard Core?

Vehek

  • Siren
  • *
  • Posts: 75
    • View Profile
Re: SPC Core info
« Reply #9 on: June 26, 2008, 12:14:08 AM »
You know, that site I posted in your FFV SPC core thread has information on FF4's SPC core too.
It labels F2 and F3 as having 3 parameters. If I'm understanding Google's translation correctly, F2 is related to volume and F3 is relate to Pan. Any way to check if that's right?

JCE3000GT

  • Master of FF4
  • *
  • Posts: 1,429
  • Gender: Male
  • Vladof
    • View Profile
    • BlitzKrieg Innovations
Re: SPC Core info
« Reply #10 on: June 26, 2008, 08:41:04 PM »
You know, that site I posted in your FFV SPC core thread has information on FF4's SPC core too.
It labels F2 and F3 as having 3 parameters. If I'm understanding Google's translation correctly, F2 is related to volume and F3 is relate to Pan. Any way to check if that's right?

Open up the rom, edit a song, dump the spc.   :omghax:

Vehek

  • Siren
  • *
  • Posts: 75
    • View Profile
Re: FF4 SPC Core info
« Reply #11 on: June 26, 2008, 09:40:11 PM »
I did some quick tests and it looks like they are related to volume and pan.

JCE3000GT

  • Master of FF4
  • *
  • Posts: 1,429
  • Gender: Male
  • Vladof
    • View Profile
    • BlitzKrieg Innovations
Re: FF4 SPC Core info
« Reply #12 on: September 01, 2009, 01:08:32 PM »
Anyone want to help me decipher more of this core?  I really want to attempt an import to anther S-SPC core. 

Vehek

  • Siren
  • *
  • Posts: 75
    • View Profile
Re: FF4 SPC Core info
« Reply #13 on: September 03, 2009, 09:25:13 PM »
I'm not good at recognizing what the commands actually do, but I can confirm that the number of parameters listed on the Japanese page are correct. (This SPC core and some others have a parameter # table.)
Here are some of the ones you didn't list or got wrong parameter-wise.
Quote
D3 - 3 params - (It doesn't actually do anything.)
DF - 1 param
F2 - 3 params
F3 - 3 params
F4 - 2 params - GoTo command
F5 - 3 params
Pretty much all the rest have no parameters.

E0 and F0 are the loop start/end commands.

C3-D1 of the note data is supposed to be a tie, but I can't seem to verify it by testing yet. (B4-C2 are rests)

I've attached an incomplete tool for converting a dumped FF4 SPC into a MML.
« Last Edit: September 03, 2009, 09:31:56 PM by Vehek »

Vehek

  • Siren
  • *
  • Posts: 75
    • View Profile
Re: FF4 SPC Core info
« Reply #14 on: March 20, 2010, 09:09:00 PM »
While doing some experiments recently, I looked at the Japanese wiki page and realized that the note lengths are in a slightly different order in FF4 than the later cores.
Note Lengths:1/1, 3/4, 1/2, 3/8, 1/3, 1/4, 3/16, 1/6, 1/8, 1/12, 1/16, 1/24, 1/32, 1/48, 1/64
My dumper from before had the "3/8" and "1/3" switched, and also had "3/16" and "1/6" switched because it assumed the note lengths were in the same order as FFV (and the one used in FF6/CT/etc if you ignore the extra note length.)


Also, some (nonheadered)  offsets:
3721D - SPC pointers
24942 - BRR pointers
Both, however, are not standard Lorom addresses. It adjusts the pointer based on the upper 16-bits.
Code: [Select]
$04/8651 A5 21       LDA $21    [$00:1E21]
$04/8653 C9 40 00    CMP #$0040
$04/8656 B0 05       BCS $05    [$865D]
$04/8658 69 C0 04    ADC #$04C0
$04/865B 80 22       BRA $22    [$867F]
$04/865D C9 C0 00    CMP #$00C0
$04/8660 B0 05       BCS $05    [$8667]
$04/8662 69 40 05    ADC #$0540
$04/8665 80 18       BRA $18    [$867F]
$04/8667 C9 40 01    CMP #$0140
$04/866A B0 05       BCS $05    [$8671]
$04/866C 69 C0 05    ADC #$05C0
$04/866F 80 0E       BRA $0E    [$867F]
$04/8671 C9 C0 01    CMP #$01C0
$04/8674 B0 05       BCS $05    [$867B]
$04/8676 69 40 06    ADC #$0640
$04/8679 80 04       BRA $04    [$867F]
$04/867B 18          CLC
$04/867C 69 C0 06    ADC #$06C0
$04/867F 85 21       STA $21    [$00:1E21]