XenonRecomp icon indicating copy to clipboard operation
XenonRecomp copied to clipboard

Addressing multiple TODO's since no one else did

Open ApfelTeeSaft opened this issue 3 months ago • 0 comments

  1. test_recompiler.cpp:216 - Implement CR register checking

    • Added proper CR register validation that checks all 4 fields (lt, gt, eq, so)
    • Each field is extracted from the 4-bit CR value using bit shifts
  2. recompiler.h:55 - Create RecompileArgs struct

    • Introduced RecompileArgs struct to encapsulate the 7 function parameters
    • Improves code maintainability and reduces function signature complexity
    • Updated function signature and call site accordingly
  3. recompiler.cpp:366 - Add bounds checking for mmioStore

    • Added validation to ensure the next instruction (data + 1) is within function bounds
    • Prevents potential out-of-bounds memory access
  4. recompiler.cpp:1258 - Fix MFOCRF hardcoded CR field

    • Implemented proper FXM field mask decoding to determine which CR field to read
    • Removed hardcoded cr6 and now dynamically selects the correct CR field (cr0-cr7)
    • FXM is decoded as an 8-bit mask where bit 0 (0x80) = cr0, bit 1 (0x40) = cr1, etc.

ApfelTeeSaft avatar Nov 05 '25 07:11 ApfelTeeSaft