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 14: | Line 14: | ||
Offset in emu memory (ps1_netemu 4.86) | name | info | Offset in emu memory (ps1_netemu 4.86) | name | info | ||
0x10C5E4 GP1_reset_gpu | 0x10C5E4 GP1_reset_gpu | ||
0x10C88C GP1_reset_command_buffer | 0x10C88C GP1_reset_command_buffer | ||
Line 140: | Line 139: | ||
</pre> | </pre> | ||
== Command IDs mapping == | |||
The command IDs differs in between the PS1 emulator types and versions because are an indirect ID, it seems every command ID is mapped to a static ID in a separated table<br> | The command IDs differs in between the PS1 emulator types and versions because are an indirect ID, it seems every command ID is mapped to a static ID in a separated table<br> | ||
The command ID's varies in between firmware versions, most probably because new functions was added every few versions, reorganized, etc... and this changes created a "displacement" of the old commands that causes them to increase his ID<br> | The command ID's varies in between firmware versions, most probably because new functions was added every few versions, reorganized, etc... and this changes created a "displacement" of the old commands that causes them to increase his ID<br> | ||
At the time of writing this we dont know how to map that variable ID's to an static ID (that could be valid for all firmware versions), so by now in this list is needed to indicate the firmware version where the command ID was found<br> | At the time of writing this we dont know how to map that variable ID's to an static ID (that could be valid for all firmware versions), so by now in this list is needed to indicate the firmware version where the command ID was found<br> | ||
Coincidentially there are a few commands that preserves his ID in between emulator types and revisions, most probably is because are the first commands implemented and the variable ID given to them is a very low value, so always was kept at a low position in the commands list and was not disturbed by the modifications made to the other commands. | Coincidentially there are a few commands that preserves his ID in between emulator types and revisions, most probably is because are the first commands implemented and the variable ID given to them is a very low value, so always was kept at a low position in the commands list and was not disturbed by the modifications made to the other commands. | ||
== Commands Info == | |||
=== Other 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" --> | |||
=== Command 0x00 (netemu 3.40 up to 4.88) === | === Command 0x00 (netemu 3.40 up to 4.88) === | ||
*Valid values found | *Valid values found | ||
**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 | 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 | ||
=== Command 0x01 (netemu 3.40 up to 4.88) === | === Command 0x01 (netemu 3.40 up to 4.88) === | ||
Line 275: | Line 161: | ||
=== Command 0x02 (netemu 3.40 up to 4.88) === | === Command 0x02 (netemu 3.40 up to 4.88) === | ||
The command data contains an offset that points to an area where are stored a list of sectors (4 bytes each), there are only 3 games using this command and are libcrypt protected: MediEvil (SCES-00311), Vagrant Story (SLES-02754), and Crash Team Racing (SCES-02105)<br> | |||
The command data contains an offset that points to an area where are stored a list of sectors (4 bytes each) | |||
The libcrypt protection is related with subchannel data stored by sectors, in redump.org this data is managed with the SBI files, displayed in a hexeditor view in each specific game page. If we convert the data from the official format to decimal and we compare it with the sector numbers in the redump.org SBI file it can be seen all the libcrypt protected sectors from the SBI file are included in the official format<br> | The libcrypt protection is related with subchannel data stored by sectors, in redump.org this data is managed with the SBI files, displayed in a hexeditor view in each specific game page. If we convert the data from the official format to decimal and we compare it with the sector numbers in the redump.org SBI file it can be seen all the libcrypt protected sectors from the SBI file are included in the official format<br> | ||
The official format seems to include a lot more sectors which purpose is unknown<br> | The official format seems to include a lot more sectors which purpose is unknown<br> | ||
There seems to be way to supply that data/command from external file. Some research by "Fedor Wearing A Fedora" [https://www.psx-place.com/threads/ps1-libcrypt-support-on-ps3-official-emus-research-thread.35836/page-13#post-318218 here] and [https://www.psx-place.com/threads/ps1-libcrypt-support-on-ps3-official-emus-research-thread.35836/page-13#post-318506 here]<br> | There seems to be way to supply that data/command from external file. Some research by "Fedor Wearing A Fedora" [https://www.psx-place.com/threads/ps1-libcrypt-support-on-ps3-official-emus-research-thread.35836/page-13#post-318218 here] and [https://www.psx-place.com/threads/ps1-libcrypt-support-on-ps3-official-emus-research-thread.35836/page-13#post-318506 here]<br> | ||
<u>Crash Team Racing</u> [http://redump.org/disc/798/ SCES-02105] (at absolute offset 0x1627E4 in ps1_netemu.self | <u>Crash Team Racing</u> [http://redump.org/disc/798/ SCES-02105] (at absolute offset 0x1627E4 in ps1_netemu.self 4.88) | ||
<small><pre style="height:410px"> | <small><pre style="height:410px"> | ||
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | ||
Line 422: | Line 307: | ||
</pre></small> | </pre></small> | ||
<u>MediEvil</u> [http://redump.org/disc/592/ SCES-00311] (at absolute offset 0x16298C in ps1_netemu.self | <u>MediEvil</u> [http://redump.org/disc/592/ SCES-00311] (at absolute offset 0x16298C in ps1_netemu.self 4.88) | ||
<small><pre style="height:275px"> | <small><pre style="height:275px"> | ||
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | ||
Line 511: | Line 396: | ||
</pre></small> | </pre></small> | ||
<u>Vagrant Story</u> [http://redump.org/disc/9978/ SLES-02754] (at absolute offset 0x162A8C in ps1_netemu.self | <u>Vagrant Story</u> [http://redump.org/disc/9978/ SLES-02754] (at absolute offset 0x162A8C in ps1_netemu.self 4.88) | ||
<small><pre style="height:350px"> | <small><pre style="height:350px"> | ||
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | ||
Line 636: | Line 521: | ||
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 536: | ||
*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 678: | Line 552: | ||
=== Command 0x0E (netemu 4.83 up to 4.88) === | === Command 0x0E (netemu 4.83 up to 4.88) === | ||
*Default value: 0x1F4 | *Default value: 0x1F4 | ||
*_xcdrom_thread related. | *_xcdrom_thread related. | ||
=== Command 0x0F (netemu 4.83 up to 4.88) === | === Command 0x0F (netemu 4.83 up to 4.88) === | ||
*Default value: 0xFA | *Default value: 0xFA | ||
*_xcdrom_thread related. | *_xcdrom_thread related. | ||
Line 694: | Line 566: | ||
*Default value: 0x7D | *Default value: 0x7D | ||
*_xcdrom_thread related. | *_xcdrom_thread related. | ||
=== 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 578: | ||
=== 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 728: | Line 587: | ||
*Or command 0x0A (newemu 3.40 up to 4.88) | *Or command 0x0A (newemu 3.40 up to 4.88) | ||
This is the libcrypt magic word. This command is used only in 3 games (SCES_016.95, SLES_019.07, SLES_013.01). see: [[PS1 Custom Patches]] | This is the libcrypt magic word. This command is used only in 3 games (SCES_016.95, SLES_019.07, SLES_013.01). see: [[PS1 Custom Patches]] | ||
In ps1_netemu there is | In ps1_netemu there is possbility to setup that command from one of ps1 classic files (PSISOIMG0000 / PSTITLEIMG000000 related). | ||
=== 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 602: | ||
=== 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 | *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 a new command (didnt existed in netemu 1.70) at some intermediate revision either because the old command was not fixing the problem completly or it was solving it in a dirty way. 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, so it seems netemu 4.88 command 0x1C is related with netemu 4.88 command 0x38 in some way | |||
=== 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 618: | ||
*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 808: | Line 635: | ||
*PS1 GPU related. | *PS1 GPU related. | ||
=== Command 0x2B (netemu 4.83 up to 4.88) === | === Command 0x2B(netemu 4.83 up to 4.88) === | ||
*Default value: 0 | *Default value: 0 | ||
*PS1 GPU related. | *PS1 GPU related. | ||
Line 819: | Line 646: | ||
*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 850: | Line 671: | ||
=== Command 0x38 (netemu 4.83 up to 4.88) === | === Command 0x38 (netemu 4.83 up to 4.88) === | ||
*Or command | *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. | |||
==Patches== | |||
====Disable Dithering==== | |||
Always set bit 9 in GP0 E1 command to 0. Patches apply to SPE PS1 GPU emulation program. Based on 4.86, but should be valid for all firmwares since 4.6x<br><br> | |||
For ps1_emu.elf | |||
<pre> | |||
search for: 23 EC A4 04 23 E3 3B 85 33 7E 26 00 32 05 86 00 0F 3D C6 11 | |||
replace to: 23 EC A4 04 23 E3 3B 85 33 7E 26 00 32 05 86 00 40 80 00 11 | |||
</pre> | |||
For ps1_netemu.elf | |||
<pre> | |||
search for: 7C 38 41 94 20 7F F4 94 0F 3D C6 3C 12 7F F3 8A | |||
replace to: 7C 38 41 94 20 7F F4 94 40 80 00 3C 12 7F F3 8A | |||
</pre> | |||
For ps1_newemu.elf | |||
<pre> | <pre> | ||
search for: 20 7F FD 4C 23 9D C5 85 32 05 B2 80 12 05 B2 0B 0F 3D C6 58 | |||
replace to: 20 7F FD 4C 23 9D C5 85 32 05 B2 80 12 05 B2 0B 40 80 00 58 | |||
</pre> | </pre> | ||
Patch for rpcs3 (newemu only) for testing purpose. | |||
<pre> | <pre> | ||
Version: 1.2 | |||
SPU-f3d8be702bf4cb8545656e37c29fcc6201a57991: | |||
"Disable Dithering": | |||
Games: | |||
All: | |||
All: [ All ] | |||
Author: "kozarovv" | |||
Patch Version: 1.0 | |||
Patch: | |||
- [ be32, 0xFB0, 0x40800058 ] | |||
</pre> | </pre> | ||
== | ==Psxtract== | ||
I updated psxtract to support proper subchannel data extraction for single, and multi discs. | |||
Based on most feature rich version from https://github.com/DeadlySystem/psxtract-2 github. Since i don't have github anymore, i think this is good place to share it. | |||
Only Windows version is updated! Linux code is not touched (i have no way to test). | |||
Please mirror or even make pr on github if that's prefered. | |||
* Download (source plus exe): https://www.mediafire.com/file/ytg875p1a6ph89f/psxtract-2-master.zip/file | |||
== ps1_rom.bin == | |||
. | |||
This file can be replaced by any ps1 rom image (incl. DTL models), and by most of PS2 rom images (maybe by all, deckard models untested). Replacing to bios from PS1 restore Sony logo at start up. That also should allow to run ps1 menu alone, but that's untested. Props to Jabu, iirc he figured out running Sony startup screen ages ago. | |||
. | Emulator have bug (netemu at least), that load whole 4MB file. They probably not changed that after stripping file from 4MB to 512KB. So any PS1/PS2(no deckard) bios image can be used unless is 4MB or less. All of that load games just fine. | ||
. | |||
. | === Possible Cobra implementation issues === | ||
. | Every CFW which use cobra module potentially can be affected by nasty bug that is there probably even before 7.00.<br> | ||
. | So the deal is patch in cobra that allow skip region check, example based on ps1_emu. | ||
. | |||
. | <pre>SprxPatch ps1_emu_patches[] = | ||
. | { | ||
. | { ps1_emu_get_region_offset, LI(R29, 0x82), &condition_true }, /* regions 0x80-0x82 bypass region check. */ | ||
{ 0 } | |||
}; | |||
. | |||
. | |||
. | |||
. | |||
</pre> | </pre> | ||
While patch actually skip region check, is also skipping part of code where region of ps3 is stored for future usage. And probably set whole emulation to JPN<br> | |||
This can be important because function that cobra patch, probably is responsible for selecting region of ps1_rom. <br> | |||
There is a string in emulator JJJJAEJEAEJJEJJA which seems to be selector for bios/rom region based on target ID ([[Product_Code]]). | |||
<pre>J J J J A E J E A E J J E J J A | |||
0x80 0x81 0x82 0x83 0x84 0x85 0x86 0x87 0x88 0x89 0x8A 0x8B 0x8C 0x8D 0x8E 0x8F</pre> | |||
Hard patch to 0x82 potentially lead to known PAL games frame pacing issues, and to desynced audio, and maybe more. While i can't test that i'm 100% sure that better solution here will be read third character of Title ID from SYSTEM.CNF file of disc/iso, and then patching same place with<br> ps1_emu_get_region_offset, LI(R29, title_id_based_region), &condition_true . <br> | |||
Generally if title have E then patch to ANY EU target ID, similar for US, for titles where U or E isn't found just use default J target ID. | |||
Above is based on static elf analyse, so i can't tell 100% that is an issue, but it looks like it in emu code. | |||
* Is that patch being applied every time, even on the PAL region console? I have never noticed any issues and I was playing the PAL games mostly. The only thing I noticed is the slowed and pitched down licence screen when the PAL game is launched through the ps1_netemu. --[[User:Agrippa|Agrippa]] ([[User talk:Agrippa|talk]]) 17:40, 6 January 2022 (UTC) | |||
. | * Ok, I have tested the Ape Escape PAL menu theme. There is neither any slowdown, nor pitch difference using either ps1_emu or ps1_netemu. As far as I know, no games are affected, because there are no multi region PS1 games ever released. As the video mode is set before the boot, everything seems to be ok. The cracktros are affected though, because they read that 0xBFC7FF52 offset to determine the video mode, causing the audio to be slower indeed. And it seems the ps1_netemu has got an internal audio pitch compensation, as the licence screen is pitched down (and every cracktro too). The proper patch is needed for the sake of completeness. --[[User:Agrippa|Agrippa]] ([[User talk:Agrippa|talk]]) 18:51, 1 February 2022 (UTC) | ||
. | |||
. | |||
. | |||