Skip to content

Add function signatures for GAX 2.02#31

Open
dakrk wants to merge 1 commit into
loveemu:mainfrom
dakrk:main
Open

Add function signatures for GAX 2.02#31
dakrk wants to merge 1 commit into
loveemu:mainfrom
dakrk:main

Conversation

@dakrk

@dakrk dakrk commented Jul 14, 2025

Copy link
Copy Markdown

I've been looking at FILA Decathlon, which uses this exact driver version.

I have identified the right GAX function signatures, however this isn't all that has changed between versions.

The Gax2Params structure in 2.02 doesn't appear to have fx_mixing_rate (judging by the beginning of gax2_init), but still has the unknown field that is between mixing_rate and flags. After volume and before the 24 byte field as documented in this gist is also another unknown 2 bytes. Not changing this order gives a song that's inaudible, as volume is at a mismatching offset. A diff for the driver constants file would be:

	struct_field o_Gax2Params_wram, 4
	struct_field o_Gax2Params_wram_size, 4
	struct_field o_Gax2Params_mixing_rate, 2
-	struct_field o_Gax2Params_fx_mixing_rate, 2
-	struct_field o_Gax2Params_field_C, 2
+	struct_field o_Gax2Params_field_A, 2
	struct_field o_Gax2Params_flags, 2
	struct_field o_Gax2Params_num_fx_channels, 2
	struct_field o_Gax2Params_volume, 2
-	struct_field o_Gax2Params_unknown, 0x1c @ length depends on versions
+	struct_field o_Gax2Params_unknown, 0x1a @ length depends on versions
	struct_field o_Gax2Params_fx, 4
	struct_field o_Gax2Params_music, 4

I presume unknown being 28 bytes there is a V3 change, since the offset constants past that point aren't used for the V2 GSF driver and only for V3, with V2 just being fed an immediate of 0x2C for fx directly.

Finally, the WRAM location identified by GaxDriver::FindGaxWorkRamPointerV2 doesn't appear to work for this game. It points to a WRAM location that's used internally by GAX functions, but it's not one that works for playback when passed to the params struct. In the function at 0800950c in the game is a condition that chooses between two different WRAM locations depending on the result of gax2_estimate. These two WRAM locations are 03004b00 : size=0xc80 or 030039a0 : size=0x1000. The smaller WRAM location only works for the few short tracks, while the larger one works for all songs.

I'm not sure which way you'd ideally want this to be approached in gaxtapper, hence this all being mentioned here and not done in separate pull requests. What I propose though is that all struct offsets shall be inserted into the driver the same way the function pointers are, and if DriverWorkRamSize is 0 it shall fall back to using gax2_estimate. This (and especially the latter proposal) should allow you to unify the GAX 2 and 3 driver code again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant