Primary Zelda Hacking
April 21, 2014, 09:25:31 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: There is now an official Primary Zelda Hacking Press!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Oracles Music Format  (Read 612 times)
Lin
ZOLE Creator
Administrator
Hero Member
*****
Online Online

Posts: 580



View Profile
« on: July 13, 2011, 03:24:02 AM »

Well, I decided to dive into the wonderful world of music in Oracle of Ages, and I've been studying the format for a little bit, and here's what I have so far.

First off, music pointers (and I suppose sound) are stored at 0xE5748 and each music pointer gets 3 bytes. The first byte is the bank - 0x39, so whatever is there add to 0x39. The next 2 bytes are the actual pointer and point to the instrument headers. From there, there are 3 bytes per channel (4 channels), so 12 bytes total. I'm not sure what the first byte does, but the next 2 bytes point to the music data using the 0x39 + x as the bank. Here's what I know about the music header:

Anything under E0 is a note, following this format:
-Note pitch (Byte) Only seems to go up to 40
-Note length (Byte)

From E0-EF is an instrument effect that uses this format:
-First 3 bits of the Ex is the effect, although they seem to be a fade-in
-Effect length (byte)
For example, E0 will fade in to the next note and I guess last the length byte's length

From F0-FF is a special code that references different assembly. Here's my table so far:
F0 = ?
F1 = ?
F2 = ?
F3 = ?
F4 = ?
F5 = ?
F6 = Set instrument (Next byte), Set Volume (Next byte, although the right nybble controls volume. I don't know what the left does)
F7 = ?
F8 = ?
F9 = Set Vibrato (Next byte)
FA = ?
FB = ?
FC = ?
FD = ?
FE = ?
FF = End

I'll surely be updating this more, and when I've got it all figured out I'll make a tool that edits music and can export/import music from Seasons and vice-versa.

~Lin
Logged
Jigglysaint
Hacking Guru
Full Member
*****
Offline Offline

Posts: 150


View Profile
« Reply #1 on: July 13, 2011, 03:19:20 PM »

One of those pointer bytes is a relative bank pointer.  You can place data anywhere beyond that first bank, but nowhere before it.
Logged
Lin
ZOLE Creator
Administrator
Hero Member
*****
Online Online

Posts: 580



View Profile
« Reply #2 on: July 13, 2011, 10:54:46 PM »

I already knew that, and tried it for the first byte in the 4 pointers for the instruments, but they never led to the data, so it seems only the first byte is the relative bank pointer, which I pointed out in the topic.
Logged
Jigglysaint
Hacking Guru
Full Member
*****
Offline Offline

Posts: 150


View Profile
« Reply #3 on: July 14, 2011, 03:48:24 AM »

Well from what I tested, for the 4 channels, the first byte, if changed, seems to cause the music to "mix".  For example, if you changed the second channel of the overworld music from 01 to 00, you will hear one of the channels from the previous song in ram start playing during the song.  It seems all the channel pointers have the same pattern for the first byte.  00, 01, 04, and 06.
Logged
Lin
ZOLE Creator
Administrator
Hero Member
*****
Online Online

Posts: 580



View Profile
« Reply #4 on: July 14, 2011, 04:02:22 AM »

Yeah I noticed that. That's what confused me at first. I think the values might be hardcoded to be specific values that need to be written to some sort of registers, because if any of the values are wrong then music stays glitched until the game is restarted.
Logged
jerrythomas
Newcomer
*
Offline Offline

Posts: 1


View Profile
« Reply #5 on: December 22, 2011, 08:54:41 AM »

I have tried this but did not succeeded , if you have got positive results please do share.
Logged

Luigi1000
Newcomer
*
Offline Offline

Posts: 41



View Profile
« Reply #6 on: December 22, 2011, 01:54:04 PM »

Well this idea does proove to be intresting topic to go about as it can bring an intresting change to the hacks. Will try to get what info I can.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!