marhel / r68k

A m68k emulator in rust - let r68k = musashi.clone();
MIT License
71 stars 7 forks source link

More accurate cycle emulation for DIVS/DIVU needed? #67

Open marhel opened 8 years ago

marhel commented 8 years ago

Decide if a more accurate emulation of cycles taken for DIVS/DIVU operations are needed. For now we just consume a fixed worst-case amount of cycles for DIVS/DIVU, but for example EASy68k uses an algorithm from an old usenet post that uses analysis on the operands to determine the number of cycles taken.

There's also the corresponding EASy68k implementation (note that this is not the official sources, which as far as I can see are only available as a zip through the EASy68k website, but at a glance it's the same implementation)

We need to decide if we care about more precise cycle counts for DIVS/DIVU, versus raw performance (more accurate emulation is slower), and if we do that, how to handle the fact that some Musashi timings then will no longer match (unless we also patch Musashi). Some exception-rule in the QC-tests, perhaps.