Difference between revisions of "Psxfin"
(→Danger: adding breakpoint sign bug) |
(Adding syntax for pSX debugger values.) |
||
Line 61: | Line 61: | ||
** If the trigger was in a [[delay slot]] after a jump or branch, the cursor in the Disassembly window will point to the instruction after the jump/branch, which won't be close to the trigger. | ** If the trigger was in a [[delay slot]] after a jump or branch, the cursor in the Disassembly window will point to the instruction after the jump/branch, which won't be close to the trigger. | ||
* While a breakpoint is active, the immediate value for [[slti]] and [[sltiu]] is not sign-extended.[http://ffhacktics.com/smf/index.php?topic=10616] Normally, all immediate values are sign-extended. | * While a breakpoint is active, the immediate value for [[slti]] and [[sltiu]] is not sign-extended.[http://ffhacktics.com/smf/index.php?topic=10616] Normally, all immediate values are sign-extended. | ||
+ | |||
+ | |||
+ | == Syntax of numerical values == | ||
+ | |||
+ | pSX accepts several syntaxes for entering addresses. | ||
+ | * '''decimal''': Any numerical value will be interpreted as decimal. | ||
+ | *: E.g.: | ||
+ | ** <code>124</code> => 0x7C (= 124) | ||
+ | ** <code>68e142</code> => 0x44 (= 68) | ||
+ | * '''hexadecimal''': Values starting with "0x" will be interpreted as hexadecimal. | ||
+ | *: E.g.: | ||
+ | ** <code>0x7C</code> => 0x7C (= 124) | ||
+ | * '''register''': Any name in the "Registers" subwindow can be used as a value. | ||
+ | *: E.g.: | ||
+ | ** <code>r29</code> | ||
+ | ** <code>pc</code> | ||
+ | ** <code>cop0cr14_epc</code> | ||
+ | * '''spaces''': Ignored. | ||
+ | * '''operators''': The value can be calculated. | ||
+ | ** Arithmetic operators: binary <code>+ - * / %</code> and unary <code>-</code>. Division is truncating (rounds toward 0). | ||
+ | ** Bitwise operators: binary <code>& | ^ << >></code> and unary <code>~</code>. | ||
+ | ** Comparison operators: binary <code>== != < > <= >=</code>. | ||
+ | ** Logical operators: binary <code>&& ||</code> and unary <code>!</code>. Results in 1 for true and 0 for false. | ||
+ | ** Parentheses and square brackets, for grouping: <code>( ) [ ]</code>. | ||
+ | ** Comma operator: When values are separated by commas, only the last value is taken. (This is useless.) | ||
+ | *: E.g.: | ||
+ | ** <code>r29 + (r4 + 0x35)*4</code> | ||
+ | ** <code>(r2==0)*r4 + (r2!=0)*r5 </code> => r4 if r2 is 0 else r5 | ||
+ | ** <code>r29, r5, r3</code> => r3 | ||
+ | * '''dereference operator''': Unknown, but there might be one. | ||
+ | |||
== Cheat Engine == | == Cheat Engine == | ||
− | For psxfin.exe 1.13, the base address of the emulated RAM is at | + | For psxfin.exe 1.13, the base address of the emulated RAM is at <code>[[psxfin.exe+1899BC]+30]</code>. |
[[Category:Emulators]] | [[Category:Emulators]] |
Revision as of 23:26, 18 October 2017
pSX is a Playstation emulator with debugging features and without a plugin system. It is abandonware: the latest version, 1.13, was released in 2007, and its author last posted on its message board in 2009.[1]
The final release's executable is named psxfin.exe
, while earlier unstable versions were named psxrel.exe
.
Contents
Debuggery
To open the debugger and memory tools, go to Debug -> Monitor -> r3000.
Note: All values in pSX's tools are interpreted as decimal by default. Prepend the address with "0x" to make it read hexadecimal. For example, use "0x91AF" instead of "91AF".
- Menu
- File:
- Disassemble: Disassembles a block of code and saves it to a file.
- Save binary: Saves a block of memory to a file.
- Configuration: Change the font of the disassembly window.
- Debug:
- Run (F9): (Only when halted.) Resume normal execution.
- Break: (Only when not halted.) Stop execution and set disassembly cursor to the current instruction.
- Step over (F8): (Only when halted.) Execute current instruction. If it is a call (e.g.
jal
), execute the subroutine. - Step into (F7): (Only when halted.) Execute current instruction. If it is a call, follow the jump and go to the subroutine's first instruction.
- Run to cursor: Run normally until the selected instruction is reached.
- Set next: ?
- Reset: Restart the emulation.
- Exit: Exit the debugger.
- Window: Manage the various debugger subwindows.
- Subwindows
- Call stack:
- Breakpoints: Active breakpoints.
- Registers: Current value of registers. Only updated about every second while emulation is running.
- Disassembly: Current instruction being executed. Not updated while emulation is running.
- Memory: Current values in memory. Only updated about every second while emulation is running.
- GPU:
- CDROM:
- Debugger hotkeys
- Ctrl+G: Goto. Go to specified address. Available in the Memory and Disassembly subwindows.
Breakpoints
pSX can set two kinds of breakpoints:
- Execute: Break when the instruction at this location is executed.
- Memory: Break when an instruction reads/writes/either to this address.
Breakpoint parameters
- Size: (memory breakpoint only) Specifies how many bytes after this address will be watched.
- Condition: Only break if the condition holds true. (?What is the format?)
- Count: Only break after the breakpoint is hit this many times.
Bugs
- For execution breakpoints, pSX changes the instruction to an illegal instruction until it is reached. Do not save a state while an execution breakpoint is active, or else the state will remember the illegal instruction even if there is no breakpoint there. Do not dump assembly or RAM while an execution breakpoint is active, or else it will contain the illegal instruction.
- pSX does not apply breakpoints after loading a state. After loading a state, edit (each of?) your active breakpoints, or they will have no effect.
- Do not close the debugger window while a breakpoint is active, or else pSX will crash. Delete all breakpoints first.
- When triggering a memory breakpoint, pSX will stop AFTER the triggering instruction. This means that the arrow in the Disassembly window will point to the instruction after the trigger.
- If the trigger was in a delay slot after a jump or branch, the cursor in the Disassembly window will point to the instruction after the jump/branch, which won't be close to the trigger.
- While a breakpoint is active, the immediate value for slti and sltiu is not sign-extended.[2] Normally, all immediate values are sign-extended.
Syntax of numerical values
pSX accepts several syntaxes for entering addresses.
- decimal: Any numerical value will be interpreted as decimal.
- E.g.:
124
=> 0x7C (= 124)68e142
=> 0x44 (= 68)
- hexadecimal: Values starting with "0x" will be interpreted as hexadecimal.
- E.g.:
0x7C
=> 0x7C (= 124)
- register: Any name in the "Registers" subwindow can be used as a value.
- E.g.:
r29
pc
cop0cr14_epc
- spaces: Ignored.
- operators: The value can be calculated.
- Arithmetic operators: binary
+ - * / %
and unary-
. Division is truncating (rounds toward 0). - Bitwise operators: binary
& | ^ << >>
and unary~
. - Comparison operators: binary
== != < > <= >=
. - Logical operators: binary
&& ||
and unary!
. Results in 1 for true and 0 for false. - Parentheses and square brackets, for grouping:
( ) [ ]
. - Comma operator: When values are separated by commas, only the last value is taken. (This is useless.)
- E.g.:
r29 + (r4 + 0x35)*4
(r2==0)*r4 + (r2!=0)*r5
=> r4 if r2 is 0 else r5r29, r5, r3
=> r3
- Arithmetic operators: binary
- dereference operator: Unknown, but there might be one.
Cheat Engine
For psxfin.exe 1.13, the base address of the emulated RAM is at [[psxfin.exe+1899BC]+30]
.