Editing Talk:PS2 Emulation

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 36: Line 36:
  --ee-cache-breaks-block
  --ee-cache-breaks-block
  No matter which value is used, 1 is set.
  No matter which value is used, 1 is set.
== Few popular misunderstandings ==
*vu-xgkick-delay take integer between 0-31 (confirmed on both emulator and compiler side), and not float (0.5 is invalid, will be truncated to 0 probably).
*Cop2 rounding in PCSX2 is governed by "EE/FPU" rounding setting, not by VU or VU0.
*Cop2 clamping is hardcoded in PCSX2 as far as i know, if no then is likely also governed by EE/FPU setting not VU/VU0.
*xx-no-clamping setting is not really no clamping known from PCSX2. This is a special mode which can be used regardless of other clamp commands. For comparison, PCSX2 have similar mode only for FPU (Full). To fully mimic that mode, we still need fpu-to-double enabled.


== ee-native-function ==
== ee-native-function ==
Line 244: Line 251:


Same goes for "kernel" injections, they are also based on ID + Hash + address. Generally all "injections" should be safe to be enabled by configs. There is really small chance for hash/address(and id) collision. Not to be confused with "native" / "native-patch" !
Same goes for "kernel" injections, they are also based on ID + Hash + address. Generally all "injections" should be safe to be enabled by configs. There is really small chance for hash/address(and id) collision. Not to be confused with "native" / "native-patch" !
== Fast Accurate MUL Implementation ==
Whilst Accurate MUL is implemented as very resource heavy fully fledged soft float operation, there is theoretically less accurate but very fast "accurate MUL" available. Surprisingly this is not a copy pasted PS3 implementation (no need to reach Olympus from Lop Nor this time). While this implementation is assumed to be less accurate (than soft floats), the result should be the same as with soft floats. r14 and esi are source floats for operation. So, here it comes:
<pre>
mov    edx, r14d
mov    eax, esi
xor    eax, r14d
shr    edx, 23
and    eax, 80000000h
and    edx, 0FFh
jz      mul_end        ; mul by denormal
mov    ecx, 817h
bextr  ecx, esi, ecx  ; esi >> 23 & 0xFF
jz      mul_end        ; mul by denormal
and    r14d, 7FFFFFh
and    esi, 7FFFFFh
add    edx, ecx
or      r14d, 800000h
or      esi, 800000h
imul    rsi, r14
shr    rsi, 23
vcvtsi2ss xmm0, xmm0, rsi
vaddss  xmm0, xmm0, cs:(float)0.5
vmovd  ecx, xmm0
shr    ecx, 23
lea    edx, [rcx+rdx-115h]
cmp    edx, 0FFh
jle    case1
mov    ecx, 7F800000h
mov    esi, 7FFFFFh
jmp    case2
case1:
add    ecx, -150
xor    ebx, ebx
shr    esi, cl
mov    ecx, edx
and    esi, 0FF7FFFFFh
shl    ecx, 23
test    edx, edx
cmovle  esi, ebx
cmovle  ecx, ebx
case2:
or      esi, eax
or      esi, ecx
mov    eax, esi
mul_end:
ret
</pre>


= RESEARCH TO DO =
= RESEARCH TO DO =
Please note that all contributions to PS4 Developer wiki are considered to be released under the GNU Free Documentation License 1.2 (see PS4 Developer wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:

Cancel Editing help (opens in new window)