• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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

3,830
Posts
14
Years
    • Age 27
    • OH
    • Seen Feb 26, 2024
    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.
     
    3,830
    Posts
    14
    Years
    • Age 27
    • OH
    • Seen Feb 26, 2024
    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.
    oe41Wud.png

    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.
     
    3,830
    Posts
    14
    Years
    • Age 27
    • OH
    • Seen Feb 26, 2024
    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:
    4
    Posts
    6
    Years
    • Seen Nov 30, 2023
    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