Commit Graph

4450 Commits

Author SHA1 Message Date
James Benton
fad35a8823 coreinit: Rename SCIRegion::US to USA 2016-07-22 22:26:12 +01:00
James Benton
370c51dd20 decaf: Be a bit more intelligent when trying to find game to load. 2016-07-22 22:26:12 +01:00
James Benton
6adaa32825 fs: Fix bug in GenericPath not using correct path separator when searching for parent /.. 2016-07-22 22:26:12 +01:00
Brett Lawson
bc850ec773 Improved handling of Time and SystemInfo throughout. 2016-07-22 02:05:34 -07:00
Brett Lawson
6af401478c Implement zlib inflate/deflate stream resetting. 2016-07-22 01:54:11 -07:00
Brett Lawson
ab60f10688 Include buffer padding space when allocating buffers.
This is neccessary as some games specify fetching that goes
past the end of the buffer, even though they do not use this
data.  This causes the host-GPU to discard the triangle but
we need to still render it.
2016-07-22 01:17:09 -07:00
Brett Lawson
1fd4bd3d18 Fix index ordering to properly generate triangles. 2016-07-22 01:17:09 -07:00
Brett Lawson
bc28945a73 Fix issue where attribute buffer was not marked as unmapped. 2016-07-22 01:17:08 -07:00
Brett Lawson
36cc0923ea Fix SIN/COS GLSL implementation. 2016-07-21 23:53:01 -07:00
Brett Lawson
c04693b0f5 More gracefully handle uninitialised mutexes... 2016-07-21 23:47:58 -07:00
Brett Lawson
7834c58ef0 Various minor comment and code fixups. 2016-07-21 23:37:32 -07:00
Brett Lawson
e0aa42dd8b Cleanup and merge xmm float utility functions. 2016-07-21 23:26:16 -07:00
Andrew Church
e69dd51a9a jit: Fix ps1 handling in fused multiply-add instructions.
Also use Intel FMA3 instructions when available to avoid loss of
precision in the result.
2016-07-21 23:26:15 -07:00
Andrew Church
669f4eb4e9 jit: Fix double-precision arithmetic insns improperly writing to ps1. 2016-07-21 23:26:15 -07:00
Andrew Church
328802c7d8 jit: Fix rounding of values in ps_merge. 2016-07-21 23:26:15 -07:00
Andrew Church
d0789fe007 jit: Fix register passing for fallback code.
Also fix outdated register usage comment.
2016-07-21 23:26:14 -07:00
Andrew Church
51af24efe3 jit: Fix fmr/fneg/fabs/fnabs writing to ps1. 2016-07-21 23:26:14 -07:00
Andrew Church
b2dbcf6c47 jit: Fix lfd clearing the ps1 slot. 2016-07-21 23:26:13 -07:00
Andrew Church
3bb0567430 jit: Fix lfs not updating the ps1 slot. 2016-07-21 23:26:12 -07:00
Andrew Church
616f7b14fd interpreter: Fix inaccuracies in ps_res handling.
Use ppc_estimate_reciprocal() instead of regular division, and avoid
setting FPSCR[XX] on inexact results.
2016-07-21 23:26:12 -07:00
Andrew Church
ae2fe765c6 interpreter: Fix improper truncation of ps1 value. 2016-07-21 23:26:11 -07:00
Brett Lawson
d78d2bead0 jit: Fix neg rN,rN destroying the value of rN.
We need to store the registers before using them, or else
parameter calling order could cause the write to occur
prior to the read as we do not hook directly into asmjit.
2016-07-21 22:35:01 -07:00
Brett Lawson
eaf29d72d0 Rewrote ExpHeap and refactored other memory heap stuff.
This commit includes a complete rewrite of the expanded heap
implementation to match closer with the native implementation.
Additionally, some refactoring was applied to the other heaps
to match with the pattern used for the new expanded heap.
2016-07-21 22:29:56 -07:00
Brett Lawson
2f8a3f64d0 Implement GHS time syscall. 2016-07-21 22:29:55 -07:00
Brett Lawson
2c045672d9 Update loader to use a custom memory space for loading.
This is required as some games stupidly expect that the memory
in their MEM2 bucket is zerod out when the application starts
up.  When the loader runs and uses MEM2 for its loader temp
region, this "dirties" that memory, causing those games to fail.
We can't use the system heap as it is not large enough for some
games temporary data (seen up to 0x02900000 bytes).  Note that
we do not keep the loader memory mapped at all times, only when
the loader is actively running.
2016-07-21 22:29:55 -07:00
Brett Lawson
cdcdc6905e Disable checking of OSMutex tags.
See comment for details.
2016-07-21 22:29:55 -07:00
Brett Lawson
1424922caf Fix bug in attribute buffer divisor selection.
The previous code assumed that VAO's specified their divisor info
on a per-attribute basis when it is actually per-buffer.  We now
track the divisor information for each buffer and set it once at
the end, we also track to ensure that all attributes of a single
buffer use the same divisor information.
2016-07-21 22:29:55 -07:00
Brett Lawson
be59e85c74 Improve NO_PERSISTENT_MAP to avoid generating GL errors. 2016-07-21 22:29:55 -07:00
Brett Lawson
7b914c766a Include Fetch Shader disassembly in Vertex Shader GLSL. 2016-07-21 22:29:55 -07:00
Brett Lawson
8ff3ef9d24 Use SQ_ALU_CONST_CACHE instead of SQ_VTX_RESOURCE for KCACHE. 2016-07-21 22:29:55 -07:00
Brett Lawson
7bac2f1a4d Upload all 14 supported uniform blocks instead of just 8. 2016-07-21 22:29:54 -07:00
Brett Lawson
c4e08e8867 Disassemble GPU shader KCACHE information directly.
We used to try to infer information about what the KCACHE was
actually doing, this decompiles the instructions directly
as recorded instead.
2016-07-21 22:29:54 -07:00
Brett Lawson
60492971fc Added assertions for uniform block alignment. 2016-07-21 22:29:54 -07:00
Brett Lawson
63672424d4 Added support for keeping record of symbol type information. 2016-07-21 22:29:54 -07:00
Brett Lawson
2910d4c6ff Added logging for specific GHS syscall ID's. 2016-07-21 22:29:54 -07:00
James Benton
66dc5600df Fix build from merge error 2016-07-18 15:08:30 +01:00
Andrew Church
4e2e3f355e Add missing logic to convert option strings to region codes. 2016-07-18 15:07:24 +01:00
James Benton
9379e4a12b Merge branch 'region-config' of https://github.com/achurch/decaf-emu into achurch-region-config 2016-07-18 13:39:58 +01:00
James
1c9bcbd1a6 Merge pull request #195 from achurch/time-scale
Add a --time-scale option to control the emulated clock speed.
2016-07-18 13:34:25 +01:00
Brett Lawson
5226dff486 Move CIA/NIA storage to OSContext instead of thread stack.
This is not entirely neccessary.  However, when threads are
rescheduled through an interrupt, it is hard to guarentee
that the threads stack pointer is at an acceptable place.
This will make it even less likely that our scheduler
corrupts the state of any running threads.
2016-07-18 03:07:11 -07:00
Brett Lawson
fddf3b2eb9 Fixed issue with FS thread causing app shutdown failures.
This bug would cause the emulator to freeze up when trying to
shut down.  This was due to a race between the shutdown flag
and the notification to tell the FS thread that it was set.
2016-07-18 03:07:11 -07:00
Brett Lawson
0561dabd7b Use special interrupt contexts to handle interrupts.
This removes any possibility of the interrupt handler
corrupting the state of any running threads.
2016-07-18 03:07:11 -07:00
Brett Lawson
857d878464 Send GX2Invalidate operations through a GPU backchannel.
GX2Invalidate can be called from any core at any time.  This is
contrary to the idea that only one core can write at a time.
It is possible that more of our internal commands should do this.
2016-07-18 03:07:11 -07:00
Brett Lawson
7025daba9c Games like to memset -1, this warning was a dumb idea... 2016-07-18 03:07:11 -07:00
Andrew Church
66529012c7 coreinit: Update thread switch time even when switching to no thread.
Fixes non-running threads being credited with idle time when a core goes idle.
2016-07-18 18:15:26 +09:00
Andrew Church
3c0b756fbc Make the emulated system region configurable.
Also add the region constant for Japan.
2016-07-18 16:45:42 +09:00
Brett Lawson
e20016f810 Bind vertex shader inputs to the correct attribute indexes.
Previously, the ordering was arbitrarily decided by
OpenGL which caused shaders which did not map the buffers
in-order to incorrectly assign them.
2016-07-17 20:25:34 -07:00
Brett Lawson
405b2df6e6 Added assertions for currently unimplemented shader features. 2016-07-17 20:25:30 -07:00
Brett Lawson
d1fff66d14 Handle pixel shader gl_FragCoord input register. 2016-07-17 20:25:25 -07:00
Brett Lawson
4d614f6e7a Handle pixel shader semantic mapping default values. 2016-07-17 20:25:20 -07:00