133 Commits

Author SHA1 Message Date
Henrik Rydgård
d2ffac57dc Memory::IsValidAddress: Consider VRAM with a kernel flag invalid.
We don't have it mapped in our memory map, so this can actually crash
checked reads like Read_U32.

Since it isn't mapped, and it can't possibly be valid in retail PSP
games to access VRAM this way, I don't think this will cause any
problems.

However, if it does, we'll have to add the corresponding mappings to the
memory map.
2024-11-12 10:41:14 +01:00
Henrik Rydgård
5926886c0c Some include cleanup, delete some obsolete code 2024-07-25 14:52:41 +02:00
Henrik Rydgård
c332d564db IRInterpreter: Cache the MIPSState pointer in a local, faster address check 2024-05-10 23:21:51 +02:00
Henrik Rydgård
70ae4a35c1 Fix faulty formula for block transfer size-check. 2024-05-10 13:50:49 +02:00
Henrik Rydgård
0b91aa50ee Improve memory safety, add bugfix to little-used sysclib functions 2024-05-05 14:19:49 +02:00
Henrik Rydgård
c004bea5e4 Use memchr in IsValidNullTerminatedString 2024-05-05 12:23:36 +02:00
Henrik Rydgård
85f8fd0bdb Safety fix for GetCharPointer
Uses IsValidNullTerminatedString from #19103 by Kethen
2024-05-05 12:09:08 +02:00
Katharine Chui
47c7fab928 optimize Memory::IsValidNullTerminatedString 2024-05-03 21:00:26 +08:00
Katharine Chui
b570cacd90 add Memory::IsValidNullTerminatedString 2024-05-01 22:58:01 +08:00
Ethan O'Brien
8426b35a80 Cleanup emscripten libretro build target 2023-08-12 14:38:35 -05:00
Unknown W. Brackets
9cebfc31b3 Debugger: Avoid unaligned reads in expressions.
Potentially, a watch or break condition could crash if it was unaligned
between mirrors.  This might happen if it's not the condition you wanted,
especially.  Play it safe.
2023-04-12 01:14:30 -07:00
Henrik Rydgård
e1a48d74c4 A bit more GetPointer cleanup.
Probably not worth it for performance reasons, but some semantic cleanup
is good, especially the accidental GetPointer -> writable casts without
using GetPointerWrite.

Using Unchecked on already checked pointers, or when we'd crash anyway
if it returned nullptr, is good for clarity.
2023-01-10 12:13:47 +01:00
Henrik Rydgård
91b7bf986e Can do an unchecked GetPointer here 2023-01-01 20:48:03 +01:00
Henrik Rydgård
a4d3e0ead8 Add range checks in replaced memcpy/memset functions. (#16693)
* Add range checks in replaced memcpy/memset functions.

Keep seeing especially Replace_memcpy as a semi-rare crash in the
reports. Hopefully this will take care of it, though if games hit this,
they're probably on their way to failing somehow anyway.

* Alternate approach, correctly causing memory exceptions if not ignoring
2023-01-01 18:25:40 +00:00
Henrik Rydgård
65c016d154 Fix dialog rendering (PPGe). Fixes #15954
Was caused by 867eb99 , part of #15950 .
2022-09-04 00:42:14 +02:00
Unknown W. Brackets
ccd4e92184 Kernel: Use PSPPointer for status objects.
Code makes more sense when reading ->size rather than offset 0.
2022-09-03 10:44:12 -07:00
Unknown W. Brackets
3a372aa615 HLE: Remove misc usage of WriteStruct().
Prefer PSPPointer and notifying.
2022-09-03 10:44:11 -07:00
Henrik Rydgård
e6403d7157 Split GetPointer into two versions, to help with const correctness 2022-07-24 13:26:19 +02:00
Unknown W. Brackets
2479d52202 Global: Reduce includes of common headers.
In many places, string, map, or Common.h were included but not needed.
2022-01-30 16:35:33 -08:00
Unknown W. Brackets
32ea8734fb MemMap: Cleanup memory mirror pointers. 2021-04-23 22:43:21 -07:00
Unknown W. Brackets
744d17e13c Core: Correct ValidSize outside scratchpad.
And simplify all the scratchpad valid checks.
2021-04-21 19:32:22 -07:00
Unknown W. Brackets
124774fecb Debugger: Provide memory mapping ranges.
Most of these are entirely static, but introspection is good for APIs.
2021-04-04 21:27:30 -07:00
Unknown W. Brackets
bab9581901 Core: Unbreak ValidSize limits.
Broken in bdd2029.
2021-03-28 19:42:29 -07:00
aliaspider
9a3e5879bb Global: Correct many endian types and casts. 2021-02-18 22:25:24 -08:00
Henrik Rydgård
5ed5947804 Merge pull request #13943 from unknownbrackets/dialog
Dialog: Simulate volatile memory lock behavior
2021-02-15 16:47:06 +01:00