Commit graph

1147 commits

Author SHA1 Message Date
Unknown W. Brackets
fd1b01b573 Fix the vrndi.s output range.
Was previously outputting only valid positive float values, but should use
a much wider range of a u32.

Might've affected randomness in some games.
2014-09-01 22:33:01 -07:00
Unknown W. Brackets
5f6f6827b5 jit: Update rounding mode immediately on ctc1. 2014-08-30 23:48:27 -07:00
Unknown W. Brackets
e8cdbcc33f x86jit: Fix some flags/EAX trashing in rounding.
Fixes #6810.
2014-08-30 16:46:43 -07:00
Unknown W. Brackets
8daff0a25e armjit: Fix some downcount issues with rounding.
When setting the rounding mode we need to be super careful about not
destroying flags or R0 if they are needed.
2014-08-30 16:43:13 -07:00
Unknown W. Brackets
820a8e8f2b armjit: Don't reset downcount on fpu instructions.
It's maintained always, oops.
2014-08-30 16:30:13 -07:00
Unknown W. Brackets
d4ec7d8019 Add another memcpy variant.
Fixes #4324 (Marvel Ultimate Alliance 2 videos), thanks daniel229.
2014-08-23 08:45:25 -07:00
Henrik Rydgård
5d836bfa5a Merge pull request #6765 from hrydgard/thin3d
Switch UI drawing from GL to Thin3D. This activates the D3D9 path as well.
2014-08-23 10:52:21 +02:00
Henrik Rydgård
b7da82eebb Merge pull request #6762 from unknownbrackets/fpu-rounding
Handle fpu rounding mode at least in jits
2014-08-23 10:43:22 +02:00
Unknown W. Brackets
e9b5e6f277 armjit: Maintain rounding mode throughout jit. 2014-08-22 19:57:50 -07:00
Henrik Rydgard
808f05da89 (Partially) slip thin3d underneath DrawBuffer. 2014-08-22 20:54:53 +02:00
Unknown W. Brackets
925557ed47 x86jit: Maintain the rounding mode always.
This should be less often than doing it per block that uses fpu, unless
the game doesn't use fpu much at all.
2014-08-22 09:53:00 -07:00
Henrik Rydgård
f8a4236d58 Merge pull request #6679 from unknownbrackets/gpu-blend
Handle doubled alpha blending using premultiplication
2014-08-22 10:06:24 +02:00
Unknown W. Brackets
1fcbb7bbd4 armjit: Respect the rounding mode for mul/etc. 2014-08-22 00:32:01 -07:00
Unknown W. Brackets
ab13b36484 x86jit: Implement cvt.w.s.
Not really used that often, anyway, but easy enough and good for testing
that we set the rounding mode correctly.
2014-08-22 00:01:06 -07:00
Unknown W. Brackets
dc91dc1ce8 x86jit: Support fpu rounding modes for mul, etc.
Fixes Gods Eater Burst loading PSP savedata, but can no longer load old
savedata.
2014-08-21 23:59:55 -07:00
Sacha
97e93f48fd Clean up LitPool code and re-enable flushing in AsmJit 2014-08-20 18:29:37 +10:00
Unknown W. Brackets
d52fdafa3c Note the location of a memset variant. 2014-08-18 23:20:44 -07:00
Unknown W. Brackets
9d3cf346c3 Clarify GetSureBranchTarget() for fpu branches.
They also have CONDTYPE_ flags.  Looks like this was just getting lucky
that rs can't equal rt, but the code looks confusing when you're looking
at it from an fpu/vfpu perspective.
2014-08-18 07:46:48 -07:00
Unknown W. Brackets
78296d15c6 Don't recurse when disasming an emuhack.
Although, should this happen?  Apparently does in Peace Walker.
2014-08-17 18:43:59 -07:00
Henrik Rydgård
60eaefa6ad Merge pull request #6680 from unknownbrackets/replace-funcs
Disable most replacements and use checked mem access in them
2014-08-04 23:44:20 +02:00
Unknown W. Brackets
ac94dbcc69 Show the replaced instruction in disassembly.
Useful while debugging.
2014-08-03 19:23:29 -07:00
Unknown W. Brackets
abd1f4e58a Disassemble bne/etc. using rs, rt order.
The order makes more logical sense from game disassembly, and matches the
assembler.  Fixes #6632.
2014-08-03 19:22:18 -07:00
Unknown W. Brackets
245a2a3be0 Don't zero out downcount in replacements.
It doesn't write out js.downcountAmount in any of these cases, so zeroing
it is wrong.
2014-08-03 13:22:30 -07:00
Unknown W. Brackets
d060a06fa6 Disable a bunch of function replacements.
These are just for speed, let's turn them off.  Using a flag because:
 * I think there's still some issue with savestates, not sure.
 * We might swap this flag to a separate option.
2014-08-03 13:15:41 -07:00
Henrik Rydgard
82421f4dcf x86 jit: Further fix for nor, thanks unknown
See #6638
2014-07-27 22:26:35 +02:00
Henrik Rydgard
903ddbc513 x86 JIT: Fix bug where NOR would not get computed correctly in corner case
(CompTriArith can end up not actually mapping rd to a register when taking
a shortcut)

May fix the JIT issue mentioned by CPkmn and located by daniel229 as an aside in #6638
2014-07-27 21:41:41 +02:00
Sacha
6ce3765b12 Sailfish: More compatibility with SailFish OS. It also needs stddef where Maemo does.
Set packaging by default for iOS with b.sh.
2014-07-24 23:20:09 +10:00
Unknown W. Brackets
6aa9b8aa36 Limit stack walk distance a bit.
It was spending 0.5s in debug scanning all of memory for an entry (due to
some fp/sp tricks that aren't well detected yet.)  Let's just assume a 1MB
func doesn't need to be walked properly.
2014-07-20 21:52:55 -07:00
Unknown W. Brackets
b03460c169 Improve function range detection.
This improves a pattern like this:

  j endOfLoop;
  li v0, 0;
  startOfLoop:
  addiu v0, v0, 1
endOfLoop:
  bne v0, a0, startOfLoop;
  nop
  jr ra
  nop

Where it jumps to the end of the loop, which only jumps back to the top of
the loop.  This might misdetect a few cases of tail recursion, but only
when the funcs are right next to each other.

Also, stops scanning at a jr ra, which was causing funcs to be incorrectly
long in cases.
2014-07-20 14:42:20 -07:00
Henrik Rydgård
0e5679c833 Revert "Detect Peace Walker's anti-cheat hash func" 2014-07-20 23:39:11 +02:00
Henrik Rydgård
06f058de54 Merge pull request #6506 from unknownbrackets/replace-funcs
Detect Peace Walker's anti-cheat hash func
2014-07-18 09:34:46 +02:00
Unknown W. Brackets
a59d8b5c1f Override the codehashing func used in Peace Walker.
This makes the demo work fine even with jit enabled.  May help the full
game when fighting a certain boss.
2014-07-18 00:23:26 -07:00
Unknown W. Brackets
1fd6214945 Improve function range detection.
This improves a pattern like this:

  j endOfLoop;
  li v0, 0;
  startOfLoop:
  addiu v0, v0, 1
endOfLoop:
  bne v0, a0, startOfLoop;
  nop
  jr ra
  nop

Where it jumps to the end of the loop, which only jumps back to the top of
the loop.  This might misdetect a few cases of tail recursion, but only
when the funcs are right next to each other.

Also, stops scanning at a jr ra, which was causing funcs to be incorrectly
long in cases.
2014-07-18 00:22:19 -07:00
Sacha
6957808b97 ArmJit: Optimisation when comparing float against 0.0f 2014-07-17 05:12:43 +10:00
Sacha
d4c983d9e1 Android: ARMv5 fix 2014-07-17 02:34:22 +10:00
Unknown W. Brackets
292a9ea567 Clear module text and bss on unload.
Text is set to break instructions, data/bss to -1.  Matches results on a
PSP.
2014-07-13 22:00:32 -07:00
Unknown W. Brackets
81096f6bd0 Hook Dissidia's avi record func.
This makes it so replays can be recorded.  Though you could probably just
record separately anyway.
2014-07-13 08:36:34 -07:00
Unknown W. Brackets
09b9d2ad81 Keep track of ranges that have emuhack ops.
So that we can invalidate them smarter.
2014-07-05 16:25:16 -07:00
Unknown W. Brackets
d2e7dfcc51 Minor logging improvement. 2014-07-05 13:19:53 -07:00
Unknown W. Brackets
4b9229a5ba x86jit: Flush the PC before r/w in debug.
This way we get better log output.
2014-07-05 12:57:44 -07:00
Unknown W. Brackets
c0e6f26bb5 Fix startDefaultPrefix tripping.
We want the regs already initialized when we set this up.
2014-06-30 08:10:14 -07:00
Henrik Rydgård
bfffe33438 Merge pull request #6469 from unknownbrackets/logging
Enforce semicolons at the end of log lines
2014-06-30 11:44:02 +02:00
Unknown W. Brackets
433f4eb00a Use the ARM rounding mode flag for conversions.
It's at least much simpler.  Not sure if faster.  Handles NAN correctly.
2014-06-29 20:36:00 -07:00
Unknown W. Brackets
f339f7d539 armjit: Handle NAN correctly in float conversion. 2014-06-29 20:05:59 -07:00
Unknown W. Brackets
c168db5943 armjit: Fix really bad typo in cvt.w.s. 2014-06-29 19:43:17 -07:00
Unknown W. Brackets
0078faef8b Fix some log semicolons that might affect logic.
But, these should all be right.
2014-06-29 19:09:38 -07:00
Unknown W. Brackets
5db79dcf11 Fix some missing semicolons on log statements. 2014-06-29 19:09:37 -07:00
Unknown W. Brackets
252100aee5 Remove outdated comment (real cause found/fixed.) 2014-06-28 16:06:10 -07:00
Unknown W. Brackets
f008bebab4 armjit: Fix floor/ceil/cvt.w.s rounding.
Unfortunately, correctly rounding is probably slower.
2014-06-28 00:38:57 -07:00
Unknown W. Brackets
f544a87b2f jit: Initialize startDefaultPrefix when switching. 2014-06-28 00:38:56 -07:00