Editing Talk:PS1 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 868: Line 868:
== Known bugs ==
== Known bugs ==


=== ps1_netemu.elf ===
===ps1_netemu.elf===
==== Cdr int reads with nonstandard index ====
Emulator ignore interrupt flag register and interrupt enable register reads if cdrom index is 2, or 3. Reads like that are undocummented behavior, but confirmed to be successful on real hardware. Also Nocash docs, and Duckstation source handle that correctly, and i remember there are games which used that.
Emulator ignore interrupt flag register and interrupt enable register reads if cdrom index is 2, or 3. Reads like that are undocummented behavior, but confirmed to be successful on real hardware. Also Nocash docs, and Duckstation source handle that correctly, and i remember there are games which used that.


Line 892: Line 891:
  0xD8264  clrlwi    r0, r0, 31  #hex 54 00 07 FE
  0xD8264  clrlwi    r0, r0, 31  #hex 54 00 07 FE
This change cdrom.index & 3, into cdrom.index & 1. This way index 2, and 3 will be respected as 0, and 1. Sadly there is no easy hex pattern, so patch need to be done manually. Memory offsets for 4.86.
This change cdrom.index & 3, into cdrom.index & 1. This way index 2, and 3 will be respected as 0, and 1. Sadly there is no easy hex pattern, so patch need to be done manually. Memory offsets for 4.86.
==== Bad encoding of malformed conditional branch 0 ====
Emulator don't ignore few bits, and expect they are 0. While real hardware seems to don't care about them.
<pre>
  31..26 |25..21|20..16|15..11|10..6 |  5..0  |
  6bit  | 5bit | 5bit | 5bit | 5bit |  6bit  |
  -------+------+------+------+------+--------+------------
  000001 | rs  | 0XXX0| <--immediate16bit--> | bltz
  000001 | rs  | 0XXX1| <--immediate16bit--> | bgez
  000001 | rs  | 1XXX0| <--immediate16bit--> | bltzal
  000001 | rs  | 1XXX1| <--immediate16bit--> | bgezal
</pre>
Problem start when bits 17,18,19 are not zero. Emulator don't clear those bits, and explicitly check only for 0x0,0x1,0x10,0x11.
<pre>
r24 hold 20..16 bits extracted from opcode.
0x107958 bcondz_107958:                          # CODE XREF: r3000_opcode_table+12C↑j
0x107958                cmpwi    cr7, r24, 1  # jumptable 001067D4 case BcondZ
0x10795C                beq      cr7, loc_107E98
0x107960                cmplwi    cr7, r24, 1
0x107964                blt      cr7, loc_107E78
0x107968                cmpwi    cr7, r24, 0x10
0x10796C                beq      cr7, loc_1082A4
0x107970                cmpwi    cr7, r24, 0x11
0x107974                beq      cr7, loc_10821C
</pre>
Correct solution here will be patch to AND r24 with 0x11 first, to clear meaningless bits before comparison.
This is reason why emulator fail this "Branch Advance" CPU test: https://emulation.gametechwiki.com/index.php/PS1_Tests#CPU . Possibly standard "Branch" test is failed for the same reason.


== GTE commands ==
== GTE commands ==
Please note that all contributions to PS3 Developer wiki are considered to be released under the GNU Free Documentation License 1.2 (see PS3 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)