Editing Talk:PS1 Emulation
Jump to navigation
Jump to search
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 178: | Line 178: | ||
</pre> | </pre> | ||
== | == Commands Info == | ||
=== Command IDs mapping === | === Command IDs mapping === | ||
Line 267: | Line 190: | ||
**0 = ? (used by SCPS-18011 Um Jammer Lammy, and SLPS-01818 Langrisser IV & V Final Edition [Disc1of2]) | **0 = ? (used by SCPS-18011 Um Jammer Lammy, and SLPS-01818 Langrisser IV & V Final Edition [Disc1of2]) | ||
In Um Jammer Lammy is used together with command 0x13, so it was a bit doubtful if it was a mistake. But Langrisser IV & V Final Edition [Disc1of2] uses it too and is the only command used by this disc, so it "should" do something. Um Jammer Lammy in netemu 3.40 was fixed only with command 0x0/0x0 (id/data) | In Um Jammer Lammy is used together with command 0x13, so it was a bit doubtful if it was a mistake. But Langrisser IV & V Final Edition [Disc1of2] uses it too and is the only command used by this disc, so it "should" do something. Um Jammer Lammy in netemu 3.40 was fixed only with command 0x0/0x0 (id/data) | ||
=== Command 0x01 (netemu 3.40 up to 4.88) === | === Command 0x01 (netemu 3.40 up to 4.88) === | ||
Line 636: | Line 558: | ||
Value is integer that is later converted to double float using fcfid, and truncated to single precision by frsp.<br> | Value is integer that is later converted to double float using fcfid, and truncated to single precision by frsp.<br> | ||
I'm not familiar with CELL floating point unit quirks, but value could be just single precision float from the start, why complicate that so much?<br> | I'm not familiar with CELL floating point unit quirks, but value could be just single precision float from the start, why complicate that so much?<br> | ||
_xcdrom_thread related. | |||
=== Command 0x04 (netemu 3.40 up to 4.88) === | === Command 0x04 (netemu 3.40 up to 4.88) === | ||
*Valid values found: 0x4, 0x7, 0x14 (20d), 0x46 (70d), 0x64 (100d), 0xC8 (200d), 0xFFFFFF38 ( | *Valid values found: 0x4, 0x7, 0x14 (20d), 0x46 (70d), 0x64 (100d), 0xC8 (200d), 0xFFFFFF38 (????????) | ||
*Default value: 0 | *Default value: 0 | ||
*_xcdrom_thread related. | *_xcdrom_thread related. | ||
=== Command 0x05 (netemu 3.40 up to 4.88) === | === Command 0x05 (netemu 3.40 up to 4.88) === | ||
Line 657: | Line 573: | ||
*Default value: 0 | *Default value: 0 | ||
*_xcdrom_thread related. | *_xcdrom_thread related. | ||
=== Command 0x07 (netemu 4.83 up to 4.88) === | === Command 0x07 (netemu 4.83 up to 4.88) === | ||
*Default value: 0 | *Default value: 0 | ||
*_xcdrom_thread related. | *_xcdrom_thread related. | ||
=== Command 0x08 (netemu 3.40 up to 4.88) === | === Command 0x08 (netemu 3.40 up to 4.88) === | ||
Line 697: | Line 608: | ||
=== Command 0x12 (netemu 4.83 up to 4.88) === | === Command 0x12 (netemu 4.83 up to 4.88) === | ||
*Or command 0x10 (netemu 3.40) | *Or command 0x10 (netemu 3.40) | ||
=== Command 0x13 (netemu 4.83 up to 4.88) === | === Command 0x13 (netemu 4.83 up to 4.88) === | ||
*Default value: 0 | *Default value: 0 | ||
=== Command 0x14 (netemu 4.83 up to 4.88) === | === Command 0x14 (netemu 4.83 up to 4.88) === | ||
Line 715: | Line 620: | ||
=== Command 0x16 (netemu 4.83 up to 4.88) === | === Command 0x16 (netemu 4.83 up to 4.88) === | ||
*Default value: 0 | *Default value: 0 | ||
=== Command 0x17 (netemu 4.83 up to 4.88) === | === Command 0x17 (netemu 4.83 up to 4.88) === | ||
Line 731: | Line 632: | ||
When value is not zero is returned by emulator when game try to read cop0r3 (BPC) register. When value is 0 (default), emulator return real BPC content. | When value is not zero is returned by emulator when game try to read cop0r3 (BPC) register. When value is 0 (default), emulator return real BPC content. | ||
This command can be successfully used for 90% of libcrypt games. More importantly address where magic word is stored is known, so payloads like cobra should be able to just write value there on emulator init. List of magic words is already known, and can be included in cobra source, or as external txt for game managers like webman. | |||
Runtime which read it can be patched directly (example from ps1_netemu 4.86): | |||
<pre> | |||
seg003:00106570 read_cop0r3___BPC: | |||
seg003:00106570 li r3, 0x17 # jumptable 0000000000106538 case 0 | |||
seg003:00106574 bl ReadInternalConfigValue <---------- can be replaced with li r3, magic_word | |||
seg003:00106578 nop | |||
seg003:0010657C cmpdi r3, 0 | |||
seg003:00106580 beq def_106538 # jumptable 0000000000106538 default case, cases 1,2,4,6-8 | |||
seg003:00106584 mr r29, r3 | |||
</pre> | |||
=== Command 0x18 (netemu 4.83 up to 4.88) === | === Command 0x18 (netemu 4.83 up to 4.88) === | ||
*Default value: 0 | *Default value: 0 | ||
=== Command 0x19 (netemu 4.83 up to 4.88) === | === Command 0x19 (netemu 4.83 up to 4.88) === | ||
Line 750: | Line 658: | ||
=== Command 0x1B (netemu 4.83 up to 4.88) === | === Command 0x1B (netemu 4.83 up to 4.88) === | ||
*Default value: 0x3E8 | *Default value: 0x3E8 | ||
=== Command 0x1C (netemu 4.83 up to 4.88) === | === Command 0x1C (netemu 4.83 up to 4.88) === | ||
*Or command 0x18 (netemu 3.40) | *Or command 0x18 (netemu 3.40) | ||
*Or command 0x1A (netemu 3.55 ?) | *Or command 0x1A (netemu 3.55 ?) | ||
*Or command 0x02 (netemu 1.70) - | *Or command 0x02 (netemu 1.70) | ||
Destruction Derby (SCUS-94302) was fixed in netemu 1.70 by using 0x02/0x02 (id/data), and in netemu 4.88 with 0x38/0x02 (id/data). Netemu 1.70 command 0x02 was remapped to netemu 4.88 command 0x1C but are 2 different commands. What happened is sony decided to change the old command by the new command 0x32 (didnt existed in netemu 1.70) at some intermediate revision. The interesting detail of this story is this change in the destruction derby config seems to indicate netemu 4.88 command ids 0x1C and 0x38 with data value 0x2 can be used to solve the same problem. Netemu 4.88 command 0x38 reloads the game with ps1_newemu.self 4.88 that contains another config with the command 0x3/0x2 (id/data)<br> | |||
Old command 0x02 is related to new 0x1C. But it seems that sony decided to split/extend that little bit. Instead of 0x02 there is now 0x1C, 0x1D, 0x1E, so config is now more flexible. All that is "JOY" PSX HW IO related, but "JOY" handle also memory card, so this is no 100% clear which one it helps without more reversing. --kozarovv. | |||
=== Command 0x1E (netemu 4.83 up to 4.88) === | === Command 0x1E (netemu 4.83 up to 4.88) === | ||
*Default value: 0x7D0 | *Default value: 0x7D0 | ||
*xPadThread related. | *xPadThread related. | ||
=== Command 0x21 (netemu 4.83 up to 4.88) === | === Command 0x21 (netemu 4.83 up to 4.88) === | ||
Line 790: | Line 677: | ||
*Default value: 0x3E8 | *Default value: 0x3E8 | ||
*PS1 GPU related. | *PS1 GPU related. | ||
=== Command 0x23 (netemu 4.83 up to 4.88) === | === Command 0x23 (netemu 4.83 up to 4.88) === | ||
Line 819: | Line 705: | ||
*Default value: 0 | *Default value: 0 | ||
*PS1 GPU related. | *PS1 GPU related. | ||
=== Command 0x32 (netemu 4.83 up to 4.88) === | === Command 0x32 (netemu 4.83 up to 4.88) === | ||
Line 852: | Line 732: | ||
*Or command 0x2C in ps1_netemu.self 3.40 | *Or command 0x2C in ps1_netemu.self 3.40 | ||
*Or command 0x2E in ps1_netemu.self 3.55 ? | *Or command 0x2E in ps1_netemu.self 3.55 ? | ||
*Or command 0x15 in ps1_emu.self 4.88 ? | |||
*Valid values found: | *Valid values found: | ||
** | **1 = relaunch the game with ps1_emu.self | ||
**2 = relaunch the game with ps1_newemu.self | |||
**3 = relaunch the game with ps1_netemu.self (value 3 found inside ps1_emu.self) | |||
If the value is different than 0 relaunch the game with a different emu. | |||
This command doesn't seem to work with the current Cobra version with the latest WebMAN MOD, as well as with IRISMAN's payload. Gaia Seed: Project Seed Trap (SLPS-00624) and Um Jammer Lammy (SCUS-94448) boot in netemu instead of newemu while the PS one Classics versions boot into newemu. Is there any known reason this happens? --[[User:Mrjaredbeta|Mrjaredbeta]] ([[User talk:Mrjaredbeta|talk]]) 18:59, 29 May 2022 (UTC) | |||
=== | === Orphan commands info === | ||
* 0xE param is divider for 0x204CC00 (psx cpu speed), result is stored on fixed address and used by many functions. <!-- we need to move this note to the new page sections and delete this one originally named "Known ps1emu.self commands" --> | |||
* | |||
== Known bugs == | == Known bugs == | ||
=== ps1_netemu.elf | ===ps1_netemu.elf=== | ||
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 916: | Line 769: | ||
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. | ||
== GTE commands == | == GTE commands == |