Jump to content

Audioseq and Code Notes (Debug)


Airikita
 Share

Recommended Posts

Audioseq pointers in Debug:

 

$00BCC6B0

 

00000000 00006A90 02020000 00000000

00006A90 00001040  02020000 00000000

00007AD0 00002500 02020000 00000000

00009FD0 00000AB0 02020000 00000000

0000AA80 00000890 02020000 00000000

0000B310 00000980 02020000 00000000

0000BC90 00000B80 02020000 00000000

0000C810 000007A0 02020000 00000000

0000CFB0 000005C0 02020000 00000000

0000D570 00000730 02020000 00000000

0000DCA0 000006A0 02020000 00000000

0000E340 00000740 02020000 00000000

0000EA80 00000900 02020000 00000000

0000F380 000006F0 02020000 00000000

0000FA70 00000820 02020000 00000000

00010290 000006B0 02020000 00000000

00010940 000007C0 02020000 00000000

etc...

 

 

Format:

 

aaaaaaaa bbbbbbbb xxxxxxxx ????????

 

aaaaaaaa = start of sequence offset in Audioseq file (starts with D3)

 

bbbbbbbb = sequence length

 

xxxxxxxx = unknown? Sometimes is 02010000, usually 02020000

 

 

 

The table in RAM will be converted to this:

 

Posted Image

 

 

 

UPDATE:

 

Other actions:

 

- Breakpoint set at $80099174 - JAL 0x800FA00C  (set_bgm)

- address 80155500 stored at $801719B0 beforehand

Link to comment
Share on other sites

If you're working in RAM, consider referencing the console debug output that the ROM spits out with a customized build of mupen64plus. Printing the return address along with the debug text gives a rough idea where specific functions are. Search "bgm" on this page.

Link to comment
Share on other sites

 

Format:

 

aaaaaaaa bbbbbbbb xxxxxxxx ????????

 

aaaaaaaa = start of sequence offset in Audioseq file (starts with D3)

 

bbbbbbbb = possibly sequence length?

 

xxxxxxxx = unknown? Sometimes is 02010000, usually 02020000

 

...

 

EDIT:

Music values do not appear to match up with offset list.

 

 

b is sequence length, yes.

x appears more like 02yy0000, y is 02 normally and 01 for sequences not used as actual bgm  ex. warp songs (I think).

? is just 0, probably not used.

 

In RAM the sequence addresses are translated to their ROM addresses.

Link to comment
Share on other sites

The first x is 02000000, might be instrument sets? It is length 6A90, which is the longest sequence, and seems unrelated to the others. Unless it is the larger chunk of Hyrule Field that is listed in the music value list.

 

http://wiki.spinout182.com/w/Zelda_64:_OoT_Music_Values

 

There are 21 lines of "Overworld" music sequences in the first 23 lines, which seems like an awfully long list, unless those values are incorrect values, and the set_bgm redirects to Hyrule Field music when used?

 

This would make the title screen theme the 7th sequence, after the first offset, in the list if this is the case.

 

 

EDIT: I calculated 108 different sequences in the Music Values list, currently confirming if it matches the list in ROM..........

 

Seems to me the list in ROM actually lists 110 sequences, which isn't too odd, but still a bit odd since the two at the start are "Nothing.."

 

 

 

 

EDIT 2: Successful music change made, the music values do line up with the offsets. This means you can add music to Audioseq and change the offset of the music of your choice!

 

Also, 00000028 00000000 02020000 00000000 seems to match up with "Fairy Fountain", this might be incorrect, and the list probably shifts after this point.

Link to comment
Share on other sites

The first two aren't actual sequences, they are used for sound effects or something. Hyrule Field is made of many smaller sequences which play depending on what's going on, sequences 3 to 17 (hexadecimal) are the parts it uses and 2 is the sequence number actually used by the game (I don't think anyone ever found out how it works).

Link to comment
Share on other sites

  • 2 weeks later...

Adding music of any length:

 

This should be a simple explanation... you create your new music sequence with deathbasket's InstEd, and place the song itself (not the Audioseq file) in a new location on it's own.

 

I picked F62A00 (as an example) because I had free space there, and the song was 1F46 in length. It was for the boss music 1B, but the song was too big, and I wasn't going to replace any other music.

 

It also wasn't working when I changed the address of the altered Audioseq file to a new location I put it in, as the dma file still loads it from 0x44DF0 for some reason...

 

So, if you subtract 44DF0 from the new address, you will get your new offset to the sequence.

 

So, I do this: F62A00 - 44DF0 = F1DC10, and get my new offset for the list of audioseq offsets.

 

So I enter 00F1DC10 00001F46 to the offset where the boss music is used.... $1B0 away from 0xBCC6B0. By doing so, the new music will work. You can likely create some elaborate sequences with this and create sequences of any length. But still use caution when making sequences, and aim for the smallest size possible.

  • Like 1
Link to comment
Share on other sites

  • 7 months later...

Recently I reviewed a particular sequence, 57 - Fairy's Fountain. In the list of pointers, this music sequence does NOT use a pointer:

00000028 00000000 02020000 00000000

 

Instead it apparently uses the value 28, which is also Fairy's Fountain... I am unsure of how this works, but does anyone have insight into why sequence 57 uses the value 28 instead of the address?

 

I assume it uses it as a literal sequence value because it has a size of 00000000, perhaps checking the size to use it differently?

Link to comment
Share on other sites

This is an interesting one. At first I thought maybe it had something to do with the harp intro since the file select screen doesn't play the harp intro but going into a fairy fountain does, however, listening to the tracks, they're both completely identical. The reason I was thinking this is I've replaced 02 with Termina Field. Listening to 02, there's no morning theme to it. However, listening to 31, there's the morning theme and funny enough...it starts playing Hyrule Field as if I never replaced it. But the game definitely plays Termina Field's music. So it's probably not the answer you're looking for but maybe it can start you off in some direction.

Link to comment
Share on other sites

The tracks are the same, the sequences are the same, however because 57 is a different value, it includes a different instrument. They will sound slightly different because of different instrument sets. However, I don't know why it does not just use the same pointer as 28's Fairy Fountain.

 

Refer to my video of Ganondorf playing the Hyrule Castle theme... all I did was swap the pointer with the one for the Hyrule Castle theme, but I did not change Ganondorf's organ instrument set. So Ganondorf could have probably just used the value to the castle theme instead of the actual address according to that theory.

Link to comment
Share on other sites

I played around with this and made Ganondorf's organ play the mini game theme.

 

Then I made all 5 temples and the Ice Cavern play Ganondorf's music.

 

I realized strange things: Sometimes the music in the Shadow Temple was a bit different, as if the instruments would play Ganondorf's theme slightly different.

 

Most curious: When I enter the Ice Cavern as first location after opening the ROM, the music will stop after some seconds (as if there were missing instruments), and the ROM will FREEZE after one minute. When I first enter another location and then the Ice Cavern, the music will begin slightly different but then stop and the ROM will freeze.

When I first enter another Temple which uses Ganondorf's music and then the Ice Cavern, the track plays completely and the ROM doesn't freeze.

 

How could you explain that?

Link to comment
Share on other sites

The instrument sets are different, so you can't always just "switch" themes, you need to match the instrument set to hear the full sequence. I remember importing music and making that mistake.

 

My guess is the freezing is a result of the sequence using a track that doesn't exist in the current instrument set from the theme you swapped it with.

Link to comment
Share on other sites

I highly doubt that explains the freezing. I have used songs without assigning certain tracks instruments at all leaving them blank because I figured they sounded better without those particular tracks being used in the song even though the data for those tracks were still present when I ported the song in.

Link to comment
Share on other sites

I can't say what exactly is the problem. You should just try to change the music value in the maps scene headers it follows a certain format and shouldn't be too difficult to find

 

We have another good collection of different notes here you can look through, and you'll find this post and others below useful for what type of things you are trying to edit.

 

https://www.the-gcn.com/topic/2471-the-beginners-guide-to-music-antiqua-teasers/?p=40632

 

So, say you want to change the song in the Ice Cavern to the one of Ganon's songs. You just look up the music value that you want, and replace it with another in the scene header. You can find the offsets for scene headers here

 

http://wiki.spinout182.com/w/Zelda_64_Scene_Listings:_Debug_ROM

 

 http://wiki.spinout182.com/w/Zelda_64:_OoT_Music_Values

 

You will see the music value 58 at the address 25CC00F

 

Finding music values for bosses, and changing them will be a little different. I will look up what I can, and edit this post/

Link to comment
Share on other sites

Thank you, I know about scene headers.

But here I was changing pointers in the audioseq table (as explained by Airikita in the first post), so I didn't simply change the music value in the scene header, but rather made Ice Cavern, Forest Temple, Fire Temple, Water Temple, Shadow Temple and Spirit Temple use their original instrument set but with Ganondorf's theme.

 

I don't want to accomplish anything, but I rather wonder why the track is playing so randomly each time I enter the location and I would like to figure out why. I mean, the music should always be the same, but here, it is slightly different each time I enter Ice Cavern. It's like it would be acting randomly.

Link to comment
Share on other sites

Music is an anomaly... I have not found one in the list that crashed like you said, but it's interesting you mentioned that. Things will happen for unexpected reasons. I'm sure there's an explanation, but I can't say for sure. To me it sounds like you changed something in the sequence itself, not saying you did though.

Link to comment
Share on other sites

If I knew any possibility to give you the patch (maybe it is possible to upload things here on the GCN?), you could see - or hear - what exactly I mean.

But even then, it would probably be acting differently for you than for me.

 

(For notice, I didn't change anything in the sequence itself; I only changed all temples' music pointers to the offset of Ganondorf's theme, like you did with Ganondorf's new tune.)

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.