Skip to content

Disable the memcpy slicing thing (for HLE memcpys) in Syphon Filter games - #20642

Merged
hrydgard merged 1 commit into
masterfrom
syphon-filter-disable-split-copy
Jul 18, 2025
Merged

hrydgard merged 1 commit into
masterfrom
syphon-filter-disable-split-copy

Conversation

@hrydgard

Copy link
Copy Markdown
Owner

Fixes #20625

However, it's not clear why. As discussed in #20625, might just try to get rid of many of these replacement functions. The problem with the copy ones is that often we want to take action after the copy (for GPU copy detection purposes) and without replacing the whole function that's a bit hard (but doable).

Fixes #20625

However, it's not clear why. As discussed in #20625, might just try to
get rid of many of these replacement functions. The problem with the copy ones
is that often we want to take action *after* the copy (for GPU copy
detection purposes) and without replacing the whole function that's a
bit hard (but doable).
@hrydgard hrydgard added this to the v1.20 milestone Jul 18, 2025
@hrydgard
hrydgard merged commit 8de2a23 into master Jul 18, 2025
@hrydgard
hrydgard deleted the syphon-filter-disable-split-copy branch July 18, 2025 07:46
@Double-0-seven7

Copy link
Copy Markdown

Shame it's was not made in time for 1.19.3 , now you gotta wait until 1.20 which is next year for this to be on ios etc.

@hrydgard

Copy link
Copy Markdown
Owner Author

Well, I'm not ruling out a 1.19.4. But it's just how it is, releases take a lot of work, so can't do them all the time

@LeyoSFO

LeyoSFO commented Jul 18, 2025

Copy link
Copy Markdown
Screenshot from 2025-07-18 14-07-14 Sorry if my comment seems misplaced, but wouldn't fixing the adhoc callback timing solve the issue without having to remove the memcpy PR? Fixing it this way might be too time consuming for you so i shouldn't presume, but thought to point it out if it was unnoticed that someone already guessed the root issue, which is why i posted the screenshot.

And thanks for the Syphon Filter adhoc fix.

@hrydgard

hrydgard commented Jul 18, 2025 •

Copy link
Copy Markdown
Owner Author

Well we don't know that that's the root issue. Of course, fixing it properly would be best but that would require spending time investigating it in depth, and timing issues are the worst....

Maybe later. Also this doesn't remove the memcpy pr, it just disables it for a few games.

@anr2me

anr2me commented Jul 18, 2025 •

Copy link
Copy Markdown
Collaborator

Screenshot from 2025-07-18 14-07-14 Sorry if my comment seems misplaced, but wouldn't fixing the adhoc callback timing solve the issue without having to remove the memcpy PR? Fixing it this way might be too time consuming for you so i shouldn't presume, but thought to point it out if it was unnoticed that someone already guessed the root issue, which is why i posted the screenshot.
And thanks for the Syphon Filter adhoc fix.

The adhoc timing would be more sensitive, since we don't have the timing tested/logged on real hardware yet. So current adhoc timings are just speculation. (Someone need to added the test on JPCSPTrace to get a more accurate timings, by connecting to itself, like localhost, to minimize the latency).

And based on my old post, at the time it got frozen/crashed, there isn't any SCENET syscalls being used (other than initialization one).

It does have a PSPthread running in a loop (for the fake HLE _NetTriggerCallbacks) and only called sceKernelDelayThread(sleep time here) syscall waiting for adhoc event (which in this case there are no adhoc event yet).

The sceKernelDelayThread will cause thread switching, but removing it will cause the game to locked out on that PSPthread, since the game can't run their threads.

The sleep time was also sensitive as i remembered, it doesn't works well on some games when the value is too small, and it doesn't works well for other games when the value is too large.

May be there are better ways to put the adhoc thread to sleep without causing continuous thread switching when it have nothing to do yet, since it only have something to do when there is an adhoc event that need to be processed (by checking whether the event vector/queue is empty or not).

Edit: Using ScheduledEvent to put the fakeHLE (_NetTriggerCallbacks) in blocking mode and return from HLE only when there is an adhoc event that have been processed might be better 🤔 It will at least not excessively calling sceKernelDelayThread in a tight/short loop, which could cause waking up other threads prematurely.

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.

Syphon Filter Logan's Shadow/Combat Ops - adhoc not working?

4 participants