I guess I didn't really mean to say that I wanted to drop a tune in from Famitracker. I understand the need for this to be completely rewritten for your music engine. I was looking more for a creative source from which to replicate, or if there was something already being considered for this purpose that may even have had some Namcot sound samples implemented. There is a lot of Final Fantasy music out there that I can probably draw off from though, even if it is not from a tracker.
I have poked at your ROM file a little bit. I am at the "Hello World" point right now... (I have to start somewhere right?) I wanted to play a single note first. Then I could tweak things to make that note sound different, and try all of the different cool features of your music engine. I have not been able to get that first note yet unfortunately.
Here is what I tried:
First thing's first, I looked at the channel pointer tables for each song (0x3E010 - 0x3E40F). I notice that these are all 0x0000, which is the special value to disable the channel. For this 1-note test, I wanted to use only pulse channel 0, so for song #0's pointer table, I inserted this data at 0x3E010:
0000 0000 0000 0000 0100 0000 0000 0000
This means:
- Disable all channels except for pulse channel 0.
- Because Namcot channel 0 is disabled, paging will be on the page containing the beginning of song data space (0x3E410).
- Start Pulse channel 0 data at offset 0x0001, which equals 0x3E411.
I wanted this to be for the song that plays immediately when you start the game ("Final Fantasy Prelude"), which I'm betting is song #0, but instead of making this assumption, I copied the pointer table over all tables in the entire range 0x3E010 - 0x3E40F. So, all songs should point to the same spot.
Then I went down to offset 0x3E411 and inserted the value 0x60. Tried the game, no note played.
Then I went back to offset 0x3E411 and tried a few things and ended up with this:
F9 00 FA 87 00 FB 82 08 F6 60 60 B0
Which breaks down to:
- F9 00: Set tempo to tempo table ID 0, which comes already populated at 0x3DE10 as:
-- 1E 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09
- FA 87 00: Following example, sets envelope to fixed volume 7, speed unused.
- FB 82 08: Set Pulse channel to 50% duty cycle, with a speed of 0x08
- F6: Set to octave 6 (had tried other values, this is where I ended up.)
- 60: Play F# with length 1E (ID 0 in selected tempo table)
- 60: Play F# again, same length
- B0: Play B, same length
Would you help me figure out why the 3 notes did not play at the end?