Commit graph

402 commits

Author SHA1 Message Date
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
02e35339ee Fix a ghost bug with some games
Affects at least SM Adv 4 on PSP, which doesn't load at all.
I think the MIPS pipeline does not like invalidating the Icache and
using it immediately after (seems to read an old value sometimes?).
Rewired it to not do that and instead jump to the handler directly.
2021-03-08 02:59:11 +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
David Guillen Fandos
d21478e06e ARM dynarec: Do not use the stack at all
Fix a C func call while at it. This is a prerequisite to make the
dynarec re-entrant and get rid of libco
2021-03-05 17:47:20 +01:00
David Guillen Fandos
7bebd3051c Remove dead code
Turns out this was not even used! No need to fix it then!
2021-03-05 01:15:55 +01:00
David Guillen Fandos
89bd699837 Reduce executable size by 90%
Turns out most of that file ends up in JIT section, which is RWX and not
a very nice way to run code really (security issues aside).
This also makes possible to build that file with -ggdb otherwise it
complains about stuff.
2021-03-05 01:14:31 +01:00
David Guillen Fandos
6770e0a5e7 Minor improvements in ARM stubs
This gets rid of stack usage (except for callback invocations) in the
dynarec execution code. A requirement to make the dynarec re-entrant.
2021-03-04 18:35:48 +01:00
David Guillen Fandos
f6ead0812a Remove more dead code 2021-02-26 18:36:57 +01:00
David Guillen Fandos
349e47f0b2 Small fixes to division by zero
This causes crashes in PSP quite often in many games. Other CPUs might
(depending on the processor state) silently return zero or some
undefined value.
The fix is borrowed from ReGBA's codebase
2021-02-23 20:27:59 +01:00
Autechre
300d0c0028
Merge pull request #93 from davidgfnet/master
More cleanups (mostly whitespace and unused stuff)
2021-02-15 22:30:27 +01:00
David Guillen Fandos
ed3ba2c18b More cleanups (mostly whitespace and unused stuff) 2021-02-15 21:51:49 +01:00
Autechre
fa74054508
Merge pull request #92 from davidgfnet/master
Minor cleanup in ARM and MIPS
2021-02-13 02:01:10 +01:00
David Guillen Fandos
8d52e613c7 Minor cleanup in ARM and MIPS
Fix some small issues, mainly associated with undefined behaviour
expressions
2021-02-12 21:47:35 +01:00
Autechre
6254bbb1d2
Merge pull request #91 from davidgfnet/master
Fix ARM dynarec
2021-02-10 10:35:56 +01:00
David Guillen Fandos
2c6026cfe5 Move r15 to reg_a0 (instead of reg_mem)
I think this does not make a difference at all in the code, since PC is
treated in a special way anyway (reloaded with an immediate when read
and treated as an indirect branch when written). However for the sake of
completeness I'm undoing what I did. (The comma fix stays :P)
2021-02-10 02:53:26 +01:00
David Guillen Fandos
7aaa280b9f Fix ARM dynarec
Turns out there were a couple of very interesting and hard to track
bugs. A missing comma made the reg list too short, leaving the 31th
element at the mercy of the linker ordering algorithm, which seems to
work in some cases depending on the compiler version.
Also the cache flush code seemed not to work on my machine (OGA),
not sure why it wored in the past :/
2021-02-10 02:46:45 +01:00
twinaphex
f70d8534a1 Fix libco for arm64 2021-01-27 13:17:24 +01:00
Autechre
2b6f1d552e
Update .gitlab-ci.yml 2021-01-09 17:03:57 +01:00
Autechre
d8e0790ce9
Update .gitlab-ci.yml 2021-01-09 16:40:28 +01:00
Autechre
f520876ef6
Update .gitlab-ci.yml 2021-01-03 01:10:16 +01:00
twinaphex
23b2a55f0d Update 2020-12-19 23:18:41 +01:00
twinaphex
1d803fbdd9 Update 2020-12-06 20:25:38 +01:00
twinaphex
99e35c642c Update .gitlab-ci.yml 2020-12-06 19:45:23 +01:00
jdgleaver
e4745d32ec Add 3DS target to .gitlab-ci.yml 2020-12-03 14:05:54 +01:00
Autechre
78f7c59d5f
Merge pull request #87 from jdgleaver/dingux-gitlab-ci
Add OpenDingux target to .gitlab-ci.yml
2020-11-27 22:32:55 +01:00
jdgleaver
2f7498dbee Add OpenDingux target to .gitlab-ci.yml 2020-11-27 10:51:46 +00:00
twinaphex
303572f31b Update .gitlab-ci.yml 2020-11-10 19:26:31 +01:00
Autechre
aad3dbb0b4
Merge pull request #85 from jdgleaver/frame-mix-fast
Optimise interframe blending
2020-11-09 14:44:58 +01:00
jdgleaver
908be08be5 Optimise interframe blending 2020-11-09 13:04:00 +00:00
Autechre
c54a3bf21c
Merge pull request #84 from negativeExponent/path_separator
Use correct path separator
2020-10-29 03:29:19 +01:00
negativeExponent
56372b0635 Use correct path separator 2020-10-28 19:39:41 +08:00
Autechre
6e5d4d591e
Merge pull request #83 from jdgleaver/auto-frameskip
Overhaul frameskip options
2020-10-27 16:40:00 +01:00
jdgleaver
226bd8283a Overhaul frameskip options 2020-10-24 14:58:40 +01:00
twinaphex
c6488bf086 Update 2020-10-24 04:30:33 +02:00
Autechre
bbb5e4aa53
Merge pull request #82 from jdgleaver/android-libco
Set 'USE_LIBCO=1' in Android JNI build file
2020-10-24 01:33:08 +02:00
jdgleaver
c45187a7c8 Set 'USE_LIBCO=1' in Android JNI build file 2020-10-23 22:32:41 +01:00
Autechre
f5eae17f5a
Merge pull request #81 from jdgleaver/libco-alt
Add build-time option to run the emulator in a thread instead of libco (fixes OpenDingux target)
2020-10-23 17:34:42 +02: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
Autechre
e5bb2ffdd2
Update .gitlab-ci.yml 2020-10-18 19:28:16 +02:00
Autechre
e720c1d425
Merge pull request #80 from negativeExponent/rtc_update
Update RTC emulation
2020-10-09 14:18:48 +02:00
negativeExponent
f8b598a2ed Update RTC emulation
- Based on notes, gpSP's RTC does was based on vba.
- I've updated relevant sections of it based on latest vba.

reference issue: https://github.com/libretro/gpsp/issues/79
2020-10-09 15:14:25 +08:00
twinaphex
9fc166ebb2 Update Makefile 2020-10-08 23:56:18 +02:00
twinaphex
679006a296 Add more forward declarations 2020-10-08 15:51:24 +02:00
twinaphex
4181385f39 Add forward declarations 2020-10-08 15:47:37 +02:00
twinaphex
27419bc0b0 Add .gitlab-ci.yml 2020-10-08 05:18:01 +02:00
Autechre
6ca90ae963
Update Makefile 2020-10-08 05:16:57 +02:00
twinaphex
b10c73f00f Cleanups 2020-10-06 03:13:01 +02:00
twinaphex
2e4a393743 Merge branch 'master' of https://github.com/libretro/gpsp 2020-10-06 03:11:29 +02:00
twinaphex
fa80ff3c4b Cleanups 2020-10-06 03:09:13 +02:00