Commit Graph

104 Commits

Author SHA1 Message Date
David Guillen Fandos bd39c03992 Improve tracing a bit, also in interpreter mode 2023-04-15 02:02:17 +02:00
jSTE0 20c09d773c platforms/miyoo: Use small translation cache
As this platform only has 32MB RAM.
2022-04-03 18:55:48 +01:00
David Guillen Fandos bcd3d1ca29 [aarch64] Adding new aarch64 dynarec!
This is based on the MIPS dynarec (more or less) with some ARM
borrowings. Seems to be quite fast (under my testing fixed results:
faster than ARM on A1 but not a lot faster than the interpreter on
Android Snapdragon 845) but still some optimizations are missing at the
moment.

Seems to pass my testing suite and compatibility wise is very similar to
arm.
2021-12-12 13:18:13 +01:00
Salvador a384d653c2
Miyoo (#162)
Add Miyoo target
2021-11-14 09:58:26 +01:00
David Guillen Fandos aa52f960c8 Fix Makefile arch detection support
x86/64 detection only enabled for unix platforms, since other platforms
have hardcoded rules (including windows).
2021-11-06 12:32:20 +01:00
David Guillen Fandos e3d5ca8419 [x86/x64] Add support for x86-64 and improve 32 bit mode too.
This adds support for x86-64 dynarec both on Windows and Linux. Since
they have different requirements there's some macro magic in the stubs
file.

This also fixes x86 support in some cases: stack alignment requirements
where violated all over. This allows the usage of clang as a compiler
(which has a tendency to use SSE instructions more often than gcc does).

To support this I also reworked the mmap/VirtualAlloc magic to make sure
JIT arena stays close to .text.

Fixed some other minor issues and removed some unnecessary JIT code here
and there. clang tends to do some (wrong?) assumptions about global
symbols alignment.
2021-11-06 12:17:50 +01:00
David Guillen Fandos 3a7fedb8fb Simplify MMAP machinery for Win/Lin/Mac/Android
This gets rid of the bloated memmap_win32.c in favour of a much simpler
wrapper. This will be needed in the future since the wrapper does not
support MAP_FIXED maps (necessary for some platforms)
2021-11-05 18:23:05 +01:00
David Guillen Fandos 3368ad6f8e Remove broken fpic strip 2021-11-05 17:52:22 +01:00
David Guillen Fandos c39f5391f0 [ARM] Start using mmap'ed JIT caches for most builds
Will revisit remaining platforms and try to clean them too.
This should fix Android once and for all.
2021-10-29 22:51:39 +02:00
David Guillen Fandos 8da094d7e0 Add 60FPS overclock hack
Let's see, this should fix issues on platforms that do not support
running the emu at 59.73 FPS. We run the emu at fake 60fps, which means
we produce more audio samples than the original device.

Instead of missing samples (which produce cracks in the audio) we should
be producing some extra samples, which will result in a frame drop every
now and then (like every minute or so, so it's not noticeable).
2021-10-20 01:15:40 +02:00
David Guillen Fandos 6c195cdcaa Add libretro-common and VFS functions for read/write
Remove small unused stuff while at it.
2021-09-30 18:31:11 +02:00
Poligraf 80f86535e7
add retrofw target 2021-07-30 20:35:15 +12:00
David Guillen Fandos 8ddfae6bc2 Add PS2 builds and expand the ROM buffer to 16MB
This requires the new PS2 font drive to work, since gskit uses too much
memory.
2021-07-24 02:02:12 +02:00
David Guillen Fandos 706926caff Reduce RS90 buffer to 4MB 2021-07-23 19:26:55 +02:00
David Guillen Fandos 75e67bffc2 Add support for RS90 2021-07-23 18:50:44 +02:00
David Guillen Fandos 60155e0b81 Add preliminary support for PS2 devices 2021-07-22 18:30:45 +02:00
David Guillen Fandos 8dbf5f6c17 Enable big-endian devices: gc/wii
This patch adds big-endian compatibility in gpsp (in general but only
for the interpreter). There's no performance hit for little-endian
platforms (should be a no-op) and only add a small overhead in memory
accesses for big-endian platforms.

Most memory accesses are wrapped with a byteswap instruction and I/O reg
accesses are also rewired for proper access (using macros). Video
rendering has been fixed to also do byteswaps but there's a couple of
games and rendering modes that still seem broken (but they amount to
less than 20 games in my tests with 1K ROMs).

This also adds build rules and CI for NGC/WII/WIIU (untested)
2021-06-27 01:16:28 +02:00
David Guillen Fandos dbf72e95ef Fix the no-caller-saves bug for MIPS
Seems that ABI mandates that we allocate space for arg0..4 even if we do
pass them as registers. For some reason write_io_register<> functions
write in that stack area (1 word) corrupting the s0 saved register.
This seems to be a new gcc behaviour?
2021-06-22 00:09:44 +02:00
David Guillen Fandos f8d4276e12 Add support for mips64n32
This only needs some support to save/load state with 64 bit registers.
Since pointers remain 32 bit, no extra changes are needed in the
dynarec. Verified with qemu (qemu-mipsn32el) and miniretro.
2021-06-21 19:17:19 +02:00
David Guillen Fandos e0a31952db Add preliminary support for non mips32r2 devices
This is required in PS2 but could also make older dingux devices run
gpsp on retroarch
2021-06-18 18:03:47 +02:00
David Guillen Fandos 261b2db9bb Cleanup Makefiles a bit 2021-05-19 20:11:35 +02:00
David Guillen Fandos 37430f22c5 Small optimization (~2-4%) and whitespace cleanup!
Cleans up a ton of whitespace in cpu.c (like 100KB!) and improves
readability of some massive decode statements.

Added an optimization for PC-relative loads (pool load) in ROM (since
it's read only and cannot possibily change) that directly emits an
immediate load. This is way faster, specially in MIPS/x86, ARM can be
even faster if we rewrite the immediate load macros to also use a pool.
2021-05-07 20:41:54 +02:00
David Guillen Fandos 5b5a4db6c2 Add instruction tracing, for testing purposes 2021-04-03 00:37:42 +02:00
twinaphex fd20793545 Add CROSS_COMPILE rules 2021-03-27 15:09:01 +01:00
David Guillen Fandos 7ea6c5e247 Move OAM RAM to stubs also
Makes accesses more efficient for MIPS. Make accesses also fast for palette
reads.
2021-03-26 23:13:26 +01:00
jdgleaver 3db35eab70 Fix OpenDingux Beta build 2021-03-26 16:03:46 +00:00
David Guillen Fandos 6b503667ec Add Dingux support
Uses a different cache primitive and a differend madd(u) encoding.
Also added a flag for BGR vs RGB color output (since PSP is assuming to
be BGR for speed).
Aside from that the ABI required some special function calls for PIC.
2021-03-16 22:58:58 +01:00
David Guillen Fandos 5ffd2832e8 Rewrite of the MIPS dynarec stubs
This allows us to emit the handlers directly in a more efficient manner.
At the same time it allows for an easy fix to emit PIC code, which is
necessary for libretro. This also enables more platform specific
optimizations and variations, perhaps even run-time multiplatform
support.
2021-03-16 22:58:58 +01:00
David Guillen Fandos 1e8097ac79 Improve and simplify dynarec JIT area.
Also fix a regression on VITA.
Use gcc/OS cache flushing routines for MIPS32 instead of synci
2021-03-12 18:05:48 +01:00
twinaphex bd36c9c77d Add osx-arm64 target 2021-03-09 22:05:36 +01:00
David Guillen Fandos 56dc6ecb70 Remove libco
This removes libco and all the usages of it (+pthreads).
Rewired all dynarecs and interpreter to return after every frame so that
libretro can process events. This required to make dynarec re-entrant.

Dynarecs were updated to check for new frame on every update (IRQ, cycle
exhaustion, I/O write, etc). The performance impact of doing so should
be minimal (and definitely outweight the libco gains). While at it,
fixed small issues to get a bit more perf: arm dynarec was not idling
correctly, mips was using stack when not needed, etc.

Tested on PSP (mips), OGA (armv7), Linux (x86 and interpreter). Not
tested on Android though.
2021-03-08 18:44:03 +01:00
David Guillen Fandos 3d558413fd Fix x86 dynarec, broken by d10c4afe
The dynarec expects function args to be located in registers instead of
the stack, which is not the default calling convetion in GCC/clang.
2021-03-06 21:15:22 +01:00
twinaphex 23b2a55f0d Update 2020-12-19 23:18:41 +01:00
jdgleaver e4745d32ec Add 3DS target to .gitlab-ci.yml 2020-12-03 14:05:54 +01:00
jdgleaver 2b189fe810 OpenDingux: Fix makefile target 2020-10-23 16:06:15 +01:00
jdgleaver 00406feed9 Add build-time option to run the emulator in a thread instead of libco (fixes OpenDingux target) 2020-10-23 15:37:48 +01:00
twinaphex 9fc166ebb2 Update Makefile 2020-10-08 23:56:18 +02:00
Autechre 6ca90ae963
Update Makefile 2020-10-08 05:16:57 +02:00
twinaphex 856af16ba6 Cleanup 2020-05-27 21:39:17 +02:00
twinaphex b668259a2f Fix OSX PPC build 2020-05-27 21:34:54 +02:00
Justin Weiss 6a50b8a68d [3DS] Fix dynarec prefetch aborts
Similar fix to https://github.com/libretro/pcsx_rearmed/pull/390. The
Nintendo svcBackdoor can cause stack corruption if an interrupt
happens during it, this uses Luma3DS/Rosalina's svcCustomBackdoor instead.
2020-02-29 10:55:58 -08:00
bmaupin f1109b1df4 Use OPTIMIZE for compiling libco too
In case it needs to be debugged
2019-10-24 13:23:28 -04:00
bmaupin a60de42f3a Get dynarec working again for PSP 2019-10-20 14:58:51 -04:00
bmaupin 2e13ee1cfc Fix compiler warning for strict aliasing 2019-10-03 13:53:34 -04:00
bmaupin 7816b42a8c Fix compilation on PSP 2019-09-13 13:44:48 -04:00
Yoshi Sugawara 8acc14cf34 (tvOS) Compile using tvOS SDK 2019-09-02 15:59:57 -10:00
Ryan 'Swingflip' Hamlin 2a8bcc0ae5 Added A7A7 2018-11-01 16:42:06 +00:00
twinaphex 638aad3ad5 Add Switch target 2018-01-10 03:14:18 +01:00
Yoshi Sugawara 0b73fbaa1a support for iOS arm64 build 2017-10-02 15:57:25 -10:00
Gregor Richards 415b5ba67b Report git version with library_version 2016-12-09 18:42:12 -05:00