Skip to content

Update: ADX 010 Editor Template#132

Open
Sewer56 wants to merge 2 commits into
Thealexbarney:masterfrom
Sewer56:master
Open

Update: ADX 010 Editor Template#132
Sewer56 wants to merge 2 commits into
Thealexbarney:masterfrom
Sewer56:master

Conversation

@Sewer56
Copy link
Copy Markdown

@Sewer56 Sewer56 commented Jan 17, 2022

Summary

Made a number of small changes to the ADX template.
These are based off my personal disassembly of the Windows port of Sonic Riders, a 2006 hoverboard racing game that uses CRI. These changes are based on my disassembly of the header parsing code.

  • Fixed Parse Error with Newer 010 Editor Versions
  • Removed LoopCount. It's a simple flag that only accepts a value of 1. Any other value is ignored.
  • First short of the Loop structure is ignored by the application. Probably reserved. Marked as such.

I made this changes while working on ADX-ID3, a fun weekend project to add ID3 tag support to ADX.

Regarding AINF

I noticed the template had a mention of the 'AINF' and 'CINF' structures. While I couldn't find any test files using those headers (I've tried a fair bit), I did find the code that parses it while investigating the loop stuff.

It appears the logic is the following.

int loopOffset = version == 4 ? 32 : 20; // Start of loop header.
int ainfOffset = loopOffset + 4; // Start of loop data.
if (loopEnabled)
    ainfOffset += 20;

Game code specifically uses 32 and 20. There isn't anything to compensate for the channels and the official CRI encoding tools never supported >2 ch for ADX as far as I'm aware.

It comes after the Loop structure if the enable flag is set, and in place of the loop structure if the flag is not set.
No sample files to doublecheck, so didn't add that part in.

@Thealexbarney
Copy link
Copy Markdown
Owner

  • Removed LoopCount. It's a simple flag that only accepts a value of 1. Any other value is ignored.
  • First short of the Loop structure is ignored by the application. Probably reserved. Marked as such.

Sonic Riders might not use these values, but that doesn't mean they're not part of the ADX format or that no other applications use them

uint32 SampleRate;

This value is actually used as a signed value

@Sewer56
Copy link
Copy Markdown
Author

Sewer56 commented Jan 17, 2022

This value is actually used as a signed value

I didn't even notice I made this change when submitting the PR, seems that you are indeed correct, I doublechecked the parsing code, that is my mistake.


Regarding the rest, do you know any sample files or games that might interpret these values otherwise? The implementation in the Windows application I was looking up doesn't even read the short in question and it was pretty late in the lifespan of the original CRI Tools; so I can't imagine that stuff might have changed between different platforms.

@Thealexbarney
Copy link
Copy Markdown
Owner

Regarding the rest, do you know any sample files or games that might interpret these values otherwise?

I couldn't name any games that use multiple loops, but it was part of whatever spec CRI had for ADX. They did remove support for more than a single loop at some point, but I don't know when.

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.

2 participants