129 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5.5 5674c789ef sceUmd: Match hardware's parameter checks and wait timeouts
- A timeout of 0 to sceUmdWaitDriveStatWithTimer/CB means no timeout,
  not a tiny one (or 8ms for the CB version).
- Timeouts round like the event flag wait does.
- A wait with no timeout no longer times out right after a callback.
- sceUmdRegisterUMDCallBack only accepts callbacks.
- sceUmdActivate requires the name to be exactly "disc0:", and it and
  sceUmdDeactivate/sceUmdGetDiscInfo reject kernel pointers.
- sceUmdDeactivate needs a name in mode 2.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-09-29 09:19:32 -06:00
Henrik RydgårdandClaude Opus 5.5 eda92c4ef2 Callbacks: Track callback nesting per thread, one level deep
Replaces the global in-callback counter with each thread's own mipscall
chain, so several threads can be inside callbacks at once, and other
threads' callbacks (better priority ones right away) run while one is.
Verified against pspautotests threads/callbacks/otherthread, recursion
and intrnotify:

- A callback nests only one level: a CB wait that would go deeper never
  returns on hardware, so the callback is left pending instead.
- A non-CB wait inside a callback no longer runs callbacks because of
  the CB wait the callback interrupted.
- Callbacks for a waiting thread are only taken when it beats both the
  running thread and every ready one. After an interrupt (which runs on
  the idle thread) that's the thread about to resume, not idle.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-09-28 15:59:25 -06:00
Henrik RydgårdandClaude Opus 5.5 cd94e414cd Savestate: Reset what older states lack instead of keeping pre-load values
Missing sections (videocodec, audiocodec, aac, mp3) and old-version
branches (impose, io, umd, gps, mic, display, font) left the session
before the load in place.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-09-28 11:32:07 -06:00
Henrik RydgårdandClaude Opus 5.5 f96a58fb3e Savestate: Don't change the running game's state when saving
Some DoState code meant for after a load ran on every save:
- scePower reset the bus frequency a game set (and with a locked CPU
  speed, applied the current setting to the clock).
- sceDisplay reset the lag sync baseline, and could schedule lag sync in
  the measuring pass only, which failed the save.
- GPUState dirtied the texture, sceUmd notified the UI, and sceMpeg
  dropped a pending ringbuffer fix-up for an old state.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-09-28 09:34:06 -06:00
Henrik RydgårdandClaude Opus 5.5 db071361b0 Savestate: Wait for the SAS and IO threads before touching memory
Both drained only in their own DoState, after memory and Atrac contexts
had already been replaced under a mix or read still in flight. Also fix
sceUmd loading umdActivated into the wrong variable, and count each save
once in saveStateGeneration (it also bumped in the measuring pass).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-09-28 09:34:05 -06:00
Henrik Rydgård 86fcfdc60a Add some new function names that were cracked from NIDs by zecoxao
He used Claude, never thought of this use case, but it's logical - it
can go reverse engineer the functions to come up with likely names,
making it easier to match the SHA1 hash. (NIDs are truncated SHA1 hashes
of names, except in firmwares later than around 3.50).
2026-09-10 15:52:53 -06:00
Henrik Rydgård e9a3449ede More MIPSState * plumbing (manual) 2026-08-12 14:02:19 +02:00
Henrik Rydgård 4e1ff145a5 Logging update 2025-05-27 17:48:23 +02:00
Henrik Rydgård f98b313234 Logging fix 2025-04-02 18:30:43 +02:00
Henrik Rydgård 4e25f44eef Rename some module-related functions to include HLE where appropriate 2025-03-31 11:17:50 +02:00
Henrik Rydgård 34169cdb8e More error code consolidation 2025-02-04 11:53:22 -06:00
Henrik Rydgård 28b2c7f540 HLE log rename part 1: Remove duplicate log functions. Return type should be determined by metadata. 2025-01-29 09:45:39 +01:00
Henrik Rydgård 3ce72f87d3 Another batch of log cleanup 2025-01-28 09:31:38 +01:00
Henrik Rydgård e01ca5b057 Logging API change (refactor) (#19324)
* Rename LogType to Log

* Explicitly use the Log:: enum when logging. Allows for autocomplete when editing.

* Mac/ARM64 buildfix

* Do the same with the hle result log macros

* Rename the log names to mixed case while at it.

* iOS buildfix

* Qt buildfix attempt, ARM32 buildfix
2024-07-14 14:42:59 +02:00
Henrik Rydgård 3fd5190271 Add a comment, some additional cleanup 2024-01-16 09:07:09 +01:00
Henrik Rydgård 1f60247749 Fix hang when changing UMD with retroachievements enabled
Fixes #17976
2023-09-12 14:17:50 +02:00
Henrik Rydgård 67cb466ee1 Allow using a file browser to choose UMDs during disc change. 2023-09-04 21:43:10 +02:00
Henrik Rydgård 18e6da2e3d rc_client: Hook up UMD change (untested) 2023-07-08 21:47:19 +02:00
Henrik Rydgård d586ec0d5e Don't create Host objects except in headless/unittest 2023-03-25 10:47:01 +01:00
Henrik Rydgård fc1732cc22 Move NotifySwitchUMDUpdated 2023-03-21 13:37:19 +01:00
Henrik Rydgård dda8635c89 Move three notifications out of Host 2023-03-21 13:37:19 +01:00
Henrik Rydgård 2e16e83159 It never ends... 2021-05-13 10:39:16 +02:00
Unknown W. Brackets 74f08bee2a Umd: Fix thread wakeup.
Oops.  Not sure how I left this flag flipped.  Was not waking threads.
2021-04-15 11:16:56 -07:00
Henrik Rydgård 9783a2ec79 Merge pull request #13970 from unknownbrackets/umd-wait-stat
Correct UMD stat waiting when changing discs
2021-04-11 08:06:03 +02:00
Unknown W. Brackets cfb52bf69e Umd: Disallow waiting on status that can't occur.
Per tests, CHANGED is not waitable.
2021-01-24 13:21:25 -08:00
Unknown W. Brackets 871a0f9492 Umd: Wake waiting threads on eject/insert. 2021-01-24 12:11:42 -08:00
Unknown W. Brackets f81250660a Umd: Delay common wait drive stat funcs.
These are sometimes used in loading or loops, and take time.  This should
reduce spin looping.
2021-01-24 11:49:25 -08:00
Unknown W. Brackets 06f8ab5a49 SaveState: Make event restoring more obvious.
We still must restore all events, but everything can be taken care of
during the save state load.
2020-12-28 13:29:19 -08:00
shenweip a0fe0e38c1 SwicthUMD:Only update Switch UMD item of Windows menu instead of entire UI. 2020-10-22 17:45:29 +08:00
Henrik Rydgård 4f43cff5ca Move fileutil, net, image loaders, ui to Common. (#13506)
* Move and rename file_util/fd_util to Common/File/FileUtil and DirListing

Let's also move net while we're at it.

Move the ZIM/PNG loaders over to Common.

Move the UI framework into Common

iOS buildfix

* Buildfix

* Buildfixes

* Apple buildfix

* This typo again..

* UWP buildfix

* Fix build of PPSSPPQt, such as it is (it's not in good condition...)

* Guess what? Another buildfix.
2020-10-04 20:48:47 +02:00
Unknown W. Brackets b8342fb8ec SaveState: Rename ChunkFile files to Serialize.
Makes more sense and less weird than ChunkFileDoMap, etc.
2020-08-10 08:04:05 +00:00
Unknown W. Brackets 1dc5ee424b SaveState: Split out Do types to reduce headers. 2020-08-10 08:03:44 +00:00
Unknown W. Brackets 4b4e3432cd SaveState: Split Do() into a separate header. 2020-08-10 08:03:41 +00:00
Henrik Rydgård c5e0b799d9 Remove category from _assert_msg_ functions. We don't filter these by category anyway.
Fixes the inconsistency where we _assert_ didn't take a category but
_assert_msg_ did.
2020-07-19 20:33:25 +02:00
shenweip 9be8fc6c69 Oops. 2020-01-04 11:14:32 +08:00
shenweip 9fa4ae7b15 fix 2020-01-04 09:11:15 +08:00
shenweip 458f8cfac3 minor fix 2020-01-02 16:45:01 +08:00
shenweip d09543ebd7 Move umd replace to loaders. 2020-01-02 14:56:24 +08:00
Henrik Rydgård d7770307f3 Change some log levels to verbose 2018-05-27 21:53:27 +02:00
Henrik Rydgard 5ce73f7264 Restore calls to UpdateUI from sceUmd, now that it's faster. 2017-04-05 11:46:41 +02:00
Henrik Rydgard a029195f57 Forgot one line 2017-04-04 10:14:07 +02:00
Henrik Rydgard 0a0aa02aae Win32: Enable/disable menu items when a menu is popped down. Allows us to avoid calling UpdateUI from sceUmd. Should fix #9546 2017-04-04 10:11:03 +02:00
sum2012 1f2f044164 Fix Dies irae Amantes amentes umd switch 2017-01-30 21:39:42 +08:00
Henrik Rydgard 03b607f389 Better way of updating menus on UMD switching calls 2017-01-29 11:41:31 +01:00
sum2012 860661dc14 Build fix for non-windows
First step to fix UnitTest
2017-01-29 03:56:49 +08:00
sum2012 2c58d34f3e Add save status 2017-01-29 03:38:28 +08:00
sum2012 c83db04a25 Change to "schedule an event" 2017-01-28 21:09:37 +08:00
sum2012 3f92bac4bb Rename UMD_insterted to UMDInserted 2017-01-28 18:39:20 +08:00
sum2012 033e0604e9 Build fix for non-windows 2017-01-28 13:40:13 +08:00
sum2012 bd6764b65e Fix "Akaya Akashiya Ayakashi" umd switch
Also,make "switch umd" menu enable faster,
2017-01-28 11:51:20 +08:00