News:

The forum has been updated to SMF (2.1.3)!
Please be patient as we work to polish up the place and update features as we can.

Main Menu

One-off Question Topic

Started by Charon, 04, March, 2009, 06:56:00 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Charon

Well, we need one of these anyhow, and I didn't want to make a new topic for every problem I come across. (pin?)

BAH.

Atrius, one-off question. What kind of file do I have to save my .wav as (like, which Hz frequency, 8 or 16 bit, mono/stereo) to import sounds with, and how many bytes at the begining should I cut off from the wav file to make it work?

I know how to add the bytes at the begining of the .wav in the rom to make it play the right frequencies and length ect., but I really want to know how to import these. If I know, I could import the drum set/synth instruments from TLA from trimmed recordings.

EDIT: Please note that this is for hacking, nothing else. You can ask other kinds of questions in the Feedback section.

Atrius (He/Him)

Well... The GBA uses signed 8 bit mono audio, but you can only save WAV files as unsigned 8 bit, so they don't quite sound right after importing them unless you can convert it first.  As for frequency, theoretically any should work as long as you set the right value in the header for the data after you copy it over, but practically I don't think I'd go above 22050 Hz.  (The GBA's direct sound channels can generate sound at about 16780 Hz max, having your audio sample's frequency higher than that can still help for lower notes though)

The location of the actual sound data in a WAV file typically starts at the 44th byte, but it can vary depending on if your audio program adds extra data to the header or not.  If you were to view it as text, you could find it by looking for the word "data", and skipping the 4 bytes after it (Although they're useful too, they specify the amount of data in bytes, which you'll need also)


You should be able to just copy the data for the drum sets over.  If you look at it, it's just like another set of instruments.
[sprite=220,4,0]I'm shaking my head in general disapproval of everything[/sprite]

Charon

Wha wha wha??

I spent all day yesterday and today looking for the snare! I couldn't find it! Do you know the offsets to the begining of the drum set data and the end of the drum set data? I could probably find it via trial error methods.

And a converter is where?...

Atrius (He/Him)

In the instrument table, the entry for the drum kit would have a pointer to it's instrument set in the same place a regular instrument would have a pointer to it's WAV sample.

The drum kit instrument set starts at 0x081C3B70.


I had to program my own converter...
[sprite=220,4,0]I'm shaking my head in general disapproval of everything[/sprite]

Charon

I was going through the individual wav files to see if I could find anything...

Atrius, it's still not working. Some of those pointers lead to the system created instruments, and I really don't want to rewire anything. I tried to use your download link from my Jupiter topic on GSR, but I keep on getting an error. Do you have a fixed link by any chance? Or is it just my computer being stupid again?

Atrius (He/Him)

I haven't released the converter yet.  If you're talking about my audio data ripping tool it's here now.  I'll try to polish up the converter so I can release it sometime soon.

EDIT:

Here you go, it'll automatically convert WAV files to 8-bit mono too if they aren't already, but It doesn't touch the sample rate.  It also automatically creates the bare essentials of the 16 extra bytes of data before the actual audio data that the GBA needs too.

If you're gonna record the instrument samples from the game playing it, it's good to know that a note with the value of 0x3C is played at the exact frequency the audio data is stored as.  This doesn't apply to drum kits where each note is actually a different instrument, and will be played at it's actual frequency regardless.

This post has been edited by Atrius on Mar 5 2009, 09:02 PM
[sprite=220,4,0]I'm shaking my head in general disapproval of everything[/sprite]

Charon

Thanks, Atrius, that will be extremely useful. I was getting worried that I'd have to transfer Song.gba's instruments *shudder*

Now that I've got that over with, I'm just gonna say that this topic is for anyone, not just the wonderful Charon, with one-off questions. SO ASK AWAY FIENDS!!

This topic was pinned for all members to use as a one question help thread. - Charon

Nicktallica

I feel extremely stupid asking this, but how do I go about finding some free space in Golden Sun:TLA?  :MercurySet:  

Charon

Quote from: Nicktallica on 12, May, 2009, 09:35:00 PMI feel extremely stupid asking this, but how do I go about finding some free space in Golden Sun:TLA?  :MercurySet:
There are some programs, known as "Free Space Finders", that can help you do that. Golden Sun's free space is filled with 0x00 bytes, so you could also go into a hex editor or tile viewer to search. Some pockets of free space are before 0x1C0000, and they're relatively small (ranging from about 6-40 KB) and the two big pockets are around 0x6322B4 (around 320 KB or so) and 0xF7964C (end-of-rom free space; about 550 KB).

Atrius said that Golden Sun: The Lost Age has a sufficient amount of free space (if I remember correctly, somewhere around 1-2 MB), but as I pointed out, it's scattered all over the place.

Rolina

That's a good question, I'd like to know this too.  It'd be nice to have an option to let us max out the GBA capable space for the file, and perhaps a little gauge to let us know how full it is with content.  I don't think such a thing exists in the editor at the moment (if it does, SWEET!), but it'd be nice to have in v0.3

Nicktallica

Thank you so much Charon. Now I can insert music easily without overwriting the game's memory!


Atrius (He/Him)

Once I get my hard drives hooked up I can give you an exact list of all the free space in the ROM.

Charon, if I remember correctly, at 0x08680000 there's a list of pointers.  There are blocks of space before the majority of the first several locations.
[sprite=220,4,0]I'm shaking my head in general disapproval of everything[/sprite]

Charon

Hey, Atrius.

NEW QUESTION.

How do you do simple 16 colour palatte rotation via ASM? I can load an ASM code via scripting, but I want to make a palatte rotation occur similar to that in the animation of certain Pokemon attacks like Magical Leaf or Psychic, or like Golden Sun's Mind Read background.

Salanewt

Oh yeah, I forgot about the colour rotating for Mind Read. I would also like to know how to do this, please?

Also, I was wondering. This is just a question, based out of curiosity, but is there any other way to raise the defense of a monster? The defense editor does not currently work, so this is why I ask this now.

Have a nice day.
:MercurySet:  
Oh yeah baby, £ me harder.

Fusion is just a cheap tactic to make weak Adepts stronger.

Yoshi's Lighthouse is a hacking website in progress. Why not check it out if you like Yoshi or the Mario & Luigi games?

Aile~♥

Can VisualBoy Advance cope with ROMs bigger than can fit in a GBA cartridge? Is there room in Golden Sun 2 for extra characters, Psynergies, musics, sprites, enemies, etc.?
[sprite=16, 6, 0]:P[/sprite]

Lloyd: Easy as pie.
Genis: Sweet!
Presea: ...Sweetie pie...
Zelos: Let's not start on this again...

[spoiler=epic mindscrew][/spoiler]

Salanewt

Oh... Is there any way that we can compress/decompress graphics into/out of Golden Sun without the editor (which is not quite at this stage yet)?

Have a nice day.
:MercurySet:  
Oh yeah baby, £ me harder.

Fusion is just a cheap tactic to make weak Adepts stronger.

Yoshi's Lighthouse is a hacking website in progress. Why not check it out if you like Yoshi or the Mario & Luigi games?

Charon

Quote from: JamietheFlameUser on 03, July, 2009, 08:54:00 PMCan VisualBoy Advance cope with ROMs bigger than can fit in a GBA cartridge? Is there room in Golden Sun 2 for extra characters, Psynergies, musics, sprites, enemies, etc.?
A rom can be expanded to 32 MB. Luckily, Golden Sun is 8 MB, and the Lost Age is 16 MB, so there's plenty of new space for all that fun stuff.

Salanewt

That is a good thing. From what you say, there is enough room in the Lost age to be able to duplicate the data and put it in the game. This would be pointless, but that means that much more can be added (as well as the places from the first game). I wonder how developed Golden Sun hacking will be by Christmas...

Oh yeah, I was wondering... If I want to insert a midi file, then do I have to use Anvil Studios?

Have a nice day.
:MercurySet:  
Oh yeah baby, £ me harder.

Fusion is just a cheap tactic to make weak Adepts stronger.

Yoshi's Lighthouse is a hacking website in progress. Why not check it out if you like Yoshi or the Mario & Luigi games?

Atrius (He/Him)

You can't really expand the amount of party member characters to be higher than 8 though, not without a lot of work.
[sprite=220,4,0]I'm shaking my head in general disapproval of everything[/sprite]

Charon

Whoever does do it though better release a patch >=D

@Salanewt - You can use any midi editing software, I just prefer Anvil.