Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Allow to compile with LIGHTREC_DEBUG=1, which will set Lightrec's log level to debug mode, enable its built-in PSX code disassembler, the JIT disassembler, and enable support for the "big-ass debugger".
The latter will run the standalone build of PCSX in parallel with Lightrec's interpreter vs. its dynarec, and periodically compare their behaviour.
By default, the emulator will print a checksum of the registers after each exit point. When a mismatch is found, it is advised to re-start the debugging setting the LIGHTREC_VERY_DEBUG=1 environment variable, and to set the LIGHTREC_BEGIN_CYCLES environment variable to the cycle value of the last known state. When the "very debug" mode is used, the interpreter and dynarec will exit after each single block, and the emulator will compute a checksum of the whole RAM and scratchpad and print all registers. This two-level debugging allows to find a mismatch point very fast, and then fine-tune until the exact breaking point is found.
This is porting some code from my old pcsx_rearmed fork, which is just way too old to allow me to debug anything anymore. While it does not necesarily need to be in upstream pcsx_rearmed, it would make my life easier.