Commit Graph
131 Commits
Author SHA1 Message Date
LunaMooandClaude Opus 5.5 90cea302b9 HOME button quit screen, with the firmware's art when available
As on a PSP: pressing HOME in a game shows "Do you want to quit the game?"
over it. The game keeps running but gets no input while it's up (sceCtrl
samples are blanked). Left/right picks Yes or No, the confirm button (our
Confirmation button setting, or what compat forces) chooses, the other face
button or HOME closes it, and Yes/No can be tapped. The volume keys change
the game volume a step at a time, shown on the volume bar.

Yes runs the game's registered exit callback first, like the PSP does,
showing "Please wait..." meanwhile. Then, if the XMB launched the game, the
XMB is booted again; otherwise it's back to the game browser, like Exit to
menu. If the callback hasn't ended the game in 10 s, it's quit anyway. Not
in the XMB itself, the PS1 emulator (its own HOME menu) or GE dumps.

It lives in UI/ImposeHome.cpp; EmuScreen only feeds it input and frames and
draws it over the PSP display.

With a firmware dump installed, it's drawn with the firmware's own art from
flash0:/kd/resource/impose.rsc, which is what impose.prx draws it from:
prerendered text for each system language (the question, Yes/No normal and
highlighted, Enter/Back, Please wait...), the button icons, the lines, the
volume bar, the battery and the clock glyphs. The format is documented in
ImposeHome.cpp. Without one, the same screen is drawn with our font and
simple shapes at the same positions.

Where impose.rsc doesn't say where things go, the layout follows
impose_02g.prx (6.61), decrypted and disassembled:
- The screen is filled with 0x9CE7 (#393939); the images are opaque.
- Lines at (80, 96) and (80, 175); impose.prx grows them from the middle
  when it opens, which isn't done here.
- Volume bar: the speaker at (28, 223), 30 steps from x 62, 12 apart. It
  shows our game volume in the PSP's 30 steps.
- Button guide: the cross icon always left, the circle right, "Enter" and
  "Back" next to whichever confirms and cancels.
- Status bar: the battery at (450, 5) (60% and up full, 30% two bars, 12%
  one, then empty), the clock ending next to it at y 5: "M/D H:MM", or
  "D/M" for the DD/MM/YYYY format, no leading zero on the month, day or
  hour, AM/PM for the 12-hour clock.

The clock is the emulated PSP's local time (__RtcGetCurrentLocalTime, new),
in the system's date and time formats. The battery is this device's, since
the emulated PSP's is always full; a device without one shows it full.
For that, Windows now reports -1 for SYSPROP_BATTERY_PERCENTAGE without a
battery (was 100), as SDL already did; SDL polls the battery even when the
status overlay doesn't show it, and the overlay leaves it out when there's
none.

Core side: __CtrlSetGameInputBlocked; __KernelCanExitToVSH and
__KernelRequestExitToVSH to quit to the XMB from outside a syscall; and
__KernelInvokeRegisteredExitCallback(toVSH), so a callback that returns
without exiting ends in the XMB rather than powering down.

New strings: "Do you want to quit the game?", "Please wait..." (Dialog).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NB244iFpvm14JH2FbwHXeQ
2026-10-26 11:39:48 +01:00
Henrik RydgårdandClaude Opus 5.5 0558a7aa3e HLE: Kernel NIDs for sceKernelPollEventFlag and the 3.71 sampling setters
ThreadManForKernel's sceKernelPollEventFlag, imported by Yabause-PSP's
me.prx, and sceCtrl_driver's 3.71-3.73 NIDs for sceCtrlSetSamplingMode
and sceCtrlSetSamplingCycle (at the same addresses as the user exports
in ctrl.prx), imported by LightMP3's support.prx.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-21 08:58:10 +02:00
Henrik RydgårdandClaude Opus 5.5 7475563a3b HLE: Register ExceptionManagerForKernel, sceCtrlSetButtonIntercept
ExceptionManagerForKernel's table was never registered, so kernel
modules importing sceKernelRegisterDefaultExceptionHandler (LightMP3's
exception.prx) were left with an unresolved import. It now holds only
that one: registering the unimplemented entries would take them from
the firmware's exceptionman.prx under --vsh. Nothing could have saved
the old layout, since it was never registered.

sceCtrl_driver's sceCtrlSetButtonIntercept hides buttons from user mode
readers, which Daedalus does with the system buttons games don't get
here anyway: a no-op. Daedalus's Media Engine build needs both.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-20 21:18:21 +02:00
Henrik Rydgård 4464ef4efd Merge pull request #22432 from sum2012/patch4
Add some kernel NIDs and sceReg write overlay by Zcode
2026-10-09 18:57:39 +02:00
Henrik RydgårdandClaude Opus 5.5 0bcf7c8e2b Ctrl: Validate the sample buffer indices from savestates
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-09 15:32:05 +02:00
sum2012 472cf26be4 Add some kernel nids
sceReg:made the registry writable in-memory (sceRegSetKeyValue/sceRegCreateKey overlay + merged cached lookups), which is what fixed the Chinese font. Fix #14032
2026-10-06 04:59:56 +08:00
Henrik RydgårdandClaude Opus 5.5 a974440c79 Debugger: Time input.buttons.press in emulated vblanks
The release was counted down on the WebSocket thread, one step per poll
of host time however many vblanks had passed, so how long a scripted
press lasted depended on how fast the emulator ran, and scripted runs
went different ways. sceCtrl now releases it after that many vblank
samples, on the emulator thread; the debugger only reports when it's done.

Also: wsdbg's :screenshot works in headless with Vulkan.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 09:58:37 -06:00
Henrik RydgårdandClaude Opus 5.5 c9a631c336 sceCtrl: Add the 3.71 sceCtrl_driver NID for sceCtrlPeekBufferPositive
NJEMU's SystemButtons.prx kernel plugin imports it when the firmware
reports 3.71 or later, and polls it every frame to read HOME/volume.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-29 12:40:59 -06:00
Henrik RydgårdandClaude Opus 5.5 d4de590e3f sceCtrl: Name the port-taking buffer functions
sceCtrlPeek/ReadBufferPositive2/Negative2, which take a port before the
usual buffer and count. Not implemented.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 19:30:31 -06:00
Henrik RydgårdandClaude Sonnet 5 04a8948ded Add a VSH-only allowlist for real-loading flash0 modules, sceVshCommonUtil stub and sceVshBridge
Load and start VSH's kernel modules before booting vshmain.prx

A few flash0 modules (vshbridge.prx, paf.prx, common_gui.prx,
common_util.prx) should run for real once we know we're
actually booting the VSH rather than a game, since our fakes are unlikely
to be good substitutes for the genuine thing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PSNaZnHCjmryS3ziVN9gZU
2026-08-24 10:58:34 +02:00
Henrik Rydgård 0596ee97f6 More memory access cleanup 2026-08-11 20:14:01 +02:00
Henrik Rydgård 811c4bc577 Remove the VblankListener callback mechanism, do direct calls instead
Should fix #21575
2026-04-28 16:27:12 +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 0f840e6240 Move JPEG error codes to the big enum, some include cleanup 2025-03-21 20:44:46 +01:00
Henrik Rydgård af92d56491 Move a bunch of non-time-critical virt-keys to the new safe processing 2025-02-24 15:57:38 -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 7db68d50bb More hleLog* 2025-01-28 09:31:38 +01:00
Henrik Rydgård 9165711cef Convert more HLE logging to the hleLog system 2025-01-19 15:53:20 +01:00
Katharine Chui d7fd44280a allow binding custom right stick to analog 2024-07-16 16:06:13 +02: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 7af6501a6f UI: ScrollView: Improve interaction with the scroll bar thingy, avoid accidental clicks 2024-01-31 09:37:11 +01:00
Henrik Rydgård ad1f378902 Also simplify __CtrlUpdateButtons to only do a single read and write to the global. 2023-08-31 11:10:02 +02:00
Henrik Rydgård d924b742c0 Make the rapid-fire interval configurable
Rapid-fire works by holding down the button mapped for Rapid-Fire. Once
that's held, the PSP face buttons, L, R and Start will be repeated while
held.

With this new setting, you can change the repeat interval from the
default of 5 frames.

The interval is specified as frames rather than as milliseconds or
something because that often maps better to game logic.
2023-07-23 11:49:25 +02:00
Henrik Rydgård 04d3d3111c Clean up __Ctrl button functions. 2023-04-01 08:55:45 +02:00
Henrik Rydgård 26bf40c497 ControlMapper: Change the callbacks to be more suitable for the upcoming refactor. (#17209)
* ControlMapper: Change the callbacks to be more suitable for the upcoming refactor.

* SetAllButtons: Separate bits to set and bits to clear.

* Oops, missed committing some files somehow
2023-03-30 10:47:28 +02:00
Henrik Rydgård 1071d0808c Undo Daxter's rotation of the analog input. See #17015
I think this is quite a bit better actually. Appears to be exactly 15 degrees.
2023-02-27 11:10:47 +01:00
Unknown W. Brackets ad2e380987 Display: Move listeners to separate HW file.
Mixing this in with the HLE management funcs was messy.
2022-01-30 09:41:08 -08:00
Henrik Rydgård 3be1ff6ce4 Get the new setup flow going, with a confirmation dialog etc.
Moving the folder while already installed still crashes.
2021-08-04 23:22:43 +02:00
Henrik Rydgård cd8cfcfcd7 Merge __CtrlSetAnalogX/Y into one function. Always called together. 2021-07-09 10:41:26 +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 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
LunaMoo e999444b23 Implement PPSSPP specific cheats:
0xA0 vibration cheat(Xinput)
Syntax is: 0xA0NNLLLL 0x00MMRRRR
where NN/MM is time vibration lasts LLLL/RRRR is the vibration power

0xA1 read value for the vibration(Xinput) from game memory
Syntax is: 0xA1000000 0xNNNNNNNN
where NNNNNNNN is the address that stores following values at offset:
0xNNNNNNNN + 0x0 Left Vibration power,
0xNNNNNNNN + 0x2 Right Vibration Power
0xNNNNNNNN + 0x4 Left Vibration time
0xNNNNNNNN + 0x6 Right Vibration time

Left some room for other PPSSPP specific cheats(0xA2-0xAF)
2020-04-16 23:00:29 +02:00
iota97 f42e6a984f Rapid fire touch control 2020-01-28 08:52:18 +01:00
Henrik Rydgård 60e32e914e Fix apparent bug in #11094, fixes #11878 and likely #11798 2019-03-12 09:33:39 +01:00
Unknown W. Brackets e69e844623 Ctrl: Always mark non-user buttons released.
This matches behavior on real firmware and fixes a test failure.
2018-06-06 05:54:39 -07:00
Unknown W. Brackets 89186d8113 Replay: Initial structure for replay functionality. 2018-04-07 15:36:28 -07:00
Henrik Rydgård ce21642a61 Merge pull request #9978 from LunaMoo/ctrl_extra
Add more PSP keys(for some homebrew and cwcheats)
2017-09-28 18:51:16 +02:00
Henrik Rydgård 6a1fa728d8 Remove Globals.h 2017-08-31 17:15:22 +02:00
Unknown W. Brackets 9b7f43db04 Add additional button defines.
Not yet functional (overlap with virtkeys.)
2017-05-27 10:25:04 -07:00
Henrik Rydgard 26a2d42731 Big mutex overhaul - remove our custom ones, make them non-recursive where possible 2017-02-28 11:40:29 +01:00
Chris Burgener 842a29b0ae Add Frame Advance 2016-08-28 12:21:45 -04:00
Unknown W. Brackets da03b80c97 Standardize on just one mutex implementation. 2016-03-06 14:49:15 -08:00
Unknown W. Brackets 9591db2daa Cleanup RETURN() in __KernelWaitCurThread().
This hasn't been needed for a while.
2015-10-24 13:11:07 -07:00
Henrik Rydgard ee81c7f1a1 Rotate controls along with the display. Only rotates d-pad and analog stick, but easy to add more buttons if desired. 2015-05-15 18:49:54 +02:00
Unknown W. Brackets e2ecd1eabd Add memchecks for ReadStruct/WriteStruct. 2015-04-05 18:09:35 -07:00
Unknown W. Brackets fcf0518223 Update all the HLE tables with arg and ret info. 2015-03-22 20:51:55 -07:00
Lioncash 4ccb838306 Core: Mark some module functions as static 2014-12-08 04:40:08 -05:00
Unknown W. Brackets b370621a3a Fix sceCtrl buffer update timing drift.
Spotted by xsacha.  Only when not using vblank timing (most commonly used
by games.)
2014-07-06 01:08:44 -07:00