Commit graph

1751 commits

Author SHA1 Message Date
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
PSI-Rockin
33023c6593 Implemented VADDAq
Also possibly fixed COLCLAMP initialization
2018-12-14 16:29:51 -05:00
PSI-Rockin
455ed16898 Handle BEV bit in EE COP0 2018-11-18 16:44:49 -05:00
PSI-Rockin
b5d902ea3f Minor fixes for BIOS path PR 2018-11-11 16:54:05 -05:00
arcum42
414bda279c Keep track of the bios path / slightly better checking on loading bios (#108) 2018-11-11 13:10:28 -05:00
Kojin
382b888621 Add PSMCT24 host to host transfer (#113)
Allows DoC: FFVII to boot.
2018-11-04 22:10:19 -05:00
Timothy O'Barr
f4a12df004 Added make install (#110) 2018-10-28 12:31:56 -04:00
refractionpcsx2
439b5c6b79 Added somewhat functional COP2 Interlocking (#106)
* Added somewhat functional COP2 Interlocking
Fixed a couple of minor VU bugs

* Fix GIF DMA when CHCR written to while active. Fixes Klonoa 2

* Modified VU0Wait to always interlock (solves hangs on MBit games)
Added COP2 VU0 updating when writing to COP2 if VU0 is busy
Added a Status register pipe to the VU's for handling FSSET
Small optimisation to the VU stall checks
2018-09-23 16:45:11 -04:00
PSI-Rockin
91ac01f13b Fixed clamping and TEXA bugs - SotC no longer has garbage textures 2018-09-21 21:36:19 -04:00
PSI-Rockin
e140bca5bb Made PACKED Q an internal GIF register
Properly reset TRXPOS.y when a transfer starts
Also made SETTH and BCLR instant
2018-09-18 20:49:32 -04:00
PSI-Rockin
60ab93152b Made some timer fixes 2018-09-18 17:32:47 -04:00
PSI-Rockin
7a92e86646 Fixed cmake error 2018-09-17 20:01:29 -04:00
PSI-Rockin
70fd5d10cf Hopefully fix build error 2018-09-17 19:01:06 -04:00
PSI-Rockin
c8b4dc093b Some more timer optimizations 2018-09-17 17:51:45 -04:00
PSI-Rockin
fe64ea384a Various optimizations to timers, DMA, and the EE
Also added memcard stub
2018-09-17 17:16:53 -04:00
refractionpcsx2
88ae343628 PATH3 Masking fixes when PATH3 has finished but VIF doesn't know yet (#105)
Fixed bug where FINISH wouldn't be called if the last packet of GIF data was NLOOP 0 EOP 1
2018-09-15 17:57:50 -04:00
PSI-Rockin
c45da33380 Added VMADDAq and ERSADD 2018-09-15 17:41:45 -04:00
PSI-Rockin
bf959e346d Playing around with the pad some more 2018-09-15 17:01:44 -04:00
PSI-Rockin
f32558648f Made some changes to pad vibration... 2018-09-15 15:44:13 -04:00
PSI-Rockin
7e64a1f7c3 Fake button pressures for pad
MGS3 gets past memory card screen with this, and possibly other games work too
2018-09-15 14:46:46 -04:00
PSI-Rockin
afb13894ec Another pad fix? 2018-09-15 13:52:02 -04:00
PSI-Rockin
314ab83f54 Small pad fix 2018-09-15 13:05:29 -04:00
PSI-Rockin
42d87bb507 Handle "undefined" DMAC mode as chain mode
That, along with some newly implemented register read/writes, allows FFXII to boot and get to menus
2018-09-15 02:07:40 -04:00