51 Commits

Author SHA1 Message Date
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
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
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
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
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
79e1ae3e54
CPU/CodeCache: Rewrite using new-rec's block management 2023-10-18 00:49:01 +10:00
Stenzek
da1c28bd16 Misc: Fix arm32 build 2023-10-02 23:59:01 +10:00
Stenzek
56fc207af6 CPU: Use lookup tables for memory access 2023-10-01 20:48:02 +10:00
Stenzek
3c68543491 Bus: 16KB page compatibility for mmap fastmem 2023-09-23 14:14:52 +10:00
Stenzek
c25c7070b6 Bus: Make variable prefixes consistent 2023-09-20 21:38:38 +10:00
Stenzek
68b59ee748 CMake: Swap USE_ and WITH_ for ENABLE_
Consistency.
2023-09-17 12:36:52 +10:00
Stenzek
199c53f3af BIOS: Replace TTY patch with syscall hook 2023-08-30 00:44:01 +10:00
Stenzek
1fcf16fc81 System: Store BIOS image info/hash after loading 2023-03-16 19:22:54 +10:00
Connor McLaughlin
8c7a192128 Misc: Add copyright/license statement to applicable files
Should've did this in the beginning.
2022-12-04 21:03:49 +10:00
Connor McLaughlin
b7fbde31a7 Move utility classes from common to own static lib 2022-07-21 17:29:58 +10:00
Connor McLaughlin
e382df0d41 Support expanding RAM to 8MB (dev console) 2021-05-03 12:43:33 +10:00
Connor McLaughlin
922d320523 CPU/Recompiler: Reserve whole fastmem region to avoid clashes 2021-04-11 12:42:51 +10:00
Connor McLaughlin
475f7ccd1f Bus: Increase the number of ticks for RAM reads 2021-03-02 00:46:29 +10:00
Connor McLaughlin
9fd1d606d7 Bus: Add memory region access helpers 2020-12-17 11:57:46 +10:00
Connor McLaughlin
bf2e38aed5 CPU/Recompiler: Implement LUT-based fastmem 2020-11-24 14:49:21 +10:00
Connor McLaughlin
a03bca2f72 CPU: Make fastmem a compile-time feature (support 32-bit targets) 2020-11-21 18:39:03 +10:00
Albert Liu
f3522b7b70 Bus: Stub out EXP3 and unknown EXP accesses 2020-11-09 09:02:00 -08:00
Connor McLaughlin
b704c37e91 CPU/Recompiler: Implement speculative constants 2020-10-18 14:54:38 +10:00
Connor McLaughlin
7566c45f64 CPU/Recompiler: Implement fastmem 2020-10-18 14:54:38 +10:00
Connor McLaughlin
a6f8dde790 CPU/Recompiler: Faster ASM dispatcher 2020-10-18 14:54:38 +10:00
Connor McLaughlin
19d6037b99 CPU: Implement instruction cache simulation
Implemented for all execution modes. Disabled by default in the cached
interpreter and recompiler, always enabled in the pure interpreter.
2020-08-29 22:07:40 +10:00
Connor McLaughlin
b6f871d2b9
JIT optimizations and refactoring (#675)
* CPU/Recompiler: Use rel32 call where possible for no-args

* JitCodeBuffer: Support using preallocated buffer

* CPU/Recompiler/AArch64: Use bl instead of blr for short branches

* CPU/CodeCache: Allocate recompiler buffer in program space

This means we don't need 64-bit moves for every call out of the
recompiler.

* GTE: Don't store as u16 and load as u32

* CPU/Recompiler: Add methods to emit global load/stores

* GTE: Convert class to namespace

* CPU/Recompiler: Call GTE functions directly

* Settings: Turn into a global variable

* GPU: Replace local pointers with global

* InterruptController: Turn into a global pointer

* System: Replace local pointers with global

* Timers: Turn into a global instance

* DMA: Turn into a global instance

* SPU: Turn into a global instance

* CDROM: Turn into a global instance

* MDEC: Turn into a global instance

* Pad: Turn into a global instance

* SIO: Turn into a global instance

* CDROM: Move audio FIFO to the heap

* CPU/Recompiler: Drop ASMFunctions

No longer needed since we have code in the same 4GB window.

* CPUCodeCache: Turn class into namespace

* Bus: Local pointer -> global pointers

* CPU: Turn class into namespace

* Bus: Turn into namespace

* GTE: Store registers in CPU state struct

Allows relative addressing on ARM.

* CPU/Recompiler: Align code storage to page size

* CPU/Recompiler: Fix relative branches on A64

* HostInterface: Local references to global

* System: Turn into a namespace, move events out

* Add guard pages

* Android: Fix build
2020-07-31 17:09:18 +10:00
Connor McLaughlin
401ecfa872 Bus: Make memory map public 2020-07-18 00:28:37 +10:00
Connor McLaughlin
57cf40d1ae Bus: Work around VS2017 bug with std::array 2020-07-08 12:45:53 +10:00
Connor McLaughlin
69a00a64e6 Bus: Adjust memory access and MMIO timing
Hasn't broken anything yet, but needs more thorough testing.
2020-05-30 02:19:12 +10:00
Connor McLaughlin
11c2b5a1e8 Bus: Extend SPU address range to 0x400 bytes 2020-05-20 18:57:33 +10:00
Connor McLaughlin
07e8ddcae2 DMA: Elide intermediate copy where possible
Easy 5% performance improvement.
2020-04-29 16:52:11 +10:00
Connor McLaughlin
71c1e243fe Remove YBaseLib dependency 2020-01-10 13:40:53 +10:00
Connor McLaughlin
315f2b701a Stub out SIO controller
Fixes WipEout booting.
2019-12-07 21:09:04 +10:00
Connor McLaughlin
f11d357ab9 Compile fixes for Android 2019-11-28 01:55:33 +10:00
Connor McLaughlin
aec01d3890 Bus: Reduce RAM write delay 2019-11-27 00:01:47 +10:00
Connor McLaughlin
1d6c4a3af1 CPU: Basic recompiler implementation for x64 (lui, ori, addiu)
Disabled by default.
2019-11-19 20:38:05 +10:00
Connor McLaughlin
19062e11b5 Revert "Bus: Relax memory timing"
This reverts commit b5c799ba811e7345f92bd3e9a076304df756a3d9.
2019-11-17 22:11:16 +10:00
Connor McLaughlin
b5c799ba81 Bus: Relax memory timing
Formulas from Mednafen.
2019-11-17 01:47:46 +10:00
Connor McLaughlin
246c97ccb3 System: Scaffolding for multi-system/multi-bios 2019-11-16 20:50:59 +10:00
Connor McLaughlin
6f4cf7d5e3 System: Support changing BIOS path 2019-11-11 19:43:39 +10:00
Connor McLaughlin
9b56499afa Refactoring settings/support changing GPU renderer at runtime 2019-10-26 12:55:56 +10:00
Connor McLaughlin
a76ec6fc19 Compile fixes for GCC 2019-10-22 23:07:51 +10:00
Connor McLaughlin
ec8c5d4bb6 DMA: Batch multi-word transfers together 2019-10-13 16:48:11 +10:00
Connor McLaughlin
4422fb0545 CPU: Memory access timings 2019-10-04 20:30:54 +10:00
Connor McLaughlin
fd1c4f1457 Bus: Calculation of memory timings for external devices 2019-10-04 19:41:18 +10:00