pj64team / Project64-Legacy

Finishing what we started.
79 stars 7 forks source link

Fix virtual address resolution errors in recompiler #67

Closed parasyte closed 1 year ago

parasyte commented 1 year ago

The const evaluation for virtual address loads and stores is sometimes too eager. This bug causes the broken mechanism in the Indiana Jones intro.

The fix is to deoptimize the const evaluation when virtual address resolution fails at compile time. This generates code that evaluates the VAddr at runtime (a deoptimization).

Regenerating the block after it has run successfully just isn't an option right now. It would have to recompile everything, since invalidating only a subset of compiled blocks is not available. This would be a good way to regain the const evaluation optimization, if it were possible.