Commit Graph

89 Commits

Author SHA1 Message Date
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
Francisco José García García 6bfb7e1b47 (VITA) Dynarec working 2016-10-03 20:19:11 +02:00
Francisco José García García 24cbebe2de (VITA) Change libco and some optimizations 2016-09-29 01:03:33 +02:00
twinaphex e700ad7875 Update Makefile 2016-09-07 09:32:02 +02:00
Francisco José García García 5051773104 (VITA) Set thumb mode 2016-08-14 18:30:14 +02:00
twinaphex 70fff8152f (Vita) Try to enable dynarec 2016-08-07 16:34:34 +02:00
vanfanel 9dbea7573e Removed redundant CFLAG and added Rpi3 platform 2016-05-24 17:52:00 +02:00
twinaphex 7a5380ca84 Add gcw0 target 2016-03-04 06:37:04 +01:00
vanfanel 31f9969be1 Add rpi 2 and rpi 1 platform definitions 2016-02-27 04:29:26 +01:00
aliaspider 4b00c74784 (3DS) remove the now unused libkhax. 2016-01-18 01:00:56 +01:00
aliaspider f1d14fbe7c (3ds) dynarec: map the translation caches to specific addresses at
runtime, increases compatibility with loaders that can reloacate each
program section seperately.
move the svc enabling functions to the frontend.
2015-11-04 15:46:27 +01:00
aliaspider 6b8417143a (vita) build fix 2015-10-24 19:48:54 +01:00
twinaphex 98d327daa5 Add iOS 9 rules 2015-10-16 03:04:06 +02:00
aliaspider c52e81510f (CTR/3DS) fix the 'all' target not being the default target. 2015-09-14 04:04:25 +01:00
aliaspider c1d061e204 (3DS) add dynarec support when started from a .cia install
use libkhax for ninjhax 1.0
2015-09-11 22:02:04 +01:00
twinaphex a99c3552a4 (Vita) Add Vita target 2015-08-31 21:50:44 +02:00