mupen64plus / mupen64plus-core

Core module of the Mupen64Plus project
1.29k stars 257 forks source link

Improve 64DD emulation #990

Closed LuigiBlood closed 1 year ago

LuigiBlood commented 1 year ago

This adds two new interrupt handlers for the two different kinds of interrupts the 64DD can issue (MECHA and BM), then introduces delays based on clock speed (and CountPerOp, kinda to make sure), to every command, but especially the Seek command, and then changes the nature of BM interrupts to work with delays instead of working as fast as possible based on DMAs and other hacky reads.

The timing used is very approximate and is trying to be close to real hardware, but is not quite there, a lot more finetuning will be done eventually, but libleo is very tolerant.

This fixes Gnat Attack in Mario Artist Paint Studio prototype, as the game tries to read the next stage data before unloading the current stage, but since the 64DD responds way too quick it replaces the data before it actually unloads it and crashes.

LuigiBlood commented 1 year ago

So since then I decided to provide more improvements to 64DD here's a gist of the changes:

LuigiBlood commented 1 year ago

I'll implement disk motor management next as it seems I did a bit of a regression in the process about Gnat Attack which just crashes the emulator again. This would fix it in a definitive manner.

LuigiBlood commented 1 year ago

The only change left for this is how many ticks is truly a second on mupen so I can properly manage that, perhaps..?

richard42 commented 1 year ago

are you ready to merge this or is it WIP?

LuigiBlood commented 1 year ago

Yes this is usable I believe.