Skip to content

S3GetSampleLength 100% match#996

Draft
jeff-1amstudios wants to merge 3 commits into
dethrace-labs:mainfrom
jeff-1amstudios:match-s3getsamplelength
Draft

S3GetSampleLength 100% match#996
jeff-1amstudios wants to merge 3 commits into
dethrace-labs:mainfrom
jeff-1amstudios:match-s3getsamplelength

Conversation

@jeff-1amstudios

@jeff-1amstudios jeff-1amstudios commented Apr 18, 2026

Copy link
Copy Markdown
Collaborator

Match result

0x4c9577: S3GetSampleLength 100% match.

✨ OK! ✨

Original match

---
+++
@@ -0x4c9577,33 +0x4c7bf5,34 @@
0x4c9577 : push ebp 	(s3sound.c:296)
0x4c9578 : mov ebp, esp
0x4c957a : sub esp, 8
0x4c957d : push ebx
0x4c957e : push esi
0x4c957f : push edi
0x4c9580 : mov eax, dword ptr [ebp + 8] 	(s3sound.c:300)
0x4c9583 : push eax
0x4c9584 : call S3GetDescriptorByID (FUNCTION)
0x4c9589 : add esp, 4
         : +mov dword ptr [ebp - 4], eax
         : +cmp dword ptr [ebp - 4], 0 	(s3sound.c:301)
         : +je 0x2b
         : +mov eax, dword ptr [ebp - 4] 	(s3sound.c:302)
         : +mov eax, dword ptr [eax + 0x40]
0x4c958c : mov dword ptr [ebp - 8], eax
0x4c958f : -cmp dword ptr [ebp - 8], 0
0x4c9593 : -jne 0x7
0x4c9599 : -xor eax, eax
0x4c959b : -jmp 0x26
0x4c95a0 : mov eax, dword ptr [ebp - 8] 	(s3sound.c:303)
0x4c95a3 : -mov eax, dword ptr [eax + 0x40]
0x4c95a6 : -mov dword ptr [ebp - 4], eax
0x4c95a9 : -mov eax, dword ptr [ebp - 4]
0x4c95ac : mov eax, dword ptr [eax]
0x4c95ae : lea eax, [eax + eax*4]
0x4c95b1 : lea eax, [eax + eax*4]
0x4c95b4 : lea eax, [eax + eax*4]
0x4c95b7 : shl eax, 3
0x4c95ba : -mov ecx, dword ptr [ebp - 4]
         : +mov ecx, dword ptr [ebp - 8]
0x4c95bd : cdq 
0x4c95be : idiv dword ptr [ecx + 4]
         : +jmp 0xc
         : +jmp 0x7 	(s3sound.c:304)
         : +xor eax, eax 	(s3sound.c:305)
0x4c95c1 : jmp 0x0
0x4c95c6 : pop edi 	(s3sound.c:307)
0x4c95c7 : pop esi
0x4c95c8 : pop ebx
0x4c95c9 : leave 
0x4c95ca : ret 


S3GetSampleLength is only 74.63% similar to the original, diff above

AI generated. Time taken: 234s, tokens: 57,388

@jeff-1amstudios
jeff-1amstudios enabled auto-merge (squash) April 18, 2026 22:19
Comment thread src/S3/s3sound.c
sound_data = (tS3_sample*)descriptor->sound_data;
return 1000 * sound_data->size / sound_data->rate;
} else {
sound_data = (tS3_sample*)S3GetDescriptorByID(tag);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo: descriptor and sound_data might be transposed

@jeff-1amstudios jeff-1amstudios changed the title Match S3GetSampleLength S3GetSampleLength 100% match Apr 24, 2026
@dethrace-labs
dethrace-labs marked this pull request as draft May 21, 2026 06:30
auto-merge was automatically disabled May 21, 2026 06:30

Pull request was converted to draft

@github-actions

Copy link
Copy Markdown

reccmp report


Saved diff report generated June 30 2026, 03:06:01 (9:22:09 ago)

Increased (3):
0x4c9577 - S3GetSampleLength (74.63% -> 100.00%)
0x52d6a2 - __OP_SINjmptab (50.00% -> 51.61%)
0x52d6c2 - __OP_COSjmptab (46.67% -> 48.28%)

Decreased (2):
0x52d140 - __OP_FMODjmptab (24.24% -> 19.51%)
0x52d4b0 - __OP_SQRTjmptab (53.85% -> 51.85%)


Total effective accuracy 96.25% across 2387 functions (95.86% actual accuracy)
13 functions are aligned (0.54%)

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.

3 participants