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 298: Line 298:
     0LL);                                                                              // unk
     0LL);                                                                              // unk
  }
  }
* Netemu does crash when the first param is set to 0x2.--[[User:Agrippa|Agrippa]] ([[User talk:Agrippa|talk]]) 21:03, 7 July 2023 (CEST)
** No idea why, function that check config compare to 2 and panic if greater than. So '''2''' is accepted at least there. This config is used in 4 places. All of them use next part of config only if this one is '''1'''. 3 places check explicitly for '''1''', one place check for '''0'''. Setting '''2''' is weird from code point of view because it's almost like 0, but allow code to do one check in read function, and to be honest this doesn't look like intentional behavior because similar check is performed earlier in previous N command state, and there is handled properly including setting 1F402006 to error code instead of panic. --[[User:Kozarovv|Kozarovv]] ([[User talk:Kozarovv|talk]]) 22:31, 7 July 2023 (CEST)


===ps2_netemu command 0x12===
===ps2_netemu command 0x12===
Line 514: Line 511:
  b        end_134844
  b        end_134844
Value from 0x20(r31) is later used in compare. That result in cdvd error, or in setting which seems schedule event to happen after time from timebase pass. This event is netemu syscall 8 (0x200) which is related to all ps2 cdvd reads. Tl;dr is that value give emulator some more time before cdvd error. Weird thing is that PS button fix it.. --[[User:Kozarovv|Kozarovv]] ([[User talk:Kozarovv|talk]]) 07:05, 7 March 2022 (UTC)
Value from 0x20(r31) is later used in compare. That result in cdvd error, or in setting which seems schedule event to happen after time from timebase pass. This event is netemu syscall 8 (0x200) which is related to all ps2 cdvd reads. Tl;dr is that value give emulator some more time before cdvd error. Weird thing is that PS button fix it.. --[[User:Kozarovv|Kozarovv]] ([[User talk:Kozarovv|talk]]) 07:05, 7 March 2022 (UTC)
===ps2_netemu command 0x3D===
Looks like we misunderstood this command earlier, and probably we don't even need it.
There seems to be no emu code that make use of it beside printing config revision. This need confirmation on real hardware. In case that missing 0x3D will fail, it will be good to test at least that is really version enforcer, because i can't find part of code that is eventually responsible for that.
* Some time ago I tested the config with version 0x3D89 which contained commands supported from the version 0x40DC onwards. The console hung up right after LV2 reset.--[[User:Agrippa|Agrippa]] ([[User talk:Agrippa|talk]]) 10:16, 24 April 2022 (UTC)
** Any chance you can test this again? Config parser don't have any check for revision, when it hit 0x3D is just storing value on address that seems to be related only to UI/Menu stuff. While i can imagine some check for overall config version (still I searched and it seems to be none), i can't imagine some additional per command revision check. Which is what your test suggest here. Emulator have only one config parser, one config buffer, and one check for command number (0x51 and above still don't trigger panic yet, just ignore command). I also tried to find version numbers of 15686, 16604, 16808, 16916, 17041, 17179, 17277, 17495 in code (as hex of course), and only 17495 is found in function that is not really related to any check (described here at the end: [[Talk:PS2_Emulation#Netemu_2]] ). [[User:Kozarovv|Kozarovv]] ([[User talk:Kozarovv|talk]]) 15:06, 24 April 2022 (UTC)--
*** You are right. There is no revision check and the 0x3D command is not needed at all for the config to work.--[[User:Agrippa|Agrippa]] ([[User talk:Agrippa|talk]]) 18:14, 5 May 2022 (UTC)
**** We figured that out 2000 custom configs too late. :D  Anyway, thanks for confirming that. --[[User:Kozarovv|Kozarovv]] ([[User talk:Kozarovv|talk]]) 17:30, 9 May 2022 (UTC)
===ps2_netemu command 0x4D===
Leaving this here just in case. Fixed comments version.
0xD7F8 RGBAQ_01_and_11:
0xD7F8
0xD800 move      r80, r3              ; move new values to r80
0xD820 ilhu      r19, 0x7FFF
0xD824 lqr      r20, Q_val_cfg_plus4
0xD82C iohl      r19, 0xFFFF
0xD834 and      r17, r80, r19        ; r17 = Q & 0x7FFFFFFF
0xD840 ceqi      r15, r17, 0          ; if r17 == 0, r15 = 0xFFFFFFF, else 0
0xD844 lqr      r10, ST_Q
0xD84C cwd      r9, 0x30+var_30+8(sp) ; Prepare correct write
0xD850 rotqbyi  r16, r20, 4          ; load cmd value from config to r16
0xD858 and      r12, r15, r16        ; r15 & value_from_cfg
0xD860 or        r5, r80, r12          ; r80(Q) | r12(value from cfg or 0)
0xD868 shufb    r7, r5, r10, r9      ; select ST bits + new Q
0xD870 stqr      r7, ST_Q              ; store result as Q value in STQ


===ps2_gxemu command 0x19===
===ps2_gxemu command 0x19===
Line 2,188: Line 2,211:
* '''Dance Summit 2001: Bust-a-Move'''
* '''Dance Summit 2001: Bust-a-Move'''
** Front buffer is not flushed most of the time. Game seems to apply additional effects there, apart from the downsampling.
** Front buffer is not flushed most of the time. Game seems to apply additional effects there, apart from the downsampling.
* '''Snowblind Engine 2003+ games'''
** Shows the very last "interlaced" frame when switching back to the interlaced mode from progressive one. I thought it could be a VBLANK issue, but that old frame should be long gone by then. The issue seems to be related to the PCRTC. The SMODE2 register is updated in the VBLANK handler. That old frame is shown when the FFMD bit is switched to 1. Looking for better workarounds than delaying the VSYNC or lowering the resolution in 60 fps mode. By the way, the 0x20 command does work with negative values too. Moreover, the max positive value for NTSC is something like 0x106. Anything higher makes the screen freeze on PS2 logo (but the game is working in the background).


== Stuntman/Driv3r research ==
== Stuntman/Driv3r research ==
Line 2,532: Line 2,553:
  4000 = SPC_PUINT_MB
  4000 = SPC_PUINT_MB
  5000 = SPC_CSR1
  5000 = SPC_CSR1
||
|-
|-
| SPC_CSR  
| SPC_CSR  
Line 2,553: Line 2,575:
  4000 = SPC_PUINT_MB
  4000 = SPC_PUINT_MB
  5000 = SPC_CSR1
  5000 = SPC_CSR1
||
|-
|-
| SPC_CSR  
| SPC_CSR  
Line 2,944: Line 2,967:
||
||
|-
|-
| ustack (micro stack)
| ?
|| 0xAAA70000000
|| 0xAAA70040000
|| 0x4200000000001
|| Thread KRN0:1 (aka BOOT00)
|-
| ustack (micro stack)
|| 0xAAA70040000
|| 0xAAA70080000
|| 0x4200010000001
|| Thread KRN1:1 (aka BOOT01)
|-
| ustack (micro stack)
|| 0xAAA70080000
|| 0xAAA700C0000
|| 0x42000B0000001
|| VU0 stack (used in EEonBE when VU0 is running)
|-
| ustack (micro stack)
|| 0xAAA700C0000  
|| 0xAAA700C0000  
|| 0xAAA70100000  
|| 0xAAA70100000  
|| 0x4200030000001  
|| 0x4200030000001  
|| Thread SYS
||
|-
|-
| ustack (micro stack)
| ?
|| 0xAAA70100000  
|| 0xAAA70100000  
|| 0xAAA70140000  
|| 0xAAA70140000  
|| 0x4200040000001  
|| 0x4200040000001  
|| Thread VRC
||
|-
|-
| ustack (micro stack)
| ?
|| 0xAAA70140000  
|| 0xAAA70140000  
|| 0xAAA70180000  
|| 0xAAA70180000  
|| 0x4200050000001  
|| 0x4200050000001  
|| Thread MECHA
||
|-
|-
| ustack (micro stack)
| ?
|| 0xAAA70180000  
|| 0xAAA70180000  
|| 0xAAA701C0000  
|| 0xAAA701C0000  
|| 0x4200060000001  
|| 0x4200060000001  
|| Thread HDD
||
|-
|-
| ustack (micro stack)
| ?
|| 0xAAA701C0000  
|| 0xAAA701C0000  
|| 0xAAA70200000  
|| 0xAAA70200000  
|| 0x4200070000001  
|| 0x4200070000001  
|| Thread UI
||
|-
|-
| ustack (micro stack)
| ?
|| 0xAAA70200000  
|| 0xAAA70200000  
|| 0xAAA70280000  
|| 0xAAA70280000  
|| 0x4200090000001  
|| 0x4200090000001  
|| Thread BL2LNK and BL2MAIN
||
|-
|-
| ustack (micro stack)
| ?
|| 0xAAA70280000  
|| 0xAAA70280000  
|| 0xAAA702C0000  
|| 0xAAA702C0000  
|| 0x42000A0000001  
|| 0x42000A0000001  
|| Thread USB
||
|-
| ?
|| 0xAAA70080000
|| 0xAAA700C0000
|| 0x42000B0000001
||
|-
|-
| ustack (micro stack)
| ?
|| 0xAAA702C0000  
|| 0xAAA702C0000  
|| 0xAAA70300000  
|| 0xAAA70300000  
|| 0x42000B0000001  
|| 0x42000B0000001  
|| Thread EEonBE
||
|-
| ?
|| 0xAAA70000000
|| 0xAAA70040000
|| 0x4200000000001
||
|-
| ?
|| 0xAAA70040000
|| 0xAAA70080000
|| 0x4200010000001
||
|-
|-
|}
|}
Line 3,254: Line 3,277:
===Emu===
===Emu===
Ps2emu have available 14 fragment shaders, and 8 vertex shaders. All of them don't give any hint about name or usage.
Ps2emu have available 14 fragment shaders, and 8 vertex shaders. All of them don't give any hint about name or usage.
== Custom command ideas ==
* '''Disable GS downloads.'''<br>
It is definitely a performance improvement for many titles. In theory, easy to implement (force 0x3 TRXDIR value for every 0x1 write instead). The point is, per-game patches are superior and more robust.<br>
* '''Disable PCRTC blur.'''<br>
PCRTC merge circuits are mostly used for pathetic blurry anti-aliasing. Looks awful on modern TV screens (ToCA 3 is unreadable completely). Blending settings are controlled through the PMODE privileged register.
===Discussion===
GS download config is partially done, need little bit more than TRXDIR patch. But this is something we can patch per-game too. Games do very obvious things to reverse VIF1 FIFO, and also BUSDIR write. From there you can disable whole function that need it. Config will be better of course, but HEN users... Anti Blur is kinda easy to do. Writes to DISPLAY1 can write also to 2 and write to 2 also to 1. So they always match, and config implementation will be rather easy. Most games just offset DX/DY, and never touch those regs again. For games that mess with it, more serious approach is needed. But again HEN users are out of luck if we create command for that. It doesn't help that this can be done by EE patches too. What need to be done is removing offset between DISPLAY1 and DISPLAY2.
*Example for TOCA3 SLUS which use hard coded offset:
004C55F0 00000000
004C55F4 00000000
I'm not saying no, but for now i'm kinda lacking of motivation if not so small HEN user base will be out of luck. But more ideas can help with motivation. :P --[[User:Kozarovv|Kozarovv]] ([[User talk:Kozarovv|talk]]) 22:00, 8 August 2023 (CEST)
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)