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 1: Line 1:
TODO: Please remove unneeded uppercase letters not at the start of sentences.
* This Is Not Elon Musk Here :P - [[User:Roxanne|Roxanne]]
==Regs==
==Regs==


Line 245: Line 248:
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==
While 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 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), 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=
Line 299: Line 253:
! Name !! Notes
! Name !! Notes
|-
|-
| Locating the gs registers || Abysmal.
| 4-Player Multitap in urban reign || Weird why it isn't working.
|-
|-
| Trying to reverse-engineer any emulator's executable by using assembly and hxd to improve compatibility || Tedious. / TPC register's instruction 8998B0030000
| Locating the gs registers || Never gonna happen it seems.
|-
| Fully understanding the hook functions ||
|-
| Trying to reverse-engineer any eboot to improve compatibility ||
|-
|-
| Locating the proper CDVD read speed (God of war and Ratchet size matters [Both have affected music]) || IOP and CDVD commands help
| Locating the proper CDVD read speed (God of war and Ratchet size matters [Both have affected music]) || IOP and CDVD commands help
Line 307: Line 265:
| Fully understand what the vif chunk command thingy does || Too low and your game will freeze at the intro
| Fully understand what the vif chunk command thingy does || Too low and your game will freeze at the intro
|-
|-
| Find out what some of the gs commands do and edit their description || Infelicitous!
| Find the the most GIF accurate emulator there is. || Kof98??
|-
| Understand the gs lua functions  ||
|-
| Implement a EE memory patch for ratchet up your arsenal  || Not trivial obviously
|-
|}
* GS registers aren't mapped in easy way comparing to other ones. Offsets will vary per emulator, and that's for sure. This is what you get in read mode on JAK emu (not sure if i have v1 or v2 to be honest, is known as ps2emu16):
gs_reg_SCISSOR_1              0000000001B11800                 
gs_reg_FBA_1                  0000000001B11808                 
gs_reg_ALPHA_1                0000000001B11810                 
gs_reg_TEST_1                0000000001B11818                 
gs_reg_CLAMP_1                0000000001B11820                 
gs_reg_FRAME_1                0000000001B11828                 
gs_reg_ZBUF_1                0000000001B11830                 
gs_reg_TEX0_1                0000000001B11838                 
gs_reg_TEX1_1                0000000001B11840                 
gs_reg_MIPTBP1_1              0000000001B11880                 
gs_reg_MIPTBP2_1              0000000001B11888                 
gs_reg_XYOFFSET_1_X          0000000001B11890                 
gs_reg_XYOFFSET_1_Y          0000000001B118A0                 
gs_reg_SCISSOR_2              0000000001B11910                 
gs_reg_FBA_2                  0000000001B11918                 
gs_reg_ALPHA_2                0000000001B11920                 
gs_reg_TEST_2                0000000001B11928                 
gs_reg_CLAMP_2                0000000001B11930                 
gs_reg_FRAME_2                0000000001B11938                 
gs_reg_ZBUF_2                0000000001B11940                 
gs_reg_TEX0_2                0000000001B11948                 
gs_reg_TEX1_2                0000000001B11950                 
gs_reg_MIPTBP1_2              0000000001B11990                 
gs_reg_MIPTBP2_2              0000000001B11998                 
gs_reg_XYOFFSET_2_X          0000000001B119A0                 
gs_reg_XYOFFSET_2_Y          0000000001B119B0                 
gs_reg_FOGCOL                0000000001B11A20                 
gs_reg_COLCLAMP              0000000001B11A28                 
gs_reg_SCANMSK                0000000001B11A2C                 
gs_reg_DTHE                  0000000001B11A30                 
gs_reg_DIMX                  0000000001B11A78                 
gs_reg_TEXA                  0000000001B11A80                 
gs_reg_TEXCLUT                0000000001B11A88                 
gs_reg_PRIM                  0000000001B11A90                 
gs_reg_PRMODE                0000000001B11AA0                 
gs_reg_PRMODECONT            0000000001B11AA8                 
gs_reg_BITBLTBUF              0000000001B222E8                 
gs_reg_TRXPOS                0000000001B222F0                 
gs_reg_TRXREG                0000000001B222F8                 
gs_reg_TRXDIR                0000000001B22300                 
hwreg_GS_CSR_lower_bits      00000000079892C8                 
hwreg_GS_IMR                  00000000079892C9                 
hwreg_GS_BUSDIR              00000000079892CA                 
hwreg_GS_SIGBLID              00000000079892CC                 
hwreg_GS_SMODE2_INT          0000000007989304                 
hwreg_GS_PMODE                0000000007D89F50                 
hwreg_GS_SMODE1              0000000007D89F58                 
hwreg_GS_SMODE2              0000000007D89F60                 
hwreg_GS_SFRSH                0000000007D89F68                 
hwreg_GS_SYNCH1              0000000007D89F70                 
hwreg_GS_SYNCH2              0000000007D89F78                 
hwreg_GS_SYNCV                0000000007D89F80                 
hwreg_GS_DISPFB1              0000000007D89F88                 
hwreg_GS_DISPLAY1            0000000007D89F90                 
hwreg_GS_DISPFB2              0000000007D89F98                 
hwreg_GS_DISPLAY2            0000000007D89FA0                 
hwreg_GS_EXTBUF              0000000007D89FA8                 
hwreg_GS_EXTDATA              0000000007D89FB0                 
hwreg_GS_EXTWRITE            0000000007D89FB8                 
hwreg_GS_BGCOLOR              0000000007D89FC0
But keep in mind that GS regs can be "duplicated" for different emulation stages. GS is jited too, so it should have kind of pipeline too.
"Implement a EE memory patch for ratchet up your arsenal" Game write data using qmtc2/ctc2 and expect VU0 to still run at this point, which is not always true. Mega high vu0 mpg cycles could potentially push it little further. Patching that will be pain just because Ratchet use code overlays. This mean you need to patch game image with the same patch in more than 20 places. Because what you see in pcsx2 debugger / ps2dis will change depend on stage you play now. That's why PS3, and PCSX2 use dynamic jit patches (pcsx2 use it for different issue tho). --[[User:Kozarovv|Kozarovv]] ([[User talk:Kozarovv|talk]]) 14:20, 27 February 2023 (CET)
 
== no-clamping ==
 
Sup. Can i know how no-clamping behavior was tested to confirm that "The default emulator's behavior cannot be set by CLI commands."? Because that doesn't sound right, and emulator explicitly set 0 or 1 on init, which is confirmed in emu code. What can happen, is that other clamping settings were changed during test, and that affected result. But looking at code i don't think there is any possibility that something "in between" exist. --[[User:Kozarovv|Kozarovv]] ([[User talk:Kozarovv|talk]]) 09:33, 21 June 2023 (CEST)
 
 
 
<br>It is based on a test I did on Sly Cooper 2. If VU1 Clamping was set to 1 or 0, the game crashes. If left empty, game works fine. --[[User:Scalerize|Scalerize]] ([[User talk:Scalerize|talk]]) 14:58, 21 June 2023 (CEST)
* Do you remember when game crash? Right after ps2 logo, when going ingame, any specific level, etc. --[[User:Kozarovv|Kozarovv]] ([[User talk:Kozarovv|talk]]) 15:32, 21 June 2023 (CEST)
 
<br>Right after the ps2 logo if I recall correctly --[[User:Scalerize|Scalerize]] ([[User talk:Scalerize|talk]]) 16:34, 21 June 2023 (CEST)
* I think there was typo in config you tested. Crash right after PS2 logo is usually caused by unsupported command (emu will print "Unhandled option for this build/platform" and hit UD2 right after). Missing separator, typo, upper case characters, or something else was wrong. I double checked emu code, and it is set or not set (0 or 1). Recompiler parts which use it also test only for 0/1, and setting this command don't affect anything else. I'm going to leave description as is because without PS4 i can't test it by myself, but i'm really sceptical about it. :P --[[User:Kozarovv|Kozarovv]] ([[User talk:Kozarovv|talk]]) 16:46, 21 June 2023 (CEST)
 
So, after taking some time to think about it, I had remembered that the game would crash right after the first pyramid fmv at the press start screen. But yeah, leave as it is. You have the upper hand in removing/adding anything you like --[[User:Scalerize|Scalerize]] ([[User talk:Scalerize|talk]]) 17:19, 21 June 2023 (CEST)
 
== Config table with IDs from Jak emu ==
 
Table from Jak emulator, this is how emulator config parser see data from cli. Please don't edit typos, etc. This is how it is in emulator. I'm leaving it here, so main page can be slowly updated with data from table if needed. Emulator translate commands to ID, then use ID in jump table in parser to apply cfg. ID is not guaranteed to be the same between emulators, but i didn't tested that. Comments match id too. Script for ida to dump this info will be posted soon. UNK value is not critical for anything, but it is used for something, and it is part of original table. This table is missing few commands which are parsed outside of main cfg routine.
 
|============================================================================================================|
| ID  |  UNK  |            COMMAND              |                        COMMENT                            |
|------------------------------------------------------------------------------------------------------------|
| 0  | 0x0    | --help                          |                                                          |
| 0  | 0x0    | -?                             |                                                          |
| 1  | 0x1    | --rom                          | filename                                                  |
| 2  | 0x1    | --image                        | filename                                                  |
| 3  | 0x1    | --pack-image                    | filename                                                  |
| 4  | 0x301  | --emulog-file                  |                                                          |
| 5  | 0x1    | --r30                          | filename                                                  |
| 6  | 0x1    | --vu0                          | filename                                                  |
| 7  | 0x1    | --vu1                          | filename                                                  |
| 8  | 0x1    | --cop1                          | filename                                                  |
| 9  | 0x1    | --cop2                          | filename                                                  |
| 10  | 0x1    | --gs-plugin                    | filename                                                  |
| 11  | 0x1    | --config                        | filename                                                  |
| 12  | 0x1    | --config-opt                    | filename                                                  |
| 13  | 0x1    | --config-local-lua              | full pathname                                            |
| 14  | 0x301  | --ee-cache-breaks-block        |                                                          |
| 15  | 0x2    | --unit-test                    | filename                                                  |
| 16  | 0x0    | --no-gs                        |                                                          |
| 17  | 0x0    | --cli-only                      |                                                          |
| 18  | 0x301  | --cpu-avx                      |                                                          |
| 19  | 0x301  | --cpu-crc32                    |                                                          |
| 21  | 0x0    | --stopped                      |                                                          |
| 22  | 0x4301 | --host-pad-enhance-deadzone    | Legacy value/ignored                                      |
| 23  | 0x301  | --savedata-delete              |                                                          |
| 24  | 0x1    | --vmc1  filename                |                                                          |
| 24  | 0x4001 | --mcd1  filename                |                                                          |
| 25  | 0x1    | --vmc2  filename                |                                                          |
| 25  | 0x4001 | --mcd2  filename                |                                                          |
| 26  | 0x301  | --formatted-vmc                |                                                          |
| 26  | 0x4301 | --formatted-mcd                |                                                          |
| 27  | 0x301  | --mtap1                        |                                                          |
| 28  | 0x301  | --mtap2                        |                                                          |
| 29  | 0x1    | --vmc-src                      | native,host,target,null                                  |
| 30  | 0x1    | --vmc-dest                      | native,host,target,null                                  |
| 31  | 0x1    | --vmc1-src                      | native,host,target,null                                  |
| 31  | 0x4001 | --mcd1-initialize              | native,host,target,null                                  |
| 32  | 0x1    | --vmc1-dest                    | native,host,target,null                                  |
| 32  | 0x4001 | --mcd1-write-type              | native,host,target,null                                  |
| 33  | 0x1    | --vmc2-src                      | native,host,target,null                                  |
| 33  | 0x4001 | --mcd2-initialize              | native,host,target,null                                  |
| 34  | 0x1    | --vmc2-dest                    | native,host,target,null                                  |
| 34  | 0x4001 | --mcd2-write-type              | native,host,target,null                                  |
| 35  | 0x301  | --jitproc-use-aslr              |                                                          |
| 36  | 0x301  | --jitproc-build-match          |                                                          |
| 37  | 0x301  | --host-gamepads                |                                                          |
| 38  | 0x101  | --host-keyboard                | slot [0-7]                                                |
| 39  | 0x302  | --host-pad-loses-focus          |                                                          |
| 40  | 0x301  | --ds4-deadzone-adjust          |                                                          |
| 41  | 0x301  | --ds4-diagonal-adjust          |                                                          |
| 42  | 0x301  | --pad-analog-to-digital        |                                                          |
| 43  | 0x301  | --hid-pad                      |                                                          |
| 44  | 0x1    | --host-audio                    | [1,0,on,off,mono]                                        |
| 45  | 0x1    | --mute-audio                    | [all,none,main,bgm]                                      |
| 46  | 0x201  | --host-audio-latency            | msec/float                                                |
| 47  | 0x301  | --host-vsync                    |                                                          |
| 48  | 0x1    | --host-osd                      | [0,off,minimal,verbose]                                  |
| 49  | 0x1    | --host-graph                    | [0,off,fps]                                              |
| 50  | 0x301  | --host-dbg-kbd                  |                                                          |
| 51  | 0x301  | --host-edit-safe-area          |                                                          |
| 52  | 0x302  | --threaded-gs                  |                                                          |
| 53  | 0x101  | --rtc-epoch                    | unix_time (seconds since epoch)                          |
| 54  | 0x2    | --isd-git-hash                  | git hash (sha1)                                          |
| 55  | 0x2    | --usrd-git-hash                | git hash (sha1)                                          |
| 56  | 0x301  | --playgo-disc-per-chunk        |                                                          |
| 57  | 0x201  | --external-hdd-sleep-idle      | idle timeout in ms                                        |
| 58  | 0x201  | --external-hdd-spinup-delay    | delay in ms                                              |
| 59  | 0x301  | --external-hdd-sim              |                                                          |
| 60  | 0x301  | --external-hdd-fix              |                                                          |
| 61  | 0x201  | --host-window-scale            | scale/float                                              |
| 62  | 0x1    | --host-window-pos              | x,y                                                      |
| 63  | 0x1    | --host-display-mode            | [normal/4:3,full/16:9]                                    |
| 64  | 0x301  | --framelimiter                  |                                                          |
| 65  | 0x201  | --framelimit-fps                | FPS/float                                                |
| 66  | 0x201  | --framelimit-scalar            | scalar/float                                              |
| 67  | 0x1    | --framelimit-mode              | [normal,fast,fastest,slow,slower,slowest]                |
| 68  | 0x301  | --force-pal-60hz                |                                                          |
| 69  | 0x301  | --force-frame-blend            |                                                          |
| 70  | 0x301  | --audio-stretching              |                                                          |
| 71  | 0x101  | --spu2-update-deferral          | Ts/integer                                                |
| 72  | 0x301  | --spu2-reverb                  |                                                          |
| 73  | 0x301  | --spu2-c0-memin-to-bgm          |                                                          |
| 74  | 0x301  | --spu2-c1-memin-to-bgm          |                                                          |
| 75  | 0x101  | --spu2-ignore-kof              |                                                          |
| 76  | 0x101  | --spu2-voice-keyoff-threshold  | Ts/integer                                                |
| 77  | 0x301  | --spu2-warnings                |                                                          |
| 78  | 0x101  | --stop-at                      | frameID/integer                                          |
| 79  | 0x101  | --exit-at                      | frameID/integer                                          |
| 80  | 0x2    | --pad-run                      | filename                                                  |
| 81  | 0x1    | --pad-run-stop-after            | [800ms,1s,3m,5h]                                          |
| 82  | 0x1    | --pad-run-exit-after            | [800ms,1s,3m,5h]                                          |
| 83  | 0x2    | --pad-record                    | filename                                                  |
| 84  | 0x101  | --pad-run-frame                | frame_id/integer                                          |
| 85  | 0x101  | --pad-record-frame              | frame_id/integer                                          |
| 86  | 0x301  | --record-video-hash            |                                                          |
| 87  | 0x301  | --record-audio-hash            |                                                          |
| 88  | 0x101  | --record-video-modulo          | frames/integer                                            |
| 89  | 0x301  | --record-audio                  |                                                          |
| 90  | 0x301  | --record-audio-image            |                                                          |
| 90  | 0x301  | --record-audio-img              |                                                          |
| 91  | 0x301  | --record-audio-ext              |                                                          |
| 92  | 0x1    | --path-snaps                    | dir/folder                                                |
| 93  | 0x1    | --path-recordings              | dir/folder                                                |
| 94  | 0x1    | --path-audio-images            | dir/folder                                                |
| 95  | 0x1    | --path-memcards                | dir/folder                                                |
| 95  | 0x1    | --path-vmc                      | dir/folder                                                |
| 96  | 0x1    | --path-emulog                  | dir/folder                                                |
| 97  | 0x1    | --path-manual                  | dir/folder                                                |
| 98  | 0x1    | --path-patches                  | dir/folder                                                |
| 99  | 0x1    | --path-trophydata              | dir/folder                                                |
| 100 | 0x1    | --path-featuredata              | dir/folder                                                |
| 101 | 0x1    | --path-postproc                | dir/folder                                                |
| 102 | 0x1    | --path-patches                  | dir/folder                                                |
| 103 | 0x1    | --path-toolingscript            | dir/folder                                                |
| 104 | 0x1    | --record-name                  | subdir/folder                                            |
| 105 | 0x1    | --max-console-spam              | bytes/lifetime                                            |
| 106 | 0x1    | --snapshot-name                | filename                                                  |
| 107 | 0x101  | --snapshot-save                | frameId                                                  |
| 108 | 0x2    | --snapshot-restore              | filename                                                  |
| 109 | 0x301  | --snapshot-mcd-files            |                                                          |
| 110 | 0x101  | --snapshot-repeat              | repeat_count                                              |
| 111 | 0x1    | --snapshot-datafile            | filename                                                  |
| 112 | 0x101  | --snapshot-modulo              | frames/integer                                            |
| 113 | 0x101  | --snapshot-debug                | dbg-on-of                                                |
| 114 | 0x1    | --ee-block-validation          | [PageProt,Hash,None]                                      |
| 115 | 0x301  | --ee-validate-kernel            |                                                          |
| 116 | 0x1    | --ee-const-folding              | [None,Gpr,Fpu,All]                                        |
| 117 | 0x301  | --ee-load-rewrites              |                                                          |
| 118 | 0x301  | --ee-store-rewrites            |                                                          |
| 119 | 0x301  | --ee-live32                    |                                                          |
| 120 | 0x1    | --ee-regalloc-scalar            | [0,none,ReadOnly,WriteOnly,RW]                            |
| 121 | 0x1    | --ee-regalloc-simd              | [0,none,ReadOnly,WriteOnly,RW]                            |
| 122 | 0x301  | --ee-insn-flush-pc              |                                                          |
| 122 | 0x4301 | --ee-pc-coherency              |                                                          |
| 123 | 0x301  | --ee-insn-callmark              |                                                          |
| 123 | 0x4301 | --ee-insn-marking              |                                                          |
| 123 | 0x4301 | --ee-inst-marking              |                                                          |
| 124 | 0x301  | --ee-injection-kernel          |                                                          |
| 124 | 0x301  | --ee-kernel-hle                |                                                          |
| 125 | 0x301  | --ee-injection-title            |                                                          |
| 126 | 0x1    | --ee-static-block-links        | Type,Type,... [None,Branches,JAL,COP2,All]                |
| 127 | 0x1    | --ee-regalloc-preserve-scalar  | [0,none,LoadOnly,StoreOnly,LS]                            |
| 128 | 0x1    | --ee-regalloc-preserve-simd    | [0,none,LoadOnly,StoreOnly,LS]                            |
| 129 | 0x301  | --ee-peephole                  |                                                          |
| 130 | 0x301  | --ee-ignore-break              |                                                          |
| 130 | 0x4301 | --ee-break-as-nop              |                                                          |
| 131 | 0x101  | --ee-inline-limit-full          | insn_count/integer                                        |
| 132 | 0x101  | --ee-inline-limit-partial      | insn_count/integer                                        |
| 133 | 0x101  | --ee-jit-pagefault-threshold    | fault_count/integer                                      |
| 134 | 0x301  | --ee-jit-opt-debug              |                                                          |
| 135 | 0x301  | --iop-validate-kernel          | [PageProt,ShortHash,Hash,None]                            |
| 136 | 0x1    | --iop-block-validation          | [PageProt,ShortHash,Hash,None]                            |
| 137 | 0x1    | --iop-shorthash-len            | insn_count/integer                                        |
| 138 | 0x301  | --iop-const-folding            |                                                          |
| 141 | 0x301  | --iop-pc-coherency              |                                                          |
| 142 | 0x301  | --iop-inst-marking              |                                                          |
| 143 | 0x301  | --fpu-to-double                |                                                          |
| 144 | 0x301  | --fpu-no-clamping              |                                                          |
| 145 | 0x301  | --fpu-clamp-operands            |                                                          |
| 146 | 0x301  | --fpu-clamp-results            |                                                          |
| 147 | 0x301  | --fpu-custom-min-max            |                                                          |
| 148 | 0x301  | --fpu-custom-fused-madd        |                                                          |
| 149 | 0x301  | --fpu-accurate-range            | start,end                                                |
| 150 | 0x301  | --fpu-accurate-muldiv          |                                                          |
| 151 | 0x1    | --fpu-accurate-muldiv-range    | start,end                                                |
| 152 | 0x1    | --fpu-accurate-mul-fast        |                                                          |
| 153 | 0x1    | --fpu-accurate-addsub          |                                                          |
| 154 | 0x1    | --fpu-accurate-addsub-range    | start,end                                                |
| 155 | 0x1    | --fpu-rsqrt-fast-estimate      |                                                          |
| 156 | 0x1    | --fpu-no-clamp-range            | start,edn                                                |
| 157 | 0x301  | --vu-to-double                  |                                                          |
| 158 | 0x301  | --vu-branch-hazard              |                                                          |
| 159 | 0x301  | --vu-evil-branches              |                                                          |
| 160 | 0x301  | --vu-d-bit                      |                                                          |
| 161 | 0x301  | --vu-t-bit                      |                                                          |
| 162 | 0x301  | --vu-inst-mflag                |                                                          |
| 163 | 0x301  | --vu-inst-cflag                |                                                          |
| 164 | 0x301  | --vu-custom-min-max            |                                                          |
| 165 | 0x301  | --vu-custom-fused-madd          |                                                          |
| 166 | 0x101  | --vu-xgkick-delay              | vu_cycles/integer                                        |
| 167 | 0x301  | --vu-hack-triace                |                                                          |
| 168 | 0x101  | --vu-range-merge                | vu_inst_cnt                                              |
| 169 | 0x301  | --vu0-no-clamping              |                                                          |
| 170 | 0x301  | --vu0-clamp-operands            |                                                          |
| 171 | 0x301  | --vu0-clamp-results            |                                                          |
| 172 | 0x101  | --vu0-opt-flags                | [0,1,2] - 1=safe, 2=unsafe                                |
| 173 | 0x101  | --vu0-opt-vf00                  | [0,1,2] - 1=safe, 2=unsafe                                |
| 174 | 0x301  | --vu0-opt-subroutine            |                                                          |
| 175 | 0x301  | --vu0-const-prop                |                                                          |
| 176 | 0x301  | --vu0-inst-q                    |                                                          |
| 177 | 0x301  | --vu0-inst-p                    |                                                          |
| 178 | 0x301  | --vu0-use-rcp                  |                                                          |
| 179 | 0x301  | --vu0-use-rsqrt                |                                                          |
| 180 | 0x301  | --vu0-di-bits                  |                                                          |
| 181 | 0x1    | --vu0-clamp-range              | start,end                                                |
| 182 | 0x1    | --vu0-jr-cache-policy          | [newprog,sameprog,auto]                                  |
| 183 | 0x1    | --vu0-jalr-cache-policy        | [newprog,sameprog,auto]                                  |
| 184 | 0x1    | --vu0-mul0fix-range            | start,end                                                |
| 185 | 0x1    | --vu0-accurate-addsub-range    | start,end                                                |
| 186 | 0x1    | --vu0-aot-outmode              | out/overwrite, append                                    |
| 187 | 0x101  | --vu0-aot-start-addr            | start address                                            |
| 188 | 0x101  | --vu0-aot-end-addr              | end address                                              |
| 189 | 0x1    | --vu0-aot-start-crc            | verify crc                                                |
| 190 | 0x1    | --vu0-aot-end-crc              | verify crc                                                |
| 191 | 0x301  | --vu1-no-clamping              |                                                          |
| 192 | 0x301  | --vu1-clamp-operands            |                                                          |
| 193 | 0x301  | --vu1-clamp-results            |                                                          |
| 194 | 0x101  | --vu1-opt-flags                | [0,1,2] - 1=safe, 2=unsafe                                |
| 195 | 0x101  | --vu1-opt-vf00                  | [0,1,2] - 1=safe, 2=unsafe                                |
| 196 | 0x301  | --vu1-opt-subroutine            |                                                          |
| 197 | 0x301  | --vu1-const-prop                |                                                          |
| 198 | 0x301  | --vu1-inst-q                    |                                                          |
| 199 | 0x301  | --vu1-inst-p                    |                                                          |
| 200 | 0x301  | --vu1-use-rcp                  |                                                          |
| 201 | 0x301  | --vu1-use-rsqrt                |                                                          |
| 202 | 0x301  | --vu1-di-bits                  |                                                          |
| 203 | 0x1    | --vu1-clamp-range              | start,end                                                |
| 204 | 0x1    | --vu1-jr-cache-policy          | [newprog,sameprog,auto]                                  |
| 205 | 0x1    | --vu1-jalr-cache-policy        | [newprog,sameprog,auto]                                  |
| 206 | 0x1    | --vu1-mul0fix-range            | start,end                                                |
| 207 | 0x1    | --vu1-accurate-addsub-range    | start,end                                                |
| 208 | 0x1    | --vu1-aot-outmode              | out/overwrite, append                                    |
| 209 | 0x101  | --vu1-aot-start-addr            | start address                                            |
| 210 | 0x101  | --vu1-aot-end-addr              | end address                                              |
| 211 | 0x1    | --vu1-aot-start-crc            | verify crc                                                |
| 212 | 0x1    | --vu1-aot-end-crc              | verify crc                                                |
| 214 | 0x301  | --vu0-injection                |                                                          |
| 215 | 0x301  | --vu1-injection                |                                                          |
| 216 | 0x301  | --vu1-native-patch              |                                                          |
| 217 | 0x301  | --cop2-no-clamping              |                                                          |
| 218 | 0x301  | --cop2-clamp-operands          |                                                          |
| 219 | 0x301  | --cop2-clamp-results            |                                                          |
| 220 | 0x101  | --cop2-opt-flags                | [0,1,2] - 1=safe, 2=unsafe                                |
| 221 | 0x101  | --cop2-opt-vf00                | [0,1,2] - 1=safe, 2=unsafe                                |
| 222 | 0x301  | --cop2-const-prop              |                                                          |
| 223 | 0x301  | --cop2-inst-q                  |                                                          |
| 224 | 0x301  | --cop2-inst-p                  |                                                          |
| 225 | 0x301  | --cop2-use-rcp                  |                                                          |
| 226 | 0x301  | --cop2-use-rsqrt                |                                                          |
| 227 | 0x301  | --cop2-di-bits                  |                                                          |
| 228 | 0x1    | --cop2-accurate-range          | start,end                                                |
| 229 | 0x301  | --cop2-accurate-mul            |                                                          |
| 230 | 0x1    | --cop2-accurate-mul-range      | start,end                                                |
| 231 | 0x1    | --cop2-accurate-addsub          |                                                          |
| 232 | 0x1    | --cop2-accurate-addsub-range    | start,end                                                |
| 233 | 0x1    | --cop2-no-clamp-range          | start,end                                                |
| 234 | 0x301  | --cop2-regalloc                |                                                          |
| 235 | 0x101  | --ee-jit-disasm                | [0,1=mips,2=x86]                                          |
| 236 | 0x101  | --iop-jit-disasm                | [0,1=mips,2=x86]                                          |
| 237 | 0x101  | --vu-jit-disasm                | [0,1=mips,2=x86]                                          |
| 238 | 0x301  | --vtune-ee                      |                                                          |
| 239 | 0x301  | --vtune-vu                      |                                                          |
| 240 | 0x1    | --ee-precompile-trace          | filename                                                  |
| 241 | 0x1    | --elf-symbols=                  | filename                                                  |
| 242 | 0x1    | --map-symbols=                  | filename                                                  |
| 243 | 0x1    | --symbols=                      | filename                                                  |
| 244 | 0x1    | --pc-bisect-srcfile=            | filename                                                  |
| 245 | 0x301  | --verbose-tooling              |                                                          |
| 246 | 0x301  | --log-tooling                  |                                                          |
| 247 | 0x301  | --verbose-deci2                |                                                          |
| 248 | 0x301  | --verbose-cdvd-reads            |                                                          |
| 249 | 0x301  | --verbose-cpu-cycles            |                                                          |
| 250 | 0x301  | --verbose-thread-id            |                                                          |
| 252 | 0x301  | --assert-path1-ad              |                                                          |
| 254 | 0x301  | --ee-evt-check-full            |                                                          |
| 255 | 0x201  | --ee-cycle-scalar              | scalar/float                                              |
| 256 | 0x1    | --ee-ignore-segfault            | [none,R,W,RW]                                            |
| 257 | 0x1    | --ee-native-function            | name,mipsaddr                                            |
| 258 | 0x101  | --ee-stlf-cycle-threshold      |                                                          |
| 259 | 0x201  | --ee-sif0-cycle-scalar          | multiplier/float                                          |
| 260 | 0x201  | --ee-sif1-cycle-scalar          | multiplier/float                                          |
| 261 | 0x201  | --iop-sif0-cycle-scalar        | multiplier/float                                          |
| 262 | 0x201  | --iop-sif1-cycle-scalar        | multiplier/float                                          |
| 263 | 0x101  | --iop-tight-slice-count        | slices/int                                                |
| 264 | 0x301  | --iop-evt-check-full            |                                                          |
| 265 | 0x201  | --iop-cycle-scalar              | scalar/float                                              |
| 266 | 0x101  | --cdvd-sector-read-cycles      | cycles_per_sector                                        |
| 267 | 0x101  | --cdvd-sector-seek-cycles      | cycles_per_sector                                        |
| 268 | 0x301  | --cdvd-determinism              |                                                          |
| 269 | 0x101  | --idec-cycles-per-qwc          | int/multiplier                                            |
| 270 | 0x301  | --vif1-instant-xfer            |                                                          |
| 271 | 0x301  | --vif1-ignore-cmd-ints          |                                                          |
| 272 | 0x301  | --vif-ignore-invalid-cmd        |                                                          |
| 273 | 0x101  | --vif-thread-chunk-size        | int/kilowords                                            |
| 274 | 0x1    | --vu1-mpg-cycles                | cycles,$vupc,$vupc...                                    |
| 275 | 0x1    | --vu0-mpg-cycles                | cycles,$vupc,$vupc...                                    |
| 276 | 0x301  | --detect-idle-vif              |                                                          |
| 277 | 0x301  | --detect-idle-ee                |                                                          |
| 278 | 0x301  | --detect-idle-iop              |                                                          |
| 279 | 0x301  | --detect-idle-intc              |                                                          |
| 280 | 0x1    | --detect-idle-chcr              | dmaChan,dmaChan,... [none,VIF0,VIF1,GIF,fromIPU,toIPU,etc]|
| 281 | 0x201  | --mfifo-manual-drain            | frame_multiplier/float                                    |
| 282 | 0x101  | --mfifo-chunk-drain-cycles      | cycles/int                                                |
| 283 | 0x101  | --gs-scanout-delay              | hsync_count/integer                                      |
| 284 | 0x101  | --gs-fieldswap-delay            | hsync_count/integer                                      |
| 285 | 0x301  | --gs-use-deferred-l2h          |                                                          |
| 286 | 0x1    | --l2h-2d-params                | TRXREG,BITBLTBUF,height                                  |
| 287 | 0x1    | --gs-uprender                  | [none,2x2]                                                |
| 288 | 0x1    | --gs-upscale                    | [none,gpu,edgesmooth,motionvec]                          |
| 289 | 0x201  | --gs-aspect-ratio              | aspect/float (default=0.81)                              |
| 290 | 0x301  | --gs-progressive                |                                                          |
| 291 | 0x301  | --gs-force-bilinear            |                                                          |
| 292 | 0x301  | --gs-use-mipmap                |                                                          |
| 293 | 0x301  | --gs-use-clut-merge            |                                                          |
| 294 | 0x1    | --gs-kernel-cl                  | kernelVariant                                            |
| 295 | 0x1    | --gs-kernel-cl-up              | kernelVariantUp                                          |
| 296 | 0x301  | --gs-optimize-30fps            |                                                          |
| 297 | 0x101  | --gs-motion-factor              | motion factor                                            |
| 298 | 0x101  | --gs-vert-precision            | pixelshift                                                |
| 299 | 0x301  | --gs-check-trans-rejection      |                                                          |
| 300 | 0x301  | --gs-check-trans-rejection68    |                                                          |
| 301 | 0x301  | --gs-override-small-tri-area    |                                                          |
| 302 | 0x1    | --gs-flush-ad-xyz              | [always,safe,off,0]                                      |
| 303 | 0x1    | --gs-dirty-page-policy          | dirtyPagePolicy                                          |
| 304 | 0x101  | --gs-render-tile-threshold      |                                                          |
| 305 | 0x101  | --gs-opt-frbuff-switch          |                                                          |
| 306 | 0x301  | --gs-uv-shift-pointsampling    |                                                          |
| 307 | 0x301  | --gs-h2l-list-opt              |                                                          |
| 308 | 0x301  | --gs-h2l-accurate-hash          |                                                          |
| 309 | 0x301  | --gs-ignore-rect-correction    |                                                          |
| 310 | 0x301  | --gs-ignore-dirty-page-border  |                                                          |
| 311 | 0x101  | --gs-frontend-opt-mode          |                                                          |
| 312 | 0x301  | --gs-hdr-support                |                                                          |
| 313 | 0x301  | --gs-adaptive-frameskip        |                                                          |
| 314 | 0x4101 | --gs-scanout-offsetx            | relative offset/ignored                                  |
| 315 | 0x4101 | --gs-scanout-offsety            | relative offset/ignored                                  |
| 316 | 0x301  | --gs-skip-dirty-flush-on-mipmap |                                                          |
| 317 | 0x301  | --gs-packed15-fmv-opt          |                                                          |
| 318 | 0x1    | --safe-area-min                | area/float (range 0.9 to 1.0)                            |
| 319 | 0x301  | --lopnor-config                |                                                          |
| 320 | 0x301  | --lua-script                    |                                                          |
| 321 | 0x301  | --lua-debug-api                |                                                          |
| 322 | 0x301  | --lua-use-pcall                |                                                          |
| 323 | 0x301  | --lua-trace-gc                  |                                                          |
| 324 | 0x301  | --lua-trace-fn                  |                                                          |
| 325 | 0x301  | --lua-trace-hooks              |                                                          |
| 326 | 0x301  | --lua-trace-vmsteps            |                                                          |
| 327 | 0x301  | --load-trophy-lua              |                                                          |
| 328 | 0x301  | --load-tooling-lua              |                                                          |
| 329 | 0x301  | --load-feature-lua              |                                                          |
| 330 | 0x301  | --host-trophy-support          |                                                          |
| 330 | 0x301  | --trophy-support                |                                                          |
| 331 | 0x201  | --pcr0-delta-hack              | ratio/float                                              |
| 332 | 0x1    | --app-entitlement              | entitlement/string                                        |
| 333 | 0x301  | --ee-mem-check-eob              |                                                          |
| 334 | 0x1    | --ee-hook                      |                                                          |
| 335 | 0x1    | --iop-hook                      |                                                          |
| 336 | 0x301  | --game-live-streaming          |                                                          |
| 337 | 0x301  | --game-live-streaming-record    |                                                          |
| 338 | 0x301  | --remote-play                  |                                                          |
| 339 | 0x301  | --screenshot                    |                                                          |
| 340 | 0x1    | --screenshot-overlay-image      | filename                                                  |
| 341 | 0x1    | --screenshot-photo-title        | title/string                                              |
| 343 | 0x1    | --screenshot-comment            | string                                                    |
| 344 | 0x301  | --video-recording              |                                                          |
| 345 | 0x1    | --mute-streaming-audio          | [none,all,main,bgm]                                      |
| 346 | 0x301  | --share-play                    |                                                          |
| 347 | 0x1    | --image-disc1                  | filename                                                  |
| 348 | 0x1    | --image-disc2                  | filename                                                  |
| 349 | 0x1    | --image-disc3                  | filename                                                  |
| 350 | 0x1    | --image-disc4                  | filename                                                  |
| 351 | 0x1    | --image-disc5                  | filename                                                  |
| 352 | 0x101  | --max-disc-num                  | [1-5]                                                    |
| 353 | 0x101  | --boot-disc-id                  | [0-4]                                                    |
| 354 | 0x101  | --switch-disc-delay            | frame_count/integer                                      |
| 355 | 0x301  | --switch-disc-reset            |                                                          |
| 356 | 0x1    | --ps2-title-id                  | title_id (ex: SLUS-21059)                                |
| 356 | 0x4001 | --title-id-override            | title_id (ex: SLUS-21059)                                |
| 357 | 0x1    | --ps2-lang                      |                                                          |
| 358 | 0x1    | --savedata-fingerprint          | ps2tc,ps4tc,fingerprint                                  |
| 359 | 0x301  | --pmc-enable                    |                                                          |
| 360 | 0x101  | --pmc-buffer-size              | MB                                                        |
| 361 | 0x1    | --pmc-sample-freq              | Hz                                                        |
| 362 | 0x1    | --pmc-measure-frames            | frames(int)                                              |
|============================================================================================================|
Note: Few commands is accidentally read with = , for example --elf-symbols=. Commands like this possibly expect == to be used. Anyway, good for us all of those cmds are meaningless.
 
===Script===
IDA Script to dump this info, should find all by itself. Should... Tested on jak emu, and rogue emu. Keep in mind that it will dump only to ida output window, to dump it to file you need to modify it by yourself. Script will separate fields by comma. Output will be ID, UNK, COMMMAND, COMMENT. Next commas are eventually from config comment itself. 
import idc
import idaapi
def dump():
    search = "00 2D 3F 00" #\x00 -? x\00
    addr = idaapi.find_binary(0, ida_idaapi.BADADDR, search, 0x10, SEARCH_DOWN)
    addr += 1
    addr = get_first_dref_to(addr)
    addr -= 0x8 # Some emus might need that line commented.
    if addr != BADADDR:
        while 1:
            nr = get_wide_word(addr)
            nr = "%s" % nr
            unk = get_wide_word(addr + 2)
            unk = "%x" % unk
            cfg_str_ptr = get_qword(addr + 8)
            cfg_str    = get_strlit_contents(cfg_str_ptr, -1, STRTYPE_C)
            cfg_str    = cfg_str.decode("ascii")
            cfg_cmt_ptr = get_qword(addr + 16)
            cfg_cmt    = get_strlit_contents(cfg_cmt_ptr, -1, STRTYPE_C)
            cfg_cmt    = cfg_cmt.decode("ascii")
            if cfg_cmt_ptr != 0:
                full_str = nr + ", 0x" + unk + ", " + cfg_str + ", " + cfg_cmt
            else:
                full_str = nr + ", 0x" + unk + ", " + cfg_str
            print(full_str)
            if cfg_str[0:1] != "-":
                print("Finished!")
                break
            addr += 0x18
dump()
==Fatal Fury Modding==
{| class="wikitable"
! Fatal Fury Eboot !!  !!  !!
|-
|  ||  ||  ||
|-
|  || Offset || Value type || Normal value (DEC)
|-
| EE Something (Delta counter?) || 50FE1 || 4 Bytes || 294912000
|-
| EE Clock (Cycle scalar): || 50FE5 || 4 Bytes || 256
|-
| VU1 Jit-sync || 510DE || 1 Byte || 82
|-
| Something || 5105B || 4 Bytes || 10000
|-
| Something || 510C7 & 510D1 || 4 Bytes || 1084227584
|-
| Something bottom || 51163 || 4 Bytes || -8375837
|-
|-
| VU0 something? || 51113 || 4 Bytes || 2635467
| Find out what some of the gs commands do and edit their description ||
|-
|-
| VU0 vf00 || 51109 || 4 Bytes || 2369227
| Implement a EE memory patch for ratchet up your arsenal (Not trivial obviously) ||
|-
|-
| ?? || 5111D || 4 Bytes || 8402
| Fix the two tenchu and harry potter games (eughhh) ||
|-
|-
| Something that affects fmvs || 510F5 || 4 Bytes || 32000
|}
|}
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)