Commit Graph
339 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5.5 6d122f416e Keep JIT block entries and replacement hooks out of PSP memory
The JITs used to find a block by overwriting its first instruction with an "emuhack" holding
the offset into the code space, and replacement functions installed their own emuhack the same
way. Anything that read code (savestates, the debugger, memory dumps, cheats, the function
hasher, games reading their own code) had to translate them back.

Blocks now live in a block shadow: one u32 per guest instruction, indexed by the PC masked with
BLOCK_SHADOW_MASK (1GB on 64-bit, folding the kernel and uncached mirrors; 256MB on 32-bit, iOS
and Switch, where address space is short), with the low bits cleared so a misaligned PC can't
read across two entries. Only the ranges under memory views are committed, so a bad PC still
faults in the dispatcher, and the shadow is reserved before the memory map so it can't land in
a gap of the 4GB window. Entries hold full 32-bit offsets, lifting the 16MB limit. The
dispatchers on every backend, and the IR interpreter's loop, look blocks up there.

A hooked instruction without a compiled block gets the JIT's hook value in its entry: the offset
of the dispatcher's compile path (1 for the interpreters, the IR arena keeping that offset
empty), so dispatching there compiles a block, and the frontends substitute the hook. Compiling
replaces the entry with the block's, and destroying the block puts the hook value back. The hook
value is rewritten when the JIT changes or regenerates its dispatcher.

Hooks live in a map keyed by the masked address, and are dropped when the game overwrites the
hooked instruction, or when an icache invalidation finds the function's hash (immediates masked,
as when matching it) changed. Those checks run when queued invalidations are processed, since
cheats and the debugger queue them before writing. Installing and removing hooks invalidates
deferred, as it happens in HLE calls that can run inside a block. The cache instruction goes
through MIPSState, so it drops changed hooks too.

With clean memory, the save/clear/restore around savestates, memory reads and dumps goes away,
as do the source-range invalidations in the memcpy replacements, sceDmac and the cheats.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-11 10:33:30 +02:00
Henrik Rydgård e9cdb2b20f UI work for VSH (Windows and ImGui) 2026-08-24 11:13:00 +02:00
Henrik Rydgård 8270fca734 Remove the hardcoded F12 hotkey for screenshots on Windows.
Fixes #17559
2026-02-11 14:31:49 +01:00
Henrik Rydgård 330a638281 Add ability to copy function hash from the disassembly view
See #4179
2026-02-09 19:26:43 +01:00
Henrik Rydgård 77b9a6e2e8 Prepare for adjustable save state slot count by making the Win32 menu dynamic 2026-01-08 16:07:48 +01:00
Henrik Rydgård 5aeab28e9b Remove the "Percentage of framerate" frameskip type 2025-10-20 11:49:41 +02:00
Henrik Rydgård 94b47498ab Windows: Remove special code for the help menu 2025-09-01 09:34:27 +02:00
Henrik Rydgård b997b33d58 Change hardcoded F8 shortcut key to only work in debugger window. If desired, this can be manually re-mapped (as "Pause (no menu)") to restore the old functionality
Fixes #20676
2025-08-06 17:44:54 +02:00
Henrik Rydgård 6cfea96e58 Remove D3D9 support, to make future changes easier 2025-06-10 15:07:16 +02:00
Henrik Rydgård 96b4daf0ba Desktop (Windows) menu: Add "Save frame dump", remove the old "Dump frame to log" 2025-04-14 23:54:45 +02:00
Henrik Rydgård a45dad94ef Windows: Delete obsolete hotkey for frameskipping 2025-01-23 10:35:50 +01:00
oltolm fd8e877591 ppsspp.rc: remove mingw32 specific code
# Conflicts:
#	Windows/aboutbox.rc
2025-01-19 10:32:58 +01:00
oltolm 9566065455 make compile on mingw-w64 2025-01-11 01:25:27 +01:00
Henrik Rydgård 39ffe92e0a LR->RA rename, fixes 2024-12-12 17:47:37 +01:00
eveninglatte 00e4dcd43a Fixed some strings not being translated properly
Also changed all occurences of "Smart 2D Texture Filtering" to be lowercase except for the first word
2024-07-07 14:49:47 +02:00
Henrik Rydgård d29a2a2b8c Make the "Pause when not focused" setting available in the regular settings menu 2024-05-29 13:06:49 +02:00
Henrik Rydgård d51da3ca60 Windows: Add "Restart Graphics" to the debug menu. Useful to debug resource lifetime issues. 2024-01-18 15:57:45 +01:00
Henrik Rydgård 4360fe786c Add a setting for smart 2D texture filtering 2024-01-12 11:10:53 +01:00
Henrik Rydgård e4ea4831e9 Delete the vertex cache option from the code. 2023-10-10 15:43:43 +02:00
Nemoumbra ef20a0ba34 Ctrl+X -> Ctrl+H for closing the bottom tabs 2023-09-07 14:39:15 +03:00
Nemoumbra 5ca099a747 Scan/remove -> edit symbols 2023-07-17 16:38:24 +03:00
Nemoumbra cdba944643 Updated the resource file 2023-07-08 22:40:11 +03:00
Nemoumbra abd2b21d60 Added the logic to the ScanRemoveWindow 2023-07-08 22:40:11 +03:00
Henrik Rydgård 2708f0b93e Add a new "System" request for a username-password dialog box 2023-06-22 08:58:29 +02:00
Nemoumbra 5bf22c15d0 sceKernelPrintf improvement, QOL adjustments 2023-04-11 15:47:50 +03:00
Unknown W. Brackets 5629b01dc9 Debugger: Accept format for watches. 2023-04-09 16:39:25 -07:00
Henrik Rydgård b4c766f756 Merge pull request #17256 from unknownbrackets/debugger-watch
Debugger: Add named watch expressions
2023-04-09 10:23:25 +02:00
Unknown W. Brackets 85a071568c Debugger: Allow adding/removing watches. 2023-04-09 00:35:37 -07:00
Unknown W. Brackets 879e91dbf6 Debugger: Add empty watch tab for debugger.
Currently, there's nothing shown here.
2023-04-09 00:01:42 -07:00
Unknown W. Brackets f708ab2965 Debugger: Add delete breakpoint to context menu. 2023-04-08 23:29:59 -07:00
Nemoumbra 4a54409f09 Added new option "Copy Float (32 bit)" to Windows Debugger UI 2023-03-28 13:18:20 +03:00
Henrik Rydgård 82097b4a3b Implement NopInstruction feature in debugger
See #16975
2023-03-02 14:30:53 +01:00
Nemoumbra aab4a3034c Added new MainWindow menu item "copy PSP memory base pointer" 2023-02-24 23:54:45 +03:00
Serena 30f6296767 Remove some Windows + Qt stuff + meow 2023-01-27 19:12:41 +03:00
Henrik Rydgård 8bd6621c40 Remove postprocessing option from desktop menu (doesn't support multi-shader) 2022-12-07 11:57:28 +01:00
Henrik Rydgård a87cf02dbf Rename "Display layout editor" to "Display Layout && Effects" 2022-11-24 22:43:49 +01:00
Henrik Rydgård 519db766b6 Change "Rendering Mode" to just a "Skip buffer effects" checkbox. Reuse translations. 2022-11-06 19:26:56 +01:00
Unknown W. Brackets 19970df430 GE Debugger: Add option to track pixel in preview. 2022-09-24 12:23:02 -07:00
Unknown W. Brackets 3cc628beb4 GE Debugger: Copy images optionally with alpha.
Although, lots of apps don't support this.
2022-09-24 11:43:52 -07:00
Unknown W. Brackets f3722faef4 GE Debugger: Add a direct copy for preview images. 2022-09-24 10:05:41 -07:00
Unknown W. Brackets f14e49a373 GE Debugger: Add conditions to cmd breakpoints. 2022-09-05 17:33:54 -07:00
Unknown W. Brackets 0b30b723bb GE Debugger: Add address breakpoint conditions. 2022-09-05 17:33:54 -07:00
Unknown W. Brackets a901fa4315 GE Debugger: Add separate step based on vsync.
I think there were some games where this would step in the middle of a
frame, but not seeing it commonly now.  So make it the default, but allow
both methods in the menu.

Fixes #15893.
2022-08-23 19:48:34 -07:00
Unknown W. Brackets 49679c6a50 GE Debugger: Add context menu to control tabs.
Crurent non-functional, but shows up for the correct tab.
2022-08-14 10:20:53 -07:00
Unknown W. Brackets 2a0f23665f GE Debugger: Track tabs per panel. 2022-08-14 09:23:18 -07:00
Henrik Rydgård 9c3e00aa08 Add a second set of tabs to the Windows GE debugger. Also reorder stuff. 2022-08-14 10:43:30 +02:00
Unknown W. Brackets d1c642982b Debugger: Improve memory search result draw speed. 2022-02-10 20:40:02 -08:00
Unknown W. Brackets c66619f7c9 GE Debugger: Add filter to skip prim calls.
This allows you to cut prims from the scene as desired.
2022-02-06 21:25:33 -08:00
Unknown W. Brackets 459bb83c23 GE Debugger: Allow modify/breakpoint on matrix. 2022-02-06 00:16:35 -08:00
Unknown W. Brackets 1bb1f34af0 GE Debugger: Add breakpoint icon in state. 2022-02-05 19:27:28 -08:00