Commit Graph

28 Commits

Author SHA1 Message Date
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 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 db846ca933 sh4: pass context to interpreter funcs. get rid of sh4 regs #define 2024-11-08 18:36:08 +01:00
Flyinghead 897e06b887 sh4: refactor GetDR/SetDR and access to fp registers 2024-11-06 19:26:04 +01: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 e70a0dcf3d sh4_fpu clean up. tests 2023-02-01 13:53:32 +01:00
Flyinghead decf70c87c get rid of INLINE, NOINLINE, __forceinline 2022-10-22 22:14:19 +02:00
scribam d6545b253b Misc cleanup 2021-06-06 11:15:06 +02:00
Flyinghead 025b447a9c arm32: replace old arm emitter with vixl 2021-05-15 11:41:00 +02:00
Flyinghead 5227259048 No more fast-math on x86/x64. Yet another FTRC fix
Don't compile with -ffast-math
Fix FTRC to return 0x80000000 for NaN
-> fixes Arcade Racing Legend sound problems and disappearing cars
Remove unsupported GCW0 platform
Remove unused android makefiles
2021-03-11 12:27:00 +01:00
Flyinghead 74aae115ee sh4: implement C and WT MMU bits in cache. Use mem handlers everywhere
o/icache use C and WT bits from mmu to override cache and copy back
settings (fixes Windows CE)
move mem handlers setup out of mmu into sh4_mem. Call in dc_resume and
detect transitions interp -> dynarec to flush caches.
fix ssa tlb miss exception wih slow mmu
2020-06-24 15:23:47 +02:00
Flyinghead 22dcb1ec99 sh4 ocache implementation. IC and OC address/data read/write in P4
ignore SR.RB in user mode instead of forcing it 0
add STRICT_MODE to enable ocache in interpreter
don't flush mmu table when enabling it
fix fixNan64()
2020-06-12 17:35:14 +02:00
scribam e99aac3575 Remove "using namespace std;" 2020-03-30 23:00:43 +02:00
Flyinghead 12b9b7254a reduce precision of FIPR and FTRV sh4 ops on x86 platforms 2019-12-17 20:23:58 +01:00
Flyinghead 530cdaa23f use doubles to emulate FIPR on x86. avoid crash with per-game config
Don't store the renderer type in per-game config as this crashes.
Fixes Sonic Adventure falling off track
Other non-functional changes
2019-12-13 12:27:43 +01:00
scribam 49b7e0682b Cleanup 2019-09-07 20:36:13 +02:00
Flyinghead 35cd1fcf14 sh4: use new logging 2019-07-01 15:22:04 +02:00
Flyinghead c809c6c56f Merge branch 'fh/mymaster' into fh/master-merge 2019-03-25 16:47:47 +01:00
Flyinghead 6305df9dab ignore fldi0/fldi1 in double precision instead of dying 2019-03-13 17:19:41 +01:00
Flyinghead f419786584 Fix sh4 FTRC op to use correct positive cutoff value.
Fix for interpreter, common dynarec and x86 rec.

Fixes wrong car color in Tokyo Xtreme Racer car selection screen.
2018-10-02 12:38:49 +02:00
Flyinghead f13b366e8d Set the value for NaN according to the SH4 specs
The SH4 sets the signaling bit to 0 for qNaN: 7fbfffff instead of the
usual 7fffffff. Same games seem to rely on this.
Fixes Fur Fighters freeze and missing geometry in game.
2018-07-13 18:57:51 +02:00
Flyinghead ea35eeb728 Fix FTRC op in both interpreter and dynarec with respect to Inf and NaN
The -ffast-math gcc option implies the -ffinite-math-only option, which
produces wrong results with Inf and NaN. Use integer math to detect the
sign of float numbers in FTRC to avoid these issues.
Also the upper cut off value for conversion was apparently wrong.
Also fixed the x86 dynarec but not tested.
Fixes wrong car color in Tokyo Xtreme Racer car selection screen.
2018-07-13 12:02:32 +02:00
twinaphex b606593774 ftrc fix - revert back to nulldc defaults 2016-05-13 14:44:53 +02:00
Stefanos Kornilios Mitsis Poiitidis 4a060b5635 sh4/mmu: C++ exception based sh4 exception support. Won't run wince yet.
- Rewrite mem ops to only modify regs after exception path
- Throw & catch logic for interpreter that raises the exception
- Re-enabled some commented mmu code
2015-09-29 03:11:28 +02:00
Stefanos Kornilios Mitsis Poiitidis f5d29677b3 Merge branch 'androidui'
Conflicts:
	core/hw/pvr/spg.cpp
	core/hw/sh4/interpr/sh4_interpreter.cpp
	reicast/android/src/com/reicast/emulator/MainActivity.java
2013-12-28 22:28:50 +01:00
Stefanos Kornilios Mitsis Poiitidis 7ef9de3cae Moving code around, cleanups 2013-12-28 22:20:08 +01:00