Commit Graph

177 Commits

Author SHA1 Message Date
James Benton
45027c2add common: Remove old cerealjsonoptionalinput.h 2017-04-24 23:32:35 +01:00
Andrew Church
50b1b8b133 posix: Use TMPDIR instead of shm_open for memory backing files.
The amount of memory available for shm objects is limited on some
systems, so use a normal file instead of an shm object as the backing
store for emulated memory.

Also document the cause and workaround for SIGBUS crashes.
2017-04-24 18:07:58 +09:00
James Benton
b562c00ba6 cmake: Fix trying to link -rt on OSX 2017-04-21 00:19:39 +01:00
James Benton
1a5cafe6ac common: Fix usage of ftruncat64 on OSX. 2017-04-21 00:19:39 +01:00
James Benton
3c3646147f New virtual memory implementation. 2017-04-21 00:19:39 +01:00
James Benton
d269159e68 platform: Fix platform::freeMemory.
Size must be 0 for VirtualFree with MEM_RELEASE.
2017-04-17 11:01:00 +01:00
Peter Mackay
f16c7eebf3 Use PLATFORM_APPLE rather than __APPLE__. 2017-04-16 13:24:10 +01:00
Peter Mackay
241f678605 Fix differing context struct on macOS. 2017-04-16 09:32:05 +01:00
James Benton
eacffc8ac6 Fix linux build 2017-04-13 13:05:27 +01:00
James Benton
cb0fa4709b Abstract Windows / POSIX socket differences behind platform_socket.h 2017-04-13 13:05:27 +01:00
Peter Mackay
5cc3c0e9d0 Fix munmap of incorrect address. 2017-04-13 01:15:01 -07:00
James Benton
6f5b940810 Add support for enum flags. 2017-04-06 23:19:44 +01:00
James Benton
4c2049bf47 New JIT implementation using libbinrec. 2017-04-01 17:04:30 +01:00
James Benton
bb9a7638d5 be_ptr: Fix implicit integer cast. 2017-03-27 23:19:12 +01:00
James Benton
df360a1e51 Add explicit be_ptr cast operator. 2017-03-27 23:19:12 +01:00
Carl Kenner
82fdabb74b Add be_val<float> and VS magic numbers to natvis.
Also make Visual Studio automatically use natvis.
2017-03-26 22:08:10 +10:30
Carl Kenner
9a72281ed9 Rename and move vsdebuggervis.natvis into common 2017-03-26 22:01:20 +10:30
James Benton
20eb74bfac common: Update JSONOptionalInput to align with latest changes to cereal. 2017-03-01 13:43:16 +00:00
James Benton
94b97d79ef Remove types.h and virtual_ptr.h 2017-03-01 13:43:16 +00:00
James Benton
2edad665a3 Use CMake to build for Windows. 2017-02-20 19:25:39 +00:00
James Benton
efa6047236 common: Fix usage of _wassert which is disabled when NDEBUG is defined. 2017-02-18 17:05:41 +00:00
Andrew Church
8fd700878c interpreter: Implement fres/ps_res and frsqrte/ps_rsqrte correctly. 2017-01-04 07:24:21 +09:00
Andrew Church
5fff296aaa Remove execute permissions from source files. 2016-12-14 18:11:38 +09:00
James Benton
022f7a8d47 Modify ELF reading to use be_val with structs.
This allows us to delete the old shit BigEndianView.
2016-10-10 20:05:17 +01:00
James Benton
9581475be9 common: Fix float bitfield values. 2016-09-04 22:26:15 +01:00
Andrew Church
ecced575ac Fix OpenGL locking errors detected by -Wshadow.
Also fix other shadowing warnings throughout the codebase, and
enable shadowing warnings flag by default for CMake builds (using
-Werror=shadow except in decaf-cli and decaf-sdl, where excmd.h
triggers shadowing warnings).
2016-09-04 13:20:35 +01:00
James Benton
34cd5982da decaf: Rewrite filesystem.
Adds support for writing files to host file system.
Adds file permissions to prevent corruption of game files.
2016-09-02 01:34:22 +01:00
Brett Lawson
b4dc7ad850 Significant improvements to audio handling.
This commit refactors the audio system to properly dispatch
all of the callbacks (I think).  It also does mixing at the
correct bit levels.  It also fixes some bugs with ADPCM
decoding.  It also properly downmixes the AUX buffers.  It
probably also does other things, but I can't remember
anymore...
2016-08-30 20:23:01 -07:00
James Benton
77d4fe6273 snd_core: Store more AX Device data. 2016-08-30 01:37:05 +01:00
Brett Lawson
07d519ca3c Fix alignment issue with teenyheap.
This caused allocations that fit exactly to fail to be
allocated due to adjSize being increased to allow alignment
as a pre-step.  This modifies it to check for the ability
to do alignment on a per-block basis instead.
2016-08-23 02:26:03 -07:00
James Benton
78daf1f1d6 Add a much more lenient cereal json input archive.
- All values are optional, value will not be touched in the missing case
- Adds rapidjson flags for kParseCommentsFlag and kParseTrailingCommasFlag
2016-08-18 23:08:44 +01:00
Brett Lawson
77c6cec9fe Fix bug causing incorrect mip level count to be generated.
Our calculation of the number of mip levels for a surface
incorrectly used Log2, which returned one less level than
was intended.  Additionally, the specific logic between
how Log2 works and cntlzw might be relevant, so I fixed it
to use exactly the same logic as GX2.
2016-08-15 22:23:52 -07:00
Andrew Church
a314800690 common: Add POSIX support for illegal instruction exceptions. 2016-08-16 17:59:37 +09:00
Brett Lawson
53ae9b8884 Fix bug causing teenyheap to give overlapping allocations. 2016-08-15 19:07:27 -07:00
Brett Lawson
d2876d3bba Add windows support for illegal instruction exceptions. 2016-08-15 00:07:06 -07:00
James Benton
64e8c0ed1c bitfield: Fix gcc build.
y u do dis gcc plz
2016-08-15 18:23:28 +01:00
James Benton
c2b17f9239 common: Fix bitfield for signed types. 2016-08-15 01:42:33 +01:00
James Benton
29d6797231 Update spdlog. 2016-08-09 14:16:50 +01:00
James Benton
16b241ddc0 opengl: Use fixed_point classes for sampler MIN_LOD, MAX_LOD and LOD_BIAS. 2016-08-09 13:27:10 +01:00
James Benton
893aa29335 bitfield: Add support for fixed_point values in bitfields. 2016-08-09 13:27:10 +01:00
Brett Lawson
6e86a79609 A bunch of different AX implementations and fixes.
We now use the fixed point class to handle some cases
of fixed point.  I also reversed a bunch of things out
of sndcore2.rpl.  Not all of the things I reversed are
currently being used (currentOffsetFrac for instance).
2016-08-03 20:18:30 -07:00
Brett Lawson
0f71013d5b Added SG14 fixed_point library and some common fixed types. 2016-08-03 20:18:25 -07:00
Brett Lawson
1e01983e2e Merge pull request #214 from achurch/llvm-bug-workaround
interpreter: Work around a stupid LLVM bug.
2016-08-05 10:11:40 -07:00
James Benton
d92925d662 common: Improve bitfield syntax.
- bitfield.field() instead of .field().get()
- bitfield.field(x) instead of .field().set(x)
2016-08-04 16:07:21 +01:00
James Benton
ab8ad3b5e1 common: Fix bitfield compilation on GCC.
GCC is a bit funny here, fmt::format must be taking a const T& which
ends up requiring a proper definition of MaxValue in a .cpp somewhere
so it can take address. So to get around that we use static_cast to
force an lvalue to be passed in instead.

Thanks gcc!
2016-07-23 20:52:41 +01:00
James Benton
73b6a6e68d common: Print stacktrace when an assert is hit. 2016-07-23 16:00:17 +01:00
James Benton
f165adff7a common: Improve bitfield assert messages. 2016-07-23 15:59:50 +01:00
Andrew Church
e285c3c5e7 interpreter: Work around a stupid LLVM bug.
LLVM miscompiles code which checks floating-point exceptions because it
doesn't know about them (http://llvm.org/bugs/show_bug.cgi?id=6050).
This affects the ps_sum1 implementation, so work around it by disabling
optimization for that function when building with Clang.
2016-07-23 09:48:42 +09:00
Andrew Church
ae2fe765c6 interpreter: Fix improper truncation of ps1 value. 2016-07-21 23:26:11 -07:00
James Benton
e0076a5541 common: Implement Windows getConfigDirectory.
Uses the %APPDATA% Roaming folder.
2016-07-16 12:35:01 +01:00