Commit Graph

95 Commits

Author SHA1 Message Date
Flyinghead fe429ec01e move holly interrupts out of types.h 2023-12-16 23:04:39 +01:00
Flyinghead 2a364dee67 dynarec: check null codeBuffer in rewrite() if called before init
Fixes MINIDUMP-1VN, MINIDUMP-1X1, MINIDUMP-1XD
2023-10-13 11:41:18 +02:00
Flyinghead 60f3d718ac arm64 rec: fix crash with some naomi games (regression)
Fixes crash with doa2a and doa2m and some atomiswave conversions.
Regression due to b47f4f56ef
Fixes MINIDUMP-1TY, MINIDUMP-1TD, MINIDUMP-16Q, MINIDUMP-1AC
2023-10-01 19:31:18 +02:00
Flyinghead 2445739c0e arm,arm64 rec: check fault location before attempting to rewrite
Ignore fault if pc isn't in the dynarec code buffer.

Fix for MINIDUMP-1S0, MINIDUMP-1RS
2023-09-20 17:25:09 +02:00
Flyinghead 0f4c903fed ios build fix 2023-09-12 19:06:59 +02:00
Flyinghead 0ac483acfc sh4 dynarec refactoring
sh4 code buffer class
dynarec interface and implementations
2023-09-12 16:52:25 +02:00
scribam 40953b17c4 uwp: add support for arm64 2023-07-30 18:03:32 +02:00
scribam daf8230cca deps: update vixl 2023-07-03 11:37:42 +02:00
Flyinghead ac2637286b Merge remote-tracking branch 'origin/master' into dev 2023-05-13 15:55:47 +02:00
Flyinghead c8a45d95a7 dynarec: fix mov64 edge case when registers must be swapped
Handle case where mov64 must swap its operands depending on register
allocation.
Fix canonical call for FSCA when return operands are register-allocated.

Issue #1020
2023-04-24 17:38:49 +02:00
Flyinghead 0b1f69bfd2 dynarec: more accurate cycle counting. limit code duplication
arm, arm64, x86: only account for current block cycles if block is
executed. Test cycle_counter before updating it.
arm, arm64: use function for mmu block check (vaddr and FPU ops) to
reduce host code size per block.
2023-03-08 19:24:49 +01:00
Flyinghead 5bfbcb210c dynarec: refactor imm mem r/w and store queue handlers. clean up mmu
Eliminate duplicate code for immediate memory read/write in all dynarecs
Simplify PREF to use do_sqw_nommu even for simple SQ remap
Check for address errors before mmu translation
Get rid of unneeded template params in mmu translation funcs
2023-02-18 13:33:38 +01:00
scribam d8137a967c
C++17 (#926)
* cmake: use c++17

* Use std::size

* Use std::make_unique

* Use std::clamp

* Use structured binding

* Use [[fallthrough]]

* Use enable_if_t/is_enum_v/is_integral_v/is_same_v

* Use if constexpr

* Use try_emplace

* Use auto for iterators

* Use inline variables
2023-02-18 13:24:34 +01:00
Flyinghead 53dab29ddb iOS and Switch build fixes 2023-01-30 11:10:14 +01:00
Flyinghead 143073b61d rename _vmem to addrspace and move platform vmem stuff to virtmem ns
use namespaces
simplify names
no functional changes
2023-01-29 18:48:33 +01:00
Flyinghead 1149d499a8 x86: windows ce support in dynarec
clean up some unused methods and return values
2023-01-28 19:22:36 +01:00
Flyinghead 06c5ba7f0e sh4: simplify exceptions 2023-01-11 20:42:33 +01:00
Flyinghead c04c696ba6 arm64 dynarec: pad link section with nop to allow full mmu relink
fix literal pool being overwritten
Fix for MINIDUMP-18
2023-01-05 14:36:23 +01:00
Flyinghead 9ef37d9776 arm[64] dynarec: xtrct can have immediate operands
Fixes MINIDUMP-15
Sakura Taisen 2 crash
2023-01-03 15:15:13 +01:00
Flyinghead 62085539a7 dynarec: reg alloc 64-bit regs. avoid some interpreter fallbacks
Option to reg alloc 64-bit regs in two host regs. Used when FPSCR.SZ ==
1 (64-bit reg and memory transfers.) Enabled for arm, arm64 and x64
(windows only) dynarecs.
Don't fallback to interpreter when FPSCR.PR==1 (double precision) for
FMOV, FLDS and FLTS.
2022-12-23 16:06:54 +01:00
Flyinghead 599bc8a823 arm64 dynarec: need up to 5 ops for mem accesses
Issue #837
2022-12-22 14:55:42 +01:00
Flyinghead 2800927fa1 arm64 dynarec: can't rely on faultAddress with 512 MB vmem
Use x0 instead
2022-12-16 20:40:23 +01:00
Flyinghead 32e3e7d9c5 vmem: no more 4GB vmem mode. only map elan RAM in naomi2 mode
Do not attempt to reserve 4GM of virtual space on 64-bit hosts. Use
512MB everywhere.
Don't map elan RAM if not needed and dont protect/unprotect it in
memwatch.
2022-12-09 17:37:49 +01:00
scribam f6532ca27a fix some warnings 2022-11-19 12:52:26 +01:00
Flyinghead bc3be1029c fix sh4 scheduler. use common cycle counter in sh4 context
scheduler reset and unregister
schedule requests during reset(), not init()
preserve cntx.sh4_sched_next on sh4 reset
Use cntx.cycle_counter in dynarecs and interpreter
Fixes Confidential Mission hang at boot with HLE
2021-10-07 16:18:32 +02:00
Flyinghead 77e7c25e9c iOS support. Work in progress 2021-08-06 10:30:30 +02:00
Flyinghead 6bb4575c95 Merge remote-tracking branch 'origin/master' into libretro 2021-08-05 18:17:30 +02:00
Flyinghead 9d6c548730 naomi: close cart on reset. sh4: replace some verify by throw
Close naomi/aw cart on reset. Reset input mapping/button names
Get rid of ngen_GetFeatures()
throw exception instead of failing verify if not internal error
catch sh4 exceptions in dynarecs and throw fatal error
2021-08-03 09:47:13 +02:00
Flyinghead 7561ce753a unwind info for arm64. use static c++ lib for android
include oboe static libs
get rid of old regalloc
2021-07-29 17:46:46 +02:00
vkedwardli 3c483c61e7
Support Apple Silicon (macOS ARM Universal Binary) (#253)
* Add audio arm64 cpp into Xcode project

* Build universal binary for SDL2 also

* Add vixl aarch64 dependency + build arm64 in cmake

* hardcode pagesize for M1 CPU

* Use `MAP_JIT` and toggle between RX and RW

* add pthread.h for cmake

* Disable audio dynarec temporary

* Enable aica arm dynarec

* Supports `br` with condition

* Dynamic linker flag for libSDL2.a since Homebrew path is different on arm (for xcodeproj)

* Fallback path for Intel

* de-dup for arm64, allow cross compilation on both Intel and Apple Silicon Mac

* Rename WriteProtect() to JITWriteProtect(), Move JITWriteProtect from arm7_rec to arm7_rec_arm64

* Remove CodeCache memset

* Remove keyboard_device.cpp from xcodeproj

* Use hard tab

* Update libchdr to support compiling on M1 (thanks @scribam)
2021-07-23 22:34:12 +02:00
Flyinghead de060d66ab don't save flash if no game started. libretro: fix notifications
compilation warnings, non-functional changes
2021-07-20 19:21:11 +02:00
Flyinghead 8dee648d01 arm64 rec: put ngen_FailedToFindBlock at a fixed address
transitioning to MMU will fail it this function's address changes
happens if vmem is disabled (switch)
2021-07-14 21:03:02 +02:00
scribam d6545b253b Misc cleanup 2021-06-06 11:15:06 +02:00
Flyinghead 373dffc65a wince: ditch vmem32. use address LUT in dynarec. finer grained flush 2021-05-17 11:59:34 +02:00
Flyinghead 025b447a9c arm32: replace old arm emitter with vixl 2021-05-15 11:41:00 +02:00
Flyinghead 1464c02903 mmu: add address cache to mem slow path. better fastmmu hashtable.
mmu: add address cache to Read/WriteMemNoEx
fastmmu: ignore 1k pages. optimize hashtable
get rid of NO_MMU
2021-05-14 19:03:57 +02:00
Flyinghead e2f309b5cc arm64: store queue write dynarec optimization 2021-03-29 14:26:55 +02:00
Flyinghead 5e619a70d4 arm64: fix crash with HLE bios. Set nav bar to tranparent (android 10)
arm64 dynarec main loop and handlers were generated twice
Fix nav bar background leftover on android 10
2021-03-14 17:54:57 +01:00
C.W. Betts 3c8a2f2372 Don't compile rec_arm64 on non ARM64 machines.
Include header in posix_vmem that makes calls to sys_cache_control compile on Mac ARM64.

Replaces flyinghead#184
2021-03-03 00:57:53 -07:00
Flyinghead 424736961b arm64: get rid of inline assembler 2021-03-02 20:35:59 +01:00
Flyinghead 0c8815549c Merge branch 'fh/x64-arm-jit'
# Conflicts:
#	core/hw/aica/aica.cpp
#	core/nullDC.cpp
2021-03-02 19:42:15 +01:00
Flyinghead bbcfc8354a arm64: dynarec crash with wince games using temp blocks
Issue #185
2021-02-25 10:50:31 +01:00
Flyinghead 8e22116a17 arm64 rec: get rid of setjmp() 2021-01-31 11:55:22 +01:00
Flyinghead 80782475da x64 rec: get rid of setjmp. standardize ngen_Rewrite/HandleException
move rewrite code from exception handlers to x86/x64 dynarecs
use same host context info on linux/win
x64: stack alignment issue in mem handlers
2021-01-30 16:14:44 +01:00
Flyinghead 882e14f13f aica: x64 jit for arm
aica arm x86: use pc-relative addressing to access arm registers

OSX project fix

arm7: add simple ldm/stm handling. optimize arm32 and x64 recs

update CMakeLists.txt and Makefile. finish rebase
2021-01-26 21:32:43 +01:00
flyinghead c344903a23 new x86 dynarec. Enable for android
refactor common code between x64 and x86 dynarecs.
x86 rewrite based on the x64 one
some discarded dyna blocks weren't fully unlinked
2021-01-26 13:16:48 +01:00
flyinghead e5b3c5268b wince: attempt immediate read/write when address isn't translated 2021-01-07 19:18:53 +01:00
Flyinghead 2c54dfd132 arm64: check CpuRunning at end of each timeslice. clean up
fixes hang when exiting service menu in kofnw
2020-04-24 19:56:38 +02:00
scribam e99aac3575 Remove "using namespace std;" 2020-03-30 23:00:43 +02:00
Flyinghead 4fa18dbaea arm64: fix xtrct dynarec implementation
Fixes Speed Devils issues
2020-01-09 13:25:31 +01:00