Commit Graph

79 Commits

Author SHA1 Message Date
Xphalnos 240be07bbb Misc: Remove Duplicated Semicolons 2025-04-10 11:30:33 +02:00
Flyinghead b70c2791b2 dynarec: proper ftrc implem. (arm32/64) Use double for fipr/ftrv
Use double for canonical FIPR and FTRV on all platforms.
Fix interpreter implementation of FTRC.
Fix canonical implementation of cvt_f2i (FTRC).
arm32: use Vfma instead of Vmla for FMAC. Vfma does not a fused
muliply-add, Vmla doesn't.
arm32: Use canonical implementations of FIPR and FTRV.
arm32,arm64: Correct implemetation of cvt_f2i (FTRC)

Fixes desync with NBA 2k1/2k2 online games.
2025-01-27 17:30:06 +01:00
Flyinghead 76638df001 sh4: split xffr array. Fix FPCB_PAD on windows
Split xffr[32] into xf[16] and fr[16].
Set FPCB_PAD size to 64_KB. Issue #1736
Get rid of shil_param::reg_aofs
2024-11-13 10:31:45 +01:00
Flyinghead 129673a84b dynarec: use sh4 ctx to get register pointers. prefer offset
Move restoreHostRoundingMode() into Sh4Context
2024-11-09 18:44:51 +01:00
Flyinghead 7c1c5817d3 sh4: move sqWrite func into sh4 context. Simplify usage
Allow passing sh4 context to dynarec canonical implementations
Reduce FPCB padding to PAGE_SIZE except on arm32
2024-11-09 16:54:47 +01:00
Flyinghead e394840344 sh4: pass sh4 context to dynarecs, sh4cycles and caches
Reorder RuntimeBlockInfo members to save space
2024-11-09 13:25:55 +01:00
Flyinghead db846ca933 sh4: pass context to interpreter funcs. get rid of sh4 regs #define 2024-11-08 18:36:08 +01:00
Flyinghead 52df0133f0 sh4: pass sh4 context to sq write handlers 2024-11-06 23:27:20 +01:00
Flyinghead d5aeb482d9 sh4: move sq_buffer into sh4 context 2024-11-06 22:11:27 +01:00
Flyinghead 7eec648690 sh4: move Sh4RegType & GetRegPtr into sh4/dyna
rec-arm: use getRegOffset/reg_nofs instead of GetRegPtr
2024-11-06 20:46:32 +01:00
Flyinghead 9793e54646 avoid deadlock when sh4 cpu is restarted while emu is being stopped
The sh4 cpu is stopped/restarted during a soft reset, and dynarec code
reset (arm64, arm, x86). If the emulator is stopped concurrently, the
call may hang. Use a mutex-protected method to restart the cpu only if
the emu is still running.
2024-10-12 17:31:58 +02:00
Flyinghead b99b3450c8 sh4: compute fsrra as 1/sqrt(x) instead of sqrt(1/x)
Fixes invisible chaos emerald in Sonic Adventure cutscene after Emerald
Coast.
Partial revert of ec3ad9b.
Issue #1600
2024-08-20 21:12:05 +02:00
Flyinghead ec3ad9b328 sh4: use double for fipr and ftrv. divide before sqrt for fsrra. ssa fix
dynarec: use double to implement fipr and ftrv except on arm32
interpreter: always use double for fipr and ftrv
fsrra: perform division before square root
fmac: use std::fma or native fma op
get rid of unused dynarec op shop_swap
ssa: dead register pass must assume interpreter fallback modifies all
registers
ssa: replace reg+0 address by reg in constant propagation pass
decoder: replace address offset 0 by null param for indexed mem access
2024-06-12 10:54:15 +02:00
Flyinghead 6115a918b2 arm dynarec: apply mask to mem write8 and write16 value operand
Compilers do not cast the operand, which results in u8 handlers being
called with an u32 value.
2024-03-14 13:21:10 +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 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 0ac483acfc sh4 dynarec refactoring
sh4 code buffer class
dynarec interface and implementations
2023-09-12 16:52:25 +02:00
scribam 56b082def7 uwp: add support for arm 2023-08-02 09:32:55 +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
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 2420c05930 android: implement unwind info for arm32 2023-01-17 22:06:22 +01:00
Flyinghead 36e67203a4 Merge remote-tracking branch 'origin/master' into dev
# Conflicts:
#	core/deps/oboe
#	core/emulator.cpp
#	core/hw/maple/maple_jvs.cpp
#	core/rend/gui.cpp
2023-01-17 21:20:14 +01:00
Flyinghead 1c4303b76d arm dynarec: verify is no longer true
Fix for MINIDUMP-37
2023-01-14 10:29:44 +01:00
Flyinghead 06c5ba7f0e sh4: simplify exceptions 2023-01-11 20:42:33 +01:00
Flyinghead 8cd6a94e26 arm dynarec: avoid SIGBUS errors due to unaligned memory access
VSTR and VLDR require a 32-bit alignment in armv7. SH4 alignment
requirement is identical but ignored (no SH4 address error is raised).
So instead of crashing, just align the memory address.

Fix for MINIDUMP-1J
2023-01-08 11:13:01 +01:00
Flyinghead 756ec0e672 arm build fix 2023-01-04 12:27:04 +01:00
Flyinghead 3dfdb60139 arm dynarec: handle immediate operand to fsca 2023-01-04 12:12:24 +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 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 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 b59585437c arm32 dynarec: windows ce support 2021-08-01 17:25:48 +02:00
Flyinghead 025b447a9c arm32: replace old arm emitter with vixl 2021-05-15 11:41:00 +02:00
Flyinghead 904bed862e arm32: store queue dynarec optim. ditch Unstable Optimizations
shrink Sh4Context.pad size except on arm32
reset sh4 before mem to unlock ram
2021-03-29 14:26:55 +02:00
Flyinghead ed25d45adb arm32 rec: wrong operand size for immediate mem write
Issue #208
2021-03-29 14:20:42 +02:00
Flyinghead 6b11674949 use aligned struct for sqbuffers and sh4 context
serialize YUV_index
remove bogus arm32 TAWriteSQ implementation
2021-03-23 16:07:53 +01:00
Flyinghead d8a25e73f2 cmake fixes. makefile clean up. load gles3 driver with sdl
add FindSDL2.cmake and don't provide wrong hint
cmake: option to disable vulkan
don't use/link with egl if using sdl
remove ARM_HARDFP and use standard __ARM_PCS_VFP #def
hide texture upscaling options if no openmp
2021-03-21 18:03:22 +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 c3a95594f9 New option system
Fix per-game settings (Issue #115)
Automatic load/save state (Issue #173)
Reload Naomi/AW BIOS after per-game settings are loaded to allow
per-game BIOS region. (Issue #96)
Restrict Soul Reaver widescreen cheat to the EU version (Issue #188)
Disable UI elements for overridden settings
Clean up/simplify legacy Naomi ROM loading
2021-03-01 10:13:40 +01:00
Flyinghead a920ae5901 aica: fix race conditions between sh4/arm
Fix sound issue in Test Drive Le Mans and Looney Tunes
2021-02-14 19:19:57 +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 063c7f7d18 arm32: support for 64b immediate memory reads
fixes Mazan
2020-10-10 17:23:00 +02:00
Flyinghead 18790901b1 arm: use canonical div32p2 2020-06-06 22:37:28 +02:00
Flyinghead 34575d577c fix sdl+egl build. get rid of USES_HOMEDIR. thread deadlock at exit
fix odroid xu3 build
sdl: use left or right alt+enter to maximize window
deadlock at exit if dc_exit called from emu thread
2020-05-08 18:41:36 +02:00