Commit graph

4506 commits

Author SHA1 Message Date
Andrew Church
1e92c3af01 Fix warning about comparison of different enum types. 2015-12-18 20:30:04 +09:00
Andrew Church
cf97b8f8bc Fix unhandled-case warning. 2015-12-18 20:29:51 +09:00
James Benton
4d73f748e3 Setup threads before calling user preinit.
Fast Racing Neo does to OSGetDefaultThread/OSSetThreadName during preinit,
this will fail if we have not set the default thread prior to calling
the preinit method.
2015-12-16 19:59:43 +00:00
James Benton
7a0096c52e Fix teenyheap.
Rewrote it because it was broken in some crazy unknown way.
2015-12-16 19:59:42 +00:00
James Benton
52aa3482e0 Fix ordering of default heap initialisation. 2015-12-16 19:59:42 +00:00
James Benton
0dd7bd6f88 Print module name for unimplemented data symbols. 2015-12-16 19:59:41 +00:00
James Benton
411d7ac90b MEMGetTotalFreeSizeForExpHeap should return the total size of free blocks.
No need to consider per allocation overhead.
2015-12-16 19:59:41 +00:00
James Benton
ce8f197a7b Print all unimplemented function imports at start of game. 2015-12-16 19:59:40 +00:00
James Benton
af5f93a33e Implement gx2r_surface functions. 2015-12-16 19:59:40 +00:00
James Benton
b3ee5d23ef Add shared data heap. 2015-12-16 14:46:17 +00:00
James Benton
ae0890ad9f Implement Unit Heap.
Close #72.
2015-12-16 14:45:26 +00:00
Andrew Church
9f55d4fbe5 Comment fix regarding underflow exception issue with FMA.
After careful reading, it turns out Intel reports underflow _after_
rounding, unlike the Espresso which reports it _before_ rounding,
and IEEE 754 allows either behavior -- so this is a simple design
difference rather than a bug.
2015-12-15 20:39:00 +09:00
Andrew Church
0a7929f22f It was frsp, not fres, that left ps1 undefined, and in fact frsp
behaves like other single-precision instructions in that respect.
2015-12-15 18:32:41 +09:00
Andrew Church
cab8f31018 Apply FPU fixes to paired-single instructions. 2015-12-15 18:32:30 +09:00
Andrew Church
931b7c2201 Fix fres(HUGE_VALF), though the result is still 1 low bit off
(0x37F00010_80000000 vs. 0x37F00010_00000000 on hardware).
2015-12-15 18:32:21 +09:00
Andrew Church
dbaffb7e09 Raise overflow/underflow exceptions for fres. 2015-12-15 18:32:11 +09:00
Andrew Church
75d59a4ef5 Clean up underflow handling for FMA instructions.
It turns out part of the problem was that Intel Haswell CPUs (at least)
don't raise the underflow exception in certain cases when they should.
2015-12-15 18:31:42 +09:00
Andrew Church
3488352153 Avoid raising VXISI in FMA instructions when frA*frC is a NaN. 2015-12-15 18:31:26 +09:00
Andrew Church
80c419830e Clear pending host FP exceptions before each test. 2015-12-15 18:31:19 +09:00
Andrew Church
bb1c550fc1 Document misbehavior of lfd with paired-single instructions. 2015-12-15 18:31:05 +09:00
Andrew Church
a5ed95f785 Check FPSCR in hwtests, but exclude FR since we don't emulate it. 2015-12-15 18:30:57 +09:00
James Benton
a1fe7db6dc Output shader disassembly on shader compile error. 2015-12-14 18:47:07 +00:00
James Benton
ff0b46b906 Imlpement SQ_OP2_INST_RNDE. 2015-12-14 18:46:53 +00:00
James Benton
66342624e6 Add addrlib to CMakeLists. 2015-12-14 01:20:22 +00:00
James Benton
e9b90b4be7 Add missing addr decode for CfAluInstruction. 2015-12-14 00:59:15 +00:00
James Benton
ab3feb1caf Unify gsh-disassemble and gtx-convert into gfd-tool.
Close #97.
2015-12-14 00:59:10 +00:00
James Benton
9456b7cb14 Implement GX2GetSurfaceSliceSwizzle. 2015-12-14 00:11:19 +00:00
James Benton
d971015ed8 Move address space base/size to a globally accessible enum. 2015-12-14 00:11:14 +00:00
James Benton
29f29a0418 Update gtx-convert to use addrlib. 2015-12-14 11:29:16 +00:00
James Benton
ed6d803af7 Rewrite texture code to use addrlib. 2015-12-14 11:29:15 +00:00
James Benton
51287b3fc4 No longer use vs_out semantic ID for declaring vs_out. 2015-12-14 11:29:14 +00:00
James Benton
8b842e3750 Fix texture format and texture type being swapped. 2015-12-14 11:29:14 +00:00
James Benton
b18a7fb5ba Improve glbinding error logging. 2015-12-14 11:29:14 +00:00
James Benton
d37baeccfd Stub SAVEOpenFile, SAVEOpenFileAsync. 2015-12-14 11:29:13 +00:00
Andrew Church
b3a48e3d2e Fix disassembly operand order for 3-input floating-point instructions. 2015-12-14 06:22:27 +09:00
Andrew Church
e9e98aa8c6 Correctly round the second operand to single-precision multiply instructions.
In edge cases, this results in emulating most of an IEEE multiply operation
in software.
2015-12-14 06:21:48 +09:00
James Benton
625d261f57 Fix fpArithGeneric warnings. 2015-12-12 13:27:49 +00:00
James Benton
7c642fd868 Fix int to bool cast warning. 2015-12-12 13:27:34 +00:00
James Benton
293c823f2c Fix ps_sel using float instead of double. 2015-12-12 13:17:02 +00:00
James Benton
6dd86c2bb4 Do not exclude FMA instructions from hwtests. 2015-12-12 12:59:31 +00:00
James
95879706d1 Merge pull request #117 from achurch/cpu-interpreter-fixes
Fix CPU interpreter bugs
2015-12-12 12:53:48 +00:00
Andrew Church
a241ddbb28 Make fpr_t.paired1 a double to help out JIT. 2015-12-12 03:09:51 +09:00
Andrew Church
ecfa6b195d Fix the ps_sum instructions. 2015-12-12 02:11:48 +09:00
Andrew Church
76f4091691 Fix floating-point comparison instructions. 2015-12-12 02:04:40 +09:00
Andrew Church
948b816413 Prevent host FPU exceptions from leaking into a new emulated CPU thread. 2015-12-12 02:03:49 +09:00
Andrew Church
181deef72a Fix ps_res and ps_rsqrte. 2015-12-11 05:47:34 +09:00
Andrew Church
88a8e20a95 FMA instructions do not treat overflow of the intermediate result as an
infinity for the purpose of VXISI.
2015-12-11 03:59:32 +09:00
Andrew Church
7130f5186c Fix paired-single FMA instructions. 2015-12-11 03:45:12 +09:00
Andrew Church
4cbf72bfd1 Explicitly cast sign bit to uint32 for MSVC. 2015-12-11 01:10:27 +09:00
Andrew Church
ccea096af6 Fix paired-single elementary arithmetic instructions.
Also fix ps_merge silencing NaNs stored into slot 0.
2015-12-11 00:49:43 +09:00