Commit Graph
123 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5.5 a4fe8e8f17 sceNetAdhoc: Don't fault on NULL pointers the PSP accepts
sceNetAdhocPdpSend with NULL data and a length of 0, sceNetAdhocPdpRecv
with a NULL sender MAC or port, and sceNetAdhocPtpSend with a NULL length
pointer all raised a memory exception before the call ran, which stopped
the game. On a PSP the first two succeed and the last returns INVALID_ARG
(net/adhoc/pdp and net/adhoc/ptp in pspautotests).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 17:13:45 +01:00
Francisco José García García 539490b0c8 HLE: sceAmctrl_driver, on libkirk's amctrl
amctrl.prx's PGD (BB) MAC and cipher functions, for kernel modules that
import them: the firmware's POPS manager checks and decrypts a store PS1
game's disc image with them. libkirk's amctrl.c reimplements the module, and
its MAC_KEY and CIPHER_KEY have the layout of the contexts the callers keep in
their own memory, so those are used in place. 6.60 NIDs.
2026-10-21 12:50:45 +02:00
Henrik RydgårdandClaude Opus 5.5 0a8d569c47 HLE: kuKernelCall and sctrlHENFindFunction
Custom firmware calls, which homebrew that runs ME code uses to reach
its own kernel modules: KUBridge's kuKernelCall runs a function with the
first eight of its arguments and stores v0/v1 in ret1/ret2 afterwards;
sctrlHENFindFunction (SystemCtrlForKernel, and a new SystemCtrlForUser)
finds a loaded module's export by module, library and NID.

Tanaka's Touhou ports find and call their GE4 wrapper's exports with
them.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-20 21:18:21 +02:00
Henrik RydgårdandClaude Opus 5.5 7dd1475ed7 HLE: Pass the MIPSState to syscalls and their implementations
HLEFunc and ReplaceFunc now take the MIPSState they run on. The dispatch
paths (both interpreters and every JIT backend) pass in the state they
belong to, and CallSyscall*, hleFinishSyscall and the HLE mips call
machinery use it instead of currentMIPS.

The wrappers in FunctionWrappers.h take the function as `auto` and call it
through HLECall, which also accepts an implementation with an extra leading
MIPSState * parameter and passes the state to it. Any other signature still
fails to compile, as before. PARAM/RETURN now refer to a local `mips`.

The HLE functions (and replacement functions) that used currentMIPS now take
the state that way. Callers outside a syscall's own frame - CoreTiming
events, the adhoc matching thread, dialogs, PPGe, the debugger UIs - pass
currentMIPS or &mipsr4k explicitly. The kernel's thread internals still use
currentMIPS.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-20 15:45:14 +02:00
Henrik RydgårdandClaude Opus 5 84bd8459e9 sceAudio: implement sceAudioOneshotOutput, and cover the rest of the channel rules
Another pass looking for gaps, all of it now recorded by audio/blocking/channels
and audio/blocking/oneshot.

sceAudioOneshotOutput was the last unimplemented entry in the module, returning
"library not linked" to anyone who called it. It plays one buffer on a channel it
never reserves, so the channel frees itself when the buffer runs out, and its
argument checks are their own set: any positive sample count, aligned or not, no
upper bound, a negative volume rejected rather than skipped, and no busy check at
all. No game is known to use it; it is implemented because tracing it turned out
to be cheap, not because anything needed it.

The channels test confirms four behaviors: sceAudioChReserve(-1) skips a released
channel that is still playing while a reserve of it succeeds, a second channel
joining a running mixer doesn't lose a block unlike a first, mono counts down in
the same 64-sample steps over the same time as stereo, and the panned blocking
output has no extra delay on the high channels.

Also: the SRC resampler now interpolates into the next buffer at a buffer join
instead of holding the last sample, since the codec reads the two descriptors as
one stream. That only shows up at non-native rates and no test can see it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-10 17:03:07 -06:00
Henrik Rydgård c5e4d0d90d Rename the get-memory-pointer functions to make it clear where CPU exceptions can happen. 2026-08-12 14:06:16 +02:00
trigger c04bd1c6d9 sceParseUri: sceUriEscape & sceUriBuild 2025-07-27 13:55:22 -07:00
Henrik Rydgård a555fe8924 Partially implement sceReg 2025-04-03 14:13:50 +02:00
Henrik Rydgård 7a4d175e06 Port over some utility functions, fix bugs. 2025-03-18 09:36:32 +01:00
Nemoumbra e1542e9267 Added the HLE implementations to the table + new wrappers 2025-02-12 19:26:33 +03:00
AdamN 98dba643f4 Just the sceUtility changes from ANR2ME's branch 2025-01-06 14:38:45 +01:00
ANR2ME 4f873614e7 Added sceParseHttpResponseHeader implementation. 2025-01-05 20:16:57 +01:00
ANR2ME 0012818eb7 Implement sceHttp library 2025-01-05 19:14:15 +01:00
White Blood Cell dfd4b996bf Implement sceNetInetGetpeername and sceNetInetGetsockname as per anr2mes impl and begin converting ERROR_LOGS into hleLogError + ensuring last error is set. 2025-01-04 17:55:18 +01:00
White Blood CellandAdamN ee0b0fce6c sceNetInet and sceNetResolver support.
Co-authored-by: AdamN <anr2000@gmail.com>
2025-01-04 17:28:36 +01:00
ANR2ME bf98466a78 Added a FunctionWrapper used by sceNpService 2022-08-04 16:12:23 +07:00
Henrik Rydgård e6403d7157 Split GetPointer into two versions, to help with const correctness 2022-07-24 13:26:19 +02:00
aliaspider 9a3e5879bb Global: Correct many endian types and casts. 2021-02-18 22:25:24 -08:00
sum2012 043ef8c9d4 Wrap some SysMemForKernel's nids
#7960
2020-04-26 11:18:41 +02:00
daniel229 f8378d0d7f sceSfmt19937 fix 2015-02-16 23:38:45 +08:00
daniel229 21b0c2992b Implement sceSfmt19937 module. 2015-02-15 13:22:20 +08:00
AdamN 1c7152db3a Adding Branch opcode to the MAKE_MIPS
Temp revert old version to fix conflict; Implementing built-in PRO Adhoc Server; Add back sceUsbGps

Implementing more Adhoc functions, and some bug fix (i don't remember them anymore)
2015-01-04 13:04:02 +01:00
Unknown W. Brackets 05ab192c9c Reduce includes in Core/HLE/.
Especially templates.
2014-03-15 11:22:19 -07:00
Unknown W. Brackets 641064f0bc Consistently use MIPS_REG_V0 for return values.
This way all instances are a lot easier to search for (was trying to find
where we were writing an incorrect value to v0, turns out to be callback
related of course.)
2014-03-04 08:21:55 -08:00
Henrik Rydgård 00c32ddadb Mostly get rid of including "Globals.h" 2013-12-30 10:17:11 +01:00
Henrik Rydgard 2140892074 Initial preparations for ability to replace game functions with custom implementations.
Also auto-saves hashmap additions and reapplies the hashmap on function
rename so that if you rename a function that exists in several copies
they will all be labelled.

Note that actual function replacement is not activated yet.
2013-12-17 12:27:20 +01:00
Igor Calabria 553f1d4e4e Implements a bunch of adhoc functions 2013-10-29 21:39:45 +00:00
Unknown W. Brackets 580d4436a3 Fix vtimer uid param type, add algorithm include. 2013-10-22 07:46:33 -07:00
Unknown W. Brackets 67cd13702e Correct sceKernelSetVTimerTime*(). 2013-10-22 07:45:48 -07:00
Henrik Rydgard 7e37e183ed Wrap more adhoc functions 2013-09-07 11:06:28 +02:00
Henrik Rydgard 3b323c4176 Add a bunch of empty adhoc functions 2013-09-07 01:53:51 +02:00
shenweip c05100e0e3 Add sceHeap,some games will call this.
e.g. Linear ModeSenritsu no Stratus
2013-09-04 11:05:14 +08:00
Unknown W. Brackets 4be06d2432 Wrap the msgpipe send functions. 2013-08-18 18:38:10 -07:00
Henrik Rydgard 1a6bb7643b Add some sceNetInet stubs (used by pspradio) 2013-07-09 14:06:01 +02:00
Henrik Rydgard d2b874436d Merge branch 'jpeg' of https://github.com/CPkmn/ppsspp into CPkmn-jpeg 2013-07-05 00:09:29 +02:00
CPkmn 17493f3c4e Update FunctionWrappers.h 2013-07-04 14:51:51 -07:00
CPkmn a0379d5ac8 Update FunctionWrappers.h 2013-07-04 03:00:22 -07:00
The Dax db7e90c23e Fix parameter values in func wrapper. 2013-07-01 04:29:48 -04:00
The Dax a6dabfb5d2 Add a number of sceHttp* stubs; fixes hangs in LBP and the Monster Hunter series, when trying to go online or download DLC, and probably in other games too. 2013-07-01 04:00:41 -04:00
oioitff 1e4d896980 Implement scePsmfPlayerSetPsmfOffset and
scePsmfPlayerSetPsmfOffsetCB. And use memory buffer for PsmfPlayer
directly instead.
2013-06-25 00:16:51 +08:00
The Dax fadea64ebf Fix sceNetEtherNtostr. 2013-06-04 01:53:32 -04:00
The Dax 50dc015d44 Remove useless dependency in FunctionWrappers.h. 2013-06-04 00:41:50 -04:00
The Dax b02dbe3f5f Add a multitude of sceNet* stubs.
I tried this in an attempt to fix the Peace Walker hangs, but it didn't seem to help, so it must be related to something else.
2013-06-04 00:39:03 -04:00
Unknown W. Brackets 4c36f12889 Negative volume means unchanged, not error. 2013-05-19 10:42:22 -07:00
Unknown W. Brackets 42b925a440 Initial stab at implementing some new memory funcs.
Borrowed from JPCSP, kept simple.  Need to do tests.
2013-04-07 20:57:53 -07:00
JimLee168 e686ef46b8 Added sceZlibDecompress and VS2010 build fix
Fixes ULUS10121 Bomberman
2013-04-05 13:26:54 +08:00
Henrik Rydgard f355137156 Update native. some stubs and a buildfix. 2013-03-21 20:24:47 +01:00
sum2012 bb82ad1685 Correct WrapI_UUUI and IMP sceMpegAvcConvertToYuv420 2013-03-10 15:21:55 +08:00
sum2012 827625ac3f Add WrapI_UUUI
For sceMpegAvcConvertToYuv420 use
public int sceMpegAvcConvertToYuv420(int mpeg, TPointer bufferOutput,
TPointer unknown1, int unknown2) {
return 0;
}
2013-03-09 00:51:17 +08:00
Henrik Rydgård 556f16eb03 Merge pull request #814 from unknownbrackets/memory
sceKernelPartitionMemory() alignment/errors (review?)
2013-02-28 00:23:27 -08:00