Commit Graph

466 Commits

Author SHA1 Message Date
Flyinghead 6ea61b9084 android: support 4KB and 16KB page sizes on 64-bit platforms 2025-07-06 22:16:06 +02:00
Isaac Marovitz af043c55cd
CMake Refactors (#1979)
Signed-off-by: Isaac Marovitz <isaacryu@icloud.com>
2025-06-24 16:33:12 +02:00
Flyinghead 04999d8969 sh4: fix wince api trace calls 2025-06-21 10:25:52 +02:00
Flyinghead 26b8684e78 serial: don't depend on SerialPTY option on windows
On windows, open serial console window when config::SerialConsole is
enabled. Ignore config::SerialPTY.
2025-06-21 10:23:22 +02:00
Flyinghead 8801b2ae16 haptic: add sine effect. implement spring for midi FFB
Add sine effect to haptic api and stop using maple rumble for naomi FFB.
Emulate spring in midi FFB. Thanks to njz3 for his help on decoding the
protocol.
Don't use exponential scale for rumble when using haptic sine effect.

serialize Sh4OCache::writeBack/ThroughBufferCycles
2025-06-16 17:50:36 +02:00
Isaac Marovitz 5a110fd666
Replace sprintf with snprintf (#1884)
Signed-off-by: Isaac Marovitz <isaacryu@icloud.com>
2025-03-25 18:47:07 +01:00
Flyinghead d84108de32 maple: yet another maple timing change
Use 2 Mb/s for console and 740 Kb/s for devices.
Fixes Silent Scope vmu load issue at boot. Issue #1796
D+Vine has issues detecting A and B presses with one controller
connected but it does work eventually. No issue with more than 1
controller. Issue #1279
Power Drift only boots with one controller connected. Crashes with 2 or
more.
2025-01-28 17:26:22 +01:00
Flyinghead 1513c6cab8 msvc build fix 2025-01-27 17:47:22 +01: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 ecd0305a60 fix build without dynarec 2024-12-14 19:43:32 +01:00
Flyinghead 667e3906d8 sh4: work around previous SCIF issues when loading a state
Force SCIF_SCBRR2 to 8 bits when loading a state.
See e03e11b8a9 and
6115a918b2.
2024-12-14 19:13:05 +01:00
Flyinghead f5389bcd0b battle cable: notify user when data first received from peer
Document SCIF register bits.
2024-12-11 11:04:44 +01:00
Flyinghead bb1b1059d4 sh4: SCIF DR bit can't be reset if rx fifo isn't empty
Fixes manic panic periodic touchscreen errors.
2024-12-11 10:37:48 +01:00
Flyinghead e4599e36ed Merge remote-tracking branch 'origin/master' into dev 2024-12-08 10:47:31 +01:00
Flyinghead 15617c1816 ssa: fix regression
due to fff03f64a3
Issue #1773
2024-12-08 10:40:44 +01:00
Flyinghead 354d649ebd Merge remote-tracking branch 'origin/master' into dev 2024-12-07 20:38:55 +01:00
Johan Mattsson fff03f64a3
ssa: Fix wrong opcode comparison (#1769)
* ssa: Fix wrong opcode comparison

* ssa: handle 32 bits shift case first (shld, shad)

---------

Co-authored-by: flyinghead <flyinghead@users.noreply.github.com>
2024-12-07 18:59:14 +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 2b28e819e5 sh4: build fix. rounding mode refactoring 2024-11-08 21:34:24 +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 93ae9d0375 sh4: refactor interpreter and recompiler with Sh4Executor interface 2024-11-07 18:14:18 +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 897e06b887 sh4: refactor GetDR/SetDR and access to fp registers 2024-11-06 19:26:04 +01:00
Flyinghead aa38771cd0 refactor sh4_sr_GetFull/sh4_sr_SetFull 2024-11-06 18:01:01 +01:00
Flyinghead cd8a88366d get rid of TARGET_NO_EXCEPTIONS 2024-11-06 16:59:16 +01:00
Flyinghead 4baf529ff7 race condition when stopping emu thread right after start
In threaded rendering, CpuRunning is set after the emu thread is
started. If calling Emulator::stop() before it is set, the call will
hang.
2024-09-23 17:43:23 +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 d92790e69f sh4: incorrect div1 implementation if Rn == Rm 2024-06-20 18:12:11 +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 de6a43bd21 savestate: drop support for legacy libretro and <v16 savestates 2024-04-16 09:40:55 +02:00
Flyinghead 06a6e26588 get rid of os_GetSeconds()
replace it with std::chrono-based getTimeMs()
2024-04-11 15:25:25 +02:00
Flyinghead 391da7023f sh4: fix SCIF serialization
Fixes MINIDUMP-2M0
Add some diag logging to win_vmem
2024-03-04 17:02:42 +01:00
Flyinghead 156aafe95b sh4: fix P4 region mapping and on chip ram addressing
P4 region is normally mapped outside of the sq and system registers
areas (E4-EF, F8-FE).
Fixes NHL 2K2 missing helmet and jersey textures. Issue #1416
Fixes invalid geometry in worldkicks series (using interpreter or 4 GB
vmem space)
Fix On Chip RAM addressing: bit 13 or 25 is used to select the bank.
2024-02-27 17:39:51 +01:00
Flyinghead 70a69cf48d switch: fastmem/vmem implementation
Only map first writable mirror due to switch limitation.
2024-01-22 15:18:49 +01:00
Flyinghead c1b087df83 arm64: notify compiler that x10 is used in setHostRoundingMode
Fixes a crash on switch in single-threaded mode in
setDefaultRoundingMode.
2024-01-17 10:08:44 +01:00
scribam 6aa59c54a5
Minor misc changes (#1360)
* core: cleanup include headers
* dx11: remove unimplemented function
* core: annotate destructors with override
* aica: use range-based for loop
* bm: use const reference/structured bindings with blkmap
2024-01-02 14:38:16 +01:00
Flyinghead 9c964ac955 refactor embedded resource loading. Use for imgui font and android OSD
Generic embedded resource loading function
Zip bios and printer fonts
Add buttons.png and Roboto-Medium.ttf as embedded resources
2024-01-02 14:37:29 +01:00
scribam e057370e97 core: add missing pragma once to header files 2023-12-17 11:12:20 +01:00
Flyinghead ce4a3a7147 scif: always schedule timer when updating baud rate
Old savestates don't have any callback set, and read only devices
(barcode readers) won't schedule any either
UI message when r/w card is ejected
2023-12-03 18:22:52 +01:00
scribam db7895cea5
Some ifdefs to improve builds (#1325)
* mmu: hide some jit and fast mmu functions behind ifdef
* linux: move log to the correct place
2023-12-01 15:03:59 +01:00
Flyinghead cb518b5481 serial: fix RDF and TDFE status bits
RDF and TDFE can't be reset if tx/rx fifo is below/above trigger
Remove rx overrun check
Proper reset of scif state
Fixes maxspeed, vonot and hell gate battle cable.
Tetris connects but still has input responsiveness issues.

sh4 mmr: use unnamed bitfields
2023-11-25 17:06:45 +01:00
Flyinghead a18e3701c6 Merge remote-tracking branch 'origin/master' into dev 2023-11-25 16:58:59 +01:00
Flyinghead f11a5981fe dynarec: increase code cache free space limit from 16 to 32 KB
Windows CE games have huge code blocks. (Tomb Raider - Last Revelation)
Fixes MINIDUMP-21R
2023-11-25 15:53:52 +01:00
Flyinghead 4efacd7d71 Battle cable support
work in progress
f355 and aero dancing seem to work
vonot and tetris don't
maxspeed is broken
2023-11-23 16:40:20 +01:00
Flyinghead 09a1fea40f arm32: fix host rounding mode on android
It looks like setting host rounding stopped working on armv7 android a
while ago (v1.0 already has the issue). Directly setting the host FPSCR
register doesn't work so use the C99 standard functions fegetenv and
fesetenv instead.
Fixes flickering yoshimitsu legs in Soul Calibur.
Fixes rotating objects in Sword of the Berserk.
Issue #556
Issue #1259
2023-10-25 16:48:58 +02:00