Commit graph

1873 commits

Author SHA1 Message Date
PSI-Rockin
bf98f590c2 Added an initial 3 cycle delay to XGKICK
Also fixed stack alignment bug causing segfault on macOS
2019-02-25 19:58:53 -05:00
a dinosaur
a491dce51a CISO reading support (#123)
This changes up the build system quite a bit.
2019-02-25 18:51:46 -05:00
refractionpcsx2
d77b9ae7f9 VU JIT: Added Integer delay compensation. (#124)
Added proper handling of swap ops
Fix some P stalling stuff
Small optimisations to the JIT
2019-02-25 18:47:53 -05:00
PSISP
beb5c0cb07
Fix JIT segfaults on Linux (#127)
Reorganized some of the code to allow for future MinGW portability
2019-02-25 16:25:47 -05:00
tokumeiwokiboushimasu
1d27cb7b17 VU JIT building fixes (#125) 2019-02-24 09:26:21 -05:00
refractionpcsx2
3b6a07e98a VU JIT: Added VU stalling and Flag optimisations (#122)
Unknown ops drop back to the interpreter but print to the log what it was
Handle SQRT fallback separately
Fixed a bug with XGKick not stalling when it should
Update XGKick cycles before starting a new XGKick
Added P Pipeline and improved EFU/FDIV pipe handling
Stop VU ops writing to VF00/VI00
2019-02-23 12:25:06 -05:00
refractionpcsx2
b6b4dddb93 VU JIT: Implemented additional conditional clamping (#121) 2019-02-20 15:36:41 -05:00
PSI-Rockin
6609224e89 Added IR instruction for falling back to interpreter
Also fixed small bug where signed zero cleared MAC flags
2019-02-18 18:15:46 -05:00
PSI-Rockin
6bd47716e3 Mask PC at the end of every block 2019-02-17 14:44:16 -05:00
PSI-Rockin
39f26dd45a Keep controller status as connected even when Port 2 is selected 2019-02-17 12:44:41 -05:00
refractionpcsx2
b01f251cfa Changes to get VU JIT compiling with Visual Studio (#120)
Adds a separate assembly file only usable by MSVC. MinGW will not work currently.
2019-02-16 20:55:29 -05:00
PSI-Rockin
8a3684ffde Additional SIO2 fixes 2019-02-16 13:01:43 -05:00
PSI-Rockin
80cc463e16 Added MSUB and MULAq to JIT 2019-02-16 12:39:10 -05:00
PSI-Rockin
4bc16b6ba2 Bump up savestate version 2019-02-14 20:28:50 -05:00
refractionpcsx2
5d801f581a Fixes for PATH3 FIFO and PATH3 Masking (#119) 2019-02-14 20:28:05 -05:00
PSI-Rockin
7cd5028761 Small fix to exec_block name 2019-02-14 15:54:36 -05:00
PSI-Rockin
c2469f1a6b Made VU_JIT64::exec_block a C-style function
This should make portability easier
2019-02-14 12:35:20 -05:00
PSI-Rockin
68cc95862a Add missing header 2019-02-14 12:05:57 -05:00
PSI-Rockin
bc2671985d Update CMakeLists.txt 2019-02-14 12:01:23 -05:00
PSI-Rockin
881274295a Added RINIT
Kingdom Hearts 1 seems to work with some minor glitches
2019-02-14 11:48:52 -05:00
PSI-Rockin
d92ab80960 Replaced integer max/min instructions with floating-point equivalents
Also snuck in a nice little fix for some SIO2 stuff
2019-02-13 19:57:36 -05:00
PSI-Rockin
b14c922f4e Fixed bug in DIV scheduler and another timing bug
This fixes all the problems SotC had
Unfortunately, SotC is GS-limited...
Also fixed ABS bug and added MAC flag generation to all necessary arithmetic instructions
2019-02-13 09:42:27 -05:00
PSI-Rockin
37f2d1d442 Fixed MOVSX emitter bug
SotC looks better now but still has some SPS
Also expanded div by zero check to include MIN_FLT (should probably check if the signs are different)
2019-02-07 22:53:49 -05:00
PSI-Rockin
a2118b706f Added several instructions needed for SotC
Unfortunately it is a complete mess of polygons... still investigating
Also added CLIP and status pipeline emulation
2019-02-05 21:49:50 -05:00
PSI-Rockin
783ba5206d Fixed FIFO not flushing when GIF DMA transfer finishes
Also added FCEQ to VU interpreter
2019-02-04 17:14:50 -05:00
PSI-Rockin
36e8b91bd7 Preliminary (fast) GIF FIFO added
Dunno if this works at all
2019-02-04 16:00:35 -05:00
PSI-Rockin
1c6c41c0cc Added more instructions and added "just-in-time" sync for XGKICK
This allows Monster Hunter to go in-game with no visible problems
Also fixed a disassembly bug in RSQRT
2019-02-04 15:31:17 -05:00
PSI-Rockin
be267ea5e5 Added MR32 and MADDq to JIT
Added VU->IR code for updating Q pipeline when a Q-reading instruction is called when no stall has occurred in a block (still needs to be implemented in x64 emitter)

Added stub for FCOR
2019-01-30 17:31:28 -05:00
PSI-Rockin
ee1a71e71d Fixed bugs in MFIR and FMAND
At long last, FFX renders perfectly on the JIT. Time to move on to more complicated games
2019-01-26 20:37:26 -05:00
PSI-Rockin
e3ff478a41 Added clamping and more instructions to JIT
Refactored register allocation code a bit
FFX reaches the intro scene, but has lots of bugs
2019-01-24 12:14:17 -05:00
PSI-Rockin
03ba7ef911 Removed the SotV patches and added more instructions
Forced a VU JIT flush when a new microprogram is uploaded
Made JIT XGKICK timings a bit better
Made MAC flags update every instruction (to be reworked)
The BIOS successfully boots now. Time to get FFX working...
2019-01-17 21:01:51 -05:00
PSI-Rockin
aee6842913 Added hacky MAC flag generation to the JIT, as well as many more instructions
Fixed a bug that caused multiple division operations to not properly update the Q register
All scenes in Slave of the VU now run. The third is bugged because of timing issues with XGKICK.
2019-01-15 18:48:33 -05:00
PSI-Rockin
c271f67ede Fixed many bugs and added several instructions to the JIT
Slave of the VU, with some patches to skip IOP problems, runs at more than double the speed before getting bottlenecked by the GS.
Also changed execution to go at full speed and made the VU translator a class rather than a namespace
2019-01-13 09:45:04 -05:00
PSI-Rockin
82ff812b37 Properly implemented IBNE
This means that we have general branching logic. It doesn't handle branches in branch delays or integer delay slots, however.

Next up: FMAND. This means we'll need to have an optimized way of updating the MAC flag pipeline...
2019-01-10 22:46:02 -05:00
PSI-Rockin
1e3bf7facc Fixed additional bugs in MADD and ILWR
Also added various optimizations, as well as stubs for IBNE and FCSET. Need to work on conditional branches now.
Side note: last commit fixed some ILWR bugs, not LQI. Sorry!
2019-01-10 13:39:43 -05:00
PSI-Rockin
5fdec3c65c Fixed bugs in LQ and LQI
Also added "constant address optimizations" to LQ and LQI - potentially something to add into the IR rather than the x64 JIT?
2019-01-09 20:04:50 -05:00
PSI-Rockin
588a03fe2d Added LOI, LQ, ILW, IADD, and XTOP
Also added IR instructions for IBNE and FCSET, although no x64 code for them is generated yet
2019-01-08 23:17:20 -05:00
PSI-Rockin
70166c442a Implemented LQI, SQI, MADDbc, and e-bit stopping
FFX now runs its first microprogram successfully; whether or not the results are valid remains to be seen
2019-01-07 20:50:13 -05:00
PSI-Rockin
036fd2bc95 Properly implemented MULbc
Fixed a bug causing locked XMM registers to be allocated
Optimized flush_regs by only flushing registers that have been modified
2019-01-07 01:13:56 -05:00
PSI-Rockin
a865641079 Added integer/SSE register allocators and several more instructions
Added a literal pool to JitCache to optimize 64-bit address fetches
Added helper functions for calling compiled x64 C++ functions in JIT64
2019-01-06 23:45:08 -05:00
PSI-Rockin
568cea56d5 Added some IR instructions
Preparing for our first SSE/AVX emitted instructions...
2019-01-05 23:12:52 -05:00
Hoe Hao Cheng
152164f1f4 Keeping the code style consistent (#112)
Replaced some(maybe all?) instances of jumbledcase with snake_case
Renamed some GS structs (GS_message, for example)
Renamed camelCaseFuncs() to snake_case_funcs()
Cases where jumbledcase and snake case are mixed together (e.g. ebit_delay_slot) are kept as-is.
2019-01-05 22:54:16 -05:00
PSI-Rockin
9ac73b1e9a Messing around with fog. Should be correct for triangles now 2019-01-04 18:44:50 -05:00
PSI-Rockin
b7d06c0307 Fixed dithering bug 2019-01-04 18:24:59 -05:00
PSI-Rockin
61948c0908 Added dithering - currently untested 2019-01-04 18:15:47 -05:00
PSI-Rockin
3edf5fc01f Got the VU JIT running. So far, only B and BAL are implemented.
Made some changes to IR::Instruction to make arguments easier to read inside the emitter.

Added a reset function to the JIT to flush out the cache.

Things to consider for the future:
* Windows uses a different x64 ABI (thanks Microsoft). Perhaps we can have a generic ABI_Call function that translates a function call to the appropriate x64 assembly.
* The VU JIT is hardcoded to only work for a single VU. It needs to be modified to support both VUs.
* microVU (PCSX2's VU JIT) recompiles entire microprograms rather than blocks, allowing for advanced optimization. It would be ideal to follow a similar approach.
2019-01-03 22:07:35 -05:00
PSI-Rockin
6fa40ff800 Basic IR design and generation. Linked together all JIT components as well.
Currently dies in the IR->x64 stage. Code execution is also missing.
2019-01-02 01:11:04 -05:00
PSI-Rockin
95b0846391 Also fix a MAX/MINI bug in the VU interpreter, because why not 2019-01-01 21:00:33 -05:00
PSI-Rockin
a46db0e9e4 Stubs for IR translator and x64 emitter
Next step: define what an IR instruction is. VU upper and lower ops can be swapped; swapping can be done at compile time, but this requires the source and destination registers of the ops to be known.
2019-01-01 20:39:03 -05:00
PSI-Rockin
5a3066a773 Add a common JitCache class.
A JitCache will contain all dynamically recompiled code belonging to the EE or VU JIT.

TODO: Windows has a different way of allocating virtual memory. Currently we just die on Windows compilers.
2019-01-01 16:28:38 -05:00