130 Commits

Author SHA1 Message Date
Stenzek
c192bd798b
Bus: Stub out 0x1F802080
Used by some homebrew.
2025-04-11 22:18:27 +10:00
Stenzek
0479500357
CPU: Correctly mask upper 1.5GB of KUSEG
Stops fastmem going into a loop when trying to backpatch accesses
above 512MB.
2025-04-08 21:39:29 +10:00
Stenzek
2bfc408242
Bus: Enable mmap fastmem on uppermost KSEG0 mirror
Instead of mapping all the RAM mirrors, we only map the KSEG0
uppermost mirror. This is where some games place their stack, so
we avoid the backpatching overhead/slowdown, but don't pay the
cost of 4x the mprotect() calls when a page's protection changes,
which can have a non-trivial impact on slow ARM devices.
2025-02-15 12:42:43 +10:00
Stenzek
f25302c847
CPU/Recompiler: Actually use fetch ticks for uncached EXP1 2024-12-31 17:29:40 +10:00
Stenzek
e0877c1922
System: Add IsUsingPS2BIOS() 2024-12-31 14:58:31 +10:00
Stenzek
26db661a05
GPU: Remove global indirection 2024-12-21 14:35:12 +10:00
Stenzek
5687dd22bd
PIO: Add basic flash cartridge support 2024-12-13 23:22:57 +10:00
Stenzek
2f6eaa1d43
CPU/Interpreter: Address ICache lines in words
Might help on ARM32, because no unaligned access.

Otherwise, ~23% perf boost in debug builds. But this is pretty
meaningless.
2024-12-13 23:22:57 +10:00
Stenzek
0faa9cf650
Build: Add Devel configuration
Gets you debug assertions and logging, while still producing an
optimized executable.
2024-12-01 23:21:33 +10:00
Stenzek
5c03e1d940
Misc: Fix alignment errors on ARM32 2024-11-23 18:52:45 +10:00
Stenzek
ead9e56c4d
System: Support loading ELF files 2024-11-05 17:54:12 +10:00
Stenzek
6551358212
Log: Replace channel string search with bitset
Knocks off around ~20KB of code.
2024-10-31 14:41:33 +10:00
Stenzek
7d2216c289
GameList: Avoid double fopen/read of EXEs 2024-10-23 21:20:28 +10:00
Stenzek
2d04f2eff9
System: Support loading .CPE files 2024-10-23 21:08:17 +10:00
Stenzek
26b6c704f0
MemMap: Support dynamic page size selection
i.e. 4K to 16K on ARM64.
2024-10-05 19:25:23 +10:00
Stenzek
3dca598063
Log: Switch to enum class
Need to change the channel to a bitset too.. the string lookups are
horribly slow, and conflict when one is a prefix of another.
2024-09-21 22:26:06 +10:00
Stenzek
2e080d4998
Qt: Add edit function to debugger memory view 2024-09-06 22:48:50 +10:00
Stenzek
ab1c85790c
CPU: Refactor execution mode switching
Fixes single step breaking in branch delay slots with recompiler.
Simplifies initialization.
Removes multiple sources of truth for fastmem.
2024-09-06 20:00:30 +10:00
Stenzek
7f4e5d55db
Misc: Update copyright headers 2024-09-01 22:08:31 +10:00
Stenzek
707453b596
FileSystem: Swap vector for DynamicHeapArray
No point zeroing it out.
2024-08-25 22:13:18 +10:00
Stenzek
421bd23dc8
Bus: Add stub for SIO2 accesses
But only enable it when using a PS2 BIOS. I could put the check in the
handler registration, but realistically this is basically never going to
be called, so better to keep things simple.
2024-08-13 14:48:18 +10:00
Stenzek
00a58eb4e5
Bus: Fix sideloading EXEs without initial SP value 2024-08-11 23:50:37 +10:00
Stenzek
c3bf267936
System: Remove redundant remap 2024-08-04 21:03:39 +10:00
Stenzek
02fbfae6a0
System: Add advanced 'Export Shared Memory' option
Memory map is exported as duckstation_<pid>. Previously, this only
worked on Windows, now it is extended to Linux as well.
2024-08-04 20:28:07 +10:00
Stenzek
3a83c4265c
Misc: Fix a bunch of code analysis warnings
Some of which were even actual errors.
2024-08-02 23:56:07 +10:00
Stenzek
6fe0c986fa
System: Rewrite EXE override/loading
Relies on POST=7 as a kernel initialization indicator, instead of
patching the BIOS.

Fixes EXE loading with OpenBIOS and PS2 BIOS, and fast boot getting
baked into save states.
2024-07-28 19:05:56 +10:00
Stenzek
0b5287f199
Bus: Implement RAM_SIZE register
Fixes Rock-Climbing - Mitouhou e no Chousen - Alps Hen (Japan) crashing
on boot. Silly game does a 512 word DMA from CDROM to 0x001FFF04, with the
mapped memory size set to 4MB, expecting the DMA to trigger a bus error,
because if it doesn't, then your kernel memory goes bye bye.

A bunch of other games do set the upper 4MB to be unmapped, but this
change appears to have no effect on them. As expected, they're probably
doing the correct thing.
2024-07-24 00:14:17 +10:00
Stenzek
dce1221021
Bus: Log when RAM_SIZE changes 2024-07-23 23:00:44 +10:00
Stenzek
2e96931c32
CPU/CodeCache: Dynamically compute BIOS memory access timing
The timings can change if the game does so. Instead of forcing the
blocks to recompile, we can just manually multiply size * word_time.

Improves stability of Nightmare Creatures booting, and fixes corrupted
text in Formula Circus when using the cached interpreter.
2024-07-19 22:25:57 +10:00
Stenzek
19063d4288
Bus: Mirror BIOS area up to 4MB
Fixes bus error when using PS2 BIOS.
2024-07-19 15:51:25 +10:00
Stenzek
8ef73203b2
Bus: Ignore SPU byte writes to unaligned addresses 2024-05-31 21:00:55 +10:00
Stenzek
723af4de3a
Misc: Loading old save state versions is unlikely 2024-05-31 18:48:26 +10:00
Stenzek
1565a2667d
Misc: More format string fixes 2024-05-25 15:48:31 +10:00
Stenzek
4e922a34a7
Log: Simplify macros 2024-05-24 02:08:14 +10:00
Stenzek
792717e03e
Misc: Get rid of format string for result logging 2024-05-24 00:30:06 +10:00
Stenzek
b6d019db66
Misc: Replace log printf calls with fmt 2024-05-24 00:29:49 +10:00
Stenzek
fa104acdd1
Misc: Purge unused code and report startup error to host 2024-05-05 22:29:26 +10:00
Stenzek
ca3cfbaa99
Misc: Pass string_view by value 2024-05-05 22:28:29 +10:00
Stenzek
d1a1cab9a9
Bus: Direct KUSEG+KSEG0 isolated cache reads to ICache 2024-03-13 14:14:40 +10:00
Stenzek
c1381cfda6
System: Gracefully handle memory allocaion failure 2024-02-25 20:30:41 +10:00
Stenzek
3dfc3bd2ba
CPU: Fix incorrect scratchpad masking 2023-11-06 18:09:27 +10:00
Stenzek
23dff0a9b6
Bus: Properly set unmapped pages to NULL for LUT fastmem 2023-10-21 13:49:35 +10:00
Stenzek
c179473c2b
Bus: Allow LUT fastmem on mirrors 2023-10-18 00:49:01 +10:00
Stenzek
9d40164f84
CPU/Recompiler: Offset LUT fastmem pointers 2023-10-18 00:49:01 +10:00
Stenzek
a062b00c1a
Bus: Protect main RAM buffer
Get rid of write-time checks.
2023-10-18 00:49:01 +10:00
Stenzek
7625d4769c Bus: Keep old behavior of memory being readable when Isc
Some games (e.g. Parasite Eve) write to cache control with Isc on.
Need some hardware tests here.
2023-10-06 22:57:54 +10:00
Stenzek
6fd7eda68f Misc: Fix build on Debian Bullseye 2023-10-02 23:50:56 +10:00
Stenzek
a96111eaeb Misc: Swap make_array() for size deduction 2023-10-02 13:33:33 +10:00
Stenzek
56fc207af6 CPU: Use lookup tables for memory access 2023-10-01 20:48:02 +10:00
Stenzek
dd204d116e CPU: Warning fix 2023-10-01 13:20:14 +10:00