• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Research: Shin'en GAX Sound Engine

AtecainCorp.

Rejishan awake...
  • 1,377
    Posts
    16
    Years
    Ok. Nice. But One Issue... When you inster GAX sound Engine how you think to change Music in Hacks? Since Sappy do not Support GAX.
     
    So I got my hands on a plugin to convert from (To me) almost unreadable assembly and put it into something a bit more understandable to me C (I know C#, so it's kinda similar, although not really). I've been able to find out that gax2_init requires only two variables, and according to the IDA C disassembler, gax2_init takes two parameters when being called. One must be the pointer, but the other, I'm not sure. I'm going to have to debug the routine and check the registers to see what it uses.

    If you'd be willing to send me a copy of the assembly, I'd like to take a look at it and see what I can figure out.
     
    So, I'm working on perhaps programmatically detecting the gax_init subroutine, and I've found something in particular with the init routine that 4 games that use the engine.
    [PokeCommunity.com] Shin'en GAX Sound Engine

    Assume that there is an array of 0xF bytes with some bytes from the rom in int[] bytesRead.
    Code:
    if(bytesRead[0] == 0xF0 && bytesRead[1] == 0xB5 && bytesRead[3] == bytesRead[5])
    	return position;

    I might actually try coding this into an application, and see if I can actually get it to return not only the position of the gax_init function, but perhaps programmatically return the offset to the sound table and make it read the audio.

    So my suggestion would be to find the code that loads from a game's song table, and try to find similar functions in other games. Assuming it's all standard code, the only differences would be pointers.

    Also, I've got a function written up that finds the M4A song table already, so if you can find the needed code to search for this I can give it a try.
     
    Okay, so I was looking at the "sample table" that you reference, and here's what I've got.

    It is (obviously) a list of pointers, 109 entries long (0x1B4 bytes).
    Each entry (that I've bothered looking at) points to a 16 byte structure, all of which end in another pointer.

    The data these pointers go to seem to be a second data structure, of variable length.
    EDIT: If this second structure starts with 01 FF FF FF (-255?) it seems to be 20 bytes in length.

    Based on what I know of I know of the samples that are used normally within M4A games, these do not appear to be samples at all. :(

    If they are samples of some kind, maybe they are instrument behavior definitions?
     
    Last edited:
    Well i seem to be very late to this, and as a total rookie i can't really make heads or tails of what i am supposed to do to extract the samples, track data, etc. in order to make a gsf file of any kind... Im trying to work with the three Tony Hawk's Pro Skater games that Shin'en did music for on the GBA, if that helps... I can do about as much as opening them in a hex editor, then i'm totally lost after that.
     
    Back
    Top